Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <VideoRecorder.h>
Link against: mediaclientvideo.lib

Class CVideoRecorderUtility

class CVideoRecorderUtility : public CBase, public MMMFClientUtility;

Description

Records video data.

The class offers a simple interface to record and set meta data and control information for a video clip and save the result to a file, descriptor or URL.

Note: Some video formats also allow the storing of audio data. To accommodate this, this class contains audio functions that can manipulate such data.

While this class is abstract, CVideoRecorderUtility::NewL(MVideoRecorderUtilityObserver &,TInt,TMdaPriorityPreference) constructs, initialises and returns pointers to instances of concrete classes derived from this abstract class. This concrete class is part of the MMF implementation and is private.

Derivation

Members

Defined in CVideoRecorderUtility:

Inherited from CBase:


Construction and destruction


NewL(MVideoRecorderUtilityObserver &,TInt,TMdaPriorityPreference)

Capability: MultimediaDD A process requesting or using this method that has MultimediaDD capability will always have precedence over a process that does not have MultimediaDD.

IMPORT_C static CVideoRecorderUtility* NewL(MVideoRecorderUtilityObserver &aObserver, TInt aPriority=EMdaPriorityNormal, TMdaPriorityPreference aPref=EMdaPriorityPreferenceTimeAndQuality);

Description

Constructs and initialises a new instance of the video recorder utility.

The function leaves if the video recorder utility object cannot be created.

Parameters

MVideoRecorderUtilityObserver &aObserver

An object to receive video recorder notifications.

TInt aPriority

This client's relative priority. This is a value between EMdaPriorityMin and EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.

TMdaPriorityPreference aPref

Time vs Quality priority preferences, enumerated in TMdaPriorityPreference

Return value

CVideoRecorderUtility *

A pointer to the new video recorder utility object.

[Top]


Member functions


OpenFileL(const TDesC &,TInt,TUid,TUid,const TDesC8 &,TFourCC)

IMPORT_C void OpenFileL(const TDesC &aFileName, TInt aCameraHandle, TUid aControllerUid, TUid aVideoFormat, const TDesC8 &aVideoType=KNullDesC8, TFourCC aAudioType=KMMFFourCCCodeNULL);

Description

Opens a file that can be used to store a recorded video clip.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

const TDesC16 &aFileName

A full path name of the file to save the video clip to.

TInt aCameraHandle

A handle to the camera to use for recording.

TUid aControllerUid

The UID of the controller to use for recording.

TUid aVideoFormat

The UID of the video format to record to.

const TDesC8 &aVideoType

The descriptor containing the video MIME type.

TFourCC aAudioType

A four character code representing the encoding to be used for audio data.


OpenFileL(const RFile &,TInt,TUid,TUid,const TDesC8 &,TFourCC)

IMPORT_C void OpenFileL(const RFile &aFile, TInt aCameraHandle, TUid aControllerUid, TUid aVideoFormat, const TDesC8 &aVideoType=KNullDesC8, TFourCC aAudioType=KMMFFourCCCodeNULL);

Description

Opens a file that can be used to store a recorded video clip.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

const RFile &aFile

File handle of file to use for video clip

TInt aCameraHandle

A handle to the camera to use for recording.

TUid aControllerUid

The UID of the controller to use for recording.

TUid aVideoFormat

The UID of the video format to record to.

const TDesC8 &aVideoType

The descriptor containing the video MIME type.

TFourCC aAudioType

A four character code representing the encoding to be used for audio data.


OpenDesL(TDes8 &,TInt,TUid,TUid,const TDesC8 &,TFourCC)

IMPORT_C void OpenDesL(TDes8 &aDescriptor, TInt aCameraHandle, TUid aControllerUid, TUid aVideoFormat, const TDesC8 &aVideoType=KNullDesC8, TFourCC aAudioType=KMMFFourCCCodeNULL);

Description

Specifies a descriptor that can be used to store a recorded video clip.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

TDes8 &aDescriptor

The descriptor used to store the recorded video clip.

TInt aCameraHandle

The handle of the camera to record from.

TUid aControllerUid

The UID of the controller to use for recording.

TUid aVideoFormat

The UID of the video format to record to.

const TDesC8 &aVideoType

The descriptor containing the video MIME type.

TFourCC aAudioType

A four character code representing the encoding to be used for audio data.


OpenUrlL(const TDesC &,TInt,TInt,TUid,TUid,const TDesC8 &,TFourCC)

IMPORT_C void OpenUrlL(const TDesC &aUrl, TInt aIapId, TInt aCameraHandle, TUid aControllerUid, TUid aVideoFormat, const TDesC8 &aVideoType=KNullDesC8, TFourCC aAudioType=KMMFFourCCCodeNULL);

Description

Specifies a URL that can be used to store a recorded video clip.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

const TDesC16 &aUrl

The URL used to store the recorded video clip.

TInt aIapId

The Id of the internet access point to use.

TInt aCameraHandle

The handle of the camera to record from.

TUid aControllerUid

The UID of the controller to use for recording.

TUid aVideoFormat

The UID of the video format to record to.

const TDesC8 &aVideoType

The descriptor containing the video MIME type.

TFourCC aAudioType

A four character code representing the encoding to be used for audio data.


Close()

IMPORT_C void Close();

Description

Closes a video clip.


Prepare()

IMPORT_C void Prepare();

Description

Prepares the recorder for recording.

This should be called before the first call to record. The client will receive a MvruoPrepareComplete when the prepare operation is complete.

See also:


Record()

IMPORT_C void Record();

Description

Starts the recording of video data to the specified file, descriptor or URL.

If the video format also supports the use of an audio track, recording of the audio track can be enabled using CVideoRecorderUtility::SetAudioEnabledL(TBool).

The client will receive a MvruoRecordComplete on completion of recording, unless it explicitly ends recording with Stop. CVideoRecorderUtility::Prepare() should be called before the first call to CVideoRecorderUtility::Record().

This function must not be called until a MVideoRecorderUtilityObserver::MvruoPrepareComplete(TInt) has been received with an aError equal to KErrNone.


Stop()

IMPORT_C TInt Stop();

Description

Stops the recording of video data to the specified file, descriptor or URL.

If the video format supports audio tracks and audio is enabled, this function also stops the recording of the audio data.

Recording is stopped without sending the MvruoRecordComplete message to the client.

Return value

TInt

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.


PauseL()

IMPORT_C void PauseL();

Description

Pauses the recording of video data to the specified file, descriptor or URL.

If the video format supports audio tracks and audio is enabled, this function also pauses the recording of the audio data.

If an error occurs, this function leaves with one of the system wide error codes.


SetPriorityL(TInt,TMdaPriorityPreference)

Capability: MultimediaDD A process requesting or using this method that has MultimediaDD capability will always have precedence over a process that does not have MultimediaDD.

IMPORT_C void SetPriorityL(TInt aPriority, TMdaPriorityPreference aPref);

Description

Sets the recording priority. This is used to arbitrate between simultaneous accesses of the sound hardware.

Parameters

TInt aPriority

A priority between EMdaPriorityMin and EMdaPriorityMax. EMdaPriorityMin means the client can be interrupted by any other client, EMdaPriorityNormal means the client can only be interrupted by a client with a higher priority or EMdaPriorityMax means the client cannot be interrupted by other clients.

TMdaPriorityPreference aPref

Time vs Quality priority preferences, enumerated in TMdaPriorityPreference


GetPriorityL(TInt &,TMdaPriorityPreference &)const

IMPORT_C void GetPriorityL(TInt &aPriority, TMdaPriorityPreference &aPref) const;

Description

Gets the current recording priority. This is used to arbitrate between simultaneous accesses of the sound hardware.

Parameters

TInt &aPriority

A priority between EMdaPriorityMin and EMdaPriorityMax. EMdaPriorityMin means the client can be interrupted by any other client, EMdaPriorityNormal means the client can only be interrupted by a client with a higher priority or EMdaPriorityMax means the client cannot be interrupted by other clients.

TMdaPriorityPreference &aPref

Time vs Quality priority preferences, enumerated in TMdaPriorityPreference


SetVideoFrameRateL(TReal32)

IMPORT_C void SetVideoFrameRateL(TReal32 aFrameRate);

Description

Sets the video frame rate.

Parameters

TReal32 aFrameRate

The video frame rate, in frames/second.


VideoFrameRateL()const

IMPORT_C TReal32 VideoFrameRateL() const;

Description

Returns the video frame rate.

If an error occurs, this function leaves with one of the system wide error codes.

Return value

TReal32

The frame rate in frames/second.


SetVideoFrameSizeL(const TSize &)

IMPORT_C void SetVideoFrameSizeL(const TSize &aSize);

Description

Sets the video frame size in pixels.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

const TSize &aSize

The video frame size, in pixels


GetVideoFrameSizeL(TSize &)const

IMPORT_C void GetVideoFrameSizeL(TSize &aSize) const;

Description

Gets the video frame size.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

TSize &aSize

The video frame size, in pixels.


SetVideoBitRateL(TInt)

IMPORT_C void SetVideoBitRateL(TInt aBitRate);

Description

Sets the video bit rate.

Parameters

TInt aBitRate

The video bit rate in bits/second. This can be called with the parameter KMMFVariableVideoBitRate which specifies a variable bit rate.


VideoBitRateL()

IMPORT_C TInt VideoBitRateL();

Description

Returns the video bit rate.

Return value

TInt

The video bit rate in bits/second or KMMFVariableVideoBitRate.


SetAudioBitRateL(TInt)

IMPORT_C void SetAudioBitRateL(TInt aBitRate);

Description

Sets the audio bit rate.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

TInt aBitRate

The video bit rate in bits/second.


AudioBitRateL()const

IMPORT_C TInt AudioBitRateL() const;

Description

Gets the audio bit rate.

If an error occurs, this function leaves with one of the system wide error codes.

Return value

TInt

The audio bit rate in bits/second.


SetAudioEnabledL(TBool)

IMPORT_C void SetAudioEnabledL(TBool aEnabled);

Description

Sets whether the current clip has an audio stream.

Parameters

TBool aEnabled

A boolean indicating if the audio stream is enabled. ETrue to enable audio, EFalse to disable it.


AudioEnabledL()const

IMPORT_C TBool AudioEnabledL() const;

Description

Returns the status of audio support for the video clip currently being recorded.

Return value

TBool

A boolean indicating if an audio stream is present. ETrue if it is, otherwise EFalse.


DurationL()const

IMPORT_C TTimeIntervalMicroSeconds DurationL() const;

Description

Returns the length of the video clip.

Return value

TTimeIntervalMicroSeconds

The length of the video clip in microseconds.


SetMaxClipSizeL(TInt)

IMPORT_C void SetMaxClipSizeL(TInt aClipSizeInBytes);

Description

Sets the maximum recording size for a video clip in bytes.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

TInt aClipSizeInBytes

The maximum file size of a video clip. This can be called with the parameter KMMFNoMaxClipSize which signifies no maximum clip size.


SetGainL(TInt)

IMPORT_C void SetGainL(TInt aGain);

Description

Sets the audio recording gain.

If you want to disable audio, rather than setting the recording gain to 0, use CVideoRecorderUtility::SetAudioEnabledL(TBool).

If an error occurs, this function leaves with one of the system wide error codes

Parameters

TInt aGain

The recording gain, between 0 and MaxGain().


GainL()const

IMPORT_C TInt GainL() const;

Description

Returns the current recording gain.

If an error occurs, this function leaves with one of the system wide error codes.

Return value

TInt

The current recording gain, between 0 and MaxGain().


MaxGainL()const

IMPORT_C TInt MaxGainL() const;

Description

Returns the maximum possible setting for the recording gain.

Return value

TInt

An integer value specifying the maximum recording gain.


NumberOfMetaDataEntriesL()const

IMPORT_C TInt NumberOfMetaDataEntriesL() const;

Description

Returns the number of meta data entries associated with this video clip.

If an error occurs, this function leaves with one of the system wide error codes.

Return value

TInt

The number of meta data entries


MetaDataEntryL(TInt)const

IMPORT_C CMMFMetaDataEntry* MetaDataEntryL(TInt aIndex) const;

Description

Returns a meta data entry from the current clip.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

TInt aIndex

The index of the entry to retrieve. The index is between 0 and CVideoRecorderUtility::NumberOfMetaDataEntriesL()const-1.

Return value

CMMFMetaDataEntry *

The meta data entry requested.

Leave codes

KErrArgument

If the index is out of range, or with one of the other system-wide error codes.


AddMetaDataEntryL(const CMMFMetaDataEntry &)

IMPORT_C void AddMetaDataEntryL(const CMMFMetaDataEntry &aNewEntry);

Description

Adds a new meta data entry to the video clip.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

const CMMFMetaDataEntry &aNewEntry

The meta data entry to add.


RemoveMetaDataEntryL(TInt)

IMPORT_C void RemoveMetaDataEntryL(TInt aIndex);

Description

Removes a meta data entry.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

TInt aIndex

The index of the meta data entry to remove.


ReplaceMetaDataEntryL(TInt,const CMMFMetaDataEntry &)

IMPORT_C void ReplaceMetaDataEntryL(TInt aIndex, const CMMFMetaDataEntry &aNewEntry);

Description

Replaces a meta data entry.

The meta data entry specified by aIndex is replaced by the new data specified in aNewEntry. The index must be a value between 0 and CVideoRecorderUtility::NumberOfMetaDataEntriesL()const-1.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

TInt aIndex

The index of the meta data entry to replace.

const CMMFMetaDataEntry &aNewEntry

The meta data entry to replace the specified entry.


AudioTypeL()const

IMPORT_C TFourCC AudioTypeL() const;

Description

Returns the audio type. This represents the encoding of audio data within the current format.

If an error occurs, this function leaves with one of the system wide error codes.

Return value

TFourCC

A Four Character Code representing the AudioType.


SetVideoTypeL(const TDesC8 &)

IMPORT_C void SetVideoTypeL(const TDesC8 &aType);

Description

Sets the codec to use for the video component of the video clip.

This represents the encoding of the video data within the current format. To retrieve a list of available video codecs, use CVideoRecorderUtility::GetSupportedVideoTypesL(CDesC8Array &)const.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

const TDesC8 &aType

The descriptor containing the video MIME type.


SetAudioTypeL(TFourCC)

IMPORT_C void SetAudioTypeL(TFourCC aType);

Description

Sets the audio type. This represents the encoding of the audio data within the current format.

To retrieve a list of available audio codecs, use CVideoRecorderUtility::GetSupportedAudioTypesL(RArray< TFourCC > &)const.

If an error occurs, this function leaves with one of the system wide error codes.

Parameters

TFourCC aType

The Four Character Code representing the Audio Type.


GetSupportedVideoTypesL(CDesC8Array &)const

IMPORT_C void GetSupportedVideoTypesL(CDesC8Array &aVideoTypes) const;

Description

Gets a list of the video types that are supported for recording to.

Parameters

CDesC8Array &aVideoTypes

An array of Four Character Codes representing the video types supported.


GetSupportedAudioTypesL(RArray< TFourCC > &)const

IMPORT_C void GetSupportedAudioTypesL(RArray< TFourCC > &aAudioTypes) const;

Description

Gets a list of the audio types that are supported for recording to.

Parameters

RArray< TFourCC > &aAudioTypes

An array of Four Character Codes representing the audio types supported.


RecordTimeAvailable()const

IMPORT_C TTimeIntervalMicroSeconds RecordTimeAvailable() const;

Description

Returns the (possibly estimated) record time left in the clip.

Return value

TTimeIntervalMicroSeconds

The record time available, in microseconds.


VideoFormatMimeType()const

IMPORT_C const TDesC8& VideoFormatMimeType() const;

Description

Returns the video format's MIME type.

Return value

const TDesC8 &

The video clip's MIME type.


ControllerImplementationInformationL()

IMPORT_C const CMMFControllerImplementationInformation& ControllerImplementationInformationL();

Description

Returns the controller implementation information associated with the current controller.

Return value

const CMMFControllerImplementationInformation &

The controller implementation structure associated with the controller.


CustomCommandSync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TDes8 &)

IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2, TDes8 &aDataFrom);

Description

Sends a synchronous custom command to the controller.

Parameters

const TPckgBuf &aDestination

The destination of the message, consisting of the UID of the interface of this message.

TInt aFunction

The function number to indicate which function is to be called on the interface defined in the aDestination parameter.

const TDesC8 &aDataTo1

A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.

const TDesC8 &aDataTo2

A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.

TDes8 &aDataFrom

A reference to an area of memory to which the controller framework will write any data to be passed back to the client. Can't be KNullDesC8.

Return value

TInt

The result of the request. Exact range of values is dependent on the interface.


CustomCommandSync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &)

IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2);

Description

Sends a synchronous custom command to the controller.

Parameters

const TPckgBuf &aDestination

The destination of the message, consisting of the UID of the interface of this message.

TInt aFunction

The function number to indicate which function is to be called on the interface defined in the aDestination parameter.

const TDesC8 &aDataTo1

A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.

const TDesC8 &aDataTo2

A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.

Return value

TInt

The result of the request. The exact range of values is dependent on the interface.


CustomCommandAsync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TDes8 &,TRequestStatus &)

IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2, TDes8 &aDataFrom, TRequestStatus &aStatus);

Description

Sends an asynchronous custom command to the controller.

Note: This method will return immediately. The RunL of the active object owning the aStatus parameter will be called when the command is completed by the controller framework.

Parameters

const TPckgBuf &aDestination

The destination of the message, consisting of the UID of the interface of this message.

TInt aFunction

The function number to indicate which function is to be called on the interface defined in the aDestination parameter.

const TDesC8 &aDataTo1

A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.

const TDesC8 &aDataTo2

A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.

TDes8 &aDataFrom

A reference to an area of memory to which the controller framework will write any data to be passed back to the client. Can't be KNullDesC8.

TRequestStatus &aStatus

The TRequestStatus of an active object. This will contain the result of the request on completion. The exact range of result values is dependent on the interface.


CustomCommandAsync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TRequestStatus &)

IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2, TRequestStatus &aStatus);

Description

Sends an asynchronous custom command to the controller.

Note: This method will return immediately. The RunL of the active object owning the aStatus parameter will be called when the command is completed by the controller framework.

Parameters

const TPckgBuf &aDestination

The destination of the message, consisting of the UID of the interface of this message.

TInt aFunction

The function number to indicate which function is to be called on the interface defined in the aDestination parameter.

const TDesC8 &aDataTo1

A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.

const TDesC8 &aDataTo2

A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.

TRequestStatus &aStatus

The TRequestStatus of an active object. This will contain the result of the request on completion. The exact range of result values are dependent on the interface.


SetPixelAspectRatioL(const TVideoAspectRatio &)

IMPORT_C void SetPixelAspectRatioL(const TVideoAspectRatio &aAspectRatio);

Pre-Condition

The video codec has been selected.

Description

Sets recorded video pixel aspect ratio. The client must select the video codec and set the picture size (CVideoRecorderUtility::SetVideoFrameSizeL(const TSize &)) before calling this method, since the supported aspect ratios may depend on the codec and picture size. If the codec or picture size is not set, the controller may accept or reject pixel aspect ratios incorrectly.

If an error occurs, this function leaves with any of the system wide error codes. Common error codes are listed below. This method can be called after the destination has been opened, but only before calling CVideoRecorderUtility::Prepare().

Parameters

const TVideoAspectRatio &aAspectRatio

Video pixel aspect ratio. The default aspect ratio is 1:1 (square pixels).

Leave codes

KErrNotSupported

The specified pixel aspect ratio is not supported or the controller does not support the pixel aspect ratio extension.

KErrNotReady

Invalid state: This method can be called after the destination has been opened but only before calling Prepare().


GetPixelAspectRatioL(TVideoAspectRatio &)const

IMPORT_C void GetPixelAspectRatioL(TVideoAspectRatio &aAspectRatio) const;

Pre-Condition

The destination file, descriptor, or URL has been opened.

Description

Gets the current pixel aspect ratio.

If an error occurs, this function leaves with one of the system wide error codes. This method can be called after the destination has been opened.

Parameters

TVideoAspectRatio &aAspectRatio

The current video pixel aspect ratio.

Leave codes

KErrNotSupported

The controller does not support the pixel aspect ratio extension.

KErrNotReady

Invalid state: This method can be called after the destination has been opened.


GetSupportedPixelAspectRatiosL(RArray< TVideoAspectRatio > &)const

IMPORT_C void GetSupportedPixelAspectRatiosL(RArray< TVideoAspectRatio > &aAspectRatios) const;

Pre-Condition

The video codec has been selected.

Description

Gets a list of supported pixel aspect ratios. The client must select the video codec and set the picture size (CVideoRecorderUtility::SetVideoFrameSizeL(const TSize &)) before calling this method, since the supported aspect ratios may depend on the codec and picture size. If the codec or picture size is not set, the returned list may not be correct.

If an error occurs, this function leaves with any of the system wide error codes. Common error codes are listed below.

Parameters

RArray< TVideoAspectRatio > &aAspectRatios

On return contains an array of supported pixel aspect ratios.

Leave codes

KErrNotSupported

The controller does not support the pixel aspect ratio extension.

KErrNotReady

Invalid state: This method can be called after the destination has been opened and the video codec selected.


SetAudioChannelsL(const TUint)

IMPORT_C void SetAudioChannelsL(const TUint aNumChannels);

Pre-Condition

The audio codec has been selected.

Description

Sets the number of audio channels to record (1 for mono, 2 for stereo). The client must select the audio codec before calling this method, since not all codecs support stereo or multi-channel recording. If the codec has not been set, this method may accept or reject configurations incorrectly.

If an error occurs, this function leaves with any of the system wide error codes. Common error codes are listed below. This method can be called after the destination has been opened, but only before calling CVideoRecorderUtility::Prepare().

Parameters

const TUint aNumChannels

Number of audio channels to use -- 1 for mono, 2 for stereo.

Leave codes

KErrNotSupported

The specified number of channels is not supported or the controller does not support controlling the number of audio channels.

KErrNotReady

Invalid state: This method can be called after the destination has been opened, but only before calling Prepare().


AudioChannelsL()const

IMPORT_C TUint AudioChannelsL() const;

Pre-Condition

The destination file, descriptor, or URL has been opened.

Description

Returns the current number of audio channels to record (1 for mono, 2 for stereo).

If an error occurs, this function leaves with any of the system wide error codes. Common error codes are listed below. This method can be called after the destination has been opened.

Return value

TUint

The number of audio channels to be recorded.

Leave codes

KErrNotSupported

The controller does not support controlling the number of audio channels.

KErrNotReady

Invalid state: This method can be called after the destination has been opened.


GetSupportedAudioChannelsL(RArray< TUint > &)const

IMPORT_C void GetSupportedAudioChannelsL(RArray< TUint > &aChannels) const;

Pre-Condition

The audio codec has been selected.

Description

Gets the list of the supported numbers of audio channels. One channel represents mono, two channels stereo and so on. This method can only be called after the audio codec has been selected, otherwise the list may be incorrect.

If an error occurs, this function leaves with any of the system wide error codes. Common error codes are listed below.

Parameters

RArray< TUint > &aChannels

On return contains an array of supported numbers of audio channels.

Leave codes

KErrNotSupported

The controller does not support controlling the number of audio channels.

KErrNotReady

Invalid state: This method can be called after the audio codec has been selected.


SetAudioSampleRateL(const TUint)

IMPORT_C void SetAudioSampleRateL(const TUint aSampleRate);

Pre-Condition

The audio codec has been selected.

Description

Sets the sample rate for audio recording. The client must select the audio codec before calling this method, since the supported sample rates depend on the codec. If the codec has not been set, this method may accept or reject configurations incorrectly.

If an error occurs, this function leaves with any of the system wide error codes. Common error codes are listed below.

Parameters

const TUint aSampleRate

Sample rate for audio recording.

Leave codes

KErrNotSupported

The specified sample rate is not supported or the controller does not support controlling the audio sample rate.

KErrNotReady

Invalid state: This method can be called after the destination has been opened and the audio codec selected, but only before calling Prepare().


AudioSampleRateL()const

IMPORT_C TUint AudioSampleRateL() const;

Pre-Condition

The destination file, descriptor, or URL has been opened.

Description

Returns the current audio sample rate.

If an error occurs, this function leaves with any of the system wide error codes. Common error codes are listed below. This method can be called after the destination has been opened.

Return value

TUint

The current audio sample rate.

Leave codes

KErrNotSupported

The controller does not support controlling the audio sample rate.

KErrNotReady

Invalid state: This method can be called after the destination has been opened.


GetSupportedAudioSampleRatesL(RArray< TUint > &)const

IMPORT_C void GetSupportedAudioSampleRatesL(RArray< TUint > &aSampleRates) const;

Pre-Condition

The audio codec has been selected.

Description

Gets the list of the supported audio sample rates. The client must select the audio codec before calling this method, since the supported sample rates depend on the codec. If the codec has not been set, the returned list may not be correct.

If an error occurs, this function leaves with any of the system wide error codes. Common error codes are listed below.

Parameters

RArray< TUint > &aSampleRates

On return contains an array of supported sample rates.

Leave codes

KErrNotSupported

The controller does not support controlling the audio sample rate.

KErrNotReady

Invalid state: This method can be called after the audio codec has been selected.