fix naming and formatting
This commit is contained in:
parent
b909162daa
commit
84df55c6e8
@ -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
|
||||
|
@ -257,7 +257,6 @@ public abstract class MultipleInputVideoGraph implements VideoGraph {
|
||||
onPreProcessingVideoFrameProcessorEnded(videoCompositorInputId);
|
||||
}
|
||||
});
|
||||
|
||||
preProcessors.put(videoCompositorInputId, preProcessor);
|
||||
return videoCompositorInputId;
|
||||
}
|
||||
|
@ -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}.
|
||||
*
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
@Nullable
|
||||
String alternativeMimeType = MediaCodecUtil.getAlternativeCodecMimeType(inputFormat);
|
||||
if (alternativeMimeType != null) {
|
||||
requestedOutputMimeType = alternativeMimeType;
|
||||
hdrEncoders =
|
||||
getSupportedEncodersForHdrEditing(MimeTypes.VIDEO_H265, inputFormat.colorInfo);
|
||||
getSupportedEncodersForHdrEditing(alternativeMimeType, inputFormat.colorInfo);
|
||||
}
|
||||
}
|
||||
if (hdrEncoders.isEmpty()) {
|
||||
hdrMode = HDR_MODE_TONE_MAP_HDR_TO_SDR_USING_OPEN_GL;
|
||||
} else {
|
||||
requestedOutputMimeType = MimeTypes.VIDEO_H265;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user