4330 Commits

Author SHA1 Message Date
olly
4940f21d48 Make position-out-of-range errors non-retryable
PiperOrigin-RevId: 396354920
2021-09-14 12:07:52 +01:00
andrewlewis
469c0e756a Use @C.TrackType more widely
Also add `TYPE_USE` target on the @IntDef (and fix @Targets for other
@IntDefs).

#exofixit

PiperOrigin-RevId: 396333212
2021-09-14 12:04:11 +01:00
christosts
cd91ae4053 PlaybackStatsListener: add check when adding guessed times
This is was reported in #9257 where the PlaybackStatsListener may try to
access an emtpy ArrayList.

Issue: #9257

#minor-release
#exofixit

PiperOrigin-RevId: 396329373
2021-09-14 12:00:24 +01:00
bachinger
76d60b911e Migrate media item transition tests to TestExoPlayer
PiperOrigin-RevId: 396313679
2021-09-14 11:58:30 +01:00
andrewlewis
71a4b6337c Fix javadoc consistency
#exofixit

PiperOrigin-RevId: 396304941
2021-09-14 11:56:45 +01:00
olly
68ee587e25 Constrain resolved period positions to be within the period
This is a candidate fix for #8906. As mentioned in that issue,
negative positions within windows might be (kind of) valid in
live streaming scenarios, where the window starts at some
non-zero position within the period. However, negative positions
within periods are definitely not valid. Neither are positions
that exceed the period duration.

There was already logic in ExoPlayerImplInternal to prevent a
resolved seek position from exceeding the period duration. This
fix adds the equivalent constraint for the start of the period.
It also moves the application of the constraints into Timeline.
This has the advantage that the constraints are applied as part
of state masking in ExoPlayerImpl.seekTo, removing any UI flicker
where the invalid seek position is temporarily visible.

Issue: #8906
PiperOrigin-RevId: 395917413
2021-09-10 15:11:52 +01:00
andrewlewis
0c4bb23dd3 Rename audioVolume parameter to volume
The new name is consistent with the corresponding parameters to `onVolumeChanged`, `setDeviceVolume` and `onDeviceVolumeChanged`.

PiperOrigin-RevId: 395705288
2021-09-09 18:17:40 +01:00
kimvde
0c969bb73d Remove deprecated SingleSampleMediaSource.createMediaSource
#exofixit

PiperOrigin-RevId: 395518824
2021-09-09 18:13:25 +01:00
ibaker
ee8df7afcb Ensure MediaSourceFactory instances can be re-used
This fixes DefaultDrmSessionManager so it can be used by a new Player
instance (by nulling out its reference to the playback thread, which is
unique per-Player instance). This only works if the
DefaultDrmSessionManager is 'fully released' before being used by the
second Player instance, meaning that the reference count of the manager
and all its sessions is zero.

#exofixit
#minor-release
Issue: #9099
PiperOrigin-RevId: 395490506
2021-09-09 18:09:21 +01:00
samrobinson
c403de1c19 Fix AudioSink reset javadoc.
PiperOrigin-RevId: 395444714
2021-09-08 17:10:44 +01:00
olly
c2e6d2028b Fix poor documentation and variable name choice in StreamKey
Issue #9284

PiperOrigin-RevId: 395443015
2021-09-08 17:08:56 +01:00
andrewlewis
3cdc8a9ea3 Use correct last timestamp for C2 MP3 workaround
The C2 MP3 decoder produces an extra output buffer when draining after
end-of-stream is queued. This output buffer has a later timestamp than the last
queued input buffer so we need to calculate its timestamp to detect a stream
change in the correct position.

Before this CL we used the original input buffer timestamp as the largest
queued timestamp, which caused the stream change to be detected at the correct
position because the original input buffer timestamp was slightly larger than
the actual last output buffer timestamp. After this change we use exact
calculated timestamp as the largest queued timestamp. I manually verified
gapless continues to work on a device using the C2 MP3 decoder by comparing
output of the MP3 gapless and MP3 gapless stripped playlists in the demo app,
and that the last buffer timestamp now matches.

#exofixit

PiperOrigin-RevId: 395428928
2021-09-08 17:02:48 +01:00
ibaker
9949424da4 Deprecate all methods on C and move them to Util
C should only hold constants.

Also resolve the TODO in getErrorCodeForMediaDrmErrorCode(), and
annotate the deprecated methods with Error Prone's @InlineMe to
facilitate automated refactoring of callers.

PiperOrigin-RevId: 395244855
2021-09-07 17:56:41 +01:00
olly
b6089758ff Fix incorrect assertion in CacheDataSource
#minor-release
#exofixit

PiperOrigin-RevId: 395233639
2021-09-07 17:54:35 +01:00
samrobinson
11d2d7daf9 Add open @IntDef for Renderer message types.
#exofixit

PiperOrigin-RevId: 395233622
2021-09-07 17:52:40 +01:00
olly
2e21208f63 Workaround ConnectivityManager SecurityException on Android 11
#exofixit
#minor-release
Issue: #9002
PiperOrigin-RevId: 395221648
2021-09-07 17:44:41 +01:00
samrobinson
5183eaaf1e Add open @IntDef for track selection reasons.
#exofixit

PiperOrigin-RevId: 395217458
2021-09-07 17:42:30 +01:00
kimvde
7129d84efd Avoid OMX.qti.audio.decoder.flac on API level < 32
Before, this decoder was avoided on API levels < 30.

#minor-release
Issue:#9349
PiperOrigin-RevId: 395209684
2021-09-07 11:56:18 +01:00
andrewlewis
d05c15dee0 Add open @IntDef for track types
Also add handling of `C.TRACK_TYPE_IMAGE` in a couple of places where it was
missing.

#exofixit

PiperOrigin-RevId: 395078312
2021-09-06 15:04:47 +01:00
apodob
dd19bc8927 Integrate ExoplayerCuesDecoder and SubtitleExtractor
This CL contains integration of the ExoplayerCuesDecoder and the
SubtitleExtractor with the player. The SubtitleExtractor is integrated
inside the DefaultMediaSourceFactory. The flag was added to the
state of the DefaultMediaSourceFactory to let user decide between the
ProgressiveMediaSource and the SingleSampleMediaSource as a source for
subtitles. Choosing the ProgressiveMediaSource will cause data to flow
through the SubtitleExtractor and eventually the ExoplayerCuesDecoder.

PiperOrigin-RevId: 394500305
2021-09-06 14:54:38 +01:00
apodob
3213f969c0 Add handling end of stream in the ExoplayerCuesDecoder
Empty buffer with flag C.BUFFER_FLAG_END_OF_STREAM is send at the end
of the stream. Handling that flag properly is necessary to make the
ExoplayerCuesDecoder work properly with components like TextRenderer.

PiperOrigin-RevId: 394472642
2021-09-06 14:52:41 +01:00
samrobinson
0d4986f806 Remove deprecated static metadata methods.
PiperOrigin-RevId: 394196332
2021-09-02 09:44:04 +01:00
kimvde
9e04789e4d Fix DefaultTrackSelector Javadoc about tunneling
#minor-release
Issue:#9350
PiperOrigin-RevId: 394112689
2021-09-02 09:40:21 +01:00
apodob
3183183d54 Add ExoplayerCuesDecoder that decodes text/x-exoplayer-cues
PiperOrigin-RevId: 393723394
2021-09-02 09:34:53 +01:00
claincly
58e5ed0afb Fix transcoding drops a few frames.
In the old version, the transcoder uses decoder.isEnded() alone as the criteria
to stop the encoding/muxing process. It's rectified to:

- On decoder ending, signal the encoder of EOS after writing all decoded frames to it.
- On encoder ending, write end track to muxer.

PiperOrigin-RevId: 393322114
2021-08-27 16:43:21 +01:00
ibaker
9c2b4b860b Enforce valid key responses in FakeExoMediaDrm
Make this behaviour optional, so it can be disabled for
AnalyticsCollectorTest where we don't use
FakeExoMediaDrm.LicenseServer.

PiperOrigin-RevId: 393133721
2021-08-27 16:39:47 +01:00
ibaker
84cf63a72f Test DefaultDrmSession provisioning is requested by provideKeyResponse
Follow-up to
<unknown commit>

PiperOrigin-RevId: 393132950
2021-08-27 16:37:59 +01:00
kimvde
f574ec952a Make TransformerTranscodingVideoRenderer support API < 23
PiperOrigin-RevId: 393100075
2021-08-27 16:36:09 +01:00
ibaker
3710446b9d Test DefaultDrmSession with NotProvisionedException from getKeyRequest
PiperOrigin-RevId: 392927795
2021-08-26 11:05:31 +01:00
bachinger
a9913e5410 Add the media item to PositionInfo
PiperOrigin-RevId: 392914515
2021-08-26 11:03:40 +01:00
ibaker
e5a39eca1e Fix incorrect DataSourceContractTest test names
These should have been updated as part of
1affbf9357

#minor-release

PiperOrigin-RevId: 392913561
2021-08-26 11:01:59 +01:00
krocard
9fad5f4130 Add Track selection to the Player API
This cl doesn't implement completely the API for
`ExoPlayerImpl` as
`onTrackSelectionParametersChanged` is not called.

The follow up cl adds `TrackSelectionParameters` in PlaybackInfo
to correctly propagate the change event and mask it.

Additionally `TrackSelectionParameters` is serialized as a Parcelable
for now. It is transitioned to bundleable in a follow up cl.

PiperOrigin-RevId: 392899918
2021-08-26 10:58:27 +01:00
samrobinson
66c85245e6 Improve javadoc deprecation for ExoPlayer Components.
PiperOrigin-RevId: 392861577
2021-08-26 10:56:38 +01:00
samrobinson
628e744e26 Deprecate ExoPlayer VideoComponent.
PiperOrigin-RevId: 392668736
2021-08-25 10:56:33 +01:00
samrobinson
d3cc98d368 Deprecate ExoPlayer AudioComponent.
PiperOrigin-RevId: 392655598
2021-08-25 10:54:34 +01:00
olly
3d5e32dc2c Update references to ShadowBaseLooper to use ShadowLooper
ShadowBaseLooper is deprecated and will be removed in a forthcoming CL.

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:391922969:BASE:391896312:1629439874303:285a1989
PiperOrigin-RevId: 392647041
2021-08-25 10:50:35 +01:00
olly
3f16730763 Support generating notifications for paused downloads
- Android 12 will not allow our download service to be
  restarted from the background when conditions that
  allow downloads to continue are met. As an interim
  (and possibly permanent) solution, we'll keep the
  service in the foreground if there are unfinished
  downloads that would continue if conditions were met.
- Keeping the service in the foreground requires a
  foreground notification. Hence we need to be able to
  generate a meaningful notification for this state.

PiperOrigin-RevId: 391969986
2021-08-20 16:25:43 +01:00
olly
03d0b34ab9 Size dolby vision buffers for H265 by default
PiperOrigin-RevId: 391965200
2021-08-20 16:23:54 +01:00
olly
082542c152 Add note that isLastBuffer is best-effort only
PiperOrigin-RevId: 391952144
2021-08-20 11:54:15 +01:00
bachinger
0848188a43 Move TrackGroupTest and TrackGroupArrayTest to lib-common
PiperOrigin-RevId: 391837747
2021-08-20 11:50:51 +01:00
samrobinson
dfb9ac11e9 Deprecate ExoPlayer DeviceComponent.
PiperOrigin-RevId: 391499955
2021-08-19 10:48:03 +01:00
samrobinson
2e2e5e9feb Remove the ExoPlayerImpl implementation of ExoPlayer.
PiperOrigin-RevId: 391498621
2021-08-19 10:46:15 +01:00
bachinger
061d8ee193 Remove qualifier in link tag
PiperOrigin-RevId: 391485174
2021-08-19 10:44:38 +01:00
olly
85142be9a4 DRM refactor / cleanup
PiperOrigin-RevId: 391403236
2021-08-19 10:42:56 +01:00
krocard
cd297b048a Make Track selection objects Bundleable
Most of those objects needs to be sent to MediaControler.

`TrackSelectior.Parameters` could have stayed Parcelable,
but it needs to be `Bundleable` as it inherit from
`TrackSelectionParameters` that is and needs to be
serializable anyway for the demo app.
As a result it has also been migrated to bundleable.

PiperOrigin-RevId: 391353293
2021-08-19 10:38:51 +01:00
andrewlewis
ce4c8e405c Add some range annotations
PiperOrigin-RevId: 391253301
2021-08-17 15:48:10 +01:00
samrobinson
d58e8df252 Deprecate ExoPlayer TextComponent.
PiperOrigin-RevId: 391077147
2021-08-17 15:46:16 +01:00
olly
ef0bfa487f Remove previously deprecated DefaultHttpDataSourceFactory
NO_EXTERNAL

PiperOrigin-RevId: 391054962
2021-08-17 15:42:49 +01:00
olly
38e5864f87 Remove Player.Listener inheritance of TextOutput
PiperOrigin-RevId: 390630998
2021-08-17 15:37:29 +01:00
olly
743b33e821 Remove Player.Listener inheritance of VideoListener
NO_EXTERNAL

PiperOrigin-RevId: 390614839
2021-08-17 15:35:44 +01:00