Package com.google.android.exoplayer2.extractor.mkv

## Interface EbmlProcessor

-     public interface EbmlProcessor

  Defines EBML element IDs/types and processes events.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static interface` | `EbmlProcessor.ElementType` | EBML element types.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `ELEMENT_TYPE_BINARY` | Type for binary elements.
    `static int` | `ELEMENT_TYPE_FLOAT` | Type for IEEE floating point value elements of either 4 or 8 bytes.
    `static int` | `ELEMENT_TYPE_MASTER` | Type for elements that contain child elements.
    `static int` | `ELEMENT_TYPE_STRING` | Type for string elements.
    `static int` | `ELEMENT_TYPE_UNKNOWN` | Type for unknown elements.
    `static int` | `ELEMENT_TYPE_UNSIGNED_INT` | Type for integer value elements of up to 8 bytes.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `binaryElement​(int id, int contentsSize, ExtractorInput input)` | Called when a binary element is encountered.
    `void` | `endMasterElement​(int id)` | Called when the end of a master element is encountered.
    `void` | `floatElement​(int id, double value)` | Called when a float element is encountered.
    `@com.google.android.exoplayer2.extractor.mkv.EbmlProcessor.ElementType int` | `getElementType​(int id)` | Maps an element ID to a corresponding type.
    `void` | `integerElement​(int id, long value)` | Called when an integer element is encountered.
    `boolean` | `isLevel1Element​(int id)` | Checks if the given id is that of a level 1 element.
    `void` | `startMasterElement​(int id, long contentPosition, long contentSize)` | Called when the start of a master element is encountered.
    `void` | `stringElement​(int id, String value)` | Called when a string element is encountered.

- - ### Field Detail

    - #### ELEMENT_TYPE_UNKNOWN

          static final int ELEMENT_TYPE_UNKNOWN

      Type for unknown elements.
      See Also:
        Constant Field Values

    - #### ELEMENT_TYPE_MASTER

          static final int ELEMENT_TYPE_MASTER

      Type for elements that contain child elements.
      See Also:
        Constant Field Values

    - #### ELEMENT_TYPE_UNSIGNED_INT

          static final int ELEMENT_TYPE_UNSIGNED_INT

      Type for integer value elements of up to 8 bytes.
      See Also:
        Constant Field Values

    - #### ELEMENT_TYPE_STRING

          static final int ELEMENT_TYPE_STRING

      Type for string elements.
      See Also:
        Constant Field Values

    - #### ELEMENT_TYPE_BINARY

          static final int ELEMENT_TYPE_BINARY

      Type for binary elements.
      See Also:
        Constant Field Values

    - #### ELEMENT_TYPE_FLOAT

          static final int ELEMENT_TYPE_FLOAT

      Type for IEEE floating point value elements of either 4 or 8 bytes.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getElementType

          @com.google.android.exoplayer2.extractor.mkv.EbmlProcessor.ElementType int getElementType​(int id)

      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` - The element ID to map.
      Returns:
        One of `ELEMENT_TYPE_UNKNOWN`, `ELEMENT_TYPE_MASTER`, `ELEMENT_TYPE_UNSIGNED_INT`, `ELEMENT_TYPE_STRING`, `ELEMENT_TYPE_BINARY` and `ELEMENT_TYPE_FLOAT`.

    - #### isLevel1Element

          boolean isLevel1Element​(int id)

      Checks if the given id is that of a level 1 element.
      Parameters:
        `id` - The element ID.
      Returns:
        Whether the given id is that of a level 1 element.

    - #### startMasterElement

          void startMasterElement​(int id,
                                  long contentPosition,
                                  long contentSize)
                           throws ParserException

      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(int)` is made.

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

      Parameters:
        `id` - The element ID.
        `contentPosition` - The position of the start of the element's content in the stream.
        `contentSize` - The size of the element's content in bytes.
      Throws:
        `ParserException` - If a parsing error occurs.

    - #### endMasterElement

          void endMasterElement​(int id)
                         throws ParserException

      Called when the end of a master element is encountered.
      Parameters:
        `id` - The element ID.
      Throws:
        `ParserException` - If a parsing error occurs.

    - #### integerElement

          void integerElement​(int id,
                              long value)
                       throws ParserException

      Called when an integer element is encountered.
      Parameters:
        `id` - The element ID.
        `value` - The integer value that the element contains.
      Throws:
        `ParserException` - If a parsing error occurs.

    - #### floatElement

          void floatElement​(int id,
                            double value)
                     throws ParserException

      Called when a float element is encountered.
      Parameters:
        `id` - The element ID.
        `value` - The float value that the element contains
      Throws:
        `ParserException` - If a parsing error occurs.

    - #### stringElement

          void stringElement​(int id,
                             String value)
                      throws ParserException

      Called when a string element is encountered.
      Parameters:
        `id` - The element ID.
        `value` - The string value that the element contains.
      Throws:
        `ParserException` - If a parsing error occurs.

    - #### binaryElement

          void binaryElement​(int id,
                             int contentsSize,
                             ExtractorInput input)
                      throws IOException

      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` - The element ID.
        `contentsSize` - The element's content size.
        `input` - The `ExtractorInput` from which data should be read.
      Throws:
        `ParserException` - If a parsing error occurs.
        `IOException` - If an error occurs reading from the input.