Skip to content

Commit

Permalink
Format with google-java-format
Browse files Browse the repository at this point in the history
  • Loading branch information
claincly committed Mar 4, 2024
1 parent 5fea852 commit 8e76256
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ interface Listener {

/**
* Returns the {@link VideoFrameProcessor} that handles the processing for an input registered via
* {@link #registerInput(int)}. If the {@code inputId} is not {@linkplain #registerInput(int)
* registered} before, this method will throw an {@link IllegalStateException}.
* {@link #registerInput(int)}. If the {@code sequenceIndex} is not {@linkplain
* #registerInput(int) registered} before, this method will throw an {@link
* IllegalStateException}.
*/
VideoFrameProcessor getProcessor(int inputId);
VideoFrameProcessor getProcessor(int sequenceIndex);

/**
* Sets the output surface and supporting information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import static androidx.media3.effect.DebugTraceUtil.logEvent;
import static java.util.concurrent.TimeUnit.MILLISECONDS;


import android.content.Context;
import android.opengl.EGLContext;
import android.opengl.EGLDisplay;
Expand All @@ -46,8 +47,6 @@
import androidx.media3.common.VideoGraph;
import androidx.media3.common.util.GlUtil;
import androidx.media3.common.util.UnstableApi;
import androidx.media3.common.util.Util;

import com.google.common.util.concurrent.MoreExecutors;
import java.util.ArrayDeque;
import java.util.ArrayList;
Expand Down Expand Up @@ -260,9 +259,9 @@ public void onEnded() {
}

@Override
public VideoFrameProcessor getProcessor(int inputId) {
checkState(Util.contains(preProcessors, inputId));
return preProcessors.get(inputId);
+ public VideoFrameProcessor getProcessor(int sequenceIndex) {
+ checkState(contains(preProcessors, sequenceIndex));
+ return preProcessors.get(sequenceIndex);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void onEnded() {
}

@Override
public VideoFrameProcessor getProcessor(int inputId) {
public VideoFrameProcessor getProcessor(int sequenceIndex) {
return checkStateNotNull(videoFrameProcessor);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ interface Listener {
}

/**
* Registers a new input source, and returns a unique {@code inputId} corresponding to this
* source, to be used in {@link #queueInputTexture}.
* Registers a new input source.
*
* @param sequenceIndex The sequence index of the input source which is used to determine the
* order of the input sources.
* order of the input sources. The same index should to be used in {@link #queueInputTexture}.
*/
void registerInputSource(int sequenceIndex);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,8 @@ public VideoSinkImpl(
// reduces decoder timeouts, and consider restoring.
videoFrameProcessorMaxPendingFrameCount =
Util.getMaxPendingFramesCountForMediaCodecDecoders(context);
videoGraph.registerInput(0);
videoFrameProcessor = videoGraph.getProcessor(0);
videoGraph.registerInput(/* sequenceIndex= */ 0);
videoFrameProcessor = videoGraph.getProcessor(/* sequenceIndex= */ 0);

videoEffects = new ArrayList<>();
finalBufferPresentationTimeUs = C.TIME_UNSET;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ TransformerVideoGraph create(
*
* <p>If the method throws any {@link Exception}, the caller must call {@link #release}.
*
* @param sequenceIndex The sequence index of the input, which can aid ordering of the inputs.
* @param sequenceIndex The index of the input sequence, which is used to order the inputs.
*/
GraphInput createInput(int sequenceIndex) throws VideoFrameProcessingException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ public void registerInput(int sequenceIndex) throws VideoFrameProcessingExceptio
}

@Override
public VideoFrameProcessor getProcessor(int inputId) {
return videoGraph.getProcessor(inputId);
public VideoFrameProcessor getProcessor(int sequenceIndex) {
return videoGraph.getProcessor(sequenceIndex);
}

@Override
Expand Down

0 comments on commit 8e76256

Please sign in to comment.