287 Commits

Author SHA1 Message Date
olly
e160649d9c README updates for MediaSource, DataSource and UI modules
PiperOrigin-RevId: 401793145
2021-10-09 18:21:54 +01:00
olly
e7c6ed5e7f Mechanical README cleanups
PiperOrigin-RevId: 401767060
2021-10-09 18:14:36 +01:00
ibaker
a04f1d1726 Migrate usages of MediaItem.PlaybackProperties to LocalConfiguration
PiperOrigin-RevId: 399206106
2021-09-28 16:35:31 +01:00
ibaker
ad99a44083 Add empty sdk-version node to all AndroidManifest.xml files
PiperOrigin-RevId: 397772916
2021-09-21 14:17:33 +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
olly
c2e6d2028b Fix poor documentation and variable name choice in StreamKey
Issue #9284

PiperOrigin-RevId: 395443015
2021-09-08 17:08:56 +01:00
samrobinson
5183eaaf1e Add open @IntDef for track selection reasons.
#exofixit

PiperOrigin-RevId: 395217458
2021-09-07 17:42:30 +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
olly
85142be9a4 DRM refactor / cleanup
PiperOrigin-RevId: 391403236
2021-08-19 10:42:56 +01:00
olly
b627d70054 Migrate uses of deprecated DataSource factories
PiperOrigin-RevId: 389844289
2021-08-10 14:56:20 +01:00
andrewlewis
d0e426080b Set StreamIndex Name as format.label in SS
Issue: #9252

#minor-release

PiperOrigin-RevId: 388889406
2021-08-05 12:32:15 +01:00
andrewlewis
337d5aa9b6 Fix parameter names on overridden methods
The dokka javadoc generation tool complains when parameter names don't match between a method and its override. This change updates occurrences where there is currently a mismatch.

PiperOrigin-RevId: 387367509
2021-07-29 21:09:30 +01:00
andrewlewis
9c27cfcda7 Fix parameter names on overridden methods
The dokka javadoc generation tool complains when parameter names don't match between a method and its override. This change updates occurrences where there is currently a mismatch.

Notable renamings that might be controversial:
- `onPlaybackStateChanged(int state)` to `onPlaybackStateChanged(int playbackState)` affected a lot of lines but seems more consistent with other '-Changed' methods.
- `handleMessage(int messageType, Object payload)` to `handleMessage(int messageType, Object message)`
- `ExtractorInput` and `DataSource` inherit `DataReader` which had `read(byte[] target, ...`, while data sources normally called the first parameter `buffer`. I have standardized these all to use `buffer` even though it looks out of place in the `ExtractorInput` interface (which has more `read` methods with `target`).

PiperOrigin-RevId: 387290360
2021-07-28 09:15:29 +01:00
bachinger
2ee6d6d95d Make getFallbackSelection nullable to indicate disabling of exclusion
PiperOrigin-RevId: 386442542
2021-07-27 12:14:04 +01:00
bachinger
6dbc1eb189 Make customization of fallback selection more flexible
PiperOrigin-RevId: 383245932
2021-07-09 09:04:43 +01:00
ibaker
0df0df9aee Remove @DoNotInstrument from test classes
This isn't needed now we've updated to Robolectric 4.6

PiperOrigin-RevId: 383109343
2021-07-09 08:58:38 +01:00
aquilescanta
fc26d4eeb1 Remove the last deprecated ParserException constructor
PiperOrigin-RevId: 381221669
2021-06-30 13:27:45 +01:00
bachinger
1cb4fb290f Change signature of ChunkSource.onChunkLoadError
A no-op change that changes the signature of the onChunkLoadError method of the ChunkSource. Implementors can get the exclusion duration directly from the LoadErrorHndlingPolicy instead of receiving it as an argument of the callback.

PiperOrigin-RevId: 381102935
2021-06-30 13:26:32 +01:00
aquilescanta
b5dbadee0c Remove ParserException(cause) constructor
PiperOrigin-RevId: 378635295
2021-06-10 17:36:29 +01:00
kimvde
fc47c2fe86 Add missing @DoNotInstrument annotations
PiperOrigin-RevId: 377006047
2021-06-02 18:13:19 +01:00
olly
1da25f5979 Remove deprecated MediaSource.getTag
PiperOrigin-RevId: 373222158
2021-05-12 11:52:03 +01:00
bachinger
4c1a294b2e Format Java source files
PiperOrigin-RevId: 372127633
2021-05-06 13:32:25 +01:00
olly
67fc1f0c0a Remove deprecated Downloader constructors
PiperOrigin-RevId: 371307278
2021-04-30 18:54:32 +01:00
ibaker
dafea4e40f Re-format some javadoc
PiperOrigin-RevId: 369642047
2021-04-21 18:46:00 +01:00
andrewlewis
e28332ff82 Add common prefix to loader thread names
All threads created by ExoPlayer should now have the prefix "ExoPlayer:".

PiperOrigin-RevId: 356518037
2021-02-11 12:05:06 +00:00
krocard
ec43735054 Split mutations method out of TrackSelection
`TrackSelection` had mutation methods which were to be called only
internally by ExoPlayer components but were exposed in the
public `Player` interface.

The mutation methods have been moved out of `TrackSelection`
to a new class `ExoTrackSelection`.

Current track related read-only method have also been moved out,
because they are actually something quite unclear.
Even for a single item playlist, it's the track being buffered rather
than the track being played, which is unclear.
But when you have a playlist it starts to get really confusing,
because if the next item is being buffered, then it's actually
the last track to be buffered in the currently playing item.
As a final aside, the implementations don't do proper thread synchronization
to ensure visibility of updated state by the calling thread.

Exposing those mutable methods in the public `Player` interface
was problematic because they leaking internal concepts of `ExoPlayer`.
This is also required to minimize the `Player` interface for long term
stability.

`ExoTrackSelection` is a subclass of `TrackSelection`.
This is not ideal as an `TrackSelection` implementation could
break the current immutability.
This was done in order for this refactor to be simpler.
A future patch will fully split the two classes.

All `MediaPeriod` and `Sources` had to be updated to use the new
`TrackSelection` dynamic aspect class name.
An alternative would have been to break ExoPlayer's public API, keeping
`TrackSelection` as the dynamic aspect name, and calling the public static
aspect class `TrackSelectionState` or similar.
Nevertheless, while it would have impacted less files, it would have
many more small apps and casual users of ExoPlayer.

#player-to-common

PiperOrigin-RevId: 353637924
2021-01-25 15:37:38 +00:00
ibaker
5b9fa7d7d9 Add MediaSourceFactory#setDrmSessionManagerProvider()
Deprecate other DRM config methods.

Issue: #8466
PiperOrigin-RevId: 353251452
2021-01-22 16:58:56 +00:00
ibaker
b2a42ea157 Rename MediaSourceDrmHelper to DefaultDrmSessionManagerProvider
Also move it to the `drm` package, and extract a
`DrmSessionManagerProvider` interface.

I'll add `MediaSourceFactory.setDrmSessionProvider()` in a follow-up
change.

Issue: #8466
PiperOrigin-RevId: 352582559
2021-01-19 19:24:06 +00:00
christosts
d4a84b88b5 Remove deprecated method setMinLoadableRetryCount().
Remove setMinLoadableRetryCount() from SingleSampleMediaSource,
DashMediaSource, HlsMediaSource and SsMediaSource factories.

PiperOrigin-RevId: 352008657
2021-01-17 21:51:13 +00:00
bachinger
05c928f96d Add live configuration to Timeline.Window
Issue: #5011
PiperOrigin-RevId: 346828103
2020-12-14 10:17:23 +00:00
tonihei
94b8fab25e Remove deprecated MediaSource builder methods and constructors.
All these methods have been deprecated since at least 2.9.0.

PiperOrigin-RevId: 336320219
2020-10-13 16:27:20 +01:00
olly
04f67e4adc Simplify DefaultMediaSourceFactory ad configuration
- Use a setter, which is consistent with how other optional
  components are passed.
- Remove nesting where a provider provides another provider.
  Since AdSupportProvider then only provides one thing, it
  can be renamed to AdsLoaderProvider, which more clearly
  expresses what it provides.

PiperOrigin-RevId: 330396334
2020-09-07 20:43:41 +01:00
olly
fd71e38db3 Fix DASH/SS/HLS module readme files
PiperOrigin-RevId: 329751934
2020-09-07 20:42:23 +01:00
bachinger
e55b345595 Make all media source factories create a drm session
PiperOrigin-RevId: 327691347
2020-08-21 12:55:14 +01:00
ibaker
f0ae8afd80 Separate the dump files from the test assets
This allows us to more easily create different dumps derived from the
same assets.

This moves media/source files from `assets/` to `assets/media/` and
dump files from `assets/` to `assets/extractordumps/` and
`assets/audiosinkdumps/` as appropriate. I intend to add
`assets/playbackdumps/` in a future CL.

PiperOrigin-RevId: 326986283
2020-08-17 16:13:53 +01:00
aquilescanta
fcb263a407 Make DrmSessionManager take a Format instead of DrmInitData
Skipping acquirePlaceholderSession which will be removed
in a following change.

PiperOrigin-RevId: 326402746
2020-08-17 16:11:17 +01:00
olly
511a6c729e Increase flexibility of ISM URL handling
PiperOrigin-RevId: 326025335
2020-08-17 16:09:01 +01:00
olly
283bed8cb2 Fix ExoMediaCryptoType attachment
- Attach types for placeholder sessions. If a placeholder session will be
  attached and a downstream renderer doesn't know what to do with it, then
  this attachment is necessary to correctly determine that the renderer
  does not support the track.
- Attach types to sample formats. Without this, if playback fails due to
  a CryptoException, the ExoPlaybackException that gets thrown spuriously
  indicates that the format's DRM type was not supported.

PiperOrigin-RevId: 325214745
2020-08-07 19:02:42 +01:00
christosts
f4287ed070 Add a builder for DownloadRequest
PiperOrigin-RevId: 324616617
2020-08-07 18:59:30 +01:00
tonihei
d625af67db Add load cancelation support to DASH and SS
Issue: #7244 added this feature to HLS. This change is the exact copy
in ChunkSampleStream to add the same support to the other adaptive
formats.

Note that ChunkSampleStream doesn't support slicing, so we can't cancel
a read-from chunk, and we need to prevent reading into an already
canceled chunk load so that the chunk can be automatically discarded
after the cancelation.

Issue: #2848
PiperOrigin-RevId: 324179972
2020-08-01 12:56:39 +01:00
ibaker
fda3b3d8ec Use static imports for methods that make sense without their class name
PiperOrigin-RevId: 323349585
2020-07-27 23:59:52 +01:00
bachinger
f81a353bf8 Remove onMediaPeriodCreated/Released/ReadingStarted
These callbacks were only necessary to track the queue in AnalyticsCollector and there is no other known benefit of having them.

PiperOrigin-RevId: 322535274
2020-07-24 10:44:48 +01:00
olly
576ef82191 Remove explicit use of Robolectric PAUSED looper mode
It's now the default everywhere, so there's no need to specify it
explicitly.

PiperOrigin-RevId: 322153319
2020-07-24 10:41:00 +01:00
aquilescanta
ecc834d704 Make DrmSessionManager.getExoMediaCryptoType cover placeholder sessions
getExoMediaCryptoType will only return null for drmInitData == null and
track types for which placeholder sessions are not used. This change
will allow renderers to abstract themselves from format.drmInitData.

PiperOrigin-RevId: 322131219
2020-07-24 10:39:57 +01:00
christosts
b249480060 Offline: store MIME type and keySetId
Replace `type` with (optional) `mimeType` and add `keySetId` in
DownloadRequest. The DownloadHelper infers the downloading method (DASH,
HLS, SmoothStreaming or Progressive) from the content's MIME type and
URI.

PiperOrigin-RevId: 322117384
2020-07-24 10:39:30 +01:00
olly
21f5914e56 Re-add rawtypes suppression
PiperOrigin-RevId: 322008577
2020-07-24 10:38:35 +01:00
aquilescanta
e486dc602c Release Extractor resources in DASH
PiperOrigin-RevId: 321181453
2020-07-24 10:34:48 +01:00
ibaker
49db15ef73 Migrate usages of DownloadHelper TrackSelector constants
PiperOrigin-RevId: 321157115
2020-07-24 10:32:51 +01:00
ibaker
7b69b47a5e Migrate usages of deprecated MediaSource#getTag() method
PiperOrigin-RevId: 321156463
2020-07-24 10:32:42 +01:00
ibaker
e9482c7f0c Migrate uses of deprecated DefaultDownloadFactory constructor
PiperOrigin-RevId: 321153963
2020-07-24 10:32:15 +01:00