2075 Commits

Author SHA1 Message Date
olly
32b0474d57 Clean up playback suppression
PiperOrigin-RevId: 274561876
2019-10-14 14:11:31 +01:00
olly
0cda57aa5a Bump version to 2.10.6
PiperOrigin-RevId: 274534626
2019-10-14 14:10:28 +01:00
olly
5a6fdaad72 Don't set a playback suppression reason for permanent audio focus loss
It's documented to be for temporary loss only (i.e. the case where
externally reported playWhenReady is still true)

PiperOrigin-RevId: 274129922
2019-10-13 12:42:52 +01:00
olly
6934c6fb33 Fix bogus reporting of audio focus loss
Playback cannot be suppressed if playWhenReady=false

PiperOrigin-RevId: 273726084
2019-10-13 12:33:56 +01:00
olly
0249058c1b Parse Label elements for adaptation sets
Issue: #6297
PiperOrigin-RevId: 273297284
2019-10-13 12:29:18 +01:00
sofijajvc
722722d8df Fix GL error logging
Log only if an error occured.

PiperOrigin-RevId: 272618322
2019-10-13 12:16:50 +01:00
olly
32afc33313 Make factories return specific types
PiperOrigin-RevId: 272614917
2019-10-13 12:16:38 +01:00
olly
e34685601c Minor upstream cleanup
PiperOrigin-RevId: 272614610
2019-10-13 12:16:08 +01:00
ibaker
e0c8cbe21e Pass the raw ICY metadata through IcyInfo
The ICY 'spec' isn't really clear/tight enough to do anything more
specific than this I think.

Issue:#6476
PiperOrigin-RevId: 272405322
2019-10-13 12:13:28 +01:00
tonihei
ad59304f77 Forward isPlaying/playbackSuppressionReason changes to analytics listeners.
PiperOrigin-RevId: 271347407
2019-10-13 12:03:39 +01:00
tonihei
7e46d34788 Add EventListener.onPlaybackSuppressionReasonChanged
Adding this callback makes sense for completeness (we have similar callbacks
for all other playback state properties), and also to detect audio focus loss
while buffering which would currently trigger no callback because isPlaying
is still false.

Issue:#6203
PiperOrigin-RevId: 271347351
2019-10-13 12:03:18 +01:00
olly
a3667decf9 Try initializing ADAPTATION_WORKAROUND_BUFFER as a byte[]
PiperOrigin-RevId: 270999947
2019-10-13 12:01:34 +01:00
tonihei
fec8275331 Change default bandwidth fraction in AdaptiveTrackSelection.
A reduced fraction of 0.7 was shown to better balance the rebuffer/quality
trade-off.

PiperOrigin-RevId: 270670465
2019-10-13 11:58:39 +01:00
tonihei
f8d81d05a4 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-20 10:07:10 -07:00
aquilescanta
556a9954a8 Avoid retrying fatal errors
Also clear fatal errors on seek operations

PiperOrigin-RevId: 269780886
2019-09-18 15:28:19 -07:00
olly
73e35abf27 Bump version to 2.10.5
PiperOrigin-RevId: 269582832
2019-09-18 15:26:44 -07:00
olly
2fca01b925 Make flags contiguous: There's no reason for the gap :)
PiperOrigin-RevId: 269514872
2019-09-17 09:08:12 -07:00
aquilescanta
47e405ee11 Add a metadata argument to Format factory methods used in HLS
Required for propagation of HlsMetadataEntry's in chunkless preparation.

PiperOrigin-RevId: 263324345
2019-09-17 08:34:13 -07:00
christosts
1a4b1e1ea1 Revert "Add HTTP request parameters (headers) to DataSpec."
This reverts commit c3d6be3afdd7c0ca68dba15e443bc64aa3f61073.
2019-09-16 17:53:40 -07:00
Oliver Woodman
26e293070e Merge pull request #6158 from xirac:dev-v2
PiperOrigin-RevId: 268240722
2019-09-16 17:51:50 -07:00
tonihei
560c8c8760 Simplify and improve text selection logic.
This changes the logic in the following ways:
 - If no preferred language is matched, prefer better scores for the selected
   audio language.
 - If a preferred language is matched, always prefer the better match
   irrespective of default or forced flags.
 - If a preferred language score and the isForced flag is the same, prefer
   tracks with a better selected audio language match.

PiperOrigin-RevId: 259707430
2019-09-16 17:33:38 -07:00
Toni
9bc4497749 Merge pull request #6178 from xirac:feature/text-track-score
PiperOrigin-RevId: 259707359
2019-09-16 17:31:27 -07:00
olly
23ddfaa80a 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-16 17:08:39 -07:00
andrewlewis
b9ffea6831 Fix decoder selection for E-AC3 JOC streams
Issue: #6398
PiperOrigin-RevId: 267563795
2019-09-16 17:08:06 -07:00
tonihei
72aa150f02 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-16 17:04:32 -07:00
andrewlewis
5a516baa78 Fix init data handling for FLAC in MP4
Issue: #6396
PiperOrigin-RevId: 267536336
2019-09-16 17:04:24 -07:00
aquilescanta
c3f3b1bfa4 Clarify LoadErrorHandlingPolicy's loadDurationMs javadocs
PiperOrigin-RevId: 266797383
2019-09-16 16:57:21 -07:00
Oliver Woodman
525d0320a7 Fix exception message
PiperOrigin-RevId: 266790267
2019-09-16 16:56:32 -07:00
kimvde
284a672bb3 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-16 16:51:07 -07:00
olly
f05d67b7c7 Simplify androidTest manifests & fix links to use https
PiperOrigin-RevId: 266396506
2019-09-02 14:39:02 +01:00
olly
407dbf075e Add HttpDataSource.getResponseCode to provide the status code associated with the most recent HTTP response.
PiperOrigin-RevId: 266218104
2019-09-02 14:38:24 +01:00
olly
ad699b8ff6 seenCacheError should be set for all errors
PiperOrigin-RevId: 265662686
2019-09-02 14:37:40 +01:00
christosts
c3d6be3afd Add HTTP request parameters (headers) to DataSpec.
Adds HTTP request parameters in DataSpec. Keeps DataSpec behavior to be immutable as before.

PiperOrigin-RevId: 265087782
2019-09-02 14:37:24 +01:00
tonihei
46bf710cb3 Do not compare bitrates of audio tracks with different languages.
The last selection criteria is the audio bitrate to prefer higher-quality
streams. We shouldn't apply this criterium though if the languages of the
tracks are different.

Issue:#6335
PiperOrigin-RevId: 265064756
2019-09-02 14:37:12 +01:00
olly
7cefb56eda Update comment to indicate correct int value of "FLAG_ALLOW_CACHE_FRAGMENTATION" in ExoPlayer2 upstream DataSpec
Currently the value of FLAG_ALLOW_CACHE_FRAGMENTATION is defined as "1 << 4" but commented as "8". Either the value of FLAG_ALLOW_CACHE_FRAGMENTATION should be "1 << 3", or the comment should be 16. Here I am modifying the comment since it does not affect any current behavior.

PiperOrigin-RevId: 265011839
2019-09-02 14:36:05 +01:00
andrewlewis
886fe910a8 Avoid potential ArrayStoreException with audio processors
The app is able to pass a more specialized array type, so the Arrays.copyOf call
produces an array into which it's not valid to store arbitrary AudioProcessors.

Create a new array and copy into it to avoid this problem.

PiperOrigin-RevId: 264779164
2019-09-02 14:35:52 +01:00
ibaker
c60b355f9c Add support for the AOM scheme_id for ID3-in-EMSG
https://developer.apple.com/documentation/http_live_streaming/about_the_common_media_application_format_with_http_live_streaming

PiperOrigin-RevId: 264126140
2019-09-02 14:35:00 +01:00
ibaker
47e0580d80 Unwrap SCTE-35 messages in emsg boxes
PiperOrigin-RevId: 263768428
2019-09-02 14:34:35 +01:00
ibaker
d3d192e36e Extend EventMessage.toString to include durationMs
This field is used in .equals(), so it makes sense to include it in toString() too.

PiperOrigin-RevId: 263768329
2019-09-02 14:34:30 +01:00
ibaker
9ec346a2e1 Modify EventMessageDecoder to return null if decoding fails (currently throws exceptions)
This matches the documentation on MetadataDecoder.decode:
"@return The decoded metadata object, or null if the metadata could not be decoded."

PiperOrigin-RevId: 263767144
2019-09-02 14:34:19 +01:00
ibaker
5100e67c83 Support unwrapping nested Metadata messages in MetadataRenderer
Initially this supports ID3-in-EMSG, but can also be used to support SCTE35-in-EMSG too.

PiperOrigin-RevId: 263535925
2019-09-02 14:33:45 +01:00
ibaker
2de1a204e2 Add Metadata.toString that prints the contents of entries
entries are used in .equals(), so it's good to have them printed in toString() too (for test failures) and it makes logging easier too.

PiperOrigin-RevId: 263335503
2019-09-02 14:33:26 +01:00
ibaker
dcac4aa67f Add description to TextInformationFrame.toString() output
This field is used in .equals(), we should print it in toString() too

PiperOrigin-RevId: 263335432
2019-09-02 14:33:21 +01:00
tonihei
90b62c67fb Change default video buffer size to 32MB.
The current max video buffer is 13MB which is too small for high quality
streams and doesn't allow the DefaultLoadControl to buffer up to its default
max buffer time of 50 seconds.

Also move util method and constants only used by DefaultLoadControl into this
class.

PiperOrigin-RevId: 263328088
2019-09-02 14:33:14 +01:00
tonihei
a381cbf536 Make reset on network change the default.
PiperOrigin-RevId: 262886490
2019-09-02 14:32:54 +01:00
olly
921ff02c90 Only read from FormatHolder when a format has been read
I think we need to start clearing the holder as part of the
DRM rework. When we do this, it'll only be valid to read
from the holder immediately after it's been populated.

PiperOrigin-RevId: 262362725
2019-09-02 14:32:40 +01:00
ibaker
a08b537e8e Simplify EventMessageEncoder/Decoder serialization
We're no longer tied to the emsg spec, so we can skip unused fields
and assume ms for duration.

Also remove @Nullable annotation from EventMessageEncoder#encode, it
seems the current implementation never returns null

PiperOrigin-RevId: 262135009
2019-09-02 14:32:33 +01:00
ibaker
bb6b0e1a5a Expose a method on EventMessageDecoder that returns EventMessage directly
PiperOrigin-RevId: 262121134
2019-09-02 14:32:27 +01:00
tonihei
acdb19e99d Clean up documentation of DefaultTrackSelector.ParametersBuilder.
We don't usually refer to other classes when documenting method parameters
but rather duplicate the actual definition.

PiperOrigin-RevId: 262102714
2019-09-02 14:32:21 +01:00
tonihei
c4ac166f2f Add allowAudioMixedChannelCountAdaptiveness parameter to DefaultTrackSelector.
We already allow mixed mime type and mixed sample rate adaptation on request,
so for completeness, we can also allow mixed channel count adaptation.

Issue:#6257
PiperOrigin-RevId: 261930046
2019-09-02 14:32:10 +01:00