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
Format with google-java-format
  • Loading branch information
claincly committed May 8, 2024
commit 3cccecf36866ed0b749bdf90100b2c53fc88b276
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it's easier if we require sequence indices start from 0, so please add something like "The index must start from zero"

*
* @return The id of the registered input, which can be used to get the underlying {@link
* VideoFrameProcessor} via {@link #getProcessor(int)}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ interface Listener {
* source, to be used in {@link #queueInputTexture}.
*
* @param sequenceIndex The sequence index of the input source, which is can be used to determine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reword: which is used to determine the order of the input sources

* the order of the input sources.
* the order of the input sources.
*/
int registerInputSource(int sequenceIndex);
AradiPatrik marked this conversation as resolved.
Show resolved Hide resolved

/**
* Signals that no more frames will come from the upstream {@link GlTextureProducer.Listener}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public SampleExporter(Format firstInputFormat, MuxerWrapper muxerWrapper) {
* @throws ExportException If an error occurs getting the input.
*/
public abstract GraphInput getInput(
EditedMediaItem editedMediaItem, Format format, int sequenceIndex) throws ExportException;
EditedMediaItem editedMediaItem, Format format, int sequenceIndex) throws ExportException;

/**
* Processes the input data and returns whether it may be possible to process more data by calling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ public VideoSampleExporter(
}

@Override
public GraphInput getInput(EditedMediaItem editedMediaItem, Format format, int sequenceIndex) throws ExportException {
public GraphInput getInput(EditedMediaItem editedMediaItem, Format format, int sequenceIndex)
throws ExportException {
try {
return videoGraph.createInput(sequenceIndex);
} catch (VideoFrameProcessingException e) {
Expand Down