# Cea708Decoder

Artifact: [androidx.media3:media3-extractor](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/extractor/text/cea/Cea708Decoder.java+class:androidx.media3.extractor.text.cea.Cea708Decoder)

*** ** * ** ***

<br />

```
@UnstableApi
class Cea708Decoder : SubtitleDecoder
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleDecoder` for CEA-708 (also known as "EIA-708").

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#Cea708Decoder(int,java.util.List<byte[]>)( accessibilityChannel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, initializationData: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!>? )` Constructs an instance. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleInputBuffer?` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#dequeueInputBuffer()()` Dequeues the next input buffer to be filled and queued to the decoder. |
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleOutputBuffer?` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#dequeueOutputBuffer()()` Dequeues the next output buffer from the decoder. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#flush()()` Flushes the decoder. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#getName()()` Returns the name of the decoder. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#queueInputBuffer(androidx.media3.extractor.text.SubtitleInputBuffer)(inputBuffer: https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleInputBuffer!)` Queues an input buffer to the decoder. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#release()()` Releases the decoder. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#setOutputStartTimeUs(long)(outputStartTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the timestamp from which output buffers should be produced, in microseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#setPositionUs(long)(positionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Informs the decoder of the current playback position. |

| ### Protected functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/Subtitle!` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#createSubtitle()()` Creates a `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/Subtitle` from the available data. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#decode(androidx.media3.extractor.text.SubtitleInputBuffer)(inputBuffer: https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleInputBuffer!)` Filters and processes the raw data, providing `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/Subtitle`s via `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/CeaDecoder#createSubtitle()` when sufficient data has been processed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleOutputBuffer?` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#getAvailableOutputBuffer()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#getPositionUs()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#isNewSubtitleDataAvailable()()` Returns whether there is data available to create a new `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/Subtitle`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/Cea708Decoder#releaseOutputBuffer(androidx.media3.extractor.text.SubtitleOutputBuffer)(outputBuffer: https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleOutputBuffer!)` |

### Inherited functions

From [androidx.media3.decoder.Decoder](https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder) `abstract I?` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder#dequeueInputBuffer()()`

Dequeues the next input buffer to be filled and queued to the decoder.
`abstract O?` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder#dequeueOutputBuffer()()`

Dequeues the next output buffer from the decoder.
`abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder#queueInputBuffer(I)(inputBuffer: I!)`

Queues an input buffer to the decoder.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder#setCallback(androidx.media3.decoder.Decoder.Callback,java.util.concurrent.Executor)(callback: https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder.Callback!, executor: https://developer.android.com/reference/java/util/concurrent/Executor.html!)`

Sets the callback and executor.

## Public constructors

### Cea708Decoder

```
Cea708Decoder(
    accessibilityChannel: Int,
    initializationData: (Mutable)List<ByteArray<Byte>!>?
)
```

Constructs an instance.

| Parameters |
|---|---|
| `accessibilityChannel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The accessibility channel, or `https://developer.android.com/reference/kotlin/androidx/media3/common/Format#NO_VALUE()` if unknown. |
| `initializationData: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!>?` | Optional initialization data for the decoder. If present, it must conform to the structure created by `https://developer.android.com/reference/kotlin/androidx/media3/common/util/CodecSpecificDataUtil#buildCea708InitializationData(boolean)`. |

## Public functions

### dequeueInputBuffer

```
fun dequeueInputBuffer(): SubtitleInputBuffer?
```

Dequeues the next input buffer to be filled and queued to the decoder.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleInputBuffer?` | The input buffer, which will have been cleared, or null if a buffer isn't available. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder` | If a decoder error has occurred. |
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleDecoderException` |   |

### dequeueOutputBuffer

```
fun dequeueOutputBuffer(): SubtitleOutputBuffer?
```

Dequeues the next output buffer from the decoder.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleOutputBuffer?` | The output buffer, or null if an output buffer isn't available. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder` | If a decoder error has occurred. |
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleDecoderException` |   |

### flush

```
fun flush(): Unit
```

Flushes the decoder. Ownership of dequeued input buffers is returned to the decoder. The caller is still responsible for releasing any dequeued output buffers.

### getName

```
fun getName(): String!
```

Returns the name of the decoder.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The name of the decoder. |

### queueInputBuffer

```
fun queueInputBuffer(inputBuffer: SubtitleInputBuffer!): Unit
```

Queues an input buffer to the decoder.

| Parameters |
|---|---|
| `inputBuffer: https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleInputBuffer!` | The input buffer. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder` | If a decoder error has occurred. |
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleDecoderException` |   |

### release

```
fun release(): Unit
```

Releases the decoder. Must be called when the decoder is no longer needed.

### setOutputStartTimeUs

```
fun setOutputStartTimeUs(outputStartTimeUs: Long): Unit
```

Sets the timestamp from which output buffers should be produced, in microseconds.

Any decoded buffer with a timestamp less than `outputStartTimeUs` should be skipped by the implementation and not made available via `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder#dequeueOutputBuffer()`.

This method must only be called before `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder#queueInputBuffer(I)` initially or after `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder#flush()`.

| Parameters |
|---|---|
| `outputStartTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The time from which output buffer should be produced, in microseconds. |

### setPositionUs

```
fun setPositionUs(positionUs: Long): Unit
```

Informs the decoder of the current playback position.

Must be called prior to each attempt to dequeue output buffers from the decoder.

| Parameters |
|---|---|
| `positionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The current playback position in microseconds. |

## Protected functions

### createSubtitle

```
protected fun createSubtitle(): Subtitle!
```

Creates a `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/Subtitle` from the available data.

### decode

```
protected fun decode(inputBuffer: SubtitleInputBuffer!): Unit
```

Filters and processes the raw data, providing `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/Subtitle`s via `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/cea/CeaDecoder#createSubtitle()` when sufficient data has been processed.

### getAvailableOutputBuffer

```
protected fun getAvailableOutputBuffer(): SubtitleOutputBuffer?
```

### getPositionUs

```
protected fun getPositionUs(): Long
```

### isNewSubtitleDataAvailable

```
protected fun isNewSubtitleDataAvailable(): Boolean
```

Returns whether there is data available to create a new `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/Subtitle`.

### releaseOutputBuffer

```
protected fun releaseOutputBuffer(outputBuffer: SubtitleOutputBuffer!): Unit
```