14090 Commits

Author SHA1 Message Date
tonihei
57282f61ce Simplify StreamRequest.Builder to an Uri Builder and make it public
Right now, the option to build an IMA DAI URI programmatically is still
package-private. To simplify the process, we can remove the StreamRequest
wrapper and directly provide an URI builder.

The same class can provide some package-private helper methods to parse the
created URI.

#minor-release

PiperOrigin-RevId: 427445326
2022-02-21 17:05:05 +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
ibaker
94ee09a916 Remove deprecated CronetDataSource constructors
#minor-release

PiperOrigin-RevId: 427216911
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
4ff75f0247 Fix For Sample-To-Bytes Calculation In OpusDecoder
Aligning the byte size calculation with the sizes defined in opus_jni.cc
for the `outputFloat=true` case

#minor-release

PiperOrigin-RevId: 427028982
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
krocard
0fac743ee2 Split AnalyticsCollector in interface and default Impl
This will allow R8 to strip out the implementation
if it is not needed for an app.

#minor-release

PiperOrigin-RevId: 427983730
2022-02-21 17:04:13 +00:00
kimvde
62ed0d0a5d Remove Transformer deprecated methods that were never released
#minor-release

PiperOrigin-RevId: 427965501
2022-02-21 17:04:13 +00:00
tonihei
216fd6407c 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:04:13 +00:00
tonihei
4633e404fc Add missing Javadoc for AudioAttributes.
#minor-release

PiperOrigin-RevId: 427712140
2022-02-21 17:04:13 +00:00
krocard
ed111cbfaa 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:04:13 +00:00
tonihei
86d5de8adf 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:04:13 +00:00
olly
ed8f66922b Fix incorrect parameter name
PiperOrigin-RevId: 427474975
2022-02-21 17:04:13 +00:00
tonihei
c75c773a87 Simplify StreamRequest.Builder to an Uri Builder and make it public
Right now, the option to build an IMA DAI URI programmatically is still
package-private. To simplify the process, we can remove the StreamRequest
wrapper and directly provide an URI builder.

The same class can provide some package-private helper methods to parse the
created URI.

#minor-release

PiperOrigin-RevId: 427445326
2022-02-21 17:04:13 +00:00
olly
eafa537d6d Handle Choreographer.getInstance throwing RuntimeException
#minor-release

PiperOrigin-RevId: 427439588
2022-02-21 17:04:13 +00:00
tonihei
1baac238e1 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.

#minor-release

PiperOrigin-RevId: 427415349
2022-02-21 17:04:13 +00:00
ibaker
6aa1816bd3 Remove LegacyPlayerView from media3
Apps should migrate to PlayerView (called StyledPlayerView in
exoplayer2) before migrating from exoplayer2 to media3.

PiperOrigin-RevId: 427222944
2022-02-21 17:04:13 +00:00
ibaker
d6a6cbf8aa Remove deprecated CronetDataSource constructors
#minor-release

PiperOrigin-RevId: 427216911
2022-02-21 17:04:12 +00:00
tonihei
d718d964fb 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:04:12 +00:00
tonihei
34a2a6ea18 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:04:12 +00:00
christosts
1223fa23b0 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:04:12 +00:00
tonihei
11e5c67356 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:04:12 +00:00
tonihei
09ede4aa45 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:04:12 +00:00
tonihei
6cf571a43c Add missing calls to AnalyticsCollector
PiperOrigin-RevId: 427133919
2022-02-21 17:04:12 +00:00
tonihei
5d031ce892 Remove deprecated EventListener
PiperOrigin-RevId: 427133817
2022-02-21 17:04:12 +00:00
tonihei
ea5245ae2b Fix the position of IntDefs to match TYPE_USE
PiperOrigin-RevId: 427131569
2022-02-21 17:04:12 +00:00
tonihei
0949b9ff07 Rollback of 795762545b
*** Original commit ***

Rollback of d93b0093ae

*** 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:04:12 +00:00
olly
db40866174 Fix For Sample-To-Bytes Calculation In OpusDecoder
Aligning the byte size calculation with the sizes defined in opus_jni.cc
for the `outputFloat=true` case

#minor-release

PiperOrigin-RevId: 427028982
2022-02-21 17:04:12 +00:00
olly
c4a37da295 Rollback of d93b0093ae
*** 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:04:12 +00:00
olly
661449d7cd Revert of 87420e5f9bd1671cd3068185f7358f5faba53e71
PiperOrigin-RevId: 426996878
2022-02-21 17:04:12 +00:00
olly
69c7311cac Revert of 9c8c0a59823e2a49451fbdf7040107c6cea43cc5
PiperOrigin-RevId: 426994820
2022-02-21 17:04:12 +00:00
olly
c1e7192820 Revert of e0bab55f12eb68073fa812c5580634d4efe32f7f
PiperOrigin-RevId: 426994559
2022-02-21 17:04:12 +00:00