4278 Commits

Author SHA1 Message Date
jaewan
149958fb07 Change return type of getMaxSeekToPreviousPosition() to long
This matches the type of all position related APIs.

PiperOrigin-RevId: 390558523
2021-08-13 11:43:52 +01:00
olly
24b0cf8c30 Fix references to AudioAttributes in Javadoc
PiperOrigin-RevId: 390365923
2021-08-12 16:39:52 +01:00
olly
2a6136f370 Remove Player.Listener inheritance of AudioListener
PiperOrigin-RevId: 390332263
2021-08-12 16:34:42 +01:00
claincly
4ef0355884 Prototype video transcoding
The prototype is built upon Transformer and took many references from
TransformerAudioRenderer.

Please take a look and we can discuss more details.

PiperOrigin-RevId: 390192487
2021-08-12 16:30:21 +01:00
olly
f7a511af2d Remove Player.Listener inheritance of MetadataOutput
PiperOrigin-RevId: 390137267
2021-08-11 17:37:24 +01:00
kimvde
01613a2e55 Remove usages of deprecated SimpleExoPlayer.Builder
PiperOrigin-RevId: 390130681
2021-08-11 17:34:19 +01:00
olly
7dffb2dc4d Migrate to Player.Listener
PiperOrigin-RevId: 390124675
2021-08-11 17:32:55 +01:00
kimvde
10b4e10f43 Move SimpleExoPlayer.Builder to ExoPlayer
- Remove ExoPlayer.Builder
- Copy SimpleExoPlayer.Builder to ExoPlayer
- Deprecate SimpleExoPlayer.Builder

PiperOrigin-RevId: 389890299
2021-08-11 12:07:16 +01:00
olly
f5d8c211f5 Remove some deprecated source/sink classes
PiperOrigin-RevId: 389879570
2021-08-11 12:06:02 +01:00
olly
31a839c848 Move non-player specific classes to common
These will all be needed in common to break dependencies
between decoder extension modules and the core module.

PiperOrigin-RevId: 389871983
2021-08-10 15:01:42 +01:00
olly
b627d70054 Migrate uses of deprecated DataSource factories
PiperOrigin-RevId: 389844289
2021-08-10 14:56:20 +01:00
olly
700ec93994 Move DeviceInfo into root package
PiperOrigin-RevId: 389681733
2021-08-09 20:11:23 +01:00
olly
7e8ba03147 Deprecate final non-nested Factory classes in upstream
PiperOrigin-RevId: 389661768
2021-08-09 20:07:24 +01:00
olly
e2ffb5e11b Remove DeviceListener
PiperOrigin-RevId: 389640670
2021-08-09 20:06:05 +01:00
olly
5dc8eeb4bf Remove IntArrayQueue from public API
PiperOrigin-RevId: 389622428
2021-08-09 20:03:22 +01:00
ibaker
db1fe8041b Remove @DoNotInstrument from test classes
This isn't needed now we've updated to Robolectric 4.6

Follow-up to 0df0df9aee

PiperOrigin-RevId: 389616471
2021-08-09 20:02:05 +01:00
ibaker
849c307402 Move requiresSecureDecoder logic into ExoMediaDrm
The result is plumbed back to `MediaCodecRenderer` via a new
`DrmSession#requiresSecureDecoder` method.

This allows us to use the `MediaDrm#requiresSecureDecoder` method added
in Android 12:
https://developer.android.com/reference/android/media/MediaDrm#requiresSecureDecoder(java.lang.String)

This change also removes
`FrameworkMediaCrypto#forceAllowInsecureDecoderComponents`, replacing it
with equivalent logic in `FrameworkMediaDrm#requiresSecureDecoder`.

PiperOrigin-RevId: 389616038
2021-08-09 20:00:42 +01:00
olly
0097a79c2d Add ability to disable Surface.setFrameRate calls
Adding a CHANGE_FRAME_RATE_STRATEGY_ALWAYS strategy is
omitted from this commit, since adding it is more complicated
than just plumbing it through and leaving everything else
unchanged. Specifically, VideoFrameReleaseTimeHelper would
need updating to behave differently when such a strategy is
enabled. It currently calls setFrameRate in cases such as
pausing, seeking and re-buffering, on the assumption that
changes to the underlying display refresh rate will only be
made if they can be done seamlessly. For a mode in which
this will not be the case, it makes more sense to stick to
the content frame-rate when these events occur. It may also
make sense to only use explicit content frame-rate values,
and not those inferred from individual frame timestamps.
Finally, for adaptive content containing a mix of frame-rates,
it makes sense to use the maximal frame-rate across all
variants, and to avoid calling setFrameRate on switches from
one variant to another.

Applications that know the frame-rate of their content can
set ExoPlayer's strategy to CHANGE_FRAME_RATE_STRATEGY_OFF and
then use setFrameRate directly on the output surface. Note that
this is likely to be a better option for apps than anything we
could implement in ExoPlayer, because the application layer
most likely knows the frame-rate of the content earlier than
ExoPlayer does (e.g., to perform the disruptive mode switch
at the same time as an activity transition).

Adding CHANGE_FRAME_RATE_STRATEGY_ALWAYS will be deferred
until there's clear demand for it. In the meantime, we'll
recommend the alternative approach above.

PiperOrigin-RevId: 389610965
2021-08-09 19:59:16 +01:00
olly
225081721d Statically import TRACK_TYPE constants in SimpleExoPlayer
PiperOrigin-RevId: 389170562
2021-08-06 16:01:22 +01:00
apodob
a5e772f91f Move SubtitleDecoder to common
This CL moves SubtitleDecoder and all its dependencies
to common in order to enable using it in extractor
module while implementing SubtitleExtractor.

PiperOrigin-RevId: 388979021
2021-08-06 16:00:03 +01:00
olly
9dcfd90ef7 Cleanup some deprecated constants
PiperOrigin-RevId: 388893920
2021-08-05 12:33:28 +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
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
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