ToiMediaSession Interface Reference

Description

Each media player, recorder, distributor 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(), ToiMediaService::createSessionInstance() are called.

See also:
ToiMediaService
ToiMediaPlayer
ToiMediaRecorder
ToiMediaConsumer

import "ToiMediaSession.idl";

Inheritance diagram for ToiMediaSession:
ToiEventTarget

List of all members.

Public Member Functions

TToiDistributionId enableDistribution () raises (TToiSessionViolationException)
void setDistributionProperties (in TToiDistributionId distributionId, in TToiDistributionPropertySequence properties) raises (TToiInvalidArgumentException, TToiSessionViolationException)
void disableDistribution (in TToiDistributionId distributionId) raises (TToiSessionViolationException, TToiInvalidArgumentException)
ToiMediaSessionDistributionInfo getDistributionInfo (in TToiDistributionId distributionId) raises (TToiSessionViolationException, TToiInvalidArgumentException)
TToiDistributionIdSequence getDistributionIds () raises (TToiSessionViolationException)
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 ()

Public Attributes

const TToiSessionType TYPE_PLAYER = 1
const TToiSessionType TYPE_RECORDER = 2
const TToiSessionType TYPE_CONSUMER = 4
const TToiSessionType TYPE_DISTRIBUTOR = 8
const TToiSessionType TYPE_EXTENDED = 16
const string PROPERTY_DISTRIBUTION_PROTOCOL_TYPE = "distribution.protocol.type"
const string PROPERTY_DISTRIBUTION_DRM_TYPE = "distribution.drm.type"
const string PROPERTY_DISTRIBUTION_CLIENT_MAC_ADDRESS = "distribution.client.macaddress"
const string PROPERTY_DISTRIBUTION_TRANSCODING_AUDIO_LANGUAGE = "distribution.transcoding.audiolanguage"
const string PROPERTY_DISTRIBUTION_TRANSCODING_DVS_ENABLED = "distribution.transcoding.dvsenabled"
const string PROPERTY_DISTRIBUTION_STARTPOSITION = "distribution.media.startposition"
const string PROPERTY_DISTRIBUTION_TIMESHIFT_ASSET = "distribution.media.timeshift.asset"
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 long TToiDistributionId
typedef sequence
< TToiDistributionId
TToiDistributionIdSequence
typedef sequence
< ToiMediaSessionDistributionProperty
TToiDistributionPropertySequence
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.

Technical Preview:
This typedef is a TECHNICAL PREVIEW, it may change. Distribution identifier. This identifier is unique across sessions.
Technical Preview:
This typedef is a TECHNICAL PREVIEW. Sequence of distribution identifiers.
Technical Preview:
This typedef is a TECHNICAL PREVIEW, it may change. Sequence of properties.

The media session identifier type.

Data type used for identifying media session types. This type should be used as a bitmask as defined below.

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 ToiMediaSession::disableDistribution ( in TToiDistributionId  distributionId) raises (TToiSessionViolationException, TToiInvalidArgumentException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. This method disables distribution for this session. If multiple distributions are allowed only the given distribution will be disabled. This call will result in termination of content streaming to the IP client but the session will not be closed.
Exceptions:
TToiSessionViolationExceptionIf the session no longer exist an session violation exception is raised.
TToiInvalidArgumentExceptionIf distribution id is invalid. The ToiMediaSession::enableDistribution() method provides a valid distribution id. If any property in the sequence is not valid.
TToiDistributionId ToiMediaSession::enableDistribution ( ) raises (TToiSessionViolationException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. This method allows distribution to be activated for this session. No distributor is created as a result of this call, but the platform is allowed to activate one it receives an incoming client request that matches this session. Depending on the type of session, multiple distributions may not be allowed.
Exceptions:
TToiSessionViolationExceptionIf the session no longer exist an session violation exception is raised.
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. Use ToiMediaService::enumerateRecorders() instead.
Return values:
assetIdThe asset identifier.
Exceptions:
TToiOperationNotSupportedExceptionIf the stream is not being recorded an operation is not supported exception is raised.
TToiSessionViolationExceptionIf the session no longer exist an session violation exception is raised.
TToiDistributionIdSequence ToiMediaSession::getDistributionIds ( ) raises (TToiSessionViolationException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. This method returns the enabled distributions for this session. An empty list means no distribution is enabled.
Return values:
idsIdentifiers for all the dstributions associated with this session
Exceptions:
TToiSessionViolationExceptionIf the session no longer exist an session violation exception is raised.
ToiMediaSessionDistributionInfo ToiMediaSession::getDistributionInfo ( in TToiDistributionId  distributionId) raises (TToiSessionViolationException, TToiInvalidArgumentException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. This method returns information about given distribution.
Parameters:
distributionIdThe Distribution identifier whose information is to be returned.
Return values:
infoThe distribution information containing the destination URl, and distribution properties
Exceptions:
TToiSessionViolationExceptionIf the session no longer exist an session violation exception is raised.
TToiInvalidArgumentExceptionIf distribution id is invalid. The ToiMediaSession::enableDistribution() method provides a valid distribution id. If any property in the sequence is not valid.
TToiSessionId ToiMediaSession::getId ( )

Get the session identifier.

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

Get the current value of a parameter.

Parameters:
nameName of the requested parameter.
Return values:
valueThe value of the parameter.
Exceptions:
TToiInvalidArgumentExceptionIf no parameter with this name can be found an invalid argument exception is raised.
TToiSessionViolationExceptionIf the session no longer exist an session violation exception is raised.
TToiState ToiMediaSession::getState ( )

Returns the current state of the media session.

Return values:
stateThe current session state.
Exceptions:
TToiSessionViolationExceptionIf 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:
infoInformation about the stream.
Exceptions:
TToiNoDataExceptionIf no information is yet available an no data exception is raised.
TToiSessionViolationExceptionIf 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:
typeThe type of the session, e.g. ToiMediaSession::TYPE_PLAYER. This field is a bitmask.
Exceptions:
TToiSessionViolationExceptionIf 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:
urlThe source URL of the session.
Exceptions:
TToiSessionViolationExceptionIf 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 for the scenario where the application used ToiMediaSession:OpenSession to open the session. This can only be done by calling ToiMediaPlayer::close() or ToiMediaRecorder::close().

Note that this method may close the associated session and release any associated system resources for the scenario where the application used ToiMediaServiceCreateSessionInstance method. The session will be closed if the "reference count" of the relevant session goes down to zero (i.e. no other player, recorder or session class is still associated with this session.

void ToiMediaSession::setDistributionProperties ( in TToiDistributionId  distributionId,
in TToiDistributionPropertySequence  properties 
) raises (TToiInvalidArgumentException, TToiSessionViolationException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. This method sets distribution properties to be used if there is a distributor activated for this session associated with the distributionId.
Parameters:
distributionIdThe Distribution identifier that these properties will be applied to.
propertiesThe sequence of distribution properties that will be applied to the distributors.
Exceptions:
TToiInvalidArgumentExceptionIf distribution id is invalid. The ToiMediaSession::enableDistribution() method provides a valid distribution id. If any property in the sequence is not valid.
TToiSessionViolationExceptionIf the session no longer exist an session violation exception is raised.
void ToiMediaSession::setParameter ( in string  name,
in string  value 
) raises (TToiInvalidArgumentException, TToiSessionViolationException)

Set the current value of a parameter.

Parameters:
nameName of the parameter.
Return values:
valueThe value to be set to parameter.
Exceptions:
TToiInvalidArgumentExceptionIf no parameter with this name can be found an invalid argument exception is raised.
TToiSessionViolationExceptionIf 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.

const string ToiMediaSession::PROPERTY_DISTRIBUTION_CLIENT_MAC_ADDRESS = "distribution.client.macaddress"
Technical Preview:
This constant is a TECHNICAL PREVIEW, it may change. Distribution property Client MAC address

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

const string ToiMediaSession::PROPERTY_DISTRIBUTION_DRM_TYPE = "distribution.drm.type"
Technical Preview:
This constant is a TECHNICAL PREVIEW, it may change. This identifies the distribution content protection protocol to be used. This property must be included to stream content.

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

const string ToiMediaSession::PROPERTY_DISTRIBUTION_PROTOCOL_TYPE = "distribution.protocol.type"
Technical Preview:
This constant is a TECHNICAL PREVIEW, it may change. This identifies the distribution transport protocol to be used. This property must be included to stream content

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

const string ToiMediaSession::PROPERTY_DISTRIBUTION_STARTPOSITION = "distribution.media.startposition"
Technical Preview:
This constant is a TECHNICAL PREVIEW, it may change. This identifies the start position of the dvr asset for streaming session. This property should only be included when the SourceURL is a dvr asset.

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

const string ToiMediaSession::PROPERTY_DISTRIBUTION_TIMESHIFT_ASSET = "distribution.media.timeshift.asset"
Technical Preview:
This constant is a TECHNICAL PREVIEW, it may change. This identifies the timeshift asset associated with this session. This is used to support switching the distribution from Live to Time shifted content.

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

const string ToiMediaSession::PROPERTY_DISTRIBUTION_TRANSCODING_AUDIO_LANGUAGE = "distribution.transcoding.audiolanguage"
Technical Preview:
This constant is a TECHNICAL PREVIEW, it may change. This identifies the audio language to be used. This property is only included when transcoding is required. If this property is not set then the first language is selected

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

const string ToiMediaSession::PROPERTY_DISTRIBUTION_TRANSCODING_DVS_ENABLED = "distribution.transcoding.dvsenabled"
Technical Preview:
This constant is a TECHNICAL PREVIEW, it may change. This enables DVS for the streaming session. This property is only included when transcoding is required.

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

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, distribution 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.

This type is used by a session that is pre-created before being used for playing, recording, consuming or distributing a stream.

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

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.