4700 Commits

Author SHA1 Message Date
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
ibaker
a09960b8f4 Move HLS mapped track picking into a separate method
This helps reduce the amount of nesting in HlsSampleStreamWrapper.track()

PiperOrigin-RevId: 271983779
2019-10-13 12:08:24 +01:00
ibaker
d9b60edabf Remove duplicated tracksEnded check in HlsSampleStreamWrapper
PiperOrigin-RevId: 271364512
2019-10-13 12:04:28 +01:00
ibaker
87138ceede Reshuffle {audio,video}SampleQueue{Index,MappingDone} into fields mapped by type
PiperOrigin-RevId: 271364200
2019-10-13 12:04:12 +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
76a1dd3da2 Use Player.isPlaying in appropriate places.
This method should be used where we previously checked for active playback
by state==READY and playWhenReady=true. Using the new method ensures we take
audio focus into account for these usages.

Also update some method naming to avoid confusion with the isPlaying method.

Issue:#6203
PiperOrigin-RevId: 270910982
2019-10-13 12:01:04 +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
aquilescanta
c9fc0da745 When the HLS container format is not packed audio, reset timestmap offset
Issue:#6444
PiperOrigin-RevId: 270252126
2019-09-20 12:33:13 -07: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
olly
57370b37ce Update translations
PiperOrigin-RevId: 269521864
2019-09-17 09:07:55 -07:00
bachinger
32a8625fb7 allowing 36 characters for shuffle mode off
PiperOrigin-RevId: 268478545
2019-09-17 09:06:50 -07:00
bachinger
cf3cfa1d69 allow 33 characters for strings of shuffle on/off
PiperOrigin-RevId: 268238764
2019-09-17 09:06:43 -07:00
bachinger
b2aa0ae087 provide content description for shuffle on/off button
PiperOrigin-RevId: 266884166
2019-09-17 09:06:13 -07:00
aquilescanta
66ba8d7793 Fix propagation of HlsMetadataEntry's in HLS chunkless preparation
PiperOrigin-RevId: 263356275
2019-09-17 08:34:37 -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
bachinger
332afc9f79 move transparency values of buttons to resources to make it accessible for customization
PiperOrigin-RevId: 266880069
2019-09-16 16:57:53 -07:00
aquilescanta
c3f3b1bfa4 Clarify LoadErrorHandlingPolicy's loadDurationMs javadocs
PiperOrigin-RevId: 266797383
2019-09-16 16:57:21 -07:00
bachinger
c879bbf64c move transparency of shuffle mode off button to bitmap
PiperOrigin-RevId: 266795413
2019-09-16 16:56:55 -07:00
Oliver Woodman
525d0320a7 Fix exception message
PiperOrigin-RevId: 266790267
2019-09-16 16:56:32 -07:00
bachinger
4712bcfd53 use isPlaying to determine which notification action to display in compact view
PiperOrigin-RevId: 266782250
2019-09-16 16:54:18 -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