7798 Commits

Author SHA1 Message Date
samrobinson
d47d1ebf19 Deprecate static metadata getter and listener method.
PiperOrigin-RevId: 385781004
2021-07-21 14:44:00 +01:00
samrobinson
0b0277af50 Set StyledPlayerView/PlayerView artwork from MediaMetadata.
PiperOrigin-RevId: 385763366
2021-07-21 14:41:20 +01:00
samrobinson
c157db694a Split MediaMetadataTest cases into PictureFrameTest and ApicFrameTest.
PiperOrigin-RevId: 385758742
2021-07-21 14:39:56 +01:00
samrobinson
fde3075af1 Add an artworkDataType to MediaMetadata.
This field is to be associated with the artworkData.

PiperOrigin-RevId: 385757480
2021-07-21 14:38:30 +01: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
samrobinson
135eb3f8cf Split some MediaMetadataTest cases into TextInformationFrameTest.
PiperOrigin-RevId: 385562351
2021-07-20 08:52:38 +01:00
kimvde
fa1bb32deb Remove deprecated PlaybackPreparer
Also update release note to account for upcoming ControlDispatcher removal.

PiperOrigin-RevId: 385520701
2021-07-20 08:47:26 +01:00
kimvde
31c9875ec9 Deprecate ControlDispatcher in the UI
PiperOrigin-RevId: 385129211
2021-07-20 08:38:13 +01:00
kimvde
3830848888 Use Player methods in DefaultControlDispatcher
PiperOrigin-RevId: 385118021
2021-07-20 08:36:46 +01:00
klhyun
f173ffa972 Do not set aspect ratio if unknown.
When the size of the video is unknown,
PlayerView and StyledPlayerView set the aspect ratio as 1,
which could result in wrong view layout.

This CL sets the aspect ratio as 0 (unset) to prevent that.

This handles Issue: #9189.

PiperOrigin-RevId: 385115357
2021-07-20 08:35:17 +01:00
kimvde
626c3e9843 Remove fastforward_increment and rewind_increment attributes
This values won't be configurable from the UI anymore once the
DefaultControlDispatcher is removed.

They can be configured in the Player or by using a ForwardingPlayer.

PiperOrigin-RevId: 385113498
2021-07-20 08:33:49 +01:00
kimvde
227f9a3b93 PlayerNotificationManager: add setUseRewind/FastForwardAction
This is a preliminary step to deprecate ControlDispatcher.

PiperOrigin-RevId: 385097270
2021-07-16 11:25:42 +01:00
bachinger
78ecb10ac0 Add RepresentationHolder.selectedBaseUrl and use it for new chunks
PiperOrigin-RevId: 384968532
2021-07-16 11:24:21 +01:00
aquilescanta
99abb4e1e9 Check for TS synchronization before parsing packet from random position
#minor-release
Issue: #9100
PiperOrigin-RevId: 384962258
2021-07-16 11:22:55 +01:00
olly
7157f3c119 Move E2E DASH test into DASH package
PiperOrigin-RevId: 384912341
2021-07-15 14:47:20 +01:00
kimvde
85f3af8864 Use Player commands to enable UI buttons
PiperOrigin-RevId: 384910388
2021-07-15 14:45:44 +01:00
olly
08ac778ad6 Fix package name for UI tests
PiperOrigin-RevId: 384893655
2021-07-15 13:23:42 +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
bachinger
f60c080500 Minor change to extractor module to avoid formatting changes
PiperOrigin-RevId: 384730845
2021-07-14 21:18:23 +01:00
samrobinson
b9ac5a145f Implement a DefaultMediaDescriptionAdapter that uses MediaMetadata.
PiperOrigin-RevId: 384681659
2021-07-14 21:16:20 +01:00
claincly
6512463280 Make network-based DataSource implementations use ErrorCode.
PiperOrigin-RevId: 384666131
2021-07-14 12:19:49 +01:00
claincly
f9f93c5a49 Handle absolute URI in RtspMediaTrack.
Issue: #9183

RFC2326 Section C.1.1 specifies that the URI to identify a track can be either
absolute (like rtsp://example.com/path) or relative (like "path"). Currently
we don't handle absolute URI, and this CL is to add the support.

Note though, we don't currently use the Content-Base or Content-Location
headers for the session URI.

PiperOrigin-RevId: 384649818
2021-07-14 12:18:31 +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
olly
e403dda105 End ListenerSet iteration sooner
PiperOrigin-RevId: 384500287
2021-07-14 12:14:19 +01:00
olly
949f715c6b Avoid IncorrectContextUseViolation on Android 11
Applications may need to pass a non-visual context when creating
a DefaultTrackSelector (e.g., because they're audio-only or are
creating the selector in a background service).

Obtaining the default display via DisplayManager avoids the strict
mode violation that occurs when retrieving it via WindowManager.

#minor-release

PiperOrigin-RevId: 384487363
2021-07-14 12:13:06 +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
ibaker
1058997e38 Explicitly override all non-deprecated methods in Player.Listener
Most of the super-interfaces are deprecated, but the intention is that
only the types are deprecated and the methods themselves shouldn't be.
In order to reflect this in javadoc we override all the methods in
`Player.Listener` in order to 'cancel' the deprecation.

This change deliberately doesn't override methods that are explicitly
deprecated with documented replacements (like
`Player.EventListener#onPlayerStateChanged`) - these should contine to
be marked as deprecated in javadoc.

PiperOrigin-RevId: 384253725
2021-07-13 10:07:54 +01:00
aquilescanta
6c37c3c2f4 Add ERROR_CODE_DRM_LICENSE_EXPIRED for KeysExpiredException
The errorCode assignment will be done in a following CL.

PiperOrigin-RevId: 384230228
2021-07-13 10:05:20 +01:00
olly
822f6282f1 The sound, vibrate and ticker will only be played once
Android doc:https://developer.android.com/reference/android/app/Notification.Builder#setOnlyAlertOnce(boolean)

PiperOrigin-RevId: 384227580
2021-07-13 10:04:11 +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
kimvde
1309b26ebe Add support for MP4 H263 atom type
#minor-release
Issue:#9158
PiperOrigin-RevId: 383660258
2021-07-09 09:24:13 +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
samrobinson
d9618b5104 Fix missing word in javadoc.
PiperOrigin-RevId: 383448851
2021-07-09 09:19:01 +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
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