Add default constructor for InAppMuxer.Factory

PiperOrigin-RevId: 532838813
(cherry picked from commit 410840c9e19836fe1fc5c38001a6150fefe29027)
This commit is contained in:
sheenachhabra 2023-05-17 17:49:53 +00:00 committed by Tofunmi Adigun-Hameed
parent 61a5dd76e3
commit b97ec5edfc
3 changed files with 13 additions and 13 deletions

View File

@ -53,10 +53,7 @@ public class TransformerWithInAppMuxerEndToEndTest {
public void videoEditing_completesSuccessfully() throws Exception {
String testId = "videoEditing_completesSuccessfully";
Transformer transformer =
new Transformer.Builder(context)
.setMuxerFactory(
new InAppMuxer.Factory(DefaultMuxer.Factory.DEFAULT_MAX_DELAY_BETWEEN_SAMPLES_MS))
.build();
new Transformer.Builder(context).setMuxerFactory(new InAppMuxer.Factory()).build();
ImmutableList<Effect> videoEffects = ImmutableList.of(RgbFilter.createGrayscaleFilter());
MediaItem mediaItem = MediaItem.fromUri(Uri.parse(MP4_FILE_ASSET_DIRECTORY + inputFile));
EditedMediaItem editedMediaItem =
@ -76,10 +73,7 @@ public class TransformerWithInAppMuxerEndToEndTest {
public void audioEditing_completesSuccessfully() throws Exception {
String testId = "audioEditing_completesSuccessfully";
Transformer transformer =
new Transformer.Builder(context)
.setMuxerFactory(
new InAppMuxer.Factory(DefaultMuxer.Factory.DEFAULT_MAX_DELAY_BETWEEN_SAMPLES_MS))
.build();
new Transformer.Builder(context).setMuxerFactory(new InAppMuxer.Factory()).build();
ChannelMixingAudioProcessor channelMixingAudioProcessor = new ChannelMixingAudioProcessor();
channelMixingAudioProcessor.putChannelMixingMatrix(
ChannelMixingMatrix.create(/* inputChannelCount= */ 1, /* outputChannelCount= */ 2));

View File

@ -25,7 +25,6 @@ import androidx.media3.common.Effect;
import androidx.media3.common.MediaItem;
import androidx.media3.effect.RgbFilter;
import androidx.media3.transformer.AndroidTestUtil;
import androidx.media3.transformer.DefaultMuxer;
import androidx.media3.transformer.EditedMediaItem;
import androidx.media3.transformer.Effects;
import androidx.media3.transformer.ExportTestResult;
@ -50,10 +49,7 @@ public class TransformerWithInAppMuxerEndToEndTest {
return;
}
Transformer transformer =
new Transformer.Builder(context)
.setMuxerFactory(
new InAppMuxer.Factory(DefaultMuxer.Factory.DEFAULT_MAX_DELAY_BETWEEN_SAMPLES_MS))
.build();
new Transformer.Builder(context).setMuxerFactory(new InAppMuxer.Factory()).build();
ImmutableList<Effect> videoEffects = ImmutableList.of(RgbFilter.createGrayscaleFilter());
MediaItem mediaItem = MediaItem.fromUri(Uri.parse(MP4_ASSET_AV1_VIDEO_URI_STRING));
EditedMediaItem editedMediaItem =

View File

@ -42,6 +42,16 @@ public final class InAppMuxer implements Muxer {
public static final class Factory implements Muxer.Factory {
private final long maxDelayBetweenSamplesMs;
/**
* Creates an instance with {@link Muxer#getMaxDelayBetweenSamplesMs() maxDelayBetweenSamplesMs}
* set to {@link DefaultMuxer.Factory#DEFAULT_MAX_DELAY_BETWEEN_SAMPLES_MS}.
*/
public Factory() {
this(
/* maxDelayBetweenSamplesMs= */ DefaultMuxer.Factory
.DEFAULT_MAX_DELAY_BETWEEN_SAMPLES_MS);
}
/** {@link Muxer.Factory} for {@link InAppMuxer}. */
public Factory(long maxDelayBetweenSamplesMs) {
this.maxDelayBetweenSamplesMs = maxDelayBetweenSamplesMs;