11436 Commits

Author SHA1 Message Date
olly
e99ca16176 Upgrade build tools and switch from jcenter() to mavenCentral()
Use of mavenCentral() is now the default when making a new project
in Android Studio. Furthermore, Android Studio displays warnings
when jcenter() is used.

PiperOrigin-RevId: 377268744
2021-06-03 13:55:52 +01:00
aquilescanta
4c8532bd74 Make runUntilError take an ExoPlayer instance
PiperOrigin-RevId: 377267159
2021-06-03 13:54:45 +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
aquilescanta
a8e96da1a2 Bump mockito version to 3.4.0
PiperOrigin-RevId: 377064882
2021-06-02 18:20:54 +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
aquilescanta
4e749e7afe Disable reconnection CastOptions
This includes setResumeSavedSession(false) and setEnableReconnectionService(false).

PiperOrigin-RevId: 376162880
2021-05-27 16:10:54 +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
olly
f2680d3169 Tweak readme
PiperOrigin-RevId: 376155192
2021-05-27 16:10:39 +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
claincly
0fb5fa75cf Support basic and digest authentication.
Authentication sequence in RTSP:

- Server replies "Unauthorized" to our DESCRIBE request, and includes the
  necessary information (i.e. realm, digest nonce, etc) in WWW-Authenticate
  header

- After `RtspClient` receives the response, we

  - Parse the WWW-Authenticate header, stores the auth info. The info is saved
    for all further RTSP requests (that all need to carry authorization headers)
  - send the second DESCRIBE request with the Authorization header.

#minor-release

PiperOrigin-RevId: 376116302
2021-05-27 10:47:18 +01:00
aquilescanta
8f04d36f59 Inline redundant constructor
PiperOrigin-RevId: 376005620
2021-05-27 10:46:06 +01:00
aquilescanta
85e4137b81 Add test for ColorInfo in MP4
PiperOrigin-RevId: 375992816
2021-05-27 10:44:50 +01:00
aquilescanta
e8498054d7 Add ColorInfo to extractor tests' format serialization
PiperOrigin-RevId: 375992627
2021-05-27 10:43:36 +01:00
bachinger
095e2feb20 Enable source code formatting
PiperOrigin-RevId: 375979170
2021-05-27 10:42:22 +01:00
olly
ee2af43a54 Fix file formatting
PiperOrigin-RevId: 375919564
2021-05-27 10:40:54 +01:00
olly
4b0c987675 Fix StyledPlayerView detachment
Issue: #8985
#minor-release
PiperOrigin-RevId: 375913914
2021-05-27 10:40:14 +01:00
claincly
614f9d8d55 Rename RtspMessageChannel.openSocket() to open().
The method openSocket in RtspMessageChannel does not actually open a socket.
The 'open' term refers more to opening the message channel.

#minor-release

PiperOrigin-RevId: 375908999
2021-05-27 10:38:56 +01:00
claincly
cfb90e4b70 Remove the default RTSP message handling off playback thread.
The callbacks received RTSP messages and RTSP sending errors are now invoked
directly from RtspMessageChannel's internal threads. It's up to the handler
implementation to decide which thread to handle the messages.

#minor-release

PiperOrigin-RevId: 375908282
2021-05-27 10:38:17 +01:00
claincly
68b2875a42 Move RTP packet forwarding off playback thread.
Previously, RTSP interleaved binary data is posted onto the playback thread
for handling, the playback thread then adds the received data to a queue.
A loader thread will later dequeue the data and process it.

In this CL, the binary data is sent through a separate listener, on
RtspMessageChannel's RTSP receiving thread.

#minor-release

PiperOrigin-RevId: 375907609
2021-05-27 10:37:39 +01:00
claincly
4a780fb90a Allow RtspHeaders to take multiple header values under the same name.
Some RTSP servers will offer multiple WWW-Authenticate options. We wanted to
be able to pick them up.

#minor-release

PiperOrigin-RevId: 375907276
2021-05-27 10:37:00 +01:00
ibaker
e7516fe4e0 Throw from (pre)acquireSession if the DrmSessionManager isn't prepared
Currently acquireSession() fails with an NPE from
checkNotNull(exoMediaDrm). A follow-up change will result in exoMediaDrm
sometimes being non-null while prepareCount==0 (and in this case we
still want acquireSession() to fail).

preacquireSession() doesn't currently fail in a way the caller can
observe - the same NPE is thrown, but asynchronously and it doesn't
propagate out of the background thread. Throwing directly seems
preferable since it's a clear bug to be trying to preacquire sessions
from an unprepared/released manager.

PiperOrigin-RevId: 375906450
2021-05-27 10:36:20 +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
ddc047c235 Add ColorInfo parsing support in MP4 files
PiperOrigin-RevId: 375719035
2021-05-26 11:32:29 +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
aquilescanta
a1ecf3193a Assign ERROR_CODE_PARSING_* to ParsingException
PiperOrigin-RevId: 375515685
2021-05-26 11:29:53 +01:00
aquilescanta
6a8b9557cc Use ERROR_CODE_BEHIND_LIVE_WINDOW instead of instanceof checks
PiperOrigin-RevId: 375514509
2021-05-26 11:29:16 +01:00
Oliver Woodman
afe4217c1c Merge pull request #8943 from dlafayet:embeddedstyle2
PiperOrigin-RevId: 375484765
2021-05-26 11:28:37 +01:00