Refactor according to reviews.
This commit is contained in:
parent
52adaf8d26
commit
51a9bcca61
@ -75,7 +75,8 @@ public interface VideoGraph {
|
||||
*
|
||||
* <p>If the method throws, the caller must call {@link #release}.
|
||||
*
|
||||
* @param sequenceIndex The sequence index of the input which can aid ordering of the inputs.
|
||||
* @param sequenceIndex The sequence index of the input which can aid ordering of the inputs. The
|
||||
* index must start from 0.
|
||||
*/
|
||||
void registerInput(int sequenceIndex) throws VideoFrameProcessingException;
|
||||
|
||||
|
@ -47,6 +47,8 @@ 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;
|
||||
@ -261,7 +263,7 @@ public abstract class MultipleInputVideoGraph implements VideoGraph {
|
||||
|
||||
@Override
|
||||
public VideoFrameProcessor getProcessor(int inputId) {
|
||||
checkState(preProcessors.indexOfKey(inputId) >= 0);
|
||||
checkState(Util.contains(preProcessors, inputId));
|
||||
return preProcessors.get(inputId);
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ import java.util.concurrent.Executor;
|
||||
@UnstableApi
|
||||
public abstract class SingleInputVideoGraph implements VideoGraph {
|
||||
|
||||
/** The ID {@link #registerInput(int)} returns. */
|
||||
/** The index of the only {@linkplain #registerInput(int) registered} input. */
|
||||
public static final int SINGLE_INPUT_INDEX = 0;
|
||||
|
||||
private final Context context;
|
||||
|
@ -49,8 +49,8 @@ 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}.
|
||||
*
|
||||
* @param sequenceIndex The sequence index of the input source, which is can be used to determine
|
||||
* the order of the input sources.
|
||||
* @param sequenceIndex The sequence index of the input source which is used to determine the
|
||||
* order of the input sources.
|
||||
*/
|
||||
void registerInputSource(int sequenceIndex);
|
||||
|
||||
|
@ -64,7 +64,7 @@ import java.util.List;
|
||||
*
|
||||
* @param editedMediaItem The initial {@link EditedMediaItem} of the input.
|
||||
* @param format The initial {@link Format} of the input.
|
||||
* @param sequenceIndex The sequence index of the input.
|
||||
* @param sequenceIndex The index of the input sequence.
|
||||
* @throws ExportException If an error occurs getting the input.
|
||||
*/
|
||||
public abstract GraphInput getInput(
|
||||
|
Loading…
x
Reference in New Issue
Block a user