Search in sources :

Example 11 with MediaCodecInfo

use of androidx.media3.exoplayer.mediacodec.MediaCodecInfo in project media by androidx.

the class MediaCodecInfoTest method isSeamlessAdaptationSupported_withDifferentMimeType_returnsFalse.

@Test
@SuppressWarnings("deprecation")
public void isSeamlessAdaptationSupported_withDifferentMimeType_returnsFalse() {
    MediaCodecInfo codecInfo = buildH264CodecInfo(/* adaptive= */
    true);
    Format hdAv1Format = FORMAT_H264_HD.buildUpon().setSampleMimeType(VIDEO_AV1).build();
    assertThat(codecInfo.isSeamlessAdaptationSupported(FORMAT_H264_HD, hdAv1Format, /* isNewFormatComplete= */
    true)).isFalse();
}
Also used : Format(androidx.media3.common.Format) Test(org.junit.Test)

Example 12 with MediaCodecInfo

use of androidx.media3.exoplayer.mediacodec.MediaCodecInfo in project media by androidx.

the class MediaCodecInfoTest method isSeamlessAdaptationSupported_colorInfoOmittedFromCompleteNewFormat_returnsFalse.

@Test
@SuppressWarnings("deprecation")
public void isSeamlessAdaptationSupported_colorInfoOmittedFromCompleteNewFormat_returnsFalse() {
    MediaCodecInfo codecInfo = buildH264CodecInfo(/* adaptive= */
    false);
    Format hdrVariantFormat = FORMAT_H264_4K.buildUpon().setColorInfo(buildColorInfo(C.COLOR_SPACE_BT601)).build();
    assertThat(codecInfo.isSeamlessAdaptationSupported(hdrVariantFormat, FORMAT_H264_4K, /* isNewFormatComplete= */
    true)).isFalse();
}
Also used : Format(androidx.media3.common.Format) Test(org.junit.Test)

Example 13 with MediaCodecInfo

use of androidx.media3.exoplayer.mediacodec.MediaCodecInfo in project media by androidx.

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));
}
Also used : Format(androidx.media3.common.Format) DecoderReuseEvaluation(androidx.media3.exoplayer.DecoderReuseEvaluation) Test(org.junit.Test)

Example 14 with MediaCodecInfo

use of androidx.media3.exoplayer.mediacodec.MediaCodecInfo in project media by androidx.

the class MediaCodecInfoTest method isSeamlessAdaptationSupported_withRotation_returnsFalse.

@Test
@SuppressWarnings("deprecation")
public void isSeamlessAdaptationSupported_withRotation_returnsFalse() {
    MediaCodecInfo codecInfo = buildH264CodecInfo(/* adaptive= */
    true);
    Format hdRotatedFormat = FORMAT_H264_HD.buildUpon().setRotationDegrees(90).build();
    assertThat(codecInfo.isSeamlessAdaptationSupported(FORMAT_H264_HD, hdRotatedFormat, /* isNewFormatComplete= */
    true)).isFalse();
}
Also used : Format(androidx.media3.common.Format) Test(org.junit.Test)

Example 15 with MediaCodecInfo

use of androidx.media3.exoplayer.mediacodec.MediaCodecInfo in project media by androidx.

the class MediaCodecInfoTest method isSeamlessAdaptationSupported_colorInfoOmittedFromIncompleteNewFormat_returnsTrue.

@Test
@SuppressWarnings("deprecation")
public void isSeamlessAdaptationSupported_colorInfoOmittedFromIncompleteNewFormat_returnsTrue() {
    MediaCodecInfo codecInfo = buildH264CodecInfo(/* adaptive= */
    false);
    Format hdrVariantFormat = FORMAT_H264_4K.buildUpon().setColorInfo(buildColorInfo(C.COLOR_SPACE_BT601)).build();
    assertThat(codecInfo.isSeamlessAdaptationSupported(hdrVariantFormat, FORMAT_H264_4K, /* isNewFormatComplete= */
    false)).isTrue();
}
Also used : Format(androidx.media3.common.Format) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)21 Format (androidx.media3.common.Format)20 DecoderReuseEvaluation (androidx.media3.exoplayer.DecoderReuseEvaluation)14 SuppressLint (android.annotation.SuppressLint)8 Nullable (androidx.annotation.Nullable)6 MediaCodecInfo (androidx.media3.exoplayer.mediacodec.MediaCodecInfo)6 Point (android.graphics.Point)5 MediaFormat (android.media.MediaFormat)3 DecoderDiscardReasons (androidx.media3.exoplayer.DecoderReuseEvaluation.DecoderDiscardReasons)3 CodecCapabilities (android.media.MediaCodecInfo.CodecCapabilities)2 RendererCapabilities (androidx.media3.exoplayer.RendererCapabilities)2 MediaCodecInfo (android.media.MediaCodecInfo)1 Surface (android.view.Surface)1 CallSuper (androidx.annotation.CallSuper)1 DrmInitData (androidx.media3.common.DrmInitData)1 FrameworkCryptoConfig (androidx.media3.exoplayer.drm.FrameworkCryptoConfig)1 MediaCodecAdapter (androidx.media3.exoplayer.mediacodec.MediaCodecAdapter)1 DecoderQueryException (androidx.media3.exoplayer.mediacodec.MediaCodecUtil.DecoderQueryException)1 GtsTestUtil.shouldSkipWidevineTest (androidx.media3.test.exoplayer.playback.gts.GtsTestUtil.shouldSkipWidevineTest)1 RequiresNonNull (org.checkerframework.checker.nullness.qual.RequiresNonNull)1