587 Commits

Author SHA1 Message Date
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
krocard
0dd296c2c9 Move BundleableUtil in common
It is used to implement `Bundleable` for
`TrackSelection`.

PiperOrigin-RevId: 383408386
2021-07-09 09:17:57 +01:00
aquilescanta
8b1fcfc40f Drop support for subclass instance unbundling in PlaybackException
PiperOrigin-RevId: 383408075
2021-07-09 09:16:41 +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
73b5d0c37b Expand documentation of ERROR_CODE_DRM_CONTENT_ERROR
PiperOrigin-RevId: 383382813
2021-07-09 09:11:34 +01:00
aquilescanta
5b2e854344 Add missing call and rename getErrorCodeForMediaDrmErrorCode
PiperOrigin-RevId: 383251000
2021-07-09 09:06:00 +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
ee488e6625 Clarify the thread requirements of a SurfaceView or SurfaceHolder
Issue: #9005
PiperOrigin-RevId: 382765045
2021-07-09 08:54:07 +01:00
ibaker
5e4056eb4c Encode emsg duration & ID as int64 instead of uint32
The serialization scheme used here is custom, it doesn't need
to be compatible with emsg-v0 or emsg-v1 (since
97183ef558).

This means that C.TIME_UNSET will propagate correctly through the
serialization.

#minor-release

Issue: #9123
PiperOrigin-RevId: 382762873
2021-07-09 08:49:27 +01:00
ibaker
ee426822ee Mark BasePlayer constructor as protected
This is an abstract class so it can only be constructed from the context
of a subclass anyway.

PiperOrigin-RevId: 382756293
2021-07-09 08:46:58 +01:00
claincly
6035932fa3 Make HttpDataSourceException use PlaybackException error codes.
PiperOrigin-RevId: 382710409
2021-07-09 08:44:36 +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
claincly
ee0d905eed Add ERROR_CODE_TIMEOUT.
Also remove the method for creating a TYPE_RENDERER ExoPlaybackException
with unknown renderer name and index.

PiperOrigin-RevId: 382589655
2021-07-09 08:40:38 +01:00
claincly
dda1d37368 Make HttpDataSourceException subclass DataSourceException.
PiperOrigin-RevId: 382551642
2021-07-09 08:39:26 +01:00
aquilescanta
b0ddef5bcf Assign DRM error codes
PiperOrigin-RevId: 382527115
2021-07-09 08:38:13 +01:00
aquilescanta
c1995745e7 Move platform error mapping to common
In order to use it for error code assignment. Note that these DRM errors
could be thrown on API < 18 (from MediaCodec.CryptoException), which is
the reason we can't put the mapping in FrameworkMediaDrm.

PiperOrigin-RevId: 382512414
2021-07-09 08:36:53 +01:00
aquilescanta
124a6aea50 Remove unused method Log.getLogStackTraces
It was impossible to call because it was a non-static method in a class
with a private constructor.

PiperOrigin-RevId: 382504128
2021-07-09 08:34:38 +01:00
krocard
4de4f85739 Document threading guarantee of Player.addListener
These guarantees were documented for `EventListener` and
hold as well for Listener but were not documented.

PiperOrigin-RevId: 382498188
2021-07-09 08:33:26 +01:00
aquilescanta
a24bbbdd5e Reimplement getErrorCodeFromPlatformDiagnosticsInfo to save the pattern
PiperOrigin-RevId: 382494191
2021-07-09 08:31:10 +01:00
aquilescanta
d9d02710c0 Add tests for Util.getErrorCodeFromPlatformDiagnosticsInfo
PiperOrigin-RevId: 382311518
2021-07-09 08:27:17 +01:00
aquilescanta
2ca7432bf6 Move Util.getErrorCodeFromPlatformDiagnosticsInfo into common
Will be needed for error code assignment.

PiperOrigin-RevId: 382305328
2021-07-09 08:26:03 +01:00
Scott
dffcf258ee Updated mimetypes to support DTSX and to correct assign dtse to DTS Express 2021-07-08 11:11:26 +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
764f9f20d6 Add info about trick-playness to the Format log string
PiperOrigin-RevId: 382139109
2021-06-30 13:50:32 +01:00
aquilescanta
155e27ec7c Move ExoPlaybackException back into core
PiperOrigin-RevId: 381941053
2021-06-30 13:47:30 +01:00
claincly
ffbec2234d Assign PlaybackException.ErrorCode to renderer failures.
PiperOrigin-RevId: 381852092
2021-06-30 13:45:02 +01:00
aquilescanta
465f7c06d8 Add ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED
And assign it to CleartextNotPermittedException.

PiperOrigin-RevId: 381247430
2021-06-30 13:34:31 +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
samrobinson
2d44f82aa4 Correct naming of compilation field MediaMetadata.
PiperOrigin-RevId: 381016088
2021-06-30 13:20:18 +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
aquilescanta
81c542b6a7 Remove deprecated ParserException constructor
And replace it with factory method which includes more
context for error code assignment.

PiperOrigin-RevId: 380624625
2021-06-21 22:29:27 +01:00
samrobinson
775507088c Add a playlist title field to MediaMetadata.
Allows for compatibility with METADATA_KEY_COMPILATION.

PiperOrigin-RevId: 380179505
2021-06-21 22:17:25 +01:00
aquilescanta
fc1d3dd192 Make onPlayerError take a PlaybackException
PiperOrigin-RevId: 380174672
2021-06-21 22:15:01 +01:00
samrobinson
9c12d08531 Do not check the validity of dates in MediaMetadata.
PiperOrigin-RevId: 380009757
2021-06-21 22:08:51 +01:00
samrobinson
259f0f67a3 Add genre to MediaMetadata.
PiperOrigin-RevId: 380000589
2021-06-21 22:07:39 +01:00
samrobinson
d1aacc5f3b Add release date and recording date fields to MediaMetadata.
PiperOrigin-RevId: 379962022
2021-06-21 22:06:29 +01:00
kimvde
56e97783eb Simplify DefaultControlDispatcher by using Player methods
PiperOrigin-RevId: 379732136
2021-06-21 21:59:14 +01:00
olly
63f12f0216 Remove obsolete Checker Framework suppression strings
More information: go/checker-3130-lsc

Tested:
    TAP for global presubmit queue passed after automated deflaking of failures: http://mondo/deflaker/run/ff80a4f9-d5d7-47ac-9560-63372e1ff624 http://mondo/deflaker/run/ca3ce61f-2af8-4fa7-b6e4-c98b5c4d950c
    http://test/OCL:379405669:BASE:379421861:1623763190392:bd2d256a
PiperOrigin-RevId: 379623080
2021-06-21 21:57:56 +01:00
olly
a3dbd61239 Remove obsolete Checker Framework suppression strings
More information: go/checker-3130-lsc

Tested:
    Some test failures are present, but the CL author has decided to mail the change anyway
PiperOrigin-RevId: 379622938
2021-06-21 21:56:37 +01:00
ibaker
391ad7dbb9 Add DRM info to Format.toLogString
The Widevine H264 samples in the demo app now log this from the EventLogger:
```
[X] Track:0, id=1, mimeType=video/avc, bitrate=772315, codecs=avc1.42c01e, drm=[widevine,cenc], res=320x142, fps=24.0, supported=YES
```

And the VP9 ones log:
```
[X] Track:0, id=1, mimeType=video/x-vnd.on2.vp9, bitrate=588256, codecs=vp9, drm=[widevine], res=320x142, fps=23.809525, supported=YES
```

#minor-release

PiperOrigin-RevId: 379498332
2021-06-15 18:43:46 +01:00
kimvde
912acacbe1 Add onFastForward/RewindIncrementChanged to Player
PiperOrigin-RevId: 379497408
2021-06-15 18:42:19 +01:00
samrobinson
7d81f20f92 Add disc fields to MediaMetadata.
PiperOrigin-RevId: 379469182
2021-06-15 18:40:46 +01:00
Oliver Woodman
f90d0a26a4 Merge pull request #9023 from DolbyLaboratories:dev-v2-multicodecs
PiperOrigin-RevId: 379440699
2021-06-15 18:39:14 +01:00
olly
0b97f08955 Suppress warnings in preparation for Checker Framework 3.13.0 upgrade.
LSC: go/checker-lsc

Tested:
    TAP train for global presubmit queue
    http://test/OCL:379220771:BASE:379219228:1623675799153:ea986c7c
PiperOrigin-RevId: 379284240
2021-06-15 18:34:39 +01:00
jinpark
581e543d39 Add toBundle(boolean excludeMediaItems) to Timeline.
Add MediaItem.EMPTY.

PiperOrigin-RevId: 379273172
2021-06-15 18:30:32 +01:00