MediaCodecBufferFlags Enum

Definition

This enumeration supports a bitwise combination of its member values.

[System.Flags]
public enum MediaCodecBufferFlags
[<System.Flags>]
type MediaCodecBufferFlags = 
Inheritance
MediaCodecBufferFlags
Attributes

Fields

Name Value Description
None 0
KeyFrame 1

This indicates that the (encoded) buffer marked as such contains the data for a key frame.

Android reference for android.media.MediaCodec.BUFFER_FLAG_KEY_FRAME.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

SyncFrame 1

This indicates that the buffer marked as such contains the data for a sync frame.

CodecConfig 2

This indicated that the buffer marked as such contains codec initialization / codec specific data instead of media data.

EndOfStream 4

This signals the end of stream, i.e.

PartialFrame 8

This indicates that the buffer only contains part of a frame, and the decoder should batch the data until a buffer without this flag appears before decoding the frame.

Android reference for android.media.MediaCodec.BUFFER_FLAG_PARTIAL_FRAME.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

DecodeOnly 32

This indicates that the buffer is decoded and updates the internal state of the decoder, but does not produce any output buffer. When a buffer has this flag set, OnFrameRenderedListener.onFrameRendered(MediaCodec,long,long) and Callback.onOutputBufferAvailable(MediaCodec,int,BufferInfo) will not be called for that given buffer. For example, when seeking to a certain frame, that frame may need to reference previous frames in order for it to produce output. The preceding frames can be marked with this flag so that they are only decoded and their data is used when decoding the latter frame that should be initially displayed post-seek. Another example would be trick play, trick play is when a video is fast-forwarded and only a subset of the frames is to be rendered on the screen. The frames not to be rendered can be marked with this flag for the same reason as the above one. Marking frames with this flag improves the overall performance of playing a video stream as fewer frames need to be passed back to the app. In CodecCapabilities.FEATURE_TunneledPlayback, buffers marked with this flag are not rendered on the output surface. A frame should not be marked with this flag and BUFFER_FLAG_END_OF_STREAM simultaneously, doing so will produce a InvalidBufferFlagsException

Android reference for android.media.MediaCodec.BUFFER_FLAG_DECODE_ONLY.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to