482 Commits

Author SHA1 Message Date
samrobinson
22f05e549a Populate MediaMetadata from VorbisComment.
PiperOrigin-RevId: 378844617
2021-06-11 12:25:39 +01:00
kimvde
53d67daaef Add available commands to fast forward and rewind
PiperOrigin-RevId: 378842286
2021-06-11 12:24:37 +01:00
olly
3e819d082a Make javadoc valid html5
As of [JDK-8247957](https://bugs.openjdk.java.net/browse/JDK-8247957), doclint
no longer supports html4.

Tested:
    Some test failures are present, but the CL author has decided to mail the change anyway
PiperOrigin-RevId: 378819179
2021-06-11 12:23:35 +01:00
jaewan
3a519b539b Include remote player cases for reason constants in Player
PiperOrigin-RevId: 378779411
2021-06-11 12:22:28 +01:00
olly
047037e74b Bump version to 2.14.1 and tidy release notes
#minor-release

PiperOrigin-RevId: 378665771
2021-06-10 17:39:58 +01:00
aquilescanta
805cd47682 Add methods for comparing PlaybackException data
Also replace the equals() method in MediaUtils.

PiperOrigin-RevId: 378638642
2021-06-10 17:37:42 +01:00
aquilescanta
b5dbadee0c Remove ParserException(cause) constructor
PiperOrigin-RevId: 378635295
2021-06-10 17:36:29 +01:00
samrobinson
5204bb0d44 Add playlist MediaMetadata to the Player.
PiperOrigin-RevId: 378407609
2021-06-10 11:23:30 +01:00
kimvde
e4263c4a67 Add fast forward and rewind methods to Player
PiperOrigin-RevId: 378104210
2021-06-08 13:04:56 +01:00
olly
4b30cca914 Update @SuppressWarnings annotations for go/nullness diagnostics
in preparation for upgrading the version of the Checker Framework in google3.

More information: go/checker-3110-lsc

PiperOrigin-RevId: 377925828
2021-06-08 13:02:47 +01:00
olly
b56b769faa Update @SuppressWarnings annotations for go/nullness diagnostics
in preparation for upgrading the version of the Checker Framework in google3.

More information: go/checker-3110-lsc

PiperOrigin-RevId: 377374612
2021-06-08 12:50:09 +01:00
aquilescanta
af4b891c99 Use UnrecognizedFormatException for progressive media only
PiperOrigin-RevId: 377303025
2021-06-03 20:07:04 +01:00
kimvde
b0a3bc5b28 Rename ExoFlags to FlagSet
We want to remove mentions of ExoPlayer for
convergence.

PiperOrigin-RevId: 377290376
2021-06-03 20:04:39 +01:00
aquilescanta
36841d4f6f Replace one of the ParserException constructors with factory method
PiperOrigin-RevId: 377281961
2021-06-03 20:03:16 +01:00
olly
bb2e0bc0ef Bump targetSdkVersion to 30
- Remove Robolectric workarounds that are no longer needed
- Add workarounds for b/190021699

PiperOrigin-RevId: 377279422
2021-06-03 20:01:50 +01:00
andrewlewis
2260678bee Fix texture transformation in gldemo
`SurfaceTexture` provides a transform matrix with each buffer. Previously
gldemo ignored this but it is important to apply it to have the video render
properly.

The transformation matrix from the surface texture includes flipping so this
change removes the hard-coded flipping from `a_texcoord`.

Issue: #8992

#minor-release

PiperOrigin-RevId: 377271389
2021-06-03 19:59:43 +01:00
jinpark
0edb7873e0 Make RemotableTimeline public
PiperOrigin-RevId: 377231322
2021-06-03 13:52:42 +01:00
tonihei
2938d40bf4 Allow to specify the number of removed ad groups in AdPlaybackState.
This helps to remove old ad groups (e.g. those that fell out
of the live window) to keep the data size of AdPlaybackState small.

Also added this case to some existing unit tests to ensure it's
covered.

PiperOrigin-RevId: 376170653
2021-05-27 18:49:53 +01:00
tonihei
0d0ccadc83 Add getter for ad groups in AdPlaybackState.
This allows to decouple the data structure from the access. In
a future change, this allows to completely remove old ad groups
(e.g. for live streams where the number of groups would otherwise
grow forever).

Also move the time into the group itself for better encapsulation.

PiperOrigin-RevId: 376170408
2021-05-27 18:48:40 +01:00
ibaker
4033832cba Cleanup the MediaItem.Builder javadoc for 'conditional' setters
Many of the setters are ignored unless others are set - this change:
* Lists these conditions exhaustively.
* Uses more concise language to avoid overshadowing the main details
  of what the setter sets.
* Tweaks the language from 'is ignored' to 'shouldn't be called', to
  open up the future possibility of throwing an error if these are
  called without the 'required' setter also being present (see
  Issue: #8957).

#minor-release

PiperOrigin-RevId: 376162385
2021-05-27 16:10:54 +01:00
claincly
6d04b998f9 Use more factory method to create ParserException.
ParserException's constructor methods are deprecated.

#minor-release

PiperOrigin-RevId: 376150191
2021-05-27 16:04:10 +01:00
ibaker
41ce635a42 Fix docs on MediaItem.Builder#setDrmUuid
The docs on setLicenseUri say it's optional, and it has been since
379cd8a04f
(which should have changed this javadoc too)

#minor-release

PiperOrigin-RevId: 376139158
2021-05-27 16:02:56 +01:00
claincly
4f59394f51 Use factory method to create ParserException.
ParserException's constructor methods are deprecated.

#minor-release

PiperOrigin-RevId: 376127494
2021-05-27 16:01:38 +01:00
aquilescanta
c353151288 Add errorCode to the EventLogger
PiperOrigin-RevId: 376126959
2021-05-27 16:00:32 +01:00
olly
ee2af43a54 Fix file formatting
PiperOrigin-RevId: 375919564
2021-05-27 10:40:54 +01:00
gyumin
beb13f62a7 Add FOLDER_TYPE_NONE to MediaMetadata
PiperOrigin-RevId: 375883879
2021-05-26 11:33:41 +01:00
klhyun
2e5c95e80a Remove obsolte TODO
PiperOrigin-RevId: 375830765
2021-05-26 11:33:04 +01:00
aquilescanta
2e8d4c9110 Extract function for mapping ColorInfo-related constants
PiperOrigin-RevId: 375705247
2021-05-26 11:31:52 +01:00
aquilescanta
4e5e654eff Add convenience method for getting the name of an error code
PiperOrigin-RevId: 375686596
2021-05-26 11:31:12 +01:00
samrobinson
6b7a0d8c11 Add year to MediaMetadata.
#minor-release

PiperOrigin-RevId: 375674759
2021-05-26 11:30:36 +01:00
ibaker
926df59081 Defensively copy potentially mutable text in Cue constructor
Without this the Cue isn't deeply immutable, which can be a bit
surprising.

PiperOrigin-RevId: 375477571
2021-05-26 11:27:59 +01:00
ibaker
2081f4b466 Annotate Cue.Builder getters with @Pure
This reduces the null-checking required in a follow-up change.

PiperOrigin-RevId: 375468504
2021-05-26 11:27:22 +01:00
samrobinson
8d550bf05b Add an extras bundle to MediaMetadata.
#minor-release

PiperOrigin-RevId: 375435339
2021-05-26 11:25:27 +01:00
samrobinson
e793a9031b Add a mediaType field to MediaMetadata.
#minor-release

PiperOrigin-RevId: 375097412
2021-05-21 18:25:49 +01:00
aquilescanta
1c4294175f Add contentIsMalformed and dataType to ParserException
PiperOrigin-RevId: 374874272
2021-05-21 12:02:29 +01:00
klhyun
9e4315f48d Implement MediaController#getCurrentCues
It only covers MediaSession - MediaController
(Does not consider cases that either a legacy session or a legacy controller is involved)

Add PlayerInfo#Builder to clean it up.

PiperOrigin-RevId: 374785779
2021-05-20 15:39:34 +01:00
christosts
65d8ff80db ForwardingPlayer only forwards Player operations
PiperOrigin-RevId: 374621615
2021-05-19 20:24:53 +01:00
krocard
41afb6ac4e Add guarantied invalid command to allow niche optimisations
This allows users to use `int` to store an optional command.

PiperOrigin-RevId: 374600127
2021-05-19 20:24:29 +01:00
aquilescanta
66c1aedeb3 Assign ERROR_CODE_BEHIND_LIVE_WINDOW to BehindLiveWindowExceptions
PiperOrigin-RevId: 374425179
2021-05-19 20:23:38 +01:00
aquilescanta
227795964b Add an IntDef for DATA_TYPE_* constants
PiperOrigin-RevId: 374418502
2021-05-19 20:22:48 +01:00
aquilescanta
6c06b4efd1 Re-order error codes for symmetry
PiperOrigin-RevId: 374416794
2021-05-19 20:22:23 +01:00
aquilescanta
61c92007b7 Bubble up the errorCode argument in preparation for new factory methods
Notes:
- The only functional change is that createForRemote now assings ERROR_CODE_REMOTE_ERROR.
- createForSource still uses ERROR_CODE_UNSPECIFIED, even though it expects an
  IOException. The reason for not using ERROR_CODE_IO_UNSPECIFIED is that the reason for
  the error might not be IO. For example, malformed media, or BehindLiveWindowException,
  which have non-IO error codes. So using UNSPECIFIED saves a later change in category.
PiperOrigin-RevId: 374390407
2021-05-19 20:21:57 +01:00
tonihei
378b3f6eb5 Add Util class for server-side inserted ads.
When working with SSAI ads, we need to easily convert positions between
the underlying stream and the media model that exposes ad groups. To
simplify this, we can add util methods (that are testable on their own).

In addition, we need an easy way to build AdPlaybackStates for SSAI
inserted ads. The metadata is obtained out-of-band and usually has the
ad group start and end times in the underlying stream only. Hence, we
also add a util method to add a new ad group based on this information.

PiperOrigin-RevId: 374369360
2021-05-19 20:21:32 +01:00
samrobinson
25b453a5fe Add track number & total to MediaMetadata
#minor-release

PiperOrigin-RevId: 374235979
2021-05-19 20:20:43 +01:00
tonihei
04d6c8ed19 Fix grammar nit
PiperOrigin-RevId: 374186953
2021-05-17 18:20:14 +01:00
krocard
6a30af567f Add Commands.Builder.addAllCommands for easy init
MediaSession default command state contains all
commands.
To avoid having to update MediaSession when a command
is added, allow to create a Commands.Builder that
starts with all commands.

PiperOrigin-RevId: 374183484
2021-05-17 18:19:53 +01:00
aquilescanta
17209ed1ee Use the term equivalent instead of equal in assertion
The assertion doesn't check equality (as in x.equals(y)), but rather
whether a subset of the fields are equal.

PiperOrigin-RevId: 374183338
2021-05-17 18:19:32 +01:00
olly
2566b24642 Remove deprecated Listener.onTimelineChanged
PiperOrigin-RevId: 374171038
2021-05-17 18:19:13 +01:00
christosts
1dfda7ab6e ForwardingPlayer implements Player
Make ForwardingPlayer implement Player and not extend BasePlayer so that
ForwardingPlayer forwards each Player method directly to the wrapped
Player instance.

PiperOrigin-RevId: 374161084
2021-05-17 18:18:14 +01:00
tonihei
795210d7bc Update player logic to handle server-side inserted ads.
There are two main changes that need to be made:
 1. Whenever we determine the next ad to play, we need to select a
    server-side inserted ad even if it has been played already (because
    it's part of the stream).
 2. When the Timeline is updated in the player, we need to avoid changes
    that would unnecessarily reset the renderers. Whenever a Timeline
    change replaces content with a server-side inserted ad at the same
    position we can just keep the existing MediaPeriod and also if the
    duration of the current MediaPeriod is reduced but it is followed by
    a MediaPeriod in the same SSAI stream, we can don't need to reset
    the renderers as we keep playing the same stream.

PiperOrigin-RevId: 373745031
2021-05-14 11:24:46 +01:00