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
This simulates reading from the buffer (which is what actual
renderers would do). Otherwise the buffer always gets expanded
and might cause memory issues.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167994899
In this case the playback state transitions to IDLE, which isn't
caught so far. (This code is equivalent to the one in ExoHostedTest.java)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167980981
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
This appears to be fixed in Oreo, but given how harmless
the workaround is we can probably just apply it on all
API levels to be sure.
Issue: #3160
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167709070
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
When creating PlaybackControlView inside SimpleExoPlayerView,
we want certain attributes to be passed through. This lets you
set control attributes on the SimpleExoPlayerView directly. We
don't want all attributes to be propagated though; only our own
custom ones.
Not sure if there's a cleaner way to do this. Pragmatically this
solution seems ... ok :)?
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167619801
This allows to use a fake clock and an action schedule with timed delays
together.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167582860
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
In order to retrieve the data set, the track selection index was used, but
the data set is actually indexed by track group indices.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167566049
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
Using the same sampler introduced some minor horizontal scratches.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167347995
We currently switch without downloading overlapping segments, but
we do not actually switch more aggressively. This change fixes
this. Note there's an implicit assumption made that if one media
playlist declares independent segments, the others will too. This
is almost certainly true in practice, and if it's not the penalty
isn't too bad (the player may try and switch to a higher quality
variant one segment's worth of buffer too soon).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167120992
The bytesRemaining didn't always take into account any skipped bytes, which
meant that reaching the end of the file was not correctly detected in read().
Issue: #3216
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167016672
UTF-8 is the default charset on Android so this should be a no-op change, but
makes the code portable (in case it runs on another platform).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167011583