13436 Commits

Author SHA1 Message Date
tonihei
9582a9f099 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-08 17:18:32 +00:00
tonihei
3ab5437c85 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-08 17:17:32 +00:00
Rakesh Kumar
ace363e183 Fix review comments in RtpH265Reader 2022-02-08 16:41:45 +05:30
tonihei
c832bf495e Add missing calls to AnalyticsCollector
PiperOrigin-RevId: 427133919
2022-02-08 11:07:50 +00:00
tonihei
5cc3ce9a50 Remove deprecated EventListener
PiperOrigin-RevId: 427133817
2022-02-08 11:07:50 +00:00
tonihei
287182952d Fix the position of IntDefs to match TYPE_USE
#minor-release

PiperOrigin-RevId: 427131569
2022-02-08 11:07:50 +00:00
tonihei
caf62842c4 Rollback of 2a7743346c
*** Original commit ***

Rollback of 1521e50307

*** Original commit ***

Wire up MediaMetricsListener and add configuration to disable it.

The listener will automatically forward diagnostics info to the
Android platform. ExoPlayer.Builder gets a new setter that allows
to disable this feature if required.

#...

***

PiperOrigin-RevId: 427131438
2022-02-08 11:07:50 +00:00
tonihei
d807b87e34 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-08 11:07:50 +00:00
olly
1270eb012d 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-08 11:07:50 +00:00
claincly
31aa9d458d Fix profile-level setting.
On some old devices, the encoding level needs to be set with the encoding
profile, but not on newer devices.

The profile/level override is applied by following
https://developer.android.com/guide/topics/media/sharing-video

PiperOrigin-RevId: 427008536
2022-02-08 11:07:50 +00:00
olly
fab5dfa156 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-08 11:07:50 +00:00
olly
c2cb22a056 Rollback of 1521e50307
*** Original commit ***

Wire up MediaMetricsListener and add configuration to disable it.

The listener will automatically forward diagnostics info to the
Android platform. ExoPlayer.Builder gets a new setter that allows
to disable this feature if required.

#minor-release

***

PiperOrigin-RevId: 426997342
2022-02-08 11:07:50 +00:00
olly
1f7174e731 Revert of 87420e5f9bd1671cd3068185f7358f5faba53e71
PiperOrigin-RevId: 426996878
2022-02-08 11:07:43 +00:00
olly
631b107bda Revert of 9c8c0a59823e2a49451fbdf7040107c6cea43cc5
PiperOrigin-RevId: 426994820
2022-02-08 11:07:24 +00:00
olly
bc118097d8 Revert of e0bab55f12eb68073fa812c5580634d4efe32f7f
PiperOrigin-RevId: 426994559
2022-02-08 11:07:09 +00:00
samrobinson
403d92a4d4 Output from the Transformer the average audio & video bitrates.
PiperOrigin-RevId: 426956151
2022-02-08 10:27:15 +00:00
Ian Baker
77315b6596 Merge pull request #9924 from jruesga:cea708-decoder-honor-service-block-size
PiperOrigin-RevId: 426953267
2022-02-08 10:26:23 +00:00
ibaker
59958d6a16 Remove deprecated DefaultRenderersFactory constructors
#minor-release

PiperOrigin-RevId: 426938026
2022-02-08 10:25:31 +00:00
tonihei
1df5572dd2 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-08 10:24:41 +00:00
ibaker
d50a43912e Remove deprecated ProgressiveMediaSource.Factory setters
#minor-release

PiperOrigin-RevId: 426909957
2022-02-08 10:23:41 +00:00
olly
e0bab55f12 Add missing calls to AnalyticsCollector
PiperOrigin-RevId: 426892085
2022-02-08 10:22:39 +00:00
olly
9c8c0a5982 Remove deprecated EventListener
PiperOrigin-RevId: 426876984
2022-02-08 10:21:37 +00:00
olly
99f952aae5 Update final translations
PiperOrigin-RevId: 426870226
2022-02-07 11:45:15 +00:00
ibaker
4e3d15be87 Remove deprecated ActionFile and ActionFileUpgradeUtil
#minor-release

PiperOrigin-RevId: 426868933
2022-02-07 11:44:22 +00:00
ibaker
ce4225f864 Fix some missed StyledPlayerView -> PlayerView rename sites
PiperOrigin-RevId: 426868804
2022-02-07 11:43:37 +00:00
ibaker
168914256d 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-07 10:50:22 +00:00
ibaker
87420e5f9b Fix the position of IntDefs to match TYPE_USE
#minor-release

PiperOrigin-RevId: 426855255
2022-02-07 10:49:31 +00:00
ibaker
2522815d7b 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-07 10:48:39 +00:00
ibaker
01c814e2f0 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-07 10:47:50 +00:00
ibaker
8554ae5a02 Make @LogLevel public and TYPE_USE
#minor-release

PiperOrigin-RevId: 426410137
2022-02-07 10:47:06 +00:00
ibaker
6fc5f9800e 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-07 10:46:18 +00:00
ibaker
0e856402a2 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-07 10:45:27 +00:00
ibaker
14f9d9c62c 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-07 10:44:36 +00:00
ibaker
0bf21f2e20 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-07 10:43:43 +00:00
hschlueter
b3476e442a Disable fallback in tests that don't test fallback.
Fallback is only disabled for robolectric and instrumentation tests.
For MH tests, fallback is not disabled, as it may be needed due to
the broad range of devices available.

PiperOrigin-RevId: 426403167
2022-02-07 10:42:43 +00:00
olly
24749339db Support relative MPD.Location URIs
#minor-release
Issue: google/ExoPlayer#9939
PiperOrigin-RevId: 426394339
2022-02-07 10:41:54 +00:00
ibaker
8149ac8922 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-04 14:51:52 +00:00
claincly
f6baffc490 Roll forward of 2ed1deb52d.
Reason for not rolling back the rollback d68b790077: file name changed and
file content moved, the automated tool is unable to correctly apply the change.

Apply suggested AVC profile depending on the API version.

Use `AVCProfileHigh` only when there's encoder support.

PiperOrigin-RevId: 426363780
2022-02-04 14:50:44 +00:00
ibaker
9a5238b0f7 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-04 14:49:52 +00:00
ibaker
7b9eaaed14 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-04 14:49:03 +00:00
ibaker
37d47e1d13 Mark LegacyPlayerView as deprecated
This type is still known as PlayerView in exoplayer2

#minor-release

PiperOrigin-RevId: 426348286
2022-02-04 14:47:47 +00:00
ibaker
dc6bf507c7 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-04 14:46:54 +00:00
claincly
e2d4bd15cd Add option to disable encoder fallback.
We use the top priority encoder (sorted by EncoderSelector) and the requested
output format for encoding.

PiperOrigin-RevId: 426191800
2022-02-04 09:41:36 +00:00
hschlueter
7507da51a0 Make GlProgram an outer class.
This change makes GlUtil.Program an outer class named GlProgram,
and also moves private static helpers as well as the inner classes
Attribute and Uniform which were only used by GlUtil.Program to
GlProgram. Other static utility methods remain in GlUtil.

No functional changes intended.

PiperOrigin-RevId: 426119299
2022-02-04 09:40:51 +00:00
kimvde
ddfd79bb98 Use SpeedChangingAudioProcessor in Transformer
PiperOrigin-RevId: 426113559
2022-02-04 09:39:51 +00:00
ibaker
92a6cc10a4 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-04 09:38:55 +00:00
tonihei
1521e50307 Wire up MediaMetricsListener and add configuration to disable it.
The listener will automatically forward diagnostics info to the
Android platform. ExoPlayer.Builder gets a new setter that allows
to disable this feature if required.

#minor-release

PiperOrigin-RevId: 426099872
2022-02-04 09:38:03 +00:00
ibaker
8aefed20f8 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-04 09:37:13 +00:00
tonihei
530c868c17 Ignore format changes arriving after the media has been removed.
PiperOrigin-RevId: 426089165
2022-02-04 09:36:21 +00:00
claincly
7e873b5121 Improve MIME type fallback logic.
- The MIME type should ideally default to HEVC if there is an encoder for it.
- Next, check if AVC is supported.
- If there is no encoder for AVC, then we should pick an encoder in the list of
existing encoders instead of abandoning the transformation.

PiperOrigin-RevId: 425900638
2022-02-04 09:35:20 +00:00