Added in API level 30

OutputFrame


class OutputFrame
kotlin.Any
   ↳ android.media.MediaCodec.OutputFrame

A single output frame and its associated metadata.

Summary

Public methods
ArrayDeque<MediaCodec.BufferInfo!>

MutableSet<String!>

Returns an unmodifiable set of the names of entries that has changed from the previous frame.

Int

Returns the buffer flags.

MediaFormat

Returns a read-only MediaFormat for this frame.

HardwareBuffer?

Returns the output hardware graphic buffer, or null if this frame is empty.

MediaCodec.LinearBlock?

Returns the output linear block, or null if this frame is empty.

Long

Returns the presentation timestamp in microseconds.

Public methods

getBufferInfos

Added in API level 35
fun getBufferInfos(): ArrayDeque<MediaCodec.BufferInfo!>
Return
ArrayDeque<MediaCodec.BufferInfo!> This value cannot be null.

getChangedKeys

Added in API level 30
fun getChangedKeys(): MutableSet<String!>

Returns an unmodifiable set of the names of entries that has changed from the previous frame. The entries may have been removed/changed/added. Client can find out what the change is by querying MediaFormat object returned from getFormat.

Return
MutableSet<String!> This value cannot be null.

getFormat

Added in API level 30
fun getFormat(): MediaFormat

Returns a read-only MediaFormat for this frame. The returned object is valid only until the client calls android.media.MediaCodec#releaseOutputBuffer.

Return
MediaFormat This value cannot be null.

getHardwareBuffer

Added in API level 30
fun getHardwareBuffer(): HardwareBuffer?

Returns the output hardware graphic buffer, or null if this frame is empty.

Exceptions
java.lang.IllegalStateException if this output frame is not graphic.

getLinearBlock

Added in API level 30
fun getLinearBlock(): MediaCodec.LinearBlock?

Returns the output linear block, or null if this frame is empty.

Exceptions
java.lang.IllegalStateException if this output frame is not linear.

getPresentationTimeUs

Added in API level 30
fun getPresentationTimeUs(): Long

Returns the presentation timestamp in microseconds.