*** Original commit ***
ExoPlayer: Add setVideoFrameProcessorFactory().
This allows apps to use a custom VideoFrameProcessor implementation for video
playback. This may be useful, for example, when outputting to a texture.
***
PiperOrigin-RevId: 536391597
(cherry picked from commit 06908e1a865c4c5ae9a9f52986255756bb20cd07)
This change moves the default logic into the actual Player
implementations, but does not introduce any behavior changes compared
to addMediaItems+removeMediaItems except to make the updates "atomic"
in ExoPlayerImpl, SimpleBasePlayer and MediaController. It also
provides backwards compatbility for cases where Players don't support
the operation.
Issue: google/ExoPlayer#8046
#minor-release
PiperOrigin-RevId: 534945089
(cherry picked from commit 2c07468908fdba9918d33d0f02c6ff872b87fefc)
Also, document that texture output disables manual frame release.
In the past, texture output would lead to surface output methods throwing. Now,
they're simply no-ops instead.
PiperOrigin-RevId: 534894168
(cherry picked from commit abf649cdfa367976517ee07f83ea805b60ed88a5)
When the video renderer is disabled, the video size is set to 0/0
and sent to listeners. The `PlayerView` potentially still has the last frame
displayed when the player is stopped or an error occurs. This may have the
effect that the frame is displayed distorted.
Not changing the aspect ratio when the video size arrives when the player is IDLE
avoids the problem. In the case when playback starts again and the renderes is
enabled, another video size is sent to the listener.
#minor-release
PiperOrigin-RevId: 534860889
(cherry picked from commit 6469fffd8fe4ffc404f4bc1e405c362ff7020827)
This helps to highlight that the replaced range doesn't need to have
the same size as before.
#minor-release
PiperOrigin-RevId: 534834917
(cherry picked from commit acb567d5a723102a82afff2eb36f953f203deddf)
I undid my last clean-up (b762ca993e) in 5a5c3ce3bd
#minor-release
PiperOrigin-RevId: 534763770
(cherry picked from commit 41492b6e299b4069324dd74ae03ad896992ae970)
This change removes it from `Player.Listener` and `AnalyticsListener`,
use `onPositionDiscontinuity` with `DISCONTINUITY_REASON_SEEK` instead.
#minor-release
PiperOrigin-RevId: 534757426
(cherry picked from commit 5c713feb60bafbf8534cc30c525572bc4c96222b)
Tentative/experimental value to reduce codec timeouts. We will reconsider using a larger limit after seeing whether this really does reduce error rate.
PiperOrigin-RevId: 534491615
(cherry picked from commit 66554b9b686843d4f503833d59717a7717dd4959)
- Number of frames from SurfaceTexture that is sent downstream
- Times ExtTexMgr signaled end of current input stream
PiperOrigin-RevId: 534487842
(cherry picked from commit d584a772e3dbc0ba6df7e4d7073e735e1918c6c4)
Mp4Muxer already supports writing Mp4LocationData so added that
as supported Metadata entry.
Support for more Metadata entries will be added in upcoming CLs.
PiperOrigin-RevId: 534473866
(cherry picked from commit 7c477589e5f25b1fffa51e8961ed26f4615066a5)
I moved this assignment in 0888dfbd05
in order to provide a single source-of-truth for `publish.gradle`,
but as pointed out in Issue: androidx/media#416 this breaks apps that are depending
on our project locally using the instructions we publish. Instead we can
remove the `rootProject.name` check from `publish.gradle`, and check an
explicit boolean value instead to indicate if the root project is 'ours'
(with this boolean only set from `settings.gradle`, so it doesn't get
picked up by apps depending on us locally).
#minor-release
PiperOrigin-RevId: 534459085
(cherry picked from commit 9a795712843aa8907a3087fc6003e000960db5ad)
And fix violation of this in AdsMediaSource.
#minor-release
PiperOrigin-RevId: 534441648
(cherry picked from commit c73955a4cd75a2b8b7393d5a44067d0eaeb3981a)
Use the audio or video specific variants instead.
#minor-release
PiperOrigin-RevId: 534436644
(cherry picked from commit 5a5c3ce3bd4a6b906e8ddc6cbdbfcf2d7f4ee71f)
Use the non-deprecated constructor instead.
#minor-release
PiperOrigin-RevId: 534426655
(cherry picked from commit 48348df58ad7ebbe13b842a3daa9db21a67c75ad)
Use the constructor that takes an `Executor` instead.
#minor-release
PiperOrigin-RevId: 534370613
(cherry picked from commit ff0f1c4e9c41ae9c0e087988f1e5d82cbe4c1324)
- Use artwork display mode `fill` to improve visual apperance
- Some minor cleanup
#minor-release
PiperOrigin-RevId: 534366246
(cherry picked from commit 230921e4ab999f3f9af40688cedaf02631052a95)
This change merges some duplicate sections, moves some items to more
appropriate sections and removes unnecessary items (deprecations are
self-documenting, so don't need to be included here).
#minor-release
PiperOrigin-RevId: 534363065
(cherry picked from commit b762ca993ef2c8afc2e840cebdf86bba2778b798)
This change deprecates `PlayerView.setUseArtwork(boolean)` and
introduces `setArtworkDisplayMode(mode)` and
`artworkDisplayMode="off|fit|fill"` instead.
- off: no artwork is displayed (like deprecated useArtwork=false)
- fit: letterbox like media (like deprecated useArtwork=true)
- fill: scales the artwork to fill the entire width/weight of the player view
#minor-release
PiperOrigin-RevId: 534167226
(cherry picked from commit 46fb454b3ffc4b2ad97ceccb4dc798e1c9a4c774)
Basically this change removes a bug that makes video playback stuck when
a video is playing and the user taps the UMO notification to get to
the player activity.
- Use `launchMode="singleTop"` for `PlayerActivity`
- Change session activity to a back stacked activity on service `onDestroy`.
Using a back stacked activity `onDestroy()` will be useful once this demo
app implements playback resumption.
The rest of the changes are aesthetic:
- clean up and optimize screen space usage in UI of `PlayerActivity`
- changed some colors, paddings and spacings
- adds a default artwork for the `PlayerView`
PiperOrigin-RevId: 534152052
(cherry picked from commit 96a4ae7e40732dccd2fdded4cb8d0cc7f25f8cdd)
Fix a bug when seeking in an opus container. The calculations inside
DefaultOggSeeker may overflow a long primitive.
Issue: androidx/media#391
#minor-release
PiperOrigin-RevId: 534128513
(cherry picked from commit b9a4e614f7cfe863e72dec779b7beb1a8c1e4e2d)
Earlier metadata was written multiple times as it came.
With new changes, all the distinct metadata entries will
get collected and will be written at once in the end.
PiperOrigin-RevId: 534088401
(cherry picked from commit a9e3f5def4fa17aa82f47a8d3a1f1452c2e6f245)
This allows apps to use a custom VideoFrameProcessor implementation for video
playback. This may be useful, for example, when outputting to a texture.
PiperOrigin-RevId: 534044831
(cherry picked from commit 438ae0ed6ac1059e8aaa9380f476c1403f24a986)
This is a follow-up to 99dac0be0f where we made the same change in
ExoPlayerImpl and SimpleBasePlayer, but for consistency it makes
sense to also update the masking code in MediaControllerImplBase to
assume the same logic.
Note: MediaControllerImplLegacy already handles this case via
setMediaItems and doesn't need to be updated further.
#minor-release
PiperOrigin-RevId: 534038759
(cherry picked from commit 33af245465ac9a8441a58a6fd6bf75c34e2efa26)
The methods in ExoPlayerImpl and MediaControllerImplBase that determine
the new PlayerInfo/PlaybackInfo currently have a hard-to-reason-about
setup where the method generating the new info accesses other methods
that rely on the existing class field instead of working with the
passed in PlayerInfo/PlaybackInfo. This prevents reuse of the util
methods (e.g. for replaceMediaItems) because they access potentially
stale state.
This change untangles these methods a bit by making the util methods
either static or at least ensure that they don't rely on existing
class fields of PlayerInfo/PlaybackInfo. Overall, the change is a
complete no-op.
#minor-release
PiperOrigin-RevId: 534036633
(cherry picked from commit 1fa790348e7e90c987d3385a79a2c7c150cd6824)
MediaControllerImplBase currently drops the pending initial seek
position when a user sets an empty playlist.
When seeking in empty playlists and setting new empty playlists,
the class also drops the the period index (and wrongly assigns zero
instead of the windowIndex).
#minor-release
PiperOrigin-RevId: 534035046
(cherry picked from commit caf1c77af1822d0268d7f028f358374bbe2ba1c8)
The main interface documentation hasn't been updated substantially
since 2017 and is missing notes for many of its current features and
requirements.
Also change the recommendation for implementors from BasePlayer to
SimpleBasePlayer to ensure new classes are more likely to cover all
of the interface requirements.
#minor-release
PiperOrigin-RevId: 534027117
(cherry picked from commit 6de6bd9c4f23b87427b7d2c4cb2c330aef5fba49)