Shaka Packager SDK
|
#include <demuxer.h>
Public Member Functions | |
Demuxer (const std::string &file_name) | |
void | SetKeySource (std::unique_ptr< KeySource > key_source) |
Status | Run () override |
void | Cancel () override |
MediaContainerName | container_name () |
Status | SetHandler (const std::string &stream_label, std::shared_ptr< MediaHandler > handler) |
void | SetLanguageOverride (const std::string &stream_label, const std::string &language_override) |
void | set_dump_stream_info (bool dump_stream_info) |
Public Member Functions inherited from shaka::media::MediaHandler | |
Status | SetHandler (size_t output_stream_index, std::shared_ptr< MediaHandler > handler) |
Connect downstream handler at the specified output stream index. | |
Status | AddHandler (std::shared_ptr< MediaHandler > handler) |
Connect downstream handler to the next available output stream index. | |
Status | Initialize () |
bool | IsConnected () |
Validate if the handler is connected to its upstream handler. | |
Protected Member Functions | |
MediaHandler implementation overrides. | |
Status | InitializeInternal () override |
Status | Process (std::unique_ptr< StreamData > stream_data) override |
bool | ValidateOutputStreamIndex (size_t stream_index) const override |
Validate if the stream at the specified index actually exists. | |
Protected Member Functions inherited from shaka::media::MediaHandler | |
virtual Status | OnFlushRequest (size_t input_stream_index) |
Event handler for flush request at the specific input stream index. | |
Status | Dispatch (std::unique_ptr< StreamData > stream_data) const |
Status | DispatchStreamInfo (size_t stream_index, std::shared_ptr< const StreamInfo > stream_info) const |
Dispatch the stream info to downstream handlers. | |
Status | DispatchMediaSample (size_t stream_index, std::shared_ptr< const MediaSample > media_sample) const |
Dispatch the media sample to downstream handlers. | |
Status | DispatchTextSample (size_t stream_index, std::shared_ptr< const TextSample > text_sample) const |
Dispatch the text sample to downstream handlers. | |
Status | DispatchSegmentInfo (size_t stream_index, std::shared_ptr< const SegmentInfo > segment_info) const |
Dispatch the segment info to downstream handlers. | |
Status | DispatchScte35Event (size_t stream_index, std::shared_ptr< const Scte35Event > scte35_event) const |
Dispatch the scte35 event to downstream handlers. | |
Status | DispatchCueEvent (size_t stream_index, std::shared_ptr< const CueEvent > cue_event) const |
Dispatch the cue event to downstream handlers. | |
Status | FlushDownstream (size_t output_stream_index) |
Flush the downstream connected at the specified output stream index. | |
Status | FlushAllDownstreams () |
Flush all connected downstream handlers. | |
bool | initialized () |
size_t | num_input_streams () const |
size_t | next_output_stream_index () const |
const std::map< size_t, std::pair< std::shared_ptr< MediaHandler >, size_t > > & | output_handlers () |
Additional Inherited Members | |
Static Public Member Functions inherited from shaka::media::MediaHandler | |
static Status | Chain (const std::vector< std::shared_ptr< MediaHandler >> &list) |
Demuxer is responsible for extracting elementary stream samples from a media file, e.g. an ISO BMFF file.
|
explicit |
file_name | specifies the input source. It uses prefix matching to create a proper File object. The user can extend File to support a custom File object with its own prefix. |
Definition at line 76 of file demuxer.cc.
|
overridevirtual |
Cancel a demuxing job in progress. Will cause Run to exit with an error status of type CANCELLED.
Implements shaka::media::OriginHandler.
Definition at line 129 of file demuxer.cc.
|
inline |
|
inlineoverrideprotectedvirtual |
Internal implementation of initialize. Note that it should only initialize the MediaHandler itself. Downstream handlers are handled in Initialize().
Implements shaka::media::MediaHandler.
|
inlineoverrideprotectedvirtual |
Process the incoming stream data. Note that (1) stream_data.stream_index should be the input stream index; (2) The implementation needs to call DispatchXxx to dispatch the processed stream data to the downstream handlers after finishing processing if needed.
Implements shaka::media::MediaHandler.
|
overridevirtual |
Drive the remuxing from demuxer side (push). Read the file and push the Data to Muxer until Eof.
Implements shaka::media::OriginHandler.
Definition at line 88 of file demuxer.cc.
Status shaka::media::Demuxer::SetHandler | ( | const std::string & | stream_label, |
std::shared_ptr< MediaHandler > | handler | ||
) |
Set the handler for the specified stream.
stream_label | can be 'audio', 'video', or stream number (zero based). |
handler | is the handler for the specified stream. |
Definition at line 133 of file demuxer.cc.
void shaka::media::Demuxer::SetKeySource | ( | std::unique_ptr< KeySource > | key_source | ) |
Set the KeySource for media decryption.
key_source | points to the source of decryption keys. The key source must support fetching of keys for the type of media being demuxed. |
Definition at line 84 of file demuxer.cc.
void shaka::media::Demuxer::SetLanguageOverride | ( | const std::string & | stream_label, |
const std::string & | language_override | ||
) |
Override the language in the specified stream. If the specified stream is a video stream or invalid, this function is a no-op.
stream_label | can be 'audio', 'video', or stream number (zero based). |
language_override | is the new language. |
Definition at line 143 of file demuxer.cc.