This listener will need to be passed to the MuxerWrapper to throw when
the Transformer is stuck.
PiperOrigin-RevId: 482433552
(cherry picked from commit e6d5595545ac4e0715b8b914a9a4b4a2757911d7)
Make it easier to support use of RGBA_101012 rather than RGBA_8888 for EGL
contexts, displays, and surfaces.
This tangentially supports adding HDR tests, by slightly simplifying the color
selection logic we'd have to add in HDR tests.
PiperOrigin-RevId: 482219428
(cherry picked from commit bb215857e5fd0768ce53c7c61ba91c48dab14bd2)
The reason for making the Muxer public is that we want to add an option
to disable or configure the timer that will throw when the muxer doesn't
receive any data for a given period of time.
PiperOrigin-RevId: 482199360
(cherry picked from commit cf14d0687db5b8c0ea9edeae67a0b91affacbcd8)
The MediaNotficationManager stops the service from the foreground
calling Service.stopForeground(boolean) which is deprecated in API 33.
This change calls Service.stopForeground(int), which was added in API
24.
#minor-release
PiperOrigin-RevId: 482190332
(cherry picked from commit 601eaba7a6dcce963d5a3547d939ea41404ad3fe)
`transformationMatrix` is not ambiguous, as there's no other local
transformationMatrix variable nearby.
PiperOrigin-RevId: 482184602
(cherry picked from commit e39826a8db9f478b56403c8afe7b73b88f57c1c2)
This was originally added in 4fd7d777b6, but it hasn't done anything
since 98ee159df1 (when the instanceof ExoPlayer check was removed).
PiperOrigin-RevId: 482161662
(cherry picked from commit a5b09b8cccca80fb7c40a9576e029ef462b64582)
Before, they used `width` and `height`, which was inconsistent with other pixel tests, and less descriptive.
Refactoring change only. No functional change intended.
PiperOrigin-RevId: 481970243
(cherry picked from commit cce79a70402a231ff1ae6924ea75d59c5680e7b4)
Currently, repeating the same item (via seekNext/Previous) implicitly
results in a seek to the default position of the current item, which
looks exactly the same as a direct seek. As a result, we don't send
onMediaItemTransition as we would for every other seekNext/Previous
call.
This can be fixed by explicitly marking the repeat case in the internal
BasePlayer/ExoPlayerImpl methods, so that the callback can be triggered.
Issue: google/ExoPlayer#10667
PiperOrigin-RevId: 481951788
(cherry picked from commit f850206c51ced023b1603aa7661dd556ee436740)
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)