259 Commits

Author SHA1 Message Date
ibaker
b7486f4883 Add a test for 33-bit HLS WebVTT wraparound
This also gives some general test coverage for HLS' WebvttExtractor

Issue: #7462
PiperOrigin-RevId: 315257252
2020-06-08 17:40:33 +01:00
ibaker
3474c39c10 Add support for non-contiguous Ogg pages
bear_vorbis_gap.ogg is a copy of bear_vorbis.ogg with 10 garbage bytes
(DE AD BE EF DE AD BE EF DE AD) inserted before the second capture
pattern and 3 garbage bytes inserted at the end (DE AD BE).

Issue: #7230
PiperOrigin-RevId: 314715729
2020-06-04 14:16:40 +01:00
ibaker
377bf27f47 Extend WebVTT ruby-position support to include <rt> tags
PiperOrigin-RevId: 312096467
2020-05-18 22:38:45 +01:00
ibaker
38fc7d8c0d Add WebVTT support for ruby-position CSS property
This is currently only parsed if the CSS class is specified directly on
the <ruby> tag (e.g. <ruby.myClass>)

PiperOrigin-RevId: 312091710
2020-05-18 22:38:29 +01:00
ibaker
0dd57de1f1 Parse TTML's tts:textAlign into Cue.textAlign, not an AlignmentSpan
The tts:textAlign property only applies to <p> elements, which
correspond 1:1 with ExoPlayer Cue objects, so we can use
Cue.textAlignment to store this info instead of encoding it in
the span-styled text.

This will mean that TTML subtitles used with
SubtitleView#setApplyEmbeddedStyles(false) will start respecting
the tts:textAlign properties from the source data (currently this
information is stripped when we remove all span styling). I think this
is working-as-intended, we respect alignment of other subtitle types
(e.g. WebVTT) when applyEmbeddedStyles=false. We also respect all other
'positioning' related properties in this case e.g. Cue.position and
Cue.line.

PiperOrigin-RevId: 310895499
2020-05-14 22:19:50 +01:00
ibaker
252bf43bf4 Stop parsing unsupported WebVTT CSS properties
The spec lists an exhaustive list of CSS properties that should be
recognised, all others must be ignored:
https://www.w3.org/TR/webvtt1/#the-cue-pseudo-element

PiperOrigin-RevId: 310353888
2020-05-14 22:18:46 +01:00
andrewlewis
965383879e Add tests for snap-back to midroll
These tests require longer content so that the ads are spaced apart far enough
to trigger preloading while content is playing (rather than immediately as soon
as a position is reported).

PiperOrigin-RevId: 309733826
2020-05-05 18:37:30 +01:00
andrewlewis
99a3cc2877 Add test ads response with two midrolls
Also clean up naming of test ads responses.

PiperOrigin-RevId: 309728625
2020-05-05 18:37:21 +01:00
ibaker
767b29f159 Implement the rest of WebVTT's line computation
Steps 4-10 of https://www.w3.org/TR/webvtt1/#cue-computed-line

This part is harder to fit into our code structure because it depends on
how many cues are simultaneously visible - so it has to go in
WebvttSubtitle not WebvttCueParser (which only deals with individual
cues in isolation).

This removes the `isNormal()` method that was trying to approximate
the correct behaviour.

PiperOrigin-RevId: 309021686
2020-05-01 19:47:23 +01:00
ibaker
922b8a2c15 Add option to FakeTrackOutput to de-duplicate repeated formats
Expose this through ExtractorAsserts via a new AssertionConfig object

PiperOrigin-RevId: 308980701
2020-05-01 19:46:30 +01:00
aquilescanta
5d3230d85a Add test for TS with h264 and DTS audio
PiperOrigin-RevId: 307789384
2020-04-27 10:40:01 +01:00
aquilescanta
1b6a32f25a Add test for TsExtractor's FLAG_DETECT_ACCESS_UNITS
PiperOrigin-RevId: 307777265
2020-04-27 10:40:01 +01:00
tonihei
96ccb893f2 Fix timestamp rounding error in fMP4 extractor.
The sample timestamps are currently rounded to milliseconds, only to
be multiplied by 1000 later. This causes rounding errors where the sample
timestamps don't match the timestamps in the seek table (which are already
in microseconds).

issue:#7086
PiperOrigin-RevId: 307630559
2020-04-27 10:19:23 +01:00
olly
cb51a1bfe6 Fix H265Reader to correctly output SEI and AUD NAL units
Issue: #7113
PiperOrigin-RevId: 307380133
2020-04-20 13:30:02 +01:00
ibaker
eb8c174b4c Update WebVttCueParser to parse position alignment values
Currently we assume these are "start", "center", "middle" or "end",
which was correct in a previous draft of the spec:
https://www.w3.org/TR/2014/WD-webvtt1-20141111/#dfn-webvtt-text-position-cue-setting

The released spec uses "line-left", "center" and "line-right":
https://www.w3.org/TR/webvtt1/#webvtt-position-cue-setting

PiperOrigin-RevId: 307371066
2020-04-20 13:29:44 +01:00
Oliver Woodman
ad3fb3d05c Merge pull request #7247 from vadimdolgachev:subtitle_track_name_for_matroska
PiperOrigin-RevId: 307368176
2020-04-20 13:29:34 +01:00
kimvde
63da73df00 Add tests for ID3 in Mp3Extractor
PiperOrigin-RevId: 306844582
2020-04-17 10:44:32 +01:00
kimvde
ed977d1429 Test and fix H265Reader
- Update H265Reader to output the same samples after a seek to 0.
- Add a TsExtractor test for H.265.

PiperOrigin-RevId: 306675050
2020-04-17 10:43:57 +01:00
olly
ba0028ca2c Parse trick-play role flags from DASH manifests
Issue: #6054
PiperOrigin-RevId: 306641689
2020-04-15 17:42:19 +01:00
kimvde
d33c5ac0b3 Improve tests and samples naming in TsExtractor
PiperOrigin-RevId: 305526093
2020-04-08 21:49:12 +01:00
kimvde
afc2858ad0 Add PsExtractor test for AC3
PiperOrigin-RevId: 305503256
2020-04-08 21:48:54 +01:00
kimvde
dc80cf32b6 Add TsExtractor tests for LATM and H264
PiperOrigin-RevId: 305475709
2020-04-08 21:48:36 +01:00
olly
d87fc72378 Add DASH text representation parsing tests
PiperOrigin-RevId: 305140826
2020-04-07 13:39:03 +01:00
olly
eb65f5e20a Fix ADTS extraction with mid-stream ID3
PiperOrigin-RevId: 304184650
2020-04-01 22:38:45 +01:00
olly
db61af23b9 Parse opus gain correctly as a signed value
Issue: #7046
PiperOrigin-RevId: 303354941
2020-03-27 23:33:15 +00:00
andrewlewis
09be441e3d Add canned VAST/VMAP ad responses for testing
PiperOrigin-RevId: 303286872
2020-03-27 23:31:54 +00:00
ibaker
2842eb3eb4 Make milliseconds optional in SubRip (SRT) subtitles
issue:#7122
PiperOrigin-RevId: 303154493
2020-03-27 23:31:21 +00:00
olly
05fb211121 WAV: Don't read past data end position
Issue: #7129
PiperOrigin-RevId: 302660343
2020-03-25 13:05:14 +00:00
ibaker
0c20462b48 Allow missing hours in SubRip (.srt) subtitle timecodes
Add a test for this case, and extend the existing tests to ensure the
hour is parsed when it's present.

issue:#7122
PiperOrigin-RevId: 302472213
2020-03-25 13:03:52 +00:00
Oliver Woodman
0175dd4441 Merge pull request #7057 from Chimerapps:dash_assetidentifier
PiperOrigin-RevId: 300313753
2020-03-11 16:27:36 +00:00
andrewlewis
9c1c74ecc4 Rename .unklen.dump -> .unknown_length.dump
PiperOrigin-RevId: 298334502
2020-03-10 10:16:54 +00:00
Oliver Woodman
06e1651612 Merge pull request #7026 from DolbyLaboratories:dev-v2-test-assets
PiperOrigin-RevId: 298317097
2020-03-10 10:16:35 +00:00
Nicola Verbeeck
170fc852ca DASH: Include AssetIdentifier in period
DASH: Parse AssetIdentifier in period
Breaking: DashManifestParser.buildPeriod signature has changed
2020-03-06 12:24:04 +01:00
olly
67b29bbe39 Format.Builder: Finish migration
Issue: #5978
PiperOrigin-RevId: 297876336
2020-02-28 18:43:04 +00:00
olly
3730639c95 Don't set decoded bitrate on audio/flac format
PiperOrigin-RevId: 297864386
2020-02-28 18:42:39 +00:00
andrewlewis
64feb97d62 Add codecs string to extractor dumps
PiperOrigin-RevId: 297806457
2020-02-28 18:41:13 +00:00
olly
db97d0c37c Format.Builder: Migrate MatroskaExtractor
Selection flags and language tags appear to apply to all tracks
in MKV, so I think the change in output is correct.

PiperOrigin-RevId: 297646190
2020-02-28 18:41:04 +00:00
kimvde
56dbe83a4c Extractor tests: dump only non-default values for format
This removes noisy data from the dump files and allows updating less
dump files if a format field is added, removed or updated.

PiperOrigin-RevId: 297617138
2020-02-28 18:40:54 +00:00
ybai001
40df646a07 Add AC3 and EAC3-JOC Test Assets 2020-02-28 19:32:01 +08:00
kim-vde
292942feb3 Merge pull request #6971 from DolbyLaboratories:dev-v2-ts-assets
PiperOrigin-RevId: 297591404
2020-02-27 17:16:20 +00:00
kim-vde
6946170d3e Merge pull request #6922 from phhusson:feature/ait
PiperOrigin-RevId: 297579733
2020-02-27 17:15:52 +00:00
kimvde
52825a272d Rename FLAC dump files based on output instead of language
PiperOrigin-RevId: 297336461
2020-02-27 17:15:11 +00:00
olly
31f0302505 Extractor tests: Output average and peak bitrates separately
Note: The dump files will need updating again when the extractors
are modified to only set the appropriate bitrate. Enhancing the
test first is nice, because it means that in subsequent CLs the
dump file updates can be used to quickly see what's changed in
the output.
PiperOrigin-RevId: 297188367
2020-02-27 17:14:47 +00:00
ibaker
94315ab757 Remove duplicate SCTE-35 format and add sample to TsExtractorTest
It's not clear why we're currently outputting the format in both init()
and consume() - it seems likely that this was accidentally introduced
in <unknown commit>
when we started outputting the format in consume() but didn't remove it
from init().

The SCTE-35 TsExtractorTest doesn't pass with the current code because
when it seeks back to the beginning of the file init() is not called
again so the second pass through only sees one sample (and
ExtractorAsserts checks that seeking back to 0 produces the same output
as reading the file from the beginning).

I generated the SCTE-35 sample using TSDuck's tsp command:
$ tsp --add-input-stuffing 1/10 \
   -I file testdata/src/test/assets/ts/sample.ts \
   -P pmt --service 1  --add-programinfo-id 0x43554549 --add-pid 600/0x86 \
   -P spliceinject --service 1 --files scte_35.xml --wait-first-batch \
   -P filter --negate --pid 0x1FFF \
   -O file testdata/src/test/assets/ts/sample_scte35.ts

This was adapted from the instructions in section 5.2.24.1 of the TSDuck
user manual: https://tsduck.io/download/docs/tsduck.pdf

PiperOrigin-RevId: 296217084
2020-02-25 21:22:40 +00:00
ibaker
786a1ee82f Add ruby support to TtmlDecoder
I had to expand the info that gets passed around a bit, so I could join up the container, base & text ruby nodes.

Spec: https://www.w3.org/TR/2018/REC-ttml2-20181108/#style-attribute-ruby
PiperOrigin-RevId: 295931653
2020-02-25 21:21:04 +00:00
kimvde
7a8ab7ce68 FakeTrackOutput: test all the formats sent
PiperOrigin-RevId: 294621946
2020-02-13 15:44:47 +00:00
kimvde
bdfd24290f Share FLAC extractor tests between both extractors
PiperOrigin-RevId: 294614958
2020-02-13 15:44:29 +00:00
ybai001
397aafb3ce Add EAC3 and AC-4 test assets 2020-02-13 09:47:18 +08:00
kim-vde
fed0acc253 Merge pull request #6949 from DolbyLaboratories:dev-v2-assets
PiperOrigin-RevId: 294441610
2020-02-11 17:12:55 +00:00
kimvde
363599dd54 Move assets from dash to testdata module
PiperOrigin-RevId: 294241169
2020-02-11 17:12:21 +00:00