1259 Commits

Author SHA1 Message Date
tofunmi
5ee6c9b16d ultraHdr test: add checks for devices with invalid color formats
PiperOrigin-RevId: 628101730
2024-04-25 09:37:16 -07:00
kimvde
c87940eb27 AudioGraph refactoring: configure mixer and add sources in one place
PiperOrigin-RevId: 628076773
2024-04-25 08:02:00 -07:00
claincly
124c70ac26 Add MIME type to match any image
PiperOrigin-RevId: 627486539
2024-04-23 13:27:42 -07:00
kimvde
abd0ff7352 Remove configure methods
Pass the parameters to the constructor instead

PiperOrigin-RevId: 627420999
2024-04-23 09:59:56 -07:00
tofunmi
73f614b14d Effect: support disabling color transfers when HDR->SDR tonemapping
also makes the setter more flexible by ignoring the value of the setter when the output is hdr rather than throwing (since all HDR content must be have a linear color space)

PiperOrigin-RevId: 627388436
2024-04-23 08:02:30 -07:00
sheenachhabra
b813bd3976 Use silence audio in RawAssetLoader tests
This is avoid dependency on `MediaExtractor` whose
behaviour is not consistent across different API versions.

PiperOrigin-RevId: 627330485
2024-04-23 03:38:31 -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
claincly
7aed9d40a0 Clean up nullness annotation
PiperOrigin-RevId: 627114088
2024-04-22 12:07:07 -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
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
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
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
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
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
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
tofunmi
c74603b66b Allow bt601 as sdr colorspace when checking sdr colors
PiperOrigin-RevId: 624877126
2024-04-15 01:57:52 -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
tofunmi
1f40451631 UltraHDR: use HdrCapabilitiesUtil to assume device supports hdr editing
PiperOrigin-RevId: 624122752
2024-04-12 04:00:58 -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
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
Googler
d71e062780 Add recommendation on setting frame rate for images
PiperOrigin-RevId: 623214178
2024-04-09 10:43:13 -07:00
samrobinson
81b9739bda Consolidate dump files for item effect vs composition effect.
PiperOrigin-RevId: 623161140
2024-04-09 07:33:38 -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
tofunmi
c8aaaa8a85 Ultra Hdr Test: skip devices that don't support format
PiperOrigin-RevId: 622195071
2024-04-05 09:09:16 -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
ibaker
032cad8d09 Remove more unnecessary SDK checks now the min is 19
PiperOrigin-RevId: 621600592
2024-04-03 12:15:24 -07:00
kimvde
bf21f1edd5 Add methods to seek in preview audio pipeline
PiperOrigin-RevId: 621513330
2024-04-03 07:21:01 -07:00
sheenachhabra
308c4c4fbf Take fragment duration in Ms instead of Us
PiperOrigin-RevId: 621144165
2024-04-02 05:44:46 -07:00
claincly
b584abfaba Clarify error message to remind user of forceAudioTrack
PiperOrigin-RevId: 620042879
2024-03-28 13:40:07 -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
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
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
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
tofunmi
f4fefd19f7 Document and test multi asset ultraHDR support
PiperOrigin-RevId: 619200688
2024-03-26 08:39:44 -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
andrewlewis
c3c964627f Log internal Transformer lifecycle for debugging
Add logging similar to `ExoPlayerImpl` to make bug reports more useful.

PiperOrigin-RevId: 619117500
2024-03-26 02:31:31 -07:00
sheenachhabra
2eaece5ed9 Move setMaxDelayBetweenSamplesMs on Transformer builder
This property is transformer specific and does not belong to
muxer interface.
This is to eventually replace muxer interface in Transformer module with
muxer interface in Muxer module.

PiperOrigin-RevId: 618895836
2024-03-25 11:02:15 -07:00
sheenachhabra
483d2bb9e7 Add Muxer interface in muxer module
The immediate plan is to replace `Transformer Muxer interface`
with this one.
It was not straight forward to move/change `Transformer Muxer interface`
hence this intermediate step.
The follow up CL will also remove fragmented MP4 related code from
`Mp4Muxer` and move it into `FragmentedMp4Muxer implements Muxer`.

PiperOrigin-RevId: 618789265
2024-03-25 03:40:15 -07:00
huangdarwin
d165af9a85 Test: Use AssumptionViolatedException for format support detection.
This is the most widely-used test-skipping method I'm aware of, so I figured this
would be a great method to scale usage of AssumptionViolatedException.

PiperOrigin-RevId: 618160931
2024-03-22 06:41:18 -07:00
sheenachhabra
16aac07bce Add support for processing 3 byte NAL start code in Mp4Muxer
Issue: androidx/media#725

Ideally the test to transmux a `ts` file (having 3 bytes NAL start code)
should go into `Mp4MuxerEndToEndTest`but `Mp4MuxerEndToEndTest` uses `MediaExtractor` and `MediaExtractor` is returning samples with `4 byte NAL start code` which will not exercise the newly added code path.
Hence the test is added in `TransformerWithInAppMuxerEndToEndTest` which
internally uses `media3 extractor` and feeds samples with `3 bytes NAL start code`
only.

PiperOrigin-RevId: 617985866
2024-03-21 15:49:12 -07:00
kimvde
6fc4f0263f Add methods required for seek to AudioGraph
Seeking will consist of the following steps:
- Block the AudioGraph input data.
- Flush the AudioGraph.
- Seek the ExoPlayers.
- Unblock the AudioGraph input data.

PiperOrigin-RevId: 617868124
2024-03-21 09:31:51 -07:00