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.
#minor-release
PiperOrigin-RevId: 427947028
For when a track is both encrypted and has supplemental data, the sample size will be equal to `block sample size - encryption data size`.
PiperOrigin-RevId: 427807612
We have seen devices running on API21/23 fail transcoding because of setting
encoding profile/level.
Some devices (ale-123/nexus 7) on API21 returns ENOSYS (Function not
implemented) when being configured with a profile setting. (although API21
introduced the capability of setting encoding profile)
Some devices (nexus 5) on API23 fails configuration with a specific parameter
set, despite advertising support for it.
Not setting the baseline profile has no effect on encoding, because when not
set, the encoding will pick a suitable profile to use. Since baseline is
the lowest possible profile, the auto-picked value can't be worse than
baseline.
Ref: b/218696352
PiperOrigin-RevId: 427792124
On some Android devices, the return value of
```
MediaCodecInfo.getCapabilitiesForType(mimeType).profileLevels
```
contains one entry for each encoding profile, like <profile, maxSupportedLevel>
but on some other devices, there are multiple entries for the same profile,
like <HIGH_PROFILE, LEVEL1>, <HIGH_PROFILE, LEVEL2>, <HIGH_PROFILE, LEVEL3>,
where we need to iterate through all the entries and find the max.
PiperOrigin-RevId: 427727030
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
When a asset contains multiple cc embedded tracks, current Cea708Decoder service
block parsing logic is discarding all the data in that frame.
For example, a manifest with 2 embedded CEA-708 close captions tracks:
<Accessibility schemeIdUri="urn:scte:dash:cc:cea-708:2015" value="1=lang:eng;2=lang:spa"/>
when the spanish track is selected (service number 2), when processing the
following CEA-708 frame:
FC9420FD2062FF0829FE8CFCFE9818FEE332FE731FFE1042FE2062FE0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000FA0000
the frame can be descomposed as:
FF0829 FE8CFC FE9818 FEE332 FE731F FE1042 FE2062 FE0000
08 (00 001000) 0 (sequence) 8 (frame size)
298CFC9818E332731F10 422062 0000
=====
29 (001 01001) 1 (service number) 9 (service block length)
8CFC9818E332731F10
42 (010 00010) 2 (service number) 2 (service block length)
2062
0000 Null block service
The current processCurrentPacket logic will discard the whole frame is discarded
because the first service number found in the frame belongs to service number 1,
which is not the one we are currently looking for.
This commit modifies the processCurrentPacket decoding logic, to take into
account all service blocks available in the frame, by iteraring over the
full frame data and skipping those service blocks we are not interesting in.
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
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
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
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
With this change, MediaCodecAudioRenderer always configures MediaCodec
with max output channels set to 99 on API 32+.
#minor-release
PiperOrigin-RevId: 427192801
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
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
*** Original commit ***
Rollback of 9b8ed581d0
*** Original commit ***
Add missing imports to ExoPlayerImpl
These were missed in 3bb0210d22
#minor-release
***
***
PiperOrigin-RevId: 427131696
*** Original commit ***
Rollback of 08c5b1cb0a
*** 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
*** 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
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
*** 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
*** 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
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
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
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
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
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
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
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