21799 Commits

Author SHA1 Message Date
ivanbuper
d6e4642bcf Rollback of 5ab9a7856f
PiperOrigin-RevId: 710770581
2024-12-30 12:24:05 -08:00
jbibik
afd601f670 Refactor non-ripple Modifier into a separate file
Modifiers.kt will be a place for other extensions on Modifier class

PiperOrigin-RevId: 709416429
2024-12-24 15:27:21 -08:00
jbibik
6da58758a8 Add vertical videos to demo-compose
Useful for future testing of aspect ratio functionality.

PiperOrigin-RevId: 709354104
2024-12-24 08:47:42 -08:00
rohks
3b9737f88a Fix release notes based on Devsite linter warnings
PiperOrigin-RevId: 709329498
2024-12-24 06:17:43 -08:00
sheenachhabra
16617f5a8b Improve javadoc in Mp4LocationData and Mp4OrientationData class
PiperOrigin-RevId: 709061777
2024-12-23 07:57:58 -08:00
claincly
515de89973 Support MediaCodec tonemapping in CompositionPlayer
PiperOrigin-RevId: 708995517
2024-12-23 02:06:08 -08:00
sheenachhabra
f22d91d9e5 Clarify the stream closing responsibility in muxer
PiperOrigin-RevId: 708359779
2024-12-20 10:24:48 -08:00
claincly
8188f7a865 Repect Composition's HDR mode setting using OpenGL
Subsequent CLs will add support for other HDR modes

PiperOrigin-RevId: 708340216
2024-12-20 09:11:00 -08:00
rohks
5c40498054 Fix quotes around parameter name in release notes
PiperOrigin-RevId: 708334464
2024-12-20 08:47:17 -08:00
sheenachhabra
1b0e2fb75e Rename "setSampleCopyEnabled" to "setSampleCopyingEnabled" in muxer
PiperOrigin-RevId: 708322440
2024-12-20 07:57:59 -08:00
sheenachhabra
684c394019 Fix java doc of setSampleBatchingEnabled method
PiperOrigin-RevId: 708310532
2024-12-20 06:58:54 -08:00
Googler
f06bfc2e15 Log errors in BaseGlShaderProgram and QueueingGlShaderProgram.
PiperOrigin-RevId: 708297631
2024-12-20 05:59:18 -08:00
Googler
c12b1768a6 Add sample rate fallback to DefaultEncoderFactory
After this change if a sample rate is requested that is not supported by the available encoders and enableFallback is true, DefaultEncoderFactory will fall back to the encoder with the closest matching sample rate.

In the case when an encoding profile is included in requestedAudioEncoderSettings, an encoder matching that profile will continue to be preferenced.

PiperOrigin-RevId: 708295869
2024-12-20 05:50:25 -08:00
rohks
5c3c3b91f3 Remove publishing for media3-ui-compose temporarily
This is due to a missing version error for the `androidx.compose.foundation` dependency.

PiperOrigin-RevId: 707944220
2024-12-19 09:54:59 -08:00
shahddaghash
915130eb00 Add usePlatformDiagnostics in Transformer.
Added a new `usePlatformDiagnostics` in Transformer. This parameter enables/disables forwarding editing events and performance data to the platform.

This is pre-work for metrics support in Transformer. In the following CLs, metrics collection and forwarding will be implemented.

PiperOrigin-RevId: 707930368
2024-12-19 09:03:19 -08:00
ibaker
59789b7209 Fix typo in 1.6.0-alpha01 release notes
#cherrypick

PiperOrigin-RevId: 707907431
2024-12-19 07:31:52 -08:00
rohks
506bc91dd8 Bump Media3 version to 1.6.0-alpha01
PiperOrigin-RevId: 707896534
2024-12-19 06:45:57 -08:00
rohks
9d610894cf Update release notes for Media3 1.6.0-alpha01 release
PiperOrigin-RevId: 707880171
2024-12-19 05:30:04 -08:00
rohks
ca58867816 Hard-code channel count and sample rate for AMR-NB and AMR-WB
AMR-NB and AMR-WB are inherently mono, so channel count is set to 1. Sample rate is also hard-coded to adhere to codec standards.

Also removed unused parameter `hasAdditionalViews` in `StriData`.

#cherrypick

PiperOrigin-RevId: 707606245
2024-12-18 11:03:26 -08:00
sheenachhabra
44aa87c832 Extract MuxerException into a separate file
This is to avoid very long name as the FQN earlier
contained muxer 3 times

PiperOrigin-RevId: 707591813
2024-12-18 10:21:51 -08:00
shahddaghash
c3b58f2434 Bump Media3 version to 1.5.1
PiperOrigin-RevId: 707576152
2024-12-18 09:29:43 -08:00
shahddaghash
896bd0d330 Update release notes for Media3 1.5.1 release
PiperOrigin-RevId: 707558817
2024-12-18 08:25:16 -08:00
Copybara-Service
2f507650cc Merge pull request #1871 from colinkho:cmc
PiperOrigin-RevId: 707528211
2024-12-18 06:32:41 -08:00
Googler
2d37823695 Add VP9 Mp4 clip to Mp4MuxerEndToEndParameterizedAndroidTest
The dump file for VP9 mp4 clips varied across SDK versions due to inconsistent CSDs from the platform extractor. By replacing the platform extractor with `MediaExtractorCompat`, the Media3 extractor will provide consistent CSDs across all SDK versions.

PiperOrigin-RevId: 707509473
2024-12-18 05:16:55 -08:00
tonihei
1c044c98ad Formatting fixes 2024-12-18 12:58:32 +00:00
siroberts
16dcf91c1c Reduce log severity to info for unhandled media buttons
PiperOrigin-RevId: 707485315
2024-12-18 03:47:58 -08:00
Googler
6d2331fd13 Add ApvC codec support to Mp4Muxer.
PiperOrigin-RevId: 707482517
2024-12-18 03:38:20 -08:00
Googler
9b628d4542 Update Muxer Test with MediaExtractorCompact
Replace Platform extractor with MediaExtractorCompact in AndroidMuxerTestUtils.

PiperOrigin-RevId: 707469755
2024-12-18 02:50:11 -08:00
bachinger
d4f4a2c1d4 Allow the number of ad groups to grow with AdsMediaSource
This enables `AdsMediaSource` to be used with a live media
source that has a growing `AdPlaybackState` to which ad groups
can be appended.

Before this change, `AdsMediaSource` asserted that the number
of ad groups was kept the same, else an exception was thrown.
After this change, the assertion checks the validity of the
update and throws in case the update isn't considered valid.

An update is valid if ad groups are appended to the existing
`AdPlaybackState` or ads are appended to existing ad groups.
Further the `adGroupIndex` and `timeUs`of an existing ad
group can not be changed and once a media item is set for a
given ad, that media item can't be changed either.

PiperOrigin-RevId: 707244455
2024-12-17 14:10:27 -08:00
bachinger
aa2ee8f702 Add client side post roll placeholder
PiperOrigin-RevId: 707142019
2024-12-17 09:59:16 -08:00
ibaker
32ab258c43 Use Build.MANUFACTURER instead of Util alias in AudioCapabilities
It seems that changes via Robolectric's `ShadowBuild.setManufacturer()`
and similar methods don't propagate correctly (or quickly?) to these
aliases.

This change resolves a failure caused by different test ordering in
`AudioCapabilitiesTest` in order to unblock the 1.6.0-alpha01 release.
A follow-up change will migrate other usages from `Util.XXX` to
`Build.XXX`.

PiperOrigin-RevId: 707125446
2024-12-17 09:10:40 -08:00
bachinger
3dede2415d Add AdsMediaSourceFactory for HLS interstitials
PiperOrigin-RevId: 707109323
2024-12-17 08:25:58 -08:00
shahddaghash
acc41cb5f7 Add contrast effect to effect demo
Added a contrast effect and the connection needed to apply the video effects to ExoPlayer.

The effect can be applied to the video by checking the "Contrast" card, and use the slider to change the contrast value. The effects are applied when `Apply effects` button is clicked.

PiperOrigin-RevId: 707092041
2024-12-17 07:33:52 -08:00
Colin Kho
6287a22285 Added getter methods to ContainerMediaChunk & a callback method whenever a load loop is finished 2024-12-17 15:29:59 +00:00
tonihei
2d11a339de Import AudioManagerCompat and AudioFocusRequest from androidx.media
Both classes provide utilities widely used by apps that are not
yet available in Media3. This change imports the existing logic as
it is with style adjustments to the Media3 codebase.

PiperOrigin-RevId: 707067512
2024-12-17 06:14:36 -08:00
rohks
4b26eb2800 Fix lint errors
- Add required mutability flag to `ConnectionStateTest` to fix
  `Missing PendingIntent mutability flag`.
- Suppress `WrongConstant` lint error caused by Kotlin's spread operator
  not propagating the `@IntDef` annotation.

#cherrypick

PiperOrigin-RevId: 707061163
2024-12-17 05:53:19 -08:00
ibaker
601b025b3c Clarify the base of releaseTimeNs in VideoFrameMetadataListener
Also remove docs about API < 21, since the `minSdk` for the library is
now 21.

PiperOrigin-RevId: 707038503
2024-12-17 04:20:44 -08:00
tonihei
71f82df57f Switch default of async crypto mode to disabled
There are reproducible issues with codec timeouts when using
this API, so we disable it entirely until we know more about
potential fixes and where they are available.

Issue: androidx/media#1641
#cherrypick
PiperOrigin-RevId: 707025950
2024-12-17 03:25:32 -08:00
bachinger
12566a50d5 Reorder IMA samples for easier QA testing
PiperOrigin-RevId: 707014618
2024-12-17 02:33:21 -08:00
bachinger
3fe1f2a734 Add adId to AdGroup
PiperOrigin-RevId: 706761644
2024-12-16 10:47:17 -08:00
michaelkatz
d5d85558c1 Skip just-early video frames only if directed to release the frame
`MediaCodecVideoRenderer` will skip frames if a surface has not been set and video frame presentation time is early but too close to the current playback position. In the case that the `VideoFrameReleaseControl` says to `FRAME_RELEASE_TRY_AGAIN_LATER`, these frames should not be skipped.

PiperOrigin-RevId: 706711734
2024-12-16 08:05:30 -08:00
sheenachhabra
319ac2e5af Remove Parcelable interface from Metadata and Metadata.Entry
`Parcelable` is not safe for IPCs between binaries with potentially
different class definitions (e.g. two apps built from different versions
of media3).

If we get a use case to bundle metadata, then the `Metadata` and
`Metadata.Entry` classes needs to provide a `toBundle()` method.

PiperOrigin-RevId: 706678892
2024-12-16 05:58:02 -08:00
sheenachhabra
1326a92350 Do not bundle metadata when creating Format bundle
Metadata does not provide a `toBundle` method. It implements
`Parcelable` which is not safe for IPCs between binaries with
potentially different class definitions (e.g. two apps built from
different versions of media3).

If we get a use case to bundle metadata as well, then the `Metadata`
class needs to provide a `toBundle()` method.

PiperOrigin-RevId: 705920231
2024-12-13 10:12:37 -08:00
ibaker
36466cf883 Add some session methods to the stable API
This change adds a new stable overload of
`SessionToken.createSessionToken` which takes the platform `Token` type
(instead of `Parcelable`). It also stabilises
`MediaController.getCustomLayout` & the corresponding listener.

PiperOrigin-RevId: 705917161
2024-12-13 10:03:46 -08:00
dancho
72672b7f87 Implement audioNeedsEncoding based on requested settings
Do not use ForceEncodeFactory in tests

PiperOrigin-RevId: 705835243
2024-12-13 04:23:35 -08:00
bachinger
07b658a6da Ignore invalid interstitials instead of throwing
The HLS spec says so in rfc8216bis (4.4.5.1)

PiperOrigin-RevId: 705829265
2024-12-13 03:58:55 -08:00
dancho
522883bf16 Less granular skipping for HE-AAC support
PiperOrigin-RevId: 705822449
2024-12-13 03:28:51 -08:00
tonihei
3bce3af1a3 Switch play FGS exemption to use custom action instead of commands
Custom actions are more naturally associated with a user intent
than commands (that are meant to be used for automated inter-app
communication without user interaction).

PiperOrigin-RevId: 705797057
2024-12-13 01:43:21 -08:00
bachinger
83b5eb0040 Add HlsInterstitialsAdsLoader
Reads HLS interstitials information from the playlist and
populates the `AdPlaybackState` accordingly to play the ads.

An app can register a `Listener` to be informed about ad
related events.

Only VOD streams are supported and X-ASSET-LIST attibutes
are ignored with this change.

PiperOrigin-RevId: 705604201
2024-12-12 13:04:10 -08:00
jbibik
e0496ff88d [demo-compose] Initialize the Player outside of Compose
PiperOrigin-RevId: 705533932
2024-12-12 09:39:50 -08:00