mirror of
https://github.com/androidx/media.git
synced 2025-05-04 14:10:40 +08:00
Update FrameProcessor.create()
to accept an input track type.
Based on [this conversation thread](https://chat.google.com/room/AAAA--f88ao/76Rem_cRCK8), I've opted to update the existing FrameProcessor.create() rather than deprecate it, as it is unlikely to be in use by apps outside google3. PiperOrigin-RevId: 506920930
This commit is contained in:
parent
557b7dcc71
commit
d4db00e51a
@ -49,6 +49,8 @@ public interface FrameProcessor {
|
|||||||
* @param debugViewProvider A {@link DebugViewProvider}.
|
* @param debugViewProvider A {@link DebugViewProvider}.
|
||||||
* @param inputColorInfo The {@link ColorInfo} for input frames.
|
* @param inputColorInfo The {@link ColorInfo} for input frames.
|
||||||
* @param outputColorInfo The {@link ColorInfo} for output frames.
|
* @param outputColorInfo The {@link ColorInfo} for output frames.
|
||||||
|
* @param inputTrackType The {@link C.TrackType} of the input. Supported track types are {@link
|
||||||
|
* C#TRACK_TYPE_VIDEO} and {@link C#TRACK_TYPE_IMAGE}.
|
||||||
* @param releaseFramesAutomatically If {@code true}, the {@link FrameProcessor} will render
|
* @param releaseFramesAutomatically If {@code true}, the {@link FrameProcessor} will render
|
||||||
* output frames to the {@linkplain #setOutputSurfaceInfo(SurfaceInfo) output surface}
|
* output frames to the {@linkplain #setOutputSurfaceInfo(SurfaceInfo) output surface}
|
||||||
* automatically as {@link FrameProcessor} is done processing them. If {@code false}, the
|
* automatically as {@link FrameProcessor} is done processing them. If {@code false}, the
|
||||||
@ -66,6 +68,7 @@ public interface FrameProcessor {
|
|||||||
DebugViewProvider debugViewProvider,
|
DebugViewProvider debugViewProvider,
|
||||||
ColorInfo inputColorInfo,
|
ColorInfo inputColorInfo,
|
||||||
ColorInfo outputColorInfo,
|
ColorInfo outputColorInfo,
|
||||||
|
@C.TrackType int inputTrackType,
|
||||||
boolean releaseFramesAutomatically,
|
boolean releaseFramesAutomatically,
|
||||||
Executor executor,
|
Executor executor,
|
||||||
Listener listener)
|
Listener listener)
|
||||||
|
@ -1982,6 +1982,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
|||||||
DebugViewProvider.NONE,
|
DebugViewProvider.NONE,
|
||||||
inputColorInfo,
|
inputColorInfo,
|
||||||
outputColorInfo,
|
outputColorInfo,
|
||||||
|
C.TRACK_TYPE_VIDEO,
|
||||||
/* releaseFramesAutomatically= */ false,
|
/* releaseFramesAutomatically= */ false,
|
||||||
/* executor= */ handler::post,
|
/* executor= */ handler::post,
|
||||||
new FrameProcessor.Listener() {
|
new FrameProcessor.Listener() {
|
||||||
|
@ -25,6 +25,7 @@ import android.media.Image;
|
|||||||
import android.media.ImageReader;
|
import android.media.ImageReader;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.util.DebugViewProvider;
|
import com.google.android.exoplayer2.util.DebugViewProvider;
|
||||||
import com.google.android.exoplayer2.util.FrameInfo;
|
import com.google.android.exoplayer2.util.FrameInfo;
|
||||||
import com.google.android.exoplayer2.util.FrameProcessingException;
|
import com.google.android.exoplayer2.util.FrameProcessingException;
|
||||||
@ -295,6 +296,7 @@ public final class GlEffectsFrameProcessorFrameReleaseTest {
|
|||||||
DebugViewProvider.NONE,
|
DebugViewProvider.NONE,
|
||||||
/* inputColorInfo= */ ColorInfo.SDR_BT709_LIMITED,
|
/* inputColorInfo= */ ColorInfo.SDR_BT709_LIMITED,
|
||||||
/* outputColorInfo= */ ColorInfo.SDR_BT709_LIMITED,
|
/* outputColorInfo= */ ColorInfo.SDR_BT709_LIMITED,
|
||||||
|
C.TRACK_TYPE_VIDEO,
|
||||||
releaseFramesAutomatically,
|
releaseFramesAutomatically,
|
||||||
MoreExecutors.directExecutor(),
|
MoreExecutors.directExecutor(),
|
||||||
new FrameProcessor.Listener() {
|
new FrameProcessor.Listener() {
|
||||||
|
@ -94,6 +94,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
|
|||||||
DebugViewProvider debugViewProvider,
|
DebugViewProvider debugViewProvider,
|
||||||
ColorInfo inputColorInfo,
|
ColorInfo inputColorInfo,
|
||||||
ColorInfo outputColorInfo,
|
ColorInfo outputColorInfo,
|
||||||
|
@C.TrackType int inputTrackType,
|
||||||
boolean releaseFramesAutomatically,
|
boolean releaseFramesAutomatically,
|
||||||
Executor listenerExecutor,
|
Executor listenerExecutor,
|
||||||
Listener listener)
|
Listener listener)
|
||||||
|
@ -154,6 +154,7 @@ import org.checkerframework.dataflow.qual.Pure;
|
|||||||
debugViewProvider,
|
debugViewProvider,
|
||||||
frameProcessorInputColor,
|
frameProcessorInputColor,
|
||||||
frameProcessorOutputColor,
|
frameProcessorOutputColor,
|
||||||
|
MimeTypes.getTrackType(firstInputFormat.sampleMimeType),
|
||||||
/* releaseFramesAutomatically= */ true,
|
/* releaseFramesAutomatically= */ true,
|
||||||
MoreExecutors.directExecutor(),
|
MoreExecutors.directExecutor(),
|
||||||
new FrameProcessor.Listener() {
|
new FrameProcessor.Listener() {
|
||||||
|
@ -28,6 +28,7 @@ import android.media.Image;
|
|||||||
import android.media.ImageReader;
|
import android.media.ImageReader;
|
||||||
import android.media.MediaFormat;
|
import android.media.MediaFormat;
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.util.DebugViewProvider;
|
import com.google.android.exoplayer2.util.DebugViewProvider;
|
||||||
import com.google.android.exoplayer2.util.Effect;
|
import com.google.android.exoplayer2.util.Effect;
|
||||||
import com.google.android.exoplayer2.util.FrameInfo;
|
import com.google.android.exoplayer2.util.FrameInfo;
|
||||||
@ -223,6 +224,7 @@ public final class FrameProcessorTestRunner {
|
|||||||
DebugViewProvider.NONE,
|
DebugViewProvider.NONE,
|
||||||
inputColorInfo,
|
inputColorInfo,
|
||||||
outputColorInfo,
|
outputColorInfo,
|
||||||
|
C.TRACK_TYPE_VIDEO,
|
||||||
/* releaseFramesAutomatically= */ true,
|
/* releaseFramesAutomatically= */ true,
|
||||||
MoreExecutors.directExecutor(),
|
MoreExecutors.directExecutor(),
|
||||||
new FrameProcessor.Listener() {
|
new FrameProcessor.Listener() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user