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.
import "ToiMediaSession.idl";
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< TToiStreamId > | TToiStreamIdSequence |
| typedef sequence< octet > | TToiCipherData |
| typedef long | TToiSessionId |
| typedef long | TToiSessionType |
| typedef long | TToiCipher |
| typedef long | TToiCipherBlockMode |
| typedef long | TToiCipherResidueMode |
| typedef long ToiMediaSession::TToiCipher |
List of ciphers.
| typedef long ToiMediaSession::TToiCipherBlockMode |
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.
| typedef long ToiMediaSession::TToiCipherResidueMode |
Cipher residue mode.
| typedef sequence< octet > ToiMediaSession::TToiDataRelayData |
Data type used for data relay filter vectors. These are stored as a sequence of bytes.
| typedef long ToiMediaSession::TToiDistributionId |
| typedef sequence< TToiDistributionId > ToiMediaSession::TToiDistributionIdSequence |
| typedef sequence< ToiMediaSessionDistributionProperty > ToiMediaSession::TToiDistributionPropertySequence |
| typedef long ToiMediaSession::TToiSessionId |
The media session identifier type.
| typedef long ToiMediaSession::TToiSessionType |
Data type used for identifying media session types. This type should be used as a bitmask as defined below.
| typedef long ToiMediaSession::TToiState |
State identifier used to identify the media session state.
| typedef long ToiMediaSession::TToiStreamId |
Data type used to identify a stream.
| typedef sequence< TToiStreamId > ToiMediaSession::TToiStreamIdSequence |
Data type used for TToiStreamId vectors. These are stored as a sequence of TToiStreamId values.
| void ToiMediaSession::disableDistribution | ( | in TToiDistributionId | distributionId | ) | raises (TToiSessionViolationException, TToiInvalidArgumentException) |
| TToiSessionViolationException | If the session no longer exist an session violation exception is raised. |
| TToiInvalidArgumentException | If 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) |
| TToiSessionViolationException | If the session no longer exist an session violation exception is raised. |
| string ToiMediaSession::getAssetId | ( | ) | raises (TToiOperationNotSupportedException, TToiSessionViolationException) |
Returns the asset identifier used for recording.
| assetId | The asset identifier. |
| 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. |
| TToiDistributionIdSequence ToiMediaSession::getDistributionIds | ( | ) | raises (TToiSessionViolationException) |
| ids | Identifiers for all the dstributions associated with this session |
| TToiSessionViolationException | If the session no longer exist an session violation exception is raised. |
| ToiMediaSessionDistributionInfo ToiMediaSession::getDistributionInfo | ( | in TToiDistributionId | distributionId | ) | raises (TToiSessionViolationException, TToiInvalidArgumentException) |
| distributionId | The Distribution identifier whose information is to be returned. |
| info | The distribution information containing the destination URl, and distribution properties |
| TToiSessionViolationException | If the session no longer exist an session violation exception is raised. |
| TToiInvalidArgumentException | If 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.
| id | The session identifier. |
| string ToiMediaSession::getParameter | ( | in string | name | ) | raises (TToiInvalidArgumentException, TToiSessionViolationException) |
Get the current value of a parameter.
| name | Name of the requested parameter. |
| value | The value of the parameter. |
| 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.
| state | The current session state. |
| 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.
| info | Information about the stream. |
| 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.
| type | The type of the session, e.g. ToiMediaSession::TYPE_PLAYER. This field is a bitmask. |
| 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.
| url | The source URL of the session. |
| 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 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) |
| distributionId | The Distribution identifier that these properties will be applied to. |
| properties | The sequence of distribution properties that will be applied to the distributors. |
| TToiInvalidArgumentException | If distribution id is invalid. The ToiMediaSession::enableDistribution() method provides a valid distribution id. If any property in the sequence is not valid. |
| TToiSessionViolationException | If 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.
| name | Name of the parameter. |
| value | The value to be set to parameter. |
| 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. |
| const TToiCipher ToiMediaSession::CIPHER_AES_128 = 3 |
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.
| const TToiCipher ToiMediaSession::CIPHER_DVB_CSA = 1 |
DVB Common Scrambling Algorithm, 64 bit key length.
This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_DVB_CSA.
| const TToiCipher ToiMediaSession::CIPHER_NONE = 0 |
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.
| const TToiCipher ToiMediaSession::CIPHER_TRIPLE_DES = 4 |
Triple Data Encryption Standard
This constant can also be accessed from toi.consts.ToiMediaSession.CIPHER_TRIPLE_DES.
| const long ToiMediaSession::ON_PARAMETER_CHANGED = 1900 |
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" |
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" |
This constant can also be accessed from toi.consts.ToiMediaSession.PROPERTY_DISTRIBUTION_DRM_TYPE.
| const string ToiMediaSession::PROPERTY_DISTRIBUTION_PROTOCOL_TYPE = "distribution.protocol.type" |
This constant can also be accessed from toi.consts.ToiMediaSession.PROPERTY_DISTRIBUTION_PROTOCOL_TYPE.
| const string ToiMediaSession::PROPERTY_DISTRIBUTION_STARTPOSITION = "distribution.media.startposition" |
This constant can also be accessed from toi.consts.ToiMediaSession.PROPERTY_DISTRIBUTION_STARTPOSITION.
| const string ToiMediaSession::PROPERTY_DISTRIBUTION_TIMESHIFT_ASSET = "distribution.media.timeshift.asset" |
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" |
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" |
This constant can also be accessed from toi.consts.ToiMediaSession.PROPERTY_DISTRIBUTION_TRANSCODING_DVS_ENABLED.
| const TToiState ToiMediaSession::STATE_CLOSED = 3 |
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.
| const TToiState ToiMediaSession::STATE_CONNECTING = 0 |
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.
| const TToiState ToiMediaSession::STATE_FAILED = 2 |
In STATE_FAILED the media session has permanently failed.
This constant can also be accessed from toi.consts.ToiMediaSession.STATE_FAILED.
| const TToiState ToiMediaSession::STATE_RUNNING = 1 |
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.
| const TToiSessionType ToiMediaSession::TYPE_EXTENDED = 16 |
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.
| const TToiSessionType ToiMediaSession::TYPE_PLAYER = 1 |
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.