Back to Exoplayer

DefaultMediaCodecAdapterFactory (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/mediacodec/DefaultMediaCodecAdapterFactory.html

latest5.9 KB
Original Source

Package com.google.android.exoplayer2.mediacodec

Class DefaultMediaCodecAdapterFactory

  • java.lang.Object

    • com.google.android.exoplayer2.mediacodec.DefaultMediaCodecAdapterFactory
  • All Implemented Interfaces:MediaCodecAdapter.Factory


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classDefaultMediaCodecAdapterFactoryextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[MediaCodecAdapter.Factory](MediaCodecAdapter.Factory.html "interface in com.google.android.exoplayer2.mediacodec")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

The default MediaCodecAdapter.Factory.

By default, this factory creates AsynchronousMediaCodecAdapter instances on devices with API level >= 31 (Android 12+). For devices with older API versions, the default behavior is to create SynchronousMediaCodecAdapter instances. The factory offers APIs to force the creation of AsynchronousMediaCodecAdapter (applicable for devices with API >= 23) or SynchronousMediaCodecAdapter instances.

Field Summary

- 

Fields inherited from interface com.google.android.exoplayer2.mediacodec.MediaCodecAdapter.Factory

DEFAULT

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | DefaultMediaCodecAdapterFactory() | Deprecated. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | MediaCodecAdapter | createAdapter​(MediaCodecAdapter.Configuration configuration) | Deprecated.

Creates a MediaCodecAdapter instance. | | void | experimentalSetSynchronizeCodecInteractionsWithQueueingEnabled​(boolean enabled) | Deprecated.

Enable synchronizing codec interactions with asynchronous buffer queueing. | | DefaultMediaCodecAdapterFactory | forceDisableAsynchronous() | Deprecated.

Forces the factory to always create SynchronousMediaCodecAdapter instances. | | DefaultMediaCodecAdapterFactory | forceEnableAsynchronous() | Deprecated.

Forces this factory to always create AsynchronousMediaCodecAdapter instances, provided the device API level is >= 23. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

DefaultMediaCodecAdapterFactory

public DefaultMediaCodecAdapterFactory()

Deprecated.

Method Detail

- 

forceEnableAsynchronous

@CanIgnoreReturnValue
public[DefaultMediaCodecAdapterFactory](DefaultMediaCodecAdapterFactory.html "class in com.google.android.exoplayer2.mediacodec")forceEnableAsynchronous()

Deprecated.

Forces this factory to always create AsynchronousMediaCodecAdapter instances, provided the device API level is >= 23. For devices with API level < 23, the factory will create SynchronousMediaCodecAdapters. Returns:This factory, for convenience.

- 

forceDisableAsynchronous

@CanIgnoreReturnValue
public[DefaultMediaCodecAdapterFactory](DefaultMediaCodecAdapterFactory.html "class in com.google.android.exoplayer2.mediacodec")forceDisableAsynchronous()

Deprecated.

Forces the factory to always create SynchronousMediaCodecAdapter instances. Returns:This factory, for convenience.

- 

experimentalSetSynchronizeCodecInteractionsWithQueueingEnabled

public void experimentalSetSynchronizeCodecInteractionsWithQueueingEnabled​(boolean enabled)

Deprecated.

Enable synchronizing codec interactions with asynchronous buffer queueing.

This method is experimental, and will be renamed or removed in a future release.

Parameters:enabled - Whether codec interactions will be synchronized with asynchronous buffer queueing.

- 

createAdapter

public[MediaCodecAdapter](MediaCodecAdapter.html "interface in com.google.android.exoplayer2.mediacodec")createAdapter​([MediaCodecAdapter.Configuration](MediaCodecAdapter.Configuration.html "class in com.google.android.exoplayer2.mediacodec")configuration)
                                throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: MediaCodecAdapter.Factory

Creates a MediaCodecAdapter instance. Specified by:createAdapter in interface MediaCodecAdapter.FactoryThrows:IOException