Format with google-java-format

This commit is contained in:
Luyuan Chen 2024-03-04 11:57:36 +00:00
parent 51a9bcca61
commit 0403e5881d
7 changed files with 15 additions and 17 deletions

View File

@ -82,10 +82,11 @@ public interface VideoGraph {
/**
* 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.

View File

@ -47,8 +47,6 @@ import androidx.media3.common.VideoFrameProcessor;
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;
@ -262,9 +260,9 @@ public abstract class MultipleInputVideoGraph implements VideoGraph {
}
@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

View File

@ -162,7 +162,7 @@ public abstract class SingleInputVideoGraph implements VideoGraph {
}
@Override
public VideoFrameProcessor getProcessor(int inputId) {
public VideoFrameProcessor getProcessor(int sequenceIndex) {
return checkStateNotNull(videoFrameProcessor);
}

View File

@ -46,11 +46,10 @@ public interface VideoCompositor extends GlTextureProducer {
}
/**
* 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);

View File

@ -550,8 +550,8 @@ public final class CompositingVideoSinkProvider
// 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;

View File

@ -70,7 +70,7 @@ import java.util.concurrent.Executor;
*
* <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;
}

View File

@ -548,8 +548,8 @@ import org.checkerframework.dataflow.qual.Pure;
}
@Override
public VideoFrameProcessor getProcessor(int inputId) {
return videoGraph.getProcessor(inputId);
public VideoFrameProcessor getProcessor(int sequenceIndex) {
return videoGraph.getProcessor(sequenceIndex);
}
@Override