ToiMediaService is the main interface of the Media Service. It is used by applications to create media consumers, players,sessions and recorders. Each player, recorder, session and consumer generates a media session which can be accessed by any application through the (C++) OpenSession() function. This allows other applications than the actual owner to get stream information, extract stream data, set decryption keys etc.
import "ToiMediaService.idl";
Public Member Functions | |
| ToiMediaPlayer | createPlayerInstance () raises (TToiInvalidArgumentException, TToiNotEnoughResourcesException, TToiPermissionDeniedException) |
| ToiMediaPlayer | createPipPlayerInstance () raises (TToiInvalidArgumentException, TToiOperationNotSupportedException, TToiPermissionDeniedException) |
| ToiMediaRecorder | createRecorderInstance () raises (TToiInvalidArgumentException, TToiNotEnoughResourcesException, TToiOperationNotSupportedException) |
| TToiDistributorInfoSequence | enumerateDistributors () |
| TToiPlayerInfoSequence | enumeratePlayers () |
| TToiRecorderInfoSequence | enumerateRecorders () |
| ToiMediaSession | createSessionInstance (in string url) raises (TToiInvalidArgumentException, TToiNotEnoughResourcesException, TToiPermissionDeniedException, TToiOperationNotSupportedException) |
| ToiMediaSession | openSession (in ToiMediaSession::TToiSessionId sessionId) raises (TToiInvalidArgumentException) |
| void | subscribeType (in ToiEventListener eventListener, in ToiMediaSession::TToiSessionType type) raises (TToiInvalidArgumentException) |
| void | unsubscribeType (in ToiEventListener eventListener, in ToiMediaSession::TToiSessionType type) raises (TToiInvalidArgumentException) |
Public Attributes | |
| const string | REASON_UNKNOWN = "Unknown" |
| const string | REASON_COMMAND_OPEN = "CommandOpen" |
| const string | REASON_COMMAND_CLOSE = "CommandClose" |
| const string | REASON_COMMAND_PAUSE = "CommandPause" |
| const string | REASON_COMMAND_PLAY = "CommandPlay" |
| const string | REASON_COMMAND_FASTFORWARD = "CommandFastForward" |
| const string | REASON_COMMAND_REWIND = "CommandRewind" |
| const string | REASON_COMMAND_PLAYFROMPOSITION = "CommandPlayFromPosition" |
| const string | REASON_COMMAND_RECORD = "CommandRecord" |
| const string | REASON_COMMAND_CONSUME = "CommandConsume" |
| const string | REASON_POSITION_END = "PositionEnd" |
| const string | REASON_POSITION_START = "PositionStart" |
| const string | REASON_TIMESHIFT_BUFFER_OPEN = "TimeshiftBufferOpen" |
| const string | REASON_TIMESHIFT_BUFFER_FULL = "TimeshiftBufferFull" |
| const string | REASON_TIMESHIFT_BUFFER_DISCARDED = "TimeshiftBufferDiscarded" |
| const string | REASON_TIMESHIFT_BUFFER_REDIRECTED = "TimeshiftBufferRedirected" |
| const string | REASON_ERROR_COMMAND_NOT_SUPPORTED = "ErrorCommandNotSupported" |
| const string | REASON_ERROR_STREAM_CLIENT = "ErrorStreamClient" |
| const string | REASON_ERROR_CONNECTION_FAILED = "ErrorConnectionFailed" |
| const string | REASON_ERROR_INVALID_PRECONDITION = "ErrorInvalidPrecondition" |
| const string | REASON_ERROR_PERMISSION_DENIED = "ErrorPermissionDenied" |
| const string | REASON_ERROR_INVALID_DISKASSET = "ErrorInvalidDiskasset" |
| const string | REASON_ERROR_UNSUPPORTED_DISKASSET_VERSION = "ErrorUnsupportedDiskAssetVersion" |
| const string | REASON_ERROR_DISK_FULL = "ErrorStorageFull" |
| const string | REASON_ERROR_LOWLEVEL_IO_FAILURE = "ErrorLowlevelIOFailure" |
| const string | REASON_ERROR_POSITION_INVALID = "ErrorPositionInvalid" |
| const string | REASON_ERROR_DISK_OVERHEATED = "ErrorStorageOverheated" |
| const string | REASON_ERROR_HOST_UNREACHABLE = "ErrorHostUnreachable" |
| const string | REASON_ERROR_UNEXISTING_RESOURCE = "ErrorUnexistingResource" |
| const string | REASON_ERROR_NO_EXTERNAL_INPUT_SIGNAL = "ErrorNoExternalInputSignal" |
Events | |
| const long | ON_SESSION_STATE_CHANGED = 1600 |
| const long | ON_DISTRIBUTOR_STATUS_CHANGED = 1601 |
| const long | ON_PLAYER_STATUS_CHANGED = 1602 |
| const long | ON_RECORDER_STATUS_CHANGED = 1603 |
| const long | ON_SESSION_STREAM_INFO_CHANGED = 1604 |
TToiDistributorState | |
| const TToiDistributorState | DISTRIBUTOR_STATE_IDLE = 0 |
| const TToiDistributorState | DISTRIBUTOR_STATE_CONNECTING = 1 |
| const TToiDistributorState | DISTRIBUTOR_STATE_PAUSED = 2 |
| const TToiDistributorState | DISTRIBUTOR_STATE_PLAYING = 3 |
| const TToiDistributorState | DISTRIBUTOR_STATE_FASTFORWARDING = 4 |
| const TToiDistributorState | DISTRIBUTOR_STATE_REWINDING = 5 |
| const TToiDistributorState | DISTRIBUTOR_STATE_FAILED = 6 |
TToiPlayerType | |
| const TToiPlayerType | PLAYER_MAIN = 0 |
| const TToiPlayerType | PLAYER_PIP = 1 |
Public Types | |
| typedef long | TToiDistributorState |
| typedef long | TToiPlayerType |
| typedef sequence < ToiMediaServiceSessionInfo > | TToiSessionSequence |
| typedef sequence < ToiMediaServiceDistributorInfo > | TToiDistributorInfoSequence |
| typedef sequence < ToiMediaServicePlayerInfo > | TToiPlayerInfoSequence |
| typedef sequence < ToiMediaServiceRecorderInfo > | TToiRecorderInfoSequence |
| typedef sequence< ToiMediaServiceDistributorInfo > ToiMediaService::TToiDistributorInfoSequence |
| typedef long ToiMediaService::TToiDistributorState |
| typedef sequence< ToiMediaServicePlayerInfo > ToiMediaService::TToiPlayerInfoSequence |
| typedef long ToiMediaService::TToiPlayerType |
| typedef sequence< ToiMediaServiceRecorderInfo > ToiMediaService::TToiRecorderInfoSequence |
| typedef sequence< ToiMediaServiceSessionInfo > ToiMediaService::TToiSessionSequence |
Sequence of sessions.
| ToiMediaPlayer ToiMediaService::createPipPlayerInstance | ( | ) | raises (TToiInvalidArgumentException, TToiOperationNotSupportedException, TToiPermissionDeniedException) |
This function creates a new Picture in Picture media player and associates it with the calling application.
When the application no longer needs the media player, it must release it by calling ToiMediaPlayer::releaseInstance(). This will return the underlying resources to the system.
| IToiMediaPlayer | The address to the ToiMediaPlayer instance. |
| TToiInvalidArgumentException | Raised if the specified application identifier is invalid. |
| TToiOperationNotSupportedException | Raised if a new player instance cannot be created. |
| TToiPermissionDeniedException | Raised if the calling application is not allowed to create instances of the media player. This restriction applies to popup applications. |
| ToiMediaPlayer ToiMediaService::createPlayerInstance | ( | ) | raises (TToiInvalidArgumentException, TToiNotEnoughResourcesException, TToiPermissionDeniedException) |
This function creates a new media player and associates it with the calling application.
When the application no longer needs the media player, it must release it by calling ToiMediaPlayer::releaseInstance(). This will return the underlying resources to the system.
| IToiMediaPlayer | The address to the ToiMediaPlayer instance. |
| TToiInvalidArgumentException | Raised if the specified application identifier is invalid. |
| TToiNotEnoughResourcesException | Raised if a new player instance cannot be created due to lack of system resources. |
| TToiPermissionDeniedException | Raised if the calling application is not allowed to create instances of the media player. This restriction applies to popup applications. |
| ToiMediaRecorder ToiMediaService::createRecorderInstance | ( | ) | raises (TToiInvalidArgumentException, TToiNotEnoughResourcesException, TToiOperationNotSupportedException) |
This function creates a new media recorder and associates it with the calling application.
When the application no longer needs the media recorder, it must release it by calling ToiMediaRecorder::releaseInstance(). This will return the underlying resources to the system.
| IToiMediaRecorder | The address to the ToiMediaRecorder instance |
| TToiInvalidArgumentException | Raised if the specified application identifier is invalid. |
| TToiNotEnoughResourcesException | Raised if a new recorder instance cannot be created due to lack of system resources. |
| TToiOperationNotSupportedException | Raised if recording is not supported on this system. |
| ToiMediaSession ToiMediaService::createSessionInstance | ( | in string | url | ) | raises (TToiInvalidArgumentException, TToiNotEnoughResourcesException, TToiPermissionDeniedException, TToiOperationNotSupportedException) |
| url | The source URL of the ToiMediaSession instance. |
| IToiMediaSession | The address to the ToiMediaSession instance. |
| TToiInvalidArgumentException | Raised if the specified application identifier is invalid. |
| TToiNotEnoughResourcesException | Raised if a media session instance cannot be created due to lack of system resources. |
| TToiPermissionDeniedException | Raised if the calling application is not allowed to create instances of the media session. |
| TToiOperationNotSupportedException | Raised if Invalid application id |
| TToiDistributorInfoSequence ToiMediaService::enumerateDistributors | ( | ) |
| distributors | Sequence of distributors. |
| TToiPlayerInfoSequence ToiMediaService::enumeratePlayers | ( | ) |
| players | Sequence of players. |
| TToiRecorderInfoSequence ToiMediaService::enumerateRecorders | ( | ) |
| recorders | Sequence of recorders. |
| ToiMediaSession ToiMediaService::openSession | ( | in ToiMediaSession::TToiSessionId | sessionId | ) | raises (TToiInvalidArgumentException) |
Open an existing session. Each call to this method returns the address of a unique object that must be released when no longer needed, by calling ToiMediaSession::releaseInstance().
Note that the actual session does not necessarily have to be owned by the application calling this function. It may still be used by the owner to access the functionality of the ToiMediaSession interface.
| sessionId | The identifier of the session. |
| IToiMediaSession | object implements the ToiMediaSession interface. |
| TToiInvalidArgumentException | Raised if the session identifier does not identify an existing session. Note that all applications must be designed to handle this exception since sessions can be closed at any time, rendering the session identifier invalid. |
| void ToiMediaService::subscribeType | ( | in ToiEventListener | eventListener, |
| in ToiMediaSession::TToiSessionType | type | ||
| ) | raises (TToiInvalidArgumentException) |
| eventListener | ToiEventListener |
| type | The type of state change notification. |
| TToiInvalidArgumentException | If the parameter name is invalid or not recognized an invalid argument exception is raised. |
| void ToiMediaService::unsubscribeType | ( | in ToiEventListener | eventListener, |
| in ToiMediaSession::TToiSessionType | type | ||
| ) | raises (TToiInvalidArgumentException) |
| eventListener | ToiEventListener |
| type | The type of state change notification. |
| TToiInvalidArgumentException | If the parameter name is invalid or not recognized an invalid argument exception is raised. |
In DISTRIBUTOR_STATE_CONNECTING the media distributor has an active session and is in the process of establishing a connection to a media stream source. If a session exists that is attached to the same source, then the Media Distributor will use this session. The media disributor will leave this state automatically and enter DISTRIBUTOR_STATE_PAUSED when it has successfully established the connection to the media distributor's stream source. If the media distributor decides it cannot connect, it will enter DISTRIBUTOR_STATE_FAILED.
This constant can also be accessed from toi.consts.ToiMediaService.DISTRIBUTOR_STATE_CONNECTING.
In DISTRIBUTOR_STATE_FAILED the media distributor may or may not have a connection to a media destination but the process of getting the stream to that destination failed in some fatal way.
This constant can also be accessed from toi.consts.ToiMediaService.DISTRIBUTOR_STATE_FAILED.
In DISTRIBUTOR_STATE_FASTFORWARDING the media distributor has a connection to a media destination and distributes the stream to that destination in forward direction at a pace above normal playback. For streams on which this operation cannot be performed, this state is not available. On a command from the media destination, the media distributor will leave this state for one of the other media distributor states. DISTRIBUTOR_STATE_PLAYING, DISTRIBUTOR_STATE_PAUSED, or DISTRIBUTOR_STATE_REWINDING. If an error occurs with the stream severe enough for the media distributor to determine it cannot continue distribution, the media distributor will go to DISTRIBUTOR_STATE_FAILED.
This constant can also be accessed from toi.consts.ToiMediaService.DISTRIBUTOR_STATE_FASTFORWARDING.
In DISTRIBUTOR_STATE_IDLE the media distributor is not actively streaming to a client. This is an intermediate state that will automatically change to DISTRIBUTOR_STATE_CONNECTING once the required system resources are available.
This constant can also be accessed from toi.consts.ToiMediaService.DISTRIBUTOR_STATE_IDLE.
In DISTRIBUTOR_STATE_PAUSED the media distributor has a connection to a media stream source but media distribution to the destination is halted. On a command from the media destination, the media distributor will leave this state for one of the other distribution states DISTRIBUTOR_STATE_PLAYING, DISTRIBUTOR_STATE_FASTFORWARDING, or DISTRIBUTOR_STATE_REWINDING. If an error occurs with the stream severe enough for the media distributor to determine it cannot continue media distribution, the media distributor will go to DISTRIBUTOR_STATE_FAILED.
This constant can also be accessed from toi.consts.ToiMediaService.DISTRIBUTOR_STATE_PAUSED.
In DISTRIBUTOR_STATE_PLAYING the media distributor has a connection to a media destination and distributes the stream to the destination in normal pace. On a command from the media destination, the media distributor will leave this state for one of the other distribution states DISTRIBUTOR_STATE_PAUSED,DISTRIBUTOR_STATE_FASTFORWARDING, or DISTRIBUTOR_STATE_REWINDING. If an error occurs with the stream severe enough for the media distributor to determine it cannot continue distribution, the media distributor will go to DISTRIBUTOR_STATE_FAILED.
This constant can also be accessed from toi.consts.ToiMediaService.DISTRIBUTOR_STATE_PLAYING.
In DISTRIBUTOR_STATE_REWINDING the media distributor has a connection to a media destination and distributes the stream to that destination in reverse direction at a pace above normal playback. For streams on which this operation cannot be performed, this state is not available. On a command from the media destination, the media distributor will leave this state for one of the other media distributor states. DISTRIBUTOR_STATE_PLAYING, DISTRIBUTOR_STATE_PAUSED, or DISTRIBUTOR_STATE_FASTFORWARDING. If an error occurs with the stream severe enough for the media distributor to determine it cannot continue distribution, the media distributor will go to DISTRIBUTOR_STATE_FAILED.
This constant can also be accessed from toi.consts.ToiMediaService.DISTRIBUTOR_STATE_REWINDING.
| const long ToiMediaService::ON_DISTRIBUTOR_STATUS_CHANGED = 1601 |
This is an Event identifier for ToiMediaDistributorStatusChangedEvent.
This constant can also be accessed from toi.consts.ToiMediaService.ON_DISTRIBUTOR_STATUS_CHANGED.
| const long ToiMediaService::ON_PLAYER_STATUS_CHANGED = 1602 |
This is an Event identifier for ToiMediaPlayerStatusChangedEvent.
This constant can also be accessed from toi.consts.ToiMediaService.ON_PLAYER_STATUS_CHANGED.
| const long ToiMediaService::ON_RECORDER_STATUS_CHANGED = 1603 |
This is an Event identifier for ToiMediaRecorderStatusChangedEvent.
This constant can also be accessed from toi.consts.ToiMediaService.ON_RECORDER_STATUS_CHANGED.
| const long ToiMediaService::ON_SESSION_STATE_CHANGED = 1600 |
This is an Event identifier for ToiMediaSessionStateChangedEvent.
This constant can also be accessed from toi.consts.ToiMediaService.ON_SESSION_STATE_CHANGED.
| const long ToiMediaService::ON_SESSION_STREAM_INFO_CHANGED = 1604 |
This is an Event identifier for ToiMediaSessionStreamInfoChangedEvent.
This constant can also be accessed from toi.consts.ToiMediaService.ON_SESSION_STREAM_INFO_CHANGED.
| const TToiPlayerType ToiMediaService::PLAYER_MAIN = 0 |
Main Player type.
This constant can also be accessed from toi.consts.ToiMediaService.PLAYER_MAIN.
| const TToiPlayerType ToiMediaService::PLAYER_PIP = 1 |
Picture-In-Picture Player type.
This constant can also be accessed from toi.consts.ToiMediaService.PLAYER_PIP.
| const string ToiMediaService::REASON_COMMAND_CLOSE = "CommandClose" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_CLOSE.
| const string ToiMediaService::REASON_COMMAND_CONSUME = "CommandConsume" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_CONSUME.
| const string ToiMediaService::REASON_COMMAND_FASTFORWARD = "CommandFastForward" |
State change caused by a fast forward command
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_FASTFORWARD.
| const string ToiMediaService::REASON_COMMAND_OPEN = "CommandOpen" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_OPEN.
| const string ToiMediaService::REASON_COMMAND_PAUSE = "CommandPause" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_PAUSE.
| const string ToiMediaService::REASON_COMMAND_PLAY = "CommandPlay" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_PLAY.
| const string ToiMediaService::REASON_COMMAND_PLAYFROMPOSITION = "CommandPlayFromPosition" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_PLAYFROMPOSITION.
| const string ToiMediaService::REASON_COMMAND_RECORD = "CommandRecord" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_RECORD.
| const string ToiMediaService::REASON_COMMAND_REWIND = "CommandRewind" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_REWIND.
| const string ToiMediaService::REASON_ERROR_COMMAND_NOT_SUPPORTED = "ErrorCommandNotSupported" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_COMMAND_NOT_SUPPORTED.
| const string ToiMediaService::REASON_ERROR_CONNECTION_FAILED = "ErrorConnectionFailed" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_CONNECTION_FAILED.
| const string ToiMediaService::REASON_ERROR_DISK_FULL = "ErrorStorageFull" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_DISK_FULL.
| const string ToiMediaService::REASON_ERROR_DISK_OVERHEATED = "ErrorStorageOverheated" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_DISK_OVERHEATED.
| const string ToiMediaService::REASON_ERROR_HOST_UNREACHABLE = "ErrorHostUnreachable" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_HOST_UNREACHABLE.
| const string ToiMediaService::REASON_ERROR_INVALID_DISKASSET = "ErrorInvalidDiskasset" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_INVALID_DISKASSET.
| const string ToiMediaService::REASON_ERROR_INVALID_PRECONDITION = "ErrorInvalidPrecondition" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_INVALID_PRECONDITION.
| const string ToiMediaService::REASON_ERROR_LOWLEVEL_IO_FAILURE = "ErrorLowlevelIOFailure" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_LOWLEVEL_IO_FAILURE.
| const string ToiMediaService::REASON_ERROR_NO_EXTERNAL_INPUT_SIGNAL = "ErrorNoExternalInputSignal" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_NO_EXTERNAL_INPUT_SIGNAL.
| const string ToiMediaService::REASON_ERROR_PERMISSION_DENIED = "ErrorPermissionDenied" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_PERMISSION_DENIED.
| const string ToiMediaService::REASON_ERROR_POSITION_INVALID = "ErrorPositionInvalid" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_POSITION_INVALID.
| const string ToiMediaService::REASON_ERROR_STREAM_CLIENT = "ErrorStreamClient" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_STREAM_CLIENT.
| const string ToiMediaService::REASON_ERROR_UNEXISTING_RESOURCE = "ErrorUnexistingResource" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_UNEXISTING_RESOURCE.
| const string ToiMediaService::REASON_ERROR_UNSUPPORTED_DISKASSET_VERSION = "ErrorUnsupportedDiskAssetVersion" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_UNSUPPORTED_DISKASSET_VERSION.
| const string ToiMediaService::REASON_POSITION_END = "PositionEnd" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_POSITION_END.
| const string ToiMediaService::REASON_POSITION_START = "PositionStart" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_POSITION_START.
| const string ToiMediaService::REASON_TIMESHIFT_BUFFER_DISCARDED = "TimeshiftBufferDiscarded" |
State change caused by a timeshift buffer discard command
This constant can also be accessed from toi.consts.ToiMediaService.REASON_TIMESHIFT_BUFFER_DISCARDED.
| const string ToiMediaService::REASON_TIMESHIFT_BUFFER_FULL = "TimeshiftBufferFull" |
State change caused by buffer full
This constant can also be accessed from toi.consts.ToiMediaService.REASON_TIMESHIFT_BUFFER_FULL.
| const string ToiMediaService::REASON_TIMESHIFT_BUFFER_OPEN = "TimeshiftBufferOpen" |
State change caused by player opened timeshift buffer
This constant can also be accessed from toi.consts.ToiMediaService.REASON_TIMESHIFT_BUFFER_OPEN.
| const string ToiMediaService::REASON_TIMESHIFT_BUFFER_REDIRECTED = "TimeshiftBufferRedirected" |
State change caused by a timeshift buffer redirection command
This constant can also be accessed from toi.consts.ToiMediaService.REASON_TIMESHIFT_BUFFER_REDIRECTED.
| const string ToiMediaService::REASON_UNKNOWN = "Unknown" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_UNKNOWN.