2640 Commits

Author SHA1 Message Date
christosts
f47d06e7b3 Set ExoPlayer's MediaCodecOperationMode
PiperOrigin-RevId: 288868298
2020-01-10 15:56:30 +00:00
krocard
91d2b8581e Make MediaCodecRenderer.codec nullable
Also fix annotation style of the surrounding functions.

PiperOrigin-RevId: 288865420
2020-01-10 15:56:22 +00:00
ibaker
2c02f787bd Remove unused styles from TTML test data
PiperOrigin-RevId: 288862795
2020-01-10 15:56:13 +00:00
olly
1a9b301f52 Fix extension FLAC decoder to correctly handle non-16-bit depths
PiperOrigin-RevId: 288860159
2020-01-10 15:55:49 +00:00
andrewlewis
017a7cf38c Resolve TrueHD spec TODO
PiperOrigin-RevId: 288855515
2020-01-10 15:55:40 +00:00
Oliver Woodman
4f15cfaa78 Merge pull request #6836 from DolbyLaboratories:dev-v2-refineAC4
PiperOrigin-RevId: 288772277
2020-01-08 22:15:53 +00:00
kimvde
79edf7cce2 FlacExtractor: add condition for zero-length reads
This improves readability by making clearer that reading no bytes from
the input in readFrames() is an expected case if the buffer is full.

PiperOrigin-RevId: 288711841
2020-01-08 22:15:43 +00:00
tonihei
fa9bf9c828 Ensure seeks to new windows are reported as seeking.
Currently, seeks are only tracked if both the start and the end of the seek
is within the same window. This means no seeking state is reported if the
playback switches to a new window during the seek.

This problem is fixed by tracking seek start and end events in all cases,
but only report seeking state once the window becomes the foreground window.

PiperOrigin-RevId: 288706674
2020-01-08 22:15:18 +00:00
ibaker
14e401f53a Update TtmlDecoder to keep only one Span of each type
The current code relies on Android's evaluation order of spans, which
doesn't seem to be defined anywhere.

PiperOrigin-RevId: 288700011
2020-01-08 22:15:10 +00:00
ibaker
8e26505ee8 Fix what I think is a typo in WebVTT test data
Without the CSS tweak the additional test assertion fails.

PiperOrigin-RevId: 288698323
2020-01-08 22:15:02 +00:00
andrewlewis
762bc18a28 Fix TrueHD chunking in Matroska
Issue: #6845
PiperOrigin-RevId: 288688716
2020-01-08 15:58:28 +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
kimvde
ee091e6a45 Use FlacLibrary.isAvailable in FlacExtractor selection
PiperOrigin-RevId: 288667790
2020-01-08 15:58:12 +00:00
olly
63f90adef0 Add package level NonNull to extractor.ts
Also remove most classes from the nullness blacklist

PiperOrigin-RevId: 288494712
2020-01-08 15:57:56 +00:00
christosts
fb42f818ec Add start() method in MediaCodecAdapter
PiperOrigin-RevId: 288476415
2020-01-08 15:57:48 +00:00
ibaker
c5535e825e Fix null-checker suppression introduced by 3.0.1 upgrade
Suppression added in 6f9baffa0c

PiperOrigin-RevId: 288475120
2020-01-08 15:57:39 +00:00
ibaker
181606137d Remove assertCues() helper methods from WebvttDecoderTest
These make the interesting bits of each assertion harder to follow imo.

Also remove all the assertWithMessage() calls at the same time, Olly
convinced me these are rarely useful since you can click from the stack
trace to the failing line in the IDE.

PiperOrigin-RevId: 288470704
2020-01-08 15:57:31 +00:00
olly
692c8ee0ac Fix playback for Vivo codecs that output non-16-bit audio
PiperOrigin-RevId: 288468497
2020-01-08 15:57:22 +00:00
ibaker
09ca5c0783 Remove assertWithMessage() calls from SsaDecoderTest
As discussed with Olly, these don't add much info and are liable
to go stale.

PiperOrigin-RevId: 288463027
2020-01-08 15:57:06 +00:00
olly
9618e5e00f FlacExtractor: Fix possible skipping of frame boundaries
PiperOrigin-RevId: 288304477
2020-01-08 15:56:57 +00:00
olly
24743c77ce Remove WavExtractor from the nullness blacklist
PiperOrigin-RevId: 288292488
2020-01-06 14:56:28 +00:00
ibaker
a98fc7ca48 Add tate-chu-yoko support to WebVTT decoding
PiperOrigin-RevId: 288285953
2020-01-06 14:56:20 +00:00
kimvde
06fcf29edd Simulate IO exceptions in all FlacExtractor tests
- Simulate IO exceptions in the test using FlacBinarySearchSeeker for
  seeking in FlacExtractorTests. This makes the test slower but covers
  more test cases.

PiperOrigin-RevId: 288285057
2020-01-06 14:56:11 +00:00
tonihei
3a31bc1724 Support 5G in network type detection
PiperOrigin-RevId: 288280500
2020-01-06 14:56:02 +00:00
ibaker
6f312c054e Add <ruby> tag support to WebvttCueParser
There's currently no rendering support for ruby text in SubtitleView
or SubtitlePainter, but this does have a visible impact with the
current implementation by stripping the ruby text from Cue.text
meaning it doesn't show up at all under the 'naive' rendering.
This is an improvement over the current behaviour of including
the ruby text in-line with the base text (no rubies is better than
wrongly rendered rubies).

PiperOrigin-RevId: 288280416
2020-01-06 14:55:54 +00:00
ibaker
e55af3e3c8 Add RubySpan
This will be used when parsing Ruby info from WebVTT and TTML/IMSC
subtitles.

PiperOrigin-RevId: 288280181
2020-01-06 14:55:37 +00:00
ibaker
1e7db22ee2 Convert StyleSpan assertions in SpannedSubject to fluent style
PiperOrigin-RevId: 288274998
2020-01-06 14:55:28 +00:00
ibaker
29df73e268 Fix MatroskaExtractor to use blockDurationUs not durationUs
This typo was introduced in ddb70d96ad
when migrating a static method with parameter `durationUs` to an
instance method where the correct field to use was `blockDurationUs`
(but `durationUs` also exists).

The test that catches this was only added in 45013ece1e (and
therefore configured with the wrong expected output data).

issue:#6833
PiperOrigin-RevId: 288274197
2020-01-06 14:55:19 +00:00
christosts
1c1c0ed88a Remove getDequeueOutputBufferTimeoutUs
Remove unused method
MediaCodecRenderer#getDequeueOutputBufferTimeoutUs().

PiperOrigin-RevId: 288005572
2020-01-06 14:55:10 +00:00
olly
f1f0ff3a65 Use MIME types rather than PCM encodings for ALAW and MLAW
PiperOrigin-RevId: 287999703
2020-01-06 14:55:01 +00:00
ibaker
88e70d7c1b Remove WebvttCssStyle.cascadeFrom()
It's not used. I was trying to work out how to correctly cascade my
text-combine-upright styling, but deleting the method seemed easier...

PiperOrigin-RevId: 287989480
2020-01-06 14:54:53 +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
ibaker
1c0e69789f Clear existing Spans when applying CSS styles in WebvttCueParser
Relying on the precedence of spans seems risky - I can't find it
defined anywhere. It might have changed in Android 6.0?
https://stackoverflow.com/q/34631851

PiperOrigin-RevId: 287989365
2020-01-06 14:54:35 +00:00
kimvde
f76b4fe63e Add unit tests to FLAC extractor related classes
PiperOrigin-RevId: 287973192
2020-01-06 14:54:26 +00:00
ybai001
a67394b230 Optimize AC-4 code and add related test cases
-- Optimize Mp4Extractor for AC-4
-- Optimize FragmentedMp4Extractor for AC-4
-- Add test case for AC-4 in MP4
-- Add test case for AC-4 in Fragmented MP4
2020-01-06 15:21:43 +08:00
olly
826083db92 Add support for IMA ADPCM in WAV
PiperOrigin-RevId: 287854701
2020-01-02 19:24:31 +00:00
olly
f0e0ee421f Support twos codec in MP4
Issue: #5789
PiperOrigin-RevId: 287828559
2020-01-02 19:24:23 +00:00
andrewlewis
cafffcb812 Fix handling of E-AC-3 streams with AC-3 frames
Issue: #6602
PiperOrigin-RevId: 287816831
2020-01-02 19:23:58 +00:00
olly
77f01da660 Don't use WavHeader.averageBytesPerSecond
It's unreliable for at least one IMA ADPCM file I've found.
Calculating the blockIndex to seek to using exact properties
also seems more robust.

Note this doesn't change anything for the existing PCM test,
since averageBytesPerSecond is set correctly. It does make
a difference for an upcoming IMA ADPCM test though.

PiperOrigin-RevId: 287814947
2020-01-02 19:23:50 +00:00
andrewlewis
fefb1a17a0 Fix typos
PiperOrigin-RevId: 287810018
2020-01-02 19:23:42 +00:00
tonihei
b77717ce91 Remove buffer size based adaptation.
An experiment with this algorithm didn't show positive results. We can
therefore keep the simpler default algorithm.

Startblock:
  <unknown commit> is submitted
PiperOrigin-RevId: 287807538
2020-01-02 19:23:34 +00:00
andrewlewis
035cb096d9 Mark final field
PiperOrigin-RevId: 287669425
2020-01-02 19:23:20 +00:00
olly
24a19264db Fix handling of network transitions in RequirementsWatcher
Issue: #6733
PiperOrigin-RevId: 286621715
2019-12-20 20:42:07 +00:00
olly
f50ed8fd9c Enable blacklisting for HTTP 416
Where media segments are specified using byte ranges, it makes
sense that a server might return 416 (which we don't consider
for blacklisting) if the segment is unavailable, rather than
the 404 (which we do consider for blacklisting) that we expect
when media segments are only specified using a URL.

Issue: #6775
PiperOrigin-RevId: 286620698
2019-12-20 20:41:59 +00:00
ibaker
14a0c9ebfd Add vertical support to WebvttCueParser
PiperOrigin-RevId: 286583957
2019-12-20 16:58:59 +00:00
ibaker
f88fbaf655 Add Cue.verticalType field
Inspired by the `vertical` cue setting in WebVTT:
https://www.w3.org/TR/webvtt1/#webvtt-vertical-text-cue-setting

PiperOrigin-RevId: 286583621
2019-12-20 16:58:50 +00:00
olly
da121a0805 Throw more appropriate exceptions from extractors
PiperOrigin-RevId: 286581465
2019-12-20 16:58:40 +00:00
olly
7bea558b31 Add test case for mdat atom extending beyond the file length
Issue: #6774
PiperOrigin-RevId: 286576383
2019-12-20 16:03:16 +00:00
olly
19fb25101b DefaultDownloadIndex: Clear failure reason when removing download
The Download constructor considers it invalid to have a failure
reason if the download isn't in the failed state. Unfortunately,
calling DefaultDownloadIndex.removeAllDownloads when there's a
failed download will change the state without clearing the reason.
If the downloads are then read back from the DefaultDownloadIndex
we end up violating the Download constructor assertion.

This change clears the failed reason for any existing rows in the
invalid state, and also fixes the root cause that allows invalid
rows to enter the table in the first place.

Issue: #6785
PiperOrigin-RevId: 286576242
2019-12-20 16:03:08 +00:00
olly
8e96188909 Relax MP4 sniffing to allow an atom to extend beyond the file length
Issue: #6774
PiperOrigin-RevId: 286575797
2019-12-20 16:02:59 +00:00