426 Commits

Author SHA1 Message Date
olly
7a03e8edc0 Add NonNull to testutil.truth
PiperOrigin-RevId: 286185549
2019-12-18 18:53:48 +00:00
bachinger
36fa9d5a43 add top-level playlist API
Design doc: https://docs.google.com/document/d/11h0S91KI5TB3NNZUtsCzg0S7r6nyTnF_tDZZAtmY93g/edit

Issue: #6161, #5155
PiperOrigin-RevId: 286020313
2019-12-18 18:52:51 +00:00
tonihei
021291b38f Add server-client time offset to Window.
This offset allows to improve the calculated live offset because it
can take known client-server time offsets into account.

PiperOrigin-RevId: 285970738
2019-12-18 18:52:11 +00:00
kimvde
fcfc4eb5b6 Add FlacExtractorSeekTest
PiperOrigin-RevId: 285823771
2019-12-18 18:51:15 +00:00
kimvde
3e4baa101c Implement seeking from seektable in FLAC extractor
PiperOrigin-RevId: 285799995
2019-12-18 18:51:00 +00:00
olly
2fe3e188a9 FakeTrackOutput: Throw if sample size exceeds maxInputSize
This indicates the extractor has output a Format with a specified
maxInputSize that's too small. Failing in FakeTrackOutput ensures
this doesn't happen during Extractor tests.

PiperOrigin-RevId: 285776069
2019-12-18 18:50:52 +00:00
olly
4eb06373b1 Manual rollback of b3f485d7d9
It's technically possible to output a seekable SeekMap with unknown duration. This can occur if the media defines seek points but doesn't define either the overall duration or the duration of the media from the last seek point to the end.

PiperOrigin-RevId: 285769121
2019-12-18 18:50:44 +00:00
olly
53ec532a0e Add more SeekMap assertions, and "fix" MatroskaExtractor
In MatroskaExtractor, if the last cue time exceeds the duration
specified in the header, then we end up generating a negative
duration chunk as the last item in the SeekMap. We should probably
not do this, so drop it instead.

Note: Matroska does have a CueDuration element, but it's not used
in the one problematic file I've found.
PiperOrigin-RevId: 285738418
2019-12-18 18:50:28 +00:00
olly
b3f485d7d9 Add an additional sanity check to FakeExtractorOutput
PiperOrigin-RevId: 285422885
2019-12-18 18:49:41 +00:00
olly
b7b3a15855 Make it easier to update extractor test dump files
PiperOrigin-RevId: 285407744
2019-12-18 18:49:25 +00:00
ibaker
38e9213a9d Use SpannedSubject in WebvttCueParserTest
This is a useful test to see if it works well in a real situation.

PiperOrigin-RevId: 285386471
2019-12-13 15:22:39 +00:00
olly
59083c9f1c Suppress rawtypes warning when instantiating generic array
Change FakeAdaptiveMediaPeriod back to this style for consistency.

PiperOrigin-RevId: 284967667
2019-12-11 13:46:39 +00:00
kimvde
a95c28a929 Implement binary search seeking for FLAC extractor
PiperOrigin-RevId: 284814594
2019-12-11 13:45:43 +00:00
ibaker
7263699c2e Create Truth SpannedSubject for style assertions
This will be used in subtitle decoding tests

I followed this guide: https://truth.dev/extension.html

PiperOrigin-RevId: 284787298
2019-12-11 13:45:11 +00:00
ibaker
5da510cf00 Fix generics warning in FakeAdaptiveMediaPeriod.
Remove all generic arrays from this class.

FakeAdaptiveMediaPeriod.java:171: warning: [rawtypes] found raw type: ChunkSampleStream
    return new ChunkSampleStream[length];
               ^
  missing type arguments for generic class ChunkSampleStream<T>
  where T is a type-variable:
    T extends ChunkSource declared in class ChunkSampleStream

PiperOrigin-RevId: 284761750
2019-12-11 13:44:39 +00:00
kimvde
70ba4b197c Add peek() method to ExtractorInput
PiperOrigin-RevId: 284586799
2019-12-10 12:37:02 +00:00
olly
a9b327d932 Rollback of 2462aeb443
*** Original commit ***

Add peek() method to ExtractorInput

***

PiperOrigin-RevId: 284539719
2019-12-09 16:31:27 +00:00
kimvde
2462aeb443 Add peek() method to ExtractorInput
PiperOrigin-RevId: 284537150
2019-12-09 16:31:12 +00:00
bachinger
74faa3aa9f rename setMediaItem to setMediaSource
PiperOrigin-RevId: 284514142
2019-12-09 16:30:56 +00:00
ibaker
32f02107b4 Stop disabling InvalidPackage now we're on JUnit 4.13
PiperOrigin-RevId: 283995105
2019-12-06 19:20:29 +00:00
ibaker
cad2fe3955 Upgrade to JUnit 4.13-rc-2
PiperOrigin-RevId: 283994812
2019-12-06 19:20:21 +00:00
bachinger
f25bcedf72 Playlist API: submit ahead some files of the playlist API CL
PiperOrigin-RevId: 283988536
2019-12-06 19:20:13 +00:00
andrewlewis
cbdf45aa5f Verify metadata in extractor tests
PiperOrigin-RevId: 283960017
2019-12-06 19:19:50 +00:00
olly
cb873dd1ee Use play and pause convenience methods
PiperOrigin-RevId: 283949259
2019-12-06 19:19:18 +00:00
tonihei
72d5b425d3 Add IntDefs for renderer capabilities.
This simplifies documentation and adds compiler checks that the correct values
are used.

PiperOrigin-RevId: 283754163
2019-12-05 10:20:15 +00:00
tonihei
65c4a58825 Use Util method to create Handler instead of using deprecated method.
Calls to new Handler() without arguments are deprecated as of the latest Android
version. Replace them by a Util.createHandler call similar to the ones we
already have.

PiperOrigin-RevId: 283532891
2019-12-04 09:59:44 +00:00
tonihei
b84bde0252 Prevent stuck playback if shouldContinueLoading returns false
If LoadControl.shouldContinueLoading returns false and the renderers are not
ready for playback using the already buffered data, playback is stuck.

To prevent this situation, we always continue loading if the buffer is almost
empty. We already have a similar workaround for when
LoadControl.shouldStartPlayback returns false even if loading stopped.

Having both workarounds allows playback to continue even if the LoadControl
tries to prevent loading and playing all the time.

PiperOrigin-RevId: 283516750
2019-12-04 09:59:30 +00:00
kimvde
b18650fdcf Expose metadata in FLAC extractor
PiperOrigin-RevId: 281538423
2019-11-22 15:09:17 +00:00
aquilescanta
f6afbe6cb0 Make MediaLoadData a top level class
In order to reuse it in LoadErrorHandlingPolicy.

PiperOrigin-RevId: 281333287
2019-11-22 15:08:16 +00:00
aquilescanta
95d0921114 Make LoadEventInfo a top level class
In order to reuse it in LoadErrorHandlingPolicy.

PiperOrigin-RevId: 281087397
2019-11-18 17:55:51 +00:00
olly
1ef345192c Clean up non-trivial track selection deprecation
PiperOrigin-RevId: 281051893
2019-11-18 17:55:04 +00:00
andrewlewis
be03c08410 Add test for becoming noisy handling
To trigger receiving the broadcast it's necessary to idle() the shadow
main looper, which has to be done from the test thread. Therefore this
change removes the send broadcast action and instead sends the broadcast
from the test thread.

PiperOrigin-RevId: 279660935
2019-11-15 05:13:23 +00:00
bachinger
cd2c1f2f24 Playlist API: Add setMediaItem() and prepare()
PiperOrigin-RevId: 278867153
2019-11-15 05:11:45 +00:00
olly
4570cd37c5 Testutils: Add missing Javadoc + Misc cleanup
PiperOrigin-RevId: 278835106
2019-11-15 05:11:36 +00:00
kimvde
c8170e18d0 Update AndroidX Test versions to latest
Split the version of the sublibraries because their latest version
number is different. See
https://developer.android.com/jetpack/androidx/releases/test#1.2.0.

PiperOrigin-RevId: 278585090
2019-11-05 16:18:38 +00:00
olly
9842ea7f22 Move classes that don't belong in testutils out of testutils
PiperOrigin-RevId: 278401000
2019-11-05 16:18:24 +00:00
olly
5968c8345b Remove auto-value dependency
PiperOrigin-RevId: 278398045
2019-11-05 16:18:09 +00:00
olly
5ff7f3a17e Remove pointless arithmetic
PiperOrigin-RevId: 277706810
2019-11-05 16:14:19 +00:00
bachinger
01a4cf98d5 add default methods isSingleWindow and getInitialTimeline to MediaSource interface
PiperOrigin-RevId: 277695826
2019-11-05 16:14:03 +00:00
bachinger
e6e2dcc58d Rollback of 36f8bd78f7
*** Original commit ***

Rollback of 4ad4e3e4fc

*** Original commit ***

Rollback of 3b22db33ba

*** Original commit ***

add top-level playlist API to ExoPlayer

Public design doc:
https://docs.google.com/document/d/11...

***

PiperOrigin-RevId: 275813737
2019-10-30 08:46:42 +00:00
ibaker
93f2dd8deb Switch test usages of ConditionVariable#block(timeout) to CountDownLatch
ConditionVariable.block(timeout) doesn't work in Robolectric, because it
relies on the system clock which doesn't advance.

PiperOrigin-RevId: 275798281
2019-10-30 08:46:33 +00:00
tonihei
4e667b899d Fix NPE in FakeAdaptiveMediaPeriod.
The compositeSequenableLoader was causing NPEs in isLoading. Initializing it
upfront prevents this problem and is in line with what we do in all real
MediaPeriods.

PiperOrigin-RevId: 275491511
2019-10-30 08:46:23 +00:00
bachinger
36f8bd78f7 Rollback of 4ad4e3e4fc
*** Original commit ***

Rollback of 3b22db33ba

*** Original commit ***

add top-level playlist API to ExoPlayer

Public design doc:
https://docs.google.com/document/d/11h0S91KI5TB3NNZUtsCzg0S7r6nyTnF_tDZZAtmY93g

Issue: #6161

***

***

PiperOrigin-RevId: 275276158
2019-10-18 17:42:03 +01:00
olly
46c6f260f5 Add test action for setting audio attributes
Also removed "to be executed" from all the comments, since it
didn't seem to add value.

PiperOrigin-RevId: 274139837
2019-10-13 12:40:52 +01:00
samrobinson
f326f7110f Added SendBroadcast as an Action.
Removed a redundant TestSimpleExoPlayer subclass.

PiperOrigin-RevId: 272681643
2019-10-04 13:32:19 +01:00
olly
3c235dfc1f Make factories return specific types
PiperOrigin-RevId: 272614917
2019-10-04 13:31:40 +01:00
tonihei
4f640bc62e Add SequencableLoader.isLoading
This method allows the player to figure out whether we still have an ongoing
load even if LoadControl.shouldContinueLoading returns false.

PiperOrigin-RevId: 272445577
2019-10-02 21:30:07 +01:00
tonihei
dd4f9bcaae Add Timeline.Window.isLive
This flag is currently merged into Window.isDynamic, which isn't always true
because
1. A window can be dynamic for other reasons (e.g. when the duration is still
missing).
2. A live stream can be become non-dynamic when it ends.

Issue:#2668
Issue:#5973
PiperOrigin-RevId: 271999378
2019-10-02 21:28:43 +01:00
bachinger
4ad4e3e4fc Rollback of 3b22db33ba
*** Original commit ***

add top-level playlist API to ExoPlayer

Public design doc:
https://docs.google.com/document/d/11h0S91KI5TB3NNZUtsCzg0S7r6nyTnF_tDZZAtmY93g

Issue: #6161

***

PiperOrigin-RevId: 270728267
2019-10-02 21:25:39 +01:00
bachinger
216f74ecc7 avoid unexpected state changes with certain playlist states
With the internal playlist some new situation may happen that were not possible before:

- handlePlaylistInfoRefreshed in EPII called in IDLE state
- handlePlaylistInfoRefreshed in EPII called in ENDED state with an empty playlist
- seeks in ENDED state with an empty playlist

PiperOrigin-RevId: 270316681
2019-09-22 00:15:43 +01:00