2873 Commits

Author SHA1 Message Date
olly
1440cad5ed Fix build warnings under exoplayer/v2/library
- Removes empty <p> tag in javadoc
- Removes incorrect parameter name warnings for var args.

PiperOrigin-RevId: 294555651
2020-02-13 15:44:11 +00:00
olly
1cbe3f72e6 DataSpec: Deprecate most constructors
Keeping (Uri) and (Uri, position, length) to avoid needing
Builder for the trivial case.

PiperOrigin-RevId: 294530226
2020-02-13 15:43:54 +00:00
olly
14d3ed09d5 Add DataSpec.Builder
PiperOrigin-RevId: 294518763
2020-02-13 15:43:35 +00:00
Daniele Bonaldo
e99a7f6cd2 Merge branch 'dev-v2' into subtitle_color_in_cue_class
# Conflicts:
#	library/core/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttCueParser.java
2020-02-12 17:07:23 +01:00
olly
829282fa12 Replace DataSpec.absoluteStreamPosition with uriPositionOffset
This is a preliminary step toward adding a DataSpec.Builder,
which is needed for sanity when adding DataSpec.customData.

The existing absoluteStreamPosition field is very error prone,
because anyone using a Builder to adjust the request position
will need to remember to adjust two values:

dataSpec
    .buildUpon()
    .setAbsoluteStreamPosition(x)
    .setPosition(x)
    .build();

Furthermore, the difference between position and
absoluteStreamPosition is irrelevant in nearly all cases. In
the core library, the difference is only relevant when initializing
AES encryption/decryption to write/read cache files.

Replacing absoluteStreamPosition with uriPositionOffset will
simplify the code block above to:

dataSpec
    .buildUpon()
    .setPosition(x)
    .build();

PiperOrigin-RevId: 294485644
2020-02-11 22:10:17 +00:00
christosts
f59755f51c Fix JavaDoc
Replace Thread with thread on documentation.

PiperOrigin-RevId: 294401357
2020-02-11 17:12:45 +00:00
christosts
bc02643df0 Async queuing on MultiLockAsyncMediaCodecAdapter
Add support for asynchronous input buffer queueing in the
MultiLockAsyncMediaCodecAdapter.

PiperOrigin-RevId: 294397811
2020-02-11 17:12:37 +00:00
kimvde
22ce744095 Move assets from core to testdata module
PiperOrigin-RevId: 294239472
2020-02-11 17:12:13 +00:00
tonihei
66aa35f581 Select adaptive audio tracks based on the best track in the group.
Currently, the subset of audio tracks for adaptation is selected
purely based on the size of the subset in the track group, completely
ignoring the previously selected best individual track.

This change ignores all tracks with a different configuration than the
previously selected best track.

PiperOrigin-RevId: 294231806
2020-02-11 17:12:06 +00:00
bachinger
0eb0267131 deprecate and rename onLoadingChanged
PiperOrigin-RevId: 294222083
2020-02-11 17:11:58 +00:00
christosts
5725acb789 Defer MediaCodec queueing to background thread
The DedicatedThreadAsyncMediaCodecAdapter supports enqueueing
input buffers in a background Thread.

PiperOrigin-RevId: 294202744
2020-02-11 17:11:50 +00:00
aquilescanta
ac8a2e80e1 Prepare and release DrmSessionManager in Renderers
Issue: #6951
PiperOrigin-RevId: 294187695
2020-02-11 17:11:35 +00:00
christosts
d8802df62e Add interface MediaCodecInputBufferEnqueuer
MediaCodecInputBufferEnqueuer wraps MediaCodec queue operations.

PiperOrigin-RevId: 294182717
2020-02-11 17:11:04 +00:00
andrewlewis
fc24a0d52d Fix API check warning
PiperOrigin-RevId: 294179427
2020-02-11 17:10:49 +00:00
bachinger
c02933ac0a rename getPlaybackError
PiperOrigin-RevId: 294074348
2020-02-11 17:10:41 +00:00
krocard
9875c5d2b4 AudioCapabilities: Missing int class annotation
PiperOrigin-RevId: 293565660
2020-02-11 17:09:23 +00:00
andrewlewis
0dd8e6a7c1 Add GL demo app
Demonstrates rendering to a GLSurfaceView while applying a GL shader.

Issue: #6920
PiperOrigin-RevId: 293551724
2020-02-11 17:08:53 +00:00
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
bachinger
e1c48515eb add next, previous, fastForward and rewind to ControlDispatcher
Issue: #6926, #6934
PiperOrigin-RevId: 293315532
2020-02-11 17:07:52 +00:00
olly
cfda4a5870 Add some nullness annotations to SampleQueue
PiperOrigin-RevId: 292921158
2020-02-11 17:07:18 +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
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
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
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
olly
d287e13d9e Add Format.createSampleFormat for common use case
PiperOrigin-RevId: 292562678
2020-01-31 17:52:51 +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
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
olly
016042defa Fix incorrect parameter name comment
PiperOrigin-RevId: 292099759
2020-01-30 19:29:55 +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
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
aquilescanta
bb9b3fd45e Fix some typos
PiperOrigin-RevId: 291750515
2020-01-28 16:55:41 +00:00
Pierre-Hugues Husson
1d65afdd16 Add minimal support of DVB AIT
This is used by broadcast channels to provide interactive contents.
2020-01-28 16:07:02 +01:00