Fix local asset naming

PiperOrigin-RevId: 496410502
This commit is contained in:
andrewlewis 2022-12-19 16:48:41 +00:00 committed by Tianyi Feng
parent 14947539e5
commit 0744a52b8d
4 changed files with 26 additions and 26 deletions

View File

@ -93,8 +93,8 @@ public final class AndroidTestUtil {
.setFrameRate(30.472f) .setFrameRate(30.472f)
.build(); .build();
public static final String MP4_REMOTE_1080P_5_SECOND_HLG10 = "asset:///media/mp4/hlg-1080p.mp4"; public static final String MP4_ASSET_1080P_5_SECOND_HLG10 = "asset:///media/mp4/hlg-1080p.mp4";
public static final Format MP4_REMOTE_1080P_5_SECOND_HLG10_FORMAT = public static final Format MP4_ASSET_1080P_5_SECOND_HLG10_FORMAT =
new Format.Builder() new Format.Builder()
.setSampleMimeType(VIDEO_H265) .setSampleMimeType(VIDEO_H265)
.setWidth(1920) .setWidth(1920)
@ -107,8 +107,8 @@ public final class AndroidTestUtil {
C.COLOR_TRANSFER_HLG, C.COLOR_TRANSFER_HLG,
/* hdrStaticInfo= */ null)) /* hdrStaticInfo= */ null))
.build(); .build();
public static final String MP4_REMOTE_1080P_4_SECOND_HDR10 = "asset:///media/mp4/hdr10-1080p.mp4"; public static final String MP4_ASSET_1080P_4_SECOND_HDR10 = "asset:///media/mp4/hdr10-1080p.mp4";
public static final Format MP4_REMOTE_1080P_4_SECOND_HDR10_FORMAT = public static final Format MP4_ASSET_1080P_4_SECOND_HDR10_FORMAT =
new Format.Builder() new Format.Builder()
.setSampleMimeType(VIDEO_H265) .setSampleMimeType(VIDEO_H265)
.setWidth(1920) .setWidth(1920)

View File

@ -15,10 +15,10 @@
*/ */
package androidx.media3.transformer.mh; package androidx.media3.transformer.mh;
import static androidx.media3.transformer.AndroidTestUtil.MP4_REMOTE_1080P_4_SECOND_HDR10; import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_1080P_4_SECOND_HDR10;
import static androidx.media3.transformer.AndroidTestUtil.MP4_REMOTE_1080P_4_SECOND_HDR10_FORMAT; import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_1080P_4_SECOND_HDR10_FORMAT;
import static androidx.media3.transformer.AndroidTestUtil.MP4_REMOTE_1080P_5_SECOND_HLG10; import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_1080P_5_SECOND_HLG10;
import static androidx.media3.transformer.AndroidTestUtil.MP4_REMOTE_1080P_5_SECOND_HLG10_FORMAT; import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_1080P_5_SECOND_HLG10_FORMAT;
import static androidx.media3.transformer.mh.analysis.FileUtil.assertFileHasColorTransfer; import static androidx.media3.transformer.mh.analysis.FileUtil.assertFileHasColorTransfer;
import android.content.Context; import android.content.Context;
@ -54,7 +54,7 @@ public class ForceInterpretHdrVideoAsSdrTest {
if (AndroidTestUtil.skipAndLogIfInsufficientCodecSupport( if (AndroidTestUtil.skipAndLogIfInsufficientCodecSupport(
context, context,
testId, testId,
/* decodingFormat= */ MP4_REMOTE_1080P_4_SECOND_HDR10_FORMAT, /* decodingFormat= */ MP4_ASSET_1080P_4_SECOND_HDR10_FORMAT,
/* encodingFormat= */ null)) { /* encodingFormat= */ null)) {
return; return;
} }
@ -71,7 +71,7 @@ public class ForceInterpretHdrVideoAsSdrTest {
TransformationTestResult transformationTestResult = TransformationTestResult transformationTestResult =
new TransformerAndroidTestRunner.Builder(context, transformer) new TransformerAndroidTestRunner.Builder(context, transformer)
.build() .build()
.run(testId, MediaItem.fromUri(Uri.parse(MP4_REMOTE_1080P_4_SECOND_HDR10))); .run(testId, MediaItem.fromUri(Uri.parse(MP4_ASSET_1080P_4_SECOND_HDR10)));
assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR); assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR);
Log.i(TAG, "Transformed."); Log.i(TAG, "Transformed.");
} catch (TransformationException exception) { } catch (TransformationException exception) {
@ -90,7 +90,7 @@ public class ForceInterpretHdrVideoAsSdrTest {
if (AndroidTestUtil.skipAndLogIfInsufficientCodecSupport( if (AndroidTestUtil.skipAndLogIfInsufficientCodecSupport(
context, context,
testId, testId,
/* decodingFormat= */ MP4_REMOTE_1080P_5_SECOND_HLG10_FORMAT, /* decodingFormat= */ MP4_ASSET_1080P_5_SECOND_HLG10_FORMAT,
/* encodingFormat= */ null)) { /* encodingFormat= */ null)) {
return; return;
} }
@ -107,7 +107,7 @@ public class ForceInterpretHdrVideoAsSdrTest {
TransformationTestResult transformationTestResult = TransformationTestResult transformationTestResult =
new TransformerAndroidTestRunner.Builder(context, transformer) new TransformerAndroidTestRunner.Builder(context, transformer)
.build() .build()
.run(testId, MediaItem.fromUri(Uri.parse(MP4_REMOTE_1080P_5_SECOND_HLG10))); .run(testId, MediaItem.fromUri(Uri.parse(MP4_ASSET_1080P_5_SECOND_HLG10)));
assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR); assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR);
Log.i(TAG, "Transformed."); Log.i(TAG, "Transformed.");
} catch (TransformationException exception) { } catch (TransformationException exception) {

View File

@ -18,8 +18,8 @@ package androidx.media3.transformer.mh;
import static androidx.media3.common.MimeTypes.VIDEO_H265; import static androidx.media3.common.MimeTypes.VIDEO_H265;
import static androidx.media3.common.util.Assertions.checkNotNull; import static androidx.media3.common.util.Assertions.checkNotNull;
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_1080P_1_SECOND_HDR10_VIDEO_SDR_CONTAINER; import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_1080P_1_SECOND_HDR10_VIDEO_SDR_CONTAINER;
import static androidx.media3.transformer.AndroidTestUtil.MP4_REMOTE_1080P_4_SECOND_HDR10; import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_1080P_4_SECOND_HDR10;
import static androidx.media3.transformer.AndroidTestUtil.MP4_REMOTE_1080P_5_SECOND_HLG10; import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_1080P_5_SECOND_HLG10;
import static androidx.media3.transformer.AndroidTestUtil.recordTestSkipped; import static androidx.media3.transformer.AndroidTestUtil.recordTestSkipped;
import static androidx.media3.transformer.mh.analysis.FileUtil.assertFileHasColorTransfer; import static androidx.media3.transformer.mh.analysis.FileUtil.assertFileHasColorTransfer;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
@ -74,7 +74,7 @@ public class HdrEditingTest {
TransformationTestResult transformationTestResult = TransformationTestResult transformationTestResult =
new TransformerAndroidTestRunner.Builder(context, transformer) new TransformerAndroidTestRunner.Builder(context, transformer)
.build() .build()
.run(testId, MediaItem.fromUri(Uri.parse(MP4_REMOTE_1080P_4_SECOND_HDR10))); .run(testId, MediaItem.fromUri(Uri.parse(MP4_ASSET_1080P_4_SECOND_HDR10)));
Log.i(TAG, "Transformed."); Log.i(TAG, "Transformed.");
assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_ST2084); assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_ST2084);
return; return;
@ -97,7 +97,7 @@ public class HdrEditingTest {
TransformationTestResult transformationTestResult = TransformationTestResult transformationTestResult =
new TransformerAndroidTestRunner.Builder(context, transformer) new TransformerAndroidTestRunner.Builder(context, transformer)
.build() .build()
.run(testId, MediaItem.fromUri(Uri.parse(MP4_REMOTE_1080P_5_SECOND_HLG10))); .run(testId, MediaItem.fromUri(Uri.parse(MP4_ASSET_1080P_5_SECOND_HLG10)));
Log.i(TAG, "Transformed."); Log.i(TAG, "Transformed.");
assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_HLG); assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_HLG);
return; return;
@ -128,7 +128,7 @@ public class HdrEditingTest {
TransformationTestResult transformationTestResult = TransformationTestResult transformationTestResult =
new TransformerAndroidTestRunner.Builder(context, transformer) new TransformerAndroidTestRunner.Builder(context, transformer)
.build() .build()
.run(testId, MediaItem.fromUri(Uri.parse(MP4_REMOTE_1080P_4_SECOND_HDR10))); .run(testId, MediaItem.fromUri(Uri.parse(MP4_ASSET_1080P_4_SECOND_HDR10)));
assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_ST2084); assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_ST2084);
} }
@ -151,7 +151,7 @@ public class HdrEditingTest {
TransformationTestResult transformationTestResult = TransformationTestResult transformationTestResult =
new TransformerAndroidTestRunner.Builder(context, transformer) new TransformerAndroidTestRunner.Builder(context, transformer)
.build() .build()
.run(testId, MediaItem.fromUri(Uri.parse(MP4_REMOTE_1080P_5_SECOND_HLG10))); .run(testId, MediaItem.fromUri(Uri.parse(MP4_ASSET_1080P_5_SECOND_HLG10)));
assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_HLG); assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_HLG);
} }
@ -192,7 +192,7 @@ public class HdrEditingTest {
TransformationTestResult transformationTestResult = TransformationTestResult transformationTestResult =
new TransformerAndroidTestRunner.Builder(context, transformer) new TransformerAndroidTestRunner.Builder(context, transformer)
.build() .build()
.run(testId, MediaItem.fromUri(Uri.parse(MP4_REMOTE_1080P_4_SECOND_HDR10))); .run(testId, MediaItem.fromUri(Uri.parse(MP4_ASSET_1080P_4_SECOND_HDR10)));
Log.i(TAG, "Tone mapped."); Log.i(TAG, "Tone mapped.");
assertThat(isToneMappingFallbackApplied.get()).isTrue(); assertThat(isToneMappingFallbackApplied.get()).isTrue();
assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR); assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR);
@ -245,7 +245,7 @@ public class HdrEditingTest {
TransformationTestResult transformationTestResult = TransformationTestResult transformationTestResult =
new TransformerAndroidTestRunner.Builder(context, transformer) new TransformerAndroidTestRunner.Builder(context, transformer)
.build() .build()
.run(testId, MediaItem.fromUri(Uri.parse(MP4_REMOTE_1080P_5_SECOND_HLG10))); .run(testId, MediaItem.fromUri(Uri.parse(MP4_ASSET_1080P_5_SECOND_HLG10)));
Log.i(TAG, "Tone mapped."); Log.i(TAG, "Tone mapped.");
assertThat(isToneMappingFallbackApplied.get()).isTrue(); assertThat(isToneMappingFallbackApplied.get()).isTrue();
assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR); assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR);

View File

@ -16,8 +16,8 @@
package androidx.media3.transformer.mh; package androidx.media3.transformer.mh;
import static androidx.media3.common.util.Assertions.checkNotNull; import static androidx.media3.common.util.Assertions.checkNotNull;
import static androidx.media3.transformer.AndroidTestUtil.MP4_REMOTE_1080P_4_SECOND_HDR10; import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_1080P_4_SECOND_HDR10;
import static androidx.media3.transformer.AndroidTestUtil.MP4_REMOTE_1080P_5_SECOND_HLG10; import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_1080P_5_SECOND_HLG10;
import static androidx.media3.transformer.mh.analysis.FileUtil.assertFileHasColorTransfer; import static androidx.media3.transformer.mh.analysis.FileUtil.assertFileHasColorTransfer;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
@ -74,7 +74,7 @@ public class HdrToSdrToneMapTest {
TransformationTestResult transformationTestResult = TransformationTestResult transformationTestResult =
new TransformerAndroidTestRunner.Builder(context, transformer) new TransformerAndroidTestRunner.Builder(context, transformer)
.build() .build()
.run(testId, MediaItem.fromUri(Uri.parse(MP4_REMOTE_1080P_4_SECOND_HDR10))); .run(testId, MediaItem.fromUri(Uri.parse(MP4_ASSET_1080P_4_SECOND_HDR10)));
Log.i(TAG, "Tone mapped."); Log.i(TAG, "Tone mapped.");
assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR); assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR);
return; return;
@ -119,7 +119,7 @@ public class HdrToSdrToneMapTest {
TransformationTestResult transformationTestResult = TransformationTestResult transformationTestResult =
new TransformerAndroidTestRunner.Builder(context, transformer) new TransformerAndroidTestRunner.Builder(context, transformer)
.build() .build()
.run(testId, MediaItem.fromUri(Uri.parse(MP4_REMOTE_1080P_5_SECOND_HLG10))); .run(testId, MediaItem.fromUri(Uri.parse(MP4_ASSET_1080P_5_SECOND_HLG10)));
Log.i(TAG, "Tone mapped."); Log.i(TAG, "Tone mapped.");
assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR); assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR);
return; return;
@ -165,7 +165,7 @@ public class HdrToSdrToneMapTest {
TransformationTestResult transformationTestResult = TransformationTestResult transformationTestResult =
new TransformerAndroidTestRunner.Builder(context, transformer) new TransformerAndroidTestRunner.Builder(context, transformer)
.build() .build()
.run(testId, MediaItem.fromUri(Uri.parse(MP4_REMOTE_1080P_4_SECOND_HDR10))); .run(testId, MediaItem.fromUri(Uri.parse(MP4_ASSET_1080P_4_SECOND_HDR10)));
Log.i(TAG, "Tone mapped."); Log.i(TAG, "Tone mapped.");
assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR); assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR);
return; return;
@ -211,7 +211,7 @@ public class HdrToSdrToneMapTest {
TransformationTestResult transformationTestResult = TransformationTestResult transformationTestResult =
new TransformerAndroidTestRunner.Builder(context, transformer) new TransformerAndroidTestRunner.Builder(context, transformer)
.build() .build()
.run(testId, MediaItem.fromUri(Uri.parse(MP4_REMOTE_1080P_5_SECOND_HLG10))); .run(testId, MediaItem.fromUri(Uri.parse(MP4_ASSET_1080P_5_SECOND_HLG10)));
Log.i(TAG, "Tone mapped."); Log.i(TAG, "Tone mapped.");
assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR); assertFileHasColorTransfer(transformationTestResult.filePath, C.COLOR_TRANSFER_SDR);
return; return;