92 Commits

Author SHA1 Message Date
olly
1cfb68bf68 Change order of RawCcExtractor init to call format before endTracks.
This fixes an issue where the output track's sample format is null for rawCC captions when endTracks method is called.

PiperOrigin-RevId: 313622631
2020-05-29 18:34:10 +01:00
krocard
151ea531b1 Make constants more readable with _ separator
Add an `_` in long constants.
Eg: 10000 => 10_000.

I'm proposing this change because I have had multiple
missread due to confusing the number of 0 in a long number.

More specifically, added an underscore to all number matching:
`final.*\ [0-9]{2,}000;`

PiperOrigin-RevId: 313186920
2020-05-27 19:00:36 +01:00
ibaker
2397e7f67a Replace TestUtil.joinByteArrays() with Guava's Bytes.concat()
PiperOrigin-RevId: 312481058
2020-05-21 17:09:22 +01:00
olly
0de9c007af Fix naming to reflect that CEA-708 is supported too
PiperOrigin-RevId: 312131816
2020-05-18 22:39:51 +01:00
samrobinson
cda9417aa6 Allow MP3 files to play with size greater than 2GB.
Issue:#7337
PiperOrigin-RevId: 312042768
2020-05-18 16:13:52 +01:00
aquilescanta
f6d0e34cea Fix Extractor.read throws documentation
PiperOrigin-RevId: 311755157
2020-05-18 16:13:25 +01:00
olly
6e47819be4 Minor copybara fixes
- Remove proguard-rules.txt symlink
- Guard against classes annotated with @ClosedSource but not excluded

PiperOrigin-RevId: 311312671
2020-05-14 22:23:19 +01:00
aquilescanta
f599155bbf Document the sample data format for samples with supplemental data
PiperOrigin-RevId: 311298802
2020-05-14 22:23:01 +01:00
krocard
040a88f4f8 Parse AAC initialisation data in MatroskaExtractor
This aligns mkv with mp4, flv and ts extractors.

This issue was found when AAC in an MKV container was not offloaded
as format.codecs was null.

PiperOrigin-RevId: 310170759
2020-05-06 20:57:53 +01:00
aquilescanta
a8d1de5198 Fix TrackOutput documentation for encryption data format
PiperOrigin-RevId: 309899166
2020-05-05 18:38:05 +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
ibaker
0e6b318138 Remove ExtractorAsserts overloads that take a Context
Also mark the two assertOutput methods private, to make the API surface
smaller.

PiperOrigin-RevId: 308228186
2020-04-27 10:41:49 +01:00
aquilescanta
5d3230d85a Add test for TS with h264 and DTS audio
PiperOrigin-RevId: 307789384
2020-04-27 10:40:01 +01:00
ibaker
11c24ac3e7 Split {Amr,Ogg}ExtractorTest into parameterized & non-parameterized
This avoids the non-parameterized tests being run repeatedly for every
combination of parameters.

PiperOrigin-RevId: 307785770
2020-04-27 10:40:01 +01:00
ibaker
cfa8e19f77 Use parameterization in most extractor tests
Part of what makes these tests hard to deal with (imo) is being
unable to easily run a specific config, or seeing exactly which one
failed (because you always see only the first failure).

I put the parameters as a method on ExtractorAsserts to
reduce the boiler-plate required in each test class.

I'll migrate the extension FlacExtractorTest in a follow-up CL

PiperOrigin-RevId: 307785380
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
aquilescanta
7839955f31 Separate encryption data into a new TrackOutput method
Allows media parser to populate crypto data.

PiperOrigin-RevId: 307616083
2020-04-27 10:19:13 +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
olly
9a7290000c Noop naming generalization for H265Reader
This change generalizes the concept of "reading parameter sets" to
"reading prefix NAL units", ahead of a change that will treat AUD
and suffix SEI NAL units in the same way.

The change also introduces some static isXxxNalUnit methods for
clarity.

Issue: #7113
PiperOrigin-RevId: 307376967
2020-04-20 13:29:53 +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
vadim
fe733428de Add saving subtitle track name for MatroskaExtractor 2020-04-16 22:22:53 +07:00
aquilescanta
50926658b6 Avoid throwing an exception for sample default values
Allows playback of content when the default value is
not valid, but not used for any samples.

Issue: #7207
PiperOrigin-RevId: 306631376
2020-04-15 17:42:19 +01:00
ibaker
dfd5c512f6 Tweak PassthroughSectionPayloadReader to allow timestamp to change
PiperOrigin-RevId: 305674374
2020-04-09 16:44:19 +01:00
ibaker
d9a8622bd5 Eagerly set the format in PassthroughSectionPayloadReader.init
This reverts 94315ab757

This fixes issue:#7177

PiperOrigin-RevId: 305674114
2020-04-09 16:44:07 +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
kimvde
703fb777c4 Optimize extractors sniffing order
Issue: #6410
PiperOrigin-RevId: 305436352
2020-04-08 21:47:58 +01:00
olly
eb65f5e20a Fix ADTS extraction with mid-stream ID3
PiperOrigin-RevId: 304184650
2020-04-01 22:38:45 +01:00
olly
05fb211121 WAV: Don't read past data end position
Issue: #7129
PiperOrigin-RevId: 302660343
2020-03-25 13:05:14 +00:00
olly
eebe990d20 MP4 edit lists: Use floor rather than ceil to find first sample
If the start time of the edit falls within a sample, start from that
sample rather than the next one. This ensures playback can start from
the correct point if the sample is a keyframe, rather than having to
start from the next one.

Issue: #7133
PiperOrigin-RevId: 302639115
2020-03-25 13:04:23 +00:00
olly
920117b081 Drop prefix test- from test methods under v2/library
This CL removes the prefixes to the tests added after a6d0caaa3c.

This CL is generated by following command
$ find -name '*Test.java' | xargs -I{} sed -i 's/^\ \ public\ void\ test\([A-Z]\)\(.*\)$/  public void \L\1\E\2/' {}

PiperOrigin-RevId: 300547504
2020-03-19 00:46:48 +00:00
aquilescanta
1f202f0aee Make DataSource extend DataReader and upcast uses
This means DataSource.read now may throw InterruptedException.

PiperOrigin-RevId: 300523430
2020-03-19 00:45:59 +00:00
olly
0d230d517a Miscellaneous cleanup related to recent changes
PiperOrigin-RevId: 300067561
2020-03-11 16:26:41 +00:00
aquilescanta
47b62e8c02 DataReader: replace InterruptedException with InterruptedIOException
PiperOrigin-RevId: 299092243
2020-03-10 10:19:45 +00:00
tonihei
b5976a55ff Upgrade Kotlin annotations and fix gradle warnings
The new version fixes some warnings in Gradle builds. Also
add missing indirect compileOnly dependencies to fix some more warnings

Issue:issue:#7007
PiperOrigin-RevId: 298855510
2020-03-10 10:19:19 +00:00
kimvde
f204e4df7d Add setCoreFlacExtractorFlags on DefaultExtractory
PiperOrigin-RevId: 298816694
2020-03-10 10:18:21 +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
olly
a6d0caaa3c Drop prefix test- from test methods under v2/library
This is one step toward following the google3's test naming convention.
See go/java-testing/getting_started#basic-test-template for details
why prefix test isn't necessary.

This CL is generated by following command
$ find -name '*Test.java' | xargs -I{} sed -i 's/^\ \ public\ void\ test\([A-Z]\)\(.*\)$/  public void \L\1\E\2/' {}

and then manually modified following tests where test method names conflict with test target.
- VorbisUtilTest
- VorbisReaderTest
- UtilTest
- DownloadManagerDashTest
- DefaultOggSeekerTest
- OggPageHeaderTest
- HlsMasterPlaylistParserTest

PiperOrigin-RevId: 298074653
2020-03-10 10:15:43 +00: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
1ca9a061b1 Split AAC utils out of CodecSpecificDataUtil
PiperOrigin-RevId: 297823929
2020-02-28 18:42:30 +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
ybai001
40df646a07 Add AC3 and EAC3-JOC Test Assets 2020-02-28 19:32:01 +08:00
aquilescanta
a114a0ed7f Rename SampleDataReader to DataReader and move to common
PiperOrigin-RevId: 297603312
2020-02-27 17:16:53 +00: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