This is the first commit out of two. This change adds the missing event
flags for the onEvents() callback when MediaController is connected to a
media3 session (see MediaControllerImplBase). I updated the
MediaControllerListenerTest and MediaControllerStateMaskingTest with
assertions that on onEvents() is called alongside individual
Player.Listener callbacks.
There will be a follow-up change for the case where a MediaController is
connected to a legacy MediaSession (MediaControllerImplLegacy). I've
split this in two separate changes to make the size of the commit
manageable for reviewing.
#minor-release
PiperOrigin-RevId: 481933437
(cherry picked from commit 46d5a0e33bd562cd9e6420b342a68bf112847f83)
In exoplayer2 this affects StyledPlayer(Control)View
#minor-release
PiperOrigin-RevId: 481878940
(cherry picked from commit cc1d35cfd787a02124c48d9e7df1c94dd78da085)
- The naming DefaultMuxer is more consistent with the rest of
Transformer codebase (e.g. DefaultEncoderFactory).
- By hiding the implementation details of DefaultMuxer, the transition
to in-app Muxer will be seamless for apps using DefaultMuxer.
- The current plan is that DefaultMuxer will become the in-app muxer.
PiperOrigin-RevId: 481838790
(cherry picked from commit 3399f4ecdfd0354f49a8599d04e4cc68295f2af5)
This means the null checker can be more sure that these fields don't
get reassigned between a null-check and a usage.
PiperOrigin-RevId: 481142004
(cherry picked from commit e97b25a668035679fce798e978af576303b0e10e)
We already have logic to end all session except the current one if the
current one doesn't have a MediaPeriodId yet. This is assuming that this
only happens after a seek on the app side where the player doesn't have
detailled knowledge about the MediaPeriodIds yet.
Currently this logic isn't triggered if the window we are coming from
doesn't have its MediaPeriodId either as we run into another check that
keeps sessions around until we have a valid windowSequenceNumber.
Swapping both conditions fixes this case without breaking any of the
other known transition scenarios.
Issue: androidx/media#180
PiperOrigin-RevId: 480866465
(cherry picked from commit 409c9f874cbfce4b6c77ee700c0c50caa218cf3d)
Adds root extras and metadata extras to MockMediaLibraryService and MockMediaBrowserCompatService and completed test cases for asserting
interoperability with a media1 or Media3 browser.
PiperOrigin-RevId: 480854842
(cherry picked from commit 006a519a0e83d5b9e4262a5bbc228c02b3c9cf5f)
- This method is redundant with getSupportedSampleMimeTypes().
- This is to prepare the Muxer class to become public.
PiperOrigin-RevId: 480840902
(cherry picked from commit 2786db9e73505a8d6d4c4f2c284aacb605006ab8)
When debugging and fixing Issue: google/ExoPlayer#10666 I wanted to write a regression
test, but needed to add a test first... This is just a small bit of
coverage to start with. It checks the field/channel filtering works
correctly, but doesn't check any styling info. It also doesn't test
'pop on' subtitles (i.e. when the subtitle isn't shown until a 'end of
subtitle' signal is received).
PiperOrigin-RevId: 480644568
(cherry picked from commit 706b1299049b23dbc71a7407ffbaf8598f56b610)
Most demo videos aren't very long, and the default demo video is only 10 seconds.
Shorten the maximum trim duration to 10 seconds, to demonstrate transformer functionality more easily, and allow this to be used more easily when trimming short sections of a longer video (ex. to make test clips)
PiperOrigin-RevId: 480602037
(cherry picked from commit f35bda3524408d8bf560c080bd6a80698c7c08e1)
Player controls are somewhat distracting when showing the difference between the
input and output video, as they obscure and darken the video players.
PiperOrigin-RevId: 480597804
(cherry picked from commit 51edb329a124e5af302e1ebbd3527300619ac86a)
Before, slider values were read as `floor()`'ed `longValue()`s, so that trimming to
intervals less than one second would be interpreted as a request for a zero-
duration trim.
Also, rename `radiusRange` references here to `trimRange`, since this is not a
radius range.
PiperOrigin-RevId: 480401556
(cherry picked from commit fb5cd18dcd8b8e2a6baa308d6907f2e02751474e)
We currently use the literal -1 (=NO_VALUE) when adding up the
total. Tracks without known bitrate can be ignored in the
calculation, but we should use an explicit value of 0.
#minor-release
Issue: google/ExoPlayer#10664
PiperOrigin-RevId: 480048126
(cherry picked from commit b0daae72cfa5b5390d2fe2077e011955952d858d)
If the sample type is Dolby Vision and the display does not support Dolby Vision, then the capabilities DecoderSupport flag is set to DECODER_SUPPORT_FALLBACK_MIMETYPE. This denotes that the renderer will use a decoder for a fallback mimetype if possible. This alters track selection as tracks with DecoderSupport DECODER_SUPPORT_PRIMARY are preferred.
UnitTests included
-DefaultTrackSelector test that checks track selection reordering with DECODER_SUPPORT_FALLBACK_MIMETYPE
-MediaCodecVideoRenderer test that checks setting of DecoderSupport flag based on Display's Dolby Vision support
Issue: google/ExoPlayer#8944
PiperOrigin-RevId: 480040876
(cherry picked from commit 266de1b21bae6ed267022547d42601a00ea14e88)
Replace the instance-field MediaController with a local instance created
in each test.
PiperOrigin-RevId: 480039768
(cherry picked from commit ba1ecafb8f0db2a0e822eceffa724f1baae4a073)
PlayableFolderActivity currently uses two seperate commands
to set the playlist and then seek to the requested item.
This is slightly inefficient and also causes analytics
listeners to believe the first item in the playlist was
briefly active.
#minor-release
Issue: androidx/media#180
PiperOrigin-RevId: 480031682
(cherry picked from commit 5d6d069e4e946a46884a838482567ff085e88283)
Currently, a frame is dropped if it's requested release time is in the past.
This mode was added to support previewing. However, in normal ExoPlayer
playback, slightly late frames (<30ms late) are also rendered. On MediaCodec
side, this means calling `releaseOutputBuffer` with a release time in the
past.
PiperOrigin-RevId: 479615291
(cherry picked from commit a426cb27c0d0c85bd6cb4c04cb27957e3075754c)
Remove static imports to constants and imports to intdefs, to make the
code more readable.
PiperOrigin-RevId: 479594144
(cherry picked from commit 36e12fbadb7b274f770a5904675493300c8fa89c)
Also, update tests to allow AnyOf error codes, and no longer check exception messages, which caused quite a bit of churn.
PiperOrigin-RevId: 479570861
(cherry picked from commit 8548e3519e3d6ef214d5c18d640a8bf6efe19c83)
This mode is supported by using `C.TIME_UNSET` (which is a negative value). The
new logic decouples the value of `C.TIME_UNSET` and the frame dropping
behaviour.
PiperOrigin-RevId: 479368880
(cherry picked from commit 26be9ae88548bcf95327801931b3b5797304bc66)
* Add `setOutputStreamOffsetUs(long)` method in `AudioSink`.
* Add private methods `setOutputStreamOffsetUs(long)` method in `MediaCodecRenderer` and `DecoderAudioRenderer`.
* Add protected method `onOutputStreamOffsetUs(long)` method in `MediaCodecRenderer`, in which:
* `MediaCodecRenderer` itself will be no-op for this method.
* `MediaCodecAudioRenderer` will propagate this value to its `audioSink`.
* Add logics in `DecoderAudioRenderer` to calculate `outputStreamOffsetUs`.
PiperOrigin-RevId: 479265429
(cherry picked from commit 5bff8623748a1ce9e411cfa9df171143925da89f)
The JavaDoc of RequestMetadata should point to the media3 controller,
not the platform one.
PiperOrigin-RevId: 479047924
(cherry picked from commit b70258e43dd9a9aead05eb2247f2058044bee1a5)
Currently `FrameProcessor.releaseOutputFrame()` method supports
Release at a specific system time
Drops the frame
This API is not that convenient to use when the caller wants to release a frame, now, regardless of the release time. A use case is to release (present) a frame when no frame is shown for a while, and it's thus better to just release the frame, now.
Currently if MCVR wants a frame to be rendered now, MCVR calls release frame with a set offset like 10us: `releaseOutputFrame(System.nanoTime() + 10_000)`. The 10us offset is to prevent the frame processor dropping the frame, due to thread hopping delays.
To make the API better usable, consider adding a mode for releasing the frame now, like (bold marks the new mode)
- Use C.TIME_UNSET to drop
- **Use -1 to release the frame immediately, or**
- Use an actual release time.
PiperOrigin-RevId: 479044215
(cherry picked from commit 139a6e8d3175143957c44e4c4b5e15853202682e)
Assert that tone mapping is applied when an HDR edit cannot be HDR, but is successfully tone mapped. Meanwhile, assert that fallback, which is applied after codec configuration (which throws the "Tone-mapping requested but not supported by the decoder" error) is not applied when that error is called.
PiperOrigin-RevId: 478762951
(cherry picked from commit 253486d4af057776da0eb5926e31190f43dbe3b3)
When a media service currently produces multiple media sessions, the notification of the second session overwrites the notification of the first one, because all sessions use the same notification ID. When we use different notification IDs for different sessions, multiple media notifications can be up at the same time, which means that they can both be controlled at the same time.
PiperOrigin-RevId: 478709069
(cherry picked from commit 7783c6e4f71943b543ddb569b120bdbbab362b96)
"Final" was likely added to reference the FinalMatrixTextureProcessorWrapper,
which is a package-private class. However, I think more clear to express that
this is the input size, which then has all effects applied, to get the output
size.
PiperOrigin-RevId: 477975358
(cherry picked from commit de82a2be336e9308e194d5baf91c348a2700a5de)
Per go/java-practices/imports#static
No functional changes intended.
PiperOrigin-RevId: 477974779
(cherry picked from commit d5c272fde88f3efde7535933331270d2aea2fbb9)
Rename test files to avoid substrings that can be implied by the directory name,
like "Transformation" and "Test"
No functional changes. Renaming-only.
PiperOrigin-RevId: 477724724
(cherry picked from commit 62b95a71902349e95693174f83bb48e6927d5249)