Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix indeterminate z-order of EditedMediaItemSequences #1055

Merged
merged 8 commits into from
May 8, 2024
Merged
Prev Previous commit
Next Next commit
Refactor according to reviews.
  • Loading branch information
AradiPatrik authored and claincly committed May 8, 2024
commit 51a9bcca616bd492c17ac6d5c4a11c37ff01978b
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ interface Listener {
*
* <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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
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 @@ -261,7 +263,7 @@ public void onEnded() {

@Override
public VideoFrameProcessor getProcessor(int inputId) {
checkState(preProcessors.indexOfKey(inputId) >= 0);
checkState(Util.contains(preProcessors, inputId));
return preProcessors.get(inputId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
@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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ interface Listener {
* 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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public SampleExporter(Format firstInputFormat, MuxerWrapper muxerWrapper) {
*
* @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(
Expand Down