20289 Commits

Author SHA1 Message Date
tofunmi
caf584152d Add release notes for recent transformer features
PiperOrigin-RevId: 606565385
2024-02-13 12:23:50 +00:00
Ian Baker
1bf3101269 Remove V19 from AudioTimestampPoller.AudioTimestampV19 2024-02-13 10:26:20 +00:00
Ian Baker
205c8734cc In-line more V19 methods in TrackSelectionParameters, AudioTimestampPoller and CaptionStyleCompat 2024-02-13 10:26:20 +00:00
Ian Baker
c4d9df970c Format with google-java-format 2024-02-13 10:26:20 +00:00
Ian Baker
c0c1c315c5 In-line GlUtil.Api18 and VideoFrameReleaseHelper.DisplayHelperV16/17
Also put back a comment in DownloadTracker that is still relevant on API 19.

Also deprecate PlaceholderSurface.newInstanceV17() in favour of just
newInstance()
2024-02-13 10:26:20 +00:00
Gaëtan Muller
d327cb4795 Code cleanup 2024-02-13 10:26:20 +00:00
Gaëtan Muller
e1ba75c871 Remove some API-dependant classes 2024-02-13 10:26:20 +00:00
Gaëtan Muller
08ab18be77 Remove unnecessary TargetApi annotation 2024-02-13 10:26:20 +00:00
Gaëtan Muller
963e517a5a Remove unnecessary RequiresApi annotation 2024-02-13 10:26:19 +00:00
Gaëtan Muller
973b717914 Remove unnecessary SDK_INT checks 2024-02-13 10:26:19 +00:00
tianyifeng
2b473831c6 Implement onInit() and onRelease() in FakeRenderer
PiperOrigin-RevId: 606301390
2024-02-12 10:57:14 -08:00
claincly
216f3fedb8 Loosen the requirement to register every input frame
VideoFrameProcessor requires every input frame to be registered before they are
rendered to its input Surface. This CL adds the option to register the input
frame only once. This is useful for camera inputs where not all input frames
come with changing FrameInfo.

PiperOrigin-RevId: 606294894
2024-02-12 10:38:42 -08:00
huangdarwin
69f651a40d HDR: Use better color test.
Our previous test video was difficult to use for testing our tone-mapping
algorithm, because it didn't have many different colors. Use a better
video for tone-map tests, by having one with more different colors

PiperOrigin-RevId: 606274843
2024-02-12 09:31:02 -08:00
huangdarwin
2594691950 Clarify speedchange javadoc to mention duration.
The speed is that value only until the next one

PiperOrigin-RevId: 606258937
2024-02-12 08:25:39 -08:00
tofunmi
1a5eb4eecd Support segment-specific speed changes in SpeedChangeEffect
PiperOrigin-RevId: 606204479
2024-02-12 04:03:23 -08:00
michaelkatz
0b0c419c73 Fallback to including track language name if display name is not found
Issue: androidx/media#988
PiperOrigin-RevId: 606193299
2024-02-12 03:07:36 -08:00
tonihei
adc23e8e8b Add icon constants to CommandButton
These allow to set the icon in a standardized way without needing
custom bitmaps or resources. For now, this is just additional
information without backwards-compatible icons or implications.

The same value gets written to the platform session via a new
extras key that can be read and set from sessions not using Media3
yet.

PiperOrigin-RevId: 605670988
2024-02-09 10:37:12 -08:00
ibaker
338aef4830 Fix transformer, effect, muxer and container API dependencies
The public APIs of these modules reference symbols in some of their
dependencies, so these should be API dependencies, not implementation:
> An API dependency is one that contains at least one type that is
> exposed in the library binary interface, often referred to as its ABI
> (Application Binary Interface).

https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_recognizing_dependencies

Transformer also uses symbols from `lib-common`, but these are already
an API dep of `lib-exoplayer` so no need to duplicate that here.

PiperOrigin-RevId: 605660621
2024-02-09 10:05:54 -08:00
huangdarwin
73c9753229 HDR: Update constant name for clarity.
This matrix converts from BT2020 in RGB, not to XYZ in BT2020,
so put "bt2020" nearer to RGB.

PiperOrigin-RevId: 605654773
2024-02-09 09:45:16 -08:00
sheenachhabra
69c555be0a Move retrieveTrackFormat() method to TestUtil
TestUtil class is more appropriate for the given method.
In the next CL, the only method in FileUtil.java will be moved back
into transformer library and the FileUtil class will be removed.

PiperOrigin-RevId: 605648034
2024-02-09 09:18:14 -08:00
sheenachhabra
8a758c2ed7 Replace setModificationTime API with setTimestampData in Mp4Muxer
The new API will take both `creation time` and `modification time`.

Till now, Mp4Muxer wrote `modification time` in both
`creation time` and `modification time` field, which was
incorrect.

PiperOrigin-RevId: 605590623
2024-02-09 04:15:53 -08:00
sheenachhabra
a31a384393 Version bump to media3:1.3.0-rc01
#minor-release

PiperOrigin-RevId: 605573991
2024-02-09 02:44:25 -08:00
sheenachhabra
c4605b3c90 Update release notes for media3:1.3.0-rc01
#minor-release

PiperOrigin-RevId: 605561427
2024-02-09 01:40:25 -08:00
huangdarwin
a5e47982f4 HDR: Add color-space conversion for PQ tone-map.
Previously, we missed the BT2020->BT709 color-space conversion.

A user-visible impact of this is that red and green channels used to be
undersaturated, but now are more correctly saturated.

PiperOrigin-RevId: 605411926
2024-02-08 13:33:52 -08:00
tianyifeng
9b0cdde7d2 Report the skipped silence more deterministically
Issue: androidx/media#1035
#minor-release
PiperOrigin-RevId: 605361126
2024-02-08 10:40:40 -08:00
tonihei
e56e27e725 Move release note to the right section
#minor-release

PiperOrigin-RevId: 605310711
2024-02-08 07:31:57 -08:00
tofunmi
4d29d8f012 DefaultAssetLoaderFactory: Simplify file extension retrival
Change the file extension retrieval back to how it was before 5488d33da8 to reduce the change of false negatives in `isImage()`

PiperOrigin-RevId: 605281186
2024-02-08 05:01:03 -08:00
ibaker
3a7a665d5d Rollback of 406c0a15be
PiperOrigin-RevId: 605015994
2024-02-07 09:56:59 -08:00
ibaker
7ebfed505c Stop double-encoding CMCD query parameters
`Uri.appendQueryParameter` is documented to encode its arguments, so
calling `Uri.encode` beforehand results in double-encoding.

Issue: androidx/media#1075

#minor-release

PiperOrigin-RevId: 604995441
2024-02-07 08:44:33 -08:00
tonihei
5f9c96ab53 Set correct track id when skipping empty tracks in Mp4Extractor
The track id must be the index in the list of published tracks
as it's used as such elsewhere. This is currently not true if we
skip an empty track as all subsequent tracks get a wrong or even
invalid id.

#minor-release

PiperOrigin-RevId: 604929178
2024-02-07 03:39:59 -08:00
tofunmi
2cb9d9b383 Export: Add methods to determine the conversion process of a track
PiperOrigin-RevId: 604754827
2024-02-06 13:58:14 -08:00
bachinger
138532e3fd Fix the regex used for validating custom CMCD key names
Relax the regex to only check for hyphen which is required by the specification.

Issue: androidx/media#1028
#minor-release
PiperOrigin-RevId: 604719300
2024-02-06 11:59:20 -08:00
tianyifeng
ccd603acb0 Improve AudioCapabilities with AudioManager API in Android 13
PiperOrigin-RevId: 604700601
2024-02-06 11:57:09 -08:00
sheenachhabra
20053dcdc6 Test output file's metadata using MetadataRetriever
Earlier implementation compared the whole file against a golden
data. The new implementation compares only the metadata being tested.
This will avoid updating the golden data when any unrelated change
(unrelated to scenario being tested) is made.

Added a separate test to compare the whole output file against a golden data.

PiperOrigin-RevId: 604692985
2024-02-06 10:36:47 -08:00
ibaker
7ae3d69e00 JpegMotionPhotoExtractor: Don't emit an image track with no metadata
The current implementation of `JpegMotionPhotoExtractor.sniff` returns
`true` for any image with Exif data (not just motion photos). Improving
this is tracked by b/324033919. In the meantime, when we 'extract' a
non-motion photo with `JpegMotionPhotoExtractor`, the result is
currently a single empty image track and no video track (since there's
no video, since this isn't a motion photo). This 'empty' image track
is usually used to transmit metadata about the video parts of the
image file (in the form of `MotionPhotoMetadata`), but this metadata is
also (understandably) absent for non-motion photos. Therefore there's
no need to emit this image track at all, and it's clearer to emit no
tracks at all when extracting a non-motion photo using
`JpegMotionPhotoExtractor`.

This change also removes a `TODO` that is misplaced, since there's no
image bytes being emitted here (and never was).

PiperOrigin-RevId: 604688053
2024-02-06 10:22:18 -08:00
samrobinson
c768e60bf2 Clearer testing of isEnded state of AudioGraphInput.
PiperOrigin-RevId: 604680924
2024-02-06 10:00:24 -08:00
ibaker
eabba49610 Check sampleMimeType rather than containerMimeType for images
These are often the same for image tracks, since we usually drop the
whole image file (both the container and actual encoded image bytes)
into a single sample, but there are cases where we emit a track with
`containerMimeType=image/jpeg` but **no** samples (from
`JpegMotionPhotoExtractor`, to carry some metadata about the image +
video byte offsets).

It's therefore more correct to implement the `supportsFormat` check
based on `sampleMimeType`, so that these 'empty' image tracks are not
considered 'supported' by `ImageRenderer`.

#minor-release

PiperOrigin-RevId: 604672331
2024-02-06 09:31:37 -08:00
bachinger
c2273345c5 Add constructor that takes only a Context
#minor-release

PiperOrigin-RevId: 604659845
2024-02-06 08:47:03 -08:00
tonihei
f8f6d80477 Add source prefix to MergingMediaPeriod Format ids
This was already done for the TrackGroup ids in <unknown commit>,
but in some scenarios only the Format instances are known and
it's helpful to be able to identify where they came from.

Issue: androidx/media#883

#minor-release

PiperOrigin-RevId: 604644039
2024-02-06 07:45:42 -08:00
tonihei
766a15a51e Include nullness of RequestMetadata.extras in equals method
This ensures RequestMetadata with just non-null extras is not
considered equal to RequestMetadata.EMPTY. This makes sure the
contents are bundled when a controller sets the extras in a
new MediaItem.

PiperOrigin-RevId: 604632788
2024-02-06 06:58:51 -08:00
ibaker
db74bb9609 Clearly define the consistency requirements for SequenceableLoader
Add a test for this consistency in `CompositeSequenceableLoaderTest`,
and also make the
`CompositeSequenceableLoaderTest.FakeSequenceableLoader` implementation
more realistic.

#minor-release

PiperOrigin-RevId: 604604103
2024-02-06 04:25:14 -08:00
andrewlewis
e683b9a506 Expand encoding operating rate workaround
PiperOrigin-RevId: 604602441
2024-02-06 04:15:49 -08:00
Googler
718cf1299b Fix Kotlin 2.0 compilation error in session demo app
Since Kotlin 2.0 the compiler became better at detecting incorrect
annotation applications. The @OptIn annotation can't be applied to an
expression, so when compiling with Kotlin 2.0 it results in an error.

PiperOrigin-RevId: 604596657
2024-02-06 03:47:20 -08:00
ibaker
25498b151b Merge Cea608Parser back into Cea608Decoder
This reverses 27caeb8038

Due to the re-ordering of packets done in `CeaDecoder`, there's no way
to use the current implementation to correctly parse these subtitle
formats during extraction (the `SubtitleParser` interface), so we have
to keep the `SubtitleDecoder` implementations.

#minor-release

PiperOrigin-RevId: 604594837
2024-02-06 03:36:23 -08:00
ibaker
51b4fa2cc8 Merge Cea708Parser back into Cea708Decoder
This reverses 94e45eb4ad

Due to the re-ordering of packets done in `CeaDecoder`, there's no way
to use the current implementation to correctly parse these subtitle
formats during extraction (the `SubtitleParser` interface), so we have
to keep the `SubtitleDecoder` implementations.

#minor-release

PiperOrigin-RevId: 604350951
2024-02-05 10:03:32 -08:00
huangdarwin
e4145a9953 Update javadoc to be the right DrawableOverlay class.
PiperOrigin-RevId: 604337168
2024-02-05 09:13:40 -08:00
tofunmi
4da576f05f Support transmux when both no op effects and regular rotations are set
PiperOrigin-RevId: 604319412
2024-02-05 08:05:32 -08:00
samrobinson
f8352580cb Add AudioGraphInput tests around getOutput behaviour.
PiperOrigin-RevId: 604297126
2024-02-05 06:18:46 -08:00
tofunmi
49c6d25106 Move setting the muxerWrapper rotation out of shouldTranscodeVideo()
Before supporting transmuxing when both no op effects and regular rotations are set, move setting the muxerWrapper rotation out of shouldTranscodeVideo() to ensure the muxerWrapper rotation is only set at the appropriate times.

This cl also ensures the state between the muxerWrapper and the list of video effects is consistent by clearing the list of videoEffects in trim optimization. If trim optimisation is being applied, then EditedMediItem.effects.videoEffects only contains no-op effects or regular rotations that get be applied in the muxer wrapper. Therefore, we should clear the list of video effects to ensure that no effect gets applied twice.

PiperOrigin-RevId: 604292052
2024-02-05 05:54:11 -08:00
samrobinson
029071a342 Improve checks around AudioGraphInput configuring with requested format
Also adds extra AudioGraphInputTest cases.

PiperOrigin-RevId: 603690041
2024-02-02 08:13:54 -08:00