17739 Commits

Author SHA1 Message Date
ibaker
3708e7529a Publish gradle attributes for AndroidX compatibility
These attributes are required when importing our artifacts into
androidx-main in order to generate reference documentation (JavaDoc and
KDoc).

#minor-release

PiperOrigin-RevId: 504502555
(cherry picked from commit 47349b8c4bd69415da8895061be71ef748c4a2d3)
2023-01-26 14:26:00 +00:00
tonihei
c357e67dd1 Filter available commands based on PlaybackStateCompat actions
This allows a MediaController to understand which methods calls
are available on a legacy session.

PiperOrigin-RevId: 504306806
(cherry picked from commit 067340cb0a03dede0f51425de00643fe3789baf2)
2023-01-26 14:26:00 +00:00
christosts
207d67b7af Suppress warnings in ImaUtil
ImaUtil calls VideoProgressUpdate.equals() which is annotated as hidden,
which causes lint errors with gradle.

#minor-release

PiperOrigin-RevId: 504306210
(cherry picked from commit 5f6e172c8fce652adf2c05e8f2d041c793e900ea)
2023-01-26 14:26:00 +00:00
michaelkatz
846258b69c Deduplicate onSetMediaItem handler logic
Created unified MediaUtils method to handle various logic for calling Player.setMediaItems from MediaSessionStub and MediaSessionLegacyStub

PiperOrigin-RevId: 504271877
(cherry picked from commit 7fbdbeb6cafe075f04b6a4321ef826643b3482e1)
2023-01-26 14:26:00 +00:00
christosts
2adcfd9b15 Add missing # in release notes
PiperOrigin-RevId: 504013985
(cherry picked from commit 5147011772286778e84410012a24e329fde12040)
2023-01-26 14:25:34 +00:00
samrobinson
728619018b Move audio buffer/array test utility methods to TestUtil.
PiperOrigin-RevId: 504611069
2023-01-25 20:37:34 +00:00
huangdarwin
a2521bff07 Effect: Decouple GlEffectsFrameProcessorTestRunner from GLEffects.
This is necessary in order to move HDR to SDR tone-mapping tests to transformer/mh,
and to move the test runner to androidx.media3.test-utils, which should not have to
include androidx.media3.effects.

PiperOrigin-RevId: 504607929
2023-01-25 20:33:24 +00:00
tonihei
2d7ddccebb Add missing command checks in UI module
The commands are partly checked already before enabling
features or calling player methods, but the checks were
still missing in many places.

#minor-release

PiperOrigin-RevId: 504589888
2023-01-25 20:29:23 +00:00
kimvde
5ed72efbe0 Move removeAudio/Video to EditedMediaItem
Also add a Builder to EditedMediaItem to avoid having a constructor with
many optional parameters, or a chain of constructors.

PiperOrigin-RevId: 504588544
2023-01-25 20:25:23 +00:00
huangdarwin
5d04d38d35 Test: Rename FrameProcessor Pixel Tests.
Rename tests using the action state expectation pattern.

PiperOrigin-RevId: 504546583
2023-01-25 20:21:27 +00:00
ibaker
f083ff264d Document two limitations with subtitle sideloading
#minor-release

PiperOrigin-RevId: 504517946
2023-01-25 20:17:17 +00:00
huangdarwin
4c9538bd4c Effect: Clarify OpenGL configuration.
This information may be needed for applications to create their own OpenGL contexts
and textures passed into or interacting with Effects.

PiperOrigin-RevId: 504342258
2023-01-25 20:13:10 +00:00
christosts
f86948f01c Suppress warnings in ImaUtil
ImaUtil calls VideoProgressUpdate.equals() which is annotated as hidden,
which causes lint errors with gradle.

#minor-release

PiperOrigin-RevId: 504306210
2023-01-25 20:09:04 +00:00
christosts
4c1be4c7a1 Minor fix in transforming-media.md
#minor-release

PiperOrigin-RevId: 504281747
2023-01-25 20:04:53 +00:00
huangdarwin
b2d9354951 Effect: Clarify GlEffect javadoc exception cause.
PiperOrigin-RevId: 504273335
2023-01-25 20:00:48 +00:00
samrobinson
7abbd6aa1f Use EMPTY_BUFFER in SpeedChangingAudioProcessorTest.
PiperOrigin-RevId: 504264862
2023-01-25 19:56:51 +00:00
tofunmi
fb074e1823 correct comments in fragment_shader.
PiperOrigin-RevId: 504259419
2023-01-25 19:53:00 +00:00
samrobinson
a010ebf7b6 Consolidate TransformationResult.transformationException test usage.
PiperOrigin-RevId: 504257627
2023-01-25 19:48:31 +00:00
andrewlewis
1f9a33279e Add a way to specify default buffer size
Based on experimentation, when CameraX is producing input for frame processor the buffer size is not being set to match the camera capture resolution, so the output has lower resolution than expected. Expose the default buffer size setter on `SurfaceTexture` to allow apps to process frames at full resolution for use cases like this one where the producer doesn't override the default buffer size.

PiperOrigin-RevId: 504022107
2023-01-25 19:44:29 +00:00
tonihei
e2ece2f5bc Add missing command checks in UI module
The commands are partly checked already before enabling
features or calling player methods, but the checks were
still missing in many places.

#minor-release

PiperOrigin-RevId: 504589888
2023-01-25 18:48:15 +00:00
kimvde
e8ffc7b6f8 Move removeAudio/Video to EditedMediaItem
Also add a Builder to EditedMediaItem to avoid having a constructor with
many optional parameters, or a chain of constructors.

PiperOrigin-RevId: 504588544
2023-01-25 18:47:18 +00:00
ibaker
50beec56f4 Add missing } to publish.gradle
This was missed in 47349b8c4b

#minor-release

PiperOrigin-RevId: 504548659
2023-01-25 18:46:26 +00:00
huangdarwin
ea629bec83 Test: Rename FrameProcessor Pixel Tests.
Rename tests using the action state expectation pattern.

PiperOrigin-RevId: 504546583
2023-01-25 18:45:31 +00:00
ibaker
47349b8c4b Publish gradle attributes for AndroidX compatibility
These attributes are required when importing our artifacts into
androidx-main in order to generate reference documentation (JavaDoc and
KDoc).

#minor-release

PiperOrigin-RevId: 504502555
2023-01-25 18:44:39 +00:00
huangdarwin
b359502a13 Effect: Clarify OpenGL configuration.
This information may be needed for applications to create their own OpenGL contexts
and textures passed into or interacting with Effects.

PiperOrigin-RevId: 504342258
2023-01-25 18:43:44 +00:00
tonihei
067340cb0a Filter available commands based on PlaybackStateCompat actions
This allows a MediaController to understand which methods calls
are available on a legacy session.

PiperOrigin-RevId: 504306806
2023-01-25 18:42:51 +00:00
christosts
5f6e172c8f Suppress warnings in ImaUtil
ImaUtil calls VideoProgressUpdate.equals() which is annotated as hidden,
which causes lint errors with gradle.

#minor-release

PiperOrigin-RevId: 504306210
2023-01-25 18:41:55 +00:00
huangdarwin
301683a831 Effect: Clarify GlEffect javadoc exception cause.
PiperOrigin-RevId: 504273335
2023-01-25 18:40:54 +00:00
michaelkatz
7fbdbeb6ca Deduplicate onSetMediaItem handler logic
Created unified MediaUtils method to handle various logic for calling Player.setMediaItems from MediaSessionStub and MediaSessionLegacyStub

PiperOrigin-RevId: 504271877
2023-01-25 18:39:56 +00:00
samrobinson
030edb0e4a Use EMPTY_BUFFER in SpeedChangingAudioProcessorTest.
PiperOrigin-RevId: 504264862
2023-01-25 18:39:01 +00:00
tofunmi
7864d327e8 correct comments in fragment_shader.
PiperOrigin-RevId: 504259419
2023-01-25 18:38:04 +00:00
samrobinson
18f8e9115f Consolidate TransformationResult.transformationException test usage.
PiperOrigin-RevId: 504257627
2023-01-25 18:37:02 +00:00
andrewlewis
b85109e700 Add a way to specify default buffer size
Based on experimentation, when CameraX is producing input for frame processor the buffer size is not being set to match the camera capture resolution, so the output has lower resolution than expected. Expose the default buffer size setter on `SurfaceTexture` to allow apps to process frames at full resolution for use cases like this one where the producer doesn't override the default buffer size.

PiperOrigin-RevId: 504022107
2023-01-25 18:36:02 +00:00
christosts
5147011772 Add missing # in release notes
#minor-release

PiperOrigin-RevId: 504013985
2023-01-25 18:35:01 +00:00
michaelkatz
e266051fbe Add onSetMediaItems listener with access to start index and position
Added onSetMediaItems callback listener to allow the session to modify/set MediaItem list, starting index and position before call to Player.setMediaItem(s).

Added conditional check in MediaSessionStub.setMediaItem methods to only call player.setMediaItem rather than setMediaItems if player does not support COMMAND_CHANGE_MEDIA_ITEMS

PiperOrigin-RevId: 503427927
(cherry picked from commit bb11e0286eaa49b4178dfa29ebaea5dafba8fc39)
2023-01-25 18:18:42 +00:00
bachinger
107a481356 Add the MediaSession as an argument to getMediaButtons()
Issue: androidx/media#216
#minor-release
PiperOrigin-RevId: 503406474
(cherry picked from commit e690802e9ecf96dfbb972864819a45ae92c47c90)
2023-01-25 18:18:42 +00:00
ibaker
967224c1aa Explicitly document most Player.Listener methods in terms of getters
This makes it implicitly clear that if the value of a getter changes due
to a change in command availability then the listener will be invoked,
without needing to explicitly document every command on every listener
method.

#minor-release

PiperOrigin-RevId: 503178383
(cherry picked from commit 280889bc4a5b7ddc1b1c9fe15e222cad7f2e548a)
2023-01-25 18:18:42 +00:00
tonihei
43677b95eb Add command check for metadata in DefaultMediaNotificationProvider
PiperOrigin-RevId: 503172986
(cherry picked from commit 052c4b3c1a6b72efd7fcbf433c646fed9ea91748)
2023-01-25 18:18:42 +00:00
tonihei
28e37808ed Update media controller position before pausing.
We stop estimating new position when pausing until we
receive a new position from the player. However, this
means that we will continue to return a possible stale
previous position. Updating the current position before
pausing solves this issue.

PiperOrigin-RevId: 503153982
(cherry picked from commit e961c1b5e9bb4a6f63458b1bdcb49e97f415fabf)
2023-01-25 18:18:42 +00:00
tonihei
5b18c2d89f Extend command GET_CURRENT_MEDIA_ITEM to more methods.
We currently only document it for the getCurrentMediaItem(), but
the command was always meant to cover all information about the
current media item and the position therein.

To correctly hide information for controllers, we need to filter
the Timeline when bundling the PlayerInfo class if only this
command is available.

PiperOrigin-RevId: 503098124
(cherry picked from commit f15b7525436b45694b5e1971dac922adff48b5ae)
2023-01-25 18:18:42 +00:00
tonihei
b8b6ddf347 Correctly filter PlayerInfo by available getter commands.
When bundling PlayerInfo, we need to remove information if the
controller is not allowed to access it. This was only partially
done at the moment.

PiperOrigin-RevId: 502852798
(cherry picked from commit 69cfba7c53b563577390e4074fd270f078bf6069)
2023-01-25 18:18:42 +00:00
rohks
0606ab0cbb Fix javadoc references to writeSampleData
PiperOrigin-RevId: 502821506
(cherry picked from commit 6c14ffc1ecd13393930b9f5ee7ad7a52391d0f65)
2023-01-25 18:18:42 +00:00
tonihei
2eab93d5c5 Make availableCommands known when bundling PlayerInfo
When bundling PlayerInfo, we remove data when the controller is not
allowed to access this data via getters. We also remove data for
performance reasons. In the toBundle() method, it's currently hard to
make the connection between allowed commands and filtering, because
the values are checked at a different place. This can be made more
readable by forwarding the applicable Commands directly.

The only functional fix is to filter the Timeline when sending the
first PlayerInfo after a connecting a controller if the command to
get the Timeline is not available. This also allows us to remove a
path to filter MediaItems from Timelines as it isn't used.

PiperOrigin-RevId: 502607391
(cherry picked from commit c90ca7ba5fb9e83956e9494a584ae6b0620e3b14)
2023-01-25 18:18:42 +00:00
Googler
d41eedecb4 Disables play/pause button when there's nothing to play
PiperOrigin-RevId: 502571320
(cherry picked from commit d49a16e094d6d4bde0d1dc1ec42876c156b9c55a)
2023-01-25 18:18:42 +00:00
christosts
dd462e8cdb Filter what PlaybackStateCompat actions are advertised
PlayerWrapper advertises PlaybackStateCompat actions to the legacy
MediaSession based on the player's available commands.

PiperOrigin-RevId: 502559162
(cherry picked from commit 39f4a17ad4ac3863af22e12711247c7a87b8613e)
2023-01-25 18:18:42 +00:00
tianyifeng
79fd80f8b0 Post notification for session app when FgS starting exception is caught
PiperOrigin-RevId: 502407886
(cherry picked from commit 6ce3421ca750109acfea35029260dc3f169a1a40)
2023-01-25 18:18:42 +00:00
bachinger
818ce7271e Clarify what default settings are being used for SSAI AdsLoader
PiperOrigin-RevId: 502388865
(cherry picked from commit abe11c88ecdfe56ca31d3bffe1dd8fce6fb293af)
2023-01-25 18:18:42 +00:00
tonihei
903915de3d Fix command check in MediaControllerImplBase
The command check for setDeviceMuted was wrong.

PiperOrigin-RevId: 502355332
(cherry picked from commit cfcce9aec9d92a7067f07b2d9c00d705df0368ac)
2023-01-25 18:18:42 +00:00
tonihei
24b0367374 Add missing command checks to MediaSessionLegacyStub and PlayerWrapper
This player didn't fully check all player commands before calling the
respective methods.

PiperOrigin-RevId: 502353704
(cherry picked from commit a2a44cdc02abadd473e26e1fd9f973210d4c5f0e)
2023-01-25 18:18:42 +00:00
tonihei
55903af2f8 Remove unneccesary parameter taking Player.Command
The method to dispatch actions in MediaControllerImplBase takes
a Player.Command, but the value is only used to check if we
are setting a surface and need to handle the special blocking
call. This can be cleaned up by removing the parameter and calling
a dedicated blocking method where needed. This also ensures we
have to mention the relevant Player.Command only once in each
method.

PiperOrigin-RevId: 502341862
(cherry picked from commit 664ab72d090196625b5f533e9f0a2112951c5741)
2023-01-25 18:18:41 +00:00