368 Commits

Author SHA1 Message Date
andrewlewis
2112b722b5 Add missing @Player.State in action schedule
PiperOrigin-RevId: 309735092
2020-05-29 21:15:17 +01:00
olly
1772b0d917 ConditionVariable: Fix block(long) to correctly handle large timeouts
PiperOrigin-RevId: 308815613
2020-05-27 20:35:00 +01:00
olly
9213ffafa8 ConditionVariable: Improve documentation and allow clock injection
- Improve documentation explaining the benefits of ExoPlayer's ConditionVariable
  over the one that the platform provides
- Allow Clock injection
- Create TestUtil method for obtaining a ConditionVariable whose block(long)
  method times out correctly when used in a Robolectric test
- Add basic unit tests for ConditionVariable

PiperOrigin-RevId: 308812698
2020-05-27 20:33:54 +01:00
christosts
3ac4c1a6e5 Add Clock#currentTimeMillis()
PiperOrigin-RevId: 306602043
2020-05-27 20:31:38 +01:00
olly
e6b5e6eb6e Merge trick play tracks into main track groups
Issue: #6054
PiperOrigin-RevId: 307285068
2020-05-27 19:36:27 +01:00
olly
ca11e56fe6 Add tests to validate FLAC decoder output
PiperOrigin-RevId: 289091494
2020-01-17 13:57:41 +00:00
kimvde
37e65ec0f2 Add FlacExtractorSeekTest
PiperOrigin-RevId: 285823771
2020-01-17 13:50:12 +00:00
kimvde
bf9f49a91b Implement seeking from seektable in FLAC extractor
PiperOrigin-RevId: 285799995
2020-01-17 13:50:01 +00:00
olly
80e3152e8c Make it easier to update extractor test dump files
PiperOrigin-RevId: 285407744
2020-01-17 13:49:18 +00:00
kimvde
910bd8bdc5 Implement binary search seeking for FLAC extractor
PiperOrigin-RevId: 284814594
2020-01-17 13:42:07 +00:00
kimvde
ff1efd4ec2 Add peek() method to ExtractorInput
PiperOrigin-RevId: 284537150
2020-01-17 13:39:27 +00:00
andrewlewis
023e141be8 Verify metadata in extractor tests
PiperOrigin-RevId: 283960017
2020-01-17 13:36:40 +00:00
kimvde
f09f62da4f Expose metadata in FLAC extractor
PiperOrigin-RevId: 281538423
2020-01-17 13:20:54 +00:00
olly
5e822e160e 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 19:27:59 +00:00
olly
88be178e0f 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 19:27:45 +00:00
olly
250a5deab5 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 19:27:27 +00:00
olly
d8951a2a38 Add an additional sanity check to FakeExtractorOutput
PiperOrigin-RevId: 285422885
2019-12-18 19:27:24 +00:00
olly
a4a9cc9fd0 Suppress rawtypes warning when instantiating generic array
Change FakeAdaptiveMediaPeriod back to this style for consistency.

PiperOrigin-RevId: 284967667
2019-12-11 13:49:45 +00:00
ibaker
6ebc9f96c8 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:49:38 +00:00
tonihei
e97b8347eb Add IntDefs for renderer capabilities.
This simplifies documentation and adds compiler checks that the correct values
are used.

PiperOrigin-RevId: 283754163
2019-12-06 23:23:42 +00:00
olly
8c3e6663d3 Clean up non-trivial track selection deprecation
PiperOrigin-RevId: 281051893
2019-11-19 15:09:57 +00:00
Oliver Woodman
21957bf783 Revert "add default methods isSingleWindow and getInitialTimeline to MediaSource interface"
This reverts commit 01a4cf98d551bdac161f1b845fe00aa1ccffda47.
2019-11-18 05:41:30 +00:00
Oliver Woodman
30ed83ecef Revert "Playlist API: Add setMediaItem() and prepare()"
This reverts commit cd2c1f2f24c3a17ffa59f0c5ba9d17d55f141793.
2019-11-18 05:41:20 +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