8312 Commits

Author SHA1 Message Date
ibaker
c6bf6aae2a Rename DefaultDrmSessionEventListener to DrmSessionEventListener
Part of issue:#6765

PiperOrigin-RevId: 299319146
2020-03-10 10:20:10 +00:00
ibaker
eeab811301 Add EventDispatcher to DrmSession(Manager) acquire & release calls
This is passed in but not currently used. I'll use it in follow-up
changes.

Pre-work for issue:#6765

PiperOrigin-RevId: 299314341
2020-03-10 10:20:01 +00:00
krocard
1f4156ce6d Restore the demo list position on start
It's quite anoying to have to search in the list
the last item played everytime the demo is restarted.

Fix that by saving and restoring it.

PiperOrigin-RevId: 299109261
2020-03-10 10:19:53 +00:00
aquilescanta
47b62e8c02 DataReader: replace InterruptedException with InterruptedIOException
PiperOrigin-RevId: 299092243
2020-03-10 10:19:45 +00:00
christosts
fbf865726c Fix flaky AsynchronousMediaCodecAdapterTest
PiperOrigin-RevId: 299057572
2020-03-10 10:19:36 +00:00
bachinger
4517829610 add DefaultMediaSourceFactory and use it in PlayerActivity
PiperOrigin-RevId: 298879027
2020-03-10 10:19:27 +00:00
tonihei
b5976a55ff Upgrade Kotlin annotations and fix gradle warnings
The new version fixes some warnings in Gradle builds. Also
add missing indirect compileOnly dependencies to fix some more warnings

Issue:issue:#7007
PiperOrigin-RevId: 298855510
2020-03-10 10:19:19 +00:00
tonihei
05443d1e9e Upgrade gradle plugin to 3.6.0
PiperOrigin-RevId: 298844826
2020-03-10 10:19:11 +00:00
tonihei
0339a33430 Rename EPII.copyWithNewPosition to handlePositionDiscontinuity
The new name better reflects the purpose of the method.

PiperOrigin-RevId: 298835578
2020-03-10 10:19:02 +00:00
tonihei
8b9f7c5628 Add test to ensure AdsLoader is initialized.
This tests explicitly that initialization happens even if the Timeline
is a placeholder.

No other change is needed. While the Timeline is still a placeholder
ImaAdsLoader.getCurrentPeriodPosition will return 0 and trigger
pre-rolls (intended behaviour) and it doesn't matter whether the
actual initial period position may be somewhere else.

PiperOrigin-RevId: 298833867
2020-03-10 10:18:54 +00:00
aquilescanta
2b88961bc1 Add ExoMediaDrm.OnExpirationUpdateListener
Which mirrors MediaDrm.OnExpirationUpdateListener.

PiperOrigin-RevId: 298826713
2020-03-10 10:18:46 +00:00
tonihei
61935e14bf Add option to pause at end of stream to ExoPlayerImplInternal
This option marks streams as final such that renderers play them out
completely, then waits until this happened, and then sets the player
to paused. After that, the player can continue to read the next period
to quickly resume playback if needed.

PiperOrigin-RevId: 298824745
2020-03-10 10:18:37 +00:00
ibaker
e88e889c95 Extract MediaSourceEventDispatcher from MediaSourceEventListener
Update it to allow any listener class to be registered (and thus
require the caller of dispatch() to provide the type of listener
to call).

Maintain MediaSourceEventListener.EventDispatcher as a sub-class
for now so that all existing references continue to work. This
avoids creating a huge diff in one CL. The intention is to in-line
these incrementally.

This is pre-work for issue:#6765

PiperOrigin-RevId: 298818198
2020-03-10 10:18:29 +00:00
kimvde
f204e4df7d Add setCoreFlacExtractorFlags on DefaultExtractory
PiperOrigin-RevId: 298816694
2020-03-10 10:18:21 +00:00
andrewlewis
470ec9e5d1 Init the ads manager for placeholder timelines
It looks like loading ad cue points would cause a source info refresh
causing the content media period load to be canceled, meaning we would
never get a non-placeholder timeline.

This changes ensures that the ads manager will still be initialized,
avoiding playback getting stuck when playing a ProgressiveMediaPeriod
with a preroll ad.

PiperOrigin-RevId: 298814758
2020-03-10 10:18:13 +00:00
olly
d8ea1f60af Annotate tests to use Robolectric's LEGACY LooperMode.
The default Robolectric Looper simulation mode is changing to PAUSED from LEGACY.
The following tests fail in this new mode, and are thus being defaulted to LEGACY.

For more details see ​go/robolectric-legacy-looper-mode-lsc

Cleanup change automatically generated by error-prone refactoring
//third_party/android/androidx_test/tools/errorprone/java/androidx/test/tools/errorprone:LegacyLooperModeConverter_refactoring

Tested:
    TAP train for global presubmit queue
    http://test/OCL:297627974:BASE:298600828:1583273401491:7d94dbaa
PiperOrigin-RevId: 298809656
2020-03-10 10:18:05 +00:00
ibaker
63256a48d4 Disable text selection in SubtitleWebView
PiperOrigin-RevId: 298605366
2020-03-10 10:17:56 +00:00
krocard
58f42e9f8b Annotate render's read source result
So that swich case has a warning if all case are not
covered.

PiperOrigin-RevId: 298574013
2020-03-10 10:17:48 +00:00
ibaker
7bfd2b27eb Start generating HTML from Span-styling in SubtitleWebView
PiperOrigin-RevId: 298565231
2020-03-10 10:17:39 +00:00
bachinger
eb3ea92806 remove unnecessary null-check
PiperOrigin-RevId: 298559123
2020-03-10 10:17:31 +00:00
olly
f248a10627 [AVOD] Added if empty checks for streamKeys.
DashMediaSource is created with Manifest data and streamKeys can be empty given that streamKeys are only created out of MediaItem inside DashMediaSource, and this particular implementation don't extract them out of MediaItem properties.

Tested=Verified playback works.
PiperOrigin-RevId: 298550021
2020-03-10 10:17:23 +00:00
Oliver Woodman
aeea17dd0f Merge pull request #6999 from xufuji456:dev-v2
PiperOrigin-RevId: 298544278
2020-03-10 10:17:13 +00:00
bachinger
d1bbd3507a add media item to create media sources
This change adds the createMediaSource(MediaItem mediaItem) method to the MediaSourceFactory interface. It doesn't deprecate createMediaSource(Uri uri) to keep the cl smaller. Deprecation and removing calls to the deprecated method from within the library and extension follow in a separate CL.

PiperOrigin-RevId: 298352442
2020-03-10 10:17:03 +00:00
andrewlewis
9c1c74ecc4 Rename .unklen.dump -> .unknown_length.dump
PiperOrigin-RevId: 298334502
2020-03-10 10:16:54 +00:00
tonihei
b095fd57e6 Extend test case to cover existing and potential bug conditions.
PiperOrigin-RevId: 298334500
2020-03-10 10:16:45 +00:00
Oliver Woodman
06e1651612 Merge pull request #7026 from DolbyLaboratories:dev-v2-test-assets
PiperOrigin-RevId: 298317097
2020-03-10 10:16:35 +00:00
ibaker
2f4e88d5af Remove ByteBufferBackingArray suppression from metadata decoders
PiperOrigin-RevId: 298312222
2020-03-10 10:16:25 +00:00
ibaker
ea51e6ee8e Re-format the unreleased section of RELEASENOTES.md
The auto-formatter wants it to look like this, and will reformat
the whole list when an item is added, so let's put that diff in a
standalone change.

PiperOrigin-RevId: 298305479
2020-03-10 10:16:16 +00:00
tonihei
a12d72c72c Fix flakiness in SimpleDecoderVideoRendererTest
The test had two problems:
 1. It posts messages using a Handler and we need to idle the main looper
    to actually deliver this message.
 2. SimpleDecoder uses a background thread that is not within our control
    from the test. Ensure the decoding happens after we queue input buffers
    by using a lock.

PiperOrigin-RevId: 298300175
2020-03-10 10:16:08 +00:00
andrewlewis
0b946ac317 Move max encoded audio rates to format utils
PiperOrigin-RevId: 298290511
2020-03-10 10:16:00 +00:00
andrewlewis
2ca363316c Fix typo
PiperOrigin-RevId: 298288236
2020-03-10 10:15:52 +00:00
olly
a6d0caaa3c Drop prefix test- from test methods under v2/library
This is one step toward following the google3's test naming convention.
See go/java-testing/getting_started#basic-test-template for details
why prefix test isn't necessary.

This CL is generated by following command
$ find -name '*Test.java' | xargs -I{} sed -i 's/^\ \ public\ void\ test\([A-Z]\)\(.*\)$/  public void \L\1\E\2/' {}

and then manually modified following tests where test method names conflict with test target.
- VorbisUtilTest
- VorbisReaderTest
- UtilTest
- DownloadManagerDashTest
- DefaultOggSeekerTest
- OggPageHeaderTest
- HlsMasterPlaylistParserTest

PiperOrigin-RevId: 298074653
2020-03-10 10:15:43 +00:00
bachinger
c1258e7e9f add getter/setter of skipSilenceEnable to AudioComponent
PiperOrigin-RevId: 298070828
2020-03-10 10:15:33 +00:00
olly
67b29bbe39 Format.Builder: Finish migration
Issue: #5978
PiperOrigin-RevId: 297876336
2020-02-28 18:43:04 +00:00
christosts
0649c7b958 MediaCodecRenderer: apply rendering limit on feed
PiperOrigin-RevId: 297873726
2020-02-28 18:42:56 +00:00
olly
4c1f0c40ce Format.Builder: Simplify some test classes
PiperOrigin-RevId: 297865356
2020-02-28 18:42:48 +00:00
olly
3730639c95 Don't set decoded bitrate on audio/flac format
PiperOrigin-RevId: 297864386
2020-02-28 18:42:39 +00:00
andrewlewis
1ca9a061b1 Split AAC utils out of CodecSpecificDataUtil
PiperOrigin-RevId: 297823929
2020-02-28 18:42:30 +00:00
tonihei
ffdc5805bd Remove dependency on legacy Robolectric Looper mode
The default will soon change to Looper mode PAUSED. Some parts of our code
relies on the legacy behaviour when setting set SystemClock and expecting
pending messages to be delivered. With the new mode, we need to explicitly
request to idle the main looper so that pending messages can be delivered.

PiperOrigin-RevId: 297814964
2020-02-28 18:42:22 +00:00
tonihei
6c7a2c3cfd Ensure seeks are not ignored in ended state.
We should only ignore seek to the current position if we are
currently READY or BUFFERING. Also, pending initial seek positions
should only be saved while we have an empty timeline, independent of
the player state.

Issue:#6886
PiperOrigin-RevId: 297813854
2020-02-28 18:42:13 +00:00
tonihei
68c401b53e Mark initial progressive source Timeline as placeholder
This is more accurate since it's just a placeholder and none of the
values is provided by the media.

It also allows to fix a problem in ClippingMediaSource where we
couldn't detect a clipping error because we didn't know if the
timeline is a placeholder or not.

Issue:#5924
PiperOrigin-RevId: 297813606
2020-02-28 18:42:05 +00:00
tonihei
697165ce56 Enable window-period offset in tests by default.
This ensures all player interactions in tests automatically verify that
timestamps calculations are done correctly.

PiperOrigin-RevId: 297813324
2020-02-28 18:41:56 +00:00
tonihei
28cefe12c5 Don't ignore first period when updating information to new Timeline.
This while loop started with the second period in the queue and the
first one was always ignored.

PiperOrigin-RevId: 297812937
2020-02-28 18:41:48 +00:00
tonihei
91a87b3fa0 Prevent deletion of unprepared periods.
When a new Timeline arrives in the Player, we check whether we can keep
existing MediaPeriods. This check currently involves a condition that
checks if the MediaPeriod is already prepared. The only reason we do
that is to avoid calling MediaPeriod.seekToUs, which is not allowed
on an unprepared MediaPeriod.

It's better to keep the MediaPeriod to prevent restarting the
preparation process. The prepration check can move further down to the
place right before we would call seekToUs.

PiperOrigin-RevId: 297812584
2020-02-28 18:41:39 +00:00
tonihei
3ef0015817 Ensure to update all existing MediaPeriodInfo to new Timeline
AnalyticsCollector keeps a list of existing MediaPeriodInfo that need
to be updated to new Timelines when they arrive. This already
happens in all cases except that the playingMediaPeriod wasn't updated
when it didn't change during the timeline update.

PiperOrigin-RevId: 297812038
2020-02-28 18:41:30 +00:00
tonihei
3b1b2951e4 Clarify/fix position reference points for AdPlaybackState.
The positions were interchangeably used with window and period
positions. This change more clearly ensures that all positions in the
AdPlaybackState are based on periods and that we use the right adjustments
for all usages.

PiperOrigin-RevId: 297811633
2020-02-28 18:41:22 +00:00
andrewlewis
64feb97d62 Add codecs string to extractor dumps
PiperOrigin-RevId: 297806457
2020-02-28 18:41:13 +00:00
olly
db97d0c37c Format.Builder: Migrate MatroskaExtractor
Selection flags and language tags appear to apply to all tracks
in MKV, so I think the change in output is correct.

PiperOrigin-RevId: 297646190
2020-02-28 18:41:04 +00:00
kimvde
56dbe83a4c Extractor tests: dump only non-default values for format
This removes noisy data from the dump files and allows updating less
dump files if a format field is added, removed or updated.

PiperOrigin-RevId: 297617138
2020-02-28 18:40:54 +00:00
ybai001
40df646a07 Add AC3 and EAC3-JOC Test Assets 2020-02-28 19:32:01 +08:00