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 { ...@@ -207,7 +207,7 @@ public interface VideoFrameProcessor {
void registerInputFrame(); 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. * VideoFrameProcessor} but have not been processed yet.
* *
* <p>Can be called on any thread. * <p>Can be called on any thread.
......
...@@ -21,10 +21,8 @@ import static java.lang.Math.round; ...@@ -21,10 +21,8 @@ import static java.lang.Math.round;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.opengl.GLES20; import android.opengl.GLES20;
import android.opengl.GLUtils; import android.opengl.GLUtils;
import android.view.Surface;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; 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.GlTextureInfo;
import com.google.android.exoplayer2.util.GlUtil; import com.google.android.exoplayer2.util.GlUtil;
import com.google.android.exoplayer2.util.VideoFrameProcessingException; import com.google.android.exoplayer2.util.VideoFrameProcessingException;
...@@ -78,11 +76,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -78,11 +76,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
} }
@Override @Override
public void setDefaultBufferSize(int width, int height) {
throw new UnsupportedOperationException();
}
@Override
public void queueInputBitmap( public void queueInputBitmap(
Bitmap inputBitmap, long durationUs, float frameRate, boolean useHdr) { Bitmap inputBitmap, long durationUs, float frameRate, boolean useHdr) {
videoFrameProcessingTaskExecutor.submit( videoFrameProcessingTaskExecutor.submit(
...@@ -90,16 +83,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -90,16 +83,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
} }
@Override @Override
public Surface getInputSurface() {
throw new UnsupportedOperationException();
}
@Override
public void registerInputFrame(FrameInfo frameInfo) {
// Do nothing.
}
@Override
public int getPendingFrameCount() { public int getPendingFrameCount() {
// Always treat all queued bitmaps as immediately processed. // Always treat all queued bitmaps as immediately processed.
return 0; return 0;
......
...@@ -17,7 +17,6 @@ package com.google.android.exoplayer2.effect; ...@@ -17,7 +17,6 @@ package com.google.android.exoplayer2.effect;
import static com.google.android.exoplayer2.util.Assertions.checkStateNotNull; import static com.google.android.exoplayer2.util.Assertions.checkStateNotNull;
import android.graphics.Bitmap;
import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture;
import android.view.Surface; import android.view.Surface;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -111,12 +110,6 @@ import java.util.concurrent.atomic.AtomicInteger; ...@@ -111,12 +110,6 @@ import java.util.concurrent.atomic.AtomicInteger;
} }
@Override @Override
public void queueInputBitmap(
Bitmap inputBitmap, long durationUs, float frameRate, boolean useHdr) {
throw new UnsupportedOperationException();
}
@Override
public Surface getInputSurface() { public Surface getInputSurface() {
return surface; return surface;
} }
......
...@@ -32,24 +32,33 @@ import com.google.android.exoplayer2.util.VideoFrameProcessor; ...@@ -32,24 +32,33 @@ import com.google.android.exoplayer2.util.VideoFrameProcessor;
* *
* <p>Only works when the input is received on a {@link SurfaceTexture}. * <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. * Provides an input {@link Bitmap} to put into the video frames.
* *
* @see VideoFrameProcessor#queueInputBitmap * @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}. * See {@link VideoFrameProcessor#getInputSurface}.
* *
* <p>Only works when the input is received on a {@link SurfaceTexture}. * <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. */ /** 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}. */ /** See {@link VideoFrameProcessor#getPendingInputFrameCount}. */
int getPendingFrameCount(); 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