This allows simplified listener implementations as most listeners
will not listen to all possible notifications.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170177821
This includes both cbcs and cenc. Will only work for streams that require a single
pssh.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169382884
There's no reason to perform the discontinuity check or skip
the adaptation field if we don't have a payload reader for
the packet.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169374609
This fixes infinite loop in LeastRecentlyUsedCacheEvictor.evictCache when index store fails.
Also made CachedContentIndex not final so it can be mocked and added a package protected SimpleCache
constructor so mock index can be injected.
Issue: #3260
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169249517
This case may happen if the max span size is more than the max size the
evictor is configured.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169101093
1- Avoid dropped buffers by using a PriorityQueue instead of a set.
2- Process the end of stream after non-EOS buffers.
Issue:#3250
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169077365
1. Only tell sessions that want provisioning when provisioning occurs.
2. Also propagate failure to provision to these sessions.
3. If a session responsible for provisioning is released, start
provisioning using another session instead.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168713918
- MediaDrmEventListener.onEvent is typically called on the
app's main thread. mediaDrmHandler is instantiated on the
playback thread. Hence mediaDrmHandler should be volatile
to ensure visibility.
- Nulling mediaDrmHandler could result in a NPE in onEvent.
Instantiate mediaDrmHandler (and don't null it again) to
avoid this. MediaDrmHandler.handleMessage will correctly
discard any events for sessions that are now closed.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168707938
AdsMediaSource lives in the core library so only ImaAdsLoader remains in
the ima extension. AdsMediaSource takes an AdsLoader implementation.
ImaAdsMediaSource is deprecated rather than removed for now.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168707921
Currently, to make transition to next media period seamless, after the renderer
has read until the end of the current SampleStream, we may send it the next
SampleStream so the renderer may read from the next SampleStream ahead of the
transition.
For NoSampleRenderer, we should avoid doing this: skipping ahead for such
renderer doesn't have any benefit (the renderer does not consume data from
SampleStream), and it will change the provided rendererOffsetUs while the
renderer is still rendering from the playing media period.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168669800
This allows listeners to easily determine the source of the discontinuity.
Reasons can be period transitions, seeks, and internal reasons.
Listeners still using the deprecated ExoPlayer.EventListener interface were
updated to Player.EventListener.
GitHub: #3252
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168549612
Remove gapless functionality that relies on MediaCodec, and implement this in
an AudioProcessor instead.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168547487
Currently our Renderer is always associated with and consume data from
some SampleStreams, which were constructed from the provided MediaSource.
There are use-cases, in which the users want to have simple Renderer
implementation that does not consume data from SampleStream at all, but
render using their custom logic at each rendering position - they mostly just
need ExoPlayer to keep track of the playback position and enable/disable the
renderer.
This CL adds support for such Renderer by adding a TRACK_TYPE_NONE.
Renderer of such type will be:
- Associated with null TrackSelection as the result of track-selection
operation.
- Associated with EmptySampleStream.
GitHub: #3212
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168545749
In live streaming, if the playback position is very close to live edge,
the buffered duration will never reach minDurationForQualityIncreaseMs,
which prevents switching from ever happening. So we will provide the
durationToLiveEdgeUs to AdaptiveTrackSelection in live streaming case,
so it can handle this edge case.
GitHub: #3017
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168535969
The release callback handler in Loader might not be alive
anymore. Catch this case to prevent warnings about sending
messages on dead threads.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167996538
Remaining instrumentation tests either use android.os.Handler or rely on assets.
In the latter case, the tests are difficult to migrate due to differences
between the internal and external build systems, and configuration needed in
Android Studio. In addition, SimpleCacheSpanTest remains as an instrumentation
test because it fails due to a problem with string encoding on the internal
build (and two other tests in its package are kept with it because they depend
on it).
This test removes a dependency from testutils on Mockito, as a different
version of Mockito needs to be used for instrumentation tests vs Robolectric
tests, yet both sets of tests need to rely on testutils. Mockito setup is now
done directly in the tests that need it.
Move OggTestData to testutils so it can be used from both instrumentation and
Robolectric tests.
It may be possible to simplify assertions further using Truth but this is left
for possible later changes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167831435
Everything should go through the ExoMediaDrm layer. We still
need to abstract away the android.media exception classes, but
this is left as future work.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167710213
Reporting incorrect positions for ad playbacks was causing IMA to
think the ad wasn't playing, when in fact it was.
Issue: #3180
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167702032
Also pass an unresolved end point to ClippingMediaPeriod. This removes some
assertions checking timestamps in the ClippingMediaPeriod, but makes it
possible to identify when the end point is at the end of the media.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167683358
The default implementation is just calling through to handler.postDelayed,
while the fake clock uses its internal time value to trigger the handler
calls at the correct time.
This is useful to apply a fake clock in situations where a handler is used to
post delayed messages.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167567914
Currently FlacDecoder/FlacExtractor always perform resampling to 16bit. In some
case (with 24bit audio), this might lower the audio quality if the system
supports 24bit audio.
Since AudioTrack implementation supports resampling, we will remove the
resampling step, and return an output with the same bits-per-sample as the original stream.
User can choose to re-sample to 16bit in AudioTrack if necessary.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167494350