Commit ddb9b70c by michaelkatz Committed by microkatz

Add RequiresApi annotations to some unittest methods

PiperOrigin-RevId: 518258380
parent d49b1781
......@@ -31,6 +31,7 @@ import android.media.Image;
import android.opengl.GLES20;
import android.opengl.GLUtils;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import com.google.android.exoplayer2.util.GlUtil;
import com.google.android.exoplayer2.util.Log;
import java.io.File;
......@@ -81,6 +82,7 @@ public class BitmapPixelTestUtil {
* Returns a bitmap with the same information as the provided alpha/red/green/blue 8-bits per
* component image.
*/
@RequiresApi(19)
public static Bitmap createArgb8888BitmapFromRgba8888Image(Image image) {
int width = image.getWidth();
int height = image.getHeight();
......
......@@ -22,6 +22,7 @@ import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import static com.google.android.exoplayer2.util.Assertions.checkStateNotNull;
import static com.google.common.truth.Truth.assertThat;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.graphics.PixelFormat;
import android.media.Image;
......@@ -259,6 +260,7 @@ public final class VideoFrameProcessorTestRunner {
/* releaseFramesAutomatically= */ true,
MoreExecutors.directExecutor(),
new VideoFrameProcessor.Listener() {
@SuppressLint("WrongConstant")
@Override
public void onOutputSizeChanged(int width, int height) {
outputImageReader =
......@@ -287,6 +289,7 @@ public final class VideoFrameProcessorTestRunner {
});
}
@RequiresApi(19)
public Bitmap processFirstFrameAndEnd() throws Exception {
DecodeOneFrameUtil.decodeOneAssetFileFrame(
checkNotNull(videoAssetPath),
......@@ -319,6 +322,7 @@ public final class VideoFrameProcessorTestRunner {
videoFrameProcessor.queueInputBitmap(inputBitmap, durationUs, frameRate);
}
@RequiresApi(19)
public Bitmap endFrameProcessingAndGetImage() throws Exception {
videoFrameProcessor.signalEndOfInput();
Thread.sleep(VIDEO_FRAME_PROCESSING_WAIT_MS);
......
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