12124 Commits

Author SHA1 Message Date
olly
6edf9c31bf DownloadService: Only call getScheduler once
The second getScheduler() call violates the documentation of
the class, which states that getScheduler() is not called if
foregroundNotificationId if FOREGROUND_NOTIFICATION_ID_NONE.
Presumably implementing subclasses would return null, in which
case this didn't do any harm, but we should make sure the
implementation behaves as documented regardless.

PiperOrigin-RevId: 397167603
2021-09-16 22:44:06 +01:00
christosts
a95ee0aeba Move release note entry to correct section
#minor-release

PiperOrigin-RevId: 397164973
2021-09-16 22:41:50 +01:00
bachinger
f7abce6aea Move FlacConstant to lib-extractor
PiperOrigin-RevId: 397156268
2021-09-16 22:39:14 +01:00
bachinger
c21d5c7f33 Remove fully qualified link tag
PiperOrigin-RevId: 397141742
2021-09-16 22:37:20 +01:00
olly
f6d8cfeb1f DownloadService: Remove deprecated protected methods
PiperOrigin-RevId: 397138908
2021-09-16 22:35:23 +01:00
claincly
212e37f82a Fix RTSP WWW-Authenticate header parsing.
Issue: #9428

PiperOrigin-RevId: 397064086
2021-09-16 17:50:19 +01:00
krocard
4455554e9e Use Android 12's AudioManager.getPlaybackOffloadSupport
Previously gapless offload support was hardcoded to Pixel
only.

PiperOrigin-RevId: 397070378
2021-09-16 16:57:02 +01:00
bachinger
f8dde8ed5f Move classes from util package in lib-exoplayer
PiperOrigin-RevId: 397066804
2021-09-16 16:54:59 +01:00
samrobinson
e5e8d9dc17 Make StubExoPlayer take a context in constructor.
This is a pre-requisite step for merging SimpleExoPlayer into
ExoPlayer, because when StubExoPlayer extends ExoPlayer, it needs
a matching constructor.

PiperOrigin-RevId: 397065374
2021-09-16 16:52:52 +01:00
claincly
2f0aae0d5f Fix RTSP WWW-Authenticate header parsing.
Issue: #9428

#minor-release

PiperOrigin-RevId: 397064086
2021-09-16 16:50:54 +01:00
christosts
dfc29fc315 Fix HLS endless retrying on load errors
This was originally reported on #9390. There was a bug that when HLS
loads failed, the player would endlessly retry and never fail with a
player error.

This change fixes a bug in HlsSampleStreamWrapper.onPlaylistError()
which would return true for a playlist whose load encountered an error
but could not be excluded, whereas the method should return false.

Issue: #9390

PiperOrigin-RevId: 397045802
2021-09-16 16:44:22 +01:00
ibaker
b4aa8688df Fix how preacquired DRM sessions are released under resource contention
Previously the released preacquired sessions would start their keepalive
timeout, and so no additional resources would be freed in time for the
manager to retry the session acquisition.

This change adds an additional purge of keepalive sessions *after* the
preacquired sessions are released, which fixes the problem.

PiperOrigin-RevId: 396613352
2021-09-16 16:41:35 +01:00
christosts
e6cb52a471 PlaybackStatsListener: add check when adding guessed times
This is was reported in #9257 where the PlaybackStatsListener may try to
access an emtpy ArrayList.

Issue: #9257

#minor-release
#exofixit

PiperOrigin-RevId: 396329373
2021-09-16 16:39:51 +01:00
olly
3147a53c47 Constrain resolved period positions to be within the period
This is a candidate fix for #8906. As mentioned in that issue,
negative positions within windows might be (kind of) valid in
live streaming scenarios, where the window starts at some
non-zero position within the period. However, negative positions
within periods are definitely not valid. Neither are positions
that exceed the period duration.

There was already logic in ExoPlayerImplInternal to prevent a
resolved seek position from exceeding the period duration. This
fix adds the equivalent constraint for the start of the period.
It also moves the application of the constraints into Timeline.
This has the advantage that the constraints are applied as part
of state masking in ExoPlayerImpl.seekTo, removing any UI flicker
where the invalid seek position is temporarily visible.

Issue: #8906
PiperOrigin-RevId: 395917413
2021-09-16 16:14:20 +01:00
claincly
927d507397 Fix RTSP session header parsing regex error.
Issue: #9416

The dash "-" in the brackets must be escaped, or it acts like a range
operator.

PiperOrigin-RevId: 395909845
2021-09-16 16:11:51 +01:00
bachinger
5a5aeda3ec Add DASH samples with multiple base URLs
PiperOrigin-RevId: 395727438
2021-09-16 16:09:35 +01:00
bachinger
25a6ff5753 Select base URL on demand when a new chunk is created
Instead of selecting the base URL initially or when a load error occurs,
it is now selected when a chunk or initialization chunk is created. The
selected base URL is then assigned to
`RepresentationHolder.lastUsedBaseUrl` that is excluded in case of a
load error. For a next chunk another base URL will be selected by using
the `BaseUrlExclusionList`.

PiperOrigin-RevId: 395721221
2021-09-16 16:08:05 +01:00
olly
051e18b26f Fix STATE_IDLE Javadoc
Since playlist support was added, it's possible for the player to "have media"
and be in STATE_IDLE. The STATE_IDLE documentation therefore became incorrect.

Issue: #8946
#exofixit
#minor-release
PiperOrigin-RevId: 395653716
2021-09-16 15:14:48 +01:00
ibaker
9046124f97 Fix a bug in core_settings.gradle with relative paths
I think this has been broken since 617267bfcf (which was trying to fix
the same problem).

This change initializes `rootDir` to always be the current project (i.e. ExoPlayer)
directory. From the [Gradle docs](https://docs.gradle.org/current/userguide/working_with_files.html#sec:single_file_paths):
> What happens in the case of multi-project builds? The file() method
> will always turn relative paths into paths that are relative to the
> current project directory, which may be a child project.

We can also then remove exoplayerRoot completely and simplify the local
dependency instructions.

* #minor-release
* #exofixit
* Issue: #9403

PiperOrigin-RevId: 395478121
2021-09-16 15:13:51 +01:00
claincly
036039fb64 Handle malformed URL in RTP-Info header.
Some server will send partial URIs in the RTP-Info header, while the RTSP spec
requires absolute URLs.

Issue: #9346

PiperOrigin-RevId: 395452741
2021-09-16 15:11:42 +01:00
samrobinson
745c33f2d0 Fix AudioSink reset javadoc.
PiperOrigin-RevId: 395444714
2021-09-16 15:08:48 +01:00
olly
8a85cbbcd2 Fix poor documentation and variable name choice in StreamKey
Issue #9284

PiperOrigin-RevId: 395443015
2021-09-16 15:06:02 +01:00
bachinger
69c75fb5b0 Use identical cache keys for downloading and playing DASH segments
Issue: #9370
PiperOrigin-RevId: 395429794
2021-09-16 14:51:20 +01:00
andrewlewis
ee2ef1c3d5 Use correct last timestamp for C2 MP3 workaround
The C2 MP3 decoder produces an extra output buffer when draining after
end-of-stream is queued. This output buffer has a later timestamp than the last
queued input buffer so we need to calculate its timestamp to detect a stream
change in the correct position.

Before this CL we used the original input buffer timestamp as the largest
queued timestamp, which caused the stream change to be detected at the correct
position because the original input buffer timestamp was slightly larger than
the actual last output buffer timestamp. After this change we use exact
calculated timestamp as the largest queued timestamp. I manually verified
gapless continues to work on a device using the C2 MP3 decoder by comparing
output of the MP3 gapless and MP3 gapless stripped playlists in the demo app,
and that the last buffer timestamp now matches.

#exofixit

PiperOrigin-RevId: 395428928
2021-09-16 14:49:31 +01:00
klhyun
6452364c1c Update PlayerView's UI when available commands change
PiperOrigin-RevId: 395395015
2021-09-16 14:48:55 +01:00
olly
dd33afb335 Fix some PlayerControlView accessibility issues
- Fix focus when pausing and resuming
- Prevent repeated readout of the playback position when paused

Issue #9111

PiperOrigin-RevId: 395301765
2021-09-16 14:46:44 +01:00
olly
1bd96fbaf7 ID3: Fix end-of-string detection for UTF-16
The current detection logic checks that the two byte terminator starts
at an even position in the ID3 data, where-as it should check that it
starts at an even position relative to the start of the string.

Issue: #9087
PiperOrigin-RevId: 395274934
2021-09-16 14:40:45 +01:00
olly
a1d376fae1 Fix incorrect assertion in CacheDataSource
#minor-release
#exofixit

PiperOrigin-RevId: 395233639
2021-09-16 14:37:21 +01:00
claincly
624d212df2 Handle when additional spaces are in SDP's RTPMAP atrribute
Issue: #9379
PiperOrigin-RevId: 395226701
2021-09-16 14:36:40 +01:00
olly
28d5b35723 Use defStyleAttr when obtaining styled attributes in player views
Issue #9024

PiperOrigin-RevId: 395224661
2021-09-16 14:33:32 +01:00
olly
ced4232fd8 Duration readers: Return TIME_UNSET rather than a negative value
This typically happens if there's a discontinuity in the stream.
It's better to say we don't know, than it is to return a negative
position.

Issue: #8346
#exofixit
#minor-release
PiperOrigin-RevId: 395224088
2021-09-16 14:30:42 +01:00
olly
140e110e44 Workaround ConnectivityManager SecurityException on Android 11
Issue: #9002
PiperOrigin-RevId: 395221648
2021-09-16 14:29:54 +01:00
kimvde
aa88e0b430 Avoid OMX.qti.audio.decoder.flac on API level < 32
Before, this decoder was avoided on API levels < 30.

#minor-release
Issue:#9349
PiperOrigin-RevId: 395209684
2021-09-16 14:01:28 +01:00
gyumin
b40a6b86d6 Fix FlagSet.equals on API levels below 24
PiperOrigin-RevId: 395004645
2021-09-16 14:00:50 +01:00
olly
e7a7235a47 Remove max API level for reading TV resolution from system properties
PiperOrigin-RevId: 394415421
2021-09-16 13:59:07 +01:00
kimvde
4a7aaaa3b9 Fix DefaultTrackSelector Javadoc about tunneling
#minor-release
Issue:#9350
PiperOrigin-RevId: 394112689
2021-09-16 13:58:30 +01:00
bachinger
d930e07a0e Implement setPlaybackParameters for CastPlayer
Issue: #6784
PiperOrigin-RevId: 393374139
2021-09-16 13:57:44 +01:00
ibaker
8909f2017f Fix incorrect DataSourceContractTest test names
These should have been updated as part of
1affbf9357

#minor-release

PiperOrigin-RevId: 392913561
2021-09-16 13:56:22 +01:00
kimvde
152d1c7dc9 TsExtractor: handle packets without PTS
Issue: #9294
PiperOrigin-RevId: 392844983
2021-09-16 13:55:36 +01:00
andrewlewis
66d1e2cc9e Remove stray symlinks
These are unneeded for the external project

#minor-release

PiperOrigin-RevId: 392835942
2021-09-16 13:54:09 +01:00
bachinger
6f01e2f035 Make constructor of PlayerNotificationManager protected
Issue: #9303
#minor-release
PiperOrigin-RevId: 392022613
2021-09-16 13:53:40 +01:00
olly
54418eb644 Size dolby vision buffers for H265 by default
PiperOrigin-RevId: 391965200
2021-09-16 13:53:00 +01:00
olly
287e72c477 Add note that isLastBuffer is best-effort only
PiperOrigin-RevId: 391952144
2021-09-16 13:50:40 +01:00
kimvde
4fd7d777b6 Fix issue caused by using ForwardingPlayer and StyledPlayerControlView
StyledPlayerControlView was checking whether the player is an ExoPlayer
instance to set the track selector. This means that, if apps were
wrapping an ExoPlayer in a ForwardingPlayer (to replace a
ControlDispatcher for example), the track selector wasn't set anymore.

PiperOrigin-RevId: 391776305
2021-09-16 13:50:04 +01:00
christosts
64002f6b9a Annotate deprecated methods in ForwardingPlayer
This change is needed to generate correct javadoc, otherwise
these methods appear as not deprecated.

#minor-release

PiperOrigin-RevId: 390339092
2021-09-16 13:48:15 +01:00
christosts
8f3dbdf81c Minor javadoc fix in BaseUrlExclusionList
PiperOrigin-RevId: 390136807
2021-09-16 13:47:51 +01:00
christosts
78fc27a1c6 Fix HLS endless retrying on load errors
This was originally reported on #9390. There was a bug that when HLS
loads failed, the player would endlessly retry and never fail with a
player error.

This change fixes a bug in HlsSampleStreamWrapper.onPlaylistError()
which would return true for a playlist whose load encountered an error
but could not be excluded, whereas the method should return false.

Issue: #9390

#minor-release

PiperOrigin-RevId: 397045802
2021-09-16 12:14:33 +01:00
olly
f5498ec4bf Rename ExoDatabaseProvider to StandaloneDatabaseProvider
PiperOrigin-RevId: 396959703
2021-09-16 12:12:49 +01:00
bachinger
86dc31f291 Reset only renderers that have been enabled
#exofixit

PiperOrigin-RevId: 396938258
2021-09-16 12:11:02 +01:00
olly
5a2fd983a9 Move database package to common module
PiperOrigin-RevId: 396936785
2021-09-16 12:09:16 +01:00