4902 Commits

Author SHA1 Message Date
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
bachinger
f7e9e185f7 allowing 36 characters for shuffle mode off
PiperOrigin-RevId: 268478545
2019-09-13 13:50:33 +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
bachinger
e567f8edd0 allow 33 characters for strings of shuffle on/off
PiperOrigin-RevId: 268238764
2019-09-10 17:43:11 +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
0aba89b60e Make live HLS default start position at least 2*target duration from live edge
Issue:#6360
PiperOrigin-RevId: 267615050
2019-09-10 10:27:38 +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
Toni
75435b4210 Merge pull request #6286 from sr1990:dev-v2
PiperOrigin-RevId: 267323559
2019-09-05 10:56:35 +01:00
sr1990
33eb49ca0d Support negative value of the @r attrbute of S in SegmentTimeline element 2019-09-05 10:48:46 +01:00
sr1990
b4a1d55fe4 Support negative value of the @r attrbute of S in SegmentTimeline element 2019-09-05 10:48:46 +01: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
bachinger
a12c6641d9 provide content description for shuffle on/off button
PiperOrigin-RevId: 266884166
2019-09-05 10:48:45 +01:00
bachinger
e4eb6b7ea9 move transparency values of buttons to resources to make it accessible for customization
PiperOrigin-RevId: 266880069
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
0dc997103b Use constant to define androidx media version
PiperOrigin-RevId: 266802551
2019-09-05 10:45:24 +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
bachinger
d2c056eb91 move transparency of shuffle mode off button to bitmap
PiperOrigin-RevId: 266795413
2019-09-05 10:44:51 +01:00
olly
bcd7de5316 Fix exception message
PiperOrigin-RevId: 266790267
2019-09-05 10:44:43 +01:00
bachinger
eedf50fdca use isPlaying to determine which notification action to display in compact view
PiperOrigin-RevId: 266782250
2019-09-05 10:44:34 +01:00
aquilescanta
494b6f6f3b Re-use local variable in replacement of unnecessary indirections
PiperOrigin-RevId: 266772364
2019-09-05 10:44:26 +01:00
kimvde
82d10e2ea8 Bypass sniffing for single extractor
Sniffing is performed in ProgressiveMediaPeriod even if a single
extractor is provided. Skip it in that case to improve performances.

Issue:#6325
PiperOrigin-RevId: 266766373
2019-09-05 10:44:18 +01:00