45 Commits

Author SHA1 Message Date
hmzh
efb49f285e Refactor MIDI and Flac extractor loaders for deduplication
Add MIDI filetype information for use in the ExtractorsFactory

PiperOrigin-RevId: 447976272
2022-05-24 10:33:06 +01:00
ibaker
4f616d6003 Remove ExoPlayer's RawCcExtractor
RawCC is a Google-internal subtitle format, and is no longer used with
ExoPlayer.

PiperOrigin-RevId: 446950691
2022-05-09 11:02:25 +01:00
ibaker
e7e466f729 Remove empty <p> tag from WebvttDecoder
PiperOrigin-RevId: 445217294
2022-05-09 10:32:48 +01:00
olly
a16c0b3068 Reading AV1 initialization data.
We add an entire class like we do for parsing other codec initialization formats; it's currently not doing any parsing though (... initialization data is really simple for AV1 though: just the entire contents of the box).

For testing, we add the sample file, having been re-encoded with ffmpeg (and we also happen to have another av1 file, too).

PiperOrigin-RevId: 444890282
2022-05-09 10:24:18 +01:00
ibaker
fd6b57469d Fix calculations that may lose precision compared to their target type
PiperOrigin-RevId: 444861268
2022-05-09 10:21:44 +01:00
Ian Baker
2898d41f4a Merge pull request #9967 from jruesga:cea708-handle-multiple-service-blocks
PiperOrigin-RevId: 444816821
2022-05-09 10:18:14 +01:00
Ian Baker
9369348d6f Merge pull request #10150 from egor-n:dev-v2-8435-outlinecolour
PiperOrigin-RevId: 444787307
2022-05-09 10:15:05 +01:00
olly
296efbb395 Reading AV1 initialization data.
We add an entire class like we do for parsing other codec initialization formats; it's currently not doing any parsing though (... initialization data is really simple for AV1 though: just the entire contents of the box).

For testing, we add the sample file, having been re-encoded with ffmpeg (and we also happen to have another av1 file, too).

PiperOrigin-RevId: 439453823
2022-04-06 11:58:54 +01:00
olly
21d085f8a9 Reading average and peak bitrates from esds boxes.
This provides better compatibility with MediaExtractor, which does read these fields; we also need them for being able to mux file contents into another mp4 file.

Also, there is a minor refactor included so that we have an actual type for esds box contents instead of a pair.

PiperOrigin-RevId: 438673825
2022-04-06 11:39:05 +01:00
aquilescanta
67acfc67de Support seeking in un-intearleaved tracks in Mp4Extractor
A client can pass the id of the track on which they want to seek.

PiperOrigin-RevId: 437248055
2022-04-06 10:59:41 +01:00
aquilescanta
e8b0971f12 Simplify nullability in Mp4Extractor
PiperOrigin-RevId: 437002406
2022-03-24 15:38:20 +00:00
aquilescanta
7db0d91dd9 Add maxNumRefFrames to NalUnitUtil
Needed for AVI support.

PiperOrigin-RevId: 436991922
2022-03-24 14:41:28 +00:00
aquilescanta
5b4abc31f3 Group NAL type constants in NalUnitUtil
To be shared with AviExtractor in a later CL.

PiperOrigin-RevId: 436430385
2022-03-22 10:32:35 +00:00
olly
5a304fdbd9 FMP4: Fix output of mixed v0 and v1 emsg samples
Issue: google/ExoPlayer#9996
#minor-release
PiperOrigin-RevId: 430773329
2022-03-01 09:35:58 +00:00
olly
9238dc758d Add Matroska Extractor Test Sample For Opus
PiperOrigin-RevId: 429386479
2022-02-18 14:56:25 +00:00
olly
c80d30ebce Avoid Clearing Supplemental Data Flag In MatroskExtractor
PiperOrigin-RevId: 429368911
2022-02-18 14:56:25 +00:00
olly
f1e59f8001 Libopus Support For WebM DiscardPadding
PiperOrigin-RevId: 429364728
2022-02-18 14:56:25 +00:00
Ian Baker
38717ce969 Reformat some javadoc 2022-02-18 14:54:02 +00:00
olly
1af8d57032 Fix Sample Size For Supplemental Data In MatroskaExtractor
For when a track is both encrypted and has supplemental data, the sample size will be equal to `block sample size - encryption data size`.

PiperOrigin-RevId: 427807612
2022-02-17 10:17:19 +00:00
tonihei
287182952d Fix the position of IntDefs to match TYPE_USE
#minor-release

PiperOrigin-RevId: 427131569
2022-02-08 11:07:50 +00:00
olly
1f7174e731 Revert of 87420e5f9bd1671cd3068185f7358f5faba53e71
PiperOrigin-RevId: 426996878
2022-02-08 11:07:43 +00:00
Ian Baker
77315b6596 Merge pull request #9924 from jruesga:cea708-decoder-honor-service-block-size
PiperOrigin-RevId: 426953267
2022-02-08 10:26:23 +00:00
ibaker
87420e5f9b Fix the position of IntDefs to match TYPE_USE
#minor-release

PiperOrigin-RevId: 426855255
2022-02-07 10:49:31 +00:00
ibaker
01c814e2f0 Mark all public 'rarely used' IntDefs as only TYPE_USE
This is a breaking change if the annotation itself is in use in Kotlin
code. It's judged that the IntDefs in this commit are unlikely to be
referred to often in Kotlin code. This is because they're either:
- Related to esoteric parts of the library, or
- In a common part of the library but only returned from methods (and
  never passed to callback methods).

A follow-up change will fix the positions of existing usages to match
this new config.

#minor-release

PiperOrigin-RevId: 426410237
2022-02-07 10:47:50 +00:00
ibaker
8149ac8922 Mark all non-public IntDefs as only TYPE_USE
This only changes IntDefs that cannot be used by apps because they're
either private or package-private.

A follow-up change will fix the positions of existing usages to match
this new config.

#minor-release

PiperOrigin-RevId: 426372273
2022-02-04 14:51:52 +00:00
ibaker
92a6cc10a4 Mark some unreleased IntDefs as TYPE_USE only
The longer list of targets is only necessary for backwards
compatibility with existing Kotlin code that will stop compiling
if the position of the annotation becomes 'wrong' by marking it only
TYPE_USE. Since none of these IntDefs have been released (except in
media3 alpha1) we don't need to maintain this compatibility.

Also add a comment to all the places that *do* need the longer list of
targets, in order to explain why it's there and discourage copy-pasting
when defining new IntDefs in future.

Also fix some single-element arrays to remove the array notation.

#minor-release

PiperOrigin-RevId: 426108537
2022-02-04 09:38:55 +00:00
ibaker
daa45a16bd Fix parameter comments
PiperOrigin-RevId: 425874534
2022-02-04 09:32:39 +00:00
Andrew Lewis
497f55a4bb Merge pull request #9893 from moneytoo:mkv-vtt
PiperOrigin-RevId: 424382031
2022-01-28 08:45:44 +00:00
Andrew Lewis
b2152f1988 Merge pull request #9864 from OxygenCobalt:vorbis-comments
PiperOrigin-RevId: 424355325
2022-01-28 08:42:33 +00:00
olly
d9fd85aa63 Parse CryptoInfo from simpleTag and set it into DrmInitData.
PiperOrigin-RevId: 418960700
2022-01-05 12:15:27 +00:00
Ian Baker
d94bb08211 Merge pull request #9709 from Marksss:release-v2
PiperOrigin-RevId: 415272874
2021-12-10 11:19:44 +00:00
olly
6f63701307 Fix 1 ErrorProneStyle finding
PiperOrigin-RevId: 413188534
2021-12-02 11:55:55 +00:00
kimvde
f9d3bedb0b Fix inconsistency with spec in H.265 SPS nal units parsing
Issue: google/ExoPlayer#9719

#minor-release

PiperOrigin-RevId: 412424558
2021-12-02 11:55:44 +00:00
christosts
d5b6250350 Populate ICY headers into MediaMetadata
Populate ICY headers into MediaMetadata so that they can
propagate to the app via AnalyticsListener#onMediaMetadataChanged().
This change copies IcyHeaders.name into MediaMetadata.description
and IcyHeaders.genre into MediaMetadata.genre.

Note: MediaItem.metadata maintain their precedence and overwrite any
ICY headers parsed.

Issue: google/ExoPlayer#9677

#minor-release

PiperOrigin-RevId: 410495676
2021-11-19 14:55:51 +00:00
Ian Baker
5ce54179aa Merge pull request #9543 from KasemJaffer:rf64
PiperOrigin-RevId: 408816643
2021-11-19 14:29:19 +00:00
kimvde
f4d85ac247 WavExtractor: skip unknown chunks consistently
#minor-release

PiperOrigin-RevId: 408550935
2021-11-19 14:23:48 +00:00
kimvde
7168f93829 WavExtractor: split header reading state into 2 states
This refactoring is the basis to support RF64 (see
Issue: google/ExoPlayer#9543).

#minor-release

PiperOrigin-RevId: 407301056
2021-11-09 10:09:13 +00:00
aquilescanta
ab9741aced Parse HDR static metadata from MP4 files
#minor-release

PiperOrigin-RevId: 407136922
2021-11-09 10:09:13 +00:00
tonihei
d1e13b629d Fix rounding error in fMP4 presentation time calculation
The presentation time in fMP4 is calculated by adding and subtracting
3 values. All 3 values are currently converted to microseconds first
before the calculation, leading to rounding errors. The rounding errors
can be avoided by doing the conversion to microseconds as the last step.

For example:
In timescale 96000:  8008+8008-16016 = 0
Rounding to us first: 83416+83416-166833=-1

#minor-release

PiperOrigin-RevId: 406809844
2021-11-09 10:07:30 +00:00
kimvde
8586127d88 WavExtractor: split read stages into states
This refactoring is the basis to support RF64 (see
Issue: google/ExoPlayer#9543).

#minor-release

PiperOrigin-RevId: 406377924
2021-11-09 10:07:00 +00:00
christosts
9d5fd4f402 DefaultExtractorsFactory: lazily load flac extension
PiperOrigin-RevId: 406332026
2021-11-09 10:06:11 +00:00
ibaker
a60843ead5 Migrate callers of deprecated C.java methods to Util.java
#minor-release

PiperOrigin-RevId: 406166670
2021-11-08 15:17:26 +00:00
ibaker
e8fdab353f Allow missing full_range_flag in colr box with type=nclx
Test file produced with:
$ MP4Box -add "sample.mp4#video:colr=nclc,1,1,1" -new sample_18byte_nclx_colr.mp4

And then manually changing the `nclc` bytes to `nclx`.

This produces an 18-byte `colr` box with type `nclx`. The bitstream of
this file does not contain HDR content, so the file itself is invalid
for playback with a real decoder, but adding the box is enough to test
the extractor change in this commit.

(aside: MP4Box will let you pass `nclx`, but it requires 4 parameters, i.e. it
requires the full_range_flag to be set, resulting in a valid 19-byte colr box)

#minor-release
Issue: #9332
PiperOrigin-RevId: 405842520
2021-10-27 13:04:55 +01:00
olly
aff15ae9ee Set assumedVideoMinimumCodecOperatingRate for all playbacks
PiperOrigin-RevId: 405736227
2021-10-27 09:23:28 +01:00
Andrew Lewis
933e207b3e Update to androidx.media3
PiperOrigin-RevId: 405656499
2021-10-27 09:12:46 +01:00