4894 Commits

Author SHA1 Message Date
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
tonihei
aff9e731b2 Move DefaultHttpDataSource request header explanation to class Javadoc.
The Javadoc for open() won't be read by anyone because it's an overridden method
of the interface and not called directly from application code.

Move doc to class documentation as this is a generic explanation about the
functionality of the class. Also added "all" to clarify that all the parameters
will be added and the order of preference just applies in case of key clashes.

PiperOrigin-RevId: 266753249
2019-09-05 10:44:09 +01:00
tonihei
d9042a2985 Move effectively private method further down.
@VisibleForTesting sets the actual visiblity to private (except for tests),
so the method should be further down in code.

PiperOrigin-RevId: 266746628
2019-09-05 10:44:01 +01:00
olly
a02237de20 Fix imports
PiperOrigin-RevId: 266676413
2019-09-01 22:03:52 +01:00
olly
d720d2c3f6 Simplify androidTest manifests & fix links to use https
PiperOrigin-RevId: 266396506
2019-09-01 22:02:17 +01:00
christosts
967abdf0f5 Use DataSpec request params in DefaultHttpDataSource
DefaultHttpDataSource.open() also includes the request parameters that
are inside the DataSpec.

PiperOrigin-RevId: 266350573
2019-08-30 14:42:22 +01:00
aquilescanta
9508146840 Introduce LoadErrorHandling policy in DefaultDrmSession
This is a no-op interim change to introduce key request error
handling customization. Following changes will allow users to
inject their own LoadErrorHandlingPolicy implementations.

Issue:#6334
PiperOrigin-RevId: 266344399
2019-08-30 14:42:22 +01:00
kimvde
48555550d7 Surface MediaCodecInfo methods added in Android Q
- Surface information provided by methods isHardwareAccelerated,
  isSoftwareOnly and isVendor added in Android Q in MediaCodecInfo
  class.
- Estimate this information based on the codec name for earlier API
  levels.

Issue:#5839
PiperOrigin-RevId: 266334850
2019-08-30 14:42:22 +01:00
olly
f5c1e8b5e3 Add HttpDataSource.getResponseCode to provide the status code associated with the most recent HTTP response.
PiperOrigin-RevId: 266218104
2019-08-30 14:42:21 +01:00