With this change, the MediaCodecAudioRenderer configures the MediaCodec
to not downmix audio only if spatialization can be applied. This way,
decoders who are downmixing by default are left doing so when
spatialization cannot be applied. The renderer re-initializes the codec
when spatialization properties change mid-playback.
PiperOrigin-RevId: 422822952
The existing code creates an imbalance between `inputBufferCount` and
`droppedBufferCount` by adding 'dropped source buffers' to
`droppedBufferCount` but not to `inputBufferCount`. This results in
assertion failures in `DashTestRunner`.
PiperOrigin-RevId: 414672175
When calling Android's Log class directly, there's a LongLogTag
lint check that detects tags over the 23 char limit, however it
cannot detect long log tags in ExoPlayer due to the way that we
log via our own Log class. This commit adds @Size annotations to
enforce the same rule.
PiperOrigin-RevId: 413976364
*** Original commit ***
Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()
An upcoming change will update build() to return Player.
PiperOrigin-RevId: 401468532
DashTestRunner.setWidevineInfo instantiates a Widevine MediaDrm to check
for L1 support, which fails on GMS devices that don't support Widevine.
The Widevine tests should be skipped on these devices, but the
setWidevineInfo call happens in @Before before the skipping logic
inside the test.
This change moves the skipping logic to the beginning of @Before, and
uses Assume to ensure the test isn't run.
This will also report the test as 'skipped due to unmet assumption'
which is more precise than 'passed'.
PiperOrigin-RevId: 399452734
The DebugMediaCodecVideoRenderer expects the MediaCodec to return an
output format change after the MediaCodecRenderer detects an input
format change, but the DebugMediaCodecVideoRenderer resets its state
after flushing MediaCodec. This does not cover the following case: an
input format change is detected when queueing sample with timestamp X
and before the respective output buffer is dequeued, the player seeks
back to X. After seeking back to X, the MCR does not trigger an input
format change for X again, and MediaCodec (correctly) returns an output
format change before dequeueing output X.
This commit is changing DebugMediaCodecVideoRenderer to keep expecting
an output format change after a flush, is one a format pending output.
Such an an edge-case is addressed already in MediaCodecRenderer.
PiperOrigin-RevId: 370482506
MediaCodecRenderer is calling its protected methods
resetCodecStateForRelease() and resetCodecStateForFlush() from its
constructor. Classess that override the methods (eg.
DebugMediaCodecVideoRenderer) need to checks if the methods
are called from the superclass constructor thus their members are not
initialized yet.
With this change, the MCR constructor does not call the two
methods and sets the respective state directly on its fields.
PiperOrigin-RevId: 370445978
After refactoring MediaCodecRenderer's configureCodec() to
getMediaCodecConfiguration(), there was some state initialization left
in DebugMediaCodecVideoRenderer's configureCodec(). This is now moved
inside DebugMediaCodecVideoRenderer.onCodecInitialized().
PiperOrigin-RevId: 370430193
This change moves the responsibility of creating, configuring and starting the MediaCodec from the MediaCodecRender to the MediaCodecAdapter.Factory.
This move allows ExoPlayer's client to decide how and when codecs are created and/or reused.
To allow the move, this CL replaces MediaCodecRenderer.ConfigureCodec with MediaCodecRenderer.getCodecConfiguration
PiperOrigin-RevId: 369273887
This means there are fewer changes required when exporting these tests
as part of the GTS suite run by device manufacturers.
PiperOrigin-RevId: 367230977
`TrackSelection` had mutation methods which were to be called only
internally by ExoPlayer components but were exposed in the
public `Player` interface.
The mutation methods have been moved out of `TrackSelection`
to a new class `ExoTrackSelection`.
Current track related read-only method have also been moved out,
because they are actually something quite unclear.
Even for a single item playlist, it's the track being buffered rather
than the track being played, which is unclear.
But when you have a playlist it starts to get really confusing,
because if the next item is being buffered, then it's actually
the last track to be buffered in the currently playing item.
As a final aside, the implementations don't do proper thread synchronization
to ensure visibility of updated state by the calling thread.
Exposing those mutable methods in the public `Player` interface
was problematic because they leaking internal concepts of `ExoPlayer`.
This is also required to minimize the `Player` interface for long term
stability.
`ExoTrackSelection` is a subclass of `TrackSelection`.
This is not ideal as an `TrackSelection` implementation could
break the current immutability.
This was done in order for this refactor to be simpler.
A future patch will fully split the two classes.
All `MediaPeriod` and `Sources` had to be updated to use the new
`TrackSelection` dynamic aspect class name.
An alternative would have been to break ExoPlayer's public API, keeping
`TrackSelection` as the dynamic aspect name, and calling the public static
aspect class `TrackSelectionState` or similar.
Nevertheless, while it would have impacted less files, it would have
many more small apps and casual users of ExoPlayer.
#player-to-common
PiperOrigin-RevId: 353637924
These tests are performing offline-centric assertions using a streaming
licence. They need to be reconfigured to use a new offline-centric
licence that sets the correct duration fields (rental_duration_seconds
and playback_duration_seconds).
PiperOrigin-RevId: 350550971