231 Commits

Author SHA1 Message Date
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
hschlueter
4cf9106581 Transcode to a muxer-supported sample MIME type.
If the output sample MIME type is inferred from the input
but is not supported by the muxer, we fallback to transcoding
to a supported sample MIME type.
The audio and video renderers need to make sure not to select the PassthroughSamplePipeline for this case. Which sample MIME type
to choose is decided by the EncoderFactory.

PiperOrigin-RevId: 423272812
2022-01-25 19:22:23 +00:00
huangdarwin
41be22ef65 Transformer GL: Add pixel tests for transformation.
Rotation, translation, and scale tests on a normal video.

PiperOrigin-RevId: 422383176
2022-01-25 18:02:30 +00:00
bachinger
c4a2579b43 Inherit parent properties for manifests with dvb profile only
Issue: google/ExoPlayer#9856
PiperOrigin-RevId: 421842579
2022-01-17 14:06:06 +00:00
OxygenCobalt
49967483f6
Merge remote-tracking branch 'origin/dev-v2' into vorbis-comments
Line up this branch with the dev branch instead of the release branch.
2022-01-15 19:05:49 -07:00
OxygenCobalt
90b3056820
Refactor changes
Refactor the overall module to place the unified vorbis tags into a
single package called `vorbis`. Also re-intoduce the vorbis tags
in their original `flac` module, but deprecate them.
2022-01-09 16:16:20 -07:00
OxygenCobalt
60df845d4a
Fix vorbis tests
The vorbis tests did not expect metadata normally. Now they do.
2022-01-09 11:52:33 -07:00
ibaker
5370332fcc DASH: Stop interpreting main track role as SELECTION_FLAG_DEFAULT
The `main` role distinguishes a track from an `alternate`, but unlike
`SELECTION_FLAG_DEFAULT` it doesn't imply the track should be selected
unless user preferences state otherwise. e.g. in the case of a text
track, the player shouldn't enable subtitle rendering just because a
`main` text track is present in the manifest.

The `main`/`alternate` distinction is still available through
`Format.roleFlags` and the `ROLE_FLAG_MAIN` and `ROLE_FLAG_ALTERNATE`
values.

This behaviour was originally [added in 2.2.0](7f967f3057),
however at the time the `C.RoleFlags` IntDef did not exist. The IntDef
was [added in 2.10.0](a86a9137be).

PiperOrigin-RevId: 418937747
2022-01-04 17:17:29 +00:00
hschlueter
8b11902752 Throw when inferred sample MIME type is not supported by the muxer.
This is better than silently dropping tracks as done previously. Later,
we will implement fallback to transcoding to a supported MIME type.

PiperOrigin-RevId: 418006258
2022-01-04 14:00:44 +00:00
tonihei
65c444538b Rename HLS master playlist to multivariant playlist
The spec renamed this type of playlist in the latest revision
to use a more inclusive technical term (see
https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-10)

PiperOrigin-RevId: 417560274
2021-12-21 17:14:42 +00:00
tonihei
a1061edf7f Add some correctness checks to min/max live latency values.
For DASH manifests, we merge min/max live latency values from various
sources and they may not be consistent with each other. To ensure we
use a sensible configuration in all cases, we can add more correctness
checks:
 1. Limit the min/max values to fall into the available live window.
 2. Ensure that maxLatency >= minLatency in all cases.

Issue: google/ExoPlayer#9750
PiperOrigin-RevId: 415282938
2021-12-10 17:25:48 +00:00
kimvde
458e4b7397 Fix re-encoding after flattening
The decoder is using the SVC NAL unit prefix data on some Samsung
devices.

PiperOrigin-RevId: 414457181
2021-12-07 17:44:54 +00:00
hschlueter
775983c34b Flip input buffer even if the end of stream is reached.
Sometimes the empty end of stream buffer has a non-zero
data limit. Calling flip first, resets the limit to the
position which is zero in these cases.

PiperOrigin-RevId: 413156455
2021-12-02 12:38:56 +00:00
andrewlewis
5694a07ace Add unit test for FrameEditor
The test extracts and decodes the first video frame in the test media, renders it to the frame editor's input surface and then processes data. It then reads back the output from the frame editor, converts it to a bitmap and then compares that with a 'golden' bitmap (which is just the same as the test media's first video frame).

PiperOrigin-RevId: 413131811
2021-12-02 12:34:34 +00:00
ibaker
276f103c89 Parse DASH forced-subtitle role value
Issue: google/ExoPlayer#9727

#minor-release

PiperOrigin-RevId: 412266397
2021-11-26 16:07:17 +00:00
hschlueter
88d7b14b49 Do not queue empty input buffers.
Follow-up to a comment on 6f0f7dd1be: Buffers that are useful to pass
to the sample/passthrough pipeline should either contain data or the
end of input flag. Otherwise, passing these buffers along is unnecessary
and may even cause the decoder to allocate a new input buffer which is
wasteful.

PiperOrigin-RevId: 411060709
2021-11-26 14:45:02 +00:00
kim-vde
4a69e1660f Merge pull request #9536 from TiVo:p-fix-issue-2882
PiperOrigin-RevId: 411056555
2021-11-26 14:41:45 +00:00
tonihei
69d51feeee Add parsed essential/supplemental properties to the Representation.
We already parse essential and supplemental properties from the
Representation, but don't add them to our Representation class so that
they can be accessed by users.

Issue: google/ExoPlayer#9579
PiperOrigin-RevId: 409961990
2021-11-15 17:18:15 +00:00
tonihei
cd857d8659 Add parsed essential/supplemental properties to the Representation.
We already parse essential and supplemental properties from the
Representation, but don't add them to our Representation class so that
they can be accessed by users.

Issue: google/ExoPlayer#9579
PiperOrigin-RevId: 409961990
2021-11-15 14:52:25 +00:00
hschlueter
cfe61dbbda Write sample size to dumpfile in transformer tests.
If the number of samples changes, the sizes will help us to verify whether they are just split differently or extra data was added.

PiperOrigin-RevId: 407346280
2021-11-11 13:55:12 +00:00
tonihei
eec8d31544 Merge pull request #9543 from KasemJaffer:rf64
PiperOrigin-RevId: 408816643
2021-11-11 13:34:48 +00:00
tonihei
04517e17d4 Merge pull request #9543 from KasemJaffer:rf64
PiperOrigin-RevId: 408816643
2021-11-11 10:21:29 +00:00
hschlueter
9efa32e49b Accumulate remainder in buffer duration calculations.
When dropping the remainder, the decoder and encoder timestamps start diverging after a few buffers when no speed changes are supposed to occur. Tracking the remainder keeps them in sync.

PiperOrigin-RevId: 408341074
2021-11-08 17:05:09 +00:00
hschlueter
8552345f8f Add PassthroughSamplePipeline for audio.
When no transformation is needed, the passthrough pipeline allows us to skip decoding and re-encoding.

PiperOrigin-RevId: 407789767
2021-11-05 12:06:37 +00:00
hschlueter
62a35018f8 Separate TransformerAudioRenderer and new AudioSamplePipeline.
`TransformerAudioRenderer` reads input and passes `DecoderInputBuffer`s to the `AudioSamplePipeline`. The `AudioSamplePipeline` handles all steps from decoding to encoding. `TransformerAudioRenderer` receives `DecoderInputBuffer`s from the `AudioSamplePipeline` and passes their data to the muxer.

`AudioSamplePipeline` implements a new interface `SamplePipeline`. A pass-through pipeline will be added in a future cl.

PiperOrigin-RevId: 407555102
2021-11-05 11:48:26 +00:00
hschlueter
49a93e31d7 Write sample size to dumpfile in transformer tests.
If the number of samples changes, the sizes will help us to verify whether they are just split differently or extra data was added.

PiperOrigin-RevId: 407346280
2021-11-04 00:59:42 +00:00
aquilescanta
be4ea151c4 Parse HDR static metadata from MP4 files
#minor-release

PiperOrigin-RevId: 407136922
2021-11-03 15:57:11 +00:00
aquilescanta
41e338229a Parse HDR static metadata from MP4 files
#minor-release

PiperOrigin-RevId: 407136922
2021-11-03 15:07:30 +00:00
tonihei
4803ab3bd1 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-01 17:36:49 +00:00
tonihei
4e6960ee16 Add large renderer position offset.
This helps to prevent issues where decoders can't handle negative
timestamps. In particular it avoids issues when the media accidentally
or intentionally starts with small negative timestamps. But it also
helps to prevent other renderer resets at a later point, for example
if a live stream with a large start offset is enqueued in the playlist.

#minor-release

PiperOrigin-RevId: 406786977
2021-11-01 17:35:10 +00:00
tonihei
c05a5a162f 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-01 16:43:48 +00:00
tonihei
9f352434c7 Add large renderer position offset.
This helps to prevent issues where decoders can't handle negative
timestamps. In particular it avoids issues when the media accidentally
or intentionally starts with small negative timestamps. But it also
helps to prevent other renderer resets at a later point, for example
if a live stream with a large start offset is enqueued in the playlist.

#minor-release

PiperOrigin-RevId: 406786977
2021-11-01 16:20:19 +00:00
ibaker
39639f8df0 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:25:27 +01:00
Kasem SAEED
5b05d640c6 Add RF64 dump files for testing 2021-10-15 09:00:07 -07:00
Kasem
8501e997e0 Fix wrong RF64 data size and add unit test 2021-10-14 19:21:30 -07:00
kim-vde
059dfaef7c Merge pull request #9496 from DolbyLaboratories:dev-v2-truehd
PiperOrigin-RevId: 403081883
2021-10-14 16:16:05 +01:00
olly
eeec2b2e77 Final README updates
PiperOrigin-RevId: 402547071
2021-10-12 19:52:39 +01:00
christosts
4b3cbfd64f End to end test for WebVTT sideloaded subtitles
Enable subtitle output in the PlaybackOutput and disable the text
renderer in the MkvPlaybackTest. Add WebvttPlaybackTest to test the
output of side-loaded WebVTT subtitles.

PiperOrigin-RevId: 402526588
2021-10-12 19:48:48 +01:00
olly
e7c6ed5e7f Mechanical README cleanups
PiperOrigin-RevId: 401767060
2021-10-09 18:14:36 +01:00
olly
585b0bddcc DASH: Set MIME, width and height for image adaptation sets
Issue: #9500
PiperOrigin-RevId: 401091261
2021-10-06 20:55:10 +01:00
glass
d6bc49cc54 Add Dolby TrueHD extraction test for MP4 files.
Signed-off-by: glass <glass@dolby.com>
2021-09-30 16:17:57 +02:00
ibaker
c927bc8358 Add clearkey-based DRM playback emulator tests
These give some documentation-as-code for a clearkey integration with
ExoPlayer.

#exofixit

PiperOrigin-RevId: 398017708
2021-09-23 14:51:10 +01:00
olly
a34809bb9d Tweak use of TimestampAdjuster for seeking
- Fix use of getTimestampOffsetUs in TsExtractor where
  getFirstSampleTimestampUs should have been used.
- Don't reset TimestampAdjuster if it's in no-offset mode.
- Improve comment clarity

#minor-release

PiperOrigin-RevId: 388682711
2021-08-04 18:40:45 +01:00
apodob
8cddd4d80d Add font-size support to WebVTT CssParser.
This CL addresses the github issue [#8946](https://github.com/google/ExoPlayer/issues/8964). That issue requests support for `font-size` CSS property in WebVTT subtitle format. This CL:
* Adds support for `font-size` property by extending capabilities of WebVTT `CssParser`. Implementation of `font-size` property value parsing is based on the one in `TtmlDecoder`.
* Adds unit test along with test file containing WebVTT subtitles with all currently supported `font-size` units.

#minor-release

PiperOrigin-RevId: 388423859
2021-08-03 15:35:21 +01:00
bachinger
3f9093cc02 Add BaseUrlExlusionList and use it to select base URLs
Issues: #771 and #7654
PiperOrigin-RevId: 386850707
2021-07-27 12:23:34 +01:00
bachinger
f9162c07c2 Merge pull request #9207 from dlafayet:ruby-position
PiperOrigin-RevId: 386836747
2021-07-27 12:19:29 +01:00
Denise LaFayette
27576cfc73 Fix bug where rubyPosition in text node is not applied
Also fix bug where rubyPosition in ruby container style is not applied
2021-07-20 12:14:59 -04:00
andrewlewis
7d05f20493 Signal container MIME type for JPEGs
Before this change the `Format` on the image track output by the
`JpegExtractor` doesn't have a MIME type.

PiperOrigin-RevId: 381015819
2021-06-30 13:19:00 +01:00
bachinger
b48b618bce Parse multiple BaseURL elements
After this change, multiple BaseURL elements are parsed, but the player still only uses the first BaseURL element appearing in the manifest and its corresponding availabilityTimeOffsetUs.

PiperOrigin-RevId: 380775256
2021-06-30 13:11:25 +01:00