Have the FinalShaderProgramWrapper / VideoFrameProcessor texture
output access textures provided through a texture pool, that
recycles used textures.
Also, add the TexturePool interface to generally re-use textures.
PiperOrigin-RevId: 532754377
Propagate the "end of current stream" signal directly after queueing the
last frame, instead of waiting for the next onReadyToAcceptInputFrame()
call.
PiperOrigin-RevId: 532739462
Use Kotlin Charsets from the `kotlin.text` package, the `java.nio.charset.StandardCharsets` or the `com.google.common.base.Charsets` instead.
#minor-release
PiperOrigin-RevId: 532469103
Use a non deprecated constructor that includes the option to provide a `channelDescriptionResourceId` parameter.
#minor-release
PiperOrigin-RevId: 532450975
This change enables the IMA extension to play live DASH streams
with DAI support. Samples streams can be found and played in the
main demo app.
Issue: google/ExoPlayer#10912
#minor-release
PiperOrigin-RevId: 532407708
The periodic updates are only meant to happen while we are in the
same period or ad. This was already guaranteed except for two cases:
1. The Player in a session has updated its state without yet calling
its listeners
2. The session scheduled a PlayerInfo update that hasn't been sent yet
... and in both cases, the following happened:
- The change updated the mediaItemIndex to an index that didn't exist
in a previous Timeline known to the Controller
- One of the period position updates happened to be sent at exactly
this time
This problem can be avoided by only scheduling the update if we are
still in the same period/ad and haven't scheduled a normal PlayerInfo
update already.
Since new MediaControllers may still connect to old sessons with this
bug, we need an equivalent change on the controller side to ignore such
buggy updates.
PiperOrigin-RevId: 532089328
(cherry picked from commit 96dd0ae5837a5fd82d7407623bedb5fd4d1e9252)
This is a failure only in SSIM, so it seems unlikely we'll prioritize this over
other work or bugs soon. Suppress test failures to reduce triage burden.
PiperOrigin-RevId: 532200729
Use a non-deprecated constructor that accepts additional fields(`cause`, `responseBody`) to enhance error logging.
#minor-release
PiperOrigin-RevId: 532190896
This methods allows to replace single items or a range of items directly
without using separate operations for add and remove. The advantage is
more readable code for apps and the potential for player
implementations to optimize this process (e.g. only replace values
without interrupting playback).
The current change just introduces the API with its default behavior.
The default logic will be removed again in the future in favor of
better logic in the Player implementations.
Issue: google/ExoPlayer#8046
PiperOrigin-RevId: 532151471
Allow the VideoFrameProcessor to output multiple textures at a time, so that
lifetime of textures is up to the consumer calling VFP.releaseOutputFrame.
The FinalShaderProgramWrapper also has a new maxCapacity limit added, to ensure
the a reasonable amount of textures is used and avoid using up memory.
PiperOrigin-RevId: 532094256
The periodic updates are only meant to happen while we are in the
same period or ad. This was already guaranteed except for two cases:
1. The Player in a session has updated its state without yet calling
its listeners
2. The session scheduled a PlayerInfo update that hasn't been sent yet
... and in both cases, the following happened:
- The change updated the mediaItemIndex to an index that didn't exist
in a previous Timeline known to the Controller
- One of the period position updates happened to be sent at exactly
this time
This problem can be avoided by only scheduling the update if we are
still in the same period/ad and haven't scheduled a normal PlayerInfo
update already.
Since new MediaControllers may still connect to old sessons with this
bug, we need an equivalent change on the controller side to ignore such
buggy updates.
PiperOrigin-RevId: 532089328
When exporting compositions with multiple images in a row, transformation could
get stuck if a shader was ready to accept input when end-of-stream was already
signaled and queued from upstream. Fix accounting for the downstream capacity.
Manually tested on concatenations with several images and several videos in a
row, by adding logging and verifying the capacity updates as expected across
edited media item transitions.
PiperOrigin-RevId: 532088793
In the past, the SequenceAssetLoader was released in TransformerInternal
when the export ended.
fc539da061 was made to release the SequenceAssetLoader earlier, when
loading ended. This was causing player release timeouts because the last
AssetLoader in the sequence was released before the SamplePipelines (see
0b40bc37ab for more information).
The code that was releasing the SequenceAssetLoader was first commented
out because we didn't have an understanding of what was happening.
This change removes the early SequenceAssetLoader release all together.
It doesn't have any effect as this code was already commented out.
PiperOrigin-RevId: 532065673
The output end-of-stream notification from the last shader could theoretically
arrive before the latch for detecting it is created, which might cause waiting
on the latch indefinitely. Create the latch before signaling end of stream so
that it's guaranteed to be set before the end-of-stream signal arrives.
PiperOrigin-RevId: 532056472
The name was changed in 25581384e9
and this check wasn't updated, meaning publishing no longer worked
(it didn't publish anything, just printed lots of warnings like
`Skipping task ':test-utils-robolectric:publish' as it has no
actions.`). This change means the check is now using the same
source-of-truth as the root project name, so it shouldn't go out of
sync again.
PiperOrigin-RevId: 531457952
(cherry picked from commit 4c1eb8aec7258324134913db521cd0a005ece31b)
`VERSION_INT` is quite long with several sections, and it's easy to make
a mistake when updating it - this should help since it checks it against
`VERSION`, which is more easily human readable/writable.
PiperOrigin-RevId: 529747023
(cherry picked from commit eb58d20067b258746f72127a601dd5ee40ce9c25)
Calling LibraryResult.toBundle() could have caused a CastClassException.
This was because when unbundled with UNKNOWN_TYPE_CREATOR.fromBundle(Bundle),
the valueType was set to VALUE_TYPE_ITEM_LIST for all types and the MediaItem
was attempted to be casted to a list.
PiperOrigin-RevId: 529717688
(cherry picked from commit f28a5888091c5caa685117d7a6653ae6c5a29f26)
Also change some type parameter names in `MediaSession.BuilderBase`
because `C` now clashes with the import of `androidx.media3.common.C`.
#minor-release
PiperOrigin-RevId: 529665698
(cherry picked from commit 78f20257bd9b1cdebea3f2968cb946046b1e34d8)
The current code flags a lint error:
```
Error: Call requires API level 24 (current min is 16): java.lang.Iterable#forEach [NewApi]
```
I think this is a bit confusing because this is calling the Java
[`Iterable.forEach`](https://developer.android.com/reference/java/lang/Iterable#forEach(java.util.function.Consumer%3C?%20super%20T%3E))
method which was added in Java 8 (and therefore is only available on
API 24 and up), but there is **also** a Kotlin
[`List.forEach`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/for-each.html)
method which is available in all versions of Kotlin (and therefore all
Android versions). Since this is a Kotlin file, at first glance you
would assume this is the Kotlin method - but it's not.
This also doesn't seem to be flagged by Android Studio, but is caught
by Gradle lint on the command line.
#minor-release
PiperOrigin-RevId: 529112610
(cherry picked from commit 09b474a51936c9c83df32dfcaf816e37a72552ce)
This change:
* Adds missing `@OptIn` annotation to demo app's `ErrorMessageProvider`
* Switches from `Util.SDK_INT` to `Build.VERSION.SDK_INT` in
`SampleChooserActivity` (`PlayerActivity` is already using this).
This code hasn't changed recently, and it doesn't fail on the `release`
branch, but it failed when I checked the `main` branch just now - so I
assume lint has updated to detect more cases where unstable APIs are
being used without opt-in. I suspect the difference is due to different
Android Gradle Plugin versions between the branches.
#minor-release
PiperOrigin-RevId: 529111669
(cherry picked from commit ebcdd983e2c5a9819d8a66873351bccbf93124c6)
References to the service are kept from MediaSessionStub
and from a long-delayed Handler messages in ConnectionTimeoutHandler.
Remove strong references from these places by making the timeout
handler static and ensuring ConnectedControllersManager only keeps
a weak reference to the service (as it's part of MediaSessionStub).
Issue: androidx/media#346
PiperOrigin-RevId: 527543396
(cherry picked from commit 8c262d6c072304ed9f16feca64b70a18645cc908)
To reliably reject the System UI playback resumption notification on
all API levels (specifically API 30), the backward compatibility layer
needs to return `null` for the library root.
This is not possible in the Media3 implementation. This change allows
an app to return a `LibraryResult.ofError(RESULT_ERROR_NOT_SUPPORTED)`
that then is translated to return null by the backwards compatibility
layer.
Issue: androidx/media#355
Issue: androidx/media#167
Issue: androidx/media#27
See https://developer.android.com/guide/topics/media/media-controls#mediabrowserservice_implementation
PiperOrigin-RevId: 527276529
(cherry picked from commit 7938978b5165a9cbb63a6ee1fe5209934e996c6e)
`prepare()` now logs a warning if it's called before `setPlayer()`
because it's not possible to tell if it's being called on the wrong
thread (since 3480a27994).
This change finds all the places one is called immediately after the
other and flips the order to be more correct.
Issue: androidx/media#350
#minor-release
PiperOrigin-RevId: 526582294
(cherry picked from commit 6aacbc6bbb11a5a55ec812cc93e0bb1b6810749e)
And remove unnecessary check for isDone.
Issue: androidx/media#345
PiperOrigin-RevId: 525999615
(cherry picked from commit 186f3d5c7767e65cc823846b045282c05ed30da5)
This is a bug currently, where commands are created once but never
updated again if the actions in MediaSessionCompat are changed.
PiperOrigin-RevId: 525999084
(cherry picked from commit 79fab6783e07ea594410be347c8a3d6e1124707d)
The PlayerView methods are documented to only be needed for sphrerical
playbacks, which we are not using in the session demo app.
PiperOrigin-RevId: 525986709
(cherry picked from commit 2de89ca2ce4c06bcbf9cb80dcc903f2cdd3ff733)