1660 Commits

Author SHA1 Message Date
shahddaghash
35d5bd9675 Pass output media items's video size and frame count to MediaItemInfo
PiperOrigin-RevId: 722613631
2025-02-03 05:10:48 -08:00
Googler
4ed9abd05b Rollback of 0fb4e3ba11
PiperOrigin-RevId: 722585306
2025-02-03 03:18:59 -08:00
Googler
0fb4e3ba11 Add DebugViewEffect
Also updated DefaultVideoFrameProcessor to create GlShaderPrograms with the working ColorInfo rather than the output ColorInfo.

PiperOrigin-RevId: 721748002
2025-01-31 06:13:57 -08:00
claincly
2b07ece0e5 Allow sequences to have non-matching durations
And only repeat the secondary sequence if `isLooping` is set to true

PiperOrigin-RevId: 721713830
2025-01-31 03:46:15 -08:00
tonihei
df575a8d19 Add ClippingMediaSource.Builder
This prevents complicated constructor changes when we add new options.

PiperOrigin-RevId: 721415339
2025-01-30 09:23:49 -08:00
shahddaghash
9f96fe81f3 Pass video data space to output's MediaItemInfo
The DataSpace contains the Color Standard, Range, and Transfer.

PiperOrigin-RevId: 721341719
2025-01-30 04:39:24 -08:00
shahddaghash
3f4e0bdb04 Report output's MediaItemInfo to EditingEndedEvent
Most of the values for the output `MediaItemInfo` will be retained from the `ExportResult`, so it's now passed to `onExportSuccess` and `onExportError` directly. For now, the duration of the ouput is recorded for metrics, and more values will be added in the following CLs.

PiperOrigin-RevId: 721324689
2025-01-30 03:27:25 -08:00
kimvde
9af43c7381 CompositionPlayer: skip decode-only frames upstream of the VideoGraph
This is necessary for prewarming. With prewarming, in a sequence of 2
videos, the second renderer is enabled before the first one is disabled,
and decode-only frames should be skipped before the second renderer is
started. The problem is that the second renderer will forward frames to
a BufferingVideoSink before it is started, which  will delay the frame
handling and therefore not skip the frame before the renderer is
started.

PiperOrigin-RevId: 721032049
2025-01-29 10:44:56 -08:00
shahddaghash
bb9b3bd660 Pass codec names of input media items to MediaItemInfo
PiperOrigin-RevId: 720579315
2025-01-28 08:12:42 -08:00
shahddaghash
c058d97a97 Pass input media items audio information to MediaItemInfo
Audio `sampleMimeType`, `channelCount`, and `sampleRate` were retained from `ExportResult.ProcessedInput`'s audio format.

PiperOrigin-RevId: 720500611
2025-01-28 02:54:32 -08:00
shahddaghash
80e6fa2aa7 Separate ProcessedInput's format into audio and video
Before the change, `SequenceAssetLoader#onTrackAdded` was being called twice, for audio and video. `ExportResult.ProcessedInput` took one format, which was the latest to be written. The change leads to capturing both, the audio and video formats of the input, and prevents the issue of a format overwriting the other.

PiperOrigin-RevId: 720487697
2025-01-28 02:04:02 -08:00
kimvde
0b9ca1e70b Ignore 1 test in CompositionMultipleSequencePlaybackTest
playback_sequencesOfVideos_effectsReceiveCorrectTimestamps is failing
for prewarming. The following is happening:
- For prewarming, there are 2 alternating video renderers per sequence.
- When the first MediaItem ends (for both sequences), signalEndOfInput
is not called on the InputVideoSink (which is expected).
- The DefaultVideoCompositor doesn't receive the end-of-input-source
signal (which is also expected).
- As a result, the DefaultVideoCompositor never outputs the last frame
because it waits for more input frames to be fed.
- The VideoGraph thus doesn't output the last frame either, and the
first video renderer never ends.
- This causes playback to get stuck.

This is similar to the problem of supporting multiple video sequences
with images and videos in CompositionPlayer.

PiperOrigin-RevId: 720106413
2025-01-27 03:50:32 -08:00
shahddaghash
c3962d2fe6 Collect clipped duration instead of media item's duration
Previously, the input media item's duration was collected from `ProcessedInput.durationUs`. However, this value turned out to be the duration of the media item after clipping. Getting the duration of the input media item before clipping is tricky, so it will be dropped from Editing Metrics V1.

PiperOrigin-RevId: 719254077
2025-01-24 04:53:35 -08:00
shahddaghash
382f30616a Rollback of b25d6ef249
PiperOrigin-RevId: 719238418
2025-01-24 03:46:54 -08:00
claincly
6b54372df8 Have Sequence Player end as audio sink position is passed
The fix is to update `AudioGraphInputAudioSink.lastHandledPositionUs` when a buffer is handled, and end the `AudioGraphInputAudioSink` as the final audio sink plays out further than this position.

PiperOrigin-RevId: 718901825
2025-01-23 09:38:19 -08:00
Copybara-Service
c1242ffef1 Merge pull request #1235 from DolbyLaboratories:dlb/dovi-transformer/dev
PiperOrigin-RevId: 718856455
2025-01-23 07:26:21 -08:00
sheenachhabra
431efc9c50 Skip exportTranscodeBt2020Sdr test on sm-a325f API 33
The decode over reports its resolution capabilities and
decoder initialization eventually fails.

PiperOrigin-RevId: 718294047
2025-01-22 02:37:15 -08:00
kimvde
635e699965 Various improvements to BufferingVideoSink
PiperOrigin-RevId: 717807436
2025-01-21 01:54:45 -08:00
sheenachhabra
7c10ef03e4 Check full format support in decoder for Transformer
For the case where a hardware decoder does not fully
support the requested format, a software decoder will
be preferred.

PiperOrigin-RevId: 717584768
2025-01-20 11:27:13 -08:00
sheenachhabra
a31c7ad9a8 Move Muxer.java interface into transformer module
Muxer interface is used only in transformer.

PiperOrigin-RevId: 717538306
2025-01-20 08:13:42 -08:00
sheenachhabra
c22798f99c Removing redundant call to setLastSampleDurationBehavior on muxer
The default value is already
LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER_OR_DUPLICATE_PREVIOUS

PiperOrigin-RevId: 717497116
2025-01-20 05:14:47 -08:00
kimvde
8abd36fb27 Simplify MediaCodecRenderer.maybeInitializeProcessingPipeline
PiperOrigin-RevId: 717466577
2025-01-20 03:07:59 -08:00
sheenachhabra
c797249998 Move supported sample mime types list in specific muxer
This will reduce the risk of list becoming stale
(its already stale, to be fixed).

PiperOrigin-RevId: 716685242
2025-01-17 08:51:44 -08:00
claincly
a0618eb0ec Adds a test on using composition level effects
Also simplifies the test a bit.

PiperOrigin-RevId: 716683585
2025-01-17 08:46:44 -08:00
sheenachhabra
4ac4f7e2e0 Split InAppMuxer into InApp Mp4Muxer and FragmentedMp4Muxer
This is pre work required to remove `Muxer.java` interface
from the muxer module.
`Mp4Muxer` and `FragmentedMp4Muxer` will no longer implement
the `Muxer` interface.

PiperOrigin-RevId: 716669531
2025-01-17 08:01:28 -08:00
claincly
1732892927 Add tests for multi input video
PiperOrigin-RevId: 716208222
2025-01-16 06:19:47 -08:00
kimvde
b2c31b0743 Small nits in SequenceRenderersFactory
PiperOrigin-RevId: 716187537
2025-01-16 04:56:49 -08:00
shahddaghash
f5f5b63bf7 Pass video data space to MediaItemInfo
The `DataSpace` contains the Color Standard, Range, and Transfer. These values were mapped as follows:
* Standard: From `@C.ColorSpace` to `@DataSpace.DataSpaceStandard`
* Range: From `@C.ColorRange` to `@DataSpace.DataSpaceRange`
* Transfer: From `@C.ColorTransfer` to `@DataSpace.DataSpaceTransfer`

PiperOrigin-RevId: 716157142
2025-01-16 03:03:19 -08:00
shahddaghash
e9b82ee951 Pass video frame rate and video size to MediaItemInfo
The frame rate, height, and width are extracted from the format of processedInput.

PiperOrigin-RevId: 715843086
2025-01-15 10:09:12 -08:00
shahddaghash
04c2d22178 Pass containerMimeType and sampleMimeType to MediaItemInfo
If a format is passed to `ExportResult.ProcessedInput`, the `containerMimeType` and `sampleMimeType` are extracted from the Format and passed inside the `MediaItemInfo` object.

PiperOrigin-RevId: 715840400
2025-01-15 10:03:57 -08:00
dancho
0936b549ae Enable non-reference frame skipping in FrameExtractor
Speed up FrameExtractor for videos with non-ref frames

PiperOrigin-RevId: 715789816
2025-01-15 07:27:54 -08:00
kimvde
c5feb28838 Increase FrameExtractorTest timeout
FrameExtractorTest.extractFrame_pastDuration_returnsLastFrame is
sometimes timing out on emulator because it's too slow.

PiperOrigin-RevId: 715771071
2025-01-15 06:18:10 -08:00
shahddaghash
465399b57e Disable default collection of platform diagnostics
This is to prevent facing errors in apps using Transformer. It will be enabled again once the project is done and comprehensive tests are added.

PiperOrigin-RevId: 715435613
2025-01-14 10:33:50 -08:00
kimvde
fbf9be2f00 Fix composition player repeat mode
Some checks in SingleInputVideoGraph were causing CompositionPlayer to
throw for a single media item sequence when repeat mode was enabled. The
reason was that, in this case, no new input stream is registered to the
VideoFrameProcessor.

PiperOrigin-RevId: 715409509
2025-01-14 09:20:14 -08:00
claincly
e9e0569425 Integrate MultiInputVideoGraph in CompositionPlayer
Currently doesn't support image/video transitions

PiperOrigin-RevId: 715393251
2025-01-14 08:33:39 -08:00
shahddaghash
adb9306e2d Add format of media item to Transformer's ExportResult.ProcessedInput
This will allow us to collect info from the Format for metrics.

PiperOrigin-RevId: 715336943
2025-01-14 05:16:08 -08:00
shahddaghash
b25d6ef249 Rollback of 72a71e8b9c
PiperOrigin-RevId: 714997645
2025-01-13 09:30:39 -08:00
kimvde
b183bfb0cb CompositionPlayerTest: use correct video duration
PiperOrigin-RevId: 714847208
2025-01-13 00:01:42 -08:00
sheenachhabra
33c3d5140e Rollback of 750baf2c05
PiperOrigin-RevId: 714097260
2025-01-10 10:34:56 -08:00
shahddaghash
30c5c66db4 Pass input MediaItemInfo list with duration
Added the creation of `MediaItemInfo` for each MediaItem and passed the duration of the MediaItem to it. This is done for export operations that complete with success or with error.

PiperOrigin-RevId: 714056270
2025-01-10 08:11:45 -08:00
Googler
d9b61b060f Disable sample rate fallback tests.
In some cases encoders include a sample rate in their AudioCapabilities but do not support encoding at that sample rate. This breaks the assumption used to write these tests, so disable them for now until the fallback logic is updated to handle this limitation.

PiperOrigin-RevId: 714055556
2025-01-10 08:08:57 -08:00
shahddaghash
72a71e8b9c Report exporter and muxer names metrics to EditingEndedEvent
Added reporting 2 values from Transformer:

- `exporterName`: name of the package calling for export. Example: "androidx.media3.transformer".
- `muxerName`: name of the muxer used for the export operation. Example: "androidx.media3.muxer".

PiperOrigin-RevId: 714000672
2025-01-10 04:29:25 -08:00
shahddaghash
64462b99fc Add mediaItem durationUs to Transformer's ExportResult.ProcessedInput
This will allow us to access the duration of the input media items and collect them for metrics.

PiperOrigin-RevId: 713686613
2025-01-09 08:51:00 -08:00
kimvde
2df50f209e CompositionPlayerTest: increase timeout for emulator tests
Some tests are sometimes timing out because the emulator is too slow.

PiperOrigin-RevId: 713671851
2025-01-09 07:56:55 -08:00
tonihei
b9d12837b4 Use live providers in CompositionPlayer to remove workaround
When CompositionPlayer added repeat modes in d0afb96c40, it
changed the logic in SimpleBasePlayer to workaround the specific
scenario in CompositionPlayer that didn't seem to work correctly.
The workaround is not really generically applicable though. The
source of the original problem was that the position values of
all state objects were connected to the "live" source of the
current player so that the repetition case couldn't be detected
(the position before and after the seek looked the same). The
solution is to use the newly added LivePositionSuppliers and
disconnect them before seeking.

PiperOrigin-RevId: 713659638
2025-01-09 07:10:14 -08:00
Googler
8a709a7d76 Remove setPendingVideoEffects from VideoSink.
VideoSink#onInputStreamChanged(int, Format, List<Effect>) should now be used to set video effects on a new input stream.

PiperOrigin-RevId: 713627389
2025-01-09 04:48:21 -08:00
kimvde
04ff17d939 CompositionPlayerSeekTest: skip some tests on API 31 emulator
The audio decoder is sometimes failing with error "previous call to
queue exceeded timeout - Codec reported err 0x80000000, actionCode 0,
while in state 6/STARTED". This is probably because the emulator is too
slow.

PiperOrigin-RevId: 713564117
2025-01-09 00:24:31 -08:00
kimvde
d9776e74c8 PlayerListener: do not swallow exceptions thrown before waiting
If an error occurred in the player before the test was calling one of
the waitUntilSomething() methods, a timeout exception was thrown instead
of the actual error.

PiperOrigin-RevId: 713292292
2025-01-08 08:03:46 -08:00
kimvde
bb3b85a359 CompositionPlayerSeekTest: don't hide exception while waiting on latch
If a playback exception was thrown before or during awaiting the
frameCountBeforeBlockLatch, a TimeoutException was thrown instead of the
playback exception, hiding the actual cause of the failing test.

PiperOrigin-RevId: 713279627
2025-01-08 07:10:09 -08:00
kimvde
30038079c4 Split CompositionPlayerSeekTest.playSequenceAndGetTimestampsUs
This method is already quite complex and I will need to add more
complexity, so split it into multiple smaller methods.

This CL is a refactoring. There are no functional changes.

PiperOrigin-RevId: 713266816
2025-01-08 06:18:48 -08:00