257 Commits

Author SHA1 Message Date
olly
a3dbd61239 Remove obsolete Checker Framework suppression strings
More information: go/checker-3130-lsc

Tested:
    Some test failures are present, but the CL author has decided to mail the change anyway
PiperOrigin-RevId: 379622938
2021-06-21 21:56:37 +01:00
olly
4e8895d5cb Fix issue where a trun atom could be associated with the wrong track
Note that this removes a workaround for malformed content, in which the
track_ID is set incorrectly. It's unclear there was sufficient reason to
implement that workaround, and so it's preferable to remove it, rather
than implementing the concept of unrecognized tracks, which would be
needed to keep it and to also fix this issue.

Issue: #9056
#minor-release
PiperOrigin-RevId: 379506261
2021-06-15 18:45:21 +01:00
olly
3e819d082a Make javadoc valid html5
As of [JDK-8247957](https://bugs.openjdk.java.net/browse/JDK-8247957), doclint
no longer supports html4.

Tested:
    Some test failures are present, but the CL author has decided to mail the change anyway
PiperOrigin-RevId: 378819179
2021-06-11 12:23:35 +01:00
aquilescanta
b5dbadee0c Remove ParserException(cause) constructor
PiperOrigin-RevId: 378635295
2021-06-10 17:36:29 +01:00
olly
4b30cca914 Update @SuppressWarnings annotations for go/nullness diagnostics
in preparation for upgrading the version of the Checker Framework in google3.

More information: go/checker-3110-lsc

PiperOrigin-RevId: 377925828
2021-06-08 13:02:47 +01:00
bachinger
5700401ec1 Reformat README of extractors module
PiperOrigin-RevId: 377031562
2021-06-02 18:17:13 +01:00
bachinger
f40a92281b Add @DoNotInstrument annotations for extractors module
PiperOrigin-RevId: 377007386
2021-06-02 18:14:35 +01:00
aquilescanta
85e4137b81 Add test for ColorInfo in MP4
PiperOrigin-RevId: 375992816
2021-05-27 10:44:50 +01:00
aquilescanta
ddc047c235 Add ColorInfo parsing support in MP4 files
PiperOrigin-RevId: 375719035
2021-05-26 11:32:29 +01:00
aquilescanta
2e8d4c9110 Extract function for mapping ColorInfo-related constants
PiperOrigin-RevId: 375705247
2021-05-26 11:31:52 +01:00
aquilescanta
1fa61feb7e Migrate AtomParsers to using new ParserException fields
PiperOrigin-RevId: 375133184
2021-05-26 11:24:46 +01:00
aquilescanta
3f33f10a32 Add ExtractorUtil method for checking input conditions
Unlike Assertions, the introduced method cannot be disabled and throws
a ParserException instead. This method is meant to replace regular
assertions (which throw RuntimeExceptions) which check input in the
parsing code.

PiperOrigin-RevId: 375085160
2021-05-21 18:24:37 +01:00
aquilescanta
23d4efad7b Make TYPE_* constant declarations in lexicographic order
PiperOrigin-RevId: 374880929
2021-05-21 12:03:04 +01:00
kim-vde
eb93e5c0b5 Merge pull request #8860 from KeiMurayamaS:dev-v2-add-mpegh-parser
PiperOrigin-RevId: 373142159
2021-05-11 16:01:46 +01:00
Kei Murayama
f05197c4d5 Support parsing MPEG-H 3D Audio
First intention to support parsing MPEG-H 3D Audio in ExoPlayer is to
take advantage of parsing capability from MediaParser API in AOSP.
Just with this change ExoPlayer does't support decoding MPEG-H 3D Audio
but can support decoding either by adding decoder with an extension or
by using Android OS which has decoder capability with MediaCodec API.
2021-05-10 17:55:03 +09:00
bachinger
4c1a294b2e Format Java source files
PiperOrigin-RevId: 372127633
2021-05-06 13:32:25 +01:00
bachinger
cdff456621 Make copybara remove the LINT.IfChange tag
PiperOrigin-RevId: 371135534
2021-04-29 17:35:05 +01:00
ibaker
dafea4e40f Re-format some javadoc
PiperOrigin-RevId: 369642047
2021-04-21 18:46:00 +01:00
andrewlewis
a29ad96b1e Update internal codebase location for extractor module
PiperOrigin-RevId: 369609585
2021-04-21 10:24:26 +01:00
andrewlewis
d359882871 Update internal codebase location for flac extension
PiperOrigin-RevId: 368388742
2021-04-14 11:42:51 +01:00
olly
7aeb476812 Fix DefaultExtractorInputTest.largeSkip
PiperOrigin-RevId: 365992439
2021-04-01 16:04:42 +01:00
tonihei
76700e9d84 Log error for TrackGroups with multiple languages or role flags.
A TrackGroup must contain the same content in all Formats (except for
the quality, encoding etc). Verify that the language and role flags
are the same and log an error if don't match. Don't throw to avoid
breaking existing use cases that just happen to work by chance.

PiperOrigin-RevId: 365539240
2021-04-01 16:03:43 +01:00
aquilescanta
273d68accd Add missing switch case
Before this change, calling read after reaching the end of input in an Ogg file
would cause an IllegalStateException.

PiperOrigin-RevId: 364758873
2021-03-24 18:07:25 +00:00
kimvde
2c76bc5a4c JpegExtractor: support JFIF segment preceding Exif segment
#minor-release

PiperOrigin-RevId: 364561115
2021-03-24 18:06:16 +00:00
kimvde
ef2f8b7ae6 JpegExtractor: read GContainer and GContainerItem XMP prefixes
#minor-release

PiperOrigin-RevId: 363859522
2021-03-24 18:04:56 +00:00
olly
6f8a8fbc1c HLS: Allow audio variants to initialize the timestamp adjuster
This makes HLS playback less liable to become stuck if discontinuity
tags are inserted at different times across media playlists.

Issue: #8700
Issue: #8372
PiperOrigin-RevId: 362903428
2021-03-15 19:14:52 +00:00
kimvde
c1ef00ab42 Revert logic to decide whether meta atom is full
The previous logic was changed under the assumption that the first box
inside a meta box was not always an hdlr box, but this is not true.

#minor-release

PiperOrigin-RevId: 357200713
2021-02-12 19:55:47 +00:00
kimvde
b303eceafd Add support for MP4/QuickTime non-full meta atoms
#minor-release

PiperOrigin-RevId: 357160215
2021-02-12 16:40:31 +00:00
kimvde
0d85958a76 Fix parsing of Vorbis codec private
- Fix comparison between a byte and 0xFF to avoid conversion of 0xFF to
  byte and to int again (due to numeric promotion).
- Fix addition of int and byte with most significant bit set. The byte
  was incorrectly promoted to an int negative value.

Issue:#8496
#minor-release
PiperOrigin-RevId: 353865751
2021-01-26 15:59:41 +00:00
olly
dc7fde1ff7 Some more language fixes
Issue: #7565
PiperOrigin-RevId: 353613493
2021-01-25 15:36:59 +00:00
andrewlewis
981826555c Add support for playing JPEG motion photos
PiperOrigin-RevId: 352413375
2021-01-18 22:00:36 +00:00
Oliver Woodman
1095f5fc3e Merge pull request #8437 from equeim:interlaced
PiperOrigin-RevId: 352357712
2021-01-18 21:59:35 +00:00
kimvde
9faa393a15 Handle sample size mismatch in MP4 extractors
#minor-release

PiperOrigin-RevId: 352016698
2021-01-17 21:51:30 +00:00
kimvde
4c3f580b0c Rollback of 7d847a9552
*** Original commit ***

Handle sample size mismatch in MP4 extractors

#minor-release

***

PiperOrigin-RevId: 351774860
2021-01-15 10:56:47 +00:00
kimvde
7d847a9552 Handle sample size mismatch in MP4 extractors
#minor-release

PiperOrigin-RevId: 351756333
2021-01-15 10:56:17 +00:00
andrewlewis
9b062053fa Add support for JPEG motion photo extraction
PiperOrigin-RevId: 351752989
2021-01-15 10:56:07 +00:00
andrewlewis
d5124e8cdc Add presentation time to motion photo metadata
PiperOrigin-RevId: 351581997
2021-01-15 10:54:56 +00:00
andrewlewis
a7b20fd133 Rollback of 59aec416af
*** Original commit ***

Rollback of ff8c8645ab

*** Original commit ***

Merge #8401: Initialize Format.codecs from HEVC SPS NAL unit (#8393)

Imported from GitHub PR https://github.com/google/ExoPlayer/pull/8401

This will allow ExoPlayer to check if video track's profile and level are supported by decoder when playing progressive media so...

***

PiperOrigin-RevId: 351139861
2021-01-11 18:05:34 +00:00
olly
59aec416af Rollback of ff8c8645ab
*** Original commit ***

Merge #8401: Initialize Format.codecs from HEVC SPS NAL unit (#8393)

Imported from GitHub PR https://github.com/google/ExoPlayer/pull/8401

This will allow ExoPlayer to check if video track's profile and level are supported by decoder when playing progressive media sources.
Merge e582fb91b73c7c95e754167140211d5473c36d14 into 1347d572ef9ce79aacd667cfffa7d7468c8408a4

Issue: #8393

***

PiperOrigin-RevId: 350871621
2021-01-11 18:04:22 +00:00
Alexey Rochev
ff8c8645ab Merge #8401: Initialize Format.codecs from HEVC SPS NAL unit (#8393)
Imported from GitHub PR https://github.com/google/ExoPlayer/pull/8401

This will allow ExoPlayer to check if video track's profile and level are supported by decoder when playing progressive media sources.
Merge e582fb91b73c7c95e754167140211d5473c36d14 into 1347d572ef9ce79aacd667cfffa7d7468c8408a4

Issue: #8393
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/ExoPlayer/pull/8401 from equeim:hevc-codecs e582fb91b73c7c95e754167140211d5473c36d14
PiperOrigin-RevId: 350738065
2021-01-08 15:33:09 +00:00
Alexey Rochev
377a3250f0 H265Reader: initialize correct Format.height for interlaced video 2021-01-07 20:15:14 +03:00
Alexey Rochev
78a975c268 Initialize Format.codecs from AVC SPS NAL unit (#8393)
This will allow ExoPlayer to check if video track's profile
and level are supported by decoder when playing progressive media sources.

Also fix typo in AvcConfig.
2020-12-24 20:30:35 +03:00
kimvde
761bd091c3 Check atom size and recording mode of Samsung saut boxes
- In slow motion videos flattened by Samsung, the saut box is kept but
only have the 4 first bytes (author field).
- In Samsung normal videos, the recording mode is zero.

In these cases, skip this box.

PiperOrigin-RevId: 347577303
2020-12-17 11:25:53 +00:00
krocard
7aeeb8dd22 Minor refactor in Matroska extractor
#exofixit

PiperOrigin-RevId: 346975740
2020-12-14 10:18:13 +00:00
kimvde
4ee02a27de Mp4Extractor: add smta metadata to audio track
This is needed for slomo audio flattening.

PiperOrigin-RevId: 346965990
2020-12-14 10:17:43 +00:00
krocard
93b3f43ed2 Fix some extractor nullness checks
Fix Matroska, Heif, FLAC, Ogg, Opus, Vorbis
extractor nullness check.

There should be no functional change.
Every media that fail to be parsed should still fail.
Every media that parsed successfully should still succeed.

This refactor aims to push all nullness constraints up the call stack to clarify each API nullness contract. This ensures implementation and caller have to prove their respective contract close to where such logic is implemented. This also allows to fail early if an nullness contract is broken instead of deep in the call stack.

For example, by adding a requirement that all implementation of `StreamReader.readHeaders` have to initialize `setupData.format` if the return false, each overriding method is forced to prove this next to the logic initializing it. This also means the runtime check might not be needed because the nullnessChecker can prove itself the contract holds.

This is in contrast with adding a null check at the point of usage, which will not catch logic errors where they are produce, but later when they are perceived; making it harder to debug and catching the issue at run time instead of compile time.

#exofixit

PiperOrigin-RevId: 346163124
2020-12-14 10:15:45 +00:00
aquilescanta
0501d47144 Add iso9 to the list of supported MP4 brands
Issue: #8308
#minor-release
PiperOrigin-RevId: 345707141
2020-12-14 10:14:35 +00:00
kimvde
3a17dd5fec Slomo flattening: get metadata from smta box
Retrieve the capture frame rate and the SVC temporal layer count from
the smta box instead of the meta box because this is what Samsung do. It
is not guaranteed that the meta box will be present and will contain all
the necessary info in all slomo files.

PiperOrigin-RevId: 345639680
2020-12-14 10:14:14 +00:00
ibaker
74bbd5367e Gracefully handle null-terminated subtitle content in MKV containers
This was reported for SSA/ASS in PR #8265, but it seems to me the
SubRip part of the Matroska spec is similarly loose, so this change
handles null-terminated strings in both.

#minor-release

PiperOrigin-RevId: 345452667
2020-12-03 17:13:12 +00:00
ibaker
10b9de8342 Add an MKV asset with SSA subtitles for extractor and playback tests
Asset generated using a temporary SSA file and:
```
$ mkvmerge -o sample_with_ssa_subtitles.mkv sample.mkv input.ssa
```

PiperOrigin-RevId: 345217628
2020-12-03 17:11:13 +00:00