1461 Commits

Author SHA1 Message Date
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
andrewlewis
fc1db189f2 Remove deprecated ExoPlayer GVR extension
PiperOrigin-RevId: 388907645
2021-08-06 15:54: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
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
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
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
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
kimvde
b33496aeae Deprecate ControlDispatcher in MediaSessionConnector
PiperOrigin-RevId: 386227630
2021-07-23 14:07:55 +01:00
kimvde
90113ce013 Deprecate ControlDispatcher in media2
PiperOrigin-RevId: 386185285
2021-07-22 12:05:09 +01:00
samrobinson
d47d1ebf19 Deprecate static metadata getter and listener method.
PiperOrigin-RevId: 385781004
2021-07-21 14:44:00 +01:00
kimvde
30e65acf63 Deprecate ControlDispatcher in Leanback library
PiperOrigin-RevId: 385503851
2021-07-20 08:44:47 +01:00
olly
fdc2cbd7e2 decoder_av1/build.gradle: disable BUILD_TESTING in cmake
this avoids an extra download of googletest by cpu_features after:
06fdc0a cmake: Use CTest default (Fix #169) (#170)

PiperOrigin-RevId: 385181519
2021-07-20 08:43:28 +01:00
kimvde
85f3af8864 Use Player commands to enable UI buttons
PiperOrigin-RevId: 384910388
2021-07-15 14:45:44 +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
kimvde
58541fa1d1 Add SEEK_TO_NEXT command
PiperOrigin-RevId: 384477188
2021-07-14 12:11:46 +01:00
aquilescanta
72b416c617 Remove ExoPlaybackException factory method that doesn't take errorCode
PiperOrigin-RevId: 384442821
2021-07-14 12:08:53 +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
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
kimvde
e828dfbd7c Add getMaxSeekToPreviousPosition to Player
PiperOrigin-RevId: 383656919
2021-07-09 09:21:27 +01:00
bachinger
c0051c502a Remove temporary workaround for missing ACTION_SET_PLAYBACK_SPEED
PiperOrigin-RevId: 383390096
2021-07-09 09:13:58 +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
kimvde
15c565c7d7 Rename fastForward/rewind to seekForward/Back in Player
This matches the Javadoc better.

PiperOrigin-RevId: 383228021
2021-07-09 09:02:17 +01:00
olly
a632acc1d0 Fix 1 ErrorProneStyle finding:
* @ImaAdState 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: 383121587
2021-07-09 09:01:04 +01:00
ibaker
0df0df9aee Remove @DoNotInstrument from test classes
This isn't needed now we've updated to Robolectric 4.6

PiperOrigin-RevId: 383109343
2021-07-09 08:58:38 +01:00
claincly
747b0f057b Make DataSourceException use PlaybackException error codes.
- Use `PlaybackException.ErrorCode` IntDef for `DataSourceException` error code
- Deprecate `DataSourceException.POSITION_OUT_OF_RANGE`
- All other changes are related to replacing the deprecated constant and
  constructor

PiperOrigin-RevId: 382683522
2021-07-09 08:43:22 +01:00
olly
7b0a7f1295 Remove stray space
PiperOrigin-RevId: 382297051
2021-07-09 08:24:44 +01:00
olly
a55c0654fb Improve Cronet and OkHttp READMEs
PiperOrigin-RevId: 382279955
2021-06-30 13:54:16 +01:00
olly
dea52048cb Bump dependency versions
PiperOrigin-RevId: 382277352
2021-06-30 13:53:01 +01:00
samrobinson
9013facdd7 Rename PlaylistMediaMetadata to PlaylistMetadata in Player.
This affects the setter, getter and callback, as well as various
media 3 methods.

PiperOrigin-RevId: 382275672
2021-06-30 13:51:51 +01:00
aquilescanta
155e27ec7c Move ExoPlaybackException back into core
PiperOrigin-RevId: 381941053
2021-06-30 13:47:30 +01:00
olly
7aaba1ffe5 Migrate usage of Player.EventListener to Player.Listener
PiperOrigin-RevId: 381837274
2021-06-30 13:43:51 +01:00
olly
ea99c3fa94 Add ability to set Cronet request priority
PiperOrigin-RevId: 381833403
2021-06-30 13:42:42 +01:00
Oliver Woodman
8588bdb02a Merge pull request #9119 from chvp:media2-dispatch-previous-next
PiperOrigin-RevId: 381833313
2021-06-30 13:41:35 +01:00
olly
bb82e7df9d Cronet: Align terminology with documentation
PiperOrigin-RevId: 381472436
2021-06-30 13:40:24 +01:00
olly
6fe2f25fe9 Update DataSource extension documentation
Also upgrade the RTMP extension to use an inner class
for its factory.

PiperOrigin-RevId: 381469114
2021-06-30 13:39:09 +01:00
olly
ec9f512fee OkHttp: Upgrade to 4.9.1 (minSdkVersion 21)
Until now, we have stuck with the 3.12 long-term branch so as
to keep support for older API levels. However, this means that
the version we're using is 2.5 years old at this point. The
3.12 branch will stop receiving critical updates in December
2021.

Since use of the OkHttp extension is optional anyway, it seems
preferable to move to a modern version of OkHttp at this point.

PiperOrigin-RevId: 381465269
2021-06-30 13:37:58 +01:00
olly
bcd4bb87e5 Deprecate CronetEngineWrapper
PiperOrigin-RevId: 381239971
2021-06-30 13:32:43 +01:00
olly
1e9b6d66a3 [CronetDataSource] Support keeping the POST method and body for 302
Currently when a HTTP POST request receives a 302, CronetDataSource will change the request method from POST to GET for the redirected request, and drop the post body. This aligns with the behaviours of many user agents, but our use case would like to keep the POST method and the post body.

org.chromium.net.UrlRequest.followRedirect also changes POST to GET for 302, so should be avoided here.

PiperOrigin-RevId: 381233011
2021-06-30 13:28:50 +01:00
aquilescanta
fc26d4eeb1 Remove the last deprecated ParserException constructor
PiperOrigin-RevId: 381221669
2021-06-30 13:27:45 +01:00
olly
75c06cc4e7 Cronet: Cleanup and simplify CronetEngineWrapper
A subsequent change will deprecate CronetEngineWrapper and move
all of the logic into a utility class for obtaining a suitable
CronetEngine.

This change also deprioritizes use of unknown cronet providers.

PiperOrigin-RevId: 381051164
2021-06-30 13:24:01 +01:00
olly
116e50f365 Cronet: Deprecate internal fallback
The way CronetDataSource.Factory can internally fall back to another
factory is confusing and unnecessary. In the case the application cannot
instantiate a CronetEngine, it should directly use another factory.

This makes CronetDataSource more consistent with OkHttpDataSource. In
both cases, their factory constructors take the component that the
respective libraries advise should only be created once by the application,
which are CronetEngine and OkHttpClient respectively.

CronetEngineWrapper will be deprecated in a subsequent change.

PiperOrigin-RevId: 381016504
2021-06-30 13:21:39 +01:00
aquilescanta
1a8592c5c0 Add Player.Listener.onPlayerErrorChanged
Equivalent to onPlayerError, except it's also called for null.

PiperOrigin-RevId: 381015336
2021-06-30 13:17:49 +01:00
Charlotte Van Petegem
efc6992e17
Remove useless assertions 2021-06-28 12:06:28 +02:00