Android.Media.MediaCodec Members

The members of Android.Media.MediaCodec are listed below.

See Also: Inherited members from Java.Lang.Object

Public Fields

const
BufferFlagCodecConfigMediaCodecBufferFlags (2). This indicated that the buffer marked as such contains codec initialization / codec specific data instead of media data.
const
BufferFlagEndOfStreamMediaCodecBufferFlags (4). This signals the end of stream, i.e. no buffers will be available after this, unless of course, MediaCodec.Flush follows.
const
BufferFlagKeyFrameMediaCodecBufferFlags (1). This indicates that the (encoded) buffer marked as such contains the data for a key frame.
const
BufferFlagSyncFrameMediaCodecBufferFlags (1). This indicates that the (encoded) buffer marked as such contains the data for a key frame.
const
ConfigureFlagEncodeMediaCodecConfigFlags (1). If this codec is to be used as an encoder, pass this flag.
const
CryptoModeAesCtrMediaCodecCryptoMode (1).
const
CryptoModeUnencryptedMediaCodecCryptoMode (0).
const
InfoOutputBuffersChangedMediaCodecInfoState (-3). The output buffers have changed, the client must refer to the new set of output buffers returned by MediaCodec.GetOutputBuffers from this point on.
const
InfoOutputFormatChangedMediaCodecInfoState (-2). The output format has changed, subsequent data will follow the new format.
const
InfoTryAgainLaterMediaCodecInfoState (-1). If a non-negative timeout had been specified in the call to MediaCodec.DequeueOutputBuffer(.BufferInfo, System.Int64), indicates that the call timed out.
const
ParameterKeyRequestSyncFramestring. Request that the encoder produce a sync frame "soon".
const
ParameterKeySuspendstring. Temporarily suspend/resume encoding of input data.
const
ParameterKeyVideoBitratestring. Change a video encoder's target bitrate on the fly.
const
VideoScalingModeScaleToFitVideoScalingMode (1). The content is scaled to the surface dimensions
const
VideoScalingModeScaleToFitWithCroppingVideoScalingMode (2). The content is scaled, maintaining its aspect ratio, the whole surface area is used, content may be cropped

Public Properties

[read-only]
CodecInfoMediaCodecInfo. Get the codec info.
[read-only]
InputFormatMediaFormat. Call this after MediaCodec.Configure(MediaFormat, Android.Views.Surface, Android.Views.Surface, Android.Views.Surface) returns successfully to get the input format accepted by the codec.
[read-only]
Namestring. Get the component name.
[read-only]
OutputFormatMediaFormat. Call this after dequeueOutputBuffer signals a format change by returning MediaCodec.InfoOutputFormatChanged.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

Configure(MediaFormat, Android.Views.Surface, MediaCrypto, MediaCodecConfigFlags)
Configures a component.
static
CreateByCodecName(string) : MediaCodec
If you know the exact name of the component you want to instantiate use this method to instantiate it.
static
CreateDecoderByType(string) : MediaCodec
Instantiate a decoder supporting input data of the given mime type.
static
CreateEncoderByType(string) : MediaCodec
Instantiate an encoder supporting output data of the given mime type.
CreateInputSurface() : Android.Views.Surface
Requests a Surface to use as the input to an encoder, in place of input buffers.
DequeueInputBuffer(long) : int
Returns the index of an input buffer to be filled with valid data or -1 if no such buffer is currently available.
DequeueOutputBuffer(MediaCodec.BufferInfo, long) : int
Dequeue an output buffer, block at most "timeoutUs" microseconds.
Flush()
Flush both input and output ports of the component, all indices previously returned in calls to MediaCodec.DequeueInputBuffer(long) and MediaCodec.DequeueOutputBuffer(.BufferInfo, System.Int64) become invalid.
GetInputBuffer(int) : Java.Nio.ByteBuffer
Returns a Java.Nio.Buffer.Clear, writable ByteBuffer object for a dequeued input buffer index to contain the input data.
GetInputBuffers() : Java.Nio.ByteBuffer[]
Retrieve the set of input buffers.
GetInputImage(int) : Image
Returns a writable Image object for a dequeued input buffer index to contain the raw input video frame.
GetOutputBuffer(int) : Java.Nio.ByteBuffer
Returns a read-only ByteBuffer for a dequeued output buffer index.
GetOutputBuffers() : Java.Nio.ByteBuffer[]
Retrieve the set of output buffers.
GetOutputFormat(int) : MediaFormat
Returns the output format for a specific output buffer.
GetOutputImage(int) : Image
Returns a read-only Image object for a dequeued output buffer index that contains the raw video frame.
QueueInputBuffer(int, int, int, long, MediaCodecBufferFlags)
After filling a range of the input buffer at the specified index submit it to the component.
QueueSecureInputBuffer(int, int, MediaCodec.CryptoInfo, long, MediaCodecBufferFlags)
Similar to MediaCodec.QueueInputBuffer(int, System.Int32, System.Int32, System.Int32, System.Int32) but submits a buffer that is potentially encrypted.
Release()
Make sure you call this when you're done to free up any opened component instance instead of relying on the garbage collector to do this for you at some point in the future.
ReleaseOutputBuffer(int, bool)
If you are done with a buffer, use this call to return the buffer to the codec.
ReleaseOutputBuffer(int, long)
If you are done with a buffer, use this call to update its surface timestamp and return it to the codec to render it on the output surface.
Reset()
Returns the codec to its initial (Initialized) state.
SetCallback(MediaCodec.Callback)
Sets an asynchronous callback for actionable MediaCodec events.
SetParameters(Android.OS.Bundle)
Communicate additional parameter changes to the component instance.
SetVideoScalingMode(VideoScalingMode)
If a surface has been specified in a previous call to MediaCodec.Configure(MediaFormat, Android.Views.Surface, Android.Views.Surface, Android.Views.Surface) specifies the scaling mode to use.
SignalEndOfInputStream()
Signals end-of-stream on input.
Start()
After successfully configuring the component, call start.
Stop()
Finish the decode/encode session, note that the codec instance remains active and ready to be MediaCodec.Started again.