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

Classes

struct  DRMConfig
 Aggregates all data necessary for setting up decryption. More...
 
struct  ElementaryAudioTrackConfig
 
struct  ElementaryMediaPacket
 Type representing a single packet (video or audio). More...
 
class  ElementaryMediaStreamSource
 Main class of WASM Player. ElementaryMediaStreamSource acts as a data source for html::HTMLMediaElement. More...
 
class  ElementaryMediaStreamSourceListener
 Allows receiving ElementaryMediaStreamSource events. More...
 
class  ElementaryMediaTrack
 Tracks are used to deliver either audio or video frames to WASM Player. More...
 
struct  ElementaryMediaTrackConfig
 Common part of audio and video configs. More...
 
class  ElementaryMediaTrackListener
 Allows receiving ElementaryMediaTrack events. More...
 
struct  ElementaryVideoTrackConfig
 Contains video ElementaryMediaTrack config. More...
 
struct  EmssVersionInfo
 
struct  EncryptedElementaryMediaPacket
 Type representing a single encrypted packet (either video or audio). More...
 
struct  EncryptedSubsampleDescription
 
class  MediaKey
 Class representing an instance of media keys used to decrypt content. More...
 
struct  Result
 

Typedefs

using Seconds = std::chrono::duration< double >
 Default duration type used throughout the API. More...
 
using SessionId = int32_t
 

Enumerations

enum  SampleFormat {
  SampleFormat::kUnknown,
  SampleFormat::kU8,
  SampleFormat::kS16,
  SampleFormat::kS32,
  SampleFormat::kF32,
  SampleFormat::kPlanarS16,
  SampleFormat::kPlanarF32,
  SampleFormat::kPlanarS32,
  SampleFormat::kS24,
  SampleFormat::kAc3,
  SampleFormat::kEac3
}
 Lists audio sampling formats recognized by WASM Player. More...
 
enum  ChannelLayout {
  ChannelLayout::kNone,
  ChannelLayout::kUnsupported,
  ChannelLayout::kMono,
  ChannelLayout::kStereo,
  ChannelLayout::k2Point1,
  ChannelLayout::k2_1,
  ChannelLayout::k2_2,
  ChannelLayout::k3_1,
  ChannelLayout::k4_0,
  ChannelLayout::k4_1,
  ChannelLayout::k4_1QuadSide,
  ChannelLayout::k5_0,
  ChannelLayout::k5_0Back,
  ChannelLayout::k5_1,
  ChannelLayout::k5_1Back,
  ChannelLayout::k6_0,
  ChannelLayout::k6_0Front,
  ChannelLayout::k6_1,
  ChannelLayout::k6_1Back,
  ChannelLayout::k6_1Front,
  ChannelLayout::k7_0,
  ChannelLayout::k7_0Front,
  ChannelLayout::k7_1,
  ChannelLayout::k7_1Wide,
  ChannelLayout::k7_1WideBack,
  ChannelLayout::kDiscrete,
  ChannelLayout::kHexagonal,
  ChannelLayout::kOctagonal,
  ChannelLayout::kQuad,
  ChannelLayout::kStereoDownmix,
  ChannelLayout::kSurround
}
 Lists audio channel layouts recognized by WASM Player. More...
 
enum  DecodingMode {
  DecodingMode::kHardware,
  DecodingMode::kHardwareWithFallback,
  DecodingMode::kSoftware
}
 
enum  EncryptionMode {
  EncryptionMode::kUnknown,
  EncryptionMode::kCenc,
  EncryptionMode::kCbcs
}
 Lists encryption modes recognized by WASM Player. More...
 
enum  ContentDecryptionModule {
  ContentDecryptionModule::kUnknown,
  ContentDecryptionModule::kPlayready,
  ContentDecryptionModule::kWidevine
}
 Lists Content Decryption Modules recognized by WASM Player. More...
 
enum  Robustness {
  Robustness::kEmpty,
  Robustness::kSWSecureCrypto,
  Robustness::kSWSecureDecode,
  Robustness::kHWSecureCrypto,
  Robustness::kHWSecureDecode,
  Robustness::kHWSecureAll
}
 Lists robustness levels recognized by WASM Player. More...
 
enum  OperationResult {
  OperationResult::kSuccess = 0,
  OperationResult::kInvalidObject,
  OperationResult::kInvalidArgument,
  OperationResult::kInvalidState,
  OperationResult::kListenerAlreadySet,
  OperationResult::kNoSuchListener,
  OperationResult::kNotAllowedOnCurrentThread,
  OperationResult::kNotSupported,
  OperationResult::kAlreadyDestroyed,
  OperationResult::kAlreadyInProgress,
  OperationResult::kCloseInProgress,
  OperationResult::kNotAllowedInCurrentMode,
  OperationResult::kNoTracksAttached,
  OperationResult::kOpenInProgress,
  OperationResult::kPlaybackStateChangeInProgress,
  OperationResult::kSourceMustBeClosed,
  OperationResult::kSourceNotAttached,
  OperationResult::kTimestampsExceedDuration,
  OperationResult::kTrackLimitReached,
  OperationResult::kUnrelatedObject,
  OperationResult::kAborted,
  OperationResult::kFailed,
  OperationResult::kConfigInvalidChannelLayout,
  OperationResult::kConfigInvalidCodec,
  OperationResult::kConfigInvalidFramerate,
  OperationResult::kConfigInvalidResolution,
  OperationResult::kConfigInvalidMimeType,
  OperationResult::kConfigInvalidSampleFormat,
  OperationResult::kConfigInvalid,
  OperationResult::kAppendBufferFull,
  OperationResult::kAppendExpectsKeyframe,
  OperationResult::kAppendIgnored,
  OperationResult::kAppendNoDuration,
  OperationResult::kAppendInvalidDts,
  OperationResult::kAppendInvalidPts,
  OperationResult::kAppendInvalidTrackState,
  OperationResult::kAppendInvalidVideoParameters,
  OperationResult::kAppendNoPacketData,
  OperationResult::kAppendResourceAllocationError,
  OperationResult::kAppendDecryptionError,
  OperationResult::kAppendDecryptorNeedsMoreData,
  OperationResult::kAppendNoDecryptionKey,
  OperationResult::kAppendInvalidInitializationVector,
  OperationResult::kAppendInvalidKeyId,
  OperationResult::kAppendInvalidMediaKeySession,
  OperationResult::kAppendInvalidSubsampleDescription,
  OperationResult::kAppendUnknownDecryptionMode,
  OperationResult::kMediaKeyInvalidConfiguration,
  OperationResult::kMediaKeySessionNotUpdated,
  OperationResult::kVideoDecoderInvalidTrackType,
  OperationResult::kVideoDecoderInvalidVideoTexture,
  OperationResult::kVideoDecoderWebGlContextNotRegistered,
  OperationResult::kVideoDecoderNotInVideoTextureMode,
  OperationResult::kNotAllowed = kNotAllowedOnCurrentThread
}
 Enumerates possible outcomes of WASM function calls. More...
 

Variables

const SessionId kIgnoreSessionId
 

Typedef Documentation

◆ Seconds

using samsung::wasm::Seconds = typedef std::chrono::duration<double>

Default duration type used throughout the API.

Definition at line 53 of file common.h.

◆ SessionId

using samsung::wasm::SessionId = typedef int32_t

A session starts when track opens and lasts until it closes. All packets sent between those two events belong to a single session. When appending either a packet or an end of track to ElementaryMediaTrack, a multithreaded App must mark them with the current session_id value.

See also
ElementaryMediaPacket::session_id
ElementaryMediaTrack::GetSessionId()
ElementaryMediaTrackListener::OnSessionIdChanged()

Definition at line 25 of file session_id.h.

Enumeration Type Documentation

◆ ChannelLayout

Lists audio channel layouts recognized by WASM Player.

Enumerator
kNone 

Channel Layout is unspecified.

kUnsupported 

Channel Layout is unsupported.

kMono 

Front C.

kStereo 

Front L + R.

k2Point1 

Stereo L + R, LFE.

k2_1 

Front L + R, Back C.

k2_2 

Front L + R, Side L + R.

k3_1 

Stereo L + R, Front C, LFE.

k4_0 

Front L + R + C, Back C.

k4_1 

Stereo L + R, Front C, Rear C, LFE.

k4_1QuadSide 

Front L + R, Side L + R, LFE.

k5_0 

Front L + R + C, Side L + R.

k5_0Back 

Front L + R + C, Back L + R.

k5_1 

Front L + R + C, LFE, Side L + R.

k5_1Back 

Front L, Front R, Front C, LFE, Back L + R.

k6_0 

Stereo L + R, Front C, Side L + R, Back C.

k6_0Front 

Stereo L + R, Side L + R, Front LofC + RofC.

k6_1 

Stereo L + R, Front C, LFE, Side L + R, Rear, Center.

k6_1Back 

Stereo L + R, Front C, LFE, Back L + R, Rear Center.

k6_1Front 

Stereo L + R, Side L, Side R, Front LofC + RofC, LFE.

k7_0 

Front L + R + C, Side L + R, Back L + R.

k7_0Front 

Front L + R + C, Side L + R, Front LofC, Front RofC.

k7_1 

Front L + R + C, LFE, Side L + R, Back L + R.

k7_1Wide 

Front L + R + C, LFE, Side L + R, Front LofC + RofC.

k7_1WideBack 

Front L + R + C, LFE, Back L + R, Front LofC + RofC.

kDiscrete 

Channels are not explicitly mapped to speakers.

kHexagonal 

Stereo L + R, Front C, Back L + R + C.

kOctagonal 

Front L + R + C, Side L + R, Back L + R + C.

kQuad 

Front L + R, Back L + R.

kStereoDownmix 

Stereo L + R.

kSurround 

Front L + R + C.

Definition at line 34 of file elementary_audio_track_config.h.

◆ ContentDecryptionModule

Lists Content Decryption Modules recognized by WASM Player.

Enumerator
kUnknown 

Unknown CDM.

kPlayready 

Playready CDM.

kWidevine 

Widevine classic CDM.

Definition at line 27 of file media_key.h.

◆ DecodingMode

Enumerator
kHardware 
kHardwareWithFallback 

Mode supported only on devices which have EmssVersionInfo::has_decoding_mode set to true. Otherwise, setting this mode will have no effect.

kSoftware 

Mode supported only on devices which have EmssVersionInfo::has_decoding_mode set to true. Otherwise, setting this mode will have no effect.

Definition at line 16 of file elementary_media_track_config.h.

◆ EncryptionMode

Lists encryption modes recognized by WASM Player.

Enumerator
kUnknown 

Unknown encryption mode.

kCenc 

Full sample encryption AESCTR mode.

kCbcs 

Pattern encryption AESCBC mode.

Definition at line 20 of file media_key.h.

◆ OperationResult

Enumerates possible outcomes of WASM function calls.

Enumerator
kSuccess 

An operation ended successfully.

kInvalidObject 

The requested operation was called on an object which IsValid() property is false.

kInvalidArgument 

The requested operation was called with an invalid argument.

kInvalidState 

Cannot perform requested operation in a current ready state.

kListenerAlreadySet 

A listener of the same type as the one passed as an argument is already assigned to this object.

kNoSuchListener 

A listener passed as an argument not assigned to this object.

kNotAllowedOnCurrentThread 

Performing requested operation is not allowed on the current thread.

kNotSupported 

This functionality is not supported on this device.

Remarks
EmssVersionInfo contains information about ElementaryMediaStreamSource features available on this device.
kAlreadyDestroyed 

The requested operation cannot be performed because this object was already destroyed.

kAlreadyInProgress 

The requested operation is already in progress and cannot be requested again before it is finished.

kCloseInProgress 

Cannot complete a state change, because a transition to the ReadyState::kClosed state is already in progress. This can happen when the state change request is made when Close() request is still being processed.

kNotAllowedInCurrentMode 

The requested operation is not allowed in the current ElementaryMediaStreamSource::Mode.

kNoTracksAttached 

Cannot perform requested operation when no tracks are attached to the source.

kOpenInProgress 

Cannot complete a state change, because a transition to the ReadyState::kOpen state is already in progress. This can happen when the state change request is made when Open() request is still being processed.

kPlaybackStateChangeInProgress 

Cannot complete an Elementary Media Stream Source state change, because a playback state change is in progress. This can happen when html::HTMLMediaElement is processing a request that affects playback (e.g. seek is performed, playback is either started or paused, etc.).

kSourceMustBeClosed 

The requested operation can be executed only when ElementaryMediaStreamSource is in the ReadyState::kClosed state.

kSourceNotAttached 

Cannot perform the requested operation when ElementaryMediaStreamSource is not attached to html::HTMLMediaElement.

kTimestampsExceedDuration 

Cannot set a duration value lower than the highest presentation timestamp of any ElementaryMediaPacket buffered so far.

Remarks
ElementaryMediaStreamSource::Flush() can be used to clear buffered packets.
kTrackLimitReached 

A maximum number of tracks of the given type is already assigned to ElementaryMediaStreamSource.

kUnrelatedObject 

The object on which the operation was called is not related to an object passed as an argument (e.g. another instance was used to create the passed object).

kAborted 

The operation was aborted.

kFailed 

The operation failed due to an unspecified reason.

kConfigInvalidChannelLayout 

A provided channel layout is invalid.

kConfigInvalidCodec 

A provided codec is invalid.

kConfigInvalidFramerate 

A provided framerate is invalid.

kConfigInvalidResolution 

A provided resolution is invalid.

kConfigInvalidMimeType 

A provided mime type is invalid.

kConfigInvalidSampleFormat 

A provided sample format is invalid.

kConfigInvalid 

A provided config is invalid for an undetermined reason.

kAppendBufferFull 

The append failed due to Platform's packet buffer overflow.

Remarks
  • App is buffering ahead too many packets.
  • Since the packet was not accepted by ElementaryMediaTrack, it should be sent again.
kAppendExpectsKeyframe 

The append failed because ElementaryMediaTrack expects a keyframe.

Remarks
Sending a keyframe is always required when ElementaryMediaTrack opens.
kAppendIgnored 

The append was ignored.

Remarks
An append can be ignored when session_id changes but packets stamped with an old SessionId value are still being sent or processed. This is more of an information for App and usually shouldn't be treated as an error.
kAppendNoDuration 

The append failed because packet has no duration.

kAppendInvalidDts 

The append failed because packet has missing or negative dts.

kAppendInvalidPts 

The append failed because packet has missing or negative pts.

kAppendInvalidTrackState 

The append failed because ElementaryMediaTrack is not open.

See also
ElementaryMediaTrack::IsOpen()
kAppendInvalidVideoParameters 

The append failed because either framerate or resolution provided is invalid or missing.

kAppendNoPacketData 

The append failed because packet has no data.

kAppendResourceAllocationError 

The append failed because shared memory creation failed or shared memory handle could not be obtained.

kAppendDecryptionError 

The append failed because encrypted packet decryption failed.

kAppendDecryptorNeedsMoreData 

The append failed because decryptor needs more data to decrypt frame.

kAppendNoDecryptionKey 

The append failed because decryption key is not available.

kAppendInvalidInitializationVector 

The append failed because encrypted packet has missing or bad initialization vector.

kAppendInvalidKeyId 

The append failed because encrypted packet has missing or bad key id.

kAppendInvalidMediaKeySession 

The append failed because media key session is invalid.

See also
MediaKey
MediaKey::SetupEncryption()
MediaKey::IsValid()
kAppendInvalidSubsampleDescription 

The append failed because encrypted packet has missing or bad EncryptedSubsampleDescription.

kAppendUnknownDecryptionMode 

The append failed because encrypted packet has missing or invalid EncryptionMode.

kMediaKeyInvalidConfiguration 

Provided DRMConfig is invalid.

kMediaKeySessionNotUpdated 

Attempt to update the session failed.

kVideoDecoderInvalidTrackType 

The requested operation can be executed only on a certain track type. Video decoder related operations are available only for video tracks.

kVideoDecoderInvalidVideoTexture 

The requested operation failed because invalid video texture was provided.

kVideoDecoderWebGlContextNotRegistered 

The requested operation failed because WebGL rendering context is not registered.

See also
ElementaryMediaTrack::RegisterCurrentGraphicsContext()
kVideoDecoderNotInVideoTextureMode 

The requested operation failed because player is not set to ElementaryMediaStreamSource::Mode::kVideoTexture

See also
ElementaryMediaStreamSource::Mode
kNotAllowed 

Performing requested operation is not allowed on the current thread.

Deprecated:
Replaced by kNotAllowedOnCurrentThread for clarity, but can be used interchangeably.

Definition at line 13 of file operation_result.h.

◆ Robustness

Lists robustness levels recognized by WASM Player.

Enumerator
kEmpty 
kSWSecureCrypto 
kSWSecureDecode 
kHWSecureCrypto 
kHWSecureDecode 
kHWSecureAll 

Definition at line 34 of file media_key.h.

◆ SampleFormat

Lists audio sampling formats recognized by WASM Player.

Enumerator
kUnknown 

Unknown sample format.

kU8 

Unsigned 8-bit w/ bias of 128.

kS16 

Signed 16-bit.

kS32 

Signed 32-bit.

kF32 

Float 32-bit.

kPlanarS16 

Signed 16-bit planar.

kPlanarF32 

Float 32-bit planar.

kPlanarS32 

Signed 32-bit planar.

kS24 

Signed 24-bit.

kAc3 

Compressed AC3 bitstream.

kEac3 

Compressed E-AC3 bitstream.

Definition at line 19 of file elementary_audio_track_config.h.

Variable Documentation

◆ kIgnoreSessionId

const SessionId samsung::wasm::kIgnoreSessionId

This should be passed as ElementaryMediaPacket::session_id when session mechanism is not used (i.e. App appends packets on the main thread only).