4730 Commits

Author SHA1 Message Date
olly
e30f4f20f0 Bump version to 2.10.7
PiperOrigin-RevId: 278658259
2019-11-05 18:37:56 +00:00
kimvde
9ac13f91b6 Fix inverted arguments in FlacReader format creation
PiperOrigin-RevId: 278332587
2019-11-05 17:41:29 +00:00
kimvde
1ea878a0b0 Add parameter names to Format creation
PiperOrigin-RevId: 277963928
2019-11-05 17:41:04 +00:00
olly
accb31e489 Reset MediaSession shuffle/repeat modes if player is null
- This is for consistency with PlayerControlView.

- Also update PlayerNotificationManager notification if shuffle
  mode changes. This is for consistency with what happens when
  the repeat mode changes. By default the notification will be
  unchanged, but custom implementations can extend and then
  override createNotification, and given these modes change
  infrequently it feels like we can just do this. The alternative
  for achieving consistency would be to remove handling of repeat
  mode changes.

Issue: #6582
PiperOrigin-RevId: 277925094
2019-11-05 17:39:01 +00:00
kimvde
cc94ae7bfb Fix typo in WavHeader class
PiperOrigin-RevId: 277910360
2019-11-05 17:38:24 +00:00
andrewlewis
7ada1a848f Fix detection of Dolby Atmos in HLS
E-AC3 with JOC is signaled using the CHANNELS attribute for HLS:
https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices/hls_authoring_specification_for_apple_devices_appendices

PiperOrigin-RevId: 277680300
2019-11-05 17:37:41 +00:00
andrewlewis
f4b9042bf0 Recreate Opus decoder for stream change
The framework opus decoder discards some samples after a call to
flush(). Because we flush a decoder that is being retained across an
input format change, this means that the start of audio gets truncated
when transitioning to a new opus stream. See also
https://android.googlesource.com/platform/frameworks/av/+/refs/heads/android10-release/media/libstagefright/codecs/opus/dec/SoftOpus.cpp.

Avoid this by recreating opus decoders instead of flushing them. It
seems fine to do this for all opus decoders as reinitialization should
be cheap, OEM-provided implementations may also discard samples and
playback shouldn't be interrupted on reinitialization due to the
downstream AudioTrack buffer.

PiperOrigin-RevId: 277458759
2019-11-05 17:37:12 +00:00
ibaker
6788a830da Use -Float.MAX_VALUE for Cue#DIMEN_UNSET
Float.MIN_VALUE is very close to zero:

PiperOrigin-RevId: 276674142
2019-11-05 17:33:50 +00:00
aquilescanta
6aa792aad5 Document error handling in the Extractor interface
PiperOrigin-RevId: 276660235
2019-11-05 17:33:24 +00:00
ibaker
2c721130b1 Update parseStbl to handle edit lists & gapless info
Without this, a subtitle track empty edit list used to offset the start of
subtitles is ignored.

Also the current code seems to depend on the order in which
we parse the tracks (audio first means we have gapless info when we parse
video track, while video first we wouldn't).

It's not clear why we can't handle both edit lists & gapless info

PiperOrigin-RevId: 276029744
2019-11-05 17:32:13 +00:00
samrobinson
2671ff0c53 Added an ICY header workaround for unseekable MP3 streams.
Issue:#6537
PiperOrigin-RevId: 275477266
2019-10-18 18:15:07 +01:00
olly
b0d0914ce5 Round impossible H264 resolutions up to valid values for capabilities check
If an odd resolution is impossible in the specification itself, then we know
that the caller is passing invalid data. Round up on the assumption it's a
rounding error so that playback can proceed.

Issue: #6551
PiperOrigin-RevId: 275226813
2019-10-17 13:21:27 +01:00
tonihei
40dbe10b12 Align PlaybackSuppressionReason java doc with method doc.
Same change as done in c49388aca2.

PiperOrigin-RevId: 274894288
2019-10-15 23:10:47 +01:00
Oliver Woodman
55ff555188 Fix DashManifestParserTest in release branch 2019-10-14 17:14:41 +01:00
olly
657b47cd04 Fix broken Javadoc
PiperOrigin-RevId: 274564800
2019-10-14 14:19:52 +01:00
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
andrewlewis
c02f3dd4ff Handle legacy DASH audio channel configuration
Issue: #6523
PiperOrigin-RevId: 274160232
2019-10-13 12:44:29 +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
ibaker
3b9a9c9b7e Enable ID3-in-EMSG for HLS streams
This supports both chunkless & traditional preparation

PiperOrigin-RevId: 273938344
2019-10-13 12:37:08 +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
Oliver Woodman
6046e92920 Merge pull request #6502 from caiiiyua:bug_default_dash_chunk_source_wrong_segmentnumshift
PiperOrigin-RevId: 273549830
2019-10-13 12:29:27 +01:00
olly
0249058c1b Parse Label elements for adaptation sets
Issue: #6297
PiperOrigin-RevId: 273297284
2019-10-13 12:29:18 +01:00
olly
904e3f8d47 Define default colors as constants
It's confusing that app:played_color also modifies the colors
that derive from it, but the corresponding setter does not. It
seems generally clearer just to define constants.

PiperOrigin-RevId: 273249557
2019-10-13 12:19:04 +01:00
olly
97cfcb57e6 Cleanup: Only clamp seek positions for FFWD/RWND
It's confusing that seekTo(player, windowIndex, positionMs) does
clamping, because it only makes sense if windowIndex is the current
window.

Note: This doesn't actually fix anything (other than code clarity).
In cases where we were passing other windowIndices, we always
passed 0 as the position and so the clamping logic wouldn't have
had any effect.
PiperOrigin-RevId: 272857104
2019-10-13 12:18:23 +01:00
andrewlewis
495b418fb1 Add missing player null check
PiperOrigin-RevId: 272654378
2019-10-13 12:17:10 +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
2d0d4c7862 Clean up DashManifestParserTest
Also improve some tests by asserting the parser is left in
the correct position (assertNextTag).

PiperOrigin-RevId: 272614768
2019-10-13 12:16:25 +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
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