7491 Commits

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

PiperOrigin-RevId: 372314890
2021-05-06 13:35:40 +01:00
jinpark
d388ab25cc Make Player.Commands Bundleable
PiperOrigin-RevId: 372266634
2021-05-06 13:34:04 +01:00
aquilescanta
1f83926d2f Reserve x000 error codes for the UNSPECIFIED error codes
PiperOrigin-RevId: 372146069
2021-05-06 13:33:25 +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
aquilescanta
10ee4689f1 Fix some comments pending from previous change
PiperOrigin-RevId: 372094221
2021-05-06 13:31:47 +01:00
olly
2ef52904af Remove remaining PlayerView/StyledPlayerView core dep
PiperOrigin-RevId: 372092412
2021-05-06 13:31:27 +01:00
olly
9626e24905 Remove Format.create deprecated methods
PiperOrigin-RevId: 372088869
2021-05-06 13:30:50 +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
aquilescanta
0b7865ead9 Add PlaybackException error codes
PiperOrigin-RevId: 371919596
2021-05-04 18:35:55 +01:00
olly
a264a0a04f Remove deprecated UI methods
PiperOrigin-RevId: 371809078
2021-05-04 11:18:26 +01:00
olly
dd0981a5b6 Access ExoPlayer specific UI components via reflection
PiperOrigin-RevId: 371799441
2021-05-04 11:18:07 +01:00
gyumin
416bd43584 Revise javadoc for Rating classes
PiperOrigin-RevId: 371625281
2021-05-04 11:17:44 +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
claincly
4bf7477e3e Flatten packages within the RTSP package.
#minor-release

PiperOrigin-RevId: 371337762
2021-04-30 18:56:17 +01:00
claincly
dfb87638e7 Introduce RtpDataChannel interface.
#minor-release

PiperOrigin-RevId: 371326814
2021-04-30 18:55:59 +01:00
claincly
4eccc0356c Allow retry opening RTP ports.
In RtpDataLoadable.load, the second UDP data source is opened on the port we
specify. If the port is already in use, a BindException is thrown.

#minor-release

PiperOrigin-RevId: 371319522
2021-04-30 18:55:42 +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
olly
f7c4fd491b Remove deprecated PlaybackPreparer
PiperOrigin-RevId: 371170769
2021-04-30 11:44:07 +01:00
christosts
7d2a2aa283 Override available commands in ForwardingPlayer
This change adds an API in the ForwardingPlayer to disable commands.
This is affecting what Player.isCommandAvailable() returns as
well as what is being advertised from the
EventListener.onAvailableCommandsChanged() callback.

For the callback case, the ForwardingPlayer needs to intercept the
callback. It does so by wrapping registered EventListener and Listener
instances, which resulted in some boiler-plate code. In addition, there
is logic on the wrapped listeners to avoid triggering a queued callback
if all listeners have been removed in the meantime. This includes the
case where new listeners are added while callbacks scheduled for the
removed listeners are still pending.

PiperOrigin-RevId: 371139703
2021-04-30 11:43:48 +01:00
bachinger
cdff456621 Make copybara remove the LINT.IfChange tag
PiperOrigin-RevId: 371135534
2021-04-29 17:35:05 +01:00
andrewlewis
a695cbd2ca Update internal codebase location for common module
PiperOrigin-RevId: 371109726
2021-04-29 17:34:32 +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
jaewan
d868602401 Move Rating class to library-common
Rating class should be in the same module as MediaMetadata.

Tested:
  $ ./gradlew --stacktrace :exo-library-common:tDUT
  $ ./gradlew --stacktrace :media2-session:tDUT
  $ ./gradlew --stacktrace :media2-session-vct-current:cAT
PiperOrigin-RevId: 370902917
2021-04-28 17:33:30 +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
samrobinson
2b120f478d Add track artist, album artist and album title to MediaMetadata.
#minor-release

PiperOrigin-RevId: 370881618
2021-04-28 17:32:40 +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
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
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
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