Decoder
@UnstableApi
interface Decoder<I, O, E : DecoderException?>
ImageDecoder |
A |
SimpleDecoder |
Base class for |
SubtitleDecoder |
Decodes |
BitmapFactoryImageDecoder |
An image decoder that uses |
Cea608Decoder |
A |
Cea708Decoder |
A |
ExternallyLoadedImageDecoder |
An |
SimpleSubtitleDecoder |
Base class for subtitle parsers that use their own decode thread. |
A media decoder.
| Parameters | |
|---|---|
<I> |
The type of buffer input to the decoder. |
<O> |
The type of buffer output from the decoder. |
<E : DecoderException?> |
The type of exception thrown from the decoder. |
Summary
Nested types |
|---|
interface Decoder.CallbackCallback for asynchronous events. |
Public functions |
|
|---|---|
I? |
Dequeues the next input buffer to be filled and queued to the decoder. |
O? |
Dequeues the next output buffer from the decoder. |
Unit |
flush()Flushes the decoder. |
String! |
getName()Returns the name of the decoder. |
Unit |
queueInputBuffer(inputBuffer: I!)Queues an input buffer to the decoder. |
Unit |
release()Releases the decoder. |
Unit |
setCallback(callback: Decoder.Callback!, executor: Executor!)Sets the callback and executor. |
Unit |
setOutputStartTimeUs(outputStartTimeUs: Long)Sets the timestamp from which output buffers should be produced, in microseconds. |
Public functions
dequeueInputBuffer
fun dequeueInputBuffer(): I?
Dequeues the next input buffer to be filled and queued to the decoder.
| Returns | |
|---|---|
I? |
The input buffer, which will have been cleared, or null if a buffer isn't available. |
| Throws | |
|---|---|
E |
If a decoder error has occurred. |
dequeueOutputBuffer
fun dequeueOutputBuffer(): O?
Dequeues the next output buffer from the decoder.
| Returns | |
|---|---|
O? |
The output buffer, or null if an output buffer isn't available. |
| Throws | |
|---|---|
E |
If a decoder error has occurred. |
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 | |
|---|---|
String! |
The name of the decoder. |
queueInputBuffer
fun queueInputBuffer(inputBuffer: I!): Unit
Queues an input buffer to the decoder.
| Parameters | |
|---|---|
inputBuffer: I! |
The input buffer. |
| Throws | |
|---|---|
E |
If a decoder error has occurred. |
release
fun release(): Unit
Releases the decoder. Must be called when the decoder is no longer needed.
setCallback
fun setCallback(callback: Decoder.Callback!, executor: Executor!): Unit
Sets the callback and executor.
| Parameters | |
|---|---|
callback: Decoder.Callback! |
The callback to receive events. |
executor: Executor! |
The executor on which the callback will be invoked. |
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 dequeueOutputBuffer.
This method must only be called before queuing the first input buffer initially or after flush.
| Parameters | |
|---|---|
outputStartTimeUs: Long |
The time from which output buffer should be produced, in microseconds. |