231 Commits

Author SHA1 Message Date
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
ibaker
84a7ffc12a Add ParsableByteArray#ensureCapacity() method that keeps data
#exofixit

PiperOrigin-RevId: 344845328
2020-12-03 17:09:35 +00:00
samrobinson
7e635d9560 Set Format gapless info separately to Metadata in Extractors.
PiperOrigin-RevId: 344838400
2020-12-03 17:09:26 +00:00
ibaker
46598a46fd Audit usages of ParsableByteArray#reset(int)
This method should be assumed to clear the data of the underlying array
(it will do this if the new limit > data.length).

This means it should only be called (directly) before writing into the
backing array.

It shouldn't be used as a shorthand for position=0, limit=x - those
should be two explicit method calls.

Most of these changes are no-ops, but they make the code more correct.

The TS SectionReader can't be easily changed to be 'safe', because it
relies on sectionData maintaining state between iterations of the while
loop. Instead I've added comments justifying the existing code.

PiperOrigin-RevId: 344515340
2020-11-30 09:31:49 +00:00
tonihei
87cd644d00 Add remaining proguard config tests.
This ensures we have full test coverage for proguard configs now.
The only configs not covered by tests are:
 - IMA and OkHttp which copy recommended configs from the respective
   library. I couldn't reproduce failures by removing them (and thus
   couldn't write a test that ensures they are correct).
 - Some dontwarn lines that just suppress warnings.

In addition, this change fixes a couple of related issues:
 - Moved AV1 proguard config to correct module.
 - Removed mentioning of deprecated ExtractorMediaSource from README
 - Suppressed warning from IMA code that prevent proguarding under
   strict rules
 - Fixed wrong proguard exclusion in VP9 module.
 - Moved FLAC exclusion (DefaultExtractorsFactory) to correct module.
 - Added AlertDialog suppression for de-jetified code.
 - Removed unusued dependency from UI module that causes large APK
   size increase.

#exofixit
#minor-release

PiperOrigin-RevId: 344427532
2020-11-27 11:08:34 +00:00
ibaker
3aa17bfb9b Switch extractor tests to single-parameter parameterized syntax
This is simpler than instantiating a single-element string array for
every parameter.

#exofixit

PiperOrigin-RevId: 344237475
2020-11-27 11:06:51 +00:00
kim-vde
1cd08519f1 Merge pull request #8257 from xufuji456:dev-v2
PiperOrigin-RevId: 344057097
2020-11-24 16:04:04 +00:00
olly
f04941ed91 Fix 2 ErrorProneStyle findings:
* These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them
  (see http://go/bugpattern/UnnecessaryParentheses) (2 times)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Suggest a fix on the CL (go/how-to-suggest-fix).
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if the change looks generally problematic.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/exoplayer/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/exoplayer/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

PiperOrigin-RevId: 344053269
2020-11-24 16:03:54 +00:00
kimvde
7a7d3d1b07 Add FMP4 extractor test with sideloaded track
#exofixit

PiperOrigin-RevId: 344052500
2020-11-24 16:03:46 +00:00
tonihei
d4e1904604 Rollback of 483a350e84
*** Original commit ***

Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.

LSC: go/checker-lsc

Tested:
    TAP train for global presubmit queue
    http://test/OCL:342788973:BASE:342817196:1605636478036:6c558c0c

***

PiperOrigin-RevId: 343895651
2020-11-24 16:02:45 +00:00
ibaker
31166d41c4 Remove FLAG_SIDELOADED from FragmentedMp4Extractor
This isn't used any more, the last usage was removed in
<unknown commit>

PiperOrigin-RevId: 343266553
2020-11-19 17:13:11 +00:00
tonihei
e5fd2eb088 Rollback of db8356a17c
*** Original commit ***

Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.

LSC: go/checker-lsc

Tested:
    tap_presubmit: http://test/OCL:342788975:BASE:342885903:1605667635149:7731b723
    Some tests failed; test failures are believed to be unrelated to this CL

***

PiperOrigin-RevId: 343251530
2020-11-19 17:12:33 +00:00
olly
db8356a17c Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.
LSC: go/checker-lsc

Tested:
    tap_presubmit: http://test/OCL:342788975:BASE:342885903:1605667635149:7731b723
    Some tests failed; test failures are believed to be unrelated to this CL
PiperOrigin-RevId: 343129490
2020-11-19 17:12:16 +00:00
xufuji456
6682e6235c Compat video coding with mpeg1video in Mp4Extractor 2020-11-19 19:31:43 +08:00
tonihei
f13ffb4390 Rollback of 5d9c2d7b6a
*** Original commit ***

Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.

***

PiperOrigin-RevId: 343086403
2020-11-18 18:40:30 +00:00
olly
3c91ba14b3 Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.
PiperOrigin-RevId: 343003559
2020-11-18 18:40:17 +00:00
olly
483a350e84 Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.
PiperOrigin-RevId: 342999390
2020-11-18 18:40:06 +00:00
samrobinson
e832a4e0fc Adjust SEF reader times to long.
PiperOrigin-RevId: 342642410
2020-11-16 16:51:09 +00:00
samrobinson
55afddf05c Adjust SEF slow motion parsing to base data type off name.
PiperOrigin-RevId: 342050008
2020-11-13 14:55:10 +00:00
samrobinson
a038b421dd Add additional SEF data types.
PiperOrigin-RevId: 342034166
2020-11-13 14:54:51 +00:00
ibaker
1e776a864b Fix some typos
PiperOrigin-RevId: 341573964
2020-11-11 09:50:30 +00:00
olly
9d3875a860 Matroska: Support additional PCM codec modes
- Support 32-bit A_PCM/FLOAT/IEEE PCM
- Support 8-bit and 16-bit A_PCM/INT/BIG PCM

#minor-release
Issue: #8142
PiperOrigin-RevId: 340264679
2020-11-02 23:02:06 +00:00
samrobinson
2c746c6b6b Generalise the SlowMotion Metadata.Entry naming.
PiperOrigin-RevId: 339352447
2020-11-02 22:57:56 +00:00
samrobinson
c0a0708fc3 Extract SEF slow motion cues as Metadata
PiperOrigin-RevId: 339307746
2020-11-02 22:57:47 +00:00
kimvde
80a37c7ed1 Rename MotionPhoto to MotionPhotoMetadata
This make it clear that this class does not contain any photo/video
data.

PiperOrigin-RevId: 339045203
2020-11-02 22:56:11 +00:00
samrobinson
7ccbf572c7 Add a Metadata Entry class for SEF Slow motion data.
PiperOrigin-RevId: 338695793
2020-11-02 22:55:34 +00:00
kimvde
521a220728 Avoid throwing for still photo metadata retrieval
PiperOrigin-RevId: 338497163
2020-10-23 13:54:31 +01:00