7647 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
olly
c728de9947 Fix IncorrectContextUseViolation on Android 11
Issue: #8246
PiperOrigin-RevId: 378606475
2021-06-10 11:25:35 +01:00
samrobinson
5204bb0d44 Add playlist MediaMetadata to the Player.
PiperOrigin-RevId: 378407609
2021-06-10 11:23:30 +01:00
olly
628ebeeb2b 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: 378184078
2021-06-09 00:09:16 +01:00
claincly
1ca0efdd9b Move RtspClient creation into RtspPeriod.
RtspMediaSource uses the timeline update paradigm from ProgressiveMediaPeriod.

#minor-release

PiperOrigin-RevId: 378150758
2021-06-08 16:40:54 +01:00
aquilescanta
22b126cac3 Assign ERROR_CODE_IO_NO_PERMISSION to ErrnoException (EACCES)
PiperOrigin-RevId: 378134423
2021-06-08 16:38:44 +01:00
kimvde
e4263c4a67 Add fast forward and rewind methods to Player
PiperOrigin-RevId: 378104210
2021-06-08 13:04:56 +01:00
claincly
d0dc72fb6a Fix TCP retry bug when some RTSP tracks are not selected.
The size of rtspLoaderWrappers must match the number of tracks exposed by the
RTSP session (a track is exposed if its media description entry appears in
DESCRIBE's SDP response).

When retrying with TCP, the old code will start loading all exposed RTSP
tracks, regardless of whether they are selected.
The fixed code will only start loading selected tracks.

#minor-release

PiperOrigin-RevId: 377931030
2021-06-08 13:03:51 +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
71fb7411ce Notify the client when ExoPlayer fallbacks to a different codec.
PiperOrigin-RevId: 377602447
2021-06-08 13:01:44 +01:00
claincly
efdd55fad5 Propagate duplicated keys error in SDP better.
The current code does not catch the IAE thrown when building a MediaDescription
or SessionDescription. This CL catches the IAE and propagates it as a
ParserException.

Issue: #9014.

#minor-release

PiperOrigin-RevId: 377544439
2021-06-08 13:00:38 +01:00
aquilescanta
4e85184955 Make PlayerView depend on PlaybackException
PiperOrigin-RevId: 377542206
2021-06-08 12:59:38 +01:00
claincly
95c0c5caa5 Allow TCP retry when using authentication.
The old version's retry logic will not work if using authentication.
Specifically, we use the same authentication parameters from the previous
session, and the RTSP server will reject such parameter.

In this fix, we reset the authentication info on retry. Further, we retry the
last request on receiving a 401 Unauthorized, rather than sending out another
DESCRIBE request.

#minor-release

PiperOrigin-RevId: 377539711
2021-06-08 12:58:39 +01:00
christosts
fd4cfcdd67 AsynchronousMediaCodecAdapter cleanup
After refactoring MediaCodecAdapter.Factory to create configured and
started MediaCodecAdapters in a single operation, the
AsynchronousMediaCodecAdapter does not need to have separate methods to
configure and start, so they are merged. The CONFIGURED state is
removed.

PiperOrigin-RevId: 377519117
2021-06-08 12:56:39 +01:00
aquilescanta
29eeff9ff7 Assign error codes to FileDataSourceExceptions
PiperOrigin-RevId: 377481210
2021-06-08 12:54:31 +01:00
aquilescanta
536f7c8dbe Make StyledPlayerView depend on PlaybackException
PiperOrigin-RevId: 377480089
2021-06-08 12:53:22 +01:00
claincly
cc3cd702ff Add factory method to for using TCP streaming.
#minor-release

PiperOrigin-RevId: 377476603
2021-06-08 12:52:21 +01:00
claincly
69f9e23268 Allow reading RTSP message body by Content-Length.
Related to Issue: #8941.

RTSP message body's format is not regulated by the RTSP spec, meaning it can
use either CRLF or LF as its line terminator. The old code assumes every line
ends with CRLF (RTSP message and the message body); the new code will rely on
the Content-Length information to receive the bytes for the message body.

#minor-release

PiperOrigin-RevId: 377475565
2021-06-08 12:51:15 +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
olly
2b6581afe0 Fix nullness checks for addition of Cursor.getString stub
PiperOrigin-RevId: 377298145
2021-06-03 20:05:58 +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
claincly
016983ca9a Fallback to generate profile-level-id using H264 SPS if it's missing
Related to: Issue: #9010

Profile-level-id (Format.codecs) can be generated from SPS if SDP does not
include it.

#minor-release

PiperOrigin-RevId: 377251211
2021-06-03 13:53:42 +01:00
jinpark
0edb7873e0 Make RemotableTimeline public
PiperOrigin-RevId: 377231322
2021-06-03 13:52:42 +01:00
bachinger
46687fecb1 Allow fast forward and rewind actions in compact view
PiperOrigin-RevId: 377107132
2021-06-03 13:51:40 +01:00
olly
d515e2c1f0 Register RTSP module
PiperOrigin-RevId: 377106891
2021-06-03 13:50:37 +01:00
aquilescanta
89fe0d0cf9 Make AnalyticsListener.onPlayerError take a PlaybackException
NO_EXTERNAL

PiperOrigin-RevId: 377090819
2021-06-03 13:49:28 +01:00
olly
85b6a51666 Add DoNotInstrument annotations to DASH and UI tests
PiperOrigin-RevId: 377048460
2021-06-02 18:19:02 +01:00
bachinger
5700401ec1 Reformat README of extractors module
PiperOrigin-RevId: 377031562
2021-06-02 18:17:13 +01:00
olly
e8ee4e6e6c Add DoNotInstrument annotations to RTSP tests
PiperOrigin-RevId: 377026587
2021-06-02 18:15:47 +01:00
bachinger
f40a92281b Add @DoNotInstrument annotations for extractors module
PiperOrigin-RevId: 377007386
2021-06-02 18:14:35 +01:00
kimvde
fc47c2fe86 Add missing @DoNotInstrument annotations
PiperOrigin-RevId: 377006047
2021-06-02 18:13:19 +01:00
claincly
1dddb8eb1e Allow RtspServer read a RTP dump file.
#minor-release

PiperOrigin-RevId: 377001305
2021-06-02 18:11:27 +01:00
olly
08c882a6ae Trigger reconfiguration on newly obtained MediaCodecAdapters
Add the `needsReconfiguration` API on the `MediaCodecAdapter` interface so that `MediaCodecRenderer` can reconfigure the `MediaCodec` in case a `MediaCodecAdapter` needs to be reconfigured immediately after being obtained from the `MediaCodecAdapter.Factory`.

PiperOrigin-RevId: 376944334
2021-06-02 18:10:01 +01:00
bachinger
2fb61b8ab5 Remove fully qualified package in link tag to avoid reformatting
PiperOrigin-RevId: 376932836
2021-06-02 00:00:55 +01:00
ibaker
58e307c6b0 Keep secure MediaCodec instances when disabling the renderer
A renderer is disabled (without being reset) in two situations:
* When transitioning into a period that starts with a discontinuity
* When stopping the player with setForegroundMode(true)

Before this change the behaviour of `MediaCodecRenderer` when disabled
(but not reset) depended on whether the content being decoded had an
associated `DrmSession`:
* For content without an associated DRM session the MediaCodec instance
  was kept alive.
* For content with an associated DRM session, the MediaCodec instance
  was released. This was to prevent the DRM session from staying alive
  and continuing to make license refresh network requests while the
  player was stopped in 'foreground mode'.

This change removes the second bullet, and keeps MediaCodec instances
alive in both the secure and insecure case. This will result in the
DRM machinery making occasional license refresh network requests (at
a frequency defined by the license policy) while the player is stopped
and in 'foreground mode'. This network usage is considered to be a
'limited resource' as described by the `ExoPlayer#setForegroundMode`
javadoc.

This means that switches between secure content (or between secure and
clear content when `MediaItem.drmConfiguration.sessionForClearTypes`
indicates a secure decoder should be used for clear content) should
keep the same video decoder, thus avoiding the 'black flash' that occurs
on some devices when switching the surface away from a secure decoder.

Issue: #8842

#minor-release

PiperOrigin-RevId: 376825501
2021-06-01 15:48:18 +01:00
ibaker
1bf5a273ff Ensure DefaultDrmSessions keep working if their manager is released
This change introduces a third 'state' for `DefaultDrmSessionManager`:
It's been fully released (prepareCount == 0) but at least one of its
sessions is still active.

In this state new acquisitions are rejected (`(pre)acquireSession()`
calls will fail) but the machinery to support the existing sessions
(ExoMediaDrm and MediaDrmHandler) is kept until they're all released.

This change will allow us to remove the TODO in MediaCodecRenderer
that resolves Issue: #8842.

PiperOrigin-RevId: 376193952
2021-05-27 18:56:29 +01:00
ibaker
4cca8b6d4a Add a test for handling of DRM key refresh events
In a follow-up change I will add an additional test to ensure these
events continue to be correctly handled when DefaultDrmSessionManager
has prepareCount==0 but a non-null ExoMediaDrm instance.

PiperOrigin-RevId: 376190225
2021-05-27 18:55:03 +01:00
olly
513185b72a Fix incorrect re-use of non-secure DummySurface with secure decoder
Issue: #8776
PiperOrigin-RevId: 376186877
2021-05-27 18:53:47 +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