19477 Commits

Author SHA1 Message Date
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
ibaker
92a3f3a8cd Update WebvttParser to implement new partial-output method
This requires adapting the 'to `CuesWithTiming` list' logic to work with
the new partial-output API, and that needs a private method so it's no
longer a good fit for a default method on `Subtitle` - hence moving it
to a new utility class.

Also update the implementation to never return `UNSET` duration (this is
an equivalent change to the `SsaParser` change in 9631923440).

PiperOrigin-RevId: 566598094
2023-09-19 05:15:08 -07:00
claincly
24e700c216 Decouple output size listener and setting output surface
This is because `onOutputSizeChanged()` should in theory be called on the
listener executor.

PiperOrigin-RevId: 566591784
2023-09-19 04:43:18 -07:00
jbibik
0c918d2c47 Fix ErrorProne lint actionable items
PiperOrigin-RevId: 566571653
2023-09-19 03:01:20 -07:00
huangdarwin
93d06180ef Compositor: Remove obsolete TODO
PiperOrigin-RevId: 566327798
2023-09-18 09:39:29 -07:00
rohks
fe199455e7 Add QuickTime (Classic) support to Mp4Extractor
PiperOrigin-RevId: 566272132
2023-09-18 05:29:29 -07:00
ibaker
2c0d9ba4c3 Rollback of d58f5fdf7d
PiperOrigin-RevId: 566258299
2023-09-18 04:12:21 -07:00
tonihei
f89053dbb0 Change UI module documentation link
PiperOrigin-RevId: 566257915
2023-09-18 04:09:46 -07:00
samrobinson
c4fb755283 Open progress conditionVariable when quitting internal thread.
If getProgress is blocking whilst the internal thread calls endInternal
(for error or success), the condition is never opened. Related to this,
onCompleted and onError are therefore never surfaced to the app.

progressState is accessed from application and internal threads, so
should be marked volatile to prevent a thread caching the value.

PiperOrigin-RevId: 565720184
2023-09-15 10:50:07 -07:00
claincly
fef16b05d9 Fix flaky test becasue ExtTexMgr is not using emulator settings
When running on emulators, ExternalTextureManager needs a longer timeout for
forcing EOS, but we didn't catch a device name running on blaze: `generic_x86`

PiperOrigin-RevId: 565513152
2023-09-14 16:45:38 -07:00
huangdarwin
c77b8c8479 Compositor: Split out OpenGL drawing logic into inner class.
Organize logic a bit by splitting logic about how we draw using OpenGL onto a
texture, out from the larger class, which has lots of logic discussing how we select
frames and streams.

No functional change intended, but a few method calls are shuffled around to
simplify things.

PiperOrigin-RevId: 565426225
2023-09-14 11:26:14 -07:00
tofunmi
16b0ea850f Support multiple streams in the ImageRenderer
PiperOrigin-RevId: 565410924
2023-09-14 10:37:58 -07:00
huangdarwin
5ef5d46708 Compositor: Move Settings to DefaultVideoCompositor.
This previously was in the VideoCompositor class, but wasn't
referenced at all from that interface.

PiperOrigin-RevId: 565409646
2023-09-14 10:33:25 -07:00
sheenachhabra
03b793e2ee Read muxedPartialVideo only in MUXER_MODE_MUX_PARTIAL_VIDEO mode
When we switch from MUXER_MODE_MUX_PARTIAL_VIDEO to MUXER_MODE_APPEND_VIDEO
`muxedPartialVideo` will already be `true` so `endTrack` method will pass
through this `if(muxedPartialVideo)` check which is incorrect.

PiperOrigin-RevId: 565398117
2023-09-14 09:54:25 -07:00
ibaker
d58f5fdf7d Upgrade Guava dependency to 32.1.2
Android's version of Guava was upgraded in http://r.android.com/2731599

PiperOrigin-RevId: 565396612
2023-09-14 09:50:10 -07:00
sheenachhabra
dc865e6e98 Return TIME_UNSET for last sync sample if there is no video track
PiperOrigin-RevId: 565395263
2023-09-14 09:44:42 -07:00
huangdarwin
98009d396a Compositor: Document VideoCompositor interface thread safety.
PiperOrigin-RevId: 565388982
2023-09-14 09:22:08 -07:00