Motorola Mobility Confidential Restricted.
ToiMediaRecorder Interface Reference

Description

The ToiMediaRecorder interface is the access point for a media recorder. Access to this interface is acquired through the ToiMediaService::createRecorderInstance() function. It is possible to create multiple private media recorder instances. Each application gets its own private instance of this interface for each of its media recorder instances.

See also:
ToiMediaRecorderBase
ToiMediaService

import "ToiMediaRecorder.idl";

Inheritance diagram for ToiMediaRecorder:
ToiMediaRecorderBase ToiEventTarget

List of all members.

Public Member Functions

void open (in string url, in string assetId) raises (TToiSessionViolationException, TToiInvalidArgumentException, TToiBusyException, TToiUnavailableException, TToiInvalidPreconditionException)
void close () raises (TToiSessionViolationException)
void record () raises (TToiSessionViolationException, TToiOperationNotSupportedException)
void recordAt (in unsigned long offset) raises (TToiSessionViolationException, TToiOperationNotSupportedException)
void setParameter (in string name, in string value) raises (TToiInvalidArgumentException, TToiPermissionDeniedException)
void unsetParameter (in string name) raises (TToiInvalidArgumentException, TToiPermissionDeniedException)

Member Function Documentation

void ToiMediaRecorder::close ( ) raises (TToiSessionViolationException)

This function ends the current session by stopping any recording and disconnecting from the media source. For example, if the source is a video server it ends the server session and disconnects, or if the source is a multicast channel it leaves that multicast group. If this function returns successfully, the recorder state has changed to STATE_IDLE. If an exception is raised, the recorder state is unaffected.

Note:
The only way to leave the STATE_FAILED state is a call to ToiMediaRecorder::close().
Exceptions:
TToiSessionViolationExceptionIf the recorder is in STATE_IDLE a session violation exception is raised.
See also:
ToiMediaRecorder::open()
ToiMediaRecorder::recordAt()
ToiMediaRecorder::record()
TToiMediaRecorderState
void ToiMediaRecorder::open ( in string  url,
in string  assetId 
) raises (TToiSessionViolationException, TToiInvalidArgumentException, TToiBusyException, TToiUnavailableException, TToiInvalidPreconditionException)

This function starts a new recording session by trying to establish a connection to a media source. If this function returns successfully, the recorder state has changed to STATE_CONNECTING. If an exception is raised, the recorder state is unaffected.

Depending on the success of the connection attempt to the media source, the recorder will make a second state transition to either STATE_PAUSED or STATE_FAILED, on success and failure, respectively. In any respect, the application will be notified about this event by a call to its ToiMediaRecorderStateChangedEvent function.

The application ends the session by calling ToiMediaRecorder::close(), which makes the recorder change state to STATE_IDLE.

Parameters:
urlThe URL identifying the media source. The URL string may contain additional parameter information in accordance to the extended URL format.
assetIdIdentifies the asset to record to.
Exceptions:
TToiSessionViolationExceptionIf the recorder is not in STATE_IDLE at the time of the call to ToiMediaRecorder::open(), a session violation exception is raised. OR When query parameter "SessionMode=AttachOnly" is specified in the URL, if no matching session is found with the specified URL in running state (ToiMediaSession::TToiState::STATE_RUNNING), a session violation exception is raised.
TToiInvalidArgumentExceptionIf the URL given as argument does not follow the extended URL format, an invalid argument exception is raised.
TToiBusyExceptionIf the asset is locked and used by another recorder.
TToiUnavailableExceptionRaised if the recorder is temporarily unavailable due to platform resource management.
TToiInvalidPreconditionExceptionRaised if appending is not supported and the asset used for recording already exists and is not empty (has already been recorded to).
See also:
ToiMediaRecorder::close()
TToiMediaRecorderState
void ToiMediaRecorder::record ( ) raises (TToiSessionViolationException, TToiOperationNotSupportedException)

This function starts a recording of the stream. If this function returns successfully, the recorder state has changed to STATE_RECORDING. If an exception is raised, the recorder state is unaffected.

Exceptions:
TToiSessionViolationExceptionIf the recorder is in STATE_IDLE a session violation exception is raised.
TToiOperationNotSupportedExceptionRaised if the recorder is in a state in which this operation is not supported. This is the case when in STATE_FAILED, for example. What is supported in which state may in other cases vary depending on which media source is used.
See also:
TToiMediaRecorderState
void ToiMediaRecorder::recordAt ( in unsigned long  offset) raises (TToiSessionViolationException, TToiOperationNotSupportedException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. This function starts a new recording session and may reuse existing recorded content from another ongoing recording session, including a possible timeshift session, sharing the same source.

Depending on the success of the connection attempt to the media source, the recorder will change state to STATE_RECORDING. If something goes wrong it will end up in state STATE_FAILED. In any respect, the application will be notified about those state transistions by calls to its ToiMediaRecorderStateChangedEvent function.

Parameters:
offsetThe offset (in milliseconds) relative to the current position, i.e. a value of 1000 means that one second back in time will be reused. If the specified offset time is not available less data than requested will be given.
Exceptions:
TToiSessionViolationExceptionIf the recorder is in STATE_IDLE a session violation exception is raised.
TToiOperationNotSupportedExceptionRaised if the recorder is in a state in which this operation is not supported. This is the case when in STATE_FAILED, for example. What is supported in which state may in other cases vary depending on which media source is used.
See also:
ToiMediaRecorder::close()
TToiMediaRecorderState
void ToiMediaRecorder::setParameter ( in string  name,
in string  value 
) raises (TToiInvalidArgumentException, TToiPermissionDeniedException)

This function sets the value of a parameter. Depending on the current state, the new value is used differently. If the function is called when in idle state, the new value is used for all sessions started after the parameter is set. If the function is called in any other state but the idle state, the new value is applied to that session only and is discarded automatically when the session ends.

Parameters:
nameThe name of the parameter to set.
valueThe value to set the parameter to.
Exceptions:
TToiInvalidArgumentExceptionThe parameter name is invalid or not recognized.
TToiPermissionDeniedExceptionThe application does not have permission to change the value of the parameter.
See also:
ToiMediaRecorder::unsetParameter()
ToiMediaRecorder::getParameter()
void ToiMediaRecorder::unsetParameter ( in string  name) raises (TToiInvalidArgumentException, TToiPermissionDeniedException)

This function restores the value of a parameter to the default. Depending on the current state, the new value is used differently. If the function is called when in idle state, all sessions started after the parameter is restored will use the default value. If the function is called in any other state but the idle state, the value is changed for that session only.

Parameters:
nameThe name of the parameter for which the value is to be restored to the default.
Exceptions:
TToiInvalidArgumentExceptionThe parameter name is invalid or not recognized.
TToiPermissionDeniedExceptionThe application does not have permission to change the value of the parameter.
See also:
ToiMediaRecorder::setParameter()
ToiMediaRecorder::getParameter()