When the media3 modules are referred from an external project and
gradle.ext.androidxMediaModulePrefix is specified, build error occurs
like the following.
> gradle.ext.androidxMediaModulePrefix = "media-"
> A problem occurred evaluating project ':media-lib-common'.
> > Project with path ':media-media-lib-cast' could not be found in project ':media-lib-common'.
As you can see, the build script of the common module is trying to
use an incorrect named project which has duplicated prefixes.
To avoid the `MediaPeriodQueue`to discard the reading period, we can set the next ad of an ad group early and then (possibly) only change it's duration once we receive the actual duration. This way we avoid a rebuffering as a result of the reading period being discarded.
The change also takes care to properly set ad break and their durations when we join the live stream at the moment when an ad is playing.
PiperOrigin-RevId: 423163467
Simplifying and clarifying variables, and adding comments.
Tested by confirming demo-gl and demo-transformer both
correctly display videos
PiperOrigin-RevId: 421792079
The existing wording would be correct if prefixed with
"Returns false if [...]", but it seems confusing to a document a boolean
method in terms the condition it returns false - so I reworded it in
terms of when it returns true.
#minor-release
PiperOrigin-RevId: 421682584
The common module now defines all other released targets as constraints,
which ensures they must have matching versions. As all other libraries
indirectly depend on the common module, this declaration is only needed
in here.
PiperOrigin-RevId: 419776578
This involves stabilising AdsLoader and ImaAdsLoader, as well
as (Default)MediaSourceFactory and the following methods on
ExoPlayer.Builder:
* setMediaSourceFactory
* setAdsLoaderProvider
* setAdViewProvider
Most of ImaAdsLoader.Builder and (Default)MediaSourceFactory remain
unstable for now.
PiperOrigin-RevId: 417814106
For the media3 codebase the timeline images need to be under the common module.
Verified results in an empty commit for ExoPlayer GitHub.
PiperOrigin-RevId: 416850853
UnsupportedEglVersionException() is only used once, and seems a bit too
specific for Transformer. Also, it's possible for eglCreateContext to fail for
other reasons besides lack of support, so it wasn't always accurate when
thrown.
It is possible for devices not to support EGL version 2.0 though, per
https://source.android.com/devices/graphics/implement-opengl-es, which doesn't
specify the EGL version that must be supported.
PiperOrigin-RevId: 415489396
*** Original commit ***
Make audio track min buffer size configurable.
Move the code in its own class as DefaultAudioTrack
is getting very big. It also help for testability.
The new class is easily configurable and highly tested.
Manual test was used to catch any regression.
https://github.com/google/ExoPlayer/issues/8891
***
PiperOrigin-RevId: 415469179
Refactor GlUtil.java to be a bit more readable. Also, reorder, inline, and
rename a few things. Refactoring change only. No functional changes intended.
PiperOrigin-RevId: 415283874
Move the code in its own class as DefaultAudioTrack
is getting very big. It also help for testability.
The new class is easily configurable and highly tested.
Manual test was used to catch any regression.
https://github.com/google/ExoPlayer/issues/8891
PiperOrigin-RevId: 415268938
The new field matches the platform's
AudioAttributes.getSpatializationBehavior() API added in Sv2. At the
moment, the platform API is called via reflection, until Sv2 is released
and the compile SDK target can be increased to 32.
PiperOrigin-RevId: 414406126
When calling Android's Log class directly, there's a LongLogTag
lint check that detects tags over the 23 char limit, however it
cannot detect long log tags in ExoPlayer due to the way that we
log via our own Log class. This commit adds @Size annotations to
enforce the same rule.
PiperOrigin-RevId: 413976364
Allowing duplicate groups caused some other code working with the
array to use reference equality comparison. This is error-prone,
easily forgotten (e.g. when using the TrackGroups in a map) and
causes bugs when TrackGroups are serialized to disk or to another
process.
All TrackGroups created by ExoPlayer are already unique and custom
code creating TrackGroupArrays with identical groups can easily
distringuish them by adding an id to each group.
Issue: google/ExoPlayer#9718
PiperOrigin-RevId: 413617005
This allows to give TrackGroups an identifier. The underlying goal is
to provide a way to make otherwise identical TrackGroups
distinguishable.
Also set this id in all internal sources that may produce identical
TrackGroups in certain edge cases.
Issue: google/ExoPlayer#9718
PiperOrigin-RevId: 413430719
This is already called in GlUtil.Program().
Tested by confirming that the demo-gl target still runs as expected.
Refactoring change only. No intended functional changes.
PiperOrigin-RevId: 412308564
And also tweak existing role flag logic to strictly prefer perfect
matches over partial matches.
Caveat: Video role flags only supported for fixed track selections
(same issue as Issue: google/ExoPlayer#9519).
Issue: google/ExoPlayer#9402
PiperOrigin-RevId: 412292835
This inheritance is really confusing because ExoPlayerImpl is not
a full Player interface implementation. It also claims to be an
ExoPlayer implementation in the Javadoc which isn't true in its
current state.
Removing the inheritance also allows to clean up some unused methods.
PiperOrigin-RevId: 411756963
Before this change ExpPlayerImplInternal dropped a change of the playing period when a change in the timeline occurred that actually changed the playing period but we don't want to update the period queue. This logic also dropped the update of a skipped server side inserted preroll ad for which we want the periodQueue to 'seek' to the stream position after the preroll ad and trigger a SKIP discontinuity.
This change now introduces an exception so that a skipped SSI ad is still causing an update in the period queue which leads to a 'seek' and a discontinuity of type SKIP.
PiperOrigin-RevId: 411607299
Document that apps should retain `GlUtil.Program` while the program is in use,
and keep a reference to attributes/uniforms within the program to make sure
they don't get GC'd causing any allocated buffers passed to GL to become
invalid.
Tested manually by running gldemo and transformer.
PiperOrigin-RevId: 411516894
The player will not play ads in final states (played, skipped, error)
again. To allow ads loader customizations to play ads again, we can
add a method that resets the state back to available or unavailable
(depending on whether we have the URI for the ad).
Issue: google/ExoPlayer#9615
PiperOrigin-RevId: 411042842
Populate ICY headers into MediaMetadata so that they can
propagate to the app via AnalyticsListener#onMediaMetadataChanged().
This change copies IcyHeaders.name into MediaMetadata.description
and IcyHeaders.genre into MediaMetadata.genre.
Note: MediaItem.metadata maintain their precedence and overwrite any
ICY headers parsed.
Issue: google/ExoPlayer#9677
#minor-release
PiperOrigin-RevId: 410495676
The main point of the IDLE state is that the player is not holding
resources. Clarify this in the documentation of STATE_IDLE, prepare and
stop.
PiperOrigin-RevId: 409950785
This method is helpful when iterating the list of track overrides
to figure out which type the override applies to.
Issue: google/ExoPlayer#9665
PiperOrigin-RevId: 409108977
And in a couple of related places.
This is for consistency with the rest of the codebase where
we exclusively use indices.
#minor-release
PiperOrigin-RevId: 408273372
* Remove GlUtil.Program String[] constructor to unify and just use the
String constructor.
* Add getAttributeArrayLocationAndEnable() to simplify things a tiny bit.
* Increase usage of constant values.
PiperOrigin-RevId: 407570340
Where this introduced an inconsistency (e.g. assigning to something
called `windowIndex`), I generally renamed the transitive closure of
identifiers to maintain consistency (meaning this change is quite
large). The exception is code that interacts with Timeline and Window
directly, where sometimes I kept the 'window' nomenclature.
#minor-release
PiperOrigin-RevId: 407040052
The video scaling mode and stream type defines a default constant
that needs to be added to the IntDef definition to be assignable.
PiperOrigin-RevId: 406835696