20304 Commits

Author SHA1 Message Date
Hubert Mazur
e41f76ea85 Introduce a new optional argument for repeat mode
Add a new string command line optional argument to allow the playback
to run in loop. This would help to use the app in the automated video
tests. The change does not enable the option view for switching the loop
mode in the UI as providing an extra argument implies force, not
optional, loop playback. The extra option is provided with "repeat_mode"
key and one of the possible modes can be specified: NONE|ONE|ALL. The
available options correspond to the Player API to ensure compability.
2024-04-15 10:54:49 +02:00
kimvde
71e7e0f2cf Make VideoFrameProcessor.flush() more resilient
Allow flush to be called before registerInputStream. It's less error
prone to allow methods to be called in any order.

PiperOrigin-RevId: 624873772
2024-04-15 01:43:13 -07:00
kimvde
b7a92ce47a Always set sink provider offset in onReadyToInitializeCodec
Before this CL, the offset was set:
- in onPositionReset for composition preview
- in onReadyToInitializeCodec for ExoPlayer
The code flow is easier to reason about if the path for both use cases
is as shared as possible.

PiperOrigin-RevId: 624870150
2024-04-15 01:29:45 -07:00
kimvde
df3c245250 Remove need to call setVideoEffects before initialize in sink provider
PiperOrigin-RevId: 624869759
2024-04-15 01:26:49 -07:00
kimvde
fa0fb38ca6 Handle clip start position equal to end position in Transformer
After this CL, Transformer will throw if the clipping start and end
positions are the same because MediaMuxer doesn't support writing a
file with no samples. This should work once we default to the in-app
muxer.

Issue: androidx/media#1242
PiperOrigin-RevId: 624861950
2024-04-15 00:53:38 -07:00
ibaker
c151d13a1d Fix Kotlin "local dependency" instructions
The previous syntax doesn't seem to work. I assume I tested it when I
wrote 2eafa570e9,
so maybe it's stopped working since? Or maybe I'm wrong and it never
worked. This syntax was originally proposed in Issue: google/ExoPlayer#6339 and
seems to work today.

PiperOrigin-RevId: 624161848
2024-04-12 06:48:26 -07:00
huangdarwin
25e99af9e7 More strongly discourage use of DebugSurfaceView
This was always intended as a debug API only, but its inclusion in media3.common and public visibility has led to partners sometimes experimenting with this API and complaining when it doesn't work as expected.

PiperOrigin-RevId: 624158798
2024-04-12 06:34:06 -07:00
Copybara-Service
f13c879cd0 Merge pull request #1255 from phcannesson:fix-cast-media-item-conversion
PiperOrigin-RevId: 624147863
2024-04-12 05:45:50 -07:00
Marc Baechinger
5788286b68 add regression test for DefaultMediaItemConverter 2024-04-12 14:16:24 +02:00
tofunmi
1f40451631 UltraHDR: use HdrCapabilitiesUtil to assume device supports hdr editing
PiperOrigin-RevId: 624122752
2024-04-12 04:00:58 -07:00
bachinger
fc1d60beb9 Do not set a duration for live streams
A live window with changing duration can't be properly
displayed in a media notification. The duration constantly
changes and creates a nervous jumping seekbar that is not
really useful.

This change sets the duration for live streams to `C.TIME_UNSET`
when publishing the player state to the platform session. This
way no duration is sent to the platform session which prevents
media controls from drawing a seekbar.

Issue: androidx/media#1256
PiperOrigin-RevId: 624112541
2024-04-12 03:14:41 -07:00
claincly
8ba44ad2b1 Use Builder in deprecated constructors
PiperOrigin-RevId: 623919957
2024-04-11 13:21:32 -07:00
claincly
b1127ed735 Add support for codec importance
Set an importance value when configuring the codec in `Codec.Factory`,

PiperOrigin-RevId: 623902251
2024-04-11 12:19:29 -07:00
tofunmi
a154c98faa Fix test setup for exportUltraHdrImageThenHdrVideo_exportsHdr
make sure compostion.experimentalSetRetainHdrFromUltraHdrImage(true) so that we get hdr output

PiperOrigin-RevId: 623773784
2024-04-11 03:44:53 -07:00
kimvde
0b9180aa4f Clean-ups in VideoSinkProvider Javadoc
PiperOrigin-RevId: 623737397
2024-04-11 00:54:59 -07:00
huangdarwin
47964ff696 Make a method static
This methods doesn't need to be non-static, and can have less state assumed if static

PiperOrigin-RevId: 623466017
2024-04-10 05:47:37 -07:00
ibaker
556ddf4b30 Remove SVG link TODOs now exoplayer2 is no longer published
This removes the TODOs without updating the links, because the
DAC-hosted images are not co-located with the hosted javadoc (unlike
when these images were referenced on exoplayer.dev before 10342507f7),
and therefore we would need to include the full path anyway, at which
point it seems clearer and more robust to keep using a fully-qualified
URL with the domain too.

PiperOrigin-RevId: 623452217
2024-04-10 04:40:33 -07:00
Googler
d71e062780 Add recommendation on setting frame rate for images
PiperOrigin-RevId: 623214178
2024-04-09 10:43:13 -07:00
bachinger
5a84e09a0e Use zero offset when delegating EMSG sample data
When delegating EMSG samples in `HlsSampleStreamWrapper`,
the offset passed into `sampleMetadata(..)` of the delegate
`TrackOutput` must be zero because it is called immediately
after `sampleData(..)` is called.

The condition to trigger this issue is that more than one
metadata samples are pending in `pendingMetadataSampleInfos`
of `FragmentedMp4Extractor` which produces non-zero offsets.

Issue: androidx/media#1002
Issue: androidx/media#1203
PiperOrigin-RevId: 623210835
2024-04-09 10:32:35 -07:00
huangdarwin
24e92bb04f Update TODO link for mastering luminance
PiperOrigin-RevId: 623186293
2024-04-09 09:13:17 -07:00
michaelkatz
2622e566d3 Version bump to media3:1.4.0-alpha01
#minor-release

PiperOrigin-RevId: 623185060
2024-04-09 09:09:22 -07:00
Marc Baechinger
14fb3860e0 Update release notes 2024-04-09 17:35:40 +02:00
Paul-Hubert Cannesson
2e90d1d7c6 Fix album title metadata in media item conversion 2024-04-09 17:11:22 +02:00
samrobinson
81b9739bda Consolidate dump files for item effect vs composition effect.
PiperOrigin-RevId: 623161140
2024-04-09 07:33:38 -07:00
michaelkatz
2c015a5417 Update RELEASENOTES for 1.4.0-alpha01
#minor-release

PiperOrigin-RevId: 623158370
2024-04-09 07:20:18 -07:00
samrobinson
24b86e73cb Group together PCM audio samples by fixed size in CapturingMuxer dumps.
Reduces flakiness of tests that assert on PCM audio. Tests now have to
clearly choose how they want the capturing muxer to handle pcm audio.

Note that the only dump files that have changed are those that deal
with PCM audio (.wav, sowt, twos, silence). Because of the continuous
nature of PCM, timestamps are not part of the dump.

PiperOrigin-RevId: 623155302
2024-04-09 07:04:49 -07:00
tianyifeng
9c72fa8a7a Add reset to BasePreloadManager to release all the holding sources
Compared to `release`, the `reset` method doesn't release the preload manager instance. This applies to the use case that an app wants to discard all the sources but keep the preload manager active for later usage.

Also rename the `releaseSourceInternal` to `removeSourceInternal`, as the latter sounds more generic for different preload manager implementations.

PiperOrigin-RevId: 623148723
2024-04-09 06:30:32 -07:00
ibaker
5d6f514897 Remove references to LegacyPlayerView
This is an internal name for the exoplayer2 `PlayerView` that was never
published as part of media3.

PiperOrigin-RevId: 623120907
2024-04-09 04:12:42 -07:00
michaelkatz
5e85823ea0 Use the onPresentationEnded callback to detect end of offloaded audio
In offloaded audio playback, the `DefaultAudioSink` should use the `AudioTrack.StreamEventCallback` `onPresentationEnded` to note whether the AudioTrack has completed playing all pending data.

PiperOrigin-RevId: 622885399
2024-04-08 10:23:55 -07:00
ibaker
fad3257072 Rollback of c5e894e2d6
PiperOrigin-RevId: 622866208
2024-04-08 09:21:23 -07:00
tonihei
516d4ce1fd Reduce androidx.media usage in UI module to API < 21.
The androidx.media library is only used for its compat MediaStyle.
On API 21 and above, the logic can be easily inlined, and only
on API < 21, the androidx.media handling can be used.

This allows to remove the androidx.media dependency completely
once the minSdk has been increased to 21.

PiperOrigin-RevId: 622855469
2024-04-08 08:50:23 -07:00
Googler
c2356e3989 Rollback of c5e894e2d6
PiperOrigin-RevId: 622292092
2024-04-05 15:11:29 -07:00
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