An interface for demuxing modules. This interface provides methods used to parse data of media container and perform basic operation on StreamDemuxer
. This interface allows to set listeners for data needed by NaCl Player
- stream configurations and DRM data.
More...
#include <stream_demuxer.h>
An interface for demuxing modules. This interface provides methods used to parse data of media container and perform basic operation on StreamDemuxer
. This interface allows to set listeners for data needed by NaCl Player
- stream configurations and DRM data.
- Note
- This interface is needed to be implemented by demuxer module to be consistent with other
Native Player
modules.
Definition at line 144 of file stream_demuxer.h.
Describes message types that StreamDemuxer
can post via callback function passed by StreamDemuxer::Init method. This Message can be useful when running demuxer methods asynchronously to signal certain events or completion of actions.
Enumerator |
---|
kError |
|
kInitialized |
|
kFlushed |
|
kClosed |
|
kEndOfStream |
|
kAudioPkt |
|
kVideoPkt |
|
Definition at line 156 of file stream_demuxer.h.
Describes type of demuxer. Each demuxer can be used to parse one type of container: audio or video.
Enumerator |
---|
kUnknown |
|
kAudio |
|
kVideo |
|
Definition at line 149 of file stream_demuxer.h.
StreamDemuxer::StreamDemuxer |
( |
| ) |
|
|
inline |
virtual StreamDemuxer::~StreamDemuxer |
( |
| ) |
|
|
inlinevirtual |
virtual void StreamDemuxer::Close |
( |
| ) |
|
|
pure virtual |
static std::unique_ptr<StreamDemuxer> StreamDemuxer::Create |
( |
const pp::InstanceHandle & |
instance, |
|
|
Type |
type |
|
) |
| |
|
static |
virtual void StreamDemuxer::Flush |
( |
| ) |
|
|
pure virtual |
Performs flush operation on StreamDemuxer. All demuxed elementary stream packets have to be erased, in order to prepare StreamDemuxer
to receive data from container.
virtual bool StreamDemuxer::Init |
( |
const std::function< void(Message, std::unique_ptr< ElementaryStreamPacket >)> & |
callback, |
|
|
pp::MessageLoop |
callback_dispatcher |
|
) |
| |
|
pure virtual |
Initialize StreamDemuxer, if finished successfully then data from the requested stream can be parsed.
- Parameters
-
[in] | callback | A function which is registered. This function is used to communicate with use of StreamDemuxer::Message. It should be called on callback_dispatcher MessageLoop
In particular is used to pass ElementaryStreamPacket. |
[in] | callback_dispatcher | A pp::MessageLoop on which communication should be performed. |
- Returns
- True on success, false otherwise.
virtual void StreamDemuxer::Parse |
( |
const std::vector< uint8_t > & |
data | ) |
|
|
pure virtual |
Performs parse operation. Passed data should be parsed or added to queue data to be parsed. Parsed data - ElementaryStreamPacket
should be passed to the callback function registered in StreamDemuxer::Init. To recognize type of demuxed packet StreamDemuxer::Message::kAudioPkt or StreamDemuxer::Message::kVideoPkt can be used.
- Parameters
-
[in] | data | An byte array which helds data of media container. |
virtual bool StreamDemuxer::SetAudioConfigListener |
( |
const std::function< void(const AudioConfig &)> & |
callback | ) |
|
|
pure virtual |
Registers a callback function which is called every time audio configuration has changed and pass new configuration.
- Parameters
-
[in] | callback | A function which is registered in StreamDemuxer. It should be called each time AudioConfig had changed or on the first time configuration is available.
Callback should be called on callback_dispatcher MessageLoop registered in StreamDemuxer::Init. |
- Returns
- True on success, false otherwise.
virtual bool StreamDemuxer::SetDRMInitDataListener |
( |
const std::function< void(const std::string &type, const std::vector< uint8_t > &init_data)> & |
callback | ) |
|
|
pure virtual |
Registers a callback function which is called every time DRM init data is discovered by StreamDemuxer and pass DRM init data.
- Parameters
-
[in] | callback | A function which is registered in StreamDemuxer. It should be called DRM data is available.
Callback should be called on callback_dispatcher MessageLoop registered in StreamDemuxer::Init. |
- Returns
- True on success, false otherwise.
virtual void StreamDemuxer::SetTimestamp |
( |
Samsung::NaClPlayer::TimeTicks |
| ) |
|
|
pure virtual |
Sets time stamp to demuxed packets. Can be use after performing seek operation on elementary stream to set proper timestamps of packets.
virtual bool StreamDemuxer::SetVideoConfigListener |
( |
const std::function< void(const VideoConfig &)> & |
callback | ) |
|
|
pure virtual |
Registers a callback function which is called every time video configuration has changed and pass new configuration.
- Parameters
-
[in] | callback | A function which is registered in StreamDemuxer . It should be called each time VideoConfig had changed or on the first time configuration is available.
Callback should be called on callback_dispatcher MessageLoop registered in StreamDemuxer::Init. |
- Returns
- True on success, false otherwise.
The documentation for this class was generated from the following file: