742 Commits

Author SHA1 Message Date
ibaker
ad99a44083 Add empty sdk-version node to all AndroidManifest.xml files
PiperOrigin-RevId: 397772916
2021-09-21 14:17:33 +01:00
samrobinson
e5e8d9dc17 Make StubExoPlayer take a context in constructor.
This is a pre-requisite step for merging SimpleExoPlayer into
ExoPlayer, because when StubExoPlayer extends ExoPlayer, it needs
a matching constructor.

PiperOrigin-RevId: 397065374
2021-09-16 16:52:52 +01:00
bachinger
86dc31f291 Reset only renderers that have been enabled
#exofixit

PiperOrigin-RevId: 396938258
2021-09-16 12:11:02 +01:00
bachinger
76d60b911e Migrate media item transition tests to TestExoPlayer
PiperOrigin-RevId: 396313679
2021-09-14 11:58:30 +01:00
andrewlewis
71a4b6337c Fix javadoc consistency
#exofixit

PiperOrigin-RevId: 396304941
2021-09-14 11:56:45 +01:00
andrewlewis
0c4bb23dd3 Rename audioVolume parameter to volume
The new name is consistent with the corresponding parameters to `onVolumeChanged`, `setDeviceVolume` and `onDeviceVolumeChanged`.

PiperOrigin-RevId: 395705288
2021-09-09 18:17:40 +01:00
samrobinson
11d2d7daf9 Add open @IntDef for Renderer message types.
#exofixit

PiperOrigin-RevId: 395233622
2021-09-07 17:52:40 +01:00
samrobinson
5183eaaf1e Add open @IntDef for track selection reasons.
#exofixit

PiperOrigin-RevId: 395217458
2021-09-07 17:42:30 +01:00
andrewlewis
d05c15dee0 Add open @IntDef for track types
Also add handling of `C.TRACK_TYPE_IMAGE` in a couple of places where it was
missing.

#exofixit

PiperOrigin-RevId: 395078312
2021-09-06 15:04:47 +01:00
samrobinson
0d4986f806 Remove deprecated static metadata methods.
PiperOrigin-RevId: 394196332
2021-09-02 09:44:04 +01:00
claincly
58e5ed0afb Fix transcoding drops a few frames.
In the old version, the transcoder uses decoder.isEnded() alone as the criteria
to stop the encoding/muxing process. It's rectified to:

- On decoder ending, signal the encoder of EOS after writing all decoded frames to it.
- On encoder ending, write end track to muxer.

PiperOrigin-RevId: 393322114
2021-08-27 16:43:21 +01:00
ibaker
9c2b4b860b Enforce valid key responses in FakeExoMediaDrm
Make this behaviour optional, so it can be disabled for
AnalyticsCollectorTest where we don't use
FakeExoMediaDrm.LicenseServer.

PiperOrigin-RevId: 393133721
2021-08-27 16:39:47 +01:00
ibaker
84cf63a72f Test DefaultDrmSession provisioning is requested by provideKeyResponse
Follow-up to
<unknown commit>

PiperOrigin-RevId: 393132950
2021-08-27 16:37:59 +01:00
kimvde
f574ec952a Make TransformerTranscodingVideoRenderer support API < 23
PiperOrigin-RevId: 393100075
2021-08-27 16:36:09 +01:00
ibaker
c90d4fd371 Rollback of 557a1833f7
*** Original commit ***

Avoid adding spy to list in DataSourceContractTests

After the fix in https://github.com/mockito/mockito/issues/2331, the calls to
equals on the fake transfer listener (due to its use in a list of listeners)
are treated as interactions with it, meaning that the current verification of
'no more interactions' will fail.

This change makes the transfer listener used for testing count bytes then
delegate to another (mock) transfer listener that's passed in to avoid the
problem.

***

PiperOrigin-RevId: 393093785
2021-08-27 16:34:19 +01:00
bachinger
1d36083e25 Replace fully qualified link annotation
PiperOrigin-RevId: 393081803
2021-08-26 11:09:06 +01:00
ibaker
3710446b9d Test DefaultDrmSession with NotProvisionedException from getKeyRequest
PiperOrigin-RevId: 392927795
2021-08-26 11:05:31 +01:00
bachinger
a9913e5410 Add the media item to PositionInfo
PiperOrigin-RevId: 392914515
2021-08-26 11:03:40 +01:00
ibaker
e5a39eca1e Fix incorrect DataSourceContractTest test names
These should have been updated as part of
1affbf9357

#minor-release

PiperOrigin-RevId: 392913561
2021-08-26 11:01:59 +01:00
krocard
9fad5f4130 Add Track selection to the Player API
This cl doesn't implement completely the API for
`ExoPlayerImpl` as
`onTrackSelectionParametersChanged` is not called.

The follow up cl adds `TrackSelectionParameters` in PlaybackInfo
to correctly propagate the change event and mask it.

Additionally `TrackSelectionParameters` is serialized as a Parcelable
for now. It is transitioned to bundleable in a follow up cl.

PiperOrigin-RevId: 392899918
2021-08-26 10:58:27 +01:00
samrobinson
628e744e26 Deprecate ExoPlayer VideoComponent.
PiperOrigin-RevId: 392668736
2021-08-25 10:56:33 +01:00
samrobinson
d3cc98d368 Deprecate ExoPlayer AudioComponent.
PiperOrigin-RevId: 392655598
2021-08-25 10:54:34 +01:00
andrewlewis
557a1833f7 Avoid adding spy to list in DataSourceContractTests
After the fix in https://github.com/mockito/mockito/issues/2331, the calls to
equals on the fake transfer listener (due to its use in a list of listeners)
are treated as interactions with it, meaning that the current verification of
'no more interactions' will fail.

This change makes the transfer listener used for testing count bytes then
delegate to another (mock) transfer listener that's passed in to avoid the
problem.

PiperOrigin-RevId: 391949619
2021-08-20 11:52:32 +01:00
olly
85142be9a4 DRM refactor / cleanup
PiperOrigin-RevId: 391403236
2021-08-19 10:42:56 +01:00
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
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
700ec93994 Move DeviceInfo into root package
PiperOrigin-RevId: 389681733
2021-08-09 20:11:23 +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
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
bachinger
2ee6d6d95d Make getFallbackSelection nullable to indicate disabling of exclusion
PiperOrigin-RevId: 386442542
2021-07-27 12:14:04 +01:00
kimvde
b69c06a533 Add methods to set/get the seek back/forward increments in test player
PiperOrigin-RevId: 386177945
2021-07-22 12:03:51 +01:00
samrobinson
d47d1ebf19 Deprecate static metadata getter and listener method.
PiperOrigin-RevId: 385781004
2021-07-21 14:44:00 +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
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
e828dfbd7c Add getMaxSeekToPreviousPosition to Player
PiperOrigin-RevId: 383656919
2021-07-09 09:21:27 +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
aquilescanta
a302e34992 Remove ExoPlaybackException factory method that doesn't take errorCode
PiperOrigin-RevId: 383379334
2021-07-09 09:10:19 +01:00
bachinger
6dbc1eb189 Make customization of fallback selection more flexible
PiperOrigin-RevId: 383245932
2021-07-09 09:04:43 +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
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
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
bachinger
1cb4fb290f Change signature of ChunkSource.onChunkLoadError
A no-op change that changes the signature of the onChunkLoadError method of the ChunkSource. Implementors can get the exclusion duration directly from the LoadErrorHndlingPolicy instead of receiving it as an argument of the callback.

PiperOrigin-RevId: 381102935
2021-06-30 13:26:32 +01:00
ibaker
663082161a Re-word the DataSourceContractTest javadoc
This softens the language around suppressing individual test methods.
There are some legitimate cases where this is needed, e.g.
ByteArrayDataSourceContractTest has to suppress all the tests related
to non-existent resources because it's not possible to simulate that
case.

#minor-release

PiperOrigin-RevId: 380570017
2021-06-21 22:27:02 +01:00
olly
602c543861 Fix 2 ErrorProneStyle findings:
* 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) (2 times)

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: 380544425
2021-06-21 22:24:15 +01:00
ibaker
607fa8bf74 Allow repeated DRM provisioning in DefaultDrmSessionManager
Also change to explicitly track the provisioning session, which makes
the code easier to reason about than always using the zero'th element
of the list.

PiperOrigin-RevId: 380181453
2021-06-21 22:18:57 +01:00
aquilescanta
fc1d3dd192 Make onPlayerError take a PlaybackException
PiperOrigin-RevId: 380174672
2021-06-21 22:15:01 +01:00
ibaker
0f23fddeef Add a test for the provisioning flow to DefaultDrmSessionManagerTest
#minor-release

PiperOrigin-RevId: 379913814
2021-06-21 22:01:38 +01:00