11606 Commits

Author SHA1 Message Date
marcbaechinger
6d0a04dd87 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-12 14:09:26 +01:00
andrewlewis
e6780bd157 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-12 14:09:26 +01:00
ibaker
eb682ae825 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-12 14:09:26 +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
andrewlewis
7e7715dbae Update instructions for GMaven releasing
Issue: #5246

PiperOrigin-RevId: 366041182
2021-04-09 17:29:15 +01:00
Oliver Woodman
1fd62c685a Merge pull request #8720 from dlafayet:tts-shear-block
PiperOrigin-RevId: 365998615
2021-04-09 17:27:31 +01:00
olly
ffb1f61ef7 StyledPlayerControlView: Fix view measurement issue
The exo_controls_background view is supposed to fill its parent,
and so previously used match_parent to do this. However, if the
parent uses wrap_content for its own dimensions, the constraints
being specified become somewhat ambiguous. The parent is supposed
to be sizing itself to wrap its children, and one of the children
is supposed to be sizing itself to match the parent.

Intuitively for this case, you'd hope that the layout logic would
size the parent to wrap its other children, and that the
match_parent child would then fill the parent with its determined
size. That's not what happens, and instead the parent ends up
expanding to occupy all of the space available to it.

This commit sets the exo_controls_background view's dimensions
to be 0dp in the layout, to stop it from influencing the size of
the parent. It's then expanded to fill the parent in code.

Issue: #8726
#minor-release
PiperOrigin-RevId: 364868301
2021-04-09 17:26:35 +01:00
olly
74a9bf098c Simplify handling of playback speed in StyledPlayerControlView
PiperOrigin-RevId: 360404403
2021-04-09 17:25:04 +01:00
ibaker
14711d1fb2 Treat Dolby Vision as H264 in MCVR#getCodecMaxInputSize()
Issue: #8705
PiperOrigin-RevId: 364821429
2021-04-09 17:11:03 +01:00
Ian Baker
d102b932fe Merge pull request #8749 from romanofranz:patch-1
PiperOrigin-RevId: 364779790
2021-04-09 17:09:08 +01:00
aquilescanta
3d487dae40 Add missing switch case
Before this change, calling read after reaching the end of input in an Ogg file
would cause an IllegalStateException.

PiperOrigin-RevId: 364758873
2021-04-09 17:08:39 +01:00
kimvde
aa25037600 JpegExtractor: support JFIF segment preceding Exif segment
#minor-release

PiperOrigin-RevId: 364561115
2021-04-09 17:07:44 +01:00
Ian Baker
65ab00859f Merge pull request #8653 from dlafayet:textemphasis
PiperOrigin-RevId: 364363882
2021-04-09 17:07:08 +01:00
andrewlewis
871c24b966 Fix typo in styled player control view javadoc
#minor-release

PiperOrigin-RevId: 363915106
2021-04-09 17:05:40 +01:00
aquilescanta
ca9af38420 Add 'once' to list of devices that need SetOutputSurfaceWorkaround
Issue: #8718
PiperOrigin-RevId: 363869093
2021-04-09 17:05:13 +01:00
kimvde
5c722acca0 JpegExtractor: read GContainer and GContainerItem XMP prefixes
#minor-release

PiperOrigin-RevId: 363859522
2021-04-09 17:04:39 +01:00
aquilescanta
3732eca8b7 Avoid invalid extractors in DefaultHlsExtractorFactory
This change fixes playback of playlists where segments have the
extension and Content-Type of JPEG pictures (although in reality)
they are transport streams. File inferrence before this change will
cause an exception when assuming the inferred file type is one of
the allowed HLS containers.

#minor-release
Issue: #8733
PiperOrigin-RevId: 363641277
2021-04-09 17:04:08 +01:00
andrewlewis
6400cc2dad Upgrade IMA SDK dependency to 3.22.3
This brings in a fix for `NullPointerExceptions` within `WebView` callbacks in
the IMA SDK.

Issue: #8447
PiperOrigin-RevId: 363627446
2021-04-09 17:03:26 +01:00
kimvde
8e0d0c4c69 Replace timeline reference equality checks in FakeMediaSource
#minor-release

PiperOrigin-RevId: 363141851
2021-04-09 17:00:30 +01:00
olly
0d052e0399 HLS: Allow audio variants to initialize the timestamp adjuster
This makes HLS playback less liable to become stuck if discontinuity
tags are inserted at different times across media playlists.

Issue: #8700
Issue: #8372
PiperOrigin-RevId: 362903428
2021-04-09 16:59:46 +01:00
ibaker
06e6391866 Fix CEA-708 priority
According to the spec (section 8.4.2), high numeric values represent low
priorities, so we need to flip this sort.

Issue: #8704
#minor-release
PiperOrigin-RevId: 362558370
2021-04-09 16:57:26 +01:00
andrewlewis
3bdfb76c0c Don't update the ad group count when releasing ImaAdsLoader
`ImaAdsLoader` clears its `AdPlaybackState` when it's released but this could
cause `AdsMediaSource` to look up information in the ad playback state that is
no longer in bounds.

Issue: #8693

PiperOrigin-RevId: 362556286
2021-04-09 16:56:54 +01:00
ibaker
64ce86a0f2 Merge duplicate UI and Text release notes sections
PiperOrigin-RevId: 362079362
2021-04-09 16:52:03 +01:00
aquilescanta
21326e67e3 Fallback to inferred file types when sniffing fails
If none of the extractors successfully sniff the content then we will fall back
to inferred file types in the following order:
- Webvtt if the media comes from a SUBTITLE EXT-X-MEDIA.
- The type of media declared in the HTTP "Content-Type" header.
- The type of the media according to the file extension.
- Transport stream.

Issue: #8700
PiperOrigin-RevId: 362519769
2021-04-09 16:49:31 +01:00
ibaker
3dae045487 Deflake ClippedPlaybackTest
PiperOrigin-RevId: 362298115
2021-04-09 16:49:00 +01:00
ibaker
39e6f665a7 Pass the end position of a stream to TextRenderer when marking it final
In a period transition we pass the start time of the next period, for
the final period we pass the duration of the period or timeline, if
known.

This means sideloaded subtitles now respect the end point of
ClippingMediaSource and ensures that content subtitles aren't
incorrectly displayed over mid-roll ads.

When transitioning back into the subtitled content the subtitles still
appear slightly before the video transitions, meaning the first subtitle
of the content is shown with the last few frames of the ad. Resolving
this in a way that doesn't break anything else requires a deeper
investigation.

Issue: #5317
Issue: #8456
#minor-release
PiperOrigin-RevId: 361797118
2021-04-09 16:13:10 +01:00
Ian Baker
fbdc1bbfd7 Merge pull request #8654 from abeljim:dev-v2-8435-bolditalic
PiperOrigin-RevId: 361767801
2021-04-09 16:11:47 +01:00
tonihei
37d5947b9e Use correct period-window offset for initial prepare position.
MaskingMediaSource needs to resolve the prepare position set for a MaskingPeriod
while the source was still unprepared to the first actual prepare position.

It currently assumes that the period-window offset and the default position is
zero. This assumption is correct when a PlaceholderTimeline is used, but it
may not be true if the real timeline is already known (e.g. when re-preparing
a live stream after a playback error).

Fix this by using the known timeline at the time of the preparation.
Also:
 - Update a test that should have caught this to use lazy re-preparation.
 - Change the demo app code to use the recommended way to restart playback
   after a BehindLiveWindowException.

Issue: #8675
PiperOrigin-RevId: 361604191
2021-04-09 16:10:26 +01:00
Ian Baker
4bf57623dd Merge pull request #8677 from dlafayet:ttml
PiperOrigin-RevId: 361106701
2021-04-09 16:09:48 +01:00
kimvde
a67d260e64 Fix onPositionDiscontinuity event in CastPlayer
- Avoid having two onPositionDiscontinuity events (seek and transition)
  sent after a seek to another media item.
- Avoid triggering an onPositionDiscontinuity event after a timeline
  change.

#minor-release

PiperOrigin-RevId: 361092914
2021-04-09 16:08:40 +01:00
Ian Baker
db60db70fc Merge pull request #8662 from joakimzhang:dev-v2
PiperOrigin-RevId: 361029604
2021-04-09 16:07:55 +01:00
bachinger
01d4adad6d Reset playback speed when live speed control becomes unused
Issue: #8664
#minor-release
PiperOrigin-RevId: 360877086
2021-04-09 16:06:56 +01:00
Oliver Woodman
d6eb61d6f8 Merge pull request #8546 from TadejZupancic:dev-v2
PiperOrigin-RevId: 360433358
2021-04-09 16:06:22 +01:00
kimvde
1a190ff90e Link to callback in Player getters' Javadoc
PiperOrigin-RevId: 360398175
2021-04-09 16:04:54 +01:00
andrewlewis
bcd0a91ed6 Fall back from DTS HD to DTS
#minor-release

PiperOrigin-RevId: 360384540
2021-04-09 14:10:21 +01:00
olly
8570248079 Fix scrubber not reappearing correctly in some cases
Issue: #8646
PiperOrigin-RevId: 360184586
2021-04-09 14:08:49 +01:00
andrewlewis
46e156afee Lint and test artifacts for Maven publication
Issue: #5246
PiperOrigin-RevId: 360132205
2021-04-09 14:05:10 +01:00
aquilescanta
e38b48a9e2 Use a debug signature config for demo apps' release variant
PiperOrigin-RevId: 359724874
2021-04-09 14:03:46 +01:00
ibaker
e4d5e07fd3 Make SsaDecoder robust against absent Format items
Suggested in a comment on PR Issue: #8615

PiperOrigin-RevId: 359522217
2021-04-09 14:01:23 +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