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
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
*** Reason for rollback ***
Doesn't work because trackOutputProvider can be null when extracting init data.
*** Original change description ***
Don't copy primary-track format to non-primary tracks
Copying non-primary-track formats to non-primary tracks
looks non-trivial (I tried; went down a dead-end), so
leaving that for now.
***
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166883654
1. Make LeanbackPlayerAdapter use a ControlDispatcher. This
allows apps to suppress control events in some circumstances,
and is in-line with our mobile controls.
2. Misc simplifications and cleanup to LeanbackPlayerAdapter.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166852816
Also workaround the non-repeatable queue and fix other minor issues.
Issue:#2283
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166848894
This mapping when we call into platform components also needs
to be applied when creating the MediaCrypto instance. The fix
is to stop propagating the UUID through all the createMediaCrypto
methods. This is unnecessary, since the eventual target already
knows its own UUID!
Issue: #3138
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166843372
Copying non-primary-track formats to non-primary tracks
looks non-trivial (I tried; went down a dead-end), so
leaving that for now.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166843123
Both cases were not supported so far. Added tests which all failed in the
previous code version and adapted the concatenated media sources to cope with
empty timelines and empty concatenations.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166480344
This is mostly connecting the already stored shuffleMode with the timeline queries
for the playback order.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166199330
The media source is initialized with a DefaultShuffleOrder which can be changed at
any time. Whenever the list of media source is changed, the shuffle order is adapted
accordingly (either on the app thread if the player is not prepared yet, or on the
player thread). The shuffle order is then used to construct the timeline.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166198488
The media source is initialized with a DefaultShuffleOrder which can be changed at
any time. This shuffle order is then used within the corresponding timeline.
The isRepeatOneAtomic flag is extended to also suppress shuffling (now called
isAtomic only).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166197184
Make getMediaFormat protected so that subclasses can set additional MediaFormat
keys. For example, if the decoder output needs to be read back via an
ImageReader as YUV data it is necessary to set KEY_COLOR_FORMAT to
COLOR_FormatYUV420Flexible.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166195211
The implementation in the abstract base class takes care to forward the queries
to the correct methods given the shuffle mode and a given shuffle order.
All concatenated timeline implementations use an unshuffled order so far. The
handling of the shuffle orders will follow in other changes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166191165
In addition, let unit test assert window indices for both shuffle modes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166191069
This functionality is most likely needed by UI modules which currently need
to obtain the timeline, the current repeat and shuffle modes and are only then
able to query the next/previous window index using this information.
Adding these methods simplifies these cumbersome requests.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166181202
This allows to test the expected behaviour of timeline with different shuffle modes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166181091
This parameter is used by methods such as getNextWindowIndex
and getPreviousWindowIndex to determine the playback order.
Additionally, there are method to query the first and last
window index given the shuffle mode.
None of the timeline implementations nor the ExoPlayer
implementation supports shuffling so far.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166170229
The shuffle mode is saved using a message on the playback thread.
After setting the shuffle mode, the same media period holder verification
as for repeat mode changes gets executed.
Note: the shuffle mode is not used yet to change the playback order.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166060231