There is no use case left where we couldn't use a better
alternative (either looping in the player, using the Player
playlist API, or ConcatenatingMediaSource for advanced cases)
PiperOrigin-RevId: 367990981
Prior to this change, there were some unrealistic quirks in
our Robolectric tests. For example, onRenderedFirstFrame would
be called when using FakeVideoRenderer, despite no output to
render the frame to ever being set. This change improves the
realism of these tests. These changes are required for some
improvements being made to how outputs are set on video
renderers.
PiperOrigin-RevId: 367652169
This was added in 9609af3c23 as part of a LSC.
The RequiresNonNull annotation doesn't work anymore (it doesn't
recognize the outer class member and instead tries to find
the same variable on the inner class). So instead of suppressing
the warning of the non-fulfilled precondition, we can just
check the non-nullness directly and remove the precondition.
PiperOrigin-RevId: 367593941
The main change here is that VideoDecoderGLSurfaceView now implements
VideoDecoderOutputBufferRenderer directly. This avoids SimpleExoPlayer
having to cast to VideoDecoderGLSurfaceView, which will be necessary
if VideoDecoderGLSurfaceView is moved to the UI module. Instead, the
player can cast directly to VideoDecoderOutputBufferRenderer, which
could be moved to the Common module.
The renderer is also moved to be an inner class, since it's not used
anywhere else and since doing this makes it a little easier to move
things around.
PiperOrigin-RevId: 367398147
We added a source that allows mixed placeholder and non-placeholder
periods, but have no way to denote that in the Timeline because the
placeholder flag only exists on Window level. This causes a bug if
the first item in a concatenation has a window-period offset and the
player can't detect whether it's still a placeholder or not.
Adding this flag to Period allows the player to detect this reliably.
In addition we need to make sure that re-resolving pending positions
only happens for the first placeholder period where the window-offset
can actually change. As all subsequent periods have to start at position
0, so they don't need to be re-resolved (and shouldn't).
PiperOrigin-RevId: 367171518
* @Nullable is not a TYPE_USE annotation, so should appear before any modifiers and after Javadocs.
(see go/java-style#s4.8.5-annotations)
This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Suggest a fix on the CL (go/how-to-suggest-fix).
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if the change looks generally problematic.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.
This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/exoplayer/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/exoplayer/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.
#codehealth
PiperOrigin-RevId: 367053059
- Take centerControls padding into account to prevent switching to
minimal mode too soon
- Disable clipping to padding to avoid the edges of controls from
being clipped as the view gets smaller
Issue: #8763
PiperOrigin-RevId: 366966298
This reverts
<unknown commit>
Which was a temporary workaround for Issue: #1874
Also add a loop to ensure we process as many metadata items as
applicable in each render() call.
PiperOrigin-RevId: 366965504
LSC: go/checker-lsc
Tested:
Sample tests for this CL passed, but some tests failed during the TGP run. Test failures are believed to be unrelated to this CL
PiperOrigin-RevId: 366804637
This ensures BUFFER_FLAG_DECODE_ONLY is set on samples that are
before the playback start position, in the case that the queue
is created after the start position is set.
#minor-release
PiperOrigin-RevId: 366249188
The condition is meant to be unblocked whenever the constructor is
left. This should include unchecked exceptions (that may be thrown
due to bugs in the dependent components, or user-inhected factories)
PiperOrigin-RevId: 366235361
The new onPositionDiscontinuity callback contains sufficient information, so
that this former workaround to obtain the position before a seek is no longer
needed.
PiperOrigin-RevId: 365993937
Aims to achieve visibility parity with MediaCodecRenderer#onQueueInputBuffer.
Allows measuring the time when the codec queue the first input buffer in the codec. Which means the Codec has been initialized and is about to start decoding.
It also allows measuring how long it takes for the Codec to render its first frame.
PiperOrigin-RevId: 365906756
If the player is created on a background thread (which is allowed
as the only exception to the access-on-one-thread-only rule), it
may happen that a callback on the main thread tries to access the
player before the constructor even finished. This is dangerous and
can cause exceptions due to uninitialized variables.
To solve this, we can make sure that every player access is blocked
until the constructor finished. Blocking is safe because the
constructor itself is not doing any blocking work or acquiring locks.
The thread verification method is already called on every entry
point to the player, so we can reuse the same method for checking.
PiperOrigin-RevId: 365792949
The extended onPositionDiscontinuity callback can be used to improve some
listener classes:
- Listening to onTimelineChanged to detect discontinuities is no longer needed.
- Listening to onSeekStarted is no longer needed as the start position is part
of the onPositionDiscontinuty callback.
- The exact old position is also useful for media time history logging.
As a side effect, removing onSeekStarted handling from PlaybackStatsListener
fixes Issue: #8675 that was caused by the special EventTime handling for
onSeekStarted.
PiperOrigin-RevId: 365558959
A TrackGroup must contain the same content in all Formats (except for
the quality, encoding etc). Verify that the language and role flags
are the same and log an error if don't match. Don't throw to avoid
breaking existing use cases that just happen to work by chance.
PiperOrigin-RevId: 365539240
The hacky workaround for APIs 29/30 doesn't work on API 31. Instead,
we can use the onDisplayInfoChanged callback, that is accessible from
API 31.
PiperOrigin-RevId: 364997282
The BasePlayer implementation of add/remove
Listener knows about Components.
As those are removed from the Player
interface, the implementation of those
methods needs to be moved down in Player
implementations.
This commit makes no functional change.
PiperOrigin-RevId: 364985291
The exo_controls_background view is supposed to fill its parent,
and so previously used match_parent to do this. However, if the
parent uses wrap_content for its own dimensions, the constraints
being specified become somewhat ambiguous. The parent is supposed
to be sizing itself to wrap its children, and one of the children
is supposed to be sizing itself to match the parent.
Intuitively for this case, you'd hope that the layout logic would
size the parent to wrap its other children, and that the
match_parent child would then fill the parent with its determined
size. That's not what happens, and instead the parent ends up
expanding to occupy all of the space available to it.
This commit sets the exo_controls_background view's dimensions
to be 0dp in the layout, to stop it from influencing the size of
the parent. It's then expanded to fill the parent in code.
Issue: #8726
#minor-release
PiperOrigin-RevId: 364868301