5484 Commits

Author SHA1 Message Date
ybai001
35930623bd Add eac3 test assets and cases 2020-02-06 09:56:46 +08:00
olly
6d550ef2d6 Don't re-init codec if DRM session is unchanged
This condition is trying to detect when it might be necessary
to switch from a non-secure to a secure codec. This is not
possible if the DRM session is unchanged, unless a different
codec is required for some other reason (e.g., H264 -> H265),
which is anyway handled by canKeepCodec below.

PiperOrigin-RevId: 292909126
2020-02-03 14:45:30 +00:00
olly
cda6cba5a5 More nullness fixes in testutil
PiperOrigin-RevId: 292907271
2020-02-03 14:45:22 +00:00
ibaker
ad115a5ab3 Fix some boolean logic in TtmlStyle#inherit
I got confused copying the hasBackgroundColor logic in
3aa52c2317

Add tests to confirm I got it right this time

PiperOrigin-RevId: 292898421
2020-02-03 14:45:13 +00:00
kimvde
49fa6d63f9 Remove redundant prepared flag in ProgressiveMediaPeriod
PiperOrigin-RevId: 292892407
2020-02-03 14:45:04 +00:00
olly
8ac5698aac Remove deprecated Format.createSampleFormat
PiperOrigin-RevId: 292888026
2020-02-03 14:44:56 +00:00
olly
97fbbad6a7 Avoid unnecessary decoder instantiations on key rotation
Issue: #6903
PiperOrigin-RevId: 292884280
2020-02-03 11:21:54 +00:00
olly
c095a9ff98 Make SingleSampleMediaSource.Factory reusable
PiperOrigin-RevId: 292879934
2020-02-03 11:21:30 +00:00
ibaker
b6bd57ab12 Replace most usages of @TargetApi with @RequiresApi
We keep @TargetApi where the method is a safe no-op on
older versions due to an in-line version check.

PiperOrigin-RevId: 292878727
2020-02-03 11:21:21 +00:00
ibaker
c7ea8bbf1a Reduce the number of allocations in SubtitlePainter.setupTextLayout
PiperOrigin-RevId: 292877661
2020-02-03 11:21:05 +00:00
olly
3a702cf53a Change Format.createTextSampleFormat for common uses cases
PiperOrigin-RevId: 292863614
2020-02-03 11:20:56 +00:00
olly
0be3451c39 Change Format.createImageSampleFormat for common use case
PiperOrigin-RevId: 292570360
2020-02-03 11:20:40 +00:00
olly
a7c6cb4abb Add some missing local @Nullable annotations
PiperOrigin-RevId: 292564056
2020-02-03 11:20:31 +00:00
olly
d287e13d9e Add Format.createSampleFormat for common use case
PiperOrigin-RevId: 292562678
2020-01-31 17:52:51 +00:00
olly
04218bdeb8 Remove deprecated Format constructors
PiperOrigin-RevId: 292554283
2020-01-31 17:52:42 +00:00
olly
660cfd2863 Lock down SampleQueue to reasonable extension points
PiperOrigin-RevId: 292542298
2020-01-31 17:52:34 +00:00
olly
2a718c5aa6 Rollback of 3e41c0a1d2
*** Original commit ***

Rollback of 3c56b113e4

*** Original commit ***

Rollback of d48dc4c159

*** Original commit ***

Move getting-stuck-prevention into DefaultLoadControl.

We recently added code that prevents getting stuck if the buffer is low and
the LoadControl refuses to continue loading (b84bde0252).

Move this logic...

***

PiperOrigin-RevId: 292457964
2020-01-31 17:52:18 +00:00
samrobinson
52fb5f38a7 Adjust FakeSampleStream to take varargs of FakeSampleStreamItem.
This is instead of taking a list.

PiperOrigin-RevId: 292354720
2020-01-30 19:31:31 +00:00
samrobinson
3e6efe7eaf Fix outputFormat not being assigned after position is reset.
PiperOrigin-RevId: 292350437
2020-01-30 19:31:23 +00:00
olly
7c8a54c6d0 Start fixing nullness in testutil
PiperOrigin-RevId: 292340530
2020-01-30 19:31:06 +00:00
olly
ff822ff9fd HLS: Fix key rotation
Passing EXT-X-KEY DrmInitData through the FragmentedMp4Extractor
doesn't work for streams with key rotation, because an extractor
instance is used for multiple segments, but is only passed the
EXT-X-KEY DrmInitData corresponding to the first segment.

This change removes passing DrmInitData through the extractor,
and instead passes it via FormatAdjustingSampleQueue. This is
in-line with how manifest DrmInitData is handled during DASH
playbacks.

Issue: #6903
PiperOrigin-RevId: 292323429
2020-01-30 19:30:58 +00:00
Oliver Woodman
cf06589029 Merge pull request #6724 from nnoury:fix/subtitles-outline-color
PiperOrigin-RevId: 292316767
2020-01-30 19:30:48 +00:00
olly
d75aa97c0c SampleQueue: Let subclasses easily invalidate format adjustment
This is a nice-regardless improvement to SampleQueue, which will
likely to used to fix the referenced issue. It makes it possible
for SampleQueue subclasses to support dynamic changes to format
adjustment in a non-hacky way.

Issue: #6903
PiperOrigin-RevId: 292314720
2020-01-30 19:30:38 +00:00
bachinger
21fe13d3d7 add playWhenReady changed callback with reasons
PiperOrigin-RevId: 292194805
2020-01-30 19:30:29 +00:00
ibaker
6424403907 Add tate-chu-yoko support to TtmlDecoder
PiperOrigin-RevId: 292161845
2020-01-30 19:30:21 +00:00
aquilescanta
6377e277c7 Move DrmSession into the core module
PiperOrigin-RevId: 292112214
2020-01-30 19:30:12 +00:00
kimvde
427db0b532 Update mp3 test files to test more common use cases
PiperOrigin-RevId: 292110291
2020-01-30 19:30:04 +00:00
olly
016042defa Fix incorrect parameter name comment
PiperOrigin-RevId: 292099759
2020-01-30 19:29:55 +00:00
kimvde
5d74ebe552 MP3 IndexSeeker: handle seek to non-yet-read frames
Issue: #6787
PiperOrigin-RevId: 291953855
2020-01-30 19:29:47 +00:00
ibaker
e15989ffff Add @Dimension annotation to SubtitleView size methods
PiperOrigin-RevId: 291943185
2020-01-30 19:29:38 +00:00
ibaker
658e0e17b8 Make SubtitleWebView 'invisible' to touch events
Without this, tapping the main video playback doesn't bring up the
controls.

PiperOrigin-RevId: 291943063
2020-01-30 19:29:29 +00:00
Nicolas Noury
1e72e1acff Introduce edgeLayout to keep outline color
Fix outline style subtitle

When a ForegroundColorSpan changes the foreground color, it is also applied
to the outline painter. In order to keep the correct color, one needs to
filter out theses span. We do this with a new cue that is our text source
for the specific edgeLayout.

Take care to only apply background color once

Test: Manual check - Subtitle view can show custom color subtitles from specific Subtitle
Renderer and outline is shown correctly using user defined color.
2020-01-29 14:48:06 +01:00
krocard
e92ea31fcd Do not throw on valid SubtitleView.setViewType
Calling setViewType with the same view type as the
subtitleView is using would throw InvalidArgumentException
instead of being a noop.

PiperOrigin-RevId: 291937202
2020-01-28 16:57:01 +00:00
ibaker
2fd8cf0206 Add SubtitleWebView
PiperOrigin-RevId: 291927263
2020-01-28 16:56:51 +00:00
tonihei
b83534ee03 Simplify startMediaTimeUs states.
We currently have 3 states, but the NOT_SET state isn't needed
anymore. We can therefore replace the IntDef by a simple boolean.

PiperOrigin-RevId: 291926049
2020-01-28 16:56:43 +00:00
tonihei
739fd5f5bb Include startMediaTime in media position checkpoints.
We currently apply new parameter checkpoints from an absolute media
time and then substract the current media start time again to retrieve
the media time offset for this playback parameter checkpoint.

However, the media start time may change when unexpected discontinuities
happen (the start time doesn't actually change, but we change it to
correct for this discontinuity). This then invalidates the absolute
media time in the playback parameter checkpoints (which should have been
corrected as well).

Avoid this problem by also only applying the new start position
from the checkpoint. We don't have to save the start position anymore
because it will cancel itself out.

Also add some documentation and code clarification for improved
readability.

PiperOrigin-RevId: 291923069
2020-01-28 16:56:35 +00:00
olly
00fe2eb4a6 Tweak isPlaceholder documentation
PiperOrigin-RevId: 291905440
2020-01-28 16:56:26 +00:00
ibaker
f3157e703f Split some of SubtitleView out into SubtitleTextView
SubtitleView now becomes a ViewGroup that owns a SubtitleTextView. It
handles some common styling defaults, but delegates the underlying
values down into SubtitleTextView through the SubtitleView.Output
interface.

When I add a SubtitleWebView this will also be a ViewGroup containing
a WebView and will implement SubtitleView.Output and convert Cue styling
into HTML & CSS.

PiperOrigin-RevId: 291903294
2020-01-28 16:56:17 +00:00
olly
331edb4fb2 Expand dangal workaround to all API levels
It doesn't seem worth keeping the cap, since the device
will presumably stop receiving major version updates at
some point anyway.

Issue: #6899
PiperOrigin-RevId: 291899439
2020-01-28 16:56:08 +00:00
olly
9161fe2328 Make LongArray tests a bit more concise
This also makes them look more like the equivalent tests for
the list / array cases.

PiperOrigin-RevId: 291890150
2020-01-28 16:55:59 +00:00
kimvde
103bd4199c Add IndexSeeker to MP3 extractor
This seeker is only seeking to frames that have already been read by the
extractor for playback. Seeking to not-yet-read frames will be
implemented in another change.

Issue: #6787
PiperOrigin-RevId: 291888899
2020-01-28 16:55:50 +00:00
aquilescanta
bb9b3fd45e Fix some typos
PiperOrigin-RevId: 291750515
2020-01-28 16:55:41 +00:00
olly
8da0e27d2e Fix premature nullness assertions
Issue: #6910
PiperOrigin-RevId: 291721229
2020-01-27 18:22:31 +00:00
tonihei
4dddad831a Keep requested content position even for content periods.
We currently only keep the requested next content start position while
we are playing ads. However, we should also keep at least before a content
period is fully prepared to not loose the information about the user intent.

PiperOrigin-RevId: 291705752
2020-01-27 18:22:23 +00:00
tonihei
c0a3feee00 Add window.isPlaceHolder flag
There are existing bugs that need this flag to know whether the
current information in the window is still a placeholder or can
already be relied on for further calculation.

This flag will probably only ever be set in DummyTimeline, so it's
not added to the window.set method to avoid updating all clients.

Issue:#5924
PiperOrigin-RevId: 291705637
2020-01-27 18:22:15 +00:00
kimvde
5a6cffcf6f Justify MP3 ConstantBitrateSeeker frame size + add tests
PiperOrigin-RevId: 291702471
2020-01-27 18:22:06 +00:00
andrewlewis
2fc426214f Fix running tests with gradle
The tests for the extractor module rely on some core classes.

PiperOrigin-RevId: 291688932
2020-01-27 11:05:28 +00:00
kimvde
694f9844b0 MP3 extractor: refactor seeker initialization
PiperOrigin-RevId: 291405419
2020-01-27 11:05:20 +00:00
olly
3fc61de7f7 give SimpleDecoder's thread a name.
PiperOrigin-RevId: 291401328
2020-01-27 11:05:12 +00:00
kimvde
accbc5bba5 Add binarySearchFloor() for LongArrays
PiperOrigin-RevId: 291397882
2020-01-27 11:05:03 +00:00