Class MediaCodecAdapter.Configuration
- java.lang.Object
-
- com.google.android.exoplayer2.mediacodec.MediaCodecAdapter.Configuration
-
- Enclosing interface:
- MediaCodecAdapter
public static final class MediaCodecAdapter.Configuration extends Object
Configuration parameters for aMediaCodecAdapter
.
-
-
Field Summary
Fields Modifier and Type Field Description MediaCodecInfo
codecInfo
Information about theMediaCodec
being configured.boolean
createInputSurface
Whether to request aSurface
and use it as to the input to an encoder.MediaCrypto
crypto
For DRM protected playbacks, aMediaCrypto
to use for decryption.int
flags
Specify CONFIGURE_FLAG_ENCODE to configure the component as an encoder.Format
format
TheFormat
for which the codec is being configured.MediaFormat
mediaFormat
TheMediaFormat
for which the codec is being configured.Surface
surface
For video decoding, the output where the object will render the decoded frames.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MediaCodecAdapter.Configuration
createForAudioDecoding(MediaCodecInfo codecInfo, MediaFormat mediaFormat, Format format, MediaCrypto crypto)
Creates a configuration for audio decoding.static MediaCodecAdapter.Configuration
createForAudioEncoding(MediaCodecInfo codecInfo, MediaFormat mediaFormat, Format format)
Creates a configuration for audio encoding.static MediaCodecAdapter.Configuration
createForVideoDecoding(MediaCodecInfo codecInfo, MediaFormat mediaFormat, Format format, Surface surface, MediaCrypto crypto)
Creates a configuration for video decoding.static MediaCodecAdapter.Configuration
createForVideoEncoding(MediaCodecInfo codecInfo, MediaFormat mediaFormat, Format format)
Creates a configuration for video encoding.
-
-
-
Field Detail
-
codecInfo
public final MediaCodecInfo codecInfo
Information about theMediaCodec
being configured.
-
mediaFormat
public final MediaFormat mediaFormat
TheMediaFormat
for which the codec is being configured.
-
surface
@Nullable public final Surface surface
For video decoding, the output where the object will render the decoded frames. This must be null if the codec is not a video decoder, or if it is configured forByteBuffer
output.
-
crypto
@Nullable public final MediaCrypto crypto
For DRM protected playbacks, aMediaCrypto
to use for decryption.
-
flags
public final int flags
Specify CONFIGURE_FLAG_ENCODE to configure the component as an encoder.
-
createInputSurface
public final boolean createInputSurface
Whether to request aSurface
and use it as to the input to an encoder. This can only be set totrue
on API 18+.
-
-
Method Detail
-
createForAudioDecoding
public static MediaCodecAdapter.Configuration createForAudioDecoding(MediaCodecInfo codecInfo, MediaFormat mediaFormat, Format format, @Nullable MediaCrypto crypto)
Creates a configuration for audio decoding.- Parameters:
codecInfo
- SeecodecInfo
.mediaFormat
- SeemediaFormat
.format
- Seeformat
.crypto
- Seecrypto
.- Returns:
- The created instance.
-
createForVideoDecoding
public static MediaCodecAdapter.Configuration createForVideoDecoding(MediaCodecInfo codecInfo, MediaFormat mediaFormat, Format format, @Nullable Surface surface, @Nullable MediaCrypto crypto)
Creates a configuration for video decoding.- Parameters:
codecInfo
- SeecodecInfo
.mediaFormat
- SeemediaFormat
.format
- Seeformat
.surface
- Seesurface
.crypto
- Seecrypto
.- Returns:
- The created instance.
-
createForAudioEncoding
public static MediaCodecAdapter.Configuration createForAudioEncoding(MediaCodecInfo codecInfo, MediaFormat mediaFormat, Format format)
Creates a configuration for audio encoding.- Parameters:
codecInfo
- SeecodecInfo
.mediaFormat
- SeemediaFormat
.format
- Seeformat
.- Returns:
- The created instance.
-
createForVideoEncoding
@RequiresApi(18) public static MediaCodecAdapter.Configuration createForVideoEncoding(MediaCodecInfo codecInfo, MediaFormat mediaFormat, Format format)
Creates a configuration for video encoding.- Parameters:
codecInfo
- SeecodecInfo
.mediaFormat
- SeemediaFormat
.format
- Seeformat
.- Returns:
- The created instance.
-
-