8207 Commits

Author SHA1 Message Date
tonihei
b99c6e0513 Update message and seek positions using user intent
While the window in which a message or a seek position is resolved is
still a placeholder, we need to re-resolve the position using the
user intent (i.e. the window position) when the timeline updates.

PiperOrigin-RevId: 293346360
2020-02-11 17:08:30 +00:00
tonihei
da02bc73e8 Add missing getPeriod call to populate period.
The period in this method is most likely prepopulated correctly, but
this assumption is very error-prone and we should populate it locally.

PiperOrigin-RevId: 293345873
2020-02-11 17:08:22 +00:00
tonihei
486f401736 Pass in initial sample timestamp to FakeSampleStream.
This allows to simulate samples in a stream more accurately
particularly when streams are prepared at a non-zero position and
issuing a sample with position=0 is not expected.

Also makes seek more realistic by also issuing one sample again.

PiperOrigin-RevId: 293344081
2020-02-11 17:08:15 +00:00
tonihei
c9245c61de Fix order of timeline and prepare callback in MaskingMediaSoure
Once we receive an update from a masked source, we first start the
preparation of an already pending period, and only then notify the
player of the new timeline. If the period prepares immediately inline,
the MediaPeriod.onPrepared callback arrives before the
onPlaylistUpdateRequested call in the Player. THis is the wrong order
and causes issues when the player tries to lookup information in the
timeline that doesn't exist yet.

This change fixes preroll playbacks before live streams.

PiperOrigin-RevId: 293340031
2020-02-11 17:08:07 +00:00
kimvde
a9507a0064 Make FakeExtractorOutput dump additional seek points
PiperOrigin-RevId: 293337032
2020-02-11 17:08:00 +00:00
bachinger
e1c48515eb add next, previous, fastForward and rewind to ControlDispatcher
Issue: #6926, #6934
PiperOrigin-RevId: 293315532
2020-02-11 17:07:52 +00:00
aquilescanta
0f6bf1525d Remove unused test asset
Unused since [Internal ref: <unknown commit>].

PiperOrigin-RevId: 292932188
2020-02-11 17:07:44 +00:00
kimvde
a6f22cd96c BinarySeachSeeker: mark seek finished after reading input
This allows to continue the seek in case an error is thrown when reading
from the input.

PiperOrigin-RevId: 292924295
2020-02-11 17:07:33 +00:00
kimvde
792d9b39e0 Flac extension: disable BinarySearchSeeker if totalSamples is unknown
The ceilingTimePosition is based on the total number of samples. Binary
search seeking is not possible if this value is unknown.

PiperOrigin-RevId: 292921177
2020-02-11 17:07:26 +00:00
olly
cfda4a5870 Add some nullness annotations to SampleQueue
PiperOrigin-RevId: 292921158
2020-02-11 17:07:18 +00:00
olly
b23940dc61 Clean up Vorbis header
The functional change is to set the bitrate fields to Format.NO_VALUE
in the case that they're non-positive in the header data. Else it's
very easy to to take the fields and copy them directly into Format as
incorrect values.

Issue #2863

PiperOrigin-RevId: 292920141
2020-02-11 17:07:10 +00:00
bachinger
4bb6036cf6 add playback state changed listener
This change deprecates Player.onPlayerStateChanged(boolean pwr, int state). It removes deprecation for trivial cases. I'll remove other deprecated usages (mostly in ui module) in follow-up CLs to not bloat this CL.

PiperOrigin-RevId: 292917872
2020-02-11 17:07:03 +00:00
andrewlewis
704dae097a Add missing @deprecated tag
PiperOrigin-RevId: 292915739
2020-02-11 17:06:55 +00:00
kimvde
ed88f4f1dd Add possibility to update ExtractorOutput duration
PiperOrigin-RevId: 292912511
2020-02-11 17:06:48 +00:00
olly
de3877237b Add some missing nullness annotations
PiperOrigin-RevId: 292910310
2020-02-11 17:06:40 +00:00
kimvde
1a0afacfe1 FLAC extension: remove sample rate check
This check is not needed because the FLAC specification does not
restrict the sample rate value and because the extension reads files
with other sample rates properly.

PiperOrigin-RevId: 292909391
2020-02-11 17:06:32 +00:00
ybai001
35930623bd Add eac3 test assets and cases 2020-02-06 09:56:46 +08:00
ybai001
29f9cd3415
Merge pull request #11 from google/dev-v2
Merge from dev-v2
2020-02-06 09:44:18 +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
719b34a9f8 Migrate static imports of org.mockito.Matchers to org.mockito.ArgumentMatchers
The former is deprecated and replaced by the latter in Mockito 2.

For more information see go/mockito-2-lsc

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:292555754:BASE:292543534:1580490509580:bfdfdd31
PiperOrigin-RevId: 292881633
2020-02-03 11:21:46 +00:00
olly
bb8aa4f5b7 Update release notes for 2.11.2
PiperOrigin-RevId: 292881432
2020-02-03 11:21:38 +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
dd10d96a3f Tweak SpannedSubject error message when actual has no spans
Before:
No matching span found
in text  : Text with combined section.
expected : start=10	end=18	type=HorizontalTextInVerticalContextSpan	substring='combined'
but found:

After:
No matching span found
in text : Text with combined section.
expected: start=10	end=18	type=HorizontalTextInVerticalContextSpan	substring='combined'
but found no spans
PiperOrigin-RevId: 292878264
2020-02-03 11:21:13 +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
d7551f9740 Fixes incorrect parameter name comments in ImaAdsLoaderTest
This CL fixes build warnings (incorrect parameter name comment).

PiperOrigin-RevId: 292829708
2020-02-03 11:20:48 +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
3774530831 Fix annotation position
PiperOrigin-RevId: 292519511
2020-01-31 17:52:26 +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
bachinger
2adec8d984 annotate nullabilty of CommandReceiver
Issue: #6938
PiperOrigin-RevId: 292415853
2020-01-31 17:52:08 +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
andrewlewis
ffabb9f6e5 Add missing AV1 extension path to .gitignore
PiperOrigin-RevId: 292347360
2020-01-30 19:31:15 +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