Tizen WASM Player
Tizen WASM Player: Tizen TV WebAssembly Media Player extension allowing for a low-level elementary media stream playback.
samsung::wasm::MediaKey Class Referencefinal

Class representing an instance of media keys used to decrypt a content. More...

#include <media_key.h>

Public Types

enum  AsyncResult { AsyncResult::kSuccess, AsyncResult::kInvalidConfigurationError, AsyncResult::kSessionNotUpdatedError, AsyncResult::kUnknownError }
 
using SetupFinishedCallback = std::function< void(AsyncResult, MediaKey)>
 

Public Member Functions

 MediaKey (const MediaKey &)=delete
 
 MediaKey (MediaKey &&other)
 
MediaKeyoperator= (const MediaKey &)=delete
 
MediaKeyoperator= (MediaKey &&)
 
 ~MediaKey ()
 
bool IsValid () const
 

Static Public Member Functions

static Result< void > SetupEncryption (const DRMConfig &config, SetupFinishedCallback on_finished)
 

Friends

class ElementaryMediaTrack
 

Detailed Description

Class representing an instance of media keys used to decrypt a content.

Definition at line 71 of file media_key.h.

Member Typedef Documentation

◆ SetupFinishedCallback

Definition at line 81 of file media_key.h.

Member Enumeration Documentation

◆ AsyncResult

Defines results of asynchronous operation.
An async operation (such as Open()) can report an error in two ways: with its return value - an error there means the job wasn't started - and with argument passed to callback, which signals incorrect execution of an asnyc job.
AsyncResult describes the latter kind of errors.

Enumerator
kSuccess 

Operation ended with success.

kInvalidConfigurationError 

Configuration was invalid.

kSessionNotUpdatedError 

Attempt to update the session failed.

kUnknownError 

Unknown error.

Definition at line 74 of file media_key.h.

Constructor & Destructor Documentation

◆ MediaKey() [1/2]

samsung::wasm::MediaKey::MediaKey ( const MediaKey )
delete

◆ MediaKey() [2/2]

samsung::wasm::MediaKey::MediaKey ( MediaKey &&  other)

◆ ~MediaKey()

samsung::wasm::MediaKey::~MediaKey ( )

Member Function Documentation

◆ IsValid()

bool samsung::wasm::MediaKey::IsValid ( ) const

Returns true if this instance is valid. This method should be called after constructor to ensure backend initialized the object properly. If object is invalid all method calls will fail.

Returns
true if this instance is valid, otherwise false.

◆ operator=() [1/2]

MediaKey& samsung::wasm::MediaKey::operator= ( const MediaKey )
delete

◆ operator=() [2/2]

MediaKey& samsung::wasm::MediaKey::operator= ( MediaKey &&  )

◆ SetupEncryption()

static Result<void> samsung::wasm::MediaKey::SetupEncryption ( const DRMConfig config,
SetupFinishedCallback  on_finished 
)
static

Asynchronously creates MediaKey instance and passes it as an argument to on_finished. If setting up the encryption fails, media keys won't be valid.

Parameters
[in]configAn object containing DRM's configuration.
[in]on_finishedA callback notifying end of setting up encryption. The callback receives AsyncResult informing of the result of the operation and a newly created MediaKeys object.
Returns
Result<void> with operation_result field set to OperationResult::kSuccess on success, otherwise a code describing the error.

Friends And Related Function Documentation

◆ ElementaryMediaTrack

friend class ElementaryMediaTrack
friend

Definition at line 121 of file media_key.h.


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