DASH Media Packaging SDK
|
#include <media_handler.h>
Classes | |
struct | EncryptionConfig |
struct | MediaEvent |
struct | MediaSample |
struct | PeriodInfo |
struct | SegmentInfo |
struct | StreamData |
struct | StreamInfo |
Public Member Functions | |
Status | SetHandler (int 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 availble output stream index. | |
Protected Types | |
enum | StreamDataType { kUnknown, kPeriodInfo, kStreamInfo, kEncryptionConfig, kMediaSample, kMediaEvent, kSegmentInfo } |
Protected Member Functions | |
virtual Status | Process (std::unique_ptr< StreamData > stream_data)=0 |
virtual Status | FlushStream (int input_stream_index) |
Flush the stream at the specified input stream index. | |
virtual bool | ValidateOutputStreamIndex (int stream_index) const |
Validate if the stream at the specified index actually exists. | |
Status | Dispatch (std::unique_ptr< StreamData > stream_data) |
Status | DispatchPeriodInfo (int stream_index, std::unique_ptr< PeriodInfo > period_info) |
Dispatch the period info to downstream handlers. | |
Status | DispatchStreamInfo (int stream_index, std::unique_ptr< StreamInfo > stream_info) |
Dispatch the stream info to downstream handlers. | |
Status | DispatchEncryptionConfig (int stream_index, std::unique_ptr< EncryptionConfig > encryption_config) |
Dispatch the encryption config to downstream handlers. | |
Status | DispatchMediaSample (int stream_index, std::unique_ptr< MediaSample > media_sample) |
Dispatch the media sample to downstream handlers. | |
Status | DispatchMediaEvent (int stream_index, std::unique_ptr< MediaEvent > media_event) |
Dispatch the media event to downstream handlers. | |
Status | DispatchSegmentInfo (int stream_index, std::unique_ptr< SegmentInfo > segment_info) |
Dispatch the segment info to downstream handlers. | |
int | num_input_streams () const |
MediaHandler is the base media processing unit. Media handlers transform the input streams and propagate the outputs to downstream media handlers. There are three different types of media handlers: 1) Single input single output This is the most basic handler. It only supports one input and one output with both index as 0. 2) Multiple inputs multiple outputs The number of outputs must be equal to the number of inputs. The output stream at a specific index comes from the input stream at the same index. Different streams usually share a common resource, although they may be independent. One example of this is encryptor handler. 3) Single input multiple outputs The input stream is splitted into multiple output streams. One example of this is trick play handler. Other types of media handlers are disallowed and not supported.
Definition at line 34 of file media_handler.h.
|
protected |
Dispatch the stream data to downstream handlers. Note that stream_data.stream_index should be the output stream index.
Definition at line 41 of file media_handler.cc.
|
protectedpure virtual |
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.