|
YAACC - UPNP Client and Server
|
The loop that takes the decoded audio of one chunk out of a platform codec, with every bound the engine thread needs: a limit on the bytes (it stops at the first buffer that would exceed it, gives that buffer back without reading it and does not look at the rest), a limit on the number of buffers, and a deadline for the whole chunk. More...

Classes | |
| interface | FormatCheck |
| Looks at the new output format; throws when the engine can not use it. More... | |
| enum | Kind |
| What one call of the codec gave. More... | |
| enum | Outcome |
| Why the drain ended. More... | |
| class | Result |
| The audio (empty unless the outcome is OK) and why the drain ended. | |
| interface | Source |
| The output side of a codec. More... | |
| class | Step |
| One answer of the codec. | |
Public Member Functions | |
| CodecDrain (long limitBytes, int maxBuffers, long deadlineMillis, long timeoutMicros, LongSupplier nanos) | |
| Result | run (Source source, FormatCheck formatCheck) throws DecoderException |
The loop that takes the decoded audio of one chunk out of a platform codec, with every bound the engine thread needs: a limit on the bytes (it stops at the first buffer that would exceed it, gives that buffer back without reading it and does not look at the rest), a limit on the number of buffers, and a deadline for the whole chunk.
A hostile stream can make a decoder produce far more audio than it was given; without these bounds one chunk could keep the (high priority) audio thread busy for as long as the codec keeps answering. The codec itself is behind Source, so the bounds are tested with a fake; MediaCodecDecoder only adapts MediaCodec to it.