4108 Commits

Author SHA1 Message Date
olly
782c1739c8 Use correct Log class
#minor-release

PiperOrigin-RevId: 372314890
2021-05-06 13:35:40 +01:00
tonihei
61bbdb3794 Add missing isPlaceholder forwarding in SinglePeriodAdTimeline
Also make future similar issues less likely by adding isPlaceholder
to the set method of Period (in case forwarding Timeline
implementations use this instead of just updating values selectively)

#minor-release

PiperOrigin-RevId: 372138523
2021-05-06 13:33:06 +01:00
bachinger
4c1a294b2e Format Java source files
PiperOrigin-RevId: 372127633
2021-05-06 13:32:25 +01:00
krocard
4d4e235697 Allow disabling offload gapless
Issues have been identified around
offload gapless track transitions blocking
the track timestamp.
Until those issues are root caused, this settings
allows to disable gapless offload completely.

PiperOrigin-RevId: 372081545
2021-05-06 13:30:31 +01:00
tonihei
b71c47f0dd Clarify timebase of media times in MediaLoadData.
Also fix unncessary adjustment done in ClippingMediaSource.

#minor-release

PiperOrigin-RevId: 372080724
2021-05-06 13:30:12 +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
krocard
ffe31be08b Deprecate component listener in favor of player
All `add*Listener` and `add*Output` methods are
deprecated in favor of `addListener`.

As for the class themselves `VideoListener` and
`AudioListener` are not used internaly by ExoPlayer,
`VideoRendererEventListener`
and `AudioRendererEventListener` are use in their
place.
As a result `VideoListener` and `AudioListener`
can be deprecated in favor `Listener`.

On the other hand `TextOutput` and `MedataOutput`
are used both in the player interface and internally in
renderers.
This means that those class can't be deprecated.
There usage in the public interface are indirectly
deprecated as their is no way to use them without
using the deprecated `add*Output`.
Thus it's not an issue that the class themselves are
not deprecated.

#minor-release

PiperOrigin-RevId: 371318268
2021-04-30 18:55:06 +01:00
olly
67fc1f0c0a Remove deprecated Downloader constructors
PiperOrigin-RevId: 371307278
2021-04-30 18:54:32 +01:00
dlafayet
8c7d6447c0 Merge #8858: Support ebutts:multiRowAlign in TTML text renderer
Imported from GitHub PR https://github.com/google/ExoPlayer/pull/8858

Fix bug in text alignment inheritance where child does not correctly inherit ancestor's setting

@icbaker
Merge 70eb4bceb73b3f07e2f8d545b4fa7961189ac52a into 45616f916b28c9187b3e0f0dd18797464a079cdc

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/ExoPlayer/pull/8877 from dlafayet:multirowalign-cue d942b50a40525fea5d11b35a33d3bbc512550960
PiperOrigin-RevId: 371306966
2021-04-30 18:54:13 +01:00
bachinger
99492902c0 Merge pull request #8877 from dlafayet:textAlign
PiperOrigin-RevId: 371306900
2021-04-30 18:53:54 +01:00
ibaker
0a54360f99 Tweak verifyApplicationThread to compare Threads, not Loopers
#minor-release

PiperOrigin-RevId: 371306241
2021-04-30 18:53:35 +01:00
bachinger
cdff456621 Make copybara remove the LINT.IfChange tag
PiperOrigin-RevId: 371135534
2021-04-29 17:35:05 +01:00
kimvde
b9b405ef35 Avoid NPEs when checking the current thread in SimpleExoPlayer
Before, Looper.myLooper().getThread() could throw an NPE if the current
thread didn't have any looper.

#minor-release

PiperOrigin-RevId: 371097485
2021-04-29 17:34:01 +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
ibaker
b5d474010b Reformat some javadoc
PiperOrigin-RevId: 371068549
2021-04-29 11:43:34 +01:00
ibaker
df25cefd7a Simplify boolean ternary statements in SsaStyle
PiperOrigin-RevId: 370902227
2021-04-28 17:33:14 +01:00
ibaker
f56c1a1253 SSA: Add a test with a present but empty "Style" line
PiperOrigin-RevId: 370897451
2021-04-28 17:32:56 +01:00
ibaker
e2024072ef Fix flaky DRM assertion in AnalyticsCollectorTest
Session pre-fetching caused this ordering assertion to no longer be
always true. It should have been removed in
795ddfee40

#minor-release

PiperOrigin-RevId: 370880530
2021-04-28 17:32:24 +01:00
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
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
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
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
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
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
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
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