Update Composition javadoc for expanded audio support.

PiperOrigin-RevId: 550922961
This commit is contained in:
samrobinson 2023-07-25 18:17:38 +01:00 committed by Rohit Singh
parent 782f5b2a0e
commit b7d7027424
2 changed files with 25 additions and 9 deletions

View File

@ -158,6 +158,8 @@ public final class EditedMediaItem {
/** /**
* Sets the {@link Effects} to apply to the {@link MediaItem}. * Sets the {@link Effects} to apply to the {@link MediaItem}.
* *
* <p>Callers should not interact with underlying {@link Effects#audioProcessors}.
*
* <p>The default value is {@link Effects#EMPTY}. * <p>The default value is {@link Effects#EMPTY}.
* *
* @param effects The {@link Effects} to apply. * @param effects The {@link Effects} to apply.

View File

@ -34,6 +34,9 @@ import androidx.media3.common.MediaLibraryInfo;
import androidx.media3.common.MimeTypes; import androidx.media3.common.MimeTypes;
import androidx.media3.common.VideoFrameProcessor; import androidx.media3.common.VideoFrameProcessor;
import androidx.media3.common.audio.AudioProcessor; import androidx.media3.common.audio.AudioProcessor;
import androidx.media3.common.audio.AudioProcessor.AudioFormat;
import androidx.media3.common.audio.ChannelMixingAudioProcessor;
import androidx.media3.common.audio.SonicAudioProcessor;
import androidx.media3.common.util.Clock; import androidx.media3.common.util.Clock;
import androidx.media3.common.util.HandlerWrapper; import androidx.media3.common.util.HandlerWrapper;
import androidx.media3.common.util.ListenerSet; import androidx.media3.common.util.ListenerSet;
@ -748,23 +751,34 @@ public final class Transformer {
* EditedMediaItemSequence}, while the audio format will be determined by the {@code * EditedMediaItemSequence}, while the audio format will be determined by the {@code
* AudioMediaItem} in the second {@code EditedMediaItemSequence}. * AudioMediaItem} in the second {@code EditedMediaItemSequence}.
* *
* <p>This method is under implementation. Only the {@linkplain Composition compositions} meeting * <p>This method is under development. A {@link Composition} must meet the following conditions:
* the below conditions are supported:
* *
* <ul> * <ul>
* <li>There must be no overlapping track corresponding to the same track type in the output. * <li>The composition must have at most one {@linkplain EditedMediaItemSequence sequence} with
* More precisely, the composition must either contain a single {@linkplain * video/image data. There are no restrictions on the number of audio sequences.
* EditedMediaItemSequence sequence}, or contain one audio-only sequence and one
* video/image-only sequence.
* <li>A sequence cannot contain both HDR and SDR video input.
* <li>A sequence cannot have gaps in its video or image samples. In other words, if a sequence
* contains video or image data, it must contain this type of data in the entire sequence.
* <li>The {@linkplain Composition#effects composition effects} must contain no {@linkplain * <li>The {@linkplain Composition#effects composition effects} must contain no {@linkplain
* Effects#audioProcessors audio effects}. * Effects#audioProcessors audio effects}.
* <li>The composition effects must either contain no {@linkplain Effects#videoEffects video * <li>The composition effects must either contain no {@linkplain Effects#videoEffects video
* effects}, or exactly one {@link Presentation}. * effects}, or exactly one {@link Presentation}.
* </ul> * </ul>
* *
* <p>{@linkplain EditedMediaItemSequence Sequences} within the {@link Composition} must meet the
* following conditions:
*
* <ul>
* <li>A sequence cannot contain both HDR and SDR video input.
* <li>If an {@link EditedMediaItem} in a sequence contains data of a given {@linkplain
* C.TrackType track}, so must all items in that sequence.
* <ul>
* <li>For audio, this condition can be removed by setting an experimental {@link
* Composition.Builder#experimentalSetForceAudioTrack(boolean) flag}.
* </ul>
* <li>All sequences containing audio data must output audio with the same {@linkplain
* AudioFormat properties}. This can be done by adding {@linkplain EditedMediaItem#effects
* item specific effects}, such as {@link SonicAudioProcessor} and {@link
* ChannelMixingAudioProcessor}.
* </ul>
*
* <p>The export state is notified through the {@linkplain Builder#addListener(Listener) * <p>The export state is notified through the {@linkplain Builder#addListener(Listener)
* listener}. * listener}.
* *