mirror of
https://github.com/samsonjs/media.git
synced 2026-03-28 09:55:48 +00:00
Skip transform4K60 test if 4K decoding is not supported.
4K decoding is not supported (not required to be supported) on all devices, e.g., Nexus 5 does not support it. PiperOrigin-RevId: 450682519
This commit is contained in:
parent
9c5bc56df1
commit
066327daf9
2 changed files with 13 additions and 3 deletions
|
|
@ -232,11 +232,11 @@ public final class AndroidTestUtil {
|
|||
* @param context The {@link Context context}.
|
||||
* @param testId The test ID.
|
||||
* @param decodingFormat The {@link Format format} to decode.
|
||||
* @param encodingFormat The {@link Format format} to encode.
|
||||
* @param encodingFormat The {@link Format format} to encode, optional.
|
||||
* @return Whether the test should be skipped.
|
||||
*/
|
||||
public static boolean skipAndLogIfInsufficientCodecSupport(
|
||||
Context context, String testId, Format decodingFormat, Format encodingFormat)
|
||||
Context context, String testId, Format decodingFormat, @Nullable Format encodingFormat)
|
||||
throws IOException, JSONException {
|
||||
boolean canDecode = false;
|
||||
@Nullable MediaCodecUtil.DecoderQueryException queryException = null;
|
||||
|
|
@ -246,7 +246,7 @@ public final class AndroidTestUtil {
|
|||
queryException = e;
|
||||
}
|
||||
|
||||
boolean canEncode = canEncode(encodingFormat);
|
||||
boolean canEncode = encodingFormat == null || canEncode(encodingFormat);
|
||||
|
||||
if (canDecode && canEncode) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import static com.google.android.exoplayer2.transformer.AndroidTestUtil.FORCE_EN
|
|||
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.MP4_ASSET_SEF_URI_STRING;
|
||||
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.MP4_ASSET_URI_STRING;
|
||||
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.MP4_ASSET_WITH_INCREASING_TIMESTAMPS_URI_STRING;
|
||||
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.MP4_REMOTE_4K60_PORTRAIT_FORMAT;
|
||||
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.MP4_REMOTE_4K60_PORTRAIT_URI_STRING;
|
||||
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.recordTestSkipped;
|
||||
|
||||
|
|
@ -90,6 +91,15 @@ public class TransformationTest {
|
|||
public void transform4K60() throws Exception {
|
||||
String testId = TAG + "_transform4K60";
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
|
||||
if (AndroidTestUtil.skipAndLogIfInsufficientCodecSupport(
|
||||
context,
|
||||
testId,
|
||||
/* decodingFormat= */ MP4_REMOTE_4K60_PORTRAIT_FORMAT,
|
||||
/* encodingFormat= */ null)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Transformer transformer =
|
||||
new Transformer.Builder(context).setEncoderFactory(FORCE_ENCODE_ENCODER_FACTORY).build();
|
||||
new TransformerAndroidTestRunner.Builder(context, transformer)
|
||||
|
|
|
|||
Loading…
Reference in a new issue