Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ddb9b70c
authored
Mar 21, 2023
by
michaelkatz
Committed by
microkatz
Mar 21, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add RequiresApi annotations to some unittest methods
PiperOrigin-RevId: 518258380
parent
d49b1781
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
testutils/src/main/java/com/google/android/exoplayer2/testutil/BitmapPixelTestUtil.java
testutils/src/main/java/com/google/android/exoplayer2/testutil/VideoFrameProcessorTestRunner.java
testutils/src/main/java/com/google/android/exoplayer2/testutil/BitmapPixelTestUtil.java
View file @
ddb9b70c
...
@@ -31,6 +31,7 @@ import android.media.Image;
...
@@ -31,6 +31,7 @@ import android.media.Image;
import
android.opengl.GLES20
;
import
android.opengl.GLES20
;
import
android.opengl.GLUtils
;
import
android.opengl.GLUtils
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.RequiresApi
;
import
com.google.android.exoplayer2.util.GlUtil
;
import
com.google.android.exoplayer2.util.GlUtil
;
import
com.google.android.exoplayer2.util.Log
;
import
com.google.android.exoplayer2.util.Log
;
import
java.io.File
;
import
java.io.File
;
...
@@ -81,6 +82,7 @@ public class BitmapPixelTestUtil {
...
@@ -81,6 +82,7 @@ public class BitmapPixelTestUtil {
* Returns a bitmap with the same information as the provided alpha/red/green/blue 8-bits per
* Returns a bitmap with the same information as the provided alpha/red/green/blue 8-bits per
* component image.
* component image.
*/
*/
@RequiresApi
(
19
)
public
static
Bitmap
createArgb8888BitmapFromRgba8888Image
(
Image
image
)
{
public
static
Bitmap
createArgb8888BitmapFromRgba8888Image
(
Image
image
)
{
int
width
=
image
.
getWidth
();
int
width
=
image
.
getWidth
();
int
height
=
image
.
getHeight
();
int
height
=
image
.
getHeight
();
...
...
testutils/src/main/java/com/google/android/exoplayer2/testutil/VideoFrameProcessorTestRunner.java
View file @
ddb9b70c
...
@@ -22,6 +22,7 @@ import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
...
@@ -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
.
android
.
exoplayer2
.
util
.
Assertions
.
checkStateNotNull
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
android.annotation.SuppressLint
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.graphics.PixelFormat
;
import
android.graphics.PixelFormat
;
import
android.media.Image
;
import
android.media.Image
;
...
@@ -259,6 +260,7 @@ public final class VideoFrameProcessorTestRunner {
...
@@ -259,6 +260,7 @@ public final class VideoFrameProcessorTestRunner {
/* releaseFramesAutomatically= */
true
,
/* releaseFramesAutomatically= */
true
,
MoreExecutors
.
directExecutor
(),
MoreExecutors
.
directExecutor
(),
new
VideoFrameProcessor
.
Listener
()
{
new
VideoFrameProcessor
.
Listener
()
{
@SuppressLint
(
"WrongConstant"
)
@Override
@Override
public
void
onOutputSizeChanged
(
int
width
,
int
height
)
{
public
void
onOutputSizeChanged
(
int
width
,
int
height
)
{
outputImageReader
=
outputImageReader
=
...
@@ -287,6 +289,7 @@ public final class VideoFrameProcessorTestRunner {
...
@@ -287,6 +289,7 @@ public final class VideoFrameProcessorTestRunner {
});
});
}
}
@RequiresApi
(
19
)
public
Bitmap
processFirstFrameAndEnd
()
throws
Exception
{
public
Bitmap
processFirstFrameAndEnd
()
throws
Exception
{
DecodeOneFrameUtil
.
decodeOneAssetFileFrame
(
DecodeOneFrameUtil
.
decodeOneAssetFileFrame
(
checkNotNull
(
videoAssetPath
),
checkNotNull
(
videoAssetPath
),
...
@@ -319,6 +322,7 @@ public final class VideoFrameProcessorTestRunner {
...
@@ -319,6 +322,7 @@ public final class VideoFrameProcessorTestRunner {
videoFrameProcessor
.
queueInputBitmap
(
inputBitmap
,
durationUs
,
frameRate
);
videoFrameProcessor
.
queueInputBitmap
(
inputBitmap
,
durationUs
,
frameRate
);
}
}
@RequiresApi
(
19
)
public
Bitmap
endFrameProcessingAndGetImage
()
throws
Exception
{
public
Bitmap
endFrameProcessingAndGetImage
()
throws
Exception
{
videoFrameProcessor
.
signalEndOfInput
();
videoFrameProcessor
.
signalEndOfInput
();
Thread
.
sleep
(
VIDEO_FRAME_PROCESSING_WAIT_MS
);
Thread
.
sleep
(
VIDEO_FRAME_PROCESSING_WAIT_MS
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment