4306 Commits

Author SHA1 Message Date
andrewlewis
5e4cd1293e Use AudioTrack.isDirectPlaybackSupported on TVs only
Issue: #9239

#minor-release

PiperOrigin-RevId: 388437614
2021-08-03 15:37:55 +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
olly
f329adbc23 Opt ExoPlayer out of transcoding when reading content URIs
PiperOrigin-RevId: 388260014
2021-08-02 19:22:23 +01:00
olly
ce7c04fac1 Move setFrameRate calls into wrapper class
PiperOrigin-RevId: 388187294
2021-08-02 19:17:53 +01:00
aquilescanta
bbff5f0cc1 Assign missing error codes in UdpDataSource
PiperOrigin-RevId: 387794965
2021-08-02 11:00:34 +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
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
aquilescanta
0df62a4f20 Add ERROR_CODE_FAILED_RUNTIME_CHECK for failed checks
PiperOrigin-RevId: 387143625
2021-07-27 18:56:25 +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
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
f9162c07c2 Merge pull request #9207 from dlafayet:ruby-position
PiperOrigin-RevId: 386836747
2021-07-27 12:19:29 +01:00
aquilescanta
33fa987b32 Assign ERROR_CODE_IO_UNSPECIFIED to unclassified IOExceptions
The reason this was not an IO error code is that before other
IOExceptions were classified, this catch would grab non-IO error
codes, like ParserException. Now that we are getting closer to
the final state, we can assume IOExceptions are ok to classify
as IO error codes (unlike, for example, ParserExceptions or
DrmSessionExceptions).

PiperOrigin-RevId: 386496752
2021-07-27 12:17:00 +01:00
olly
3488c047e8 Refine LoadErrorHandlingPolicy Javadoc
PiperOrigin-RevId: 386453305
2021-07-27 12:15:24 +01:00
bachinger
2ee6d6d95d Make getFallbackSelection nullable to indicate disabling of exclusion
PiperOrigin-RevId: 386442542
2021-07-27 12:14:04 +01:00
aquilescanta
d6c721ffc5 Move DRM exception classification method to public API
PiperOrigin-RevId: 386232697
2021-07-23 14:09:29 +01:00
olly
ab416f41ac Release ownedSurface before stopping the player on timeout
PiperOrigin-RevId: 386206960
2021-07-22 13:48:06 +01:00
claincly
6f504264e0 Merge the handling of FileDataSourceException and DataSourceException.
FileDataSourceException subclasses DataSourceException and can be handled
in the same fashion.

PiperOrigin-RevId: 385983103
2021-07-21 14:47:59 +01:00
claincly
e4c9078a0c Infer error code in network-based DataSourceException.
In some DataSources, it is not easy to assign an error code at the throw site.
For example, CronetDataSource.readInternal() throws SocketTimeoutException
on L1033, and is caught at L754 as IOException and is thrown.

We need the logic to assign error code for the actual type of the error cause.
While we can certainly do in individual DataSources, IMO there's value in
making this logic generic at a higher level (like what is in this CL).

The catch and translation logic is borrowed from EPII:L646.

PiperOrigin-RevId: 385789629
2021-07-21 14:46:40 +01:00
aquilescanta
14e582b7e5 Remove ExoPlayer uses of ERROR_CODE_DRM_UNSPECIFIED
PiperOrigin-RevId: 385783671
2021-07-21 14:45:17 +01:00
samrobinson
d47d1ebf19 Deprecate static metadata getter and listener method.
PiperOrigin-RevId: 385781004
2021-07-21 14:44:00 +01:00
Denise LaFayette
27576cfc73 Fix bug where rubyPosition in text node is not applied
Also fix bug where rubyPosition in ruby container style is not applied
2021-07-20 12:14:59 -04:00
bachinger
3f5dbf2ef3 Add flag to SinglePeriodTimeline to suppress projection
Issue: #9037
#minor-release
PiperOrigin-RevId: 385630065
2021-07-20 08:58:01 +01:00
ibaker
22ab14844b Avoid DefaultDrmSessionManager releasing too many session references
Before this fix, if DefaultDrmSessionManager.release() was called while
there was at least one 'external' session reference still active (i.e.
session.referenceCount > 1) then the manager will release it's reference
immediately but when the session's reference count subsequently drops to
1 (due to external references being released) the manager will schedule
a task to release its internal reference *again*.

This change fixes the problem by only scheduling the timed release if
the manager is unreleased. This ensures that the internal references
are only released once.

Issue: #9193

#minor-release

PiperOrigin-RevId: 385580741
2021-07-20 08:54:04 +01:00
olly
7edcc89421 Fix 1 ErrorProneStyle finding:
* Constructors and methods with the same name should appear sequentially with no other code in between, even when modifiers such as static or private differ between the methods. Please re-order or re-name methods.
  (see http://go/bugpattern/UngroupedOverloads)

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: 384877648
2021-07-15 13:22:18 +01:00
claincly
6512463280 Make network-based DataSource implementations use ErrorCode.
PiperOrigin-RevId: 384666131
2021-07-14 12:19:49 +01:00
kimvde
ae31ebb143 Rename previous/next to seekToPrevious/NextWindow in Player
Also rename hasPrevious/Next to hasPrevious/NextWindow for consistency.

This makes it clearer what the difference between
seekToPrevious/NextWindow and seekToPrevious/Next is.

PiperOrigin-RevId: 384643373
2021-07-14 12:17:15 +01:00
olly
3670541465 Add option to disable 5G-NSA disambiguation
PiperOrigin-RevId: 384575860
2021-07-14 12:15:48 +01:00
kimvde
58541fa1d1 Add SEEK_TO_NEXT command
PiperOrigin-RevId: 384477188
2021-07-14 12:11:46 +01:00
claincly
002874e9e9 Use DataSourceException in FileDataSource.
PiperOrigin-RevId: 384451470
2021-07-14 12:10:20 +01:00
aquilescanta
72b416c617 Remove ExoPlaybackException factory method that doesn't take errorCode
PiperOrigin-RevId: 384442821
2021-07-14 12:08:53 +01:00
aquilescanta
cdaf3e4e99 Move DRM error code assignment into DefaultDrmSession
PiperOrigin-RevId: 384280087
2021-07-13 10:10:24 +01:00
kimvde
8451be1b0b Add SEEK_TO_PREVIOUS command
PiperOrigin-RevId: 384257929
2021-07-13 10:09:06 +01:00
claincly
ca28d6a041 Move TYPE definition out from DataSourceException.
The types (open/close/read) does not provide extra information about the thrown
playback exception, and they are not utilized at higher levels.

PiperOrigin-RevId: 384219870
2021-07-13 10:03:01 +01:00
kimvde
d84e19a302 Rename COMMAND_GET_MEDIA_ITEMS to COMMAND_GET_TIMELINE
This is more descriptive.

PiperOrigin-RevId: 383887927
2021-07-13 10:01:46 +01:00
kimvde
7031c4398d Re-order next and previous commands
This is consistent with seek back and forward commands.

PiperOrigin-RevId: 383867710
2021-07-13 10:00:31 +01:00
kimvde
bc0f3935d6 Re-order seekBack and seekForward in Player
This is more consistent with other Player methods like previous and
next.

PiperOrigin-RevId: 383832298
2021-07-13 09:59:14 +01:00
kimvde
699579fd4e Add seekToNext method to Player
PiperOrigin-RevId: 383816880
2021-07-13 09:57:58 +01:00
kimvde
7e6d82237a Rename MEDIA_ITEM to WINDOW is seek commands
This is more correct and is consistent with the Javadoc.

PiperOrigin-RevId: 383808096
2021-07-13 09:56:42 +01:00
krocard
298af78b4e Move most of DefaultTrackSelector params to TrackSelectionParameters
The parameters staying in DefaultTrackSelector are considered
too ExoPlayer specific to be part of the `Player` interface.
Those are:
 - exceedVideoConstraintsIfNecessary;
 - allowVideoMixedMimeTypeAdaptiveness;
 - allowVideoNonSeamlessAdaptiveness;
 - exceedAudioConstraintsIfNecessary;
 - allowAudioMixedMimeTypeAdaptiveness;
 - allowAudioMixedSampleRateAdaptiveness;
 - allowAudioMixedChannelCountAdaptiveness;
 - disabledTextTrackSelectionFlags;
 - exceedRendererCapabilitiesIfNecessary;
 - tunnelingEnabled;
 - allowMultipleAdaptiveSelections;
 - rendererDisabledFlags

Track selection override will be migrated in a follow up cl.

To avoid breaking backward compatibility,
`DefaultTrackSelector.Parameters` extends
`TrackSelectionParameters` and
`DefaultTrackSelector.ParametersBuilder` extends `TrackSelectionParameters.Builder`.
The change are thus transparent for clients.

Test are incomplete for now, as this is a relatively big cl, I though
the reviewer could give a first pass will the tests are completed.

PiperOrigin-RevId: 383767021
2021-07-09 09:25:15 +01:00
ibaker
20d67eb34a Rename Player.EventFlags -> Player.Event
IntDef names (like enums) are normally singular, and this isn't a 'flag'
IntDef.

PiperOrigin-RevId: 383659574
2021-07-09 09:22:54 +01:00
kimvde
e828dfbd7c Add getMaxSeekToPreviousPosition to Player
PiperOrigin-RevId: 383656919
2021-07-09 09:21:27 +01:00
kimvde
c4e99902c3 Add seekToPrevious method to Player
PiperOrigin-RevId: 383623440
2021-07-09 09:20:04 +01:00
aquilescanta
54b4f6635d Add an errorCode field to DrmSessionException
In order to avoid doing the classification in ExoPlayerImplInternal. Note:
This only makes the constructor change. The error code assignment will
happen in an immediately following CL.

PiperOrigin-RevId: 383397729
2021-07-09 09:15:17 +01:00
kimvde
1608f6f9da Remove the seekBack/Forward increment setters
This simplifies the API surface and the MediaController implementation.

PiperOrigin-RevId: 383385436
2021-07-09 09:12:49 +01:00