public final class Cea608Decoder extends Object
SubtitleDecoder
for CEA-608 (also known as "line 21 captions" and "EIA-608").Constructor and Description |
---|
Cea608Decoder() |
Modifier and Type | Method and Description |
---|---|
protected Subtitle |
createSubtitle()
Creates a
Subtitle from the available data. |
protected void |
decode(SubtitleInputBuffer inputBuffer)
Filters and processes the raw data, providing
Subtitle s via createSubtitle()
when sufficient data has been processed. |
SubtitleInputBuffer |
dequeueInputBuffer()
Dequeues the next input buffer to be filled and queued to the decoder.
|
SubtitleOutputBuffer |
dequeueOutputBuffer()
Dequeues the next output buffer from the decoder.
|
void |
flush()
Flushes the decoder.
|
String |
getName()
Returns the name of the decoder.
|
protected boolean |
isNewSubtitleDataAvailable()
Returns whether there is data available to create a new
Subtitle . |
static boolean |
isSeiMessageCea608(int payloadType,
int payloadLength,
ParsableByteArray payload)
Inspects an sei message to determine whether it contains CEA-608.
|
void |
queueInputBuffer(SubtitleInputBuffer inputBuffer)
Queues an input buffer to the decoder.
|
void |
release()
Releases the decoder.
|
protected void |
releaseOutputBuffer(SubtitleOutputBuffer outputBuffer) |
void |
setPositionUs(long positionUs)
Informs the decoder of the current playback position.
|
public String getName()
Decoder
getName
in interface Decoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
public void flush()
Decoder
flush
in interface Decoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
public void release()
Decoder
release
in interface Decoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
protected boolean isNewSubtitleDataAvailable()
Subtitle
.protected void decode(SubtitleInputBuffer inputBuffer)
Subtitle
s via createSubtitle()
when sufficient data has been processed.public static boolean isSeiMessageCea608(int payloadType, int payloadLength, ParsableByteArray payload)
The position of payload
is left unchanged.
payloadType
- The payload type of the message.payloadLength
- The length of the payload.payload
- A ParsableByteArray
containing the payload.public void setPositionUs(long positionUs)
SubtitleDecoder
Must be called prior to each attempt to dequeue output buffers from the decoder.
setPositionUs
in interface SubtitleDecoder
positionUs
- The current playback position in microseconds.public SubtitleInputBuffer dequeueInputBuffer() throws SubtitleDecoderException
Decoder
dequeueInputBuffer
in interface Decoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
SubtitleDecoderException
public void queueInputBuffer(SubtitleInputBuffer inputBuffer) throws SubtitleDecoderException
Decoder
queueInputBuffer
in interface Decoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
inputBuffer
- The input buffer.SubtitleDecoderException
public SubtitleOutputBuffer dequeueOutputBuffer() throws SubtitleDecoderException
Decoder
dequeueOutputBuffer
in interface Decoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
SubtitleDecoderException
protected void releaseOutputBuffer(SubtitleOutputBuffer outputBuffer)