NalUnitTargetBuffer


@UnstableApi
class NalUnitTargetBuffer


A buffer that fills itself with data corresponding to a specific NAL unit, as it is encountered in the stream.

Summary

Public constructors

NalUnitTargetBuffer(targetType: Int, initialCapacity: Int)

Creates the buffer.

Public functions

Unit
appendToNalUnit(data: ByteArray!, offset: Int, limit: Int)

Called to pass stream data.

Boolean
endNalUnit(discardPadding: Int)

Called to indicate that a NAL unit has ended.

Unit

Resets the buffer, clearing any data that it holds.

Unit

Called to indicate that a NAL unit has started.

Public constructors

NalUnitTargetBuffer

NalUnitTargetBuffer(targetType: Int, initialCapacity: Int)

Creates the buffer.

Parameters
targetType: Int

The type of the NAL unit.

initialCapacity: Int

The initial capacity of the buffer in bytes.

Public functions

appendToNalUnit

fun appendToNalUnit(data: ByteArray!, offset: Int, limit: Int): Unit

Called to pass stream data. The data passed should not include the 3 byte start code.

Parameters
data: ByteArray!

Holds the data being passed.

offset: Int

The offset of the data in data.

limit: Int

The limit (exclusive) of the data in data.

endNalUnit

fun endNalUnit(discardPadding: Int): Boolean

Called to indicate that a NAL unit has ended.

Parameters
discardPadding: Int

The number of excess bytes that were passed to appendToNalUnit, which should be discarded.

Returns
Boolean

Whether the ended NAL unit is of the target type.

reset

fun reset(): Unit

Resets the buffer, clearing any data that it holds.

startNalUnit

fun startNalUnit(type: Int): Unit

Called to indicate that a NAL unit has started.

Parameters
type: Int

The type of the NAL unit.

Public properties

isCompleted

val isCompletedBoolean

nalData

val nalDataByteArray<Byte>!

nalLength

val nalLengthInt