784 Commits

Author SHA1 Message Date
hschlueter
755df46a6b Remove Transformer-specific things from MediaCodecAdapter.
PiperOrigin-RevId: 421514944
2022-01-14 14:58:40 +00:00
ibaker
5e8d1eb7f3 Add MediaSource.Factory and deprecate MediaSourceFactory
This more closely matches the pattern we have for all implementations
except DefaultMediaSourceFactory (e.g. ProgressiveMediaSource.Factory)
and other factory interfaces like (Http)DataSource.Factory.

PiperOrigin-RevId: 417826803
2022-01-04 12:51:47 +00:00
ibaker
88fe829633 Mark FakeMediaSourceFactory final
There's no need to extend this class. Factories for subclasses of
FakeMediaSource will need to re-implement createMediaSource, at which
point they basically need to re-implement the whole factory interface.

PiperOrigin-RevId: 417817499
2022-01-04 12:47:06 +00:00
ibaker
bb1357b678 Delete deprecated methods from MediaSourceFactory
Some have been deprecated since 2.13.0
([commit](5b9fa7d7d9)):
* `setDrmSessionManager(DrmSessionManager)`
* `setDrmHttpDataSourceFactory(HttpDataSource.Factory)`
* `setDrmUserAgent(String)`

And the rest have been deprecated since 2.12.0
([commit](d1bbd3507a)):
* `setStreamKeys(List<String>)`
* `createMediaSource(Uri)`

PiperOrigin-RevId: 417622794
2021-12-21 17:26:06 +00:00
christosts
b5206b8e05 Add getMetrics() in MediaCodecAdapter
Before the introduction of the MediaCodecAdapter, users could get
access directly to the MediaCodec instance from
MediaCodecRenderer.getCodec() and then retrieve the codec metrics.

This change exposes MediaCodec.getMetrics() on the MediaCodecAdapter.

Issue: google/ExoPlayer#9766

#minor-release

PiperOrigin-RevId: 416343023
2021-12-15 12:22:35 +00:00
ibaker
7fca1a0876 Make DecoderCountersUtil error message clearer
By including the full counters in the failure message we have a clearer
insight into the cause of the failure.

PiperOrigin-RevId: 415982732
2021-12-13 12:21:09 +00:00
ibaker
eaa4ab59a9 Rename DecoderCounters#inputBufferCount to queuedInputBufferCount
This more accurately reflects the value stored in this field.

PiperOrigin-RevId: 414762892
2021-12-10 16:18:00 +00:00
krocard
97206b9c72 Add a builder to DefaultAudioSink
`DefaultAudioSink` already has 3 telescoping
constructors and an other one would be have been
needed to add a buffer size tuning option.

PiperOrigin-RevId: 414703366
2021-12-08 10:01:38 +00:00
ibaker
0f48dfc93e Fix how drop-to-keyframe events are recorded in DecoderCounters
The existing code creates an imbalance between `inputBufferCount` and
`droppedBufferCount` by adding 'dropped source buffers' to
`droppedBufferCount` but not to `inputBufferCount`. This results in
assertion failures in `DashTestRunner`.

PiperOrigin-RevId: 414672175
2021-12-08 10:01:38 +00:00
olly
4af0610067 Shorten log tags to 23 char limit
When calling Android's Log class directly, there's a LongLogTag
lint check that detects tags over the 23 char limit, however it
cannot detect long log tags in ExoPlayer due to the way that we
log via our own Log class. This commit adds @Size annotations to
enforce the same rule.

PiperOrigin-RevId: 413976364
2021-12-06 13:05:45 +00:00
kim-vde
4a69e1660f Merge pull request #9536 from TiVo:p-fix-issue-2882
PiperOrigin-RevId: 411056555
2021-11-26 14:41:45 +00:00
tonihei
25f408e6a9 Move DrmSessionManager initial player setup to its own method.
Currently, DrmSessionManager takes player specific values (= the
playback looper) through (pre)acquireSession calls and requires
the caller to pass in the same values every time.

Instead, we can configure the DrmSessionManager for playback with
a player once before it's being used. We can't simply extend the
prepare() method as prepare may be called before the player is
created to prewarm the DrmSessionManager.

The new method also takes a PlayerId which is bound to the lifetime
of the player similar to the playback looper.

To avoid breakage of custom MediaSources with DRM, we can keep the
old the SampleQueue.createWithDrm method as deprecated.

PiperOrigin-RevId: 410998240
2021-11-19 14:15:03 +00:00
ibaker
06755d4247 Remove null keys from DefaultHttpDataSource#getResponseHeaders
PiperOrigin-RevId: 410507648
2021-11-18 13:17:40 +00:00
tonihei
658def4136 Plumb PlayerId to MediaSource.
MediaSource can be reused with other Player instances after they
have been released, so we need to set the PlayerId when preparing
the source. Access can mostly be handled by the implementation in
BaseMediaSource.

PiperOrigin-RevId: 408878824
2021-11-11 10:49:35 +00:00
ibaker
bf1cf13cab Fix header name in WebServerDispatcher used for testing
HTTP header names are case-insensitive, but all the others in this file
are 'correctly' cased, so we might as well be consistent.

PiperOrigin-RevId: 408840566
2021-11-11 10:45:10 +00:00
ibaker
dd95587cf2 Add contract tests for DataSource#getResponseHeaders
PiperOrigin-RevId: 408840409
2021-11-11 10:40:38 +00:00
ibaker
7de079493c Migrate usages of Window-based Player methods
Where this introduced an inconsistency (e.g. assigning to something
called `windowIndex`), I generally renamed the transitive closure of
identifiers to maintain consistency (meaning this change is quite
large). The exception is code that interacts with Timeline and Window
directly, where sometimes I kept the 'window' nomenclature.

#minor-release

PiperOrigin-RevId: 407040052
2021-11-02 12:08:18 +00:00
olly
8e2083a27b Remove dependency from common tests to exoplayer
PiperOrigin-RevId: 406354526
2021-11-01 09:54:23 +00:00
ibaker
1c824561c6 Migrate callers of deprecated C.java methods to Util.java
#minor-release

PiperOrigin-RevId: 406166670
2021-10-29 11:31:50 +01:00
ibaker
ad39f38995 Update most Player parameter & doc references from Window to MediaItem
Only deprecated references remain.

Usages of the deprecated methods will be migrated in a follow-up change.

#minor-release

PiperOrigin-RevId: 405927141
2021-10-29 11:21:00 +01:00
ibaker
9c9671a0af Remove all references to @NonNull
Our package-info.java files are annotated with @NonNullApi which results
in everything being non-null by default, so this annotation is never
needed.

#minor-release

PiperOrigin-RevId: 405864737
2021-10-29 11:03:05 +01:00
andrewlewis
0ad1cdbfa1 Tidy READMEs
PiperOrigin-RevId: 405598530
2021-10-26 14:08:21 +01:00
andrewlewis
241409a888 Remove resolved TODO
This has been done for (almost) all span types.

PiperOrigin-RevId: 405588294
2021-10-26 13:55:56 +01:00
andrewlewis
4a8f2fc787 Update package name
PiperOrigin-RevId: 405394994
2021-10-25 21:24:35 +01:00
olly
d601875452 Rename releaseArtifact to releaseArtifactId
PiperOrigin-RevId: 404059404
2021-10-18 22:45:47 +01:00
olly
dd23cb13da Fix moving of DataReader
PiperOrigin-RevId: 403965543
2021-10-18 16:24:57 +01:00
olly
a242aa221e Move DataReader to common
PiperOrigin-RevId: 403928449
2021-10-18 15:34:37 +01:00
olly
18cf01cda6 Move DataSource utils into a DataSourceUtil class
PiperOrigin-RevId: 403910535
2021-10-18 15:25:43 +01:00
ibaker
a168c8c928 Use SimpleExoPlayer.Builder where necessary
An upcoming change will modify ExoPlayer.Builder#build() to return
ExoPlayer, so any places that explicitly need a SimpleExoPlayer
instance should be using SimpleExoPlayer.Builder.

PiperOrigin-RevId: 403028312
2021-10-14 12:15:46 +01:00
ibaker
5fe3ec59ca Deprecate SimpleExoPlayer in favour of ExoPlayer
PiperOrigin-RevId: 403028279
2021-10-14 12:11:35 +01:00
samrobinson
3c19850ed3 Migrate library usages of SimpleExoPlayer to ExoPlayer.
PiperOrigin-RevId: 402853522
2021-10-14 12:03:11 +01:00
olly
02719fd5b9 Move test asset ContentProvider to testutil
PiperOrigin-RevId: 402772598
2021-10-13 20:11:02 +01:00
olly
eeec2b2e77 Final README updates
PiperOrigin-RevId: 402547071
2021-10-12 19:52:39 +01:00
olly
e7c6ed5e7f Mechanical README cleanups
PiperOrigin-RevId: 401767060
2021-10-09 18:14:36 +01:00
samrobinson
96a2c03f59 Add public SimpleExoPlayer methods to ExoPlayer.
PiperOrigin-RevId: 401535981
2021-10-07 22:04:05 +01:00
ibaker
e4221c3844 Rollback of ed23b2905b
*** Original commit ***

Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()

An upcoming change will update build() to return Player.

PiperOrigin-RevId: 401468532
2021-10-07 21:53:57 +01:00
ibaker
96cfd0b415 Rename Player methods to refer to MediaItem instead of Window
PiperOrigin-RevId: 401222863
2021-10-06 21:05:14 +01:00
krocard
ac881be2fc Add TracksInfo to the Player API
TracksInfo is very similar to
`MappingTrackSelector.MappedTracksInfo` with some
fields removed to simplify the Player API,
notably it doesn't expose the renderer concept.

A significant difference is the addition of a `selected` boolean
field which avoids having a separate `getCurrentTrackSelection`
API.

This cl is a part of the bigger track selection change,
splitted for ease of review.

In particular, the MediaSession implementation and UI usage
have been slitted in child cls.

Find all cls with the tag:
#player-track-selection

PiperOrigin-RevId: 400937124
2021-10-05 23:15:16 +01:00
bachinger
014ee8f5d8 Remove fully qualified class names in link tags
PiperOrigin-RevId: 400224459
2021-10-04 11:53:39 +01:00
samrobinson
a26caae4ca Remove BasePlayer stop as a final method.
It calls through to a deprecated method, which is unusual for a
convenience method, and the deprecated method has various
implementations. This allows for a smoother removal of stop(boolean)
and removes an obstacle for the ExoPlayer-SimpleExoPlayer merge.

Adds missing @Deprecated tags to some Players.

PiperOrigin-RevId: 400213422
2021-10-04 11:49:44 +01:00
ibaker
ed23b2905b Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()
An upcoming change will update build() to return Player.

PiperOrigin-RevId: 399382297
2021-09-28 16:38:20 +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
samrobinson
e5e8d9dc17 Make StubExoPlayer take a context in constructor.
This is a pre-requisite step for merging SimpleExoPlayer into
ExoPlayer, because when StubExoPlayer extends ExoPlayer, it needs
a matching constructor.

PiperOrigin-RevId: 397065374
2021-09-16 16:52:52 +01:00
bachinger
86dc31f291 Reset only renderers that have been enabled
#exofixit

PiperOrigin-RevId: 396938258
2021-09-16 12:11:02 +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
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
samrobinson
11d2d7daf9 Add open @IntDef for Renderer message types.
#exofixit

PiperOrigin-RevId: 395233622
2021-09-07 17:52:40 +01:00
samrobinson
5183eaaf1e Add open @IntDef for track selection reasons.
#exofixit

PiperOrigin-RevId: 395217458
2021-09-07 17:42:30 +01:00