@UnstableApi
interface EbmlProcessor


Defines EBML element IDs/types and processes events.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
annotation EbmlProcessor.ElementType

EBML element types.

Constants

const Int

Type for binary elements.

const Int

Type for IEEE floating point value elements of either 4 or 8 bytes.

const Int

Type for elements that contain child elements.

const Int

Type for string elements.

const Int

Type for unknown elements.

const Int

Type for integer value elements of up to 8 bytes.

Public functions

Unit
binaryElement(id: Int, contentsSize: Int, input: ExtractorInput!)

Called when a binary element is encountered.

Unit

Called when the end of a master element is encountered.

Unit
floatElement(id: Int, value: Double)

Called when a float element is encountered.

Int

Maps an element ID to a corresponding type.

Unit
integerElement(id: Int, value: Long)

Called when an integer element is encountered.

Boolean

Checks if the given id is that of a level 1 element.

Unit
startMasterElement(id: Int, contentPosition: Long, contentSize: Long)

Called when the start of a master element is encountered.

Unit
stringElement(id: Int, value: String!)

Called when a string element is encountered.

Constants

ELEMENT_TYPE_BINARY

const val ELEMENT_TYPE_BINARY = 4: Int

Type for binary elements.

ELEMENT_TYPE_FLOAT

const val ELEMENT_TYPE_FLOAT = 5: Int

Type for IEEE floating point value elements of either 4 or 8 bytes.

ELEMENT_TYPE_MASTER

const val ELEMENT_TYPE_MASTER = 1: Int

Type for elements that contain child elements.

ELEMENT_TYPE_STRING

const val ELEMENT_TYPE_STRING = 3: Int

Type for string elements.

ELEMENT_TYPE_UNKNOWN

const val ELEMENT_TYPE_UNKNOWN = 0: Int

Type for unknown elements.

ELEMENT_TYPE_UNSIGNED_INT

const val ELEMENT_TYPE_UNSIGNED_INT = 2: Int

Type for integer value elements of up to 8 bytes.

Public functions

binaryElement

fun binaryElement(id: Int, contentsSize: Int, input: ExtractorInput!): Unit

Called when a binary element is encountered.

The element header (containing the element ID and content size) will already have been read. Implementations are required to consume the whole remainder of the element, which is contentSize bytes in length, before returning. Implementations are permitted to fail (by throwing an exception) having partially consumed the data, however if they do this, they must consume the remainder of the content when called again.

Parameters
id: Int

The element ID.

contentsSize: Int

The element's content size.

input: ExtractorInput!

The ExtractorInput from which data should be read.

Throws
androidx.media3.common.ParserException

If a parsing error occurs.

java.io.IOException

If an error occurs reading from the input.

endMasterElement

fun endMasterElement(id: Int): Unit

Called when the end of a master element is encountered.

Parameters
id: Int

The element ID.

Throws
androidx.media3.common.ParserException

If a parsing error occurs.

floatElement

fun floatElement(id: Int, value: Double): Unit

Called when a float element is encountered.

Parameters
id: Int

The element ID.

value: Double

The float value that the element contains

Throws
androidx.media3.common.ParserException

If a parsing error occurs.

getElementType

@EbmlProcessor.ElementType
fun getElementType(id: Int): Int

Maps an element ID to a corresponding type.

If ELEMENT_TYPE_UNKNOWN is returned then the element is skipped. Note that all children of a skipped element are also skipped.

Parameters
id: Int

The element ID to map.

integerElement

fun integerElement(id: Int, value: Long): Unit

Called when an integer element is encountered.

Parameters
id: Int

The element ID.

value: Long

The integer value that the element contains.

Throws
androidx.media3.common.ParserException

If a parsing error occurs.

isLevel1Element

fun isLevel1Element(id: Int): Boolean

Checks if the given id is that of a level 1 element.

Parameters
id: Int

The element ID.

Returns
Boolean

Whether the given id is that of a level 1 element.

startMasterElement

fun startMasterElement(id: Int, contentPosition: Long, contentSize: Long): Unit

Called when the start of a master element is encountered.

Following events should be considered as taking place within this element until a matching call to endMasterElement is made.

Note that it is possible for another master element of the same element ID to be nested within itself.

Parameters
id: Int

The element ID.

contentPosition: Long

The position of the start of the element's content in the stream.

contentSize: Long

The size of the element's content in bytes.

Throws
androidx.media3.common.ParserException

If a parsing error occurs.

stringElement

fun stringElement(id: Int, value: String!): Unit

Called when a string element is encountered.

Parameters
id: Int

The element ID.

value: String!

The string value that the element contains.

Throws
androidx.media3.common.ParserException

If a parsing error occurs.