Search in sources :

Example 1 with MediaCodecSelector

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

the class DefaultRenderersFactory method buildAudioRenderers.

/**
 * Builds audio renderers for use by the player.
 *
 * @param context The {@link Context} associated with the player.
 * @param extensionRendererMode The extension renderer mode.
 * @param mediaCodecSelector A decoder selector.
 * @param enableDecoderFallback Whether to enable fallback to lower-priority decoders if decoder
 *     initialization fails. This may result in using a decoder that is slower/less efficient than
 *     the primary decoder.
 * @param audioSink A sink to which the renderers will output.
 * @param eventHandler A handler to use when invoking event listeners and outputs.
 * @param eventListener An event listener.
 * @param out An array to which the built renderers should be appended.
 */
protected void buildAudioRenderers(Context context, @ExtensionRendererMode int extensionRendererMode, MediaCodecSelector mediaCodecSelector, boolean enableDecoderFallback, AudioSink audioSink, Handler eventHandler, AudioRendererEventListener eventListener, ArrayList<Renderer> out) {
    MediaCodecAudioRenderer audioRenderer = new MediaCodecAudioRenderer(context, getCodecAdapterFactory(), mediaCodecSelector, enableDecoderFallback, eventHandler, eventListener, audioSink);
    out.add(audioRenderer);
    if (extensionRendererMode == EXTENSION_RENDERER_MODE_OFF) {
        return;
    }
    int extensionRendererIndex = out.size();
    if (extensionRendererMode == EXTENSION_RENDERER_MODE_PREFER) {
        extensionRendererIndex--;
    }
    try {
        // Full class names used for constructor args so the LINT rule triggers if any of them move.
        Class<?> clazz = Class.forName("androidx.media3.decoder.opus.LibopusAudioRenderer");
        Constructor<?> constructor = clazz.getConstructor(android.os.Handler.class, androidx.media3.exoplayer.audio.AudioRendererEventListener.class, androidx.media3.exoplayer.audio.AudioSink.class);
        Renderer renderer = (Renderer) constructor.newInstance(eventHandler, eventListener, audioSink);
        out.add(extensionRendererIndex++, renderer);
        Log.i(TAG, "Loaded LibopusAudioRenderer.");
    } catch (ClassNotFoundException e) {
    // Expected if the app was built without the extension.
    } catch (Exception e) {
        // The extension is present, but instantiation failed.
        throw new RuntimeException("Error instantiating Opus extension", e);
    }
    try {
        // Full class names used for constructor args so the LINT rule triggers if any of them move.
        Class<?> clazz = Class.forName("androidx.media3.decoder.flac.LibflacAudioRenderer");
        Constructor<?> constructor = clazz.getConstructor(android.os.Handler.class, androidx.media3.exoplayer.audio.AudioRendererEventListener.class, androidx.media3.exoplayer.audio.AudioSink.class);
        Renderer renderer = (Renderer) constructor.newInstance(eventHandler, eventListener, audioSink);
        out.add(extensionRendererIndex++, renderer);
        Log.i(TAG, "Loaded LibflacAudioRenderer.");
    } catch (ClassNotFoundException e) {
    // Expected if the app was built without the extension.
    } catch (Exception e) {
        // The extension is present, but instantiation failed.
        throw new RuntimeException("Error instantiating FLAC extension", e);
    }
    try {
        // Full class names used for constructor args so the LINT rule triggers if any of them move.
        Class<?> clazz = Class.forName("androidx.media3.decoder.ffmpeg.FfmpegAudioRenderer");
        Constructor<?> constructor = clazz.getConstructor(android.os.Handler.class, androidx.media3.exoplayer.audio.AudioRendererEventListener.class, androidx.media3.exoplayer.audio.AudioSink.class);
        Renderer renderer = (Renderer) constructor.newInstance(eventHandler, eventListener, audioSink);
        out.add(extensionRendererIndex++, renderer);
        Log.i(TAG, "Loaded FfmpegAudioRenderer.");
    } catch (ClassNotFoundException e) {
    // Expected if the app was built without the extension.
    } catch (Exception e) {
        // The extension is present, but instantiation failed.
        throw new RuntimeException("Error instantiating FFmpeg extension", e);
    }
}
Also used : MediaCodecAudioRenderer(androidx.media3.exoplayer.audio.MediaCodecAudioRenderer) MediaCodecAudioRenderer(androidx.media3.exoplayer.audio.MediaCodecAudioRenderer) TextRenderer(androidx.media3.exoplayer.text.TextRenderer) MediaCodecVideoRenderer(androidx.media3.exoplayer.video.MediaCodecVideoRenderer) CameraMotionRenderer(androidx.media3.exoplayer.video.spherical.CameraMotionRenderer) MetadataRenderer(androidx.media3.exoplayer.metadata.MetadataRenderer)

Example 2 with MediaCodecSelector

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

the class MediaCodecAudioRenderer method supportsFormat.

@Override
@Capabilities
protected int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format) throws DecoderQueryException {
    if (!MimeTypes.isAudio(format.sampleMimeType)) {
        return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
    }
    @TunnelingSupport int tunnelingSupport = Util.SDK_INT >= 21 ? TUNNELING_SUPPORTED : TUNNELING_NOT_SUPPORTED;
    boolean formatHasDrm = format.cryptoType != C.CRYPTO_TYPE_NONE;
    boolean supportsFormatDrm = supportsFormatDrm(format);
    // Else we don't don't need a decoder at all.
    if (supportsFormatDrm && audioSink.supportsFormat(format) && (!formatHasDrm || MediaCodecUtil.getDecryptOnlyDecoderInfo() != null)) {
        return RendererCapabilities.create(C.FORMAT_HANDLED, ADAPTIVE_NOT_SEAMLESS, tunnelingSupport);
    }
    // the input format directly.
    if (MimeTypes.AUDIO_RAW.equals(format.sampleMimeType) && !audioSink.supportsFormat(format)) {
        return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_SUBTYPE);
    }
    // For all other input formats, we expect the decoder to output 16-bit PCM.
    if (!audioSink.supportsFormat(Util.getPcmFormat(C.ENCODING_PCM_16BIT, format.channelCount, format.sampleRate))) {
        return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_SUBTYPE);
    }
    List<MediaCodecInfo> decoderInfos = getDecoderInfos(mediaCodecSelector, format, /* requiresSecureDecoder= */
    false, audioSink);
    if (decoderInfos.isEmpty()) {
        return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_SUBTYPE);
    }
    if (!supportsFormatDrm) {
        return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_DRM);
    }
    // Check whether the first decoder supports the format. This is the preferred decoder for the
    // format's MIME type, according to the MediaCodecSelector.
    MediaCodecInfo decoderInfo = decoderInfos.get(0);
    boolean isFormatSupported = decoderInfo.isFormatSupported(format);
    boolean isPreferredDecoder = true;
    if (!isFormatSupported) {
        // Check whether any of the other decoders support the format.
        for (int i = 1; i < decoderInfos.size(); i++) {
            MediaCodecInfo otherDecoderInfo = decoderInfos.get(i);
            if (otherDecoderInfo.isFormatSupported(format)) {
                decoderInfo = otherDecoderInfo;
                isFormatSupported = true;
                isPreferredDecoder = false;
                break;
            }
        }
    }
    @C.FormatSupport int formatSupport = isFormatSupported ? C.FORMAT_HANDLED : C.FORMAT_EXCEEDS_CAPABILITIES;
    @AdaptiveSupport int adaptiveSupport = isFormatSupported && decoderInfo.isSeamlessAdaptationSupported(format) ? ADAPTIVE_SEAMLESS : ADAPTIVE_NOT_SEAMLESS;
    @HardwareAccelerationSupport int hardwareAccelerationSupport = decoderInfo.hardwareAccelerated ? HARDWARE_ACCELERATION_SUPPORTED : HARDWARE_ACCELERATION_NOT_SUPPORTED;
    @DecoderSupport int decoderSupport = isPreferredDecoder ? DECODER_SUPPORT_PRIMARY : DECODER_SUPPORT_FALLBACK;
    return RendererCapabilities.create(formatSupport, adaptiveSupport, tunnelingSupport, hardwareAccelerationSupport, decoderSupport);
}
Also used : MediaCodecInfo(androidx.media3.exoplayer.mediacodec.MediaCodecInfo) SuppressLint(android.annotation.SuppressLint) RendererCapabilities(androidx.media3.exoplayer.RendererCapabilities)

Example 3 with MediaCodecSelector

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

the class MediaCodecAudioRendererTest method supportsFormat_withEac3JocMediaAndEac3Decoder_returnsTrue.

@Test
public void supportsFormat_withEac3JocMediaAndEac3Decoder_returnsTrue() throws Exception {
    Format mediaFormat = new Format.Builder().setSampleMimeType(MimeTypes.AUDIO_E_AC3_JOC).setCodecs(MimeTypes.CODEC_E_AC3_JOC).build();
    MediaCodecSelector mediaCodecSelector = (mimeType, requiresSecureDecoder, requiresTunnelingDecoder) -> !mimeType.equals(MimeTypes.AUDIO_E_AC3) ? ImmutableList.of() : ImmutableList.of(MediaCodecInfo.newInstance(/* name= */
    "eac3-codec", /* mimeType= */
    mimeType, /* codecMimeType= */
    mimeType, /* capabilities= */
    null, /* hardwareAccelerated= */
    false, /* softwareOnly= */
    true, /* vendor= */
    false, /* forceDisableAdaptive= */
    false, /* forceSecure= */
    false));
    MediaCodecAudioRenderer renderer = new MediaCodecAudioRenderer(ApplicationProvider.getApplicationContext(), mediaCodecSelector, /* enableDecoderFallback= */
    false, /* eventHandler= */
    new Handler(Looper.getMainLooper()), audioRendererEventListener, audioSink);
    renderer.init(/* index= */
    0, PlayerId.UNSET);
    @Capabilities int capabilities = renderer.supportsFormat(mediaFormat);
    assertThat(RendererCapabilities.getFormatSupport(capabilities)).isEqualTo(C.FORMAT_HANDLED);
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) ExoPlaybackException(androidx.media3.exoplayer.ExoPlaybackException) MediaFormat(android.media.MediaFormat) Mock(org.mockito.Mock) Assert.assertThrows(org.junit.Assert.assertThrows) RunWith(org.junit.runner.RunWith) SystemClock(android.os.SystemClock) AndroidJUnit4(androidx.test.ext.junit.runners.AndroidJUnit4) Shadows.shadowOf(org.robolectric.Shadows.shadowOf) RendererCapabilities(androidx.media3.exoplayer.RendererCapabilities) Capabilities(androidx.media3.exoplayer.RendererCapabilities.Capabilities) ApplicationProvider(androidx.test.core.app.ApplicationProvider) DrmSessionManager(androidx.media3.exoplayer.drm.DrmSessionManager) MediaCodecInfo(androidx.media3.exoplayer.mediacodec.MediaCodecInfo) END_OF_STREAM_ITEM(androidx.media3.test.utils.FakeSampleStream.FakeSampleStreamItem.END_OF_STREAM_ITEM) ArgumentCaptor(org.mockito.ArgumentCaptor) ImmutableList(com.google.common.collect.ImmutableList) DrmSessionEventListener(androidx.media3.exoplayer.drm.DrmSessionEventListener) Handler(android.os.Handler) Looper(android.os.Looper) MockitoJUnit(org.mockito.junit.MockitoJUnit) RendererConfiguration(androidx.media3.exoplayer.RendererConfiguration) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) Before(org.junit.Before) MimeTypes(androidx.media3.common.MimeTypes) Mockito.atLeastOnce(org.mockito.Mockito.atLeastOnce) FakeSampleStream(androidx.media3.test.utils.FakeSampleStream) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) PlaybackException(androidx.media3.common.PlaybackException) Truth.assertThat(com.google.common.truth.Truth.assertThat) Mockito.verify(org.mockito.Mockito.verify) Format(androidx.media3.common.Format) DefaultAllocator(androidx.media3.exoplayer.upstream.DefaultAllocator) C(androidx.media3.common.C) MediaCodecSelector(androidx.media3.exoplayer.mediacodec.MediaCodecSelector) Nullable(androidx.annotation.Nullable) Rule(org.junit.Rule) FakeSampleStreamItem.oneByteSample(androidx.media3.test.utils.FakeSampleStream.FakeSampleStreamItem.oneByteSample) PlayerId(androidx.media3.exoplayer.analytics.PlayerId) FakeSampleStreamItem.format(androidx.media3.test.utils.FakeSampleStream.FakeSampleStreamItem.format) MockitoRule(org.mockito.junit.MockitoRule) Collections(java.util.Collections) MediaCodecSelector(androidx.media3.exoplayer.mediacodec.MediaCodecSelector) MediaFormat(android.media.MediaFormat) Format(androidx.media3.common.Format) RendererCapabilities(androidx.media3.exoplayer.RendererCapabilities) Capabilities(androidx.media3.exoplayer.RendererCapabilities.Capabilities) Handler(android.os.Handler) Test(org.junit.Test)

Example 4 with MediaCodecSelector

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

the class MediaCodecVideoRendererTest method setUp.

@Before
public void setUp() throws Exception {
    testMainLooper = Looper.getMainLooper();
    MediaCodecSelector mediaCodecSelector = (mimeType, requiresSecureDecoder, requiresTunnelingDecoder) -> Collections.singletonList(MediaCodecInfo.newInstance(/* name= */
    "name", /* mimeType= */
    mimeType, /* codecMimeType= */
    mimeType, /* capabilities= */
    null, /* hardwareAccelerated= */
    false, /* softwareOnly= */
    true, /* vendor= */
    false, /* forceDisableAdaptive= */
    false, /* forceSecure= */
    false));
    mediaCodecVideoRenderer = new MediaCodecVideoRenderer(ApplicationProvider.getApplicationContext(), mediaCodecSelector, /* allowedJoiningTimeMs= */
    0, /* eventHandler= */
    new Handler(testMainLooper), /* eventListener= */
    eventListener, /* maxDroppedFramesToNotify= */
    1) {

        @Override
        @Capabilities
        protected int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format) {
            return RendererCapabilities.create(C.FORMAT_HANDLED);
        }

        @Override
        protected void onOutputFormatChanged(Format format, @Nullable MediaFormat mediaFormat) {
            super.onOutputFormatChanged(format, mediaFormat);
            currentOutputFormat = format;
        }
    };
    surface = new Surface(new SurfaceTexture(/* texName= */
    0));
    mediaCodecVideoRenderer.handleMessage(Renderer.MSG_SET_VIDEO_OUTPUT, surface);
}
Also used : CodecProfileLevel(android.media.MediaCodecInfo.CodecProfileLevel) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) AndroidJUnit4(androidx.test.ext.junit.runners.AndroidJUnit4) ApplicationProvider(androidx.test.core.app.ApplicationProvider) DrmSessionManager(androidx.media3.exoplayer.drm.DrmSessionManager) MediaCodecInfo(androidx.media3.exoplayer.mediacodec.MediaCodecInfo) END_OF_STREAM_ITEM(androidx.media3.test.utils.FakeSampleStream.FakeSampleStreamItem.END_OF_STREAM_ITEM) Renderer(androidx.media3.exoplayer.Renderer) Handler(android.os.Handler) Looper(android.os.Looper) After(org.junit.After) CodecCapabilities(android.media.MediaCodecInfo.CodecCapabilities) RendererConfiguration(androidx.media3.exoplayer.RendererConfiguration) Surface(android.view.Surface) VideoSize(androidx.media3.common.VideoSize) FakeSampleStream(androidx.media3.test.utils.FakeSampleStream) Collectors(java.util.stream.Collectors) Format(androidx.media3.common.Format) MediaCodecSelector(androidx.media3.exoplayer.mediacodec.MediaCodecSelector) Nullable(androidx.annotation.Nullable) FakeSampleStreamItem.format(androidx.media3.test.utils.FakeSampleStream.FakeSampleStreamItem.format) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) MediaFormat(android.media.MediaFormat) Mock(org.mockito.Mock) RunWith(org.junit.runner.RunWith) SystemClock(android.os.SystemClock) Shadows.shadowOf(org.robolectric.Shadows.shadowOf) RendererCapabilities(androidx.media3.exoplayer.RendererCapabilities) Capabilities(androidx.media3.exoplayer.RendererCapabilities.Capabilities) ArgumentCaptor(org.mockito.ArgumentCaptor) ImmutableList(com.google.common.collect.ImmutableList) DrmSessionEventListener(androidx.media3.exoplayer.drm.DrmSessionEventListener) MockitoJUnit(org.mockito.junit.MockitoJUnit) Before(org.junit.Before) SurfaceTexture(android.graphics.SurfaceTexture) ShadowLooper(org.robolectric.shadows.ShadowLooper) MimeTypes(androidx.media3.common.MimeTypes) Mockito.times(org.mockito.Mockito.times) Test(org.junit.Test) Truth.assertThat(com.google.common.truth.Truth.assertThat) Mockito.verify(org.mockito.Mockito.verify) DefaultAllocator(androidx.media3.exoplayer.upstream.DefaultAllocator) C(androidx.media3.common.C) Mockito.never(org.mockito.Mockito.never) Rule(org.junit.Rule) FakeSampleStreamItem.oneByteSample(androidx.media3.test.utils.FakeSampleStream.FakeSampleStreamItem.oneByteSample) PlayerId(androidx.media3.exoplayer.analytics.PlayerId) MockitoRule(org.mockito.junit.MockitoRule) Collections(java.util.Collections) MediaFormat(android.media.MediaFormat) MediaCodecSelector(androidx.media3.exoplayer.mediacodec.MediaCodecSelector) Format(androidx.media3.common.Format) MediaFormat(android.media.MediaFormat) SurfaceTexture(android.graphics.SurfaceTexture) CodecCapabilities(android.media.MediaCodecInfo.CodecCapabilities) RendererCapabilities(androidx.media3.exoplayer.RendererCapabilities) Capabilities(androidx.media3.exoplayer.RendererCapabilities.Capabilities) Handler(android.os.Handler) Surface(android.view.Surface) Before(org.junit.Before)

Example 5 with MediaCodecSelector

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

the class MediaCodecVideoRendererTest method supportsFormat_withDolbyVisionMedia_returnsTrueWhenFallbackToH265orH264Allowed.

@Test
public void supportsFormat_withDolbyVisionMedia_returnsTrueWhenFallbackToH265orH264Allowed() throws Exception {
    // Create Dolby media formats that could fall back to H265 or H264.
    Format formatDvheDtrFallbackToH265 = new Format.Builder().setSampleMimeType(MimeTypes.VIDEO_DOLBY_VISION).setCodecs("dvhe.04.01").build();
    Format formatDvheStFallbackToH265 = new Format.Builder().setSampleMimeType(MimeTypes.VIDEO_DOLBY_VISION).setCodecs("dvhe.08.01").build();
    Format formatDvavSeFallbackToH264 = new Format.Builder().setSampleMimeType(MimeTypes.VIDEO_DOLBY_VISION).setCodecs("dvav.09.01").build();
    Format formatNoFallbackPossible = new Format.Builder().setSampleMimeType(MimeTypes.VIDEO_DOLBY_VISION).setCodecs("dvav.01.01").build();
    // Only provide H264 and H265 decoders with codec profiles needed for fallback.
    MediaCodecSelector mediaCodecSelector = (mimeType, requiresSecureDecoder, requiresTunnelingDecoder) -> {
        switch(mimeType) {
            case MimeTypes.VIDEO_H264:
                CodecCapabilities capabilitiesH264 = new CodecCapabilities();
                capabilitiesH264.profileLevels = new CodecProfileLevel[] { new CodecProfileLevel(), new CodecProfileLevel() };
                capabilitiesH264.profileLevels[0].profile = CodecProfileLevel.AVCProfileBaseline;
                capabilitiesH264.profileLevels[0].level = CodecProfileLevel.AVCLevel42;
                capabilitiesH264.profileLevels[1].profile = CodecProfileLevel.AVCProfileHigh;
                capabilitiesH264.profileLevels[1].level = CodecProfileLevel.AVCLevel42;
                return ImmutableList.of(MediaCodecInfo.newInstance(/* name= */
                "h264-codec", /* mimeType= */
                mimeType, /* codecMimeType= */
                mimeType, /* capabilities= */
                capabilitiesH264, /* hardwareAccelerated= */
                false, /* softwareOnly= */
                true, /* vendor= */
                false, /* forceDisableAdaptive= */
                false, /* forceSecure= */
                false));
            case MimeTypes.VIDEO_H265:
                CodecCapabilities capabilitiesH265 = new CodecCapabilities();
                capabilitiesH265.profileLevels = new CodecProfileLevel[] { new CodecProfileLevel(), new CodecProfileLevel() };
                capabilitiesH265.profileLevels[0].profile = CodecProfileLevel.HEVCProfileMain;
                capabilitiesH265.profileLevels[0].level = CodecProfileLevel.HEVCMainTierLevel41;
                capabilitiesH265.profileLevels[1].profile = CodecProfileLevel.HEVCProfileMain10;
                capabilitiesH265.profileLevels[1].level = CodecProfileLevel.HEVCHighTierLevel51;
                return ImmutableList.of(MediaCodecInfo.newInstance(/* name= */
                "h265-codec", /* mimeType= */
                mimeType, /* codecMimeType= */
                mimeType, /* capabilities= */
                capabilitiesH265, /* hardwareAccelerated= */
                false, /* softwareOnly= */
                true, /* vendor= */
                false, /* forceDisableAdaptive= */
                false, /* forceSecure= */
                false));
            default:
                return ImmutableList.of();
        }
    };
    MediaCodecVideoRenderer renderer = new MediaCodecVideoRenderer(ApplicationProvider.getApplicationContext(), mediaCodecSelector, /* allowedJoiningTimeMs= */
    0, /* eventHandler= */
    new Handler(testMainLooper), /* eventListener= */
    eventListener, /* maxDroppedFramesToNotify= */
    1);
    renderer.init(/* index= */
    0, PlayerId.UNSET);
    @Capabilities int capabilitiesDvheDtrFallbackToH265 = renderer.supportsFormat(formatDvheDtrFallbackToH265);
    @Capabilities int capabilitiesDvheStFallbackToH265 = renderer.supportsFormat(formatDvheStFallbackToH265);
    @Capabilities int capabilitiesDvavSeFallbackToH264 = renderer.supportsFormat(formatDvavSeFallbackToH264);
    @Capabilities int capabilitiesNoFallbackPossible = renderer.supportsFormat(formatNoFallbackPossible);
    assertThat(RendererCapabilities.getFormatSupport(capabilitiesDvheDtrFallbackToH265)).isEqualTo(C.FORMAT_HANDLED);
    assertThat(RendererCapabilities.getFormatSupport(capabilitiesDvheStFallbackToH265)).isEqualTo(C.FORMAT_HANDLED);
    assertThat(RendererCapabilities.getFormatSupport(capabilitiesDvavSeFallbackToH264)).isEqualTo(C.FORMAT_HANDLED);
    assertThat(RendererCapabilities.getFormatSupport(capabilitiesNoFallbackPossible)).isEqualTo(C.FORMAT_UNSUPPORTED_SUBTYPE);
}
Also used : CodecProfileLevel(android.media.MediaCodecInfo.CodecProfileLevel) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) AndroidJUnit4(androidx.test.ext.junit.runners.AndroidJUnit4) ApplicationProvider(androidx.test.core.app.ApplicationProvider) DrmSessionManager(androidx.media3.exoplayer.drm.DrmSessionManager) MediaCodecInfo(androidx.media3.exoplayer.mediacodec.MediaCodecInfo) END_OF_STREAM_ITEM(androidx.media3.test.utils.FakeSampleStream.FakeSampleStreamItem.END_OF_STREAM_ITEM) Renderer(androidx.media3.exoplayer.Renderer) Handler(android.os.Handler) Looper(android.os.Looper) After(org.junit.After) CodecCapabilities(android.media.MediaCodecInfo.CodecCapabilities) RendererConfiguration(androidx.media3.exoplayer.RendererConfiguration) Surface(android.view.Surface) VideoSize(androidx.media3.common.VideoSize) FakeSampleStream(androidx.media3.test.utils.FakeSampleStream) Collectors(java.util.stream.Collectors) Format(androidx.media3.common.Format) MediaCodecSelector(androidx.media3.exoplayer.mediacodec.MediaCodecSelector) Nullable(androidx.annotation.Nullable) FakeSampleStreamItem.format(androidx.media3.test.utils.FakeSampleStream.FakeSampleStreamItem.format) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) MediaFormat(android.media.MediaFormat) Mock(org.mockito.Mock) RunWith(org.junit.runner.RunWith) SystemClock(android.os.SystemClock) Shadows.shadowOf(org.robolectric.Shadows.shadowOf) RendererCapabilities(androidx.media3.exoplayer.RendererCapabilities) Capabilities(androidx.media3.exoplayer.RendererCapabilities.Capabilities) ArgumentCaptor(org.mockito.ArgumentCaptor) ImmutableList(com.google.common.collect.ImmutableList) DrmSessionEventListener(androidx.media3.exoplayer.drm.DrmSessionEventListener) MockitoJUnit(org.mockito.junit.MockitoJUnit) Before(org.junit.Before) SurfaceTexture(android.graphics.SurfaceTexture) ShadowLooper(org.robolectric.shadows.ShadowLooper) MimeTypes(androidx.media3.common.MimeTypes) Mockito.times(org.mockito.Mockito.times) Test(org.junit.Test) Truth.assertThat(com.google.common.truth.Truth.assertThat) Mockito.verify(org.mockito.Mockito.verify) DefaultAllocator(androidx.media3.exoplayer.upstream.DefaultAllocator) C(androidx.media3.common.C) Mockito.never(org.mockito.Mockito.never) Rule(org.junit.Rule) FakeSampleStreamItem.oneByteSample(androidx.media3.test.utils.FakeSampleStream.FakeSampleStreamItem.oneByteSample) PlayerId(androidx.media3.exoplayer.analytics.PlayerId) MockitoRule(org.mockito.junit.MockitoRule) Collections(java.util.Collections) CodecProfileLevel(android.media.MediaCodecInfo.CodecProfileLevel) MediaCodecSelector(androidx.media3.exoplayer.mediacodec.MediaCodecSelector) Format(androidx.media3.common.Format) MediaFormat(android.media.MediaFormat) CodecCapabilities(android.media.MediaCodecInfo.CodecCapabilities) RendererCapabilities(androidx.media3.exoplayer.RendererCapabilities) Capabilities(androidx.media3.exoplayer.RendererCapabilities.Capabilities) Handler(android.os.Handler) CodecCapabilities(android.media.MediaCodecInfo.CodecCapabilities) Test(org.junit.Test)

Aggregations

Nullable (androidx.annotation.Nullable)7 MediaCodecInfo (androidx.media3.exoplayer.mediacodec.MediaCodecInfo)6 MediaFormat (android.media.MediaFormat)5 Format (androidx.media3.common.Format)5 RendererCapabilities (androidx.media3.exoplayer.RendererCapabilities)5 Handler (android.os.Handler)4 DrmSessionEventListener (androidx.media3.exoplayer.drm.DrmSessionEventListener)4 DefaultAllocator (androidx.media3.exoplayer.upstream.DefaultAllocator)4 FakeSampleStream (androidx.media3.test.utils.FakeSampleStream)4 Before (org.junit.Before)4 Test (org.junit.Test)4 CodecCapabilities (android.media.MediaCodecInfo.CodecCapabilities)3 Looper (android.os.Looper)3 SystemClock (android.os.SystemClock)3 C (androidx.media3.common.C)3 MimeTypes (androidx.media3.common.MimeTypes)3 Capabilities (androidx.media3.exoplayer.RendererCapabilities.Capabilities)3 RendererConfiguration (androidx.media3.exoplayer.RendererConfiguration)3 PlayerId (androidx.media3.exoplayer.analytics.PlayerId)3 DrmSessionManager (androidx.media3.exoplayer.drm.DrmSessionManager)3