7647 Commits

Author SHA1 Message Date
tonihei
45616f916b Add missing removeDrmEventListener calls.
We remove other source related listeners if a MediaSource is
removed from the playlist or the player/source is released.
This isn't currently done for the DRM listener.

#minor-release

PiperOrigin-RevId: 370482571
2021-04-26 18:29:48 +01:00
Andrew Lewis
ed5ec4e8a8 Merge pull request #8851 from abeljim:dev-v2-8435-underlinestrikeout
PiperOrigin-RevId: 370474795
2021-04-26 18:29:25 +01:00
christosts
a162d689b6 MediaCodecRenderer: do not call protected methods from constructor
MediaCodecRenderer is calling its protected methods
resetCodecStateForRelease() and resetCodecStateForFlush() from its
constructor. Classess that override the methods (eg.
DebugMediaCodecVideoRenderer) need to checks if the methods
are called from the superclass constructor thus their members are not
initialized yet.

With this change, the MCR constructor does not call the two
methods and sets the respective state directly on its fields.

PiperOrigin-RevId: 370445978
2021-04-26 18:29:13 +01:00
samrobinson
3f3d1fb5f2 Change String MediaMetadata.title to CharSequence trackTitle.
PiperOrigin-RevId: 370439509
2021-04-26 18:29:01 +01:00
ibaker
d8ff0210ac Update MediaSourceFactory javadoc
Remove references to deprecated methods. I didn't replace the DRM info
with references to non-deprecated methods because I'm not sure it
belongs at class level. The methods themselves are already documented
in detail.

PiperOrigin-RevId: 370421087
2021-04-26 18:16:52 +01:00
ibaker
2b582b540a Add thread names to the 'player accessed on wrong thread' message
This will help app developers identify which thread is being used and
which is expected.

PiperOrigin-RevId: 370409697
2021-04-26 18:02:07 +01:00
olly
0db4f13483 Fix 1 ErrorProneStyle finding:
* @Nullable is not a TYPE_USE annotation, so should appear before any modifiers and after Javadocs.
  (see go/java-style#s4.8.5-annotations)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Suggest a fix on the CL (go/how-to-suggest-fix).
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if the change looks generally problematic.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/exoplayer/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

PiperOrigin-RevId: 370377751
2021-04-26 18:01:38 +01:00
christosts
0616c0d118 Add Player.getAvailableCommands()
Add method getAvailableCommands() in Player interface to return
the available commands. Method isCommandAvailable() moved to
BasePlayer since it can be implelented by calling
getAvailableCommands().

PiperOrigin-RevId: 370059328
2021-04-26 18:01:03 +01:00
olly
11ce80d0fa Remove deprecated ExoPlayerFactory
PiperOrigin-RevId: 369934240
2021-04-23 09:03:15 +01:00
Abel Jimenez
852101a43f initial commit for underline and strikeout 2021-04-21 18:19:38 -07:00
samrobinson
9d4cbd4e05 Update MediaMetadata from static and dynamic metadata.
PiperOrigin-RevId: 369671127
2021-04-21 18:46:58 +01:00
ibaker
d63cd461fa Remove spurious blank lines introduced in dafea4e40f
PiperOrigin-RevId: 369648457
2021-04-21 18:46:22 +01:00
ibaker
dafea4e40f Re-format some javadoc
PiperOrigin-RevId: 369642047
2021-04-21 18:46:00 +01:00
olly
76647da29a Remove deprecated ExtractorMediaSource
PiperOrigin-RevId: 369635363
2021-04-21 18:45:42 +01:00
olly
2e5a616f26 Core/UI decoupling: Move spherical back to core
A subsequent change will make the UI module access
SphericalGLSurfaceView and VideoDecoderGLSurfaceView
using reflection, now we're at the point where we only
need to reflect the constructors.

PiperOrigin-RevId: 369630102
2021-04-21 18:45:24 +01:00
olly
a78b18298b Remove some long deprecated methods
PiperOrigin-RevId: 369626542
2021-04-21 18:45:06 +01:00
olly
7d4a013c80 Remove more deprecated methods from ExoPlayerFactory
PiperOrigin-RevId: 369615413
2021-04-21 11:01:17 +01:00
andrewlewis
a29ad96b1e Update internal codebase location for extractor module
PiperOrigin-RevId: 369609585
2021-04-21 10:24:26 +01:00
tonihei
50c46e6bb7 Rollback of 09096d6fbf
*** Original commit ***

Rollback of e60609e344

*** Original commit ***

Prevent creation of new sessions if the Timeline is empty.

We currently create sessions based on the placeholder window
index. This shouldn't be needed as we now set a non-empty
timeline as soon as the first MediaItem...

***

PiperOrigin-RevId: 369609523
2021-04-21 10:24:10 +01:00
olly
9a367836e4 DASH: Avoid rounding error in getSegmentCount
Issue: #8804
PiperOrigin-RevId: 369484117
2021-04-21 09:50:01 +01:00
ibaker
7a2eaa96a2 Mark AdaptiveTrackSelection.AdaptationCheckpoint as public
The protected visibility causes problems in Kotlin (Issue: #8830) and
also prevents a subclass of AdaptiveTrackSelection.Factory that isn't
nested inside a subclass of AdaptiveTrackSelection (in both Java and
Kotlin).

#minor-release

PiperOrigin-RevId: 369468841
2021-04-21 09:49:17 +01:00
olly
09096d6fbf Rollback of e60609e344
*** Original commit ***

Prevent creation of new sessions if the Timeline is empty.

We currently create sessions based on the placeholder window
index. This shouldn't be needed as we now set a non-empty
timeline as soon as the first MediaItem is added to the playlist.

Once this check is part of the session manager, we can also remove
the equivalent workarounds from the various code integrations.

***

PiperOrigin-RevId: 369452067
2021-04-21 09:49:01 +01:00
olly
32c5ea0643 Adds Format to MediaCodecAdapter.Configuration.
PiperOrigin-RevId: 369444747
2021-04-21 09:48:46 +01:00
andrewlewis
efce7b9e2c Update internal codebase location for vp9 extension
PiperOrigin-RevId: 369443204
2021-04-21 09:48:30 +01:00
olly
2f73100128 Remove most deprecated ExoPlayerFactory methods
PiperOrigin-RevId: 369442687
2021-04-21 09:48:14 +01:00
tonihei
b921458e40 Deprecate setThrowWhenUsingWrongThread.
This method shouldn't be used anymore since the thread enforcement
is the default already. We still keep it for now to ease the transition
for apps that use ExoPlayer on multiple threads and want to temporarily
disable the enforcement while the threading problems are fixed.

PiperOrigin-RevId: 369440789
2021-04-21 09:47:58 +01:00
tonihei
e60609e344 Prevent creation of new sessions if the Timeline is empty.
We currently create sessions based on the placeholder window
index. This shouldn't be needed as we now set a non-empty
timeline as soon as the first MediaItem is added to the playlist.

Once this check is part of the session manager, we can also remove
the equivalent workarounds from the various code integrations.

PiperOrigin-RevId: 369432853
2021-04-20 15:35:13 +01:00
Oliver Woodman
830d0017d7 Remove deprecated DefaultMediaSourceEventListener
PiperOrigin-RevId: 369425007
2021-04-20 14:26:18 +01:00
krocard
08336e372d Rollforward of Move VideoComponent to ExoPlayer
The original cl has been fixed by not implementing
VideoListener but Player.Listener in
StyledPlayerView.

VideoFrameMetadataListener and CameraMotionListener are still part
of the Player interface as a good way to break the UI dependency
on them has not yet been finalised.

PiperOrigin-RevId: 369417682
2021-04-20 14:02:48 +01:00
krocard
f201b617d7 Fix broken subtitles in StyledPlayerView
PlayerView is not affected.

PiperOrigin-RevId: 369401563
2021-04-20 14:02:33 +01:00
olly
f2c13d9f44 Misc cleanup / clarification for bandwidth improvements
PiperOrigin-RevId: 369315524
2021-04-20 00:17:17 +01:00
olly
7a13163664 MediaCodecAdapter.Factory creates a started Adapter.
This change moves the responsibility of creating, configuring and starting the MediaCodec from the MediaCodecRender to the MediaCodecAdapter.Factory.

This move allows ExoPlayer's client to decide how and when codecs are created and/or reused.

To allow the move, this CL replaces MediaCodecRenderer.ConfigureCodec with MediaCodecRenderer.getCodecConfiguration

PiperOrigin-RevId: 369273887
2021-04-20 00:10:36 +01:00
Oliver Woodman
9fc3b48377 Merge pull request #8812 from TiVo:p-fix-iframe-only-implicit-init
PiperOrigin-RevId: 369215083
2021-04-20 00:10:13 +01:00
tonihei
4f145a83cf Make ProgramInformation final.
This was likely an oversight when first importing #4930.

PiperOrigin-RevId: 369199775
2021-04-20 00:09:59 +01:00
ibaker
6550ea88ea Rollback of cdebf6c68b
*** Original commit ***

Move VideoComponent in ExoPlayer

VideoFrameMetadataListener and CameraMotionListener are still part
of the Player interface as a good way to break the UI dependency
on them has not yet been finalised.

***

PiperOrigin-RevId: 369194309
2021-04-20 00:09:45 +01:00
olly
f438955285 Fix 1 ErrorProneFragileCode finding, REQUIRING THOROUGH REVIEW:
* Prefer instanceof to getClass when implementing Object#equals.
  (see http://go/bugpattern/EqualsGetClass)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Suggest a fix on the CL (go/how-to-suggest-fix).
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneFragileCode if the change looks generally problematic.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/exoplayer/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/exoplayer/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

PiperOrigin-RevId: 369180513
2021-04-20 00:09:31 +01:00
krocard
cdebf6c68b Move VideoComponent in ExoPlayer
VideoFrameMetadataListener and CameraMotionListener are still part
of the Player interface as a good way to break the UI dependency
on them has not yet been finalised.

PiperOrigin-RevId: 368863829
2021-04-20 00:08:08 +01:00
kimvde
62eb54532b Add missing checks to ExoPlayer Builders
PiperOrigin-RevId: 368851903
2021-04-20 00:07:11 +01:00
olly
33f3e5fca0 Make surfaceView non-clickable
PiperOrigin-RevId: 368818853
2021-04-16 14:13:30 +01:00
kimvde
2cc51db54a Refactor SEP prepare to clarify that it is equivalent to EPI prepare.
Before this change:
- SimpleExoPlayer.prepare(mediaSource) ended up calling
  ExoPlayerImpl.setMediaSourcesInternal() with startWindowIndex=0 and
  resetToDefaultPosition=false.
- ExoPlayerImpl.prepare(mediaSource) ended up calling
  ExoPlayerImpl.setMediaSourcesInternal() with
  startWindowIndex=C.INDEX_UNSET and resetToDefaultPosition=true.

This was functionaly equivalent but a bit confusing.

#minor-release

PiperOrigin-RevId: 368818143
2021-04-16 14:13:19 +01:00
ibaker
fff7b8079a Replace Util.toUpperInvariant() with Ascii.toUpperCase()
Even when fixed to the US locale (and thus avoiding surprising behaviour
in e.g. Turkish locale with "i" and "I") there are unexpected behaviours
when upper and lower casing non-ASCII characters.

For example it's sometimes not symmetric, e.g.:
"ẞ".toLowerCase() -> "ß"
"ß".toUpperCase() -> "SS"

In all the ExoPlayer usages we are either dealing with known-ASCII
strings (e.g. MIME types) or comparing against ASCII constant strings
anyway, so it seems easier to just use Guava's ASCII-only class in these
cases.

Util.toUpperInvariant() is null-tolerant, while Ascii.toLowercase() is
not. Most usages in this change are clearly non-null. The BandwidthMeter
usages aren't annotated @Nullable, but the current code *would* work if
countryCode was null in both cases. These methods will now throw NPE if
they're passed null.

PiperOrigin-RevId: 368816287
2021-04-16 14:13:08 +01:00
Oliver Woodman
5511bb66d8 Merge pull request #8814 from dlafayet:line-height
PiperOrigin-RevId: 368803206
2021-04-16 14:12:46 +01:00
jaewan
66e4e47e1a Fix typo
PiperOrigin-RevId: 368789636
2021-04-16 14:12:33 +01:00
kimvde
b0260f7cb8 Add experimentalSetForegroundModeTimeoutMs on SimpleExoPlayer
This is necessary to migrate apps which are using
ExoPlayer.Builder.experimentalSetForegroundModeTimeoutMs
from ExoPlayerImpl to SimpleExoPlayer.

PiperOrigin-RevId: 368657557
2021-04-16 14:12:22 +01:00
andrewlewis
14e085d6c0 Update internal codebase location for av1 extension
PiperOrigin-RevId: 368585664
2021-04-15 10:53:36 +01:00
jaewan
56899cb0e5 Tweak discontinuity reason definitions for remote players
Discontinuity reasons may not be precisely obtained for remote
player. 'Remote Player' means that playback is owned by another
app or device and the same playback can be controller by other
clients simultaneously. The MediaController is an example.
If the remote playback doesn't provide discontinuity reason, then
player cannot differentiate between automatic playback transition
and seekTo() from another client.

This CL tweaks the discontinuity reason definitions, so reasons
can be obtained without remote playback's support.
This doesn't effect the local Players, such as SimpleExoPlayer.

PiperOrigin-RevId: 368579577
2021-04-15 10:53:26 +01:00
jaewan
f0d84f21d3 Make PositionInfo Bundleable
PiperOrigin-RevId: 368453894
2021-04-15 10:53:15 +01:00
olly
d7c7161002 Core/UI decoupling: Replace SingleTapListener with OnClickListener
PiperOrigin-RevId: 368448442
2021-04-15 10:52:46 +01:00
krocard
54f3dfb453 Move DeviceComponent in ExoPlayer
PiperOrigin-RevId: 368437660
2021-04-15 10:52:35 +01:00
krocard
5ae84ab5f4 Move TextComponent to ExoPlayer
PiperOrigin-RevId: 368428647
2021-04-15 10:52:24 +01:00