1388 Commits

Author SHA1 Message Date
tonihei
8a5d21adef Remove reference to deprecated Player.EventListener.
#minor-release

PiperOrigin-RevId: 372925409
2021-05-10 23:40:26 +01:00
samrobinson
2914e574e6 Rename MediaMetadata trackTitle and trackArtist to title and artist.
#minor-release

PiperOrigin-RevId: 372537414
2021-05-07 14:58:03 +01:00
bachinger
a9fc3185fe Do not mock NetworkException
PiperOrigin-RevId: 372321626
2021-05-06 13:36:00 +01:00
bachinger
5595c48739 Optionally deduplicate updating MediaMetadataCompat
PiperOrigin-RevId: 372146631
2021-05-06 13:33:44 +01:00
bachinger
4c1a294b2e Format Java source files
PiperOrigin-RevId: 372127633
2021-05-06 13:32:25 +01:00
bachinger
39ac09e7c6 Add @DoNotInstrument for unit test classes of extensions
PiperOrigin-RevId: 372101509
2021-05-06 13:32:05 +01:00
bachinger
a3e06f7d4e Add @DoNotIntrument to test classes of the CroNet extension
PiperOrigin-RevId: 372092122
2021-05-06 13:31:08 +01:00
olly
a264a0a04f Remove deprecated UI methods
PiperOrigin-RevId: 371809078
2021-05-04 11:18:26 +01:00
jinpark
f7a8c6e4de Add command for setting media items metadata
PiperOrigin-RevId: 371482546
2021-05-04 11:17:22 +01:00
krocard
3dc6cf6bec Deprecate EventListener in favor of Listener
#minor-release

PiperOrigin-RevId: 371348520
2021-04-30 18:56:35 +01:00
olly
f7c4fd491b Remove deprecated PlaybackPreparer
PiperOrigin-RevId: 371170769
2021-04-30 11:44:07 +01:00
bachinger
cdff456621 Make copybara remove the LINT.IfChange tag
PiperOrigin-RevId: 371135534
2021-04-29 17:35:05 +01:00
olly
b65945b38f Remove deprecated CastPlayer methods
PiperOrigin-RevId: 371102614
2021-04-29 17:34:16 +01:00
krocard
de895c4894 Add get video size
Move VideoSize in the common module and have the Player return it.

`Listener` and `AnalyticsListener` `onVideoSizeChanged` are updated
with the old method deprecated.

`VideoRendererEventListener.onVideoSizeChanged` was also migrated to
`VideoSize` but the old method is removed, not deprecated.
This is because:
 - apps calling/listening to this method is a rare and niche use-case.
 - it would introduce hard to diagnostic issues where if only the caller
   or the callee is updated to use the new method, the event will be lost.
   This doesn't occur with the other 2 listeners as the caller is always
   in ExoPlayer library and was updated to call both the old and new methods.

VideoSize is used everywhere except in `Format` as this would lead to
too much refactoring and backward compatibility breakage for little gain.

#minor-release

PiperOrigin-RevId: 371087419
2021-04-29 11:44:03 +01:00
bachinger
688fd73d39 Remove AutoClosable implementation of PlayerCommandQueue
PiperOrigin-RevId: 370875532
2021-04-28 12:53:31 +01:00
bachinger
096395f0c7 Add @DoNotInstrument to Opus extension test
PiperOrigin-RevId: 370740311
2021-04-27 21:43:11 +01:00
bachinger
1a2d690dba Add @DoNotInstrument to Flac extension test
PiperOrigin-RevId: 370739641
2021-04-27 21:42:55 +01:00
bachinger
65bb4eba25 Fix reference to file in LINT.ThenChange tag
PiperOrigin-RevId: 370660058
2021-04-27 17:41:54 +01:00
krocard
5153ccde98 Remove release command for symmetry with Player construction
Release is a life cycle operation that should only be called when
the player is no longer needed. It's linked to the player lifecycle
and thus very different from prepare/stop.
As a result, it should not be in the same command.

Additionally it's not clear if remote players will ever need to call release,
as the player creator is best candidate to release it.

As a result the release operation doesn't have a use case for a command.
A release command can be added later if a need is identified.

PiperOrigin-RevId: 370649214
2021-04-27 17:41:06 +01:00
christosts
bc69509aba CronetDataSource: fix overflow bug
There is a bug when CronetDataSource opens an asset with a length
bigger that Integer.MAX_INT  (2147483647 bytes, ~2GB). In read(),
`bytesRemaining` is cast to int, which overflows and evaluates to a
negative number, causing `bytesRead` to be negative too.

PiperOrigin-RevId: 370434368
2021-04-26 18:28:50 +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
87d8907b4b Fix 4 ErrorProneStyle findings:
* @Encoding is not a TYPE_USE annotation, so should appear before any modifiers and after Javadocs.
  (see go/java-style#s4.8.5-annotations) (2 times)
* @Nullable is not a TYPE_USE annotation, so should appear before any modifiers and after Javadocs.
  (see go/java-style#s4.8.5-annotations) (2 times)

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: 370048160
2021-04-26 17:48:23 +01:00
olly
c01d26f86b Restore DeleteLocalRef usage
Issue: #8845
PiperOrigin-RevId: 369685031
2021-04-21 18:47:16 +01:00
ibaker
dafea4e40f Re-format some javadoc
PiperOrigin-RevId: 369642047
2021-04-21 18:46:00 +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
andrewlewis
517e590967 Move docs to correct folder for GitHub Pages 2021-04-21 11:00:57 +01:00
andrewlewis
a8cf54e9d0 Move extensions/opus to libraries/decoder_opus
See go/media-apis-codebase-google3.

PiperOrigin-RevId: 369603286
2021-04-21 09:50:20 +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
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
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
andrewlewis
a6e9a9c6d2 Remove mocking executor in CronetDataSourceTest
Other tests in this file already use `Executors.newSingleThreadExecutor` so do the same for the ones that currently use `mockExecutor`.

PiperOrigin-RevId: 368859470
2021-04-20 00:07:39 +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
ibaker
c50084e7ba Replace Util.toLowerInvariant() with Ascii.toLowerCase()
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.

This change also includes some null-twiddling, because
Util.toLowerInvariant() is null tolerant, while Ascii.toLowerCase() is
not. Most of the usages were already non-null, and it was easy enough to
change the remaining ones to be so by simple reordering of statements.

I'll make an equivalent change for Util.toUpperInvariant() next.

PiperOrigin-RevId: 368419813
2021-04-15 10:51:48 +01:00
krocard
40d3e12853 Move MetadataComponent from Player to ExoPlayer
PiperOrigin-RevId: 368418142
2021-04-15 10:51:26 +01:00
krocard
4fc4ddbc6a Move AudioComponent to ExoPlayer leaving key methods in Player
PiperOrigin-RevId: 368413660
2021-04-15 10:51:05 +01:00
gyumin
1ad56e96c2 Add mediaId to PlaybackStateCompat extras
It provides a way to associate PlaybackState with the current media
item.

Startblock:
  <unknown commit> is submitted
PiperOrigin-RevId: 368354775
2021-04-14 11:40:52 +01:00
bachinger
cc26a92e07 Use MediaItem.DEFAULT_MEDIA_ID as default media ID
PiperOrigin-RevId: 368204261
2021-04-13 14:59:40 +01:00
olly
a79fbb95d2 Remove unused resources from deprecated GVR module
PiperOrigin-RevId: 368014991
2021-04-13 14:58:33 +01:00
andrewlewis
3ea694b1fb Upgrade IMA SDK dependency to 3.23.0
This brings in another fix for `NullPointerExceptions` within `WebView` callbacks in the IMA SDK, related to companion ads.

Issue: #8447

#minor-release

PiperOrigin-RevId: 367591047
2021-04-09 13:19:14 +01:00
olly
199b9d1689 Convergence: Continue decoupling UI from Core
Move AdsLoader inner classes that are also required by
the UI module into common.

PiperOrigin-RevId: 367414679
2021-04-09 13:19:07 +01:00
bachinger
4c33c5110e Call new onPositionDiscontinuity callback in CastPlayer
PiperOrigin-RevId: 367020270
2021-04-09 13:17:59 +01:00
olly
6f4db96da1 Fix some dependencies
PiperOrigin-RevId: 366972832
2021-04-06 16:14:55 +01:00
olly
1315e11bfd Ffmpeg extension: Wait for channel count and sample rate
When playing TrueHD streams, it's possible that the first decoded
buffer is empty, and that the channel count and sample rate are
still unknown. To correct for this, defer determining the format
until a buffer that will actually be output from the decoder has
been obtained, and only then query the channel count and sample
rate.

Issue: #8616
#minor-release
PiperOrigin-RevId: 366246245
2021-04-01 16:06:59 +01:00
samrobinson
3d3c90b89d Add getMediaMetadata to Player and SimpleExoPlayer.
PiperOrigin-RevId: 366240390
2021-04-01 16:06:43 +01:00
andrewlewis
86a0a405b6 Update instructions for GMaven releasing
Issue: #5246

#minor-release

PiperOrigin-RevId: 366041182
2021-04-01 16:05:53 +01:00
olly
f5a4f3e609 Switch tests to use SimpleExoPlayer
PiperOrigin-RevId: 366033200
2021-04-01 16:05:35 +01:00
bachinger
2fa3675edb [Cast] Notify media item transition only when playing period removed
When playback transitions automatically, the timeline may have changed because the cast device learned about the duration of the next media item and includes this in the new media status that is sent to the CastPlayer. In such a case we need to make sure that we don't report a media item transition with reason PLAYLIST_CHANGED but for reason AUTO.

PiperOrigin-RevId: 366025323
2021-04-01 16:05:18 +01:00
krocard
1526ca5e3c Move add/remove Player.Listener down of BasePlayer
The BasePlayer implementation of add/remove
Listener knows about Components.
As those are removed from the Player
interface, the implementation of those
methods needs to be moved down in Player
implementations.

This commit makes no functional change.

PiperOrigin-RevId: 364985291
2021-04-01 16:03:09 +01:00
bachinger
dc4148d576 Add positions and new reasons to onPositionDiscontinuity
PiperOrigin-RevId: 364861539
2021-03-24 19:56:25 +00:00