Commit e58427ac by claincly Committed by Ian Baker

Add default impl for some InputHandler methods.

And minor fixes.

PiperOrigin-RevId: 526717927
parent 28641637
......@@ -207,7 +207,7 @@ public interface VideoFrameProcessor {
void registerInputFrame();
/**
* returns the number of input frames that have been made available to the {@code
* Returns the number of input frames that have been made available to the {@code
* VideoFrameProcessor} but have not been processed yet.
*
* <p>Can be called on any thread.
......
......@@ -21,10 +21,8 @@ import static java.lang.Math.round;
import android.graphics.Bitmap;
import android.opengl.GLES20;
import android.opengl.GLUtils;
import android.view.Surface;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.util.FrameInfo;
import com.google.android.exoplayer2.util.GlTextureInfo;
import com.google.android.exoplayer2.util.GlUtil;
import com.google.android.exoplayer2.util.VideoFrameProcessingException;
......@@ -78,11 +76,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
}
@Override
public void setDefaultBufferSize(int width, int height) {
throw new UnsupportedOperationException();
}
@Override
public void queueInputBitmap(
Bitmap inputBitmap, long durationUs, float frameRate, boolean useHdr) {
videoFrameProcessingTaskExecutor.submit(
......@@ -90,16 +83,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
}
@Override
public Surface getInputSurface() {
throw new UnsupportedOperationException();
}
@Override
public void registerInputFrame(FrameInfo frameInfo) {
// Do nothing.
}
@Override
public int getPendingFrameCount() {
// Always treat all queued bitmaps as immediately processed.
return 0;
......
......@@ -17,7 +17,6 @@ package com.google.android.exoplayer2.effect;
import static com.google.android.exoplayer2.util.Assertions.checkStateNotNull;
import android.graphics.Bitmap;
import android.graphics.SurfaceTexture;
import android.view.Surface;
import androidx.annotation.Nullable;
......@@ -111,12 +110,6 @@ import java.util.concurrent.atomic.AtomicInteger;
}
@Override
public void queueInputBitmap(
Bitmap inputBitmap, long durationUs, float frameRate, boolean useHdr) {
throw new UnsupportedOperationException();
}
@Override
public Surface getInputSurface() {
return surface;
}
......
......@@ -32,24 +32,33 @@ import com.google.android.exoplayer2.util.VideoFrameProcessor;
*
* <p>Only works when the input is received on a {@link SurfaceTexture}.
*/
void setDefaultBufferSize(int width, int height);
default void setDefaultBufferSize(int width, int height) {
throw new UnsupportedOperationException();
}
/**
* Provides an input {@link Bitmap} to put into the video frames.
*
* @see VideoFrameProcessor#queueInputBitmap
*/
void queueInputBitmap(Bitmap inputBitmap, long durationUs, float frameRate, boolean useHdr);
default void queueInputBitmap(
Bitmap inputBitmap, long durationUs, float frameRate, boolean useHdr) {
throw new UnsupportedOperationException();
}
/**
* See {@link VideoFrameProcessor#getInputSurface}.
*
* <p>Only works when the input is received on a {@link SurfaceTexture}.
*/
Surface getInputSurface();
default Surface getInputSurface() {
throw new UnsupportedOperationException();
}
/** Informs the {@code InputHandler} that a frame will be queued. */
void registerInputFrame(FrameInfo frameInfo);
default void registerInputFrame(FrameInfo frameInfo) {
throw new UnsupportedOperationException();
}
/** See {@link VideoFrameProcessor#getPendingInputFrameCount}. */
int getPendingFrameCount();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment