20317 Commits

Author SHA1 Message Date
Copybara-Service
236c341168 Merge pull request #1266 from hubert-mazur:looped_playback
PiperOrigin-RevId: 625260110
2024-04-16 02:54:47 -07:00
ibaker
c01babe9bb Log JSON loading exception in demo app
This change also switches from media3's `Log` class (marked with
`@UnstableApi`) to `android.util.Log` which is what we would expect
apps to use.

Issue: androidx/media#1283
PiperOrigin-RevId: 625252745
2024-04-16 02:24:17 -07:00
Marc Baechinger
a6b540545d Minor cleanup 2024-04-16 10:54:45 +02:00
kimvde
1c0345e69f Make VideoSinkImpl non-static
PiperOrigin-RevId: 624999257
2024-04-15 10:13:25 -07:00
kimvde
41d5571660 Allow sink provider to be flushed before initialized
VideoSink.initialize will be added in a next CL and we want to allow
flush to be called before and after initialize.

PiperOrigin-RevId: 624946957
2024-04-15 07:05:28 -07:00
kimvde
00e3753d62 Fix buffer lost when flushing AudioGraphInput
Before this CL, currentInputBufferBeingOutput was set to null without
adding the buffer to the queue of available buffers, which was making
this buffer unusable. After multiple seeks, playback was stuck because
the AudioGraphInput had no input buffer left.

PiperOrigin-RevId: 624943271
2024-04-15 06:50:13 -07:00
kimvde
0a741cad36 Allow sink provider speed to be set at any time
VideoSink.initialize will be added in a next CL and we want to allow
setPlaybackSpeed to be called at any time.

PiperOrigin-RevId: 624942845
2024-04-15 06:47:33 -07:00
kimvde
42335893da Remove unnecessary call in MediaCodecVideoRenderer
Before this CL, the FrameMetadataListener was set in
onReadyToInitializeCodec while it had already been set when handling
message MSG_SET_VIDEO_FRAME_METADATA_LISTENER.

PiperOrigin-RevId: 624940824
2024-04-15 06:38:05 -07:00
ibaker
a701c2f035 Tighten clearkey "default.url" workaround
This ensures it only applies to known-problematic versions of the
clearkey plugin.

PiperOrigin-RevId: 624901919
2024-04-15 03:42:57 -07:00
tonihei
11257ecacb Forward presumed no-op seeks to handler methods in (Simple)BasePlayer
Some seek operations are currently filtered in the base classes if
the target index is not explicitly specified and the implicitly
assumed operation doesn't have an obvious target index. (Example:
calling seekToNext() at the last item in a playlist)

This is too opinionated because the actual player implementation
using this base class may be able to handle this seek request (e.g.
by adding new items on the fly or using other logic to select
the most suitable next item).

This can be solved by forwarding all seek requests to the respective
handler methods even if they are a presumed no-op. Also clarify the
Javadoc that the provided index is just an assumption if it wasn't
provided explicitly in the method call.

PiperOrigin-RevId: 624887116
2024-04-15 02:38:29 -07:00
Marc Baechinger
20e98ca125 Add release notes 2024-04-15 11:01:04 +02:00
tofunmi
c74603b66b Allow bt601 as sdr colorspace when checking sdr colors
PiperOrigin-RevId: 624877126
2024-04-15 01:57:52 -07:00
Marc Baechinger
ee6961f958 Format with google-java-format 2024-04-15 10:54:49 +02:00
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