This is given raw bytes from an input stream and produces EncodedFrame objects. This must do so synchronously and is called on a background thread. This is only used from a single thread after being created.
Definition at line 35 of file demuxer.h.
virtual bool shaka::media::Demuxer::Demux |
( |
double |
timestamp_offset, |
|
|
const uint8_t * |
data, |
|
|
size_t |
size, |
|
|
std::vector< std::shared_ptr< EncodedFrame >> * |
frames |
|
) |
| |
|
pure virtual |
Attempts to demux the given data into some number of encoded frames.
If the data contains multiple streams (i.e. multiplexed content), then all frames will be given and they will be separated based on their stream_info field.
This may be given segments from a different source after starting. This will be first given the init segment for the new stream then the new segments. This should support this case and reinitialize the demxuer if needed. The resulting frames should have different stream_info fields from before, even if they are of the same type and codec.
- Parameters
-
timestamp_offset | The current offset to add to the timestamps. |
data | The data to demux. |
size | The number of bytes in data. |
frames | [OUT] Where to insert newly created frames. |
- Returns
- True on success, false on error.
Implemented in shaka::media::ffmpeg::FFmpegDemuxer.