11855 Commits

Author SHA1 Message Date
olly
bdff0d9374 Upgrade to gradle 7.0.2
PiperOrigin-RevId: 388929850
2021-08-06 15:57:25 +01:00
kimvde
9e798a647e Miscalleneous small fixes in Transformer
PiperOrigin-RevId: 388911857
2021-08-06 15:56:01 +01:00
andrewlewis
fc1db189f2 Remove deprecated ExoPlayer GVR extension
PiperOrigin-RevId: 388907645
2021-08-06 15:54:34 +01:00
olly
8525ef70ba Remove SDK_INT codename checks for R and S
These API levels have both been finalized. We're also calling methods
from these API levels directly, which may not exist if a device is
running a non-finalized R or S release.

PiperOrigin-RevId: 388903410
2021-08-06 15:53:08 +01:00
olly
9dcfd90ef7 Cleanup some deprecated constants
PiperOrigin-RevId: 388893920
2021-08-05 12:33:28 +01:00
andrewlewis
d0e426080b Set StreamIndex Name as format.label in SS
Issue: #9252

#minor-release

PiperOrigin-RevId: 388889406
2021-08-05 12:32:15 +01:00
claincly
a5cbd9f6c2 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:31:06 +01:00
gyumin
2946cbe190 Update androidx.media version to 1.4.1
PiperOrigin-RevId: 388860854
2021-08-05 12:29:46 +01:00
sungsoo
a533d8190a Add a method to distinguish whether a player can be set by MediaSession
PiperOrigin-RevId: 388835913
2021-08-05 12:28:34 +01:00
aquilescanta
7375fe3105 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 18:47:32 +01:00
Christos Tsilopoulos
81d0fe2d0f Merge pull request #9247 from colinbarr:dev-v2-rtsp-fmtp-trailing-semicolon
PiperOrigin-RevId: 388713101
2021-08-04 18:42:00 +01:00
olly
a34809bb9d 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 18:40:45 +01:00
christosts
4b1609d569 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 18:38:37 +01:00
christosts
07c49cdad8 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 18:37:16 +01:00
ibaker
6157c615b2 Standardise API-level specific nested classes
This change aligns all the names for classes that are 'holders of static
methods' to be `ApiNN`. Classes that hold state are named meaningfully
based on that state.

PiperOrigin-RevId: 388641064
2021-08-04 18:35:50 +01:00
andrewlewis
5e4cd1293e Use AudioTrack.isDirectPlaybackSupported on TVs only
Issue: #9239

#minor-release

PiperOrigin-RevId: 388437614
2021-08-03 15:37:55 +01:00
olly
cc8f4dcc6b Downgrade targetSdkVersion to 30
PiperOrigin-RevId: 388437245
2021-08-03 15:36:41 +01:00
apodob
8cddd4d80d 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-03 15:35:21 +01:00
olly
bffa3e0afb ContentDataSource: Restore ability to open file URIs
PiperOrigin-RevId: 388410558
2021-08-03 15:33:56 +01:00
Colin Barr
0921efab3e
Switch to an explicit limit of 0 for splitting on RTSP fmtp parameters 2021-08-03 10:33:49 +01:00
Colin Barr
6f67cb839c
Handle trailing semicolon on RTSP fmtp attribute 2021-08-02 21:15:33 +01:00
olly
f329adbc23 Opt ExoPlayer out of transcoding when reading content URIs
PiperOrigin-RevId: 388260014
2021-08-02 19:22:23 +01:00
olly
4013612194 HLS: Avoid stuck-buffering issues
Issue: #8850
Issue: #9153
#minor-release
PiperOrigin-RevId: 388257563
2021-08-02 19:20:57 +01:00
olly
f726212180 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-02 19:19:28 +01:00
olly
ce7c04fac1 Move setFrameRate calls into wrapper class
PiperOrigin-RevId: 388187294
2021-08-02 19:17:53 +01:00
olly
181838168c 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-02 19:16:15 +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
aquilescanta
5bc1c4837f Assign CronetDataSource error codes
PiperOrigin-RevId: 387301144
2021-07-29 21:08:02 +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
aquilescanta
0df62a4f20 Add ERROR_CODE_FAILED_RUNTIME_CHECK for failed checks
PiperOrigin-RevId: 387143625
2021-07-27 18:56:25 +01:00
bachinger
f9d94204ad Do not use index access with CopyOnWriteArrayList
PiperOrigin-RevId: 387143449
2021-07-27 18:54:54 +01:00
bachinger
7941b8726f Merge pull request #9219 from DolbyLaboratories:dev-v2-eac3-codec-comment
PiperOrigin-RevId: 387090075
2021-07-27 18:53:18 +01:00
aquilescanta
d4975415f9 Remove calls to initCause
In favor of setting the cause in the constructor, which allows
some code simplifications.

PiperOrigin-RevId: 387062636
2021-07-27 12:30:19 +01:00
olly
f53f44c9c3 Move NetworkTypeObserver 5G-NSA config to separate Config class
PiperOrigin-RevId: 386970718
2021-07-27 12:28:50 +01:00
olly
9e615ce5f3 Update dev guide to use non-deprecated factory
#minor-release

PiperOrigin-RevId: 386966219
2021-07-27 12:27:23 +01:00
claincly
cdf26a01cf Remove error code inference in DataSourceException.
The inference is used when nesting DataSourceExceptions. It is removed because
nesting does not add additional value in surfacing the exceptions, and it is
better to assign an error code at the throw site (in the "leaf" or the bottom
most data source).

PiperOrigin-RevId: 386919118
2021-07-27 12:26:07 +01:00
andrewlewis
873e83c575 Fix @see javadoc syntax
Doclava outputs an error when handling the javadoc where the `@see` clause is an anchor but also has other content.

PiperOrigin-RevId: 386875722
2021-07-27 12:24:44 +01:00
bachinger
3f9093cc02 Add BaseUrlExlusionList and use it to select base URLs
Issues: #771 and #7654
PiperOrigin-RevId: 386850707
2021-07-27 12:23:34 +01:00
olly
c6e860b8bb Fix 1 ErrorProneStyle finding:
* @Flags is not a TYPE_USE annotation, so should appear before any modifiers and after Javadocs.
  (see go/java-style#s4.8.5-annotations)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Suggest a fix on the CL (go/how-to-suggest-fix).
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if the change looks generally problematic.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/media/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

PiperOrigin-RevId: 386849198
2021-07-27 12:22:08 +01:00
olly
4c97b76208 Add exoplayer.dev page for network stack integration
PiperOrigin-RevId: 386841818
2021-07-27 12:20:43 +01:00
bachinger
f9162c07c2 Merge pull request #9207 from dlafayet:ruby-position
PiperOrigin-RevId: 386836747
2021-07-27 12:19:29 +01:00