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.
import "ToiMediaSession.idl";
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< 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::TToiSessionId |
The media session identifier type.
typedef long ToiMediaSession::TToiSessionType |
Data type used for identifying media session types. The type is used as a bitmask.
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 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.
type | The event type of the event to subscribe to. | |
listener | The JavaScript function that will receive events. |
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.
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. |
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. 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.
type | The event type of the event to remove the listener from. | |
listener | The JavaScript function that was previously added as an event listener. |
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.
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 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 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_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.