20272 Commits

Author SHA1 Message Date
sheenachhabra
2a5b9afb88 Update Media3 version number
PiperOrigin-RevId: 622211426
2024-04-05 10:15:38 -07:00
tofunmi
c8aaaa8a85 Ultra Hdr Test: skip devices that don't support format
PiperOrigin-RevId: 622195071
2024-04-05 09:09:16 -07:00
sheenachhabra
5fc35a6045 Update release notes for 1.3.1 bug fix release
PiperOrigin-RevId: 622189733
2024-04-05 08:50:27 -07:00
tianyifeng
28c70e5e54 Add remove(MediaSource) to BasePreloadManager
Both `remove(MediaItem)` and `remove(MediaSource)` return a boolean suggesting that whether the preload manager is holding the corresponding `MediaSource` and it has been removed.

PiperOrigin-RevId: 622185427
2024-04-05 08:27:27 -07:00
tofunmi
d4df814502 Effect: Change link to public available one in shader
PiperOrigin-RevId: 622178740
2024-04-05 08:04:01 -07:00
bachinger
08cc6e673d Add basic multi-player support to DefaultLoadControl
This change makes sure the `DefaultLoadControl` would work
when passed to multiple players. It makes sure and unit tests
that the loading state of a player is maintained for each player
that is using `DefaultLoadControl`.

The targetBufferSize of the `DefaultAllocator` is increased
linearly for each player and memory is allocated in a simple
first-come-first-serve manner.

PiperOrigin-RevId: 622126523
2024-04-05 03:27:51 -07:00
tonihei
e0fa697edf Refine "join" mode in video renderer for surface changes.
The join mode is used for two cases: surface switching and mid-playback
enabling of video.

In both cases, we want to pretend to be ready despite not having rendered
a new "first frame". So far, we also avoided force-rendering the first
frame immediately because it causes a stuttering effect for the
mid-playback enable case. The surface switch case doesn't have this
stuttering issue as the same codec is used without interruption. Not
force-rendering the frame immediately causes the first-frame rendered
callback to arrive too early though, which may lead to cases where
apps hide shutter views too quickly.

This problem can be solved by only avoiding the force-render for the
mid-playback enabling case, but not for the surface switching case.

PiperOrigin-RevId: 622105916
2024-04-05 01:50:14 -07:00
tianyifeng
8867642681 Use DefaultPreloadManager in shortform demo app
The `MediaSourceManager` is removed and its functionalities are replaced by `DefaultPreloadManager`.

PiperOrigin-RevId: 621884502
2024-04-04 09:39:23 -07:00
bachinger
617f9898c3 Add isPlaybackOngoing and stopMediaSessionService
This API additions help an app to implement the lifecycle of a MediaSessionService
properly and in consistency with the `MediaSessionService` being in the foreground
or not.

Not properly implementing `onTaskRemoved` is the main reason for crashes and
confusion. This change provides `MediaSessionService` with a default
implementation that avoids crashes of the service. This default implementation
uses the new API provided with this change just as an app can do.

Issue: androidx/media#1219
PiperOrigin-RevId: 621874838
2024-04-04 09:01:55 -07:00
kimvde
f9ed303bf1 Rollback of 85d4df2d2d
PiperOrigin-RevId: 621863325
2024-04-04 08:15:46 -07:00
kimvde
85d4df2d2d Throw if clip end position is equal to start position
Issue: androidx/media#1242
PiperOrigin-RevId: 621850154
2024-04-04 07:20:07 -07:00
sheenachhabra
d57229ad15 Import string translations
#minor-release

PiperOrigin-RevId: 621828038
2024-04-04 05:38:42 -07:00
ibaker
032cad8d09 Remove more unnecessary SDK checks now the min is 19
PiperOrigin-RevId: 621600592
2024-04-03 12:15:24 -07:00
tofunmi
896d147444 Overlay: fix the overlay anchor translation
Makes OverlayFrameAnchor works as described in the OverlaySettings documentation. Currently the code does the opposite e.g setting the anchor to (+1,-1) makes the code anchor to the top left rather than the bottom right.

PiperOrigin-RevId: 621585558
2024-04-03 11:27:43 -07:00
huangdarwin
60bb24a930 Overlay: Add javadoc for why we fly overlays vertically.
Otherwise, apps overriding BitmapOverlay.getVertexTransformation may not
realize this is being done, and may ask why bitmaps are flipped vertically from
what they expect

Reference: https://github.com/androidx/media/issues/1128
PiperOrigin-RevId: 621544348
2024-04-03 09:21:23 -07:00
ibaker
f9b1c82565 Remove complete TODO from TextRenderer
The method in question was added in 80bfa819c0

Also fix typo in another TODO lower down

PiperOrigin-RevId: 621543035
2024-04-03 09:14:54 -07:00
tonihei
6e66885311 Add additional queue add/remove/next icons
PiperOrigin-RevId: 621529526
2024-04-03 08:26:11 -07:00
ibaker
85793ea2ca Update ClippedPlaybackTest to fail on a player error (vs timing out)
Also explicitly use a synchronized list to collect cues. The previous
bare `ArrayList` was probably fine, because the `ConditionVariable`
creates a memory barrier between the main thread and the test thread,
but this seems more explicit (and any performance implications of the
synchronization don't matter for this test).

PiperOrigin-RevId: 621523824
2024-04-03 08:04:57 -07:00
kimvde
bf21f1edd5 Add methods to seek in preview audio pipeline
PiperOrigin-RevId: 621513330
2024-04-03 07:21:01 -07:00
ibaker
59710a5f81 Remove internal instructions from test-generated-goldens/README.md
PiperOrigin-RevId: 621163748
2024-04-02 07:15:35 -07:00
sheenachhabra
308c4c4fbf Take fragment duration in Ms instead of Us
PiperOrigin-RevId: 621144165
2024-04-02 05:44:46 -07:00
Googler
136baa148f Rollback of f4e444bdd2
PiperOrigin-RevId: 620271247
2024-03-29 10:07:56 -07:00
claincly
b584abfaba Clarify error message to remind user of forceAudioTrack
PiperOrigin-RevId: 620042879
2024-03-28 13:40:07 -07:00
jbibik
98b0d24379 Add a new empty Compose Demo as a skeleton
PiperOrigin-RevId: 620020593
2024-03-28 12:30:20 -07:00
huangdarwin
0730a5976b Color: Add undefined values to toString methods
This way, we can identify the undefined values later, if they're in use often.

PiperOrigin-RevId: 619967637
2024-03-28 09:54:48 -07:00
ibaker
c5e894e2d6 Ensure DownloadHelper doesn't leak unreleased Renderer instances
Issue: androidx/media#1224
PiperOrigin-RevId: 619935786
2024-03-28 08:17:18 -07:00
sheenachhabra
b4e6b9a694 Update java doc for processedInputs field
PiperOrigin-RevId: 619902389
2024-03-28 06:08:22 -07:00
tofunmi
272fada10e Signal assetloader output format in image case
the output format conatins key information about the output of the assetloader being hdr, so we must signal the output format, not the input format to the sample exporter

fixes mh ultraHdr test failures.
Also discovered images created are very device specfic so got rid of the pixel tests, we have pixel tests in the effects library that cover the same case.

PiperOrigin-RevId: 619899249
2024-03-28 05:56:39 -07:00
ibaker
b60cd2c033 Rollback of e665e2aee8
PiperOrigin-RevId: 619871653
2024-03-28 04:04:01 -07:00
kimvde
04a3889998 Reset maxPositionOfRemovedSources in DefaultAudioMixer
If the mixer is reset without resetting maxPositionOfRemovedSources and
then reused, the value of maxPositionOfRemovedSources can be outdated,
leading to an incorrect number of bytes being output by the mixer.

PiperOrigin-RevId: 619832502
2024-03-28 01:22:25 -07:00
tofunmi
828f6d87f9 Make calculateSpeedAdjustedTime() output monotonically increasing
calculate based on the output of consecutive calls rather than the speed provider speed change point to ensure the timestamps are monotonically increasing.

PiperOrigin-RevId: 619584001
2024-03-27 10:55:59 -07:00
Copybara-Service
8fe70332ee Merge pull request #1054 from jekopena:main
PiperOrigin-RevId: 619573181
2024-03-27 10:24:32 -07:00
sheenachhabra
55289b4392 Rename BasicMp4Writer to Mp4Writer
PiperOrigin-RevId: 619560211
2024-03-27 09:44:42 -07:00
ibaker
d684cdb330 Add PlayerView.setControllerAnimationEnabled(boolean)
Issue: androidx/media#1227
PiperOrigin-RevId: 619558900
2024-03-27 09:40:09 -07:00
ibaker
ebfd540817 Fix javadoc on PlayerView.setControllerVisibilityListener
#minor-release

PiperOrigin-RevId: 619536799
2024-03-27 08:20:38 -07:00
sheenachhabra
58e8300ea2 Make isMetadataSupported method public
Moved few other public methods from `Mp4Utils` class into the
corresponding classes which needs them.

PiperOrigin-RevId: 619535658
2024-03-27 08:16:37 -07:00
sheenachhabra
66547cc331 Remove Mp4Writer interface
Since the public class has already been split into `Mp4Muxer` and
`FragmentedMp4Muxer`, there is no need for having common interface
for internal implementation.

In the follow up CL `BasicMp4Writer` will be renamed to `Mp4Writer`
which is more appropriate and aligns with public class names.

PiperOrigin-RevId: 619486876
2024-03-27 04:28:07 -07:00
jbibik
5a318deb40 Downgrade kotlin plugin version to 1.9.0
Earlier upgrade in 276e0655f4 was too high, since Android Studio Iguana is still bundled with Kotlin plugin with version `232-1.9.0-release-358-AS10227`. The result of the mismatched plugin is a build failure like:

`Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is XXX`

Although according to https://plugins.jetbrains.com/plugin/6954-kotlin, the 1.9.23 is already available. So we will be able to upgrade again soon.

Version 1.9.0 is still good enough for the compose compiler to be 1.5.0+ according to https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility

PiperOrigin-RevId: 619278402
2024-03-26 12:43:44 -07:00
huangdarwin
24e1796c50 Effect: Improve setEnableColorTransfers javadoc.
PiperOrigin-RevId: 619250163
2024-03-26 11:15:34 -07:00
ibaker
7a105e0e57 Fix XingSeeker @param tags - follow-up to 4fde35c9cc
PiperOrigin-RevId: 619249887
2024-03-26 11:11:58 -07:00
tianyifeng
8f2f3bb7e4 Allow target preload status to be null to indicate not to preload
PiperOrigin-RevId: 619246259
2024-03-26 11:03:10 -07:00
kimvde
98dac54816 Fix negative position for clipped media
With this CL:
- The large timestamp offset added by ExoPlayer so that decoders
don't see any negative timestamps is removed before passing the
timestamp to the AudioGraph.
- Clipped media timestamps are offset by the clipping start position
before being passed to the AudioGraph.
- The offset added to the audio buffer timestamps is removed when
computing the audio sink position, to convert them back to the
timestamps passed by the player.

PiperOrigin-RevId: 619225990
2024-03-26 10:05:11 -07:00
sheenachhabra
8d65b75185 Rename setFragmentedMp4Enabled to setOutputFragmentedMp4
PiperOrigin-RevId: 619216854
2024-03-26 09:34:23 -07:00
sheenachhabra
8eb1390f80 Create FragmentedMp4Muxer class
This CL aims to separate Fragmented MP4 related logic in a separate public class.
Earlier all the logic was in a single class `Mp4Muxer`.

PiperOrigin-RevId: 619206661
2024-03-26 09:02:43 -07:00
tonihei
737bf08314 Don't apply performance point workaround from API 35
The workaround check is now part of CTS and we should be able
to rely on the PerformancePoints values (or at least can be sure
that they cover all CDD requirements)

#minor-release

PiperOrigin-RevId: 619201331
2024-03-26 08:42:49 -07:00
tofunmi
f4fefd19f7 Document and test multi asset ultraHDR support
PiperOrigin-RevId: 619200688
2024-03-26 08:39:44 -07:00
ibaker
d00ca1e343 Plumb MP3 average bitrate from metadata frames into Format
Issue: androidx/media#1081

#minor-release

PiperOrigin-RevId: 619185083
2024-03-26 07:40:08 -07:00
tonihei
6e0f8e3b0d Remove decode-only flag
No known component is using this flag anymore and it has been
deprecated for a while for custom renderers and decoders.

PiperOrigin-RevId: 619154299
2024-03-26 05:28:27 -07:00
tofunmi
ef2314c404 Move bitmap decoding out of datasource util
PiperOrigin-RevId: 619139208
2024-03-26 04:10:38 -07:00
tofunmi
65e94480f4 Transformer: add single-asset ultraHDR image to HLG HDR vid transcoding
PiperOrigin-RevId: 619138202
2024-03-26 04:06:41 -07:00