class ChunkInputStream
Defined at line 25 of file ../../src/media/codec/codecs/chunk_input_stream.h
A chunk iterator for a stream of input packets. Provides fixed size input
blocks from the stream of input packets, buffering the end of input packets
that don't align with the block size until another packet arrives to complete
the block.
`ChunkInputStream` will extrapolate timestamps with the provided extrapolator
if the input packet's timestamp does not align with the block size. See
`TimestampExtrapolator` for extrapolation semantics.
Public Methods
void ChunkInputStream (size_t chunk_size, TimestampExtrapolator && timestamp_extrapolator, InputBlockProcessor && input_block_processor)
Defined at line 9 of file ../../src/media/codec/codecs/chunk_input_stream.cc
Status ProcessInputPacket (const CodecPacket * input_packet)
Adds a new input packet to the input stream and executes
`input_block_processor` for all the newly available input blocks (which may
be none).
Pointers in an input block should not be stored. They are valid only for
their lifetime as an argument to the `input_block_processor`.
If `input_block_processor` returns `kTerminate`, iteration over input
blocks will stop. After this early termination, all calls to this instance
other than ~ChunkInputStream will fail with an `ASSERT` in debug builds.
Defined at line 20 of file ../../src/media/codec/codecs/chunk_input_stream.cc
Status Flush ()
If there are any buffered input bytes, `Flush` will pad the input block
with 0s to complete it and yield an input block with the content.
The flushed input block, which may or may not have data, will be sent to
`flush_block_processor` if provided or `input_block_processor` otherwise.
The flushed block will have `is_end_of_stream` set to `true`.
Defined at line 71 of file ../../src/media/codec/codecs/chunk_input_stream.cc
Enumerations
enum Status
| Name | Value |
|---|---|
| kOk | 0 |
| kUserTerminated | 1 |
| kExtrapolationFailedWithoutTimebase | 2 |
Defined at line 50 of file ../../src/media/codec/codecs/chunk_input_stream.h
enum ControlFlow
| Name | Value |
|---|---|
| kContinue | 0 |
| kTerminate | 1 |
Defined at line 56 of file ../../src/media/codec/codecs/chunk_input_stream.h