use of com.google.android.exoplayer2.decoder.DecoderReuseEvaluation in project ExoPlayer by google.
the class MediaCodecInfoTest method canKeepCodec_colorInfoOmittedFromOldFormat_returnsNo.
@Test
public void canKeepCodec_colorInfoOmittedFromOldFormat_returnsNo() {
MediaCodecInfo codecInfo = buildH264CodecInfo(/* adaptive= */
false);
Format hdrVariantFormat = FORMAT_H264_4K.buildUpon().setColorInfo(buildColorInfo(C.COLOR_SPACE_BT601)).build();
assertThat(codecInfo.canReuseCodec(FORMAT_H264_4K, hdrVariantFormat)).isEqualTo(new DecoderReuseEvaluation(codecInfo.name, FORMAT_H264_4K, hdrVariantFormat, REUSE_RESULT_NO, DISCARD_REASON_VIDEO_COLOR_INFO_CHANGED));
}
use of com.google.android.exoplayer2.decoder.DecoderReuseEvaluation in project ExoPlayer by google.
the class MediaCodecInfoTest method canKeepCodec_noResolutionChange_nonAdaptiveCodec_returnsYesWithReconfiguration.
@Test
public void canKeepCodec_noResolutionChange_nonAdaptiveCodec_returnsYesWithReconfiguration() {
MediaCodecInfo codecInfo = buildH264CodecInfo(/* adaptive= */
false);
Format hdVariantFormat = FORMAT_H264_HD.buildUpon().setInitializationData(ImmutableList.of(new byte[] { 0 })).build();
assertThat(codecInfo.canReuseCodec(FORMAT_H264_HD, hdVariantFormat)).isEqualTo(new DecoderReuseEvaluation(codecInfo.name, FORMAT_H264_HD, hdVariantFormat, REUSE_RESULT_YES_WITH_RECONFIGURATION, /* discardReasons= */
0));
}
use of com.google.android.exoplayer2.decoder.DecoderReuseEvaluation in project ExoPlayer by google.
the class MediaCodecInfoTest method canKeepCodec_colorInfoChange_returnsNo.
@Test
public void canKeepCodec_colorInfoChange_returnsNo() {
MediaCodecInfo codecInfo = buildH264CodecInfo(/* adaptive= */
false);
Format hdrVariantFormat1 = FORMAT_H264_4K.buildUpon().setColorInfo(buildColorInfo(C.COLOR_SPACE_BT601)).build();
Format hdrVariantFormat2 = FORMAT_H264_4K.buildUpon().setColorInfo(buildColorInfo(C.COLOR_SPACE_BT709)).build();
assertThat(codecInfo.canReuseCodec(hdrVariantFormat1, hdrVariantFormat2)).isEqualTo(new DecoderReuseEvaluation(codecInfo.name, hdrVariantFormat1, hdrVariantFormat2, REUSE_RESULT_NO, DISCARD_REASON_VIDEO_COLOR_INFO_CHANGED));
}
use of com.google.android.exoplayer2.decoder.DecoderReuseEvaluation in project ExoPlayer by google.
the class MediaCodecInfoTest method canKeepCodec_colorInfoOmittedFromNewFormat_returnsNo.
@Test
public void canKeepCodec_colorInfoOmittedFromNewFormat_returnsNo() {
MediaCodecInfo codecInfo = buildH264CodecInfo(/* adaptive= */
false);
Format hdrVariantFormat = FORMAT_H264_4K.buildUpon().setColorInfo(buildColorInfo(C.COLOR_SPACE_BT601)).build();
assertThat(codecInfo.canReuseCodec(hdrVariantFormat, FORMAT_H264_4K)).isEqualTo(new DecoderReuseEvaluation(codecInfo.name, hdrVariantFormat, FORMAT_H264_4K, REUSE_RESULT_NO, DISCARD_REASON_VIDEO_COLOR_INFO_CHANGED));
}
use of com.google.android.exoplayer2.decoder.DecoderReuseEvaluation in project ExoPlayer by google.
the class MediaCodecInfoTest method canKeepCodec_withDifferentMimeType_returnsNo.
@Test
public void canKeepCodec_withDifferentMimeType_returnsNo() {
MediaCodecInfo codecInfo = buildH264CodecInfo(/* adaptive= */
true);
Format hdAv1Format = FORMAT_H264_HD.buildUpon().setSampleMimeType(VIDEO_AV1).build();
assertThat(codecInfo.canReuseCodec(FORMAT_H264_HD, hdAv1Format)).isEqualTo(new DecoderReuseEvaluation(codecInfo.name, FORMAT_H264_HD, hdAv1Format, REUSE_RESULT_NO, DISCARD_REASON_MIME_TYPE_CHANGED));
}
Aggregations