Pepper_56_C++_interfaces
Pepper_56_C++_interfaces
 All Classes Namespaces Files Functions Typedefs Enumerations Macros Groups
pp::ElementaryStream_Samsung Class Referenceabstract

#include <es_data_source_samsung.h>

Inheritance diagram for pp::ElementaryStream_Samsung:
pp::Resource pp::AudioElementaryStream_Samsung pp::VideoElementaryStream_Samsung

Public Member Functions

 ElementaryStream_Samsung (const ElementaryStream_Samsung &other)
 
ElementaryStream_Samsungoperator= (const ElementaryStream_Samsung &other)
 
virtual
PP_ElementaryStream_Type_Samsung 
GetStreamType () const =0
 Retrieves stream type represented by this resource.
 
int32_t InitializeDone (const CompletionCallback &callback)
 
int32_t InitializeDone (PP_StreamInitializationMode mode, const CompletionCallback &callback)
 
int32_t AppendPacket (const PP_ESPacket &packet, const CompletionCallback &callback)
 
int32_t AppendEncryptedPacket (const PP_ESPacket &packet, const PP_ESPacketEncryptionInfo &encryption_info, const CompletionCallback &callback)
 
int32_t AppendTrustZonePacket (const PP_ESPacket &packet, const PP_TrustZoneReference &handle, const CompletionCallback &callback)
 
int32_t Flush (const CompletionCallback &callback)
 
int32_t SetDRMInitData (uint32_t type_size, const void *type, uint32_t init_data_size, const void *init_data, const CompletionCallback &callback)
 
int32_t SetDRMInitData (const std::string &type, uint32_t init_data_size, const void *init_data, const CompletionCallback &callback)
 
- Public Member Functions inherited from pp::Resource
 Resource ()
 The default constructor.
 
 Resource (const Resource &other)
 
virtual ~Resource ()
 Destructor.
 
Resourceoperator= (const Resource &other)
 
bool is_null () const
 
PP_Resource pp_resource () const
 
PP_Resource detach ()
 

Protected Member Functions

 ElementaryStream_Samsung (PP_Resource resource)
 
 ElementaryStream_Samsung (const Resource &resource)
 
 ElementaryStream_Samsung (PassRef, PP_Resource resource)
 
- Protected Member Functions inherited from pp::Resource
 Resource (PP_Resource resource)
 
 Resource (PassRef, PP_Resource resource)
 
void PassRefFromConstructor (PP_Resource resource)
 
void Clear ()
 Sets this resource to null. This releases ownership of the resource.
 

Detailed Description

Interface representing common functionalities of elementary streams.

Basic usage:

  1. Crate stream by calling ESDataSource_Samsung.AddStream
  2. Initialize buffer specific information (audio/video config)
  3. Call InitializeDone
  4. Attach Data Source to the player
  5. Appends Elementary Stream packets by calling AppendPacket
  6. Signalize end of stream (clip) by calling ESDataSource_Samsung.SetEndOfStream

Member Function Documentation

int32_t pp::ElementaryStream_Samsung::AppendEncryptedPacket ( const PP_ESPacket &  packet,
const PP_ESPacketEncryptionInfo &  encryption_info,
const CompletionCallback callback 
)

Appends Elementary Stream encrypted packet.

Before appending any packet to the buffer, it must be properly configured (see InitializeDone).

Parameters
[in]packetA PP_ESPacket containing Elementary Stream packet data and metadata.
[in]encryption_infoA PP_ESPacketEncryptionInfo containing packet encryption description.
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from pp_errors.h.
PP_ERROR_NOQUOTA if internal buffer is full.
PP_ERROR_FAILED if InitializeDone() has not successfully completed.
int32_t pp::ElementaryStream_Samsung::AppendPacket ( const PP_ESPacket &  packet,
const CompletionCallback callback 
)

Appends Elementary Stream packet.

Before appending any packet to the buffer, it must be properly configured (see InitializeDone).

Parameters
[in]packetA PP_ESPacket containing Elementary Stream packet data and metadata.
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from pp_errors.h.
PP_ERROR_NOQUOTA if internal buffer is full.
PP_ERROR_FAILED if InitializeDone() has not successfully completed.
int32_t pp::ElementaryStream_Samsung::AppendTrustZonePacket ( const PP_ESPacket &  packet,
const PP_TrustZoneReference &  handle,
const CompletionCallback callback 
)

Appends Elementary Stream packet.

Before appending any packet to the buffer, it must be properly configured (see InitializeDone).

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 PP_OK) the module is responsible for releasing memory reference.

Parameters
[in]packetA PP_ESPacket containing Elementary Stream metadata. Note: when using this method of appending packets size and buffer fields of PP_ESPacket struct must be set to 0 and nullptr. If they are not set to zero (nullptr), then PP_ERROR_BADARGUMENT will be returned.
[in]handleA handle to TrustZone memory containing packet data which will be appended.
[in]callbackA PCompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from pp_errors.h. Returns PP_ERROR_FAILED if InitializeDone() has not successfully completed. Returns PP_ERROR_NOQUOTA if internal buffer is full. Returns PP_ERROR_BADARGUMENT if either size or buffer are not set to 0/nullptr.
int32_t pp::ElementaryStream_Samsung::Flush ( const CompletionCallback callback)

Flushes all appended, but not decoded or rendered packets to this buffer. This method is usually called during seek operations.

Parameters
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from pp_errors.h. Returns PP_ERROR_FAILED if InitializeDone() has not successfully completed.
int32_t pp::ElementaryStream_Samsung::InitializeDone ( const CompletionCallback callback)

Call this method to confirm new/updated buffer config. This method will return PP_OK if set buffer config is valid or one of the error codes from pp_errors.h otherwise.

This method assumes that all plugin provided all necessary Elementary Stream initialization metadata (see PP_STREAMINITIALIZATIONMODE_FULL).

Parameters
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from pp_errors.h. Method returns PP_ERROR_BADARGUMENT when stream configuration is invalid.
int32_t pp::ElementaryStream_Samsung::InitializeDone ( PP_StreamInitializationMode  mode,
const CompletionCallback callback 
)

Call this method to confirm new/updated buffer config. This method will return PP_OK if set buffer config is valid or one of the error codes from pp_errors.h otherwise.

Parameters
[in]modeA parameter indicating how much information regarding elementary stream configuration was extracted by the plugin (demuxer).
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from pp_errors.h. Returns PP_ERROR_BADARGUMENT when stream configuration is invalid. Returns PP_ERROR_NOTSUPPORTED when given initialization mode is not supported by the browser.
int32_t pp::ElementaryStream_Samsung::SetDRMInitData ( uint32_t  type_size,
const void *  type,
uint32_t  init_data_size,
const void *  init_data,
const CompletionCallback callback 
)

Found DRM system initialization metadata. |type| describes type of the initialization data |init_data| associated with the stream.

Parameters
[in]type_sizeA size of DRM specific |type| buffer
[in]typeA buffer containing DRM system specific description of type of an |init_data|.
[in]init_data_sizeA size of DRM specific |init_data| buffer
[in]init_dataA buffer containing DRM system initialization data.
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from pp_errors.h.
int32_t pp::ElementaryStream_Samsung::SetDRMInitData ( const std::string &  type,
uint32_t  init_data_size,
const void *  init_data,
const CompletionCallback callback 
)

Found DRM system initialization metadata. |type| describes type of the initialization data |init_data| associated with the stream.

Parameters
[in]typeA string describing type of an |init_data|. Examples:
  • "cenc:pssh" - |init_data| will contain PSSH box as described by Common Encryption specifiacation
  • "mspr:pro" - |init_data| will contain Microsoft PlayReady Object Header (PRO).
[in]init_data_sizeA size of DRM specific |init_data| buffer
[in]init_dataA buffer containing DRM system initialization data.
[in]callbackA CompletionCallback to be called upon completion.
Returns
PP_OK on success, otherwise an error code from pp_errors.h.

The documentation for this class was generated from the following file: