229 Commits

Author SHA1 Message Date
Oliver Woodman
3abaef5593 Merge pull request #8088 from xufuji456:dev-v2
PiperOrigin-RevId: 338024866
2020-10-20 14:52:01 +01:00
kimvde
021d725c0a Add motion photo metadata entry
PiperOrigin-RevId: 337863184
2020-10-20 14:51:09 +01:00
xufuji456
af4028f30e Fix MOV with pcm_alaw/pcm_mulaw which is fixedSampleSize 2020-10-19 20:49:29 +08:00
ibaker
2371b024dd Switch to an 'api' dependency on Guava
The 'implementation' dependency causes problems when resolving
ListenableFuture in contexts that also include the
com.google.guava:listenablefuture:1.0 dependency.

Issue: #7905
Issue: #7997
Issue: #7993
PiperOrigin-RevId: 337093024
2020-10-17 01:34:15 +01:00
kimvde
58ddfe046f Add SVC layer count to MP4 metadata
This is necessary to implement SEF video flattening.

PiperOrigin-RevId: 337048264
2020-10-17 01:33:47 +01:00
kimvde
6f66e7d0ba Small fix in IndexSeekMap
This change was meant to be in 2e5f2f12ad but
was not added my mistake.

PiperOrigin-RevId: 337041686
2020-10-17 01:33:09 +01:00
kim-vde
2e5f2f12ad Merge pull request #7378 from shenwill:dev-v2
PiperOrigin-RevId: 336875300
2020-10-13 16:30:01 +01:00
ibaker
d2db0bb74a Ensure ParsableByteArray is large enough when appending in VorbisReader
PiperOrigin-RevId: 336643621
2020-10-13 16:27:48 +01:00
kimvde
53f50f7c0e Ignore negative payload size in TS PesReader
Issue: #8005
PiperOrigin-RevId: 335625992
2020-10-06 14:31:59 +01:00
kimvde
6ed371aaf3 Add search bytes parameter to TsExtractor
Context: Issue: #7988
PiperOrigin-RevId: 335608610
2020-10-06 14:31:41 +01:00
ibaker
ae0d9b1359 Preserve limit when resetting ParsableByteArray in OggPacket#populate
When I moved ParsableByteArray#data behind a getter I replaced some
assignments with calls to reset(byte[]):
ce2e6e2fd6

reset(byte[]) deliberately sets `limit` to `data.length`, in order to
handle cases that were reassigning `data` but not updating `limit`.
However OggPacket was already using `limit` to track where to write
'new' data into the array, so changing `limit` to `data.length` caused
us to try and write new data beyond the end of the array.

I looked at other uses of reset(byte[]) in ce2e6e2fd6
and condluded the only other usage in MatroskaExtractor is legit and
shouldn't be updated like this (because MatroskaExtractor previously
*wasn't* correctly updating/maintaining `limit`).

Issue: #7992
PiperOrigin-RevId: 334601586
2020-10-06 14:30:01 +01:00
Will
34ef9b2042 Add tests for the FlvExtractor seek map. Fix an EOF seeking issue. 2020-09-26 15:30:58 +08:00
kimvde
908785b701 Parse TLEN duration in Mp3Extractor
Issue: #7949
PiperOrigin-RevId: 333733615
2020-09-25 16:34:46 +01:00
samrobinson
851ca20cc0 Add support for mp2 boxes.
Issue: #7967
PiperOrigin-RevId: 333709003
2020-09-25 16:33:52 +01:00
ibaker
c76bc43de6 Delete sample_cbs.adts test asset
This seems to be an exact copy of sample.adts. Update the test to use
the same sample but just output to a different dump file.

PiperOrigin-RevId: 333469714
2020-09-25 16:31:20 +01:00
andrewlewis
69ca49f939 Add support for 'mett' sample description
PiperOrigin-RevId: 333272292
2020-09-25 16:31:02 +01:00
andrewlewis
a196fb0778 Remove unused MP4 atom type
PiperOrigin-RevId: 333051018
2020-09-25 16:30:34 +01:00
Will
989a97ebbd Get frame rate from mkv. Get frame rate from AvcConfig. 2020-09-19 11:30:14 +08:00
Will
8bed008934 Merge remote-tracking branch 'upstream/dev-v2' into dev-v2 2020-09-19 02:23:33 +08:00
olly
cdcb30ed21 Exclude Guava transitive annotation dependencies
PiperOrigin-RevId: 331148067
2020-09-11 16:01:15 +01:00
olly
b2b08ade99 Make User-Agent optional
PiperOrigin-RevId: 330593247
2020-09-09 09:41:51 +01:00
tonihei
bfe17aee3e Support ExtractorFactory in DefaultMediaSourceFactory.
This allows to customize extractor flags more easily when setting up the player.

In addition, we need to provide a way to pass in the ExtractorFactory through
the constructor chain starting in SimpleExoPlayer so that removing the
DefaultExtractorsFactory is possible for R8.

PiperOrigin-RevId: 330472935
2020-09-09 09:41:42 +01:00
kim-vde
bcad98b9ff Merge pull request #7667 from willtrking:dev-v2-mkv-dovi
PiperOrigin-RevId: 328536503
2020-08-26 16:40:35 +01:00
kimvde
6960dde8a8 Add nullness annotations to FragmentedMp4Extractor
PiperOrigin-RevId: 327797428
2020-08-26 16:39:07 +01:00
William King
b7739283e0 add back removed tests 2020-08-18 21:25:48 -07:00
William King
081c5900bf add mkv samples 2020-08-18 21:21:11 -07:00
aquilescanta
4cd8f00d72 Avoid setting a PMT reader if one exists for the same PID
This change should only affect HLS, where we don't remove the
PAT reader after reading a PAT.

Issue: #7756
PiperOrigin-RevId: 327008936
2020-08-17 16:14:57 +01:00
ibaker
f0ae8afd80 Separate the dump files from the test assets
This allows us to more easily create different dumps derived from the
same assets.

This moves media/source files from `assets/` to `assets/media/` and
dump files from `assets/` to `assets/extractordumps/` and
`assets/audiosinkdumps/` as appropriate. I intend to add
`assets/playbackdumps/` in a future CL.

PiperOrigin-RevId: 326986283
2020-08-17 16:13:53 +01:00
andrewlewis
6aeacd70bc Fix miscellaneous nits
PiperOrigin-RevId: 326208366
2020-08-17 16:09:19 +01:00
olly
7f6940fb8b TS EsInfo: Be robust against a invalid descriptor length
Issue: Issue: #7722
PiperOrigin-RevId: 325431839
2020-08-07 19:04:47 +01:00
kimvde
d8a95af5e0 FragmentedMp4Extractor: simplify track bundle initialization
This will simplify the addition of nullness annotations.

PiperOrigin-RevId: 325414700
2020-08-07 19:04:18 +01:00
olly
6a54ddd217 FMP4: Correctly handle multiple sbgp and sgpd boxes
Find sbgp and sgpd boxes with grouping_type == seig in the case they don't
come first. Previoulsy we would only find them if they came first.

Issue: Issue: #7716
PiperOrigin-RevId: 325407819
2020-08-07 19:03:50 +01:00
olly
b9612bc338 Fix codec initialization data for Opus in MP4
PiperOrigin-RevId: 325327466
2020-08-07 19:03:40 +01:00
kimvde
38dd1bb74f FragmentedMp4Extractor: simplify extra tracks logic
This will simplify the addition of nullness annotations.

PiperOrigin-RevId: 325221749
2020-08-07 19:03:02 +01:00
kimvde
f29af879c0 FragmentedMp4Extractor: allow both first_sample_flags and sample_flags
Having both in the trun box is not allowed (see section section 8.8.8.1
of ISO/IEC 14496-12:2015) but this CL makes the code more robust in case
this happens. Before this change, the first sample flag was not read,
making subsequent reads incorrect.

Issue: #7698
PiperOrigin-RevId: 325212160
2020-08-07 19:02:33 +01:00
olly
5169652575 Fix MP4 sniffing for very short files
The sniffer sniffs boxes at the start of the file to try and determine
whether the file is fragmented. However, if the file is extremely short
then it's possible that sniffing will try and read beyond the end of
the file, resulting i EOFException being thrown.

In general it's OK for sniffing to throw EOFException if the file is
not of the correct type. The problem in this case is that EOFException
can be thrown for an actual MP4 file, due to the sniffer continuing up
sniff atoms up to bytesToSearch in case the file is fragmented.

PiperOrigin-RevId: 325205389
2020-08-07 19:02:23 +01:00
olly
5de56cd618 Opus: Add utility for handling header and initialization data
PiperOrigin-RevId: 325202386
2020-08-07 19:02:14 +01:00
olly
42a7083b5c FragmentedMp4Extractor: Fix clearHeaderSize handling
PiperOrigin-RevId: 324560994
2020-08-07 18:58:21 +01:00
William King
fa81e1690f Lower mp4 filesize 2020-08-06 20:54:58 -07:00
William King
88f6bd6fad address comments 2020-08-06 20:33:01 -07:00
aquilescanta
6d0696a3c8 Stop auto-generating a CEA-608 track for standalone TS
PiperOrigin-RevId: 323811839
2020-08-01 12:55:54 +01:00
William King
c01a6de1b5 Add mp4 DoVi tests 2020-07-30 21:53:57 -07:00
olly
7edc4b1f1e FLV: Ignore invalid SCRIPTDATA name type, rather than fail playback
Issue: #7675
PiperOrigin-RevId: 323371286
2020-07-28 00:00:10 +01:00
ibaker
fda3b3d8ec Use static imports for methods that make sense without their class name
PiperOrigin-RevId: 323349585
2020-07-27 23:59:52 +01:00
ibaker
7083dbf7b4 Remove zero-args ParsableByteArray#reset() method
It's potentially confusing that this resets both position & limit, so
require callers to pass `limit` explicitly, or call setPosition(0)
if that's actually what they intended.

This makes enforcing the limit in an upcoming change slightly safer.

PiperOrigin-RevId: 323340485
2020-07-27 23:59:43 +01:00
ibaker
ce2e6e2fd6 Hide ParsableByteArray#data behind a getter
This allows us to enforce the limit because the array can only be
reassigned through reset(byte[]) or reset(byte[], int) (which update
the limit)

PiperOrigin-RevId: 323339960
2020-07-27 23:59:34 +01:00
olly
5fa7b879a2 Increase MP3 sniff bytes
MP3 is last in the sniffing order now, so I think it's fine to do this
without worrying about impacting on other file types.

PiperOrigin-RevId: 322996771
2020-07-27 23:58:58 +01:00
olly
6d92eebe51 Revert Format back to only containing audio encoding for PCM
PiperOrigin-RevId: 322683545
2020-07-24 10:46:37 +01:00
ibaker
4fbd09693a Fix nullness error in Mp4Extractor
This only manifests when turning ParsableByteArray#data into a getData()
method but I'm fixing it beforehand to avoid introducing changes into a
big refactoring change.

#exofixit

PiperOrigin-RevId: 322342497
2020-07-24 10:43:35 +01:00
ibaker
7ed729b175 Fix warning about int overflowing before being assigned to long
#exofixit

PiperOrigin-RevId: 322322340
2020-07-24 10:42:57 +01:00