Skip to content

Merge latest code from upstream main branch#24

Merged
ybai001 merged 621 commits intoDolbyLaboratories:dlb/dv-profile10/devfrom
androidx:main
Oct 9, 2025
Merged

Merge latest code from upstream main branch#24
ybai001 merged 621 commits intoDolbyLaboratories:dlb/dv-profile10/devfrom
androidx:main

Conversation

@ybai001
Copy link
Copy Markdown

@ybai001 ybai001 commented Oct 9, 2025

No description provided.

rohitjoins and others added 30 commits August 29, 2025 02:16
Updates `Util.getAudioTrackChannelConfig` to support a 13-channel configuration, utilizing new channel masks introduced in API level 32.

This is necessary to handle the output from certain on-device decoders, such as the Sony MPEG-H decoder for 360 Reality Audio, which outputs a 13-channel float PCM stream. Without this, attempts to configure the AudioTrack fail with an `Invalid output channel config`.

PiperOrigin-RevId: 800809455
This is significantly faster than `SparseBooleanArray` (at a trade-off
of slightly increased memory consumption, but in a robolectric test
this isn't a significant concern).

The partial read arrays need to be able to grow to arbitrary lengths,
but the read error arrays only have to be one larger than the
underlying data.

PiperOrigin-RevId: 800847593
These masks are being added preemptively to avoid potential playback issues for audio streams that utilize these layouts.

PiperOrigin-RevId: 800879726
PiperOrigin-RevId: 800910489
CompositionPlayer only allows speed changing on `EditedMediaItem`
instances. The effects must be created using
`Effects#createExperimentalSpeedChangingEffect()` and must be placed as
the first effect of their corresponding effects pipeline.

Eventually, we will move away from effects-based speed adjustment in
`CompositionPlayer` and migrate towards a purpose-built API.

PiperOrigin-RevId: 800918844
Add NextButton and PreviousButton Composables to it.

-------

This module will be used for UI components built with Jetpack Compose using Material3 theming:

`implementation("androidx.media3:media3-ui-compose-material3:1.X.Y")`

The components from the compose demo app will be housed in the new module instead of `media3-ui-compose` which will remain free of `material3` depedency. That module provides more foundational components (like a Surface or higher-level Composables with Slots) that don't require UI decisions and as much customization. This module, on the other hand, has very opinionated UI, although we provide as much of a customisable API surface as possible.

PiperOrigin-RevId: 800950767
Previously, `Boxes.java` generated `Vorbis CSD` without including the comment header, which was treated as empty. While this did not cause issues for `Mp4Extractor`, `MatroskaExtractor` failed to parse such CSD, leading to an "Error parsing vorbis codec private".

This change updates the CSD generation to include the comment header in the `Vorbis CodecPrivate`, as required by the [Matroska documentation](https://www.matroska.org/technical/codec_specs.html#:~:text=Initialization%3A%20none-,A_VORBIS,-Codec%20ID%3A%20A_VORBIS). This resolves the parsing error encountered by MatroskaExtractor.

PiperOrigin-RevId: 801719645
This makes the player behave more like a realistic `Player`
implementation, which transitions into `BUFFERING` when `prepare()`
or a seek operation is called, and then transitions to `READY`
automatically after a delay. The delay defaults to 100ms, but is
customizable in a constructor parameter.

Previous to this change, a `prepare()` or seek operation would make
this player permanently enter `BUFFERING` state.

This removes the two cases in the codebase that needed to subclass
`TestSimpleBasePlayer` in order to make a seek transition directly to
`READY` instead of `BUFFERING`, and so it makes `TestSimpleBasePlayer`
final which will make it easier to evolve the API in future.

PiperOrigin-RevId: 801756056
The method is currently using the background condition check
which sends a lot of messages to check the condition. When
waiting for a slightly longer playback, this considerably slows
down the test. As we are talking about a playback position,
we can make sure to trigger a main thread message just after
reaching the position to trigger the condition.

PiperOrigin-RevId: 801776840
The tests are converted to the more fluent test setup using
the advance(player).until... methods. This prevents newly
introduced flakiness by a future change that checks for
playback stuck playing without ending.

PiperOrigin-RevId: 801777540
Issue: #2750

#cherrypick

PiperOrigin-RevId: 801793222
Many devices do not respect KEY_COLOR_STANDARD

PiperOrigin-RevId: 801809546
This detects issues where the player is stuck in a state with
an advancing clock (e.g. stand-alone clock or interpolated
clock). We can only detect something is wrong once the playback
position exceeds the declared duration by an unreasonable amount
of time. The default is 1 minute to account for some expected
cases where the position exceeds the duration (e.g. inaccurate
MP3 position estimation or inaccurate duration metadata in file)

PiperOrigin-RevId: 801849124
Currently `CompositionPlayerInternal.release()` blocks the calling thread
indefinitely which causes the app to ANR.

Adding a timeout (same as ExoPlayer's default) to CompositionPlayer release.

PiperOrigin-RevId: 801854313
The default 2-item playlist was removed win dda03f7.

I think the default values are visible in API docs, so don't need to
be duplicated in the hand-written docs.

PiperOrigin-RevId: 802065391
The `MuxerOutputFactory` interface is unnecessary as muxer
does not intent to get multiple `SeekableMuxerOutput`.

PiperOrigin-RevId: 802089369
PiperOrigin-RevId: 802093144
This CL also updates extractor to allow extracting
a motion photo containing quick time video.

Verified output by uploading it to photos web portal.

PiperOrigin-RevId: 802093235
PiperOrigin-RevId: 802375720
Transformer applies its own higher level watchdog timeouts.

PiperOrigin-RevId: 802484938
`©mvc` is not included, because it needs to be merged into a single
`MVIN` ID3 frame with `©mvi` (separated by a slash), which is tricky
within the existing code structure of `MetadataUtil`.

The `sample_with_metadata.mp4` file was augmented with this command:

```
$ exiftool \
    -MovementName="foo" \
    -MovementCount=3 \
    -MovementNumber=2 \
    sample_with_metadata.mp4
```

Issue: #2754
PiperOrigin-RevId: 802515577
This change establishes the new `:media3-inspector` module as the dedicated home for media inspection utilities.

A new `androidx.media3.inspector.MetadataRetriever` is introduced, which will house APIs for both metadata and frame extraction. This new retriever utilizes the existing `MetadataRetrieverInternal` implementation for metadata-related methods.

The `androidx.media3.exoplayer.MetadataRetriever` is now deprecated in favor of this new, unified `MetadataRetriever` in the `:inspector` module.

The tests for the new `inspector.MetadataRetriever` are copied from the existing `exoplayer.MetadataRetrieverTest`. This is a temporary measure to ensure behavioral consistency during the transition. The deprecated `exoplayer.MetadataRetriever` and its tests will be removed soon. Other options, like parameterized tests, were considered too burdensome for this transitional period.

PiperOrigin-RevId: 802540666
This change promotes the Lottie overlay components from the demo app into the main effect library, making them available for general use.

PiperOrigin-RevId: 802552280
It's quite common to need all entries of a particular sub-type, or
that match a predicate (or the first match), so this change introduces
this functionality on `Metadata` and tries to use it throughout the library.

The one place that does `instanceof` checks that I left intact is where
the index is used here:
https://github.com/androidx/media/blob/4c6d778a6b9af5481aeb9dc3eb1fec86a643afba/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/HlsSampleStreamWrapper.java#L1817

PiperOrigin-RevId: 802570384
icbaker and others added 29 commits October 2, 2025 05:16
PiperOrigin-RevId: 814187648
PiperOrigin-RevId: 814203598
Parsing the sequence header is costly, and is only needed if we're about to
skip or drop an input buffer.
When a key frame sample is queued to the AV1 sample dependency parser,
copy a prefix of the data into a temporary buffer, and only parse it if we're
able to skip or drop a frame.

PiperOrigin-RevId: 814246949
PiperOrigin-RevId: 814297962
This showed up when I was testing an upgrade to Gradle 8.13 and AGP
8.12.0, but I'm not sure if it was actually surfaced by the update or
not (so fixing in a precursor CL).

PiperOrigin-RevId: 814337862
PiperOrigin-RevId: 814355296
PlayerView and PlayerControlView now support the integration of a Media Route button.
Apps can add a Media Route button to PlayerView by providing the ViewProvider.
The cast module provides a MediaRouteButtonViewProvider.

PiperOrigin-RevId: 814409466
The session demo app now displays the Cast button in the top-right corner of PlayerView instead of in the app's menu bar.

PiperOrigin-RevId: 814451577
functions inside Comparator classes.

This avoids a compilation error after JDK-8357219.
That change adds min and max methods to
Comparator. As a result, when we make unqualified
calls to min or max inside a Comparator class,
those calls resolve to those methods, overriding
any static imports.

PiperOrigin-RevId: 814666322
PiperOrigin-RevId: 814683687
The previous attempt to fix this was incomplete, because it relied on
the H.265 (or H.265) codec being present in the codec string (in
addition to the DV one) so it could be returned from
`MimeTypes.containsCodecsCorrespondingToMimeType`:
b6baeb6

This change encodes the mapping between DV codec string (prefixes) and
the NAL unit structure, so we can use that for CEA-6/708 parsing.

Issue: #2775
PiperOrigin-RevId: 814717240
The expected audio output for Opus streams in MKA containers has changed, requiring updates to the audiosink dump golden files.

PiperOrigin-RevId: 815612226
This is a non-functional change.

PiperOrigin-RevId: 815705620
Increasing the `compileSdk` forces all apps depending on the library to
increase their `compileSdk` too, which can force them to upgrade their
AGP and Gradle versions too:
https://developer.android.com/build/releases/gradle-plugin#api-level-support

Forcing this only so we can avoid hard-coding some constants in tests
doesn't seem worth it. We will bump back to 36 when we have a stronger
need to depend on something only available at that API level.

PiperOrigin-RevId: 815711168
This is a non-functional change.

PiperOrigin-RevId: 815728247
This is needed to pick up the fix for
https://issuetracker.google.com/426553902 which will otherwise
disrupt the `1.9.0-alpha01` release.

This was done using the 'upgrade assistant' in Android Studio and
tested with:

```shell
$ ./gradlew \
    -Dorg.gradle.jvmargs=-Xmx7g \
    -Dorg.gradle.java.home=/usr/lib/jvm/default-java \
    clean build
```

And also tested by installing the following demo apps and checking
they launched:
* main
* cast
* compose
* composition
* effect
* gl
* litert
* session
* shortform
* surface
* transformer
* controller test app

I didn't test:
* session-automotive (didn't have an appropriate emulator to hand)

PiperOrigin-RevId: 816110135
This was added to the wrong place in bf2e0af

PiperOrigin-RevId: 816141136
WifiLocks are a no-op while the screen is off, while the current
documentation claims the opposite.

PiperOrigin-RevId: 816214091
Adds a heuristic to `Mp4Extractor` to identify a representative thumbnail timestamp from an MP4 file. The heuristic finds the keyframe with the largest compressed size within the first 20 sync samples of a track or first 10 seconds, whichever comes first.

The timestamp is propagated via a new `ThumbnailMetadata` entry in the track's `Format`. The implementation correctly handles edit lists by ignoring preroll frames and any frames presented outside the final track duration.

PiperOrigin-RevId: 816276656
`FrameExtractorHdrTest`: `@SdkSuppress` is now used instead of `assumeTrue` to correctly skip tests.

`FrameExtractorPerformanceAnalysisTest`: Only set `extractHdrFrames` when `SDK_INT >= 34`.

PiperOrigin-RevId: 816605486
This class receives the current playbackPositionUs and updates the metadata on a ImmutableList<GlTextureFrame> with the correct release time.

PiperOrigin-RevId: 816661476
Instead of just extending the end index based on timestamps, the new approach searches forward from the initial end point, up to a limit defined by `maxNumReorderSamples`, to find any out-of-order frames that fall within the edit duration. This ensures all necessary samples are included in the edited segment.

PiperOrigin-RevId: 816662547
PiperOrigin-RevId: 816676112
Operations like seeking and thumbnail extraction in MP4 files require finding a synchronization sample. The current implementation performs a linear scan over all samples to find one, which is inefficient for files with a large number of samples and can cause delays.

This change improves performance by pre-calculating and caching the indices of sync samples when the file is first parsed. This allows for a much faster binary search lookup, significantly speeding up both seeking and thumbnail generation.

This is a no-op change and the existing tests already verifies it correctness.

PiperOrigin-RevId: 816708109
This change uses the `RendererCapabilities` helper methods to correctly
map from `@C.FormatSupport` values to `@Capabilities`.

This is better than the lint suppression introduced in
78089da

PiperOrigin-RevId: 816708746
@ybai001 ybai001 merged commit 937e1fa into DolbyLaboratories:dlb/dv-profile10/dev Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet