8653 Commits

Author SHA1 Message Date
kimvde
d911fb8538 Remove Transformer deprecated methods that were never released
#minor-release

PiperOrigin-RevId: 427965501
2022-02-21 17:05:06 +00:00
tonihei
66dfb7361f Make ExoPlayerImpl an ExoPlayer implementation
All the functionality of SimpleExoPlayer has moved to ExoPlayerImpl.
Hence, ExoPlayerImpl can fulfil its own name and become an ExoPlayer
implementation. As a result, ExoPlayer.Builder can return ExoPlayerImpl
directly without using SimpleExoPlayer at all.

PiperOrigin-RevId: 427947028
2022-02-21 17:05:06 +00:00
tonihei
b271469fd0 Add missing Javadoc for AudioAttributes.
#minor-release

PiperOrigin-RevId: 427712140
2022-02-21 17:05:06 +00:00
krocard
73a3d1d131 Fix DefaultAudioTrackBufferSizeProvider test
And move them in separate top level classes so that presubmit runs them.

#minor-release

PiperOrigin-RevId: 427482430
2022-02-21 17:05:06 +00:00
tonihei
6118d94b8a Add missing events to AnalyticsListener.
And also add a test that all Player.Listener events are forwarded
to AnalyticsListener.

The AnalyticsCollector also needlessly implemented
Video/AudioRendererEventListener, which is not needed because all of
the equivalent methods are called directly and never through the
interface.

#minor-release

PiperOrigin-RevId: 427478000
2022-02-21 17:05:06 +00:00
olly
8554cf5a6b Handle Choreographer.getInstance throwing RuntimeException
#minor-release

PiperOrigin-RevId: 427439588
2022-02-21 17:05:05 +00:00
tonihei
41a1423afc Merge listeners in ExoPlayerImpl and add missing constants
There are two sets of listeners in ExoPlayerImpl at the moment,
which can be merged together to use a single ListenerSet. This has
the added advantage that the events that were previously sent
through the ArraySet get additional guarantees provided by ListenerSet
(e.g. correct event ordering and onEvents triggered).

Also add missing constants for onEvents to ensure all Player.Listener
methods have an corresponding constant.

PiperOrigin-RevId: 427415349
2022-02-21 17:05:05 +00:00
tonihei
0dbe01dc0f Misc clean-up in ExoPlayerImpl.
This brings listener invocations closer together and removes
unnecessary methods.

Also fixes a bug where a change in track selection parameters only
queued a callback but never flushed it to actually inform the
listeners.

#minor-release

PiperOrigin-RevId: 427201691
2022-02-21 17:05:05 +00:00
tonihei
fdce6abf27 Avoid special-casing AnalyticsCollector when informing listeners.
In some cases (whose where we previously used EventListener),
AnalyticsCollector is registered as a listener to receive updates,
in other cases it is called directly.

Avoid this inconsistent handling by registering it as normal listener
and removing all callbacks that are handled by the normal listener flow.

The remaining direct usages of AnalyticsCollector calls are those
callbacks that have no equivalent in Player.Listener.

#minor-release

PiperOrigin-RevId: 427201525
2022-02-21 17:05:05 +00:00
christosts
0dd108046b Android 12L: Always set codec max output channels
With this change, MediaCodecAudioRenderer always configures MediaCodec
with max output channels set to 99 on API 32+.

#minor-release

PiperOrigin-RevId: 427192801
2022-02-21 17:05:05 +00:00
tonihei
8e8fadfe78 Remove self-listening from ExoPlayerImpl
SimpleExoPlayer used to register a listener on ExoPlayerImpl for
the old EventListener callbacks. Now both classes are merged, this is
no longer needed and should be removed in favor of calling methods
directly.

#minor-release

PiperOrigin-RevId: 427187875
2022-02-21 17:05:05 +00:00
tonihei
4edf36fdff Fix delayed discontinuity for failed ad insertions.
We have logic to not immediately interrupt playback when an ad group
fails to load and instead let the current content play and transition
at the point where the ad group should have been.

This logic was broken by dcbdbe5341 because of one of the conditions
used MediaPeriodId.adGroupIndex, which is always -1 for content ids.
It still worked for the last ad group because the next ad group index
was C.INDEX_UNSET.

Fix the issue and amend the test that was meant to catch this to test
the ad failures for the last ad and previous ads.

Also fix the PositionInfo reported in such a case, which was also wrong.

Issue: google/ExoPlayer#9929

#minor-release

PiperOrigin-RevId: 427143223
2022-02-21 17:05:05 +00:00
tonihei
acc86c4e7d Add missing calls to AnalyticsCollector
PiperOrigin-RevId: 427133919
2022-02-21 17:05:05 +00:00
tonihei
f8c0342990 Remove deprecated EventListener
PiperOrigin-RevId: 427133817
2022-02-21 17:05:05 +00:00
tonihei
fda4c32f45 Rollback of 03e645bab3
*** Original commit ***

Rollback of 9b8ed581d0

*** Original commit ***

Add missing imports to ExoPlayerImpl

These were missed in 3bb0210d22

#minor-release

***

***

PiperOrigin-RevId: 427131696
2022-02-21 17:05:05 +00:00
tonihei
dcfd6fdac3 Fix the position of IntDefs to match TYPE_USE
PiperOrigin-RevId: 427131569
2022-02-21 17:05:05 +00:00
tonihei
d67be42a7b Rollback of 12be2bc357
*** Original commit ***

Rollback of 3bb0210d22

*** Original commit ***

Move SimpleExoPlayer logic into ExoPlayerImpl

This makes SimpleExoPlayer a simple forwarding wrapper which can be
removed in the future.

The changes are all purely mechanical with none of the potential further
simplifications made yet...

***

PiperOrigin-RevId: 427131338
2022-02-21 17:05:04 +00:00
olly
690e97a5ac Rollback of 3bb0210d22
*** Original commit ***

Move SimpleExoPlayer logic into ExoPlayerImpl

This makes SimpleExoPlayer a simple forwarding wrapper which can be
removed in the future.

The changes are all purely mechanical with none of the potential further
simplifications made yet. The only exceptions are name clashes where
either EPI or SEP was calling a method in one of the classes and both
classes had different implementations for the same method name. In these
cases we needed to disambiguate between the two different
implementations (e

***

PiperOrigin-RevId: 426997821
2022-02-21 17:05:04 +00:00
olly
5976732c1b Revert of b19ced30c4c2853b09af3382b86f84c31b3a5af5
PiperOrigin-RevId: 426996878
2022-02-21 17:05:04 +00:00
olly
b285538ad5 Rollback of 9b8ed581d0
*** Original commit ***

Add missing imports to ExoPlayerImpl

These were missed in 3bb0210d22

#minor-release

***

PiperOrigin-RevId: 426996503
2022-02-21 17:05:04 +00:00
olly
b5bf1e0703 Revert of cf1dcede591e3db5481ef578e0637e271be8f336
PiperOrigin-RevId: 426994820
2022-02-21 17:05:04 +00:00
olly
1103fee093 Revert of b27349385b61efa3576bb78b59cb07c93fc3a167
PiperOrigin-RevId: 426994559
2022-02-21 17:05:04 +00:00
olly
603b6a3048 Fix minimum API level issue
Transformer's minimum API level is 21, where-as the
full library is still targeting 16. Hence we should
no longer include the transformer module in the
full library dependency.

#minor-release

PiperOrigin-RevId: 426958045
2022-02-21 17:05:04 +00:00
Ian Baker
91e98fa5b0 Merge pull request #9924 from jruesga:cea708-decoder-honor-service-block-size
PiperOrigin-RevId: 426953267
2022-02-21 17:05:04 +00:00
ibaker
8a8b4e6cff Remove deprecated DefaultRenderersFactory constructors
#minor-release

PiperOrigin-RevId: 426938026
2022-02-21 17:05:04 +00:00
tonihei
f089e79349 Update some text descriptions to ease translations.
Some strings didn't mention the context in which they are used
(for example as item in a list, or for accessibility). This makes it
harder for translators to choose the most appropriate translation and
grammar.

Also fix repeat and shuffle mode button accessibility descriptions to
indicate the action, not the current state.

PiperOrigin-RevId: 426924163
2022-02-21 17:04:58 +00:00
ibaker
2c33afa73a Remove deprecated ProgressiveMediaSource.Factory setters
#minor-release

PiperOrigin-RevId: 426909957
2022-02-21 16:59:58 +00:00
olly
b6d2e4cf1a Add missing calls to AnalyticsCollector
PiperOrigin-RevId: 426892085
2022-02-21 16:59:58 +00:00
olly
fd96fbc71c Remove deprecated EventListener
PiperOrigin-RevId: 426876984
2022-02-21 16:59:58 +00:00
ibaker
a75cc084c7 Add missing imports to ExoPlayerImpl
These were missed in 3bb0210d22

#minor-release

PiperOrigin-RevId: 426872386
2022-02-21 16:59:58 +00:00
ibaker
af43c93a0b Remove deprecated ActionFile and ActionFileUpgradeUtil
#minor-release

PiperOrigin-RevId: 426868933
2022-02-21 16:59:58 +00:00
ibaker
e40f138d7a Remove LegacyPlayerView reference from comment in proguard-rules.txt
This class is deprecated (and will be removed from media3).

#minor-release

PiperOrigin-RevId: 426860018
2022-02-21 16:59:58 +00:00
ibaker
b243610a7a Fix the position of IntDefs to match TYPE_USE
PiperOrigin-RevId: 426855255
2022-02-21 16:59:58 +00:00
ibaker
a7aa84a8a4 Add TYPE_USE to 'frequently used' IntDefs in a backwards-compatible way
This ensures Kotlin usages of these IntDef annotations in the 'old'
position will continue to compile.

'Frequently used' is a subjective judgement. I have a parallel change
that marks all the other public IntDefs in the library as TYPE_USE
(those that I've judged to be 'rarely used' by apps).

A follow-up change will fix the positions of existing usages to be as if
they're only TYPE_USE.

#minor-release

PiperOrigin-RevId: 426427334
2022-02-21 16:59:58 +00:00
ibaker
f87a6ac37b Mark all public 'rarely used' IntDefs as only TYPE_USE
This is a breaking change if the annotation itself is in use in Kotlin
code. It's judged that the IntDefs in this commit are unlikely to be
referred to often in Kotlin code. This is because they're either:
- Related to esoteric parts of the library, or
- In a common part of the library but only returned from methods (and
  never passed to callback methods).

A follow-up change will fix the positions of existing usages to match
this new config.

#minor-release

PiperOrigin-RevId: 426410237
2022-02-21 16:59:58 +00:00
ibaker
0128d0b6b1 Make @LogLevel public and TYPE_USE
#minor-release

PiperOrigin-RevId: 426410137
2022-02-21 16:59:58 +00:00
ibaker
d3bb8efaef Mark @C.SelectionReason as TYPE_USE (only) and use it in more places
This is not backwards compatible if the @SelectionReason annotation is
used in Kotlin code, but before this change there aren't many library
surfaces that return a value annotated with @SelectionReason, so it
seems relatively unlikely that it is in use in any/many apps.

A follow-up change will fix the positions of existing usages to match
this new config.

#minor-release

PiperOrigin-RevId: 426409877
2022-02-21 16:59:58 +00:00
ibaker
945643490c Move @AudioFocusGain from C to AudioFocusManager and make it private
This is only used inside AudioFocusManager, it doesn't need to public.

Also mark it TYPE_USE and update the position to match.

#minor-release

PiperOrigin-RevId: 426407790
2022-02-21 16:59:58 +00:00
ibaker
850251f9dc Remove @C.AudioManagerOffloadMode IntDef
This is only used in DefaultAudioSink, so we could move it there and
make it private - but at that point we might as well refer to the
underlying AudioManager constants instead.

#minor-release

PiperOrigin-RevId: 426407661
2022-02-21 16:59:58 +00:00
ibaker
e42b51fc6d Reshuffle the 'legacy' attrs.xml and drawables.xml files
Keep values related to LegacyPlayerView in attrs_legacy_player_view.xml
and put all values related to LegacyPlayerControlView back in their
original locations. We plan to remove LegacyPlayerView (and
attrs_legacy_player_view.xml) from media3, but will keep
LegacyPlayerControlView - so the separation of the XML files needs to
reflect this split.

#minor-release

PiperOrigin-RevId: 426406973
2022-02-21 16:59:57 +00:00
olly
b320f7d76a Support relative MPD.Location URIs
#minor-release
Issue: google/ExoPlayer#9939
PiperOrigin-RevId: 426394339
2022-02-21 16:59:57 +00:00
ibaker
f8c3a2c1f2 Mark all non-public IntDefs as only TYPE_USE
This only changes IntDefs that cannot be used by apps because they're
either private or package-private.

A follow-up change will fix the positions of existing usages to match
this new config.

#minor-release

PiperOrigin-RevId: 426372273
2022-02-21 16:59:57 +00:00
ibaker
05f3f16853 Explicitly document every overridden method in ForwardingPlayer
This makes the delegation model more explicit, and prevents the javadoc
compiler from just pulling in the Player javadoc automatically - which
can lead to some confusion when some method definitions in Player depend
on other methods (e.g. seekForward() is defined in terms of
getSeekForwardIncrement()).

Issue: google/ExoPlayer#9897

#minor-release

PiperOrigin-RevId: 426359004
2022-02-21 16:59:57 +00:00
ibaker
b4fc2e5168 Fix ForwardingPlayer @Override and @Deprecated annotations
These were messed up in 74c6ef9ba0

Also suppress deprecation warnings when we're just forwarding a
deprecated method to the delegate.

#minor-release

PiperOrigin-RevId: 426351791
2022-02-21 16:59:57 +00:00
ibaker
602e9f14d1 Mark LegacyPlayerView as deprecated
This type is still known as PlayerView in exoplayer2

#minor-release

PiperOrigin-RevId: 426348286
2022-02-21 16:59:57 +00:00
ibaker
a4f218c674 Redefine the SSAI URI format with an "ssai" scheme instead of "imadai"
This allows us to remove the IMA naming from DefaultMediaSourceFactory's
SSAI integration.

#minor-release

PiperOrigin-RevId: 426346456
2022-02-21 16:59:57 +00:00
ibaker
0e1c4106b5 Mark some unreleased IntDefs as TYPE_USE only
The longer list of targets is only necessary for backwards
compatibility with existing Kotlin code that will stop compiling
if the position of the annotation becomes 'wrong' by marking it only
TYPE_USE. Since none of these IntDefs have been released (except in
media3 alpha1) we don't need to maintain this compatibility.

Also add a comment to all the places that *do* need the longer list of
targets, in order to explain why it's there and discourage copy-pasting
when defining new IntDefs in future.

Also fix some single-element arrays to remove the array notation.

#minor-release

PiperOrigin-RevId: 426108537
2022-02-21 16:59:57 +00:00
ibaker
c8e23b491d Remove references to Player(Control)View from the dev guide
Remove most of the customisation documentation, since StyledPlayerView
isn't really designed to be customised as deeply as PlayerView.

Also remove most documentation around StyledPlayerControlView,
especially as a standalone controller class - since it doesn't work
well for this use-case.

#minor-release

PiperOrigin-RevId: 426090762
2022-02-21 16:59:57 +00:00
tonihei
4112a99f49 Ignore format changes arriving after the media has been removed.
PiperOrigin-RevId: 426089165
2022-02-21 16:59:57 +00:00
ibaker
9e3eb6c5f7 Fix parameter comments
PiperOrigin-RevId: 425874534
2022-02-21 16:59:57 +00:00