19501 Commits

Author SHA1 Message Date
rohks
9d3d7abdc6 Bump Media3 version numbers for 1.2.0-rc01
#minor-release

PiperOrigin-RevId: 575805495
2023-10-23 06:57:55 -07:00
rohks
7202f5d4de Update RELEASENOTES for 1.2.0-rc01 release
#minor-release

PiperOrigin-RevId: 575795800
2023-10-23 06:10:31 -07:00
michaelkatz
4515a0c3f2 Fallback to legacy sizerate check for H264 if CDD PerfPoint check fails
Some devices supporting Performance Points for decoder coverage are missing coverage over the CDD requirements for H264. For these cases ExoPlayer should fall back to legacy resolution and frame rate support checks. If there is an H264 stream evaluated as a `PerformancePointCoverageResult` of `COVERAGE_RESULT_NO`, then ExoPlayer checks for coverage of the [720p CDD requirement](https://source.android.com/docs/compatibility/10/android-10-cdd#5_3_4_h_264).

Issue: google/ExoPlayer#10898

Issue: androidx/media#693
PiperOrigin-RevId: 575768836
2023-10-23 03:49:50 -07:00
bachinger
a79d44edc5 Use MediaSessionImpl.onMediaButtonEvent() to dispatch key events
This change moves the handling of any media button event into
`MediaSessionImpl.onMediaButtonEvent(intent)`. This includes
the double click handling from `MediaSessionLegacyStub`.

The advantage is that everything is in one place which allows
to offer `MediaSession.Callback.onMediaButtonEvent` with which
an app can override the default implementation and handle media
buttons in a custom way.

Media button events can originate from various places:

- Delivered to `MediaSessionService.onStartCommand(Intent)`
  - A `PendingIntent` from the notification below API 33
  - An `Intent` sent to the `MediaButtonReceiver` by the system dispatched
    to the service
- Delivered to `MediaSessionCompat.Callback.onMediaButtonEvent(Intent)`
  implemented by `MediaSessionLegacyStub` during the session is active
  - Bluetooth (headset/remote control)
  - Apps/system using `AudioManager.dispatchKeyEvent(KeyEvent)`
  - Apps/system using `MediaControllerCompat.dispatchKeyEvent(keyEvent)`

Issue: androidx/media#12
Issue: androidx/media#159
Issue: androidx/media#216
Issue: androidx/media#249

#minor-release

PiperOrigin-RevId: 575231251
2023-10-20 08:55:15 -07:00
rohks
a8ab9e2c70 Update translations in the ui module
#minor-release

PiperOrigin-RevId: 575161190
2023-10-20 02:52:30 -07:00
simakova
beb1711d4c Remove CompositionPlayer activity from the transformer demo app
The CompositionPlayer is not ready yet.

Issue: androidx/media#741
PiperOrigin-RevId: 574859927
2023-10-19 07:19:15 -07:00
tonihei
bfd1a2724c Add missing command checks to playback resumption flow
Player methods shouldn't be called if they are not available and the
entry point to the playback resumption flow only checks
COMMAND_PLAY_PAUSE.

#minor-release

PiperOrigin-RevId: 574834148
2023-10-19 05:39:21 -07:00
Copybara-Service
5f80a47081 Merge pull request #728 from lawadr:audio-capabilities-fix
PiperOrigin-RevId: 574829263
2023-10-19 05:18:21 -07:00
claincly
2673b64371 Ignore 8k export test on incapable devices
And add a test to cover 8k transcode to lower resolution

PiperOrigin-RevId: 574809781
2023-10-19 03:58:13 -07:00
bachinger
54d5810fc3 Do not hide System UI when app rejects connection
If an app rejects the connection of the internal media notification manager
the session should behave like without the the media notification controller.
The legacy System UI controller should not be hidden or even rejected to
connect in such a case.

#minor-release

PiperOrigin-RevId: 574807901
2023-10-19 03:51:19 -07:00
tonihei
8f44916e97 Add release notes 2023-10-19 09:45:28 +01:00
lawadr
580ff6759c Fix AudioCapabilities regression
Since DEFAULT_MAX_CHANNEL_COUNT was increased from 8 to 10,
getMaxSupportedChannelCountForPassthrough always throws if its loop
enters its second iteration (channelCount of 9). This is due to
Util.getAudioTrackChannelConfig returning CHANNEL_INVALID when passed a
channelCount of 9, and setting CHANNEL_INVALID as the AudioFormat's
channel mask throws an exception.

This change skips each iteration where CHANNEL_INVALID is returned.
2023-10-19 09:17:41 +01:00
tonihei
f0cab4d03e Rollback of 64bd3bcad3
PiperOrigin-RevId: 574766164
2023-10-19 01:06:08 -07:00
Googler
cf3733765c Rollback of eafe2e35f0
PiperOrigin-RevId: 574755143
2023-10-19 00:21:43 -07:00
okunhardt
fa8dc4f49a Implement HttpEngineDataSource, a HttpDataSource using the [HttpEngine](https://developer.android.com/reference/android/net/http/HttpEngine) API.
HttpEngine was added in Android SDK 34. This DataSource is preferable to the DefaultHttpDataSource if supported as it offers better performance and more modern features.

PiperOrigin-RevId: 574594553
2023-10-18 14:17:56 -07:00
tonihei
c0759a4e62 Rollback of 4ebe630a80
PiperOrigin-RevId: 574530273
2023-10-18 11:05:49 -07:00
ibaker
aec6db77fa Add formatting to scheme list in DefaultDataSource javadoc
The current formatting makes the 'scheme' part of the list blend into
the definition, especially when the definition is multi-line.

https://developer.android.com/reference/androidx/media3/datasource/DefaultDataSource

I considered adding another level of nesting, but I think bold will
help distinguish the structure of the list without adding too much HTML
or visual whitespace.

#minor-release

PiperOrigin-RevId: 574514208
2023-10-18 10:17:58 -07:00
michaelkatz
00193e0304 Send decode-only Opus samples in bypass mode for seekPreRoll skip
As Opus decoders skip some bytes prior to playback during a seek, the renderer for bypass playback should send samples to the decoder even if they would be decode-only.

#minor-release

PiperOrigin-RevId: 574494666
2023-10-18 09:11:27 -07:00
tonihei
db86932781 Use DataSourceBitmapLoader by default
This replaces the SimpleBitmapLoader that can now be deprecated
as it's fully unused and doesn't provide any additional functionality.

#minor-release

PiperOrigin-RevId: 574454636
2023-10-18 06:18:32 -07:00
tianyifeng
43e6882fb4 Add PreloadMediaSource and PreloadMediaPeriod
The `PreloadMediaSource` has below two new public methods that suppose to be called by the app:

* `preload(long)` allows the apps to preload the source at the passed start position before playback. The preload efforts include preparing the source for a `Timeline`, creating and caching a `MediaPeriod`, preparing the period, selecting tracks on the period and continuing loading the data on the period.
* `releasePreloadMediaSource()` allows the apps to release the preloaded progress.

The `PreloadMediaPeriod` is designed to facilitate the `PreloadMediaSource` for the preloading work. It has a new package-private method `selectTracksForPreloading` which will cache the `SampleStream` that corresponds to the track selection made during the preloading, and when the `PreloadMediaPeriod.selectTracks` is called for playback, it will uses the preloaded streams if the new selection is equal to the selection made during the preloading.

Also add a shortform demo module to demo the usage of `PreloadMediaSource` with the short-form content use case.

PiperOrigin-RevId: 574439529
2023-10-18 04:57:06 -07:00
christosts
ff4ff76990 Fix MIDI decoder build.gradle
Issue: androidx/media#734

#minor-release

PiperOrigin-RevId: 574425269
2023-10-18 03:42:47 -07:00
christosts
eafe2e35f0 Move video frame release logic to VideoFrameReleaseControl
This change moves the release timestamp adjustment logic out of
MediaCodecVideoRenderer and into a standalone component, the
VideoFrameReleaseControl. The plan for VideoFrameReleaseControl is to use
it:
- from MediaCodecVideoRenderer, when ExoPlayer plays video in standalone
  mode.
- from the CompositionPlayer's DefaultVideoSink, when CompositionPlayer
  supports multiple sequences.
- (temporarily) from the CompositionPlayer's custom ImageRenderer while
  we are implementing single-sequence preview, which is an intermediate
  milestone for composition preview.
PiperOrigin-RevId: 574420427
2023-10-18 03:17:03 -07:00
Googler
ff330bd8e9 Rollback of 4ebe630a80
PiperOrigin-RevId: 574308136
2023-10-17 17:16:01 -07:00
Googler
1a43aa3602 Rollback of 64bd3bcad3
PiperOrigin-RevId: 574290408
2023-10-17 16:01:10 -07:00
christosts
61770f8a61 Publish MIDI decoder module on Maven repository
Issue: androidx/media#734

#minor-release

PiperOrigin-RevId: 574182702
2023-10-17 09:59:44 -07:00
andrewlewis
680eed52f3 Add support for flattening SEF files with H.265
PiperOrigin-RevId: 574173120
2023-10-17 09:26:14 -07:00
Copybara-Service
009d48a75e Merge pull request #491 from v-novaltd:dsparano-exo128
PiperOrigin-RevId: 574129451
2023-10-17 06:35:19 -07:00
microkatz
716240776e Updated golden file tests and readded constructor 2023-10-17 11:42:33 +00:00
microkatz
e28288f9c5 Updated golden file tests and removed deprecated ColorInfo constructor usage 2023-10-17 11:42:33 +00:00
microkatz
212e138bcf Removed deprecated ColorInfo constructor call and fixed formatting 2023-10-17 11:42:33 +00:00
microkatz
d206be74ef Updated to use ColorInfo.Builder() and formatting issues 2023-10-17 11:42:33 +00:00
microkatz
bbcf37dc9e Format with google-java-format 2023-10-17 11:42:33 +00:00
Daniele Sparano
f14732873f Change isColorValid with isDataSpaceValid 2023-10-17 11:42:33 +00:00
Daniele Sparano
1fe9c3303e Resume toLogString() in ColorInfo; revert DebugTextViewHelper 2023-10-17 11:42:33 +00:00
microkatz
c72ec74e11 Format with google-java-format 2023-10-17 11:42:33 +00:00
microkatz
ee1b1500e2 Format with google-java-format 2023-10-17 11:42:33 +00:00
Daniele Sparano
f8d98861ea Move luma and chroma bitdepths to ColorInfo class 2023-10-17 11:42:33 +00:00
Daniele Sparano
59ff0dbb85 Improve isobmff atom parsing changes 2023-10-17 11:42:33 +00:00
Daniele Sparano
d454bd0601 Set luma and chroma bit depths in Format from Rtsp 2023-10-17 11:42:33 +00:00
Daniele Sparano
fc61d96d5c Replace literal with constant variable 2023-10-17 11:42:32 +00:00
Daniele Sparano
c7fe0662ce Set bitdepths in test Format 2023-10-17 11:42:32 +00:00
Daniele Sparano
e71ca5a740 Add luma and chroma bit depths to Format, set them as signalled in containers and parameter sets 2023-10-17 11:42:32 +00:00
claincly
dc0bee9307 Perform case insensitive comparison in tests
The model is "Redmi 6A" on the device

PiperOrigin-RevId: 574103629
2023-10-17 04:37:21 -07:00
ibaker
df19097e22 Move DASH subtitle parsing release note to correct section
#minor-release

PiperOrigin-RevId: 574090381
2023-10-17 03:42:04 -07:00
bachinger
64bd3bcad3 Send media button events from service directly using MediaSessionImpl
Media button event coming from the `MediaSessionService` are delegated
to the `MediaSessionImpl` and then sent to the session by using the
`MediaSessionStub` directly instead of using the `MediaController`
API.

Splitting the `MediaController.Listener` and `Player.Listener` in
`MediaNotificationManager` got reverted, and both listener are set to the
controller as before. This reverts the change that introduced a
different timing behaviour. It still holds, that a listener
registered on a `MediaController` that calls a method like `play()` is
called immediately and before the call has arrived at the player. This
change works around this behaviour from the library side by calling
`MediaSessionStub` directly with a `ControllerInfo`.

#minor-release

PiperOrigin-RevId: 573918850
2023-10-16 13:52:30 -07:00
bachinger
d5f093f43c Send ConnectionState as in-process bundle if possible
#minor-release

PiperOrigin-RevId: 573849858
2023-10-16 10:15:34 -07:00
ibaker
681eadeb85 Test overriding resource type in RawResourceDataSource
I couldn't work out a good way to set up a test environment with
an asset in a different package, so I'm not adding a test for the
package overriding.

PiperOrigin-RevId: 573843326
2023-10-16 09:58:00 -07:00
samrobinson
fe1144487a Parse metadata from srfr atom in SMTA.
PiperOrigin-RevId: 573829216
2023-10-16 09:11:53 -07:00
bachinger
f53e1bc6f6 Only set the queue when COMMAND_GET_TIMELINE is available
Android Auto shows a queue button when the queue is not empty.
Apps were able to remove this queue button with the legacy API
by not setting the queue of the session.

After this change, removing `COMMAND_GET_TIMELINE` from the commands
of the media notification controller or the session player sets the
queue in the platform session to null.

#minor-release
Issue: androidx/media#339
PiperOrigin-RevId: 573813558
2023-10-16 08:14:38 -07:00
tonihei
00425dbe80 Expand MediaItems in session demo instead of just replacing them
When MediaItems are added from the controller, we currently completely
replace the item with the one from our database, overriding any
potential additional information the controller may have set.

Also forward the onAddMediaItems/onSetMediaItems callbacks to common
helper methods instead of redirecting them through super methods

#minor-release
Issue: androidx/media#706
PiperOrigin-RevId: 573799351
2023-10-16 07:05:28 -07:00