NaCl Player API
NaCl Player API Documentation
|
#include <es_data_source.h>
Public Member Functions | |
ElementaryStream (const ElementaryStream &other) | |
ElementaryStream & | operator= (const ElementaryStream &other) |
virtual ElementaryStreamType | GetStreamType () const =0 |
Retrieves stream type represented by this resource. | |
int32_t | InitializeDone (const std::function< void(int32_t)> &callback) |
int32_t | InitializeDone () |
int32_t | InitializeDone (StreamInitializationMode mode, const std::function< void(int32_t)> &callback) |
int32_t | InitializeDone (StreamInitializationMode mode) |
int32_t | AppendPacket (const ESPacket &packet, const std::function< void(int32_t)> &callback) |
int32_t | AppendPacket (const ESPacket &packet) |
int32_t | AppendEncryptedPacket (const ESPacket &packet, const ESPacketEncryptionInfo &encryption_info, const std::function< void(int32_t)> &callback) |
int32_t | AppendEncryptedPacket (const ESPacket &packet, const ESPacketEncryptionInfo &encryption_info) |
int32_t | AppendTrustZonePacket (const ESPacket &packet, const TrustZoneReference &handle, const std::function< void(int32_t)> &callback) |
int32_t | AppendTrustZonePacket (const ESPacket &packet, const TrustZoneReference &handle) |
int32_t | Flush (const std::function< void(int32_t)> &callback) |
int32_t | Flush () |
int32_t | SetDRMInitData (const std::string &type, uint32_t init_data_size, const void *init_data, const std::function< void(int32_t)> &callback) |
int32_t | SetDRMInitData (const std::string &type, uint32_t init_data_size, const void *init_data) |
Protected Member Functions | |
virtual Impl * | impl ()=0 |
Interface representing common functionalities of elementary streams.
Basic usage:
ESDataSource.AddStream
InitializeDone
AppendPacket
ESDataSource.SetEndOfStream
Most methods in this class are available in synchronous and asynchronous variant. Both versions perform the same action, the only difference is how results of those actions are reported to the caller. Asynchronous method propagates this result by a provided additional parameter callback
function.
Common constraints:
Definition at line 51 of file es_data_source.h.
int32_t Samsung::NaClPlayer::ElementaryStream::AppendEncryptedPacket | ( | const ESPacket & | packet, |
const ESPacketEncryptionInfo & | encryption_info, | ||
const std::function< void(int32_t)> & | callback | ||
) |
Appends an encrypted elementary stream packet.
Before appending any packet to the buffer, it must be properly configured (
[in] | packet | A ESPacket containing Elementary Stream packet data and metadata. |
[in] | encryption_info | A ESPacketEncryptionInfo containing packet encryption description. |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. ErrorCodes::BufferFull
if player internal buffer is full. Returns ErrorCodes::Failed
if InitializeDone()
has not successfully completed. int32_t Samsung::NaClPlayer::ElementaryStream::AppendEncryptedPacket | ( | const ESPacket & | packet, |
const ESPacketEncryptionInfo & | encryption_info | ||
) |
Synchronously appends an encrypted elementary stream packet.
For detailed description
int32_t Samsung::NaClPlayer::ElementaryStream::AppendPacket | ( | const ESPacket & | packet, |
const std::function< void(int32_t)> & | callback | ||
) |
Appends an elementary stream packet.
Before appending any packet to the buffer, it must be properly configured (
[in] | packet | A ESPacket containing Elementary Stream packet data and metadata. |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. ErrorCodes::BufferFull
if player internal buffer is full. Returns ErrorCodes::Failed
if InitializeDone()
has not successfully completed. int32_t Samsung::NaClPlayer::ElementaryStream::AppendPacket | ( | const ESPacket & | packet | ) |
Synchronously appends an elementary stream packet.
For detailed description
int32_t Samsung::NaClPlayer::ElementaryStream::AppendTrustZonePacket | ( | const ESPacket & | packet, |
const TrustZoneReference & | handle, | ||
const std::function< void(int32_t)> & | callback | ||
) |
Appends Elementary Stream packet using TrustZone handle.
Before appending any packet to the buffer, it must be properly configured (
Note: After successful append ownership of the TrustZone memory is transfered from the module to the browser and handle must not be released. But in case of any error (i.e. return code/callback call with status other than ErrorCodes::Success
) the module is responsible for releasing memory reference.
[in] | packet | A ESPacket containing Elementary Stream metadata. Note: when using this method of appending packets size and buffer fields of ESPacket struct must be set to 0 and nullptr. If they are not set to zero (nullptr), then ErrorCodes::BadArgument will be returned. |
[in] | handle | A handle to TrustZone memory containing packet data which will be appended. |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Returns ErrorCodes::Failed
if InitializeDone()
has not successfully completed. Returns ErrorCodes::BadArgument if either size
or buffer
are not set to 0. int32_t Samsung::NaClPlayer::ElementaryStream::AppendTrustZonePacket | ( | const ESPacket & | packet, |
const TrustZoneReference & | handle | ||
) |
Synchronously appends an elementary stream packet using TrustZone handle.
For detailed description
int32_t Samsung::NaClPlayer::ElementaryStream::Flush | ( | const std::function< void(int32_t)> & | callback | ) |
Flushes all appended, but not decoded or rendered packets to this buffer. This method is usually called during seek operations.
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Returns ErrorCodes::Failed
if InitializeDone()
has not successfully completed. int32_t Samsung::NaClPlayer::ElementaryStream::Flush | ( | ) |
Synchronously flushes all appended, but not decoded or rendered packets to this buffer. This method is usually called during seek operations.
For detailed description
int32_t Samsung::NaClPlayer::ElementaryStream::InitializeDone | ( | const std::function< void(int32_t)> & | callback | ) |
Call this method to confirm new/updated buffer config. This method will return ErrorCodes::Success
if set buffer config is valid or one of the error codes from ErrorCodes
otherwise.
This method assumes that all plugin provided all necessary Elementary Stream initialization metadata (see StreamInitializationMode_Full
).
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Method returns ErrorCodes::BadArgument
when stream configuration is invalid. int32_t Samsung::NaClPlayer::ElementaryStream::InitializeDone | ( | ) |
Synchronously confirm new/updated buffer config. This method will return ErrorCodes::Success
if set buffer config is valid or one of the error codes from ErrorCodes
otherwise.
For detailed description
int32_t Samsung::NaClPlayer::ElementaryStream::InitializeDone | ( | StreamInitializationMode | mode, |
const std::function< void(int32_t)> & | callback | ||
) |
Call this method to confirm new/updated buffer config. This method will return ErrorCodes::Success
if set buffer config is valid or one of the error codes from ErrorCodes
otherwise.
[in] | mode | A parameter indicating how much information regarding elementary stream configuration was extracted by the plugin (demuxer). |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Method returns ErrorCodes::BadArgument
when stream configuration is invalid. int32_t Samsung::NaClPlayer::ElementaryStream::InitializeDone | ( | StreamInitializationMode | mode | ) |
Synchronously confirm new/updated buffer config. This method will return ErrorCodes::Success
if set buffer config is valid or one of the error codes from ErrorCodes
otherwise.
For detailed description
int32_t Samsung::NaClPlayer::ElementaryStream::SetDRMInitData | ( | const std::string & | type, |
uint32_t | init_data_size, | ||
const void * | init_data, | ||
const std::function< void(int32_t)> & | callback | ||
) |
Found DRM system initialization metadata. type
describes type of the initialization data init_data
associated with the stream.
[in] | type | A string containing DRM system specific description of type of an init_data . |
[in] | init_data_size | A size of DRM specific init_data buffer. |
[in] | init_data | A buffer containing DRM system initialization data. |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. int32_t Samsung::NaClPlayer::ElementaryStream::SetDRMInitData | ( | const std::string & | type, |
uint32_t | init_data_size, | ||
const void * | init_data | ||
) |
Synchronous version of SetDRMInitData
.
For detailed description