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)
If the limited number of input buffers causes reading of all samples except the last one conveying end of stream, then the last frame will not be rendered.
PiperOrigin-RevId: 525974445
(cherry picked from commit affbb7c57e73eb4f4f654f224c477fdd2e3ac9f2)
When a `MediaButtonReceiver` is found in the manifest, the library
can implement the contract of SystemUI to signal that the app wants
a playback resumption notification to be displayed.
And, vice versa, if no `MediaButtonReceiver` is in the manifest, the
library will signal to not show the notification after the app has been
terminated.
#minor-release
PiperOrigin-RevId: 531516023
*** Original commit ***
Rollback of 65d5132f76
*** Original commit ***
Create InAppMuxer in transformer
To use the InAppMuxer, the client needs to pass InAppMuxer Factory.
***
***
PiperOrigin-RevId: 531470081
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.
#minor-release
PiperOrigin-RevId: 531457952
Until the linked bug is fixed, relax constraints to allow this one device to
pass, to suppress failures and avoid triage toil.
PiperOrigin-RevId: 531259233
An app must only have a single service in the manifest that is either
exposing `MediaLibraryService.SERVICE_INTERFACE` or
`MediaSessionService.SERVICE_INTERFACE`. Hence the component name found by
querying the package manager for a service never returns a different result
when queried again.
The static `MediaSessionImpl.serviceComponentName` can hence be removed
and the package manager queried again when a second session instance
is created.
#minor-release
PiperOrigin-RevId: 531210456
This change adds end-to-end Robolectric playback tests which handle
the scenario the player is playing audio via passthrough and
AudioTrack raises the ERROR_DEAD_OBJECT error upon which the player
attempts to recover by switching to another audio format.
PiperOrigin-RevId: 531180183
The texture input tests in TransformerEndToEndTest were not passing on
Pixel 7. Implemented a fix and fixed other minor threading issues I
spotted while looking at the code.
PiperOrigin-RevId: 531141659
*** Original commit ***
Create InAppMuxer in transformer
To use the InAppMuxer, the client needs to pass InAppMuxer Factory.
***
PiperOrigin-RevId: 531056436
Tone-mapping an HDR video with MediaCodec on sm-s908u1 was timing out.
The reason for that is that the decoder was dropping frames, and the
ExternalTextureManager was therefore never propagating the end-of-stream
signal.
There was already a workaround for a similar issue but restricted to
sm-f936b. Removed the model check as the bug is probably present on more
devices.
PiperOrigin-RevId: 530639437
The session activity is already sent to the controller with the
`ConnectionState` when it connects. This change adds the ability to update the
activity.
This allows an app to change the intent that is used to open an activity
for the notification. An app is likely to want to change the session activity
just before the session is released. This allows to use a different activity or
more importantly the back stack of the activity for while the app is running
and when used for the playback resumption notification.
PiperOrigin-RevId: 530627102
Exceptions thrown when switching AssetLoader were not reported through
the error listener. Therefore, the resources were not released and the
export was not ending.
PiperOrigin-RevId: 530626300
If tone-mapping was requested for a device supporting HDR encoding,
isToneMapped was false in VideoSamplePipeline.EncoderWrapper. This was
causing the encoder to expect HDR.
Also did some renamings to improve readability
PiperOrigin-RevId: 530584010