ToiMediaSession Interface Reference


Description

Each media player, recorder and consumer generates a media session which can be accessed by any application through the (C++) ToiMediaService::OpenSession() function. This allows other applications than the actual owner to get stream information, extract stream data, set decryption keys etc.

Sessions are created whenever ToiMediaPlayer::open(), ToiMediaRecorder::open(), (C++) ToiMediaConsumer::open() are called.

See also:
ToiMediaService
ToiMediaPlayer
ToiMediaRecorder
ToiMediaConsumer

import "ToiMediaSession.idl";

List of all members.

Public Member Functions

TToiSessionId getId ()
TToiSessionType getType () raises (TToiSessionViolationException)
string getUrl () raises (TToiSessionViolationException)
TToiState getState ()
ToiMediaSessionStreamInfo getStreamInfo () raises (TToiNoDataException, TToiSessionViolationException)
string getAssetId () raises (TToiOperationNotSupportedException, TToiSessionViolationException)
string getParameter (in string name) raises (TToiInvalidArgumentException, TToiSessionViolationException)
void setParameter (in string name, in string value) raises (TToiInvalidArgumentException, TToiSessionViolationException)
void releaseInstance ()
void addEventListener (in long type, in ToiEventListener listener) raises (TToiInvalidArgumentException)
void removeEventListener (in long type, in ToiEventListener listener) raises (TToiInvalidArgumentException)

Public Attributes

const TToiSessionType TYPE_PLAYER = 1
const TToiSessionType TYPE_RECORDER = 2
const TToiSessionType TYPE_CONSUMER = 4
const TToiSessionType TYPE_DISTRIBUTOR = 8
Events

const long ON_PARAMETER_CHANGED = 1900
TToiState

const TToiState STATE_CONNECTING = 0
const TToiState STATE_RUNNING = 1
const TToiState STATE_FAILED = 2
const TToiState STATE_CLOSED = 3
TToiCipher

const TToiCipher CIPHER_NONE = 0
const TToiCipher CIPHER_DVB_CSA = 1
const TToiCipher CIPHER_ARIB_MULTI2 = 2
const TToiCipher CIPHER_AES_128 = 3
const TToiCipher CIPHER_TRIPLE_DES = 4
TToiCipherBlockMode

const TToiCipherBlockMode CIPHER_BLOCK_MODE_NONE = 0
const TToiCipherBlockMode CIPHER_BLOCK_MODE_ECB = 1
const TToiCipherBlockMode CIPHER_BLOCK_MODE_CBC = 2
const TToiCipherBlockMode CIPHER_BLOCK_MODE_CFB = 3
const TToiCipherBlockMode CIPHER_BLOCK_MODE_OFB = 4
const TToiCipherBlockMode CIPHER_BLOCK_MODE_CTR = 5
TToiCipherResidueMode

const TToiCipherResidueMode CIPHER_RESIDUE_MODE_NONE = 0
const TToiCipherResidueMode CIPHER_RESIDUE_MODE_FRONT = 1
const TToiCipherResidueMode CIPHER_RESIDUE_MODE_BACK = 2
const TToiCipherResidueMode CIPHER_RESIDUE_MODE_CTS = 3
const TToiCipherResidueMode CIPHER_RESIDUE_MODE_OFB = 4

Public Types

typedef long TToiState
typedef sequence< octet > TToiDataRelayData
typedef long TToiStreamId
typedef sequence< TToiStreamIdTToiStreamIdSequence
typedef sequence< octet > TToiCipherData
typedef long TToiSessionId
typedef long TToiSessionType
typedef long TToiCipher
typedef long TToiCipherBlockMode
typedef long TToiCipherResidueMode

Member Typedef Documentation

List of ciphers.

List of cipher block modes.

typedef sequence< octet > ToiMediaSession::TToiCipherData

Data type used for cipher keys and initialization vectors. These are stored as a sequence of bytes.

Cipher residue mode.

typedef sequence< octet > ToiMediaSession::TToiDataRelayData

Data type used for data relay filter vectors. These are stored as a sequence of bytes.

The media session identifier type.

Data type used for identifying media session types. The type is used as a bitmask.

State identifier used to identify the media session state.

Data type used to identify a stream.

Data type used for TToiStreamId vectors. These are stored as a sequence of TToiStreamId values.


Member Function Documentation

void ToiEventTarget::addEventListener ( in long  type,
in ToiEventListener  listener 
) raises (TToiInvalidArgumentException) [inherited]

This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.

Parameters:
type The event type of the event to subscribe to.
listener The JavaScript function that will receive events.
Exceptions:
TInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the application calls addEventListener with the same combination of type and listener twice.
string ToiMediaSession::getAssetId (  )  raises (TToiOperationNotSupportedException, TToiSessionViolationException)

Returns the asset identifier used for recording.

Deprecated:
This method is not reliable since several assets may be used simultaneously in the same session.
Return values:
assetId The asset identifier.
Exceptions:
TToiOperationNotSupportedException If the stream is not being recorded an operation is not supported exception is raised.
TToiSessionViolationException If the session no longer exist an session violation exception is raised.
TToiSessionId ToiMediaSession::getId (  ) 

Get the session identifier.

Return values:
id The session identifier.
string ToiMediaSession::getParameter ( in string  name  )  raises (TToiInvalidArgumentException, TToiSessionViolationException)

Get the current value of a parameter.

Parameters:
name Name of the requested parameter.
Return values:
value The value of the parameter.
Exceptions:
TToiInvalidArgumentException If no parameter with this name can be found an invalid argument exception is raised.
TToiSessionViolationException If the session no longer exist an session violation exception is raised.
TToiState ToiMediaSession::getState (  ) 

Returns the current state of the media session.

Return values:
state The current session state.
Exceptions:
TToiSessionViolationException If the session no longer exist an session violation exception is raised.
ToiMediaSessionStreamInfo ToiMediaSession::getStreamInfo (  )  raises (TToiNoDataException, TToiSessionViolationException)

Returns information about the stream handled by the session.

Return values:
info Information about the stream.
Exceptions:
TToiNoDataException If no information is yet available an no data exception is raised.
TToiSessionViolationException If the session no longer exist an session violation exception is raised.
TToiSessionType ToiMediaSession::getType (  )  raises (TToiSessionViolationException)

Get the session type bitmask. Note that a session can combine the different type constants.

Return values:
type The type of the session, e.g. ToiMediaSession::TYPE_PLAYER. This field is a bitmask.
Exceptions:
TToiSessionViolationException If the session no longer exist an session violation exception is raised.
string ToiMediaSession::getUrl (  )  raises (TToiSessionViolationException)

Get the source URL of the session.

Return values:
url The source URL of the session.
Exceptions:
TToiSessionViolationException If the session no longer exist an session violation exception is raised.
void ToiMediaSession::releaseInstance (  ) 

This method releases the resources used by this object and removes all registered observers. Upon return this object will no longer be available and must not be called.

Note that this method does not close the associated session. This can only be done by calling ToiMediaPlayer::close() or ToiMediaRecorder::close().

void ToiEventTarget::removeEventListener ( in long  type,
in ToiEventListener  listener 
) raises (TToiInvalidArgumentException) [inherited]

This method removes an event listener for a specific event.

Parameters:
type The event type of the event to remove the listener from.
listener The JavaScript function that was previously added as an event listener.
Exceptions:
TInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the listener had not previously been added.
void ToiMediaSession::setParameter ( in string  name,
in string  value 
) raises (TToiInvalidArgumentException, TToiSessionViolationException)

Set the current value of a parameter.

Parameters:
name Name of the parameter.
Return values:
value The value to be set to parameter.
Exceptions:
TToiInvalidArgumentException If no parameter with this name can be found an invalid argument exception is raised.
TToiSessionViolationException If the session no longer exist an session violation exception is raised.

Member Data Documentation

Advanced Encryption Standard (FIPS 197), 128 bit key length.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_AES_128.

ARIB Multi-2, 64 bit key length.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_ARIB_MULTI2.

Cipher block chaining.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_BLOCK_MODE_CBC.

Cipher feedback mode.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_BLOCK_MODE_CFB.

Counter mode.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_BLOCK_MODE_CTR.

Electronic Codebook Mode

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_BLOCK_MODE_ECB.

Not applicable.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_BLOCK_MODE_NONE.

Output feedback mode.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_BLOCK_MODE_OFB.

DVB Common Scrambling Algorithm, 64 bit key length.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_DVB_CSA.

Disable decryption, key length should be zero.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_NONE.

Clear residue in the back.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_RESIDUE_MODE_BACK.

Cipher Text Stealing according to OpenCable CCCP 2.0.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_RESIDUE_MODE_CTS.

Clear residue in the front.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_RESIDUE_MODE_FRONT.

Not applicable.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_RESIDUE_MODE_NONE.

Output feedback mode according to ANSI/SCTE52.

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_RESIDUE_MODE_OFB.

Triple Data Encryption Standard

This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_TRIPLE_DES.

This is an Event identifier for ToiMediaSessionParameterChangedEvent.

This constant can also be accessed from toi.consts.ToiMediaSession.ON_PARAMETER_CHANGED.

In STATE_CLOSED the media session has been closed and will not be opened again.

This constant can also be accessed from toi.consts.ToiMediaSession.STATE_CLOSED.

In STATE_CONNECTING the media session is trying to connect to a media source. The session will not leave this state until it has recieved enough data to start playback or recording. It is possible for a session to later return to this state if the source becomes temporarily unavailable, for instance due to network congestion.

This constant can also be accessed from toi.consts.ToiMediaSession.STATE_CONNECTING.

In STATE_FAILED the media session has permanently failed.

This constant can also be accessed from toi.consts.ToiMediaSession.STATE_FAILED.

In STATE_RUNNING the media session is fully connected and has received enough data. Note that this state does not reveal any information about the playback position or pace.

This constant can also be accessed from toi.consts.ToiMediaSession.STATE_RUNNING.

Session is used for consuming a stream.

This constant can also be accessed from toi.consts.ToiMediaSession.TYPE_CONSUMER.

Session is used for distributing a stream to other network devices.

This constant can also be accessed from toi.consts.ToiMediaSession.TYPE_DISTRIBUTOR.

Session is used for playing a stream.

This constant can also be accessed from toi.consts.ToiMediaSession.TYPE_PLAYER.

Session is used for recording a stream.

This constant can also be accessed from toi.consts.ToiMediaSession.TYPE_RECORDER.