ToiMediaService Interface Reference

Description

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.

See also:
ToiMediaPlayer
ToiMediaRecorder
ToiMediaConsumer
ToiMediaSession
Service:
This is a service and can be accessed through toi.mediaService

import "ToiMediaService.idl";

Inheritance diagram for ToiMediaService:
ToiEventTarget

List of all members.

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

Member Typedef Documentation

Technical Preview:
This typedef is a TECHNICAL PREVIEW, it may change. Sequence of media distributors
Technical Preview:
-This enum is a TECHNICAL PREVIEW, it may change This enumeration defines the media distributor's distribution states.
Technical Preview:
This typedef is a TECHNICAL PREVIEW, it may change. Sequence of media players.
Technical Preview:
This structure is a TECHNICAL PREVIEW, it may change. /** This enumeration defines the different Player types.
Technical Preview:
This typedef is a TECHNICAL PREVIEW, it may change. Sequence of media recorders

Sequence of sessions.


Member Function Documentation

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.

Return values:
IToiMediaPlayerThe address to the ToiMediaPlayer instance.
Exceptions:
TToiInvalidArgumentExceptionRaised if the specified application identifier is invalid.
TToiOperationNotSupportedExceptionRaised if a new player instance cannot be created.
TToiPermissionDeniedExceptionRaised if the calling application is not allowed to create instances of the media player. This restriction applies to popup applications.
See also:
ToiMediaPlayer
ToiMediaPlayer::releaseInstance()

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.

Return values:
IToiMediaPlayerThe address to the ToiMediaPlayer instance.
Exceptions:
TToiInvalidArgumentExceptionRaised if the specified application identifier is invalid.
TToiNotEnoughResourcesExceptionRaised if a new player instance cannot be created due to lack of system resources.
TToiPermissionDeniedExceptionRaised if the calling application is not allowed to create instances of the media player. This restriction applies to popup applications.
See also:
ToiMediaPlayer
ToiMediaPlayer::releaseInstance()

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.

Return values:
IToiMediaRecorderThe address to the ToiMediaRecorder instance
Exceptions:
TToiInvalidArgumentExceptionRaised if the specified application identifier is invalid.
TToiNotEnoughResourcesExceptionRaised if a new recorder instance cannot be created due to lack of system resources.
TToiOperationNotSupportedExceptionRaised if recording is not supported on this system.
See also:
ToiMediaRecorder
ToiMediaRecorder::releaseInstance()
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. This function creates or opens a new session class that can be used for content distribution to an IP client. When the application no longer needs the media session class, it must release it by calling ToiMediaSession::releaseInstance(). This will return the underlying resources to the system if the streamer session is closed.
Parameters:
urlThe source URL of the ToiMediaSession instance.
Return values:
IToiMediaSessionThe address to the ToiMediaSession instance.
Exceptions:
TToiInvalidArgumentExceptionRaised if the specified application identifier is invalid.
TToiNotEnoughResourcesExceptionRaised if a media session instance cannot be created due to lack of system resources.
TToiPermissionDeniedExceptionRaised if the calling application is not allowed to create instances of the media session.
TToiOperationNotSupportedExceptionRaised if Invalid application id
See also:
ToiMediaSession
ToiMediaSession::releaseInstance()
TToiDistributorInfoSequence ToiMediaService::enumerateDistributors ( )
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. This method returns a list of all active distributors
Return values:
distributorsSequence of distributors.
TToiPlayerInfoSequence ToiMediaService::enumeratePlayers ( )
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. This method returns a list of all active players
Return values:
playersSequence of players.
TToiRecorderInfoSequence ToiMediaService::enumerateRecorders ( )
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. This method returns a list of all active recorders
Return values:
recordersSequence 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.

Parameters:
sessionIdThe identifier of the session.
Return values:
IToiMediaSessionobject implements the ToiMediaSession interface.
Exceptions:
TToiInvalidArgumentExceptionRaised 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.
See also:
ToiMediaSession
void ToiMediaService::subscribeType ( in ToiEventListener  eventListener,
in ToiMediaSession::TToiSessionType  type 
) raises (TToiInvalidArgumentException)
Technical Preview:
. This method is a TECHNICAL PREVIEW, it may change. This method lets the application subscribe to the type of state information it is interested in receiving. Different types include distributor, player and recorder.
Parameters:
eventListenerToiEventListener
typeThe type of state change notification.
Exceptions:
TToiInvalidArgumentExceptionIf the parameter name is invalid or not recognized an invalid argument exception is raised.
See also:
ToiMediaService::unsubscribeType()
void ToiMediaService::unsubscribeType ( in ToiEventListener  eventListener,
in ToiMediaSession::TToiSessionType  type 
) raises (TToiInvalidArgumentException)
Technical Preview:
. This method is a TECHNICAL PREVIEW, it may change. This method removes previously subscription to state information for players, recorders or distributors.
Parameters:
eventListenerToiEventListener
typeThe type of state change notification.
Exceptions:
TToiInvalidArgumentExceptionIf the parameter name is invalid or not recognized an invalid argument exception is raised.
See also:
ToiMediaService::subscribeType()

Member Data Documentation

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.

This is an Event identifier for ToiMediaDistributorStatusChangedEvent.

This constant can also be accessed from toi.consts.ToiMediaService.ON_DISTRIBUTOR_STATUS_CHANGED.

This is an Event identifier for ToiMediaPlayerStatusChangedEvent.

This constant can also be accessed from toi.consts.ToiMediaService.ON_PLAYER_STATUS_CHANGED.

This is an Event identifier for ToiMediaRecorderStatusChangedEvent.

This constant can also be accessed from toi.consts.ToiMediaService.ON_RECORDER_STATUS_CHANGED.

This is an Event identifier for ToiMediaSessionStateChangedEvent.

This constant can also be accessed from toi.consts.ToiMediaService.ON_SESSION_STATE_CHANGED.

This is an Event identifier for ToiMediaSessionStreamInfoChangedEvent.

This constant can also be accessed from toi.consts.ToiMediaService.ON_SESSION_STREAM_INFO_CHANGED.

Main Player type.

This constant can also be accessed from toi.consts.ToiMediaService.PLAYER_MAIN.

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.