517 Commits

Author SHA1 Message Date
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
bachinger
3b22db33ba add top-level playlist API to ExoPlayer
Public design doc:
https://docs.google.com/document/d/11h0S91KI5TB3NNZUtsCzg0S7r6nyTnF_tDZZAtmY93g

Issue: #6161
PiperOrigin-RevId: 269584512
2019-09-18 23:23:13 +01:00
tonihei
e784d2c507 Add Player.isPlaying and Player.getPlaybackSuppressionReason
The player may suppress playback when waiting for audio focus even if the
state==Player.READY. There is currently no getter or callback to obtain this
piece of information for UI updates or analytics.

Also, it's a important derived state to know whether the playback position is
advancing. Add isPlaying and the corresponding callback to allow retrieving
this information more easily.

Issue:#6203
PiperOrigin-RevId: 268921721
2019-09-16 23:31:20 +01:00
aquilescanta
890700fa0f Push formatHolder up to the BaseRenderer class
PiperOrigin-RevId: 268431514
2019-09-13 13:50:09 +01:00
tonihei
77ed930251 Add Timeline.Window.uid.
This allows to uniquely identify a window within a Timeline. The value is set
correctly for all Window instances, but is not used anywhere yet.

PiperOrigin-RevId: 267556516
2019-09-10 10:27:07 +01:00
olly
0e7740f576 Clear FormatHolder before and after reading from the source.
PiperOrigin-RevId: 267135256
2019-09-05 10:48:45 +01:00
olly
2d0b10a73a Use constant to define androidx annotation version
PiperOrigin-RevId: 266801762
2019-09-05 10:45:08 +01:00
tonihei
33ef4184e8 Publish test utils modules as release artificats.
This allows external users to easily write unit tests involving ExoPlayer
instances.

Issue:#6267
PiperOrigin-RevId: 266741790
2019-09-05 10:43:52 +01:00
olly
a02237de20 Fix imports
PiperOrigin-RevId: 266676413
2019-09-01 22:03:52 +01:00
tonihei
20fd4e16d2 Deprecate setTag parameter in Timeline.getWindow.
There is no point in having this parameter as the tag should always be a single
immutable object instantiated at the time the Timeline is created or earlier.

So there is no preformance benefit and it's error-prone in case people
forget to set setTag=true.

PiperOrigin-RevId: 264117041
2019-08-23 17:00:53 +01:00