fix naming and formatting

This commit is contained in:
Patrik Aradi 2024-02-06 11:14:14 +08:00 committed by Luyuan Chen
parent b909162daa
commit 84df55c6e8
6 changed files with 17 additions and 21 deletions

View File

@ -27,7 +27,6 @@ import android.opengl.EGLDisplay;
import android.opengl.EGLSurface;
import android.opengl.GLES20;
import android.util.SparseArray;
import androidx.annotation.GuardedBy;
import androidx.annotation.IntRange;
import androidx.annotation.Nullable;
@ -43,18 +42,15 @@ import androidx.media3.common.util.LongArrayQueue;
import androidx.media3.common.util.Size;
import androidx.media3.common.util.UnstableApi;
import androidx.media3.common.util.Util;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.Iterator;
import java.util.List;
import java.util.Queue;
import java.util.concurrent.ExecutorService;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/**
* A basic {@link VideoCompositor} implementation that takes in frames from input sources' streams
@ -146,9 +142,9 @@ public final class DefaultVideoCompositor implements VideoCompositor {
}
@Override
public synchronized int registerInputSource(int sequenceId) {
inputSources.put(sequenceId, new InputSource());
return sequenceId;
public synchronized int registerInputSource(int sequenceIndex) {
inputSources.put(sequenceIndex, new InputSource());
return sequenceIndex;
}
@Override

View File

@ -257,7 +257,6 @@ public abstract class MultipleInputVideoGraph implements VideoGraph {
onPreProcessingVideoFrameProcessorEnded(videoCompositorInputId);
}
});
preProcessors.put(videoCompositorInputId, preProcessor);
return videoCompositorInputId;
}

View File

@ -49,10 +49,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}.
*
* @param sequenceId The sequence ID 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 can be used to determine
* the order of the input sources.
*/
int registerInputSource(int sequenceId);
int registerInputSource(int sequenceIndex);
/**
* Signals that no more frames will come from the upstream {@link GlTextureProducer.Listener}.
*

View File

@ -67,7 +67,8 @@ import java.util.List;
* @param sequenceIndex The sequence index of the input.
* @throws ExportException If an error occurs getting the input.
*/
public abstract GraphInput getInput(EditedMediaItem editedMediaItem, Format format, int sequenceIndex) throws ExportException;
public abstract GraphInput getInput(
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

View File

@ -637,7 +637,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
}
GraphInput sampleExporterInput =
sampleExporter.getInput(firstEditedMediaItem, assetLoaderOutputFormat, sequenceIndex);
sampleExporter.getInput(firstEditedMediaItem, assetLoaderOutputFormat, sequenceIndex);
OnMediaItemChangedListener onMediaItemChangedListener =
(editedMediaItem, durationUs, decodedFormat, isLast) -> {
onMediaItemChanged(trackType, durationUs, isLast);

View File

@ -59,8 +59,6 @@ import java.util.Objects;
import org.checkerframework.checker.initialization.qual.Initialized;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.dataflow.qual.Pure;
import java.nio.ByteBuffer;
import java.util.List;
/** Processes, encodes and muxes raw video frames. */
/* package */ final class VideoSampleExporter extends SampleExporter {
@ -276,14 +274,16 @@ import java.util.List;
ImmutableList<MediaCodecInfo> hdrEncoders =
getSupportedEncodersForHdrEditing(requestedOutputMimeType, inputFormat.colorInfo);
if (hdrEncoders.isEmpty()) {
// Fallback H.265/HEVC codecs for HDR content to avoid tonemapping.
hdrEncoders =
getSupportedEncodersForHdrEditing(MimeTypes.VIDEO_H265, inputFormat.colorInfo);
@Nullable
String alternativeMimeType = MediaCodecUtil.getAlternativeCodecMimeType(inputFormat);
if (alternativeMimeType != null) {
requestedOutputMimeType = alternativeMimeType;
hdrEncoders =
getSupportedEncodersForHdrEditing(alternativeMimeType, inputFormat.colorInfo);
}
}
if (hdrEncoders.isEmpty()) {
hdrMode = HDR_MODE_TONE_MAP_HDR_TO_SDR_USING_OPEN_GL;
} else {
requestedOutputMimeType = MimeTypes.VIDEO_H265;
}
}