19343 Commits

Author SHA1 Message Date
bachinger
db26b378f8 Update release notes for 1.2.0-alpha02
PiperOrigin-RevId: 569161165
2023-09-28 06:29:42 -07:00
bachinger
2debf0187a Split demo service into its own module for reuse
To support Automotive with the session demo, we need a separate app module.
To do this we need to split the service into its own module and make it
usable from different modules.

PiperOrigin-RevId: 568975271
2023-09-27 15:21:23 -07:00
bachinger
0b0d02c3e4 Add isAutomotiveController and isAutoCompanionController
Issue: androidx/media#561
Issue: androidx/media#644
Issue: androidx/media#645
PiperOrigin-RevId: 568948230
2023-09-27 13:45:17 -07:00
bachinger
99086b4007 Add default implementation of Callback.onSubscribe
The library already maintains the subscribed controllers internally. This
change adds `MediaLibrarySession.getSubscribedControllers(mediaId)` to
access subscribed controllers for a given media ID.

To accept a subscription, `MediaLibraryService.Callback.onSubscribe` is
required to return `RESULT_SUCCESS`. So far, this isn't the case for the
default implementation of the library.

This change implements `Callback.onSubscribe` to conditionally
provide `RESULT_SUCCESS`. The default calls `Callback.onGetItem(mediaId)` to
assess the availability of the media item. If the app retruns `RESULT_SUCCESS`
with a browsable item, the subscription is accepted. If receiving a valid item
fails, the subscription is rejected.

Issue: androidx/media#561
PiperOrigin-RevId: 568925079
2023-09-27 12:19:34 -07:00
huangdarwin
1df2210cf4 Test: Update HDR GL tone-map fallback string.
PiperOrigin-RevId: 568920716
2023-09-27 12:05:30 -07:00
tonihei
77ba0292ad Add position interpolation to MediaControllerImplLegacy
Without this, the position won't udpate until the session sends
a new playback state.

PiperOrigin-RevId: 568889286
2023-09-27 10:23:27 -07:00
ibaker
b4771e07b5 Mark HEIF decoding as only supported on API 26+
https://developer.android.com/guide/topics/media/platform/supported-formats#image-formats

#minor-release

PiperOrigin-RevId: 568864219
2023-09-27 08:56:06 -07:00
samrobinson
4e10c41bcc Throw Exception if posting to application handler fails.
PiperOrigin-RevId: 568799683
2023-09-27 03:30:30 -07:00
michaelkatz
c12fb67468 Update dumpfile tests to only print ColorInfo fields that are set
PiperOrigin-RevId: 568789489
2023-09-27 02:34:29 -07:00
samrobinson
c03a0fb66b Limit SequenceAssetLoader variable scope.
All usages of these variables are within the SampleConsumerWrapper,
so limit them to that scope.

PiperOrigin-RevId: 568582645
2023-09-26 10:38:07 -07:00
jbibik
8b71712edc Change the DASH playback dump for webvtt in mp4 to include subtitles
#minor-release

PiperOrigin-RevId: 568567703
2023-09-26 09:48:52 -07:00
samrobinson
0b62d37425 Verify a thread is alive before sending a message to it.
PiperOrigin-RevId: 568515736
2023-09-26 06:09:19 -07:00
tonihei
69ffac28bb Set SurfaceView lifecycle to follow attachment in PlayerView
This avoids destroying the surface if PlayerView is hidden in the
view hierarchy.

PiperOrigin-RevId: 568501459
2023-09-26 04:58:11 -07:00
tonihei
212f1f8ea8 Update decode-only flag logic in non-MediaCodec-renderers
MediaCodecRenderer has already been updated to not rely on the
input stream to mark its samples as decode-only and instead use
a simple time-based comparison to achieve the same effect.

This change makes the same update for all other renderers that
either use the flag directly or forward to a "decoder" instance.

PiperOrigin-RevId: 568232212
2023-09-25 08:53:19 -07:00
claincly
884b3de69a Update VideoSink queueBitmap() to match VideoFrameProcessor
PiperOrigin-RevId: 568226567
2023-09-25 08:31:35 -07:00
bachinger
ffd7bb5639 Resolve and dispatch media button events within Media3
Before this change, media button events are routed from `onStartCommand`
of the `MediaSessionService` to  the `MediaSessionCompat`, resolved by
the legacy library to a session command called on
`MediaSessionCompat.Callback` from where the command is delegated back
to the Media3 session.

With this change the keycode is resolved directly to a Media3 command
that is sent to the session through the media notification controller
of the session.

After this change, a playback or custom command sent to the session
from a notification, either as a pending intent (before API 33) or as
a legacy session command, look the same and the caller is the
media notification controller on all API levels.

PiperOrigin-RevId: 568224123
2023-09-25 08:19:33 -07:00
bachinger
5e05e2ec22 Pass down ControllerInfo from service to session when connecting
With this change, the `ControllerInfo` passed to
`MediaSessionService.onGetSession(ControllerInfo)`
is the same instance that is passed later to all
callback methods of `MediaSession.Callback`.

PiperOrigin-RevId: 568216855
2023-09-25 07:50:12 -07:00
ibaker
d965516dc9 Fix 'unused return value' error in SubtitleViewUtilsTest
PiperOrigin-RevId: 568170342
2023-09-25 03:50:30 -07:00
michaelkatz
916b4b0ad7 Allow custom methods in Rtsp Options response public header
ExoPlayer will not fail playback if an RTSP server responds to the Options request with an unknown RTSP method request type. ExoPlayer will parse the response and just not call methods it does not know how to use.

Issue: androidx/media#613
PiperOrigin-RevId: 568152076
2023-09-25 02:15:42 -07:00
ibaker
1f86a4e48d Remove static initializer block from MediaSessionKeyEventTest
PiperOrigin-RevId: 568149422
2023-09-25 02:02:05 -07:00
huangdarwin
444cb3fb3a Test: Rename getBitmap to getBitmapAtPresentationTimeUs
PiperOrigin-RevId: 567683139
2023-09-22 12:06:57 -07:00
huangdarwin
8a40952e1b Test: Use timestamp iterator in texture output test.
Simplify tests, before we add some similar tests.

PiperOrigin-RevId: 567666340
2023-09-22 11:02:58 -07:00
huangdarwin
ba8c85a277 Compositor: Add VideoCompositorSettings to Composition.
This allows apps using Transformer to customize how a Composition is used.

PiperOrigin-RevId: 567633129
2023-09-22 08:51:35 -07:00
claincly
42d9879d47 Add missing VideoGraph javadoc param
PiperOrigin-RevId: 567621861
2023-09-22 07:58:55 -07:00
bachinger
742410d517 Use proxy controller to maintain platform session and notification
With this change, the notification controller that is connected by
`MediaNotificationManager`, is used as a proxy controller of the
System UI controller. An app can use the proxy at connection time
and during the lifetime of the session for configuration of the
platform session and the media notification on all API levels.

This includes using custom layout and available player and session
commands of the proxy to maintain the platform session (actions,
custom actions, session extras) and the `MediaNotification.Provider`.

The legacy System UI controller is hidden from the public API,
instead the app interacts with the Media3 proxy:

- System UI is hidden from `MediaSession.getConnectedControllers()`.
- Calls from System UI to methods of `MediaSession.Callback`/
  `MediaLibrarySession.Callback` are mapped to the `ControllerInfo`
  of the proxy controller.
- When `getControllerForCurrentRequest()` is called during an operation of
  System UI the proxy `ControllerInfo` is returned.

PiperOrigin-RevId: 567606117
2023-09-22 06:36:22 -07:00
tonihei
4f4335943c Cross-reference per-stream volume methods from device volume methods
The per-stream methods are generally preferred and having a reference
to them from the device-wide methods may help with discoverability.

Issue: google/ExoPlayer#11295
PiperOrigin-RevId: 567604785
2023-09-22 06:30:56 -07:00
claincly
d9563b133e Split VideoGraph interface and move VideoGraph to common
PiperOrigin-RevId: 567599249
2023-09-22 06:01:01 -07:00
tonihei
b2016cc484 Adjust externally loaded image URI MIME type definition
Adjust the Javadoc to highlight that data of this MIME type just contains a URI, not the actual image content.

And also remove the superfluous "key" part of the MIME type string that doesn't
really add information (and it's also really just an URI, not an URI key).

PiperOrigin-RevId: 567560238
2023-09-22 02:12:53 -07:00
huangdarwin
190fd7abc6 Compositor: Clarify javadoc, to mention VideoCompositorSettings.
Clarify that we use OverlaySettings to place frames over one another,
as passed in via VideoCompositorSettings

PiperOrigin-RevId: 567321828
2023-09-21 09:01:32 -07:00
ibaker
fc91ee1d7b Session tests: Add missing CountdownLatch.await()
This helps deflake this test.

PiperOrigin-RevId: 567288892
2023-09-21 06:30:24 -07:00
rohks
b4d03a9515 Bump IMA SDK version to 3.31.0
#minor-change

PiperOrigin-RevId: 567282094
2023-09-21 05:54:13 -07:00
huangdarwin
0675e48685 HDR: Update HdrMode fallback to use OpenGL tone-mapping.
OpenGL tone-mapping is more reliable and widely supported than
MediaCodec tone-mapping.

PiperOrigin-RevId: 567267389
2023-09-21 04:33:09 -07:00
christosts
603d36726f Move DefaultImageDecoderTest in tests
Move DefaultImageDecoderTest in tests since we can decode images with
Robolectric's native graphics mode.

PiperOrigin-RevId: 567259458
2023-09-21 03:53:42 -07:00
Googler
2052be0f51 Add new setIntsUniform for setting ivec uniforms in shaders.
PiperOrigin-RevId: 567102956
2023-09-20 15:50:43 -07:00
Googler
bfd4b6a188 Move GlProgram.loadAsset to Util and make it public.
PiperOrigin-RevId: 567025091
2023-09-20 11:21:55 -07:00
christosts
7b580d3cf8 Add performance playback test for video effects
PiperOrigin-RevId: 567000714
2023-09-20 10:11:08 -07:00
claincly
5ae21b453a Extract the VideoSinkProvider interface
PiperOrigin-RevId: 566972998
2023-09-20 08:31:13 -07:00
claincly
67900c3e81 Fix not setting videoEffect in CompositingVSP
The current code only set the videoEffects when CVSP is initialized, which
happens after `player.prepare()`. But it's valid that videoEffects are set
before calling `prepare()`.

PiperOrigin-RevId: 566941216
2023-09-20 06:11:32 -07:00
tofunmi
234f7525f0 Add MimeTypes.EXTERNALLY_LOADED_IMAGE
PiperOrigin-RevId: 566915171
2023-09-20 03:55:36 -07:00
ibaker
134f53bdb2 TTML: Remove unused CellResolution.columns and collapse to int rows
PiperOrigin-RevId: 566908824
2023-09-20 03:22:21 -07:00
michaelkatz
3cf9c08dca Create AudioOffloadPreferences class
Move audio offload mode related interfaces and definitions from `TrackSelectionParameters` to a new `AudioOffloadModePreferences` class.

PiperOrigin-RevId: 566905017
2023-09-20 03:02:51 -07:00
claincly
08c72b927d Use a longer timeout for running Transformer on emulators
PiperOrigin-RevId: 566688502
2023-09-19 11:19:13 -07:00
ibaker
db7c33b01c Deprecate Util.getAudioContentTypeForStreamType
This method isn't used by the library (since <unknown commit>).

It doesn't really work well (e.g. arbitrarily defaults to `MUSIC` when
`UNKNOWN` would be a better default). There's no suggested replacement.

PiperOrigin-RevId: 566676744
2023-09-19 10:42:49 -07:00
ibaker
694d040d7e Re-land: TtmlParser implementation - moved from TtmlDecoder
This change uses the new incremental overloads of `SubtitleParser` to
avoid introducing the performance regression caused by the original
change requiring all cues to be fully parsed before the first could be
shown on screen.

`TtmlDecoder` which used to be `SimpleSubtitleDecoder` will now be
called `TtmlParser` and implement `SubtitleParser` interface. For
backwards compatibility, we will have the same functionality provided
by `DelegatingSubtitleDecoder` backed-up by a new `TtmlParser`
instance.

PiperOrigin-RevId: 566671398
2023-09-19 10:25:48 -07:00
ibaker
e357d9f218 Don't call MediaSession.Callback.onPostConnect if connecting failed
I spotted that this looked wrong while investigating test various
session test failures. However, changing this logic doesn't seem to
affect the tests so I don't know if the change is an improvement or not.

PiperOrigin-RevId: 566655318
2023-09-19 09:29:40 -07:00
claincly
3cad5ed726 Remove using Consumer of ExportException in VideoGraphs
PiperOrigin-RevId: 566651267
2023-09-19 09:14:33 -07:00
ibaker
5661794a8f Update external/guava/METADATA link from master to main branch
PiperOrigin-RevId: 566645434
2023-09-19 08:55:48 -07:00
tianyifeng
ceac1f458f Add two helpful methods to FakeMediaSource for testing
PiperOrigin-RevId: 566636545
2023-09-19 08:14:19 -07:00
jbibik
39c1ac7f3a Move setAudioAttributes from ExoPlayer to Player
PiperOrigin-RevId: 566607528
2023-09-19 06:08:37 -07:00
ibaker
f35e7bdc6a Switch WebvttParserTest to use partial-output method
PiperOrigin-RevId: 566598735
2023-09-19 05:19:07 -07:00