2466 Commits

Author SHA1 Message Date
bachinger
216f74ecc7 avoid unexpected state changes with certain playlist states
With the internal playlist some new situation may happen that were not possible before:

- handlePlaylistInfoRefreshed in EPII called in IDLE state
- handlePlaylistInfoRefreshed in EPII called in ENDED state with an empty playlist
- seeks in ENDED state with an empty playlist

PiperOrigin-RevId: 270316681
2019-09-22 00:15:43 +01:00
tonihei
0cc0444af8 Restructure setup of default values in track selection parameter builders.
PiperOrigin-RevId: 270250456
2019-09-20 17:21:01 +01:00
tonihei
31b9280e0e Add track selection option to use accessiblity captioning manager settings
This option allows to set the preferred text language and role flags based
on the user's accessiblity captioning settings.

Issue:#5749
PiperOrigin-RevId: 270233205
2019-09-20 17:21:01 +01:00
tonihei
531c5638a2 Rename DEFAULT_WITHOUT_VIEWPORT to DEFAULT_WITHOUT_CONTEXT.
PiperOrigin-RevId: 270227069
2019-09-20 17:21:01 +01:00
bachinger
852c3a53e7 copy masked timeline before notifying listeners
PiperOrigin-RevId: 270221478
2019-09-20 17:21:01 +01:00
bachinger
a60265b106 enable/disable media source correctly when added to playlist
PiperOrigin-RevId: 270007370
2019-09-20 17:21:00 +01:00
aquilescanta
9863cd33fa Avoid retrying fatal errors
Also clear fatal errors on seek operations

PiperOrigin-RevId: 269780886
2019-09-18 23:23:21 +01:00
bachinger
3b22db33ba add top-level playlist API to ExoPlayer
Public design doc:
https://docs.google.com/document/d/11h0S91KI5TB3NNZUtsCzg0S7r6nyTnF_tDZZAtmY93g

Issue: #6161
PiperOrigin-RevId: 269584512
2019-09-18 23:23:13 +01:00
olly
75b9b11e20 Bump version to 2.10.5
PiperOrigin-RevId: 269582832
2019-09-18 23:23:04 +01:00
olly
656c97f122 Minor DefaultDrmSessionManager tweaks
PiperOrigin-RevId: 269574864
2019-09-17 16:56:54 +01:00
aquilescanta
5df2f142b4 Don't retry fatal errors in DefaultDrmSession
Issue:#6334
PiperOrigin-RevId: 269553308
2019-09-17 16:56:46 +01:00
olly
67e8024d84 Make flags contiguous: There's no reason for the gap :)
PiperOrigin-RevId: 269514872
2019-09-17 16:56:30 +01:00
olly
d3d9e288c8 Improve ChunkSource.onChunkLoadError documentation
PiperOrigin-RevId: 269463652
2019-09-17 16:56:22 +01:00
aquilescanta
6ae3e0983a Add default implementations for ExoMediaDrm.Provider
Issue:#4721
PiperOrigin-RevId: 269378440
2019-09-16 23:32:09 +01:00
aquilescanta
5630273155 Add DummyExoMediaDrm
Allows streamlining the way we handle unsupported DRM. In general, either:

* The device does not support the CDM. For example, phones don't support
  PlayReady.
* The device does not support the protection scheme. For example, API < 25
  devices do not support AES-CBC.

Currently we handle both cases differently. A dummy ExoMediaDrm will allow
the existence of dummy DefaultDrmSessionManagers.

PiperOrigin-RevId: 269315687
2019-09-16 23:32:02 +01:00
aquilescanta
9face09361 Add ExoMediaDrm.Provider
Allows shared ownership of ExoMediaDrms. Shared ownership will
allow users to pre-create ExoMediaDrms in their apps, as opposed
to having the DrmSessionManager create the ExoMediaDrm.

Issue:#4721
PiperOrigin-RevId: 269305850
2019-09-16 23:31:48 +01:00
olly
73654e27da Minor cleanup to Loader documentation
PiperOrigin-RevId: 269092322
2019-09-16 23:31:28 +01:00
tonihei
e784d2c507 Add Player.isPlaying and Player.getPlaybackSuppressionReason
The player may suppress playback when waiting for audio focus even if the
state==Player.READY. There is currently no getter or callback to obtain this
piece of information for UI updates or analytics.

Also, it's a important derived state to know whether the playback position is
advancing. Add isPlaying and the corresponding callback to allow retrieving
this information more easily.

Issue:#6203
PiperOrigin-RevId: 268921721
2019-09-16 23:31:20 +01:00
olly
d443be2a46 Clear supplementalData in DecoderInputBuffer.clear
PiperOrigin-RevId: 268894250
2019-09-16 23:31:12 +01:00
olly
20c66e6a82 Use Util.toLowerInvariant instead of String.toLowerCase
PiperOrigin-RevId: 268880519
2019-09-13 13:51:27 +01:00
tonihei
65748fa8ee Mark dropped buffers while joining as skipped.
These buffers are intentionally dropped to catch up with the playing audio.
Mark them as skipped accordingly.

PiperOrigin-RevId: 268703410
2019-09-13 13:51:19 +01:00
tonihei
dc12982bd1 Don't force render first frame when joining.
We currently force render the first frame in all cases. However, when joining
video to an ongoing playback, there is no defined first frame and we should
rather drop frames if we are late until we caught up with the audio playback.

PiperOrigin-RevId: 268698093
2019-09-13 13:51:12 +01:00
tonihei
e68b96dc78 Keep newly assigned window sequence number if queue is still empty.
When the queue is empty, we may still get multiple requests for a window
sequence number using the same periodUid. We should keep the initially
assigned number because no window change happened.

PiperOrigin-RevId: 268649009
2019-09-13 13:50:56 +01:00
aquilescanta
62eb845763 Attempt acquisition of a placeholder session if format.drmInitData is null
Issue:#4867
PiperOrigin-RevId: 268505056
2019-09-13 13:50:48 +01:00
aquilescanta
143d7d6cca Implement acquirePlaceholderSession in DefaultDrmSessionManager
Issue:#4867
PiperOrigin-RevId: 268497377
2019-09-13 13:50:41 +01:00
aquilescanta
82a31eed2f Add a placeholder mode for DefaultDrmSessions
Issue:#4867
PiperOrigin-RevId: 268473094
2019-09-13 13:50:25 +01:00
aquilescanta
0cc1e5143b Add acquirePlaceholderSession to DrmSessionManager
Issue:#4867
PiperOrigin-RevId: 268472704
2019-09-13 13:50:17 +01:00
aquilescanta
890700fa0f Push formatHolder up to the BaseRenderer class
PiperOrigin-RevId: 268431514
2019-09-13 13:50:09 +01:00
aquilescanta
bbe8c25832 Make minor simplifications in DefaultDrmSession
PiperOrigin-RevId: 268422418
2019-09-13 13:50:00 +01:00
olly
0706625089 Add fLaC prefix to FLAC initialization data
The fLaC prefix is included in the initialization data output
from the MKV extractor, so this is highly likely ot be the
right thing to do.

Issue: #6397
PiperOrigin-RevId: 268244365
2019-09-10 17:43:31 +01:00
Oliver Woodman
755b4a25e4 Merge pull request #6158 from xirac:dev-v2
PiperOrigin-RevId: 268240722
2019-09-10 17:43:21 +01:00
kimvde
73b922ee59 Add capture policy option to AudioAttributes
PiperOrigin-RevId: 268035329
2019-09-10 10:28:01 +01:00
andrewlewis
e21467f653 Fix Dolby Vision fallback to AVC and HEVC
PiperOrigin-RevId: 267979637
2019-09-10 10:27:53 +01:00
aquilescanta
5e8f611f06 Replace pendingFormat with waitingForFirstSampleInFormat in SimpleDecoderVideoRenderer
PiperOrigin-RevId: 267612438
2019-09-10 10:27:31 +01:00
aquilescanta
2866b2b3e4 Make renderers ignore drmInitData if the MediaSource provides a DrmSession
Will allows to use a DrmSession for clear periods.

Issue:#4867
PiperOrigin-RevId: 267576982
2019-09-10 10:27:23 +01:00
andrewlewis
f1ccb47c3b Fix decoder selection for E-AC3 JOC streams
Issue: #6398
PiperOrigin-RevId: 267563795
2019-09-10 10:27:15 +01:00
tonihei
77ed930251 Add Timeline.Window.uid.
This allows to uniquely identify a window within a Timeline. The value is set
correctly for all Window instances, but is not used anywhere yet.

PiperOrigin-RevId: 267556516
2019-09-10 10:27:07 +01:00
tonihei
de915bd6a1 Handle potential timeline updates that switch from content to ad.
We currently don't test if an ad needs to be played in case we are already
playing content.

This is to prevent recreating the current content period when
an ad is marked as skipped. We prefer playing until the designated ad group
position and appending another piece of content. This is less likely to cause
visible discontinuities in case the ad group position is at a key frame
boundary.

However, this means we currently miss updates that require us to play an ad
after a timeline update.

PiperOrigin-RevId: 267553459
2019-09-10 10:26:59 +01:00
andrewlewis
b77688533b Fix init data handling for FLAC in MP4
Issue: #6396
PiperOrigin-RevId: 267536336
2019-09-10 10:26:51 +01:00
Yannick RUI
5f48871731 Count the number of matches for role flags.
Select a track with matching role flags even if someone specifies a preferred role flgs without providing a preferred language
Prefer track without captions or describing music and sound flag when no role flag preference is provided.
2019-09-05 17:31:24 +02:00
tonihei
b57c556194 Remove deprecated Timeline.getWindow method.
Removing this method requires custom MediaSource implementations to switch
to the new version. While this breaks the implmentation, it also avoids problems
with accidentely forwarding to the wrong method or with accidental stack
overflows when none of the two methods gets implemented.

It's unlikely any callers are affected because this is only the extended version
with the defaultProjectionPositionUs parameter that no caller except the
internal player will use.

PiperOrigin-RevId: 267323042
2019-09-05 10:48:46 +01:00
olly
40870b8780 Prevent audio pops on audio format change. We'd like to switch opus audio bitrates in the middle of playback based on network conditions.
Changing between different bitrates on the same codec should not require decoder initialization.

PiperOrigin-RevId: 267208043
2019-09-05 10:48:45 +01:00
olly
0e7740f576 Clear FormatHolder before and after reading from the source.
PiperOrigin-RevId: 267135256
2019-09-05 10:48:45 +01:00
aquilescanta
578398c297 Move DefaultLoadErrorHandling creation to DefaultDrmSessionManager
Issue:#6334
PiperOrigin-RevId: 266910499
2019-09-05 10:48:45 +01:00
christosts
260db03167 Use DataSpec request params in HttpDataSource impls
Include Dataspec.httpRequestHeaders in CronetDataSource,
and OkHttpDataSource. Updated documentation of
HttpDataSource.open() to suggest that it should set request
headers (in decreasing priority) from (1) the passed DataSpec,
(2) parameters set with setRequestProperty() and (3) default
parameters set in the HttpDataSource.Factory. No mechanism
has been put in place to enforce this.

PiperOrigin-RevId: 266895574
2019-09-05 10:48:45 +01:00
aquilescanta
64829a0373 Calculate loadDurationMs in DefaultDrmSession key and provisioning requests
PiperOrigin-RevId: 266812110
2019-09-05 10:48:45 +01:00
olly
2d0b10a73a Use constant to define androidx annotation version
PiperOrigin-RevId: 266801762
2019-09-05 10:45:08 +01:00
aquilescanta
d37c18abfe Clarify LoadErrorHandlingPolicy's loadDurationMs javadocs
PiperOrigin-RevId: 266797383
2019-09-05 10:44:59 +01:00
olly
bcd7de5316 Fix exception message
PiperOrigin-RevId: 266790267
2019-09-05 10:44:43 +01:00
aquilescanta
494b6f6f3b Re-use local variable in replacement of unnecessary indirections
PiperOrigin-RevId: 266772364
2019-09-05 10:44:26 +01:00