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
ffb75d74
authored
May 23, 2022
by
claincly
Committed by
Ian Baker
May 23, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Skip performance tests if device is not capable.
PiperOrigin-RevId: 450427828
parent
e39a324b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/AndroidTestUtil.java
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/analysis/EncoderPerformanceAnalysisTest.java
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/AndroidTestUtil.java
View file @
ffb75d74
...
...
@@ -61,6 +61,14 @@ public final class AndroidTestUtil {
public
static
final
String
MP4_ASSET_WITH_INCREASING_TIMESTAMPS_360P_15S_URI_STRING
=
"asset:///media/mp4/sample_with_increasing_timestamps_360p.mp4"
;
public
static
final
Format
MP4_ASSET_WITH_INCREASING_TIMESTAMPS_360P_15S_FORMAT
=
new
Format
.
Builder
()
.
setSampleMimeType
(
MimeTypes
.
VIDEO_H264
)
.
setWidth
(
640
)
.
setHeight
(
360
)
.
setFrameRate
(
30.00f
)
.
build
();
public
static
final
String
MP4_ASSET_SEF_URI_STRING
=
"asset:///media/mp4/sample_sef_slow_motion.mp4"
;
public
static
final
Format
MP4_ASSET_SEF_FORMAT
=
...
...
@@ -258,6 +266,34 @@ public final class AndroidTestUtil {
return
true
;
}
/**
* Returns the {@link Format} of the given test asset.
*
* @param uri The string {@code uri} to the test file. The {@code uri} must be defined in this
* file.
* @throws IllegalArgumentException If the given {@code uri} is not defined in this file.
*/
public
static
Format
getFormatForTestFile
(
String
uri
)
{
switch
(
uri
)
{
case
MP4_ASSET_URI_STRING:
return
MP4_ASSET_FORMAT
;
case
MP4_ASSET_WITH_INCREASING_TIMESTAMPS_URI_STRING:
return
MP4_ASSET_WITH_INCREASING_TIMESTAMPS_FORMAT
;
case
MP4_ASSET_WITH_INCREASING_TIMESTAMPS_360P_15S_URI_STRING:
return
MP4_ASSET_WITH_INCREASING_TIMESTAMPS_360P_15S_FORMAT
;
case
MP4_ASSET_SEF_URI_STRING:
return
MP4_ASSET_SEF_FORMAT
;
case
MP4_REMOTE_10_SECONDS_URI_STRING:
return
MP4_REMOTE_10_SECONDS_FORMAT
;
case
MP4_REMOTE_H264_MP3_URI_STRING:
return
MP4_REMOTE_H264_MP3_FORMAT
;
case
MP4_REMOTE_4K60_PORTRAIT_URI_STRING:
return
MP4_REMOTE_4K60_PORTRAIT_FORMAT
;
default
:
throw
new
IllegalArgumentException
(
"The format for the given uri is not found."
);
}
}
private
static
boolean
canDecode
(
Format
format
)
throws
MediaCodecUtil
.
DecoderQueryException
{
@Nullable
MediaCodecInfo
decoderInfo
=
...
...
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/analysis/EncoderPerformanceAnalysisTest.java
View file @
ffb75d74
...
...
@@ -51,6 +51,7 @@ public class EncoderPerformanceAnalysisTest {
private
static
final
ImmutableList
<
String
>
INPUT_FILES
=
ImmutableList
.
of
(
AndroidTestUtil
.
MP4_ASSET_WITH_INCREASING_TIMESTAMPS_360P_15S_URI_STRING
,
AndroidTestUtil
.
MP4_ASSET_WITH_INCREASING_TIMESTAMPS_URI_STRING
,
AndroidTestUtil
.
MP4_REMOTE_4K60_PORTRAIT_URI_STRING
);
...
...
@@ -98,6 +99,14 @@ public class EncoderPerformanceAnalysisTest {
"analyzePerformance_%s_OpRate_%d_Priority_%d"
,
filename
,
operatingRate
,
priority
);
Context
context
=
ApplicationProvider
.
getApplicationContext
();
if
(
AndroidTestUtil
.
skipAndLogIfInsufficientCodecSupport
(
context
,
testId
,
/* decodingFormat= */
AndroidTestUtil
.
getFormatForTestFile
(
fileUri
),
/* encodingFormat= */
AndroidTestUtil
.
getFormatForTestFile
(
fileUri
)))
{
return
;
}
if
(
Util
.
SDK_INT
<
23
)
{
recordTestSkipped
(
context
,
...
...
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