19697 Commits

Author SHA1 Message Date
tonihei
69884e764e Workaround layout problems with Material Design
In some contexts (e.g. BottomSheetDialogFrament), Material Design
themes will override the default of singleLine=false to true. This
causes layout problems because the forward/rewind buttons are no
longer visible with singleLine=true.

This problem can be avoided by explicitly requesting the default
value of false in our layout files.

Issue: androidx/media#511

#minor-release

PiperOrigin-RevId: 582604131
(cherry picked from commit 310e2edccac75b1ed30eb69520224cb48d1cc190)
2024-01-08 15:18:38 +00:00
ibaker
b9722764ac Update recommended way to suppress @UnstableApi errors in lint.xml
#minor-release

PiperOrigin-RevId: 582599098
(cherry picked from commit bd7615c0b83df8187daaf7e8d91eb1ce9bb35240)
2024-01-08 15:18:38 +00:00
andrewlewis
7901d1cc0a Expand frame drop workaround to Realme C11
Based on on-device testing, this device seems to have the same issue as Moto G (20) where frames are dropped despite configuring the decoder not to drop frames.

PiperOrigin-RevId: 581943805
(cherry picked from commit 330713f687d4ebaec9ee8e9aaf39db503f299ce3)
2024-01-08 15:18:36 +00:00
tianyifeng
21461abc1c Parse "f800" as channel count of 5 for Dolby in DASH manifest
Issue: androidx/media#688
PiperOrigin-RevId: 581908905
(cherry picked from commit 79711ebd3f8626d9ec31f7ac18434625caeac28f)
2024-01-08 15:08:53 +00:00
Googler
2db9da5c1d Don't crash when receiving a bad playback state
PiperOrigin-RevId: 580942377
(cherry picked from commit e79809616cd0ecb6f39cbeffdaaf143c260f64e6)
2024-01-08 14:54:21 +00:00
jbibik
f189af5632 Remove old pre-releases from the github bug template
PiperOrigin-RevId: 580554963
(cherry picked from commit 508582d56c9f8e6219d2e93f0f80ea180b4ad272)
2024-01-08 14:54:21 +00:00
tonihei
d8d552af59 Fix proguard rule to also keep referenced class name
PiperOrigin-RevId: 579234050
(cherry picked from commit bce82bdc752a8da1d7c1f78bdfb417414407849b)
2024-01-08 14:54:17 +00:00
tonihei
40094273ea Fix access to stale ByteBuffer in FfmpegAudioDecoder
The native code can now reallocate the buffer if it needs to grow
its size, so we have to reacquire a reference in the Java code to
avoid accessing a stale instance.

This fixes a bug introduced by 8750ed8de6.

PiperOrigin-RevId: 578799862
(cherry picked from commit ae6f83d298424bd405372803bb8b206fc95a2d0f)
2024-01-08 14:51:05 +00:00
ibaker
2f4d475b5c Split media1/media3 conversion methods out of MediaUtils
Android Studio removed some nested imports, but I think the extra
qualification at the usage site is actually mostly helpful, so I'm
leaving it as-is.

PiperOrigin-RevId: 578518880
(cherry picked from commit 72b7019578f3051e1bec826cf0ac401a86d818dc)
2024-01-08 14:51:05 +00:00
ibaker
07258aa373 Add warning log if DASH manifest contains incomplete ClearKey info
Unfortunately we can't fail any more obviously at this point, because
manifests often contain config for multiple DRM schemes, and when
parsing the manifest we don't know which scheme is going to be used for
playback. It would be unreasonable to fail playback due to incomplete
ClearKey config if playback was otherwise going to succeed using e.g.
Widevine.

* Issue: androidx/media#777
* Issue: androidx/media#563
* Issue: google/ExoPlayer#9169

#minor-release

PiperOrigin-RevId: 578491484
(cherry picked from commit d42c23706b615d1987f988fe219ab0fe61d44ac6)
2024-01-08 14:51:05 +00:00
tianyifeng
2237f4902d Put the custom keys in MediaMetadataCompat to MediaMetadata.extras
PiperOrigin-RevId: 578473874
(cherry picked from commit 84022eacc560b90cf34253b2470aabdf4a4b767d)
2024-01-08 14:51:05 +00:00
ibaker
fe8bbcaa12 Remove stray parentheses from release notes
PiperOrigin-RevId: 577809964
(cherry picked from commit db1ab1dcf37a484370c33b399c52f4e9569c793d)
2024-01-08 14:50:26 +00:00
ibaker
a017080353 Bump okhttp dependency to 4.12
Issue: androidx/media#768
PiperOrigin-RevId: 577208115
(cherry picked from commit e8cca688ad39590a9537c940ed0db4ca805f0fb8)
2024-01-08 13:56:59 +00:00
michaelkatz
79ce4f1c73 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
(cherry picked from commit 4515a0c3f24706a43b3247b558b14d98f2b0fce2)
2024-01-08 13:56:42 +00:00
ibaker
f6fe90f30b Clean-up multi-line strings in YAML issue templates
* If we don't want any newlines in the result, it's better to use `>`
* If we want newlines (e.g. for markdown) then we should ensure the
  string **only** contains the newlines we want, because GitHub (unlike
  other markdown renderers) preserves single newlines in the output,
  leading to ugly newlines dictated by the source.

Also remove a markdown-style link that isn't renderered as markdown.

PiperOrigin-RevId: 590309749
(cherry picked from commit 6aeaad26addee2d5793a624526d1811b8973c4ce)
2023-12-13 09:49:13 +00:00
Ian Baker
4f5038bc07 Merge branch 'release' into release-1.2.0 2023-11-17 16:13:40 +00:00
ibaker
2cc8afecc6 Remove recommendation to pin annotation-experimental to version 1.2.0
This was intended to avoid bringing in a transitive dependency on the
Kotlin standard library, but Gradle no longer flags lint errors on
`@RequiresOptIn` violations with `annotation-experimental:1.2.0` (1.3.0
is needed), making this recommendation dangerous. See also
https://issuetracker.google.com/310651921.

PiperOrigin-RevId: 582276430
(cherry picked from commit aa1ec981a3eea59f8be9d44104d0573a60816436)
1.2.0
2023-11-17 10:07:23 +00:00
ibaker
1b83c59759 Add @OptIn to fields in demo PlayerActivity now this is supported
This is possible now we use `annotation-experimental:1.3.1`.

#minor-release

PiperOrigin-RevId: 582315579
(cherry picked from commit 8d83d491f198fbe3a21181df235dfff314252929)
2023-11-17 10:07:23 +00:00
jbibik
f90726a78d Merge release notes for media3 1.2.0 stable release
PiperOrigin-RevId: 580923121
(cherry picked from commit 7ee07a5ff583e8d56e34783dc4ecfdb7d9a65ef5)
2023-11-17 10:07:20 +00:00
jbibik
a2679fba54 Bump media3 versions to 1.2.0 (stable)
#minor-release

PiperOrigin-RevId: 580856330
(cherry picked from commit 3918d3620052138f0d7718cd8076e7389222572d)
2023-11-12 20:52:00 +00:00
ibaker
7991838326 Rollback of a19f577976
PiperOrigin-RevId: 577139027
(cherry picked from commit dd6306e1ba5e860d7a267a0ad3a16eb028e8fd7a)
2023-11-06 16:51:08 +00:00
rohks
3d6ac7f6f4 Add com.github.philburk:jsyn to JAR list
#minor-release

PiperOrigin-RevId: 576148893
(cherry picked from commit 00943a0a734e55a1dbdf584c1bc139ed4db67e64)
1.2.0-rc01
2023-10-24 17:07:47 +01:00
rohks
1c54c393a0 Reorder RELEASENOTES to move unreleased changes to correct section
PiperOrigin-RevId: 575807109
(cherry picked from commit 105bdf57d80e32d8c0d8c4e2598b9c43c9461870)
2023-10-23 07:03:35 -07:00
rohks
7a2d80d87e Bump Media3 version numbers for 1.2.0-rc01
#minor-release

PiperOrigin-RevId: 575805495
(cherry picked from commit 9d3d7abdc6460bcc6f01145bcb3ce1e854b86a1a)
2023-10-23 06:55:40 -07:00
rohks
c997c71258 Update RELEASENOTES for 1.2.0-rc01 release
PiperOrigin-RevId: 575795800
(cherry picked from commit 7202f5d4de6a51b3fe23994c49ad8c15350d260c)
2023-10-23 06:07:35 -07:00
bachinger
f2cf43ccd5 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
(cherry picked from commit a79d44edc5c7fdc81120dbc9b2c89b9799b14031)
2023-10-20 08:52:55 -07:00
rohks
47a451abf7 Update translations in the ui module
#minor-release

PiperOrigin-RevId: 575161190
(cherry picked from commit a8ab9e2c70c98ee65e3b3d71806da6c9fc5c42e3)
2023-10-20 02:49:23 -07:00
simakova
9ac6f89fd7 Remove CompositionPlayer activity from the transformer demo app
The CompositionPlayer is not ready yet.

Issue: androidx/media#741
PiperOrigin-RevId: 574859927
(cherry picked from commit beb1711d4cfad51b88016bbb2b1e0f1a7945ed84)
2023-10-19 07:17:02 -07:00
tonihei
e1ad106453 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
(cherry picked from commit bfd1a2724c660de0df3c13f8394238ac6aa26e68)
2023-10-19 05:36:49 -07:00
Copybara-Service
cb67b16cac Merge pull request #728 from lawadr:audio-capabilities-fix
PiperOrigin-RevId: 574829263
(cherry picked from commit 5f80a4708165ffe977ce37400f7c8eae01142e2d)
2023-10-19 05:18:21 -07:00
bachinger
a8b0bd712a 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
(cherry picked from commit 54d5810fc353a9e7133ef929ab2f822d921070b1)
2023-10-19 03:48:16 -07:00
tonihei
2ae6b1e832 Rollback of 64bd3bcad3
PiperOrigin-RevId: 574766164
(cherry picked from commit f0cab4d03ecfa7fbd48262c332d85329736224af)
2023-10-19 01:03:49 -07:00
Googler
4c778edd4d Rollback of eafe2e35f0
PiperOrigin-RevId: 574755143
(cherry picked from commit cf3733765c2ca59ef2261b2e59b21fae5e7546eb)
2023-10-19 00:18:56 -07:00
tonihei
21cb3a6bea Rollback of 4ebe630a80
PiperOrigin-RevId: 574530273
(cherry picked from commit c0759a4e62466bbc0816737e28adf1b4a513016c)
2023-10-23 13:15:17 +01:00
ibaker
5d6fefe410 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
(cherry picked from commit aec6db77faba617dc2ab225b72c9bc3350c5b5c3)
2023-10-23 13:15:17 +01:00
michaelkatz
111ac63695 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
(cherry picked from commit 00193e0304a5ea2c20012fabf77f82f29e218372)
2023-10-23 13:15:17 +01:00
tonihei
fe60d0d7b4 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
(cherry picked from commit db86932781b4a5f377d1f4c1414c3d6a74ede174)
2023-10-23 13:15:17 +01:00
christosts
5a4adc9b25 Fix MIDI decoder build.gradle
Issue: androidx/media#734

#minor-release

PiperOrigin-RevId: 574425269
(cherry picked from commit ff4ff76990b52718f8c1e4acd9075c5c06ebee0e)
2023-10-23 13:15:17 +01:00
Googler
9ace4855e0 Rollback of 4ebe630a80
PiperOrigin-RevId: 574308136
(cherry picked from commit ff330bd8e9e925987396597cfa25f5455e1d4048)
2023-10-23 13:15:17 +01:00
Googler
fcb3315edc Rollback of 64bd3bcad3
PiperOrigin-RevId: 574290408
(cherry picked from commit 1a43aa3602075cc88c902de293cb025ff3d619cc)
2023-10-23 13:15:17 +01:00
christosts
ee83baf92e Publish MIDI decoder module on Maven repository
Issue: androidx/media#734

#minor-release

PiperOrigin-RevId: 574182702
(cherry picked from commit 61770f8a61312cacf596536b614eeb49f6abab6e)
2023-10-23 13:15:17 +01:00
Copybara-Service
29846d0167 Merge pull request #491 from v-novaltd:dsparano-exo128
PiperOrigin-RevId: 574129451
(cherry picked from commit 009d48a75e932c9e8e94a28ca2b92970cf5fe357)
2023-10-23 13:15:17 +01:00
ibaker
f290d0ef86 Move DASH subtitle parsing release note to correct section
#minor-release

PiperOrigin-RevId: 574090381
(cherry picked from commit df19097e220f7b4599830bc2a802b0951bc71cfb)
2023-10-23 13:15:17 +01:00
bachinger
8e48433be3 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
(cherry picked from commit 64bd3bcad3fa4b0e433b16d583456920afad3ce2)
2023-10-23 13:15:17 +01:00
bachinger
85167f175a Send ConnectionState as in-process bundle if possible
#minor-release

PiperOrigin-RevId: 573849858
(cherry picked from commit d5f093f43cc2bda763436d4ecf32c38c76b9418e)
2023-10-23 13:15:17 +01:00
bachinger
386d2239eb 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
(cherry picked from commit f53e1bc6f63caba7774c35aeb663b9178941faf5)
2023-10-23 13:15:17 +01:00
tonihei
e46ee01c00 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
(cherry picked from commit 00425dbe80dc9da38766f7235052c434d79724d1)
2023-10-23 13:15:17 +01:00
tianyifeng
2a7d85e065 Calculate HLS live playlist refresh interval accurately
Previously, we calculated the next playlist reload time by adding the target duration (or half of it, depending on whether there is a real update in the new playlist snapshot) from the last load completion time, which makes the reload interval as long as `targetDuration(or half of it) + lastLoadDuration`. While still complying to the standard that "the client MUST wait for at least the target duration before attempting to reload the Playlist file again", this could cause buffering when the playback position is close to the end of live window. This change is to calculate the reload interval accurately by not adding the term `lastLoadDuration`.

Issue: androidx/media#663

#minor-release

PiperOrigin-RevId: 573300009
(cherry picked from commit 58a63c82aa0b59e86a656cf6644781a1c4690c82)
2023-10-23 13:15:16 +01:00
Googler
b65136e292 Remove deprecated DownloadNotificationHelper.buildProgressNotification
Use a non deprecated method that takes a `notMetRequirements` parameter
instead.

PiperOrigin-RevId: 573252909
(cherry picked from commit 8b7ebc70320e66b6360df37c36d4cfc2fb71aa98)
2023-10-23 13:15:12 +01:00
ibaker
3244318d28 Test more URI forms in RawResourceDataSourceContractTest
PiperOrigin-RevId: 573220915
(cherry picked from commit 40459f72123cfc3bbead5dd42ce2aa3a824155b2)
2023-10-23 13:14:42 +01:00