7877 Commits

Author SHA1 Message Date
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
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
f34446123d Bump version to 2.15.0 and tidy release notes
PiperOrigin-RevId: 389871495
2021-08-10 15:41:20 +01:00
christosts
bf462aca69 Fix bug in Timeline.getRemovedAdGroupCount()
#minor-release

PiperOrigin-RevId: 389174519
2021-08-06 16:10:43 +01:00
andrewlewis
8fb1e5ce51 Set StreamIndex Name as format.label in SS
Issue: #9252

#minor-release

PiperOrigin-RevId: 388889406
2021-08-05 12:44:20 +01:00
claincly
6ca0b30755 Handle RTSP session id properly.
Issue: #9254

#minor-release

We used to allow only alphanumerical characters in session id. The spec also
allows "$", "-", "_", ".", "+" (RFC2326 Sections 3.4 and 15.1).

PiperOrigin-RevId: 388873742
2021-08-05 12:43:57 +01:00
aquilescanta
17723c0836 Simplify network-related error codes
This change removes ERROR_CODE_IO_NETWORK_UNAVAILABLE,
ERROR_CODE_IO_NETWORK_CONNECTION_CLOSED, and ERROR_CODE_IO_DNS_FAILED
in favor of keeping only ERROR_CODE_IO_NETWORK_CONNECTION_FAILED.

PiperOrigin-RevId: 388715972
2021-08-04 19:05:41 +01:00
Christos Tsilopoulos
f23ab8e2c1 Merge pull request #9247 from colinbarr:dev-v2-rtsp-fmtp-trailing-semicolon
PiperOrigin-RevId: 388713101
2021-08-04 19:04:04 +01:00
olly
ba3f86821f Tweak use of TimestampAdjuster for seeking
- Fix use of getTimestampOffsetUs in TsExtractor where
  getFirstSampleTimestampUs should have been used.
- Don't reset TimestampAdjuster if it's in no-offset mode.
- Improve comment clarity

#minor-release

PiperOrigin-RevId: 388682711
2021-08-04 19:03:06 +01:00
christosts
5689e093da Set HlsSampleStreamWrapper.trackType for audio-only playlists
For audio-only playlists, when formats are communicated to the app with
AnalyticsListener.onDownstreamFormatChanged(), the passed MediaLoadData
do not indicate this is an audio track and therefore the
PlaybackStatsListener cannot derive audio format-related information.

This change sets the main SampleStreamWrappers track type to AUDIO, if
the master playlist contains only audio variants.

Issue: #9175

#minor-release

PiperOrigin-RevId: 388676060
2021-08-04 19:02:50 +01:00
christosts
5b2b882e81 Change how AnalyticsCollector releases listeners
The AnalyticsCollector releases listeners lazily so that listener
callbacks triggered on the application looper after
SimpleExoPlayer.release() are still handled. The change in ListenerSet
to post the onEvents callback on the front of the application looper
changed (correctly) how onEvents are propagated, however this made
the AnalyticsCollector deliver onEvents with out-of-order EventTimes.

This change fixes AnalyticsCollector to trigger onPlayerReleased() and
the matching onEvents() event in the correct order.

#minor-release

PiperOrigin-RevId: 388668739
2021-08-04 19:02:29 +01:00
andrewlewis
5932406926 Use AudioTrack.isDirectPlaybackSupported on TVs only
Issue: #9239

PiperOrigin-RevId: 388437614
2021-08-04 19:01:19 +01:00
apodob
95dcd89651 Add font-size support to WebVTT CssParser.
This CL addresses the github issue [#8946](https://github.com/google/ExoPlayer/issues/8964). That issue requests support for `font-size` CSS property in WebVTT subtitle format. This CL:
* Adds support for `font-size` property by extending capabilities of WebVTT `CssParser`. Implementation of `font-size` property value parsing is based on the one in `TtmlDecoder`.
* Adds unit test along with test file containing WebVTT subtitles with all currently supported `font-size` units.

#minor-release

PiperOrigin-RevId: 388423859
2021-08-04 18:57:58 +01:00
olly
8732f2f030 HLS: Avoid stuck-buffering issues
Issue: #8850
Issue: #9153
#minor-release
PiperOrigin-RevId: 388257563
2021-08-04 18:57:08 +01:00
olly
e95c42ef98 Simplify TimestampAdjuster logic
- Use timestampOffsetUs == C.TIME_UNSET directly as the way of
  determining whether the adjuster has determined the offset,
  rather than relying on lastSampleTimestampUs checks for this.
- Remove comment referring to lastSampleTimestampUs as holding
  the "adjusted PTS". Its value may not have originated from a PTS
  timestamp. It's also confusing to refer to it as "adjusted"
  given timestampOffsetUs has not been applied to it.
- Fix PassthroughSectionPayloadReader to make sure it'll never
  output a sample with an unset timestamp.

#minor-release

PiperOrigin-RevId: 388226180
2021-08-04 18:56:39 +01:00
olly
ff71425dca Fix resetting TimestampAdjuster with DO_NOT_OFFSET
Prior to this change, an initalized TimestampAdjuster that's then
reset with DO_NOT_OFFSET would incorrectly continue to apply the
offset.

Also add a test case for this issue, and for some other simple use
cases.

#minor-release

PiperOrigin-RevId: 388182645
2021-08-04 18:55:25 +01:00
Christos Tsilopoulos
a9fdade9df Remove FfmpegVideoRenderer from 2.15.0 release 2021-08-02 16:35:43 +01:00
aquilescanta
bbff5f0cc1 Assign missing error codes in UdpDataSource
PiperOrigin-RevId: 387794965
2021-08-02 11:00:34 +01:00
claincly
0bf40f8978 Fix some ErrorCode assigning cases.
DefaultHttpDataSource and OkHttpDataSource can share the same error code
assigning logic.

Fixes CronetDataSource's handling of closed connection.

PiperOrigin-RevId: 387791679
2021-08-02 10:59:30 +01:00
claincly
df49f90b7f Simplify the error code handling.
PiperOrigin-RevId: 387786273
2021-08-02 10:58:11 +01:00
aquilescanta
f19a3674f3 Assign ERROR_CODE_IO_FILE_NOT_FOUND for AssetDataSource
PiperOrigin-RevId: 387777480
2021-08-02 10:56:51 +01:00
aquilescanta
1bad403eec Add fallback case for provisioning errors
PiperOrigin-RevId: 387772641
2021-08-02 10:55:36 +01:00
aquilescanta
c45d54726f Simplify FileDataSource exception management
And change one IO_UNSPECIFIED for a ERROR_CODE_FAILED_RUNTIME_CHECK.

PiperOrigin-RevId: 387772253
2021-08-02 10:54:20 +01:00
aquilescanta
e65bcefad1 Reorder DataSourceException constructors and accept nullable parameters
This CL doesn't introduce functional changes.

PiperOrigin-RevId: 387613057
2021-07-29 21:12:30 +01:00
andrewlewis
337d5aa9b6 Fix parameter names on overridden methods
The dokka javadoc generation tool complains when parameter names don't match between a method and its override. This change updates occurrences where there is currently a mismatch.

PiperOrigin-RevId: 387367509
2021-07-29 21:09:30 +01:00
andrewlewis
9c27cfcda7 Fix parameter names on overridden methods
The dokka javadoc generation tool complains when parameter names don't match between a method and its override. This change updates occurrences where there is currently a mismatch.

Notable renamings that might be controversial:
- `onPlaybackStateChanged(int state)` to `onPlaybackStateChanged(int playbackState)` affected a lot of lines but seems more consistent with other '-Changed' methods.
- `handleMessage(int messageType, Object payload)` to `handleMessage(int messageType, Object message)`
- `ExtractorInput` and `DataSource` inherit `DataReader` which had `read(byte[] target, ...`, while data sources normally called the first parameter `buffer`. I have standardized these all to use `buffer` even though it looks out of place in the `ExtractorInput` interface (which has more `read` methods with `target`).

PiperOrigin-RevId: 387290360
2021-07-28 09:15:29 +01:00
ibaker
41fe5aa1e3 Throw IllegalStateException from Util.gzip() instead of AssertionError
The documentation on ByteArrayOutputStream and GZIPOutputStream isn't
completely clear that an IOException will *never* happen, so
AssertionError seems a bit strong - but it seems very unlikely, so we
just use IllegalStateException instead.

#minor-release

PiperOrigin-RevId: 387169297
2021-07-28 09:14:09 +01:00
aquilescanta
1aa76b5fdc Rename error code IO_BAD_HTTP_REQUEST to IO_INVALID_HTTP_CONTENT_TYPE
In order to avoid confusion with HTTP 400 Bad request.

PiperOrigin-RevId: 387145057
2021-07-27 18:57:50 +01:00