10955 Commits

Author SHA1 Message Date
olly
a79fbb95d2 Remove unused resources from deprecated GVR module
PiperOrigin-RevId: 368014991
2021-04-13 14:58:33 +01:00
marcbaechinger
14993c4139 Merge pull request #8764 from uvjustin:dev-v2
PiperOrigin-RevId: 367994410
2021-04-12 15:39:09 +01:00
gyumin
5345d716d3 Include aidl output directory to generate javadoc
PiperOrigin-RevId: 367992096
2021-04-12 15:38:59 +01:00
tonihei
aa54aa64b8 Deprecate LoopingMediaSource.
There is no use case left where we couldn't use a better
alternative (either looping in the player, using the Player
playlist API, or ConcatenatingMediaSource for advanced cases)

PiperOrigin-RevId: 367990981
2021-04-12 15:38:51 +01:00
olly
e499f6d38c Improve tests to use output surfaces more realistically
Prior to this change, there were some unrealistic quirks in
our Robolectric tests. For example, onRenderedFirstFrame would
be called when using FakeVideoRenderer, despite no output to
render the frame to ever being set. This change improves the
realism of these tests. These changes are required for some
improvements being made to how outputs are set on video
renderers.

PiperOrigin-RevId: 367652169
2021-04-12 11:44:36 +01:00
gyumin
253c8ce2ad Fix errors when generating javadoc
PiperOrigin-RevId: 367596648
2021-04-09 13:19:29 +01:00
tonihei
1dd96cd8fb Remove warning suppression.
This was added in 9609af3c23 as part of a LSC.

The RequiresNonNull annotation doesn't work anymore (it doesn't
recognize the outer class member and instead tries to find
the same variable on the inner class). So instead of suppressing
the warning of the non-fulfilled precondition, we can just
check the non-nullness directly and remove the precondition.

PiperOrigin-RevId: 367593941
2021-04-09 13:19:22 +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
olly
53166e9a78 Package VideoDecoderGLSurfaceView a little more nicely
The main change here is that VideoDecoderGLSurfaceView now implements
VideoDecoderOutputBufferRenderer directly. This avoids SimpleExoPlayer
having to cast to VideoDecoderGLSurfaceView, which will be necessary
if VideoDecoderGLSurfaceView is moved to the UI module. Instead, the
player can cast directly to VideoDecoderOutputBufferRenderer, which
could be moved to the Common module.

The renderer is also moved to be an inner class, since it's not used
anywhere else and since doing this makes it a little easier to move
things around.

PiperOrigin-RevId: 367398147
2021-04-09 13:18:59 +01:00
gyumin
d24cec517b Add missing default implementations to Player.Listener
PiperOrigin-RevId: 367238434
2021-04-09 13:18:45 +01:00
ibaker
61a5ca480e Reduce the diff between different versions of GTS tests
This means there are fewer changes required when exporting these tests
as part of the GTS suite run by device manufacturers.

PiperOrigin-RevId: 367230977
2021-04-09 13:18:37 +01:00
olly
d853379b8b Convergence: Continue decoupling UI from Core
Move CaptionStyleCompat to the UI module, where it's used

PiperOrigin-RevId: 367223891
2021-04-09 13:18:30 +01:00
jaewan
2434d4e6d4 Remove unnecessary @Nullable in exception message
PiperOrigin-RevId: 367204382
2021-04-09 13:18:22 +01:00
tonihei
c455bad8f8 Add Period.isPlaceholder to fix preparation issues for concatenation.
We added a source that allows mixed placeholder and non-placeholder
periods, but have no way to denote that in the Timeline because the
placeholder flag only exists on Window level. This causes a bug if
the first item in a concatenation has a window-period offset and the
player can't detect whether it's still a placeholder or not.

Adding this flag to Period allows the player to detect this reliably.
In addition we need to make sure that re-resolving pending positions
only happens for the first placeholder period where the window-offset
can actually change. As all subsequent periods have to start at position
0, so they don't need to be re-resolved (and shouldn't).

PiperOrigin-RevId: 367171518
2021-04-09 13:18:15 +01:00
olly
ce4c655c83 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/exoplayer/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

PiperOrigin-RevId: 367053059
2021-04-09 13:18: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
30ddaec5a4 StyledPlayerView: Fix layout issues
- Take centerControls padding into account to prevent switching to
  minimal mode too soon
- Disable clipping to padding to avoid the edges of controls from
  being clipped as the view gets smaller

Issue: #8763
PiperOrigin-RevId: 366966298
2021-04-06 16:14:46 +01:00
ibaker
9e0e937c31 Remove pipelining from MetadataRenderer
This reverts
<unknown commit>

Which was a temporary workaround for Issue: #1874

Also add a loop to ensure we process as many metadata items as
applicable in each render() call.

PiperOrigin-RevId: 366965504
2021-04-06 16:14:36 +01:00
jaewan
9510ba4d91 Make ExoPlaybackException Bundleable
PiperOrigin-RevId: 366938045
2021-04-06 16:14:20 +01:00
olly
9609af3c23 Suppress warnings in preparation for Checker Framework 3.12.0 upgrade.
LSC: go/checker-lsc

Tested:
    Sample tests for this CL passed, but some tests failed during the TGP run. Test failures are believed to be unrelated to this CL
PiperOrigin-RevId: 366804637
2021-04-06 16:14:11 +01:00
samrobinson
9ec6992ca1 Populate MediaMetadata title from IcyInfo and TextInformationFrame.
PiperOrigin-RevId: 366272937
2021-04-06 16:14:01 +01:00
olly
a5c47243f4 HLS: Fix incorrect handling of byte ranges for EXT-X-MAP tags
Issue: #8783
#minor-release
PiperOrigin-RevId: 366265419
2021-04-06 16:13:52 +01:00
olly
1242237294 Add isBlacklisted method to ExoTrackSelection interface.
Make BaseTrackSelection blacklist and isBlacklisted methods non-final.

PiperOrigin-RevId: 366256521
2021-04-06 16:13:41 +01:00
olly
b4aee72a4a Re-strip StableApiCandidate
PiperOrigin-RevId: 366255289
2021-04-01 16:25:45 +01:00
olly
7562baed0b Fix SimpleExoPlayer documentation
I've removed the "by default" statements, since this now depends on how
the builder was configured.

PiperOrigin-RevId: 366249995
2021-04-01 16:07:16 +01:00
olly
1f54776024 HLS: Set initial SampleQueue start times
This ensures BUFFER_FLAG_DECODE_ONLY is set on samples that are
before the playback start position, in the case that the queue
is created after the start position is set.

#minor-release

PiperOrigin-RevId: 366249188
2021-04-01 16:07:07 +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
tonihei
a317746eff Ensure constructor condition is unblocked even for unchecked exceptions
The condition is meant to be unblocked whenever the constructor is
left. This should include unchecked exceptions (that may be thrown
due to bugs in the dependent components, or user-inhected factories)

PiperOrigin-RevId: 366235361
2021-04-01 16:06:34 +01:00
andrewlewis
c80e7b0a68 Add back jcenter() to repositories
The buildscript entry is required by
com.android.tools.build:gradle:4.0.1.

For other projects, it appears that org.checkerframework is
in jcenter.

Without this change building with gradlew is broken, at least.

#minor-release

PiperOrigin-RevId: 366222799
2021-04-01 16:06:26 +01:00
olly
ae47a138ee Delete unused surfacecapturer package
PiperOrigin-RevId: 366131005
2021-04-01 16:06:18 +01:00
ibaker
af926deb7a Use outputStreamEnded for MetadataRenderer#isEnded
Issue: #8710
#minor-release
PiperOrigin-RevId: 366051836
2021-04-01 16:06:09 +01:00
tonihei
a7d7cfd023 Release all PlaybackStatsListener session when timeline becomes empty.
Currently they are only released when the timeline becomes non-empty
again or the player is released.

Issue: #8778
PiperOrigin-RevId: 366041625
2021-04-01 16:06:01 +01:00
andrewlewis
86a0a405b6 Update instructions for GMaven releasing
Issue: #5246

#minor-release

PiperOrigin-RevId: 366041182
2021-04-01 16:05:53 +01:00
ibaker
056ef5c914 Use Metadata.Entry.toString in PlaybackOutput test logging if possible
Add an allowlist of Metadata.Entry implementations with stable toString
overrides.

PiperOrigin-RevId: 366037505
2021-04-01 16:05:44 +01:00
olly
f5a4f3e609 Switch tests to use SimpleExoPlayer
PiperOrigin-RevId: 366033200
2021-04-01 16:05:35 +01:00
ibaker
c02288452b Add test for emsg near to end of DASH period
The dumped output should include metadata, but doesn't because of
Issue: #8710. The fix is in a follow-up change.
PiperOrigin-RevId: 366028303
2021-04-01 16:05:27 +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
jaewan
ffb5b41a20 Fix typo in Player#setMediaItems() Javadoc
PiperOrigin-RevId: 366015326
2021-04-01 16:05:10 +01:00
Oliver Woodman
6603c6bbcf Merge pull request #8720 from dlafayet:tts-shear-block
PiperOrigin-RevId: 365998615
2021-04-01 16:05:00 +01:00
tonihei
dc0ee7580e Deprecate AnalyticsListener.onSeekStarted.
The new onPositionDiscontinuity callback contains sufficient information, so
that this former workaround to obtain the position before a seek is no longer
needed.

PiperOrigin-RevId: 365993937
2021-04-01 16:04:51 +01:00
olly
7aeb476812 Fix DefaultExtractorInputTest.largeSkip
PiperOrigin-RevId: 365992439
2021-04-01 16:04:42 +01:00
olly
db42bef17b Modify visibility of onQueueInputBuffer.
Aims to achieve visibility parity with MediaCodecRenderer#onQueueInputBuffer.

Allows measuring the time when the codec queue the first input buffer in the codec. Which means the Codec has been initialized and is about to start decoding.

It also allows measuring how long it takes for the Codec to render its first frame.

PiperOrigin-RevId: 365906756
2021-04-01 16:04:34 +01:00
tonihei
192c1a18f7 Don't include video tracks without bitrate in adaptive selection.
This is generally not supported by our classes. A similar change for audio
was made in aa2beb080c.

PiperOrigin-RevId: 365795371
2021-04-01 16:04:26 +01:00
ibaker
84ce648c90 Move @Ignore from class to methods in DashWidevineOfflineTest
PiperOrigin-RevId: 365794941
2021-04-01 16:04:16 +01:00
tonihei
f31894616c Ensure callback can't access player before constructor finished.
If the player is created on a background thread (which is allowed
as the only exception to the access-on-one-thread-only rule), it
may happen that a callback on the main thread tries to access the
player before the constructor even finished. This is dangerous and
can cause exceptions due to uninitialized variables.

To solve this, we can make sure that every player access is blocked
until the constructor finished. Blocking is safe because the
constructor itself is not doing any blocking work or acquiring locks.

The thread verification method is already called on every entry
point to the player, so we can reuse the same method for checking.

PiperOrigin-RevId: 365792949
2021-04-01 16:04:08 +01:00
tonihei
394ab7bcfd Make use of position discontinuity changes.
The extended onPositionDiscontinuity callback can be used to improve some
listener classes:
 - Listening to onTimelineChanged to detect discontinuities is no longer needed.
 - Listening to onSeekStarted is no longer needed as the start position is part
   of the onPositionDiscontinuty callback.
 - The exact old position is also useful for media time history logging.

As a side effect, removing onSeekStarted handling from PlaybackStatsListener
fixes Issue: #8675 that was caused by the special EventTime handling for
onSeekStarted.

PiperOrigin-RevId: 365558959
2021-04-01 16:04:00 +01:00
olly
47af9a6889 Enable internal retry for recoverable codec exceptions
PiperOrigin-RevId: 365556167
2021-04-01 16:03:51 +01:00