Pepper_31_C++_interfaces
Public Member Functions | List of all members
pp::ContentDecryptor_Samsung Class Referenceabstract

#include <content_decryptor_samsung.h>

Collaboration diagram for pp::ContentDecryptor_Samsung:
Collaboration graph

Public Member Functions

 ContentDecryptor_Samsung (Instance *instance)
 
virtual ~ContentDecryptor_Samsung ()
 Destructor. More...
 
virtual void GenerateKeyRequest (const std::string &key_system, const std::string &type, VarArrayBuffer init_data)=0
 
virtual void AddKey (const std::string &session_id, VarArrayBuffer key, VarArrayBuffer init_data)=0
 
virtual void CancelKeyRequest (const std::string &session_id)=0
 
virtual void Decrypt (Buffer_Dev encrypted_buffer, const PP_EncryptedBlockInfo &encrypted_block_info)=0
 
void NeedKey (const std::string &key_system, const std::string &session_id, VarArrayBuffer init_data)
 
void KeyAdded (const std::string &key_system, const std::string &session_id)
 
void KeyMessage (const std::string &key_system, const std::string &session_id, VarArrayBuffer message, const std::string &default_url)
 
void KeyError (const std::string &key_system, const std::string &session_id, int32_t media_error, int32_t system_code)
 
void DeliverBlock (Buffer_Dev decrypted_block, const PP_DecryptedBlockInfo &decrypted_block_info)
 
PP_Bool RegisterDecryptor (const std::string &key_system, const std::string &type)
 

Detailed Description

Content Decryptor API allowing NaCl application to receive encrypted chunks formining elementary stream and deliver decrypted (but encoded) chunks of elementary stream to be decoded by the browser.

Definition at line 29 of file content_decryptor_samsung.h.

Constructor & Destructor Documentation

pp::ContentDecryptor_Samsung::ContentDecryptor_Samsung ( Instance instance)
explicit

A constructor that creates an ContentDecryptor_Samsung bound to instance After creation decryptor must be registered using method RegisterDecryptor in order to be used.

virtual pp::ContentDecryptor_Samsung::~ContentDecryptor_Samsung ( )
virtual

Destructor.

Member Function Documentation

virtual void pp::ContentDecryptor_Samsung::AddKey ( const std::string &  session_id,
VarArrayBuffer  key,
VarArrayBuffer  init_data 
)
pure virtual

Provides a key or license to the decryptor for decrypting media data.

When the CDM needs more information to complete addition of the key it will call KeyMessage() on the PPB_ContentDecryptor_Samsung interface, which the browser passes to the application. When the key is ready to use, the CDM must call call KeyAdded() on the PPB_ContentDecryptor_Samsung interface, and the browser must notify the web application.

Parameters
[in]session_idThe session ID.
[in]keyDecryption key, license, or other message for the given session ID.
[in]init_dataContainer specific initialization data.
virtual void pp::ContentDecryptor_Samsung::CancelKeyRequest ( const std::string &  session_id)
pure virtual

Cancels a pending key request for the specified session ID.

Parameters
[in]session_idThe session ID.
virtual void pp::ContentDecryptor_Samsung::Decrypt ( Buffer_Dev  encrypted_buffer,
const PP_EncryptedBlockInfo &  encrypted_block_info 
)
pure virtual

Decrypts the block and returns the unencrypted block via DeliverBlock() on the PPB_ContentDecryptor_Samsung interface. The returned block contains encoded data.

Parameters
[in]resourceAn encrypted data block.
[in]encrypted_block_infoA PP_EncryptedBlockInfo that contains all auxiliary information needed for decryption of the encrypted_block.
void pp::ContentDecryptor_Samsung::DeliverBlock ( Buffer_Dev  decrypted_block,
const PP_DecryptedBlockInfo &  decrypted_block_info 
)

Called after the Decrypt() method completes to deliver decrypted_block to the browser for decoding and rendering.

The plugin must not hold a reference to the encrypted buffer resource provided to Decrypt() when it calls this method. The browser will reuse the buffer in a subsequent Decrypt() call.

Parameters
[in]decrypted_blockDecrypted data block.
[in]decrypted_block_infoA PP_DecryptedBlockInfo that contains the result code and tracking info associated with the decrypted_block.
virtual void pp::ContentDecryptor_Samsung::GenerateKeyRequest ( const std::string &  key_system,
const std::string &  type,
VarArrayBuffer  init_data 
)
pure virtual

Generates a key request. key_system specifies the key or licensing system to use. type contains the MIME type of init_data. init_data is a data buffer containing data for use in generating the request.

Note: GenerateKeyRequest() must create the session ID used in other methods on this interface. The session ID must be provided to the browser by the CDM via KeyMessage() on the PPB_ContentDecryptor_Samsung interface.

Parameters
[in]key_systemThe name of the key system.
[in]typeMIME type for init_data.
[in]init_dataContainer specific initialization data.
void pp::ContentDecryptor_Samsung::KeyAdded ( const std::string &  key_system,
const std::string &  session_id 
)

A key has been added as the result of a call to the AddKey() method on the PPP_ContentDecryptor_Samsung interface.

Note: The above describes the most simple case. Depending on the key system, a series of KeyMessage() calls from the CDM will be sent to the browser, and then on to the web application. The web application must then provide more data to the CDM by directing the browser to pass the data to the CDM via calls to AddKey() on the PPP_ContentDecryptor_Samsung interface. The CDM must call KeyAdded() when the sequence is completed, and, in response, the browser must notify the web application.

Parameters
[in]key_systemThe name of the key system.
[in]session_idThe session ID.
void pp::ContentDecryptor_Samsung::KeyError ( const std::string &  key_system,
const std::string &  session_id,
int32_t  media_error,
int32_t  system_code 
)

An error occurred in a PPP_ContentDecryptor_Samsung method, or within the plugin implementing the interface.

Parameters
[in]key_systemThe name of the key system.
[in]session_idThe session ID.
[in]media_errorA MediaKeyError.
[in]system_errorA system error code.
void pp::ContentDecryptor_Samsung::KeyMessage ( const std::string &  key_system,
const std::string &  session_id,
VarArrayBuffer  message,
const std::string &  default_url 
)

A message or request has been generated for key_system in the CDM, and must be sent to the web application.

For example, when the browser invokes GenerateKeyRequest() on the PPP_ContentDecryptor_Samsung interface, the plugin must send a key message containing the key request.

Note that KeyMessage() can be used for purposes other than responses to GenerateKeyRequest() calls. See also the text in the comment for KeyAdded(), which describes a sequence of AddKey() and KeyMessage() calls required to prepare for decryption.

Parameters
[in]key_systemTthe name of the key system.
[in]session_idThe session ID.
[in]messageBuffer containing the message.
[in]default_urlDefault URL for the message.
void pp::ContentDecryptor_Samsung::NeedKey ( const std::string &  key_system,
const std::string &  session_id,
VarArrayBuffer  init_data 
)

The decryptor requires a key that has not been provided.

Sent when the decryptor encounters encrypted content, but it does not have the key required to decrypt the data. The plugin will call this method in response to a call to the Decrypt() method on the PPP_ContentDecryptor_Samsung interface.

The browser must notify the application that a key is needed, and, in response, the web application must direct the browser to call AddKey() on the PPP_ContentDecryptor_Samsung interface.

Parameters
[in]key_systemThe name of the key system.
[in]session_idThe session ID.
[in]init_dataContainer specific initialization data.

PP_Bool pp::ContentDecryptor_Samsung::RegisterDecryptor ( const std::string &  key_system,
const std::string &  type 
)

The decryptor must register itself in the Browser, so that it can be used by the Browser as Content Decryptor Module.

Parameters
[in]key_systemName of this content decryptor uder which the Browser will recognize it.
[in]typeType of media that are supported by this content decryptor (* - means all MIME types)
Returns
A PP_Bool containing containing PP_TRUE if the registration succeed, otherwise PP_FALSE.

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