11231 Commits

Author SHA1 Message Date
samrobinson
b336df3ed3 Move the ownership of MediaMetadata to ExoPlayerImpl.
Add the onMediaMetadataChanged event to onEvents.

PiperOrigin-RevId: 370738521
2021-04-27 21:42:39 +01:00
Denise LaFayette
5ef0ba4171 Fix bug in TTML inherited text alignment
Fix bug where child does not correctly inherit ancestor's text
alignment setting.

Make it so that alignment is only applied on a P node.
https://www.w3.org/TR/2018/REC-ttml2-20181108/#style-attribute-textAlign
2021-04-27 11:29:37 -07:00
aquilescanta
1d96d6b6b0 Add initial code for PlaybackException
Deferred the addition of error codes to ease the review process.

PiperOrigin-RevId: 370687238
2021-04-27 17:43:09 +01:00
claincly
537e8aadd5 Allow the extractor deplete the reordering queue as much as possible.
#minor-release

PiperOrigin-RevId: 370673852
2021-04-27 17:42:54 +01:00
tonihei
26a6aad3e4 Misc ad handling improvements.
1. Clarify intention of getAdGroupIndexForPositionUs and
   getAdGroupIndexAfterPositionUs. Both methods are used for very
   specific but different purposes and encode the logic of which
   ads should be played at which time, so it's helpful to clarify
   this in the documentation as well.
2. Change one usage getAdGroupIndexForPositionUs to use the already
   existing nextAdGroupIndex. This is also more in line with the
   intended usage as clarified in step 1.
3. Update MediaPeriodQueueTest for updateQueuedPeriods to only
   look for duration changes in future periods, not in the
   current one, because that's not handled MediaPeriodQueue for ads
   and the test is just passing by chance now. Also remove wrong
   advancePlaying() calls that are already implicitly included in
   the preceding enqueueNext() call.
4. Fix a minor bug where post-roll ads are not checked whether they
   are played already before using them as the next ad group. Also
   added a test covering this case.

#minor-release

PiperOrigin-RevId: 370664131
2021-04-27 17:42:39 +01:00
claincly
13a34b8b4a Relax session timing requirement.
Some RTSP servers do not include the RANGE attribute for live contents.

#minor-release

PiperOrigin-RevId: 370662587
2021-04-27 17:42:23 +01:00
claincly
bf04bb5bc0 Fix that loadingFinished is never set to true.
Previously loadingFinished will never be set to true because it started in
false, and we are and'ing it with `canceled`.

#minor-release

PiperOrigin-RevId: 370662456
2021-04-27 17:42:09 +01:00
bachinger
65bb4eba25 Fix reference to file in LINT.ThenChange tag
PiperOrigin-RevId: 370660058
2021-04-27 17:41:54 +01:00
claincly
8135b9c273 Publish ExoPlayer's support for RTSP.
Allow ExoPlayer to open URIs starting with rtsp://

PiperOrigin-RevId: 370653248
2021-04-27 17:41:38 +01:00
christosts
74de77a1b6 Add ForwardingPlayer
The ForwardingPlayer implements the Player interface and forwards all
operations to another Player instance. Apps will be able to override
methods of ForwardinPlayer in order to modify and/or suppress specific
Player funcionalities.

This commit introduces the ForwardingPlayer which simply forwards all
Player operations to another Player instance. In follow-up changes,
the ForwardingPlayer will be extended so that it eventually reaches the
feature-set offered by ControlDispatcher.

PiperOrigin-RevId: 370653167
2021-04-27 17:41:23 +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
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
christosts
7af95230cb DebugMediaCodecVideoRenderer: expect output format change after flush
The DebugMediaCodecVideoRenderer expects the MediaCodec to return an
output format change after the MediaCodecRenderer detects an input
format change, but the DebugMediaCodecVideoRenderer resets its state
after flushing MediaCodec. This does not cover the following case: an
input format change is detected when queueing sample with timestamp X
and before the respective output buffer is dequeued, the player seeks
back to X. After seeking back to X, the MCR does not trigger an input
format change for X again, and MediaCodec (correctly) returns an output
format change before dequeueing output X.

This commit is changing DebugMediaCodecVideoRenderer to keep expecting
an output format change after a flush, is one a format pending output.
Such an an edge-case is addressed already in MediaCodecRenderer.

PiperOrigin-RevId: 370482506
2021-04-26 18:29:37 +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
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
2fba921558 DebugMediaCodecVideoRenderer clean-up
After refactoring MediaCodecRenderer's configureCodec() to
getMediaCodecConfiguration(), there was some state initialization left
in DebugMediaCodecVideoRenderer's configureCodec(). This is now moved
inside DebugMediaCodecVideoRenderer.onCodecInitialized().

PiperOrigin-RevId: 370430193
2021-04-26 18:17:03 +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
Andrew Lewis
2a0b45ac77 Merge pull request #8852 from abeljim:dev-v2
PiperOrigin-RevId: 370407108
2021-04-26 18:01:53 +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
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
11ce80d0fa Remove deprecated ExoPlayerFactory
PiperOrigin-RevId: 369934240
2021-04-23 09:03:15 +01:00
Oliver Woodman
aeb306a164 Create CNAME 2021-04-22 09:46:08 +01:00
Abel Jimenez
9fe9adfafb Added SSA test file 2021-04-21 18:26:34 -07:00
Abel Jimenez
852101a43f initial commit for underline and strikeout 2021-04-21 18:19:38 -07:00
olly
c01d26f86b Restore DeleteLocalRef usage
Issue: #8845
PiperOrigin-RevId: 369685031
2021-04-21 18:47:16 +01:00
samrobinson
9d4cbd4e05 Update MediaMetadata from static and dynamic metadata.
PiperOrigin-RevId: 369671127
2021-04-21 18:46:58 +01:00
ibaker
e0502cb3e8 Fix in-page anchor link on exoplayer.dev troubleshooting page
Also consolidate the threading warning info with the same info on the
hello world page and update the version that the
setThrowsWhenUsingWrongThread() method will be removed in.

PiperOrigin-RevId: 369657759
2021-04-21 18:46:40 +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
517e590967 Move docs to correct folder for GitHub Pages 2021-04-21 11:00:57 +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
Oliver Woodman
18ea8d694a Remove CNAME 2021-04-21 10:17:38 +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
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
Oliver Woodman
b9e15d43ae Add CNAME 2021-04-21 09:22:53 +01:00