20227 Commits

Author SHA1 Message Date
jbibik
5a318deb40 Downgrade kotlin plugin version to 1.9.0
Earlier upgrade in 276e0655f4 was too high, since Android Studio Iguana is still bundled with Kotlin plugin with version `232-1.9.0-release-358-AS10227`. The result of the mismatched plugin is a build failure like:

`Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is XXX`

Although according to https://plugins.jetbrains.com/plugin/6954-kotlin, the 1.9.23 is already available. So we will be able to upgrade again soon.

Version 1.9.0 is still good enough for the compose compiler to be 1.5.0+ according to https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility

PiperOrigin-RevId: 619278402
2024-03-26 12:43:44 -07:00
huangdarwin
24e1796c50 Effect: Improve setEnableColorTransfers javadoc.
PiperOrigin-RevId: 619250163
2024-03-26 11:15:34 -07:00
ibaker
7a105e0e57 Fix XingSeeker @param tags - follow-up to 4fde35c9cc
PiperOrigin-RevId: 619249887
2024-03-26 11:11:58 -07:00
tianyifeng
8f2f3bb7e4 Allow target preload status to be null to indicate not to preload
PiperOrigin-RevId: 619246259
2024-03-26 11:03:10 -07:00
kimvde
98dac54816 Fix negative position for clipped media
With this CL:
- The large timestamp offset added by ExoPlayer so that decoders
don't see any negative timestamps is removed before passing the
timestamp to the AudioGraph.
- Clipped media timestamps are offset by the clipping start position
before being passed to the AudioGraph.
- The offset added to the audio buffer timestamps is removed when
computing the audio sink position, to convert them back to the
timestamps passed by the player.

PiperOrigin-RevId: 619225990
2024-03-26 10:05:11 -07:00
sheenachhabra
8d65b75185 Rename setFragmentedMp4Enabled to setOutputFragmentedMp4
PiperOrigin-RevId: 619216854
2024-03-26 09:34:23 -07:00
sheenachhabra
8eb1390f80 Create FragmentedMp4Muxer class
This CL aims to separate Fragmented MP4 related logic in a separate public class.
Earlier all the logic was in a single class `Mp4Muxer`.

PiperOrigin-RevId: 619206661
2024-03-26 09:02:43 -07:00
tonihei
737bf08314 Don't apply performance point workaround from API 35
The workaround check is now part of CTS and we should be able
to rely on the PerformancePoints values (or at least can be sure
that they cover all CDD requirements)

#minor-release

PiperOrigin-RevId: 619201331
2024-03-26 08:42:49 -07:00
tofunmi
f4fefd19f7 Document and test multi asset ultraHDR support
PiperOrigin-RevId: 619200688
2024-03-26 08:39:44 -07:00
ibaker
d00ca1e343 Plumb MP3 average bitrate from metadata frames into Format
Issue: androidx/media#1081

#minor-release

PiperOrigin-RevId: 619185083
2024-03-26 07:40:08 -07:00
tonihei
6e0f8e3b0d Remove decode-only flag
No known component is using this flag anymore and it has been
deprecated for a while for custom renderers and decoders.

PiperOrigin-RevId: 619154299
2024-03-26 05:28:27 -07:00
tofunmi
ef2314c404 Move bitmap decoding out of datasource util
PiperOrigin-RevId: 619139208
2024-03-26 04:10:38 -07:00
tofunmi
65e94480f4 Transformer: add single-asset ultraHDR image to HLG HDR vid transcoding
PiperOrigin-RevId: 619138202
2024-03-26 04:06:41 -07:00
tonihei
0f42dd4752 Use output start time instead of deprecated isDecodeOnly in CeaDecoder
PiperOrigin-RevId: 619133908
2024-03-26 03:47:18 -07:00
andrewlewis
c3c964627f Log internal Transformer lifecycle for debugging
Add logging similar to `ExoPlayerImpl` to make bug reports more useful.

PiperOrigin-RevId: 619117500
2024-03-26 02:31:31 -07:00
ibaker
6cb25119fb In-line versions only used by exoplayer-media2 extension
Also remove an unused `androidxTestServicesStorageVersion` version.

Issue: androidx/media#1216
PiperOrigin-RevId: 618990983
2024-03-25 16:21:29 -07:00
sheenachhabra
2eaece5ed9 Move setMaxDelayBetweenSamplesMs on Transformer builder
This property is transformer specific and does not belong to
muxer interface.
This is to eventually replace muxer interface in Transformer module with
muxer interface in Muxer module.

PiperOrigin-RevId: 618895836
2024-03-25 11:02:15 -07:00
Googler
f4e444bdd2 Internal change
PiperOrigin-RevId: 618879473
2024-03-25 10:12:34 -07:00
tonihei
ab0391167c Include nullness of MediaMetadata.extras in equals method
This ensures MediaMetadata with just non-null extras is not
considered equal to MediaMetadata.EMPTY. This makes sure the
contents are bundled when a controller sets the extras in a
new MediaItem

Issue: androidx/media#1176

#minor-release

PiperOrigin-RevId: 618876642
2024-03-25 10:05:15 -07:00
ibaker
fd268eed46 Remove unecessary re-setting of group from session Gradle files
These TODOs precede <unknown commit> when the group was set in the top-level
`build.gradle` file.

Issue: androidx/media#1215
PiperOrigin-RevId: 618835040
2024-03-25 07:33:05 -07:00
ibaker
d997ba367c Rollback of 7cffae9cd0
PiperOrigin-RevId: 618799275
2024-03-25 04:30:55 -07:00
Copybara-Service
c352e2c7b8 Merge pull request #1213 from MGaetan89:update_guava
PiperOrigin-RevId: 618797532
2024-03-25 04:21:53 -07:00
sheenachhabra
483d2bb9e7 Add Muxer interface in muxer module
The immediate plan is to replace `Transformer Muxer interface`
with this one.
It was not straight forward to move/change `Transformer Muxer interface`
hence this intermediate step.
The follow up CL will also remove fragmented MP4 related code from
`Mp4Muxer` and move it into `FragmentedMp4Muxer implements Muxer`.

PiperOrigin-RevId: 618789265
2024-03-25 03:40:15 -07:00
Gaëtan Muller
d66a3032c1 Update Guava to 33.0.0-android
Following the recommendation in `constants.gradle`:
d13a0f4ec6/constants.gradle (L29-L31)

This PR updates Guava to the version used in the Android repository: 33.0.0.

The changelog for Guava 33.0.0 is available [here](https://github.com/google/guava/releases/tag/v33.0.0).
2024-03-22 16:14:41 +00:00
huangdarwin
d165af9a85 Test: Use AssumptionViolatedException for format support detection.
This is the most widely-used test-skipping method I'm aware of, so I figured this
would be a great method to scale usage of AssumptionViolatedException.

PiperOrigin-RevId: 618160931
2024-03-22 06:41:18 -07:00
sheenachhabra
16aac07bce Add support for processing 3 byte NAL start code in Mp4Muxer
Issue: androidx/media#725

Ideally the test to transmux a `ts` file (having 3 bytes NAL start code)
should go into `Mp4MuxerEndToEndTest`but `Mp4MuxerEndToEndTest` uses `MediaExtractor` and `MediaExtractor` is returning samples with `4 byte NAL start code` which will not exercise the newly added code path.
Hence the test is added in `TransformerWithInAppMuxerEndToEndTest` which
internally uses `media3 extractor` and feeds samples with `3 bytes NAL start code`
only.

PiperOrigin-RevId: 617985866
2024-03-21 15:49:12 -07:00
kimvde
6fc4f0263f Add methods required for seek to AudioGraph
Seeking will consist of the following steps:
- Block the AudioGraph input data.
- Flush the AudioGraph.
- Seek the ExoPlayers.
- Unblock the AudioGraph input data.

PiperOrigin-RevId: 617868124
2024-03-21 09:31:51 -07:00
tonihei
ed505df2ca Partial revert of 3a7d31a599
The original change did not set the color info in the codec
for standard SDR infos. This was meant to help with consistency
to avoid a situation where the information is partially set and
later the bitstream provides slightly different values (all in
standard SDR though).

We can revert this part because the bitstream may change anyway
and the decoder needs to handle this internally. And more
importantly, it also avoids removing this information when encoding
the format again in Transformer.

PiperOrigin-RevId: 617582066
2024-03-20 11:51:25 -07:00
sheenachhabra
2491dd07e1 Process all samples before writing them to mdat
This refactoring is required to support 3 byte NAL start code, in which
the sample ByteBuffer might change after AnnexB to Avcc conversion.
This would required changes in the corresponding BufferInfo as well.

PiperOrigin-RevId: 617538338
2024-03-20 09:33:10 -07:00
jbibik
276e0655f4 Upgrade Kotlin version to 1.9.22
This will allow us to use the latest Compose complier version (from https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility) for the future Compose Demo.

PiperOrigin-RevId: 617509694
2024-03-20 07:44:52 -07:00
tonihei
3a7d31a599 Don't set codec color info for default SDR
Some media can read color info values from the bitstream
and may partially set some of the SDR default values in
Format.ColorInfo. Setting these default values for SDR can
confuse some codecs and may also prevent adaptive ABR
switches if not all ColorInfo values are set in exactly the
same way.

We can avoid any influence of HDR color info handling by
disabling setting the color info MediaFormat keys for SDR
video and also avoid codec reset at format changes if both
formats are SDR with slightly different ColorInfo settings.

To identify "SDR" ColorInfo instances, we need to do some
fuzzy matching as many of the default values are assumed to
match the SDR profile even if not set.

Issue: androidx/media#1158
PiperOrigin-RevId: 617473937
2024-03-20 04:58:13 -07:00
sheenachhabra
3272ad50f3 Skip AnnexB to Avcc conversion for AV1 video format
The AV1 video stream does not contain NAL unit which is a concept
specific to H.264/H.265.
This was not caught before muxer does an in place replacement of
`NAL start code` with `NAL length`. In the absence of `NAL start code`
it was automatically a no-op.

PiperOrigin-RevId: 617193317
2024-03-19 09:18:44 -07:00
sheenachhabra
e14156aa3b Rename test classes having duplicate names
PiperOrigin-RevId: 616887534
2024-03-18 11:16:48 -07:00
huangdarwin
33a87a451c Test: Remove EnsuresNonNull from media3 editing tests.
nullness checks were removed a while ago from editing, so no need for them now.

Bit neater to have less code to parse too.

Also, removes RequiresNonNull

PiperOrigin-RevId: 616887502
2024-03-18 11:13:10 -07:00
huangdarwin
d2dc901b6a Test: Fix failing HDR sequence test by swapping assumption.
Oops, missed this one in 1adb2b270d

PiperOrigin-RevId: 616871770
2024-03-18 10:28:47 -07:00
huangdarwin
e446f20a70 Test: Remove nullness for testid
This also makes it more consistent with newer testId tests that don't have nullness, so tests don't look inconsistent, and was pretty easy to do :P

PiperOrigin-RevId: 616856888
2024-03-18 09:47:12 -07:00
huangdarwin
1adb2b270d Test: Fix failing HdrEditingTest by swapping assumption.
This was broken by 2fa38d15dd, which added an assumes
method, but missed the `!` operator for the tests where HDR is
unsupported. Add an assumes method that assumes a lack of support
for HDR.

Tested on the failing device (Pixel 7) and confirmed this fixes
the test on that device, to throw AssumptionViolatedException
instead of allowing test logic to run after failing the
assumption.

PiperOrigin-RevId: 616846588
2024-03-18 09:12:33 -07:00
huangdarwin
4c85a04d07 Test: Use AssumptionViolatedException for OpenGL Tone-map support.
PiperOrigin-RevId: 616827385
2024-03-18 08:00:02 -07:00
huangdarwin
0731b07954 Test: Use format arg for assumeDeviceSupportsHdrEditing.
PiperOrigin-RevId: 616825970
2024-03-18 07:53:23 -07:00
huangdarwin
2fa38d15dd Test: Use AssumptionViolatedException for HDR capability check.
Also, use a common util method

PiperOrigin-RevId: 616815502
2024-03-18 07:06:17 -07:00
claincly
e8612a0c02 Add warning log if no output is set
PiperOrigin-RevId: 616796787
2024-03-18 05:33:17 -07:00
tianyifeng
2c8d07c2dd Inform DefaultPreloadManager when player uses PreloadMediaSource
Add a new method `onUsedByPlayer(PreloadMediaSource)` for `PreloadMediaSource.PreloadControl`, which will be invoked when the player starts to use the `PreloadMediaSource`, or calling `PreloadMediaSource.preload` while the player is already using that source. `DefaultPreloadManager` will immediately preload the next source when receiving `onUsedByPlayer` event.

PiperOrigin-RevId: 616789121
2024-03-18 04:54:49 -07:00
tonihei
87f4a3ca71 Add some clarifications around CommandButton.iconUri to Javadoc
PiperOrigin-RevId: 616775044
2024-03-18 03:43:36 -07:00
huangdarwin
cbc654a721 GL: Use GLES20.GL_FALSE and GL_TRUE instead of hardcoded value.
PiperOrigin-RevId: 616759833
2024-03-18 02:35:55 -07:00
tofunmi
d269b93755 Transformer: Take effects into account when signalling duration
PiperOrigin-RevId: 616224079
2024-03-15 13:21:12 -07:00
huangdarwin
3136deb9b3 Test: Remove extraneous testIds.
PiperOrigin-RevId: 616213378
2024-03-15 12:39:43 -07:00
tofunmi
4d1ede5432 Ultra HDR: release texture after use
PiperOrigin-RevId: 616209205
2024-03-15 12:23:45 -07:00
tofunmi
fe640da5e8 Transformer: add speedChange API
PiperOrigin-RevId: 616163061
2024-03-15 10:02:37 -07:00
tofunmi
762065fae0 Add api to find duration after an effect is applied
PiperOrigin-RevId: 616157067
2024-03-15 09:41:40 -07:00
Googler
415d779c62 Explicitly check that AudioGraph input is PCM 16
AudioGraph implicitly assumes that input will be PCM 16 bit, and not float.
Make the check explicit.

PiperOrigin-RevId: 616149131
2024-03-15 09:14:04 -07:00