22003 Commits

Author SHA1 Message Date
rohks
4ec946cb7e Remove publishing for media3-ui-compose temporarily
Disabled until we find a way to exclude it from media3 Javadoc prebuilts

PiperOrigin-RevId: 721765815
(cherry picked from commit 99f2a9f152b0331b9aaec5ac42c64283eb7fdb62)
1.6.0-alpha02
2025-01-31 15:30:09 +00:00
rohks
6a0d96addf Fix RELEASENOTES based on style guide
PiperOrigin-RevId: 721401564
(cherry picked from commit 344214d711c7a8b49e5d5f6bb44f1398eb125fc9)
2025-01-30 16:43:11 +00:00
rohks
719c37f637 Fix lint warnings in RELEASENOTES
PiperOrigin-RevId: 721326280
(cherry picked from commit 045b8e6a524b7371d07b73146837dacc5d64c267)
2025-01-30 11:52:17 +00:00
rohks
6f7522befa Suppress UseSdkSuppress warning in MediaExtractorContractTest
The fix is included in Android Gradle Plugin `8.9.0-alpha05`. Remove this suppression after upgrading.

PiperOrigin-RevId: 721009745
(cherry picked from commit 3c0e2ee19846c5052dbde81f4b41e3e301a7821b)
2025-01-29 17:52:27 +00:00
rohks
e2354fd79d Bump Media3 version to 1.6.0-alpha02
#cherrypick

PiperOrigin-RevId: 720990835
(cherry picked from commit c9a936e153fe046043469ae0bbad15f0ec68f1b0)
2025-01-29 16:55:39 +00:00
rohks
c3f5004ffc Rollback of 5c3c3b91f3
PiperOrigin-RevId: 720968647
(cherry picked from commit 98f52a1dbbda751814367cbf73e8ea436d76b2b9)
2025-01-29 15:59:14 +00:00
rohks
1d599b6b92 Update release notes for Media3 1.6.0-alpha02 release
PiperOrigin-RevId: 720963785
(cherry picked from commit 6e53d9b3bdd24106d1ce75a7a22aabe6af130445)
2025-01-29 15:58:38 +00:00
rohks
5c32abea94 Restrict test to API 24+ in MediaExtractorContractTest
`MediaExtractor.setDataSource(AssetFileDescriptor afd)` requires API 24+.

#cherrypick

PiperOrigin-RevId: 720943416
(cherry picked from commit dfef16d5c6b39c44860f28fa53ae098fc550f6a7)
2025-01-29 14:13:51 +00:00
rohks
e15438322d Fix ArrayIndexOutOfBoundsException in MP4 edit lists
The exception occurred when an edit list started at a non-sync frame with no preceding sync frame. The fix searches forward for the next sync frame in such cases, preventing the out-of-bounds access.

Issue: androidx/media#2062

#cherrypick

PiperOrigin-RevId: 720642687
2025-01-28 11:13:38 -08:00
dancho
bb37aad170 Add an option to use different texture filtering
Add an option to GlMatrixTransformation to choose the OpenGL texture
minification filter.
When mipmaps are requested, mipmaps are generated with
`glGenerateMipmap()`.

PiperOrigin-RevId: 720629807
2025-01-28 10:44:26 -08:00
shahddaghash
bb9b3bd660 Pass codec names of input media items to MediaItemInfo
PiperOrigin-RevId: 720579315
2025-01-28 08:12:42 -08:00
rohks
8d22482f79 Add MediaExtractor contract test structure with one basic test
Additional tests will be added in future changes.

PiperOrigin-RevId: 720555580
2025-01-28 06:44:40 -08:00
tonihei
ddcf455d03 Convert context dependent TrackSelectionParameters to boolean
This avoids that these settings have to be resolved inline,
potentially blocking the main thread. They can be resolved at
the time of track selection on a background thread instead.

As a side effect, we can also remove the context parameter from
the Builder. Having the Context in the Builder is also a bad sign
in the first place because it implies the potentially blocking
calls can happen.

PiperOrigin-RevId: 720523139
2025-01-28 04:26:15 -08:00
shahddaghash
c058d97a97 Pass input media items audio information to MediaItemInfo
Audio `sampleMimeType`, `channelCount`, and `sampleRate` were retained from `ExportResult.ProcessedInput`'s audio format.

PiperOrigin-RevId: 720500611
2025-01-28 02:54:32 -08:00
tonihei
706c363104 Remove potentially blocking calls from DefaultTrackSelector UI thread
The calls to Util.isTV and the interactions with the spatializer are
potentially blocking and were triggered from the constructor,
setAudioAttributes and release.

setAudioAttributes and release are both documented to be called by
the Player and should be triggered on the playback thread anyway.

The constructor initialization can be delayed until the spatializer
might be needed to avoid the blocking call.

The threading clean-up also allows to remove the lock from the
audioAttributes and the spatializer fields as they are now
accessed on the playback thread only.

PiperOrigin-RevId: 720488979
2025-01-28 02:09:28 -08:00
shahddaghash
80e6fa2aa7 Separate ProcessedInput's format into audio and video
Before the change, `SequenceAssetLoader#onTrackAdded` was being called twice, for audio and video. `ExportResult.ProcessedInput` took one format, which was the latest to be written. The change leads to capturing both, the audio and video formats of the input, and prevents the issue of a format overwriting the other.

PiperOrigin-RevId: 720487697
2025-01-28 02:04:02 -08:00
kimvde
0b9ca1e70b Ignore 1 test in CompositionMultipleSequencePlaybackTest
playback_sequencesOfVideos_effectsReceiveCorrectTimestamps is failing
for prewarming. The following is happening:
- For prewarming, there are 2 alternating video renderers per sequence.
- When the first MediaItem ends (for both sequences), signalEndOfInput
is not called on the InputVideoSink (which is expected).
- The DefaultVideoCompositor doesn't receive the end-of-input-source
signal (which is also expected).
- As a result, the DefaultVideoCompositor never outputs the last frame
because it waits for more input frames to be fed.
- The VideoGraph thus doesn't output the last frame either, and the
first video renderer never ends.
- This causes playback to get stuck.

This is similar to the problem of supporting multiple video sequences
with images and videos in CompositionPlayer.

PiperOrigin-RevId: 720106413
2025-01-27 03:50:32 -08:00
dancho
80a734f4f1 AV1 bitstream parser that identifies frames with no dependencies
Usage:
* call queueInputBuffer() with initialization data or sample data in decode
order - updates the parser state
* call sampleLimitAfterSkippingNonReferenceFrame to identify if the sample
contains a frame without dependencies
PiperOrigin-RevId: 720098835
2025-01-27 03:19:36 -08:00
shahddaghash
c3962d2fe6 Collect clipped duration instead of media item's duration
Previously, the input media item's duration was collected from `ProcessedInput.durationUs`. However, this value turned out to be the duration of the media item after clipping. Getting the duration of the input media item before clipping is tricky, so it will be dropped from Editing Metrics V1.

PiperOrigin-RevId: 719254077
2025-01-24 04:53:35 -08:00
dancho
227a4d76b1 AV1 Frame Header parsing
PiperOrigin-RevId: 719253811
2025-01-24 04:50:11 -08:00
ibaker
1772050ece Remove confusing null from ParserException.getMessage()
When reading quickly this suggests something 'real' was null (similar to
a `NullPointerException`), but it's actually just the message from the
superclass.

Seen in stack trace in Issue: androidx/media#2074:

```
Caused by: androidx.media3.common.ParserException: null {contentIsMalformed=true, dataType=1}
```

PiperOrigin-RevId: 719240235
2025-01-24 03:55:19 -08:00
shahddaghash
382f30616a Rollback of b25d6ef249
PiperOrigin-RevId: 719238418
2025-01-24 03:46:54 -08:00
dancho
dddcdf1613 AV1 sequence header parsing
PiperOrigin-RevId: 719200478
2025-01-24 01:25:58 -08:00
ibaker
a7a5d6e92b Suppress (and log) subtitle errors in SubtitleTranscodingTrackOutput
This is equivalent to the error suppression for legacy subtitles in
`TextRenderer`:
76088cd6af/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/text/TextRenderer.java (L357-L359)

This new suppression only affects errors thrown from files with
subtitles muxed together with audio/video. Standalone subtitle
files, and containers containing only text tracks, are handled
by the existing error suppression/reporting added in
49dec5db8b.

Issue: androidx/media#2052
PiperOrigin-RevId: 718930243
2025-01-23 10:49:23 -08:00
claincly
6b54372df8 Have Sequence Player end as audio sink position is passed
The fix is to update `AudioGraphInputAudioSink.lastHandledPositionUs` when a buffer is handled, and end the `AudioGraphInputAudioSink` as the final audio sink plays out further than this position.

PiperOrigin-RevId: 718901825
2025-01-23 09:38:19 -08:00
Copybara-Service
c1242ffef1 Merge pull request #1235 from DolbyLaboratories:dlb/dovi-transformer/dev
PiperOrigin-RevId: 718856455
2025-01-23 07:26:21 -08:00
dancho
61b7dfd7ba Add ObuParser to split a ByteBuffer into AV1 OBUs
PiperOrigin-RevId: 718813571
2025-01-23 04:46:38 -08:00
Copybara-Service
916018d9fe Merge pull request #1936 from colinkho:eval-buf
PiperOrigin-RevId: 718809019
2025-01-23 04:27:16 -08:00
microkatz
b6d4886887 Reevaluate ongoing chunk loading when pausing 2025-01-22 16:23:55 +00:00
ibaker
9bb254f697 Skip SSA cues where end time is before or equal to start time
The file in Issue: androidx/media#2052 contains a cue with the following timecode:

```
0:00:00:00,0:00:00:00
```

The content of this cue seems to be some 'converted by' metadata, i.e.
it's basically a comment and clearly not intended to be shown on
screen (since it has zero duration).

There is some fiddly logic later in `SsaParser` to support overlapping
cues with the old `Subtitle` structure [1], and this logic gets tripped
up by the start and end time being equal, which results in a
**single**, empty `List<Cue>` being added - which trips up another
assumption that every SSA cue line results in at least two `List<Cue>`
entries (one containing the cue text, and another containing an empty
list to signal the end of the cues).

This fiddly logic is no longer required, because overlapping
`CuesWithTiming` objects can now be merged in `TextRenderer`, so there
is a possible future simplification to `SsaParser` which removes a lot
of this complexity.

[1] Added in <unknown commit>

PiperOrigin-RevId: 718380386
2025-01-22 07:41:24 -08:00
Colin Kho
8b0cfda178 Move queue reevaluate buffer to only execute when playWhenReady is set to false 2025-01-22 15:18:16 +00:00
Colin Kho
15bdbf735d Reevaluate buffer during a playWhenReady change 2025-01-22 15:18:16 +00:00
sheenachhabra
431efc9c50 Skip exportTranscodeBt2020Sdr test on sm-a325f API 33
The decode over reports its resolution capabilities and
decoder initialization eventually fails.

PiperOrigin-RevId: 718294047
2025-01-22 02:37:15 -08:00
kimvde
635e699965 Various improvements to BufferingVideoSink
PiperOrigin-RevId: 717807436
2025-01-21 01:54:45 -08:00
ibaker
5421a74d06 Tighten two MediaCodecRenderer fields to @MonotonicNonNull
Remove some `checkNotNull` calls that are no longer needed.

PiperOrigin-RevId: 717597046
2025-01-20 12:14:56 -08:00
sheenachhabra
7c10ef03e4 Check full format support in decoder for Transformer
For the case where a hardware decoder does not fully
support the requested format, a software decoder will
be preferred.

PiperOrigin-RevId: 717584768
2025-01-20 11:27:13 -08:00
sheenachhabra
6fe011beb4 Make Mp4Muxers and FragmentedMp4Muxers implement AutoCloseable
PiperOrigin-RevId: 717549236
2025-01-20 09:02:25 -08:00
sheenachhabra
a31c7ad9a8 Move Muxer.java interface into transformer module
Muxer interface is used only in transformer.

PiperOrigin-RevId: 717538306
2025-01-20 08:13:42 -08:00
sheenachhabra
fb58bdfd52 Refactor: Mp4Muxer and FragmentedMp4Muxer no longer implement Muxer
Mp4Muxer and FragmentedMp4Muxer has different contracts
and they can not implement same interface.

PiperOrigin-RevId: 717526288
2025-01-20 07:20:48 -08:00
sheenachhabra
c22798f99c Removing redundant call to setLastSampleDurationBehavior on muxer
The default value is already
LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER_OR_DUPLICATE_PREVIOUS

PiperOrigin-RevId: 717497116
2025-01-20 05:14:47 -08:00
kimvde
8abd36fb27 Simplify MediaCodecRenderer.maybeInitializeProcessingPipeline
PiperOrigin-RevId: 717466577
2025-01-20 03:07:59 -08:00
tonihei
190563b8eb Move StreamVolumeManager system calls to playback thread
This requires some additional state handling to update the full
state atomically and guess placeholder states while updates are
in progress, using the newly added BackgroundThreadStateHander.

Some tests also needed to be adjusted to account for the fact
that the actual audio system change doesn't happen inline
anymore.

PiperOrigin-RevId: 716702141
2025-01-17 09:47:33 -08:00
sheenachhabra
c797249998 Move supported sample mime types list in specific muxer
This will reduce the risk of list becoming stale
(its already stale, to be fixed).

PiperOrigin-RevId: 716685242
2025-01-17 08:51:44 -08:00
claincly
a0618eb0ec Adds a test on using composition level effects
Also simplifies the test a bit.

PiperOrigin-RevId: 716683585
2025-01-17 08:46:44 -08:00
sheenachhabra
4ac4f7e2e0 Split InAppMuxer into InApp Mp4Muxer and FragmentedMp4Muxer
This is pre work required to remove `Muxer.java` interface
from the muxer module.
`Mp4Muxer` and `FragmentedMp4Muxer` will no longer implement
the `Muxer` interface.

PiperOrigin-RevId: 716669531
2025-01-17 08:01:28 -08:00
tonihei
a4d9a3e096 Move Wake/WifiLockManager system calls to playback thread
PiperOrigin-RevId: 716235808
2025-01-16 07:58:32 -08:00
tonihei
297b2b9956 Add util to handle background state updates and placeholder states.
This is a common pattern in media3 libraries where tasks are handled on a
background thread, but the calling thread sees an immediate state update
with a best-guess placeholder. This makes the integration for the caller
very easy as the API surface appears to be synchronous.

This util is a helper class to handle this logic and test it separately.

PiperOrigin-RevId: 716233966
2025-01-16 07:53:15 -08:00
Copybara-Service
fda8b8a35d Merge pull request #2023 from DolbyLaboratories:dlb/dovi-format/dev
PiperOrigin-RevId: 716226613
2025-01-16 07:26:46 -08:00
tonihei
4328d29f34 Lazily initialize current audio capabilities in DefaultAudioSink
PiperOrigin-RevId: 716224052
2025-01-16 07:17:26 -08:00
claincly
1732892927 Add tests for multi input video
PiperOrigin-RevId: 716208222
2025-01-16 06:19:47 -08:00