20446 Commits

Author SHA1 Message Date
bachinger
e866cb02d6 Make replaceAdTagParameters unstable API for now
PiperOrigin-RevId: 627323264
2024-04-23 03:04:51 -07:00
kimvde
8da6938782 Always initialize VideoSink in renderer
Instead of initializing the video sink outside the renderer with an
empty format for composition preview, we initialize it in the renderer
with the input format for video.

PiperOrigin-RevId: 627313708
2024-04-23 02:20:18 -07:00
kimvde
e3caed1441 Move VideoSinkProvider.initialize to VideoSink
PiperOrigin-RevId: 627290721
2024-04-23 00:37:01 -07:00
Googler
a43ffa8898 Add replaceAdTagParameters() to ImaServerSideAdInsertion.AdsLoader.
PiperOrigin-RevId: 627114711
2024-04-22 12:09:59 -07:00
claincly
7aed9d40a0 Clean up nullness annotation
PiperOrigin-RevId: 627114088
2024-04-22 12:07:07 -07:00
Googler
430fafded6 Boxes: Update STTS duration calculation.
Update the function convertPresentationTimestampsToDurationsVu
to return a list of duration in decoding order,used in the
creation of STTS boxes.

PiperOrigin-RevId: 627052898
2024-04-22 08:59:06 -07:00
sheenachhabra
03a041c452 Pass BufferInfo in writeSampleData() method in Transformer/Muxer.java
This is to eventually replace Transformer/Muxer.java with Muxer/Muxer.java

PiperOrigin-RevId: 627043808
2024-04-22 08:23:34 -07:00
sheenachhabra
86ef571644 Replace trackIndex with TrackToken in Transformer
This is to eventually replace Transformer/Muxer.java with Muxer/Muxer.java

PiperOrigin-RevId: 627027254
2024-04-22 07:20:38 -07:00
sheenachhabra
7c7e7ea629 Add API to disable sample copy in Mp4Muxer
PiperOrigin-RevId: 627002635
2024-04-22 05:26:39 -07:00
tofunmi
8ae9e81196 add test for speed adjustments, audio removed and a forced audio track
add coverage for key use case for speed adjustments

PiperOrigin-RevId: 626957912
2024-04-22 02:00:46 -07:00
claincly
716aedd019 Fix image up-side-down in when playing a Composition
When playing a Composition, the color transfer of an image is incorrectly
passed down to be SMPTE170M, but it should be SRGB.

PiperOrigin-RevId: 626425396
2024-04-19 11:37:15 -07:00
tofunmi
fb037b9847 TimestampWrapper: fix signaling input capacity
fixes https://github.com/androidx/media/issues/821

PiperOrigin-RevId: 626407880
2024-04-19 10:40:59 -07:00
tofunmi
0bc5ac24b0 Effect: remove duplicate inputColorInfo checks
We currently check certain properties about inputColorInfo twice: once in checkColors in the DVFP and once when creating the samplers in the defaultshaderprogam. The inputcolorinfo shouldn't change between these two components so removing the checks in the shader program to have one source of truth for inputColorInfo checks, which will make the code simpler when it comes to adding to color-related features (like the ones related to removing de-gamma-ing)

PiperOrigin-RevId: 626400960
2024-04-19 10:18:33 -07:00
bachinger
09f2cda43c Promote IMA DAI API to stable
PiperOrigin-RevId: 626064956
2024-04-18 09:49:48 -07:00
tofunmi
300e83414d Effect: Change link in shader ahead of deletion
PiperOrigin-RevId: 626044561
2024-04-18 08:38:41 -07:00
tianyifeng
50fefe698d Avoid non-primary playlists continuously reloading for LL-HLS streams
For LL-HLS, the non-primary playlists originally keep reloading even after the primary playlist has been changed to another one. The reason being this is to check if the hinted(#EXT-X-PRELOAD-HINT) resource has been published or removed. If removed, the loading of it should be canceled, per the suggestion in the HLS spec:

"A Client SHOULD cancel a request for a hinted resource if it is not present in a subsequent Playlist update, such as in an EXT-X-PRELOAD-HINT tag or as part of another tag such as EXT-X-PART.  The client SHOULD ignore the results of such requests."

However, keeping the non-primary playlists reloading is not optimal. As a solution, we trigger the playlist reloading only when there is a preload chunk loading instead of every time after we have processed the playlist. Compared to the original implementation, this will save the requests of reloading non-primary playlist after we have taken action upon the preload chunk being published or removed.

Issue: androidx/media#1240
PiperOrigin-RevId: 626038032
2024-04-18 08:11:19 -07:00
tonihei
e1c62df256 Remove media1 public API dependencies from session module
This is the preparation to import the media1 classes as
private copies into media3.

- Reword Javadoc to use @code instead of @link to media1 types. This
  avoids accidentally linking to the future internal types.
- Use fully qualified names for the converter methods to and from
  MediaSessionCompat.Token to ensure they keep the publicly available
  type.
- Add new public variable that is directly referenced from our code
  instead of referring the the media1 equivalent.
- Clean up tests that are using media1 types to make assertions on
  media3 fields and vice versa (mostly when using LegacyConversions
  in the test method). This also makes the tests more DAMP than DRY.
  (also moved LegacyConversionsTest to a unit test as it doesn't test
  cross-process communication)

PiperOrigin-RevId: 626000082
2024-04-18 05:33:10 -07:00
kimvde
34c31b0a33 Fix SequenceAssetLoader incorrectly reporting MediaItem change
Before this CL, if all the video (resp. audio) samples were fed before
the audio (resp. video) output format was reported, the
SequenceAssetLoader was incorrectly reporting a MediaItem change with a
null format.

PiperOrigin-RevId: 625978268
2024-04-18 03:44:18 -07:00
sheenachhabra
4aa2fb883f Add RawAssetLoader and deprecate TextureAssetLoader
All the changes are based on existing implementations
and their related tests.

No new functionality is being added.

PiperOrigin-RevId: 625756836
2024-04-17 11:48:43 -07:00
andrewlewis
2f8ce053b9 Avoid crash when testing spatialization of high channel count audio
For audio with more than 12 channels, no channel mask was determined, which
meant that the code to check spatializability would throw because of creating
an invalid audio format.

Return early if the channel mask was invalid instead (and assume spatialization
isn't possible).

PiperOrigin-RevId: 625618683
2024-04-17 03:03:01 -07:00
andrewlewis
a58a99e84d Don't constrain audio for playout in Transformer
Transformer's input shouldn't be constrained to the number of playable audio channels on the current device because the media may be edited (to mix channels for example) or encoded for playback on another device (a server for example).

PiperOrigin-RevId: 625604243
2024-04-17 01:55:51 -07:00
michaelkatz
83d1600c7e Fix typos in 1.4.0-alpha01 release notes
PiperOrigin-RevId: 625332081
2024-04-16 08:03:17 -07:00
andrewlewis
3be49a5841 Work around incorrect channel count for raw audio
The raw audio decoder's output audio format is stereo when the number of input
channels is (for example) 10 channels. Add a temporary workaround that uses the
input channel count for raw audio. This code should be removed in future when
we bypass the decoder entirely for raw audio.

Tested manually on a WAVE file with 18 audio channels.

PiperOrigin-RevId: 625307624
2024-04-16 06:21:31 -07:00
Copybara-Service
ea48fe579e Merge pull request #1272 from stevemayhew:p-add-hook-for-load-error-handler
PiperOrigin-RevId: 625285300
2024-04-16 04:48:27 -07:00
sheenachhabra
794900bfb8 Update addMetadata method in Transformer/Muxer.java
This is to align the interface with Muxer/Muxer.java and
then finally replace it.

PiperOrigin-RevId: 625283725
2024-04-16 04:40:13 -07:00
Ian Baker
e13d7e632e Fix javadoc link reference 2024-04-16 11:49:06 +01:00
Ian Baker
5fd1dc2e4e Add release note 2024-04-16 11:44:07 +01:00
Ian Baker
001ebb68f3 Formatting, nullness and javadoc rewording 2024-04-16 11:42:31 +01:00
Steve Mayhew
566c0b3eea Allows setting LoadErrorHandlingPolicy for DRM
The `DefaultDrmSessionManager` allows setting this policy.  This change
simply plumbs the setting up to the `DefaultDrmSessionManagerProvider`
2024-04-16 11:42:31 +01:00
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