use of androidx.media3.exoplayer.DecoderReuseEvaluation in project media by androidx.
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));
}
use of androidx.media3.exoplayer.DecoderReuseEvaluation in project media by androidx.
the class MediaCodecInfoTest method canKeepCodec_audioWithSameChannelCounts_returnsYesWithFlush.
@Test
public void canKeepCodec_audioWithSameChannelCounts_returnsYesWithFlush() {
MediaCodecInfo codecInfo = buildAacCodecInfo();
Format stereoVariantFormat = FORMAT_AAC_STEREO.buildUpon().setAverageBitrate(100).build();
assertThat(codecInfo.canReuseCodec(FORMAT_AAC_STEREO, stereoVariantFormat)).isEqualTo(new DecoderReuseEvaluation(codecInfo.name, FORMAT_AAC_STEREO, stereoVariantFormat, REUSE_RESULT_YES_WITH_FLUSH, /* discardReasons= */
0));
}
use of androidx.media3.exoplayer.DecoderReuseEvaluation in project media by androidx.
the class MediaCodecInfoTest method canKeepCodec_audioWithDifferentChannelCounts_returnsNo.
@Test
public void canKeepCodec_audioWithDifferentChannelCounts_returnsNo() {
MediaCodecInfo codecInfo = buildAacCodecInfo();
assertThat(codecInfo.canReuseCodec(FORMAT_AAC_STEREO, FORMAT_AAC_SURROUND)).isEqualTo(new DecoderReuseEvaluation(codecInfo.name, FORMAT_AAC_STEREO, FORMAT_AAC_SURROUND, REUSE_RESULT_NO, DISCARD_REASON_AUDIO_CHANNEL_COUNT_CHANGED));
}
use of androidx.media3.exoplayer.DecoderReuseEvaluation in project media by androidx.
the class MediaCodecInfoTest method canKeepCodec_audioWithDifferentInitializationData_returnsNo.
@Test
public void canKeepCodec_audioWithDifferentInitializationData_returnsNo() {
MediaCodecInfo codecInfo = buildAacCodecInfo();
Format stereoVariantFormat = FORMAT_AAC_STEREO.buildUpon().setInitializationData(ImmutableList.of(new byte[] { 0 })).build();
assertThat(codecInfo.canReuseCodec(FORMAT_AAC_STEREO, stereoVariantFormat)).isEqualTo(new DecoderReuseEvaluation(codecInfo.name, FORMAT_AAC_STEREO, stereoVariantFormat, REUSE_RESULT_NO, DISCARD_REASON_INITIALIZATION_DATA_CHANGED));
}
use of androidx.media3.exoplayer.DecoderReuseEvaluation in project media by androidx.
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));
}
Aggregations