515 Commits

Author SHA1 Message Date
Dustin
5b952294f6 Refactor to ChunkHander, add Mp3ChunkHandler 2022-02-04 18:45:09 -07:00
ibaker
0c2e77daca 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 15:07:19 +00:00
ibaker
564c3bcb49 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 10:16:43 +00:00
ibaker
032df64f15 Fix parameter comments
PiperOrigin-RevId: 425874534
2022-02-04 09:52:19 +00:00
Dustin
aee15f6c70 Simplify AviTrack 2022-02-03 18:07:51 -07:00
Dustin
1528b8b5ee Found out RESULT_SEEK is a bad thing. Greatly improved Extractor efficiency. 2022-02-02 14:35:52 -07:00
Jorge Ruesga
bb7cab0cfd
Cea708Decoder: Honor service block size
The current implementation of ExoPlayer Cea708 is processing the whole service block without
taking into account the defined service block size, which could cause the execution of
unwanted command.

The following set of Cea708 represents a real use case of the above.

``` hex
FC9420FD152FFF0929FE8CFCFE9818FEE332FE731FFE1044FE8B03FE8CFCFE0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000
FC942CFD1520FF4649FE8CFEFE9918FEE332FE731FFE1000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000
FC942FFD9470FF8924FE8B03FE8CFCFE4A92FE0300FE9005FE0091FE2A00FE0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000
FC9420FD97A1FFC829FE8CFEFE9918FEE332FE731FFE1043FE9203FE0100FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000
FC94D6FDCEEFFF082AFE9202FE0C90FE0500FE912AFE0000FE424EFE6F00FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000
FCC168FD20F4FF4422FE4168FE4220FE7400FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000
FC2C20FDE520FF8422FE2C20FE4265FE2000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000
FC64EFFD70EFFFC422FE646FFE4270FE6F00FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000
FC6EA7FD6E67FF0422FE6E27FE426EFE6700FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000
FCF420FD6173FF4422FE7420FE4261FE7300FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000
FC67E5FD206DFF8422FE6765FE4220FE6D00FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000
FCF480FD7579FFC422FE7403FE4275FE7900FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000
```

The above frames should be displaying the following text on the screen (or at least the first part of it).

```
Ah, don't get
all sappy about it
```

ExoPlayer is currently parsing this block as follow (in parentheses the defined service block size):

```
(2) 22416842207400
G0 A
G0 h
G0 B
G0 \u0020
G0 t
C0 COMMAND_NUL

(2) 222C2042652000
G0 ,
G0 \u0020
G0 B
G0 e
G0 \u0020
C0 COMMAND_NUL

(2) 22646F42706F00
G0 d
G0 o
G0 B
G0 p
G0 o
C0 COMMAND_NUL

(2) 226E27426E6700
G0 n
G0 '
G0 B
G0 n
G0 g
C0 COMMAND_NUL

(2) 22742042617300
G0 t
G0 \u0020
G0 B
G0 a
G0 s
C0 COMMAND_NUL

(2) 22676542206D00
G0 g
G0 e
G0 B
G0 \u0020
G0 m
C0 COMMAND_NUL

(2) 22740342757900
G0 t
C0 COMMAND_ETX
G0 B
G0 u
G0 y
C0 COMMAND_NUL

(2) 2392030C4220730000
C1 COMMAND_SPL
G0 B
G0 \u0020
G0 s
C0 COMMAND_NUL
C0 COMMAND_NUL

(2) 22616C42656E00
G0 a
G0 l
G0 B
G0 e
G0 n
C0 COMMAND_NUL
```

So it ended up processing the following cue text (additional unwanted commands could be executed as well)

```
AhB t, Be doBpon'Bngt BasgeB mt
BuyB salBen
```

If instead the parsing logic take into account the service block size

```
(2) 22416842207400
G0 A
G0 h

(2) 222C2042652000
G0 ,
G0 \u0020

(2) 22646F42706F00
G0 d
G0 o

(2) 226E27426E6700
G0 n
G0 '

(2) 22742042617300
G0 t
G0 \u0020

(2) 22676542206D00
G0 g
G0 e

(2) 22740342757900
G0 t
C0 COMMAND_ETX

(2) 2392030C4220730000
C1 COMMAND_SPL

(2) 22616C42656E00
G0 a
G0 l
```

which is translated to (again I didn't processed all the frames, just a few of them)

```
Ah, don't get
al
```

which is what we are looking for.

This PR modifies service block parsing logic to honor service block size instead of read the full service block buffer.

Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2022-02-02 16:53:54 +00:00
Dustin
e9fcc967a3 Added copyright, better comments, removed dead code. 2022-02-01 17:33:10 -07:00
Dustin
0896a04d02 Add bits per second for audio. 2022-02-01 15:08:13 -07:00
Dustin
89d10451ce Move list types to the same class. Expose readHeaderList for external use. 2022-02-01 12:59:45 -07:00
Dustin
5f76e0fa04 AvcChunkPeeker tests 2022-01-31 10:52:12 -07:00
Dustin
d006f3f473 Beef up readIdx1 tests 2022-01-31 10:51:52 -07:00
Dustin
9bd93ad98e Add work-around for muxer bug where idx1 offset is from 0, not "movi"
location
2022-01-31 04:49:18 -07:00
Dustin
0ff238df99 Fix int overrun on files with large scale 2022-01-31 04:14:43 -07:00
Dustin
565db92ae2 Don't send meta on 0 length packets 2022-01-31 03:33:12 -07:00
Dustin
7c1cf36a9a Commented verbose log 2022-01-30 21:28:04 -07:00
Dustin
4f365cef90
Merge branch 'google:dev-v2' into dev-v2 2022-01-30 21:26:24 -07:00
Dustin
bf1a15652d Added support for AVC picOrderCountType = 2 2022-01-30 21:05:33 -07:00
Dustin
5e7679df53 Fix bug with null in aviTracks, add FourCC FMP4 2022-01-30 14:12:08 -07:00
Dustin
99e699a3f7 Clean up tests 2022-01-30 13:53:20 -07:00
Dustin
df9e51de9d More AviExtractor tests 2022-01-29 19:19:13 -07:00
Dustin
432ff5ea70 More AviExtractor tests 2022-01-29 14:51:03 -07:00
Dustin
66c240f1bd AviHeaderBox Tests 2022-01-29 11:35:35 -07:00
Dustin
b520b26f0f More AviExtractor tests 2022-01-29 10:59:55 -07:00
Dustin
a17d36de12 Minor cleanup 2022-01-28 17:42:04 -07:00
Dustin
1d85bf2456 Updated seek 2022-01-28 12:47:43 -07:00
Andrew Lewis
e58ffc0682 Merge pull request #9893 from moneytoo:mkv-vtt
PiperOrigin-RevId: 424382031
2022-01-28 09:33:35 +00:00
Andrew Lewis
fe7e5b8181 Merge pull request #9864 from OxygenCobalt:vorbis-comments
PiperOrigin-RevId: 424355325
2022-01-28 09:22:51 +00:00
Dustin
c41dc2360f Fix crash on streamId out of bounds 2022-01-25 15:19:10 -07:00
Dustin
f1d007e68c Fix issue where reading mime type wrong in video. More tests 2022-01-25 15:01:02 -07:00
Dustin
7ea2d75fcd Refactor Clock logic. Refactor peeking for MP4V and AVC. Moved AVI above MP3. 2022-01-24 16:02:37 -07:00
Marcel Dopita
6b3187ccf1 Support MKV embedded WebVTT captions 2022-01-24 18:12:43 +01:00
Dustin
09485cbed1 Passed along suggestedBufferSize to ExoPlayer 2022-01-23 14:52:53 -07:00
Dustin
43b8a9b336 Add support for StreamName fixed issues with position alignment 2022-01-23 13:45:22 -07:00
Dustin
167c2f3fc0 Fix alignment in track scanner 2022-01-23 12:10:48 -07:00
Dustin
ec26539aeb BitmapFactoryVideoRenderer improvements 2022-01-23 11:29:56 -07:00
Dustin
019aee277d Remapped MP4x to video/mp4x 2022-01-23 10:17:38 -07:00
Dustin
77a1873930 Fix bugs around seek 2022-01-23 09:22:22 -07:00
Dustin
98b487eb31 Removed unused StreamDataBox 2022-01-23 09:21:40 -07:00
Dustin
b90333af02 Clean up UnboundedIntArray 2022-01-23 09:21:11 -07:00
Dustin
3daa74dceb Tests for AudioFormat, VideoFormat and UnboundedIntArray 2022-01-22 22:10:12 -07:00
Dustin
c4cf876ddb Tests for Mp4vAviTrack and StreamHeaderBox 2022-01-22 20:41:39 -07:00
Dustin
3ce652ead2 Added support for DX50 2022-01-22 16:43:04 -07:00
Dustin
d2bb0c2cc1 Add MJPEG Support 2022-01-22 14:27:28 -07:00
Dustin
6f41585e72 AvcAviTrack cleanup 2022-01-22 09:44:10 -07:00
Dustin
5ebaafde6e Fix Avc Seek 2022-01-22 08:03:49 -07:00
Dustin
4c76bf1a9d Add file chooser to UI, Fixed timing issues on H264, Fixed PAR on XVID and H264 2022-01-21 22:25:32 -07:00
Dustin
d9afe5105b Refactor, remove dead code 2022-01-18 23:25:42 -07:00
Dustin
8d90498f79 Minor Tweaks 2022-01-18 23:04:14 -07:00
Dustin
58a2ca6083 Fix for movi with LIST('rec ') 2022-01-18 15:46:25 -07:00