391 Commits

Author SHA1 Message Date
samrobinson
96c648c2d6 Improve customisability of FakeSampleStream.
PiperOrigin-RevId: 289829592
2020-01-16 13:51:18 +00:00
olly
3feb263cfe Fix nullability issues for testutil.truth
PiperOrigin-RevId: 289658098
2020-01-16 13:50:53 +00:00
andrewlewis
4c74f3cffd Make tests independent
PiperOrigin-RevId: 289521837
2020-01-16 13:50:44 +00:00
ibaker
b562e8687b Add {Relative,Absolute}SizeSpan support to SpannedSubject
I'll use this in TtmlDecoderTest

PiperOrigin-RevId: 289091526
2020-01-10 15:57:31 +00:00
olly
d24188f663 Add tests to validate FLAC decoder output
PiperOrigin-RevId: 289091494
2020-01-10 15:57:23 +00:00
ibaker
48f8a78f57 Simplify SpannedSubjectTest using helper methods
Suggested during the review of <unknown commit>

PiperOrigin-RevId: 289088296
2020-01-10 15:57:15 +00:00
ibaker
bae4d786e2 Add {Strikethrough,Alignment}Span support to SpannedSubject
I'm going to use these in TtmlDecoderTest

PiperOrigin-RevId: 288862274
2020-01-10 15:56:06 +00:00
ibaker
f22ac32c2c Relax the check in SpannedSubject.hasBoldItalicSpanBetween
Ultimately we only care if the style is both bold & italic, if some of
those are specified multiple times there's no problem.

PiperOrigin-RevId: 288862235
2020-01-10 15:55:57 +00:00
ibaker
e5eaacec20 Fix typo in SpannedSubject.hasBoldItalicSpanBetween
PiperOrigin-RevId: 288710939
2020-01-08 22:15:27 +00:00
ibaker
448db89446 Add TypefaceSpan and hasNoFooSpanBetween() support to SpannedSubject
Use these to migrate the last WebvttDecoderTest method to SpannedSubject

PiperOrigin-RevId: 288688620
2020-01-08 15:58:20 +00:00
ibaker
a98fc7ca48 Add tate-chu-yoko support to WebVTT decoding
PiperOrigin-RevId: 288285953
2020-01-06 14:56:20 +00:00
ibaker
2b1a066339 Add RubySpan support to SpannedSubject
PiperOrigin-RevId: 288280332
2020-01-06 14:55:45 +00:00
ibaker
1e7db22ee2 Convert StyleSpan assertions in SpannedSubject to fluent style
PiperOrigin-RevId: 288274998
2020-01-06 14:55:28 +00:00
ibaker
0587180f14 Make SpannedSubject more fluent
I decided the flags bit was a bit unclear so I played around with this

It's also needed for more 'complex' assertions like colors - I didn't
want to just chuck in a fourth int parameter to create:
hasForegroundColorSpan(int start, int end, int flags, int color)

PiperOrigin-RevId: 287989424
2020-01-06 14:54:44 +00:00
bachinger
06ffd23cdc make removeMediaItem return void
PiperOrigin-RevId: 286551438
2019-12-20 12:37:13 +00:00
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