class CVideoRecorderUtility : public CBase |
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, NewL() 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.
Private Member Enumerations | |
---|---|
enum | TMMFVideoRecorderState { EStopped , EOpening , EPaused , ERecording } |
Private Attributes | |
---|---|
CBody * | iBody |
~CVideoRecorderUtility | ( | ) |
Destructor. Closes the current clip, if one is open, and frees resources.
IMPORT_C void | AddMetaDataEntryL | ( | const CMMFMetaDataEntry & | aNewEntry | ) |
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.
const CMMFMetaDataEntry & aNewEntry | The meta data entry to add. |
IMPORT_C TInt | AudioBitRateL | ( | ) | const |
Gets the audio bit rate.
If an error occurs, this function leaves with one of the system wide error codes.
IMPORT_C TUint | AudioChannelsL | ( | ) | const |
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.
IMPORT_C TBool | AudioEnabledL | ( | ) | const |
Returns the status of audio support for the video clip currently being recorded.
IMPORT_C TUint | AudioSampleRateL | ( | ) | const |
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.
IMPORT_C TFourCC | AudioTypeL | ( | ) | const |
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.
IMPORT_C const CMMFControllerImplementationInformation & | ControllerImplementationInformationL | ( | ) |
Returns the controller implementation information associated with the current controller.
IMPORT_C void | CustomCommandAsync | ( | const TMMFMessageDestinationPckg & | aDestination, |
TInt | aFunction, | |||
const TDesC8 & | aDataTo1, | |||
const TDesC8 & | aDataTo2, | |||
TDes8 & | aDataFrom, | |||
TRequestStatus & | aStatus | |||
) |
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.
const TMMFMessageDestinationPckg & 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. |
IMPORT_C void | CustomCommandAsync | ( | const TMMFMessageDestinationPckg & | aDestination, |
TInt | aFunction, | |||
const TDesC8 & | aDataTo1, | |||
const TDesC8 & | aDataTo2, | |||
TRequestStatus & | aStatus | |||
) |
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.
const TMMFMessageDestinationPckg & 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. |
IMPORT_C TInt | CustomCommandSync | ( | const TMMFMessageDestinationPckg & | aDestination, |
TInt | aFunction, | |||
const TDesC8 & | aDataTo1, | |||
const TDesC8 & | aDataTo2, | |||
TDes8 & | aDataFrom | |||
) |
Sends a synchronous custom command to the controller.
const TMMFMessageDestinationPckg & 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. |
IMPORT_C TInt | CustomCommandSync | ( | const TMMFMessageDestinationPckg & | aDestination, |
TInt | aFunction, | |||
const TDesC8 & | aDataTo1, | |||
const TDesC8 & | aDataTo2 | |||
) |
Sends a synchronous custom command to the controller.
const TMMFMessageDestinationPckg & 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. |
IMPORT_C TTimeIntervalMicroSeconds | DurationL | ( | ) | const |
Returns the length of the video clip.
IMPORT_C TInt | GainL | ( | ) | const |
Returns the current recording gain.
If an error occurs, this function leaves with one of the system wide error codes.
IMPORT_C void | GetPixelAspectRatioL | ( | TVideoAspectRatio & | aAspectRatio | ) | const |
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.
TVideoAspectRatio & aAspectRatio | The current video pixel aspect ratio. |
IMPORT_C void | GetPriorityL | ( | TInt & | aPriority, |
TMdaPriorityPreference & | aPref | |||
) | const |
Gets the current recording priority. This is used to arbitrate between simultaneous accesses of the sound hardware.
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 | Priority preference |
IMPORT_C void | GetSupportedAudioChannelsL | ( | RArray < TUint > & | aChannels | ) | const |
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.
IMPORT_C void | GetSupportedAudioSampleRatesL | ( | RArray < TUint > & | aSampleRates | ) | const |
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.
IMPORT_C void | GetSupportedAudioTypesL | ( | RArray < TFourCC > & | aAudioTypes | ) | const |
Gets a list of the audio types that are supported for recording to.
IMPORT_C void | GetSupportedPixelAspectRatiosL | ( | RArray < TVideoAspectRatio > & | aAspectRatios | ) | const |
Gets a list of supported pixel aspect ratios. The client must select the video codec and set the picture size ( SetVideoFrameSizeL() ) 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.
RArray < TVideoAspectRatio > & aAspectRatios | On return contains an array of supported pixel aspect ratios. |
IMPORT_C void | GetSupportedVideoTypesL | ( | CDesC8Array & | aVideoTypes | ) | const |
Gets a list of the video types that are supported for recording to.
CDesC8Array & aVideoTypes | An array of Four Character Codes representing the video types supported. |
IMPORT_C void | GetVideoFrameSizeL | ( | TSize & | aSize | ) | const |
Gets the video frame size.
If an error occurs, this function leaves with one of the system wide error codes.
TSize & aSize | The video frame size, in pixels. |
IMPORT_C TInt | MaxGainL | ( | ) | const |
Returns the maximum possible setting for the recording gain.
IMPORT_C CMMFMetaDataEntry * | MetaDataEntryL | ( | TInt | aIndex | ) | const |
Returns a meta data entry from the current clip.
If an error occurs, this function leaves with one of the system wide error codes.
TInt aIndex | The index of the entry to retrieve. The index is between 0 and NumberOfMetaDataEntriesL()-1. |
IMPORT_C CVideoRecorderUtility * | NewL | ( | MVideoRecorderUtilityObserver & | aObserver, |
TInt | aPriority = EMdaPriorityNormal, | |||
TInt | aPref = EMdaPriorityPreferenceTimeAndQuality | |||
) | [static] |
Constructs and initialises a new instance of the video recorder utility.
The function leaves if the video recorder utility object cannot be created.
MVideoRecorderUtilityObserver & aObserver | An object to receive video recorder notifications. |
TInt aPriority = EMdaPriorityNormal | The Priority Value - 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. |
TInt aPref = EMdaPriorityPreferenceTimeAndQuality | The Priority Preference - an additional audio policy parameter. The suggested default is EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional values may be supported by given phones and/or platforms, but should not be depended upon by portable code. |
IMPORT_C TInt | NumberOfMetaDataEntriesL | ( | ) | const |
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.
IMPORT_C void | OpenDesL | ( | TDes8 & | aDescriptor, |
TInt | aCameraHandle, | |||
TUid | aControllerUid, | |||
TUid | aVideoFormat, | |||
const TDesC8 & | aVideoType = KNullDesC8 , | |||
TFourCC | aAudioType = KMMFFourCCCodeNULL | |||
) |
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.
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 = KNullDesC8 | The descriptor containing the video MIME type. |
TFourCC aAudioType = KMMFFourCCCodeNULL | A four character code representing the encoding to be used for audio data. |
IMPORT_C void | OpenFileL | ( | const TDesC & | aFileName, |
TInt | aCameraHandle, | |||
TUid | aControllerUid, | |||
TUid | aVideoFormat, | |||
const TDesC8 & | aVideoType = KNullDesC8 , | |||
TFourCC | aAudioType = KMMFFourCCCodeNULL | |||
) |
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.
const TDesC & 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 = KNullDesC8 | The descriptor containing the video MIME type. |
TFourCC aAudioType = KMMFFourCCCodeNULL | A four character code representing the encoding to be used for audio data. |
IMPORT_C void | OpenFileL | ( | const RFile & | aFile, |
TInt | aCameraHandle, | |||
TUid | aControllerUid, | |||
TUid | aVideoFormat, | |||
const TDesC8 & | aVideoType = KNullDesC8 , | |||
TFourCC | aAudioType = KMMFFourCCCodeNULL | |||
) |
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.
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 = KNullDesC8 | The descriptor containing the video MIME type. |
TFourCC aAudioType = KMMFFourCCCodeNULL | A four character code representing the encoding to be used for audio data. |
IMPORT_C void | OpenUrlL | ( | const TDesC & | aUrl, |
TInt | aIapId, | |||
TInt | aCameraHandle, | |||
TUid | aControllerUid, | |||
TUid | aVideoFormat, | |||
const TDesC8 & | aVideoType = KNullDesC8 , | |||
TFourCC | aAudioType = KMMFFourCCCodeNULL | |||
) |
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.
const TDesC & 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 = KNullDesC8 | The descriptor containing the video MIME type. |
TFourCC aAudioType = KMMFFourCCCodeNULL | A four character code representing the encoding to be used for audio data. |
IMPORT_C void | PauseL | ( | ) |
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.
IMPORT_C void | Prepare | ( | ) |
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.
IMPORT_C void | Record | ( | ) |
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 SetAudioEnabledL() .
The client will receive a MvruoRecordComplete on completion of recording, unless it explicitly ends recording with Stop. Prepare() should be called before the first call to Record() .
This function must not be called until a MVideoRecorderUtilityObserver::MvruoPrepareComplete() has been received with an aError equal to KErrNone.
IMPORT_C TTimeIntervalMicroSeconds | RecordTimeAvailable | ( | ) | const |
Returns the (possibly estimated) record time left in the clip.
IMPORT_C void | RemoveMetaDataEntryL | ( | TInt | aIndex | ) |
Removes a meta data entry.
If an error occurs, this function leaves with one of the system wide error codes.
TInt aIndex | The index of the meta data entry to remove. |
IMPORT_C void | ReplaceMetaDataEntryL | ( | TInt | aIndex, |
const CMMFMetaDataEntry & | aNewEntry | |||
) |
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 NumberOfMetaDataEntriesL() -1.
If an error occurs, this function leaves with one of the system wide error codes.
TInt aIndex | The index of the meta data entry to replace. |
const CMMFMetaDataEntry & aNewEntry | The meta data entry to replace the specified entry. |
IMPORT_C void | SetAudioBitRateL | ( | TInt | aBitRate | ) |
Sets the audio bit rate.
If an error occurs, this function leaves with one of the system wide error codes.
TInt aBitRate | The audio bit rate in bits/second. |
IMPORT_C void | SetAudioChannelsL | ( | const TUint | aNumChannels | ) |
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 Prepare() .
const TUint aNumChannels | Number of audio channels to use -- 1 for mono, 2 for stereo. |
IMPORT_C void | SetAudioEnabledL | ( | TBool | aEnabled | ) |
Sets whether the current clip has an audio stream.
TBool aEnabled | A boolean indicating if the audio stream is enabled. ETrue to enable audio, EFalse to disable it. |
IMPORT_C void | SetAudioSampleRateL | ( | const TUint | aSampleRate | ) |
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.
const TUint aSampleRate | Sample rate for audio recording. |
IMPORT_C void | SetAudioTypeL | ( | TFourCC | aType | ) |
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 GetSupportedAudioTypesL() .
If an error occurs, this function leaves with one of the system wide error codes.
TFourCC aType | The Four Character Code representing the Audio Type. |
IMPORT_C void | SetGainL | ( | TInt | aGain | ) |
Sets the audio recording gain.
If you want to disable audio, rather than setting the recording gain to 0, use SetAudioEnabledL() .
If an error occurs, this function leaves with one of the system wide error codes
TInt aGain | The recording gain, between 0 and MaxGain(). |
IMPORT_C void | SetMaxClipSizeL | ( | TInt | aClipSizeInBytes | ) |
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.
TInt aClipSizeInBytes | The maximum file size of a video clip. This can be called with the parameter KMMFNoMaxClipSize which signifies no maximum clip size. |
IMPORT_C void | SetPixelAspectRatioL | ( | const TVideoAspectRatio & | aAspectRatio | ) |
Sets recorded video pixel aspect ratio. The client must select the video codec and set the picture size ( SetVideoFrameSizeL() ) 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 Prepare() .
const TVideoAspectRatio & aAspectRatio | Video pixel aspect ratio. The default aspect ratio is 1:1 (square pixels). |
IMPORT_C void | SetPriorityL | ( | TInt | aPriority, |
TInt | aPref | |||
) |
Sets the recording priority. This is used to arbitrate between simultaneous accesses of the sound hardware.
IMPORT_C void | SetVideoBitRateL | ( | TInt | aBitRate | ) |
Sets the video bit rate.
TInt aBitRate | The video bit rate in bits/second. This can be called with the parameter KMMFVariableVideoBitRate which specifies a variable bit rate. |
IMPORT_C void | SetVideoEnabledL | ( | TBool | aEnabled | ) |
Enables or disables video recording without affecting audio recording. This API can be used to record audio only clips. Video recording is enabled by default. This can only be called before starting to record.
If an error occurs, this function leaves with any of the system wide error codes. Common error codes are listed below.
TBool aEnabled | ETrue to enable video recording, EFalse to disable it |
IMPORT_C void | SetVideoFrameRateFixedL | ( | TBool | aFixedFrameRate | ) |
Controls whether video recording framerate set using the API the SetVideoFrameRateL should be fixed or variable. When fixed framerate is requested, the video encoder will try to maintain a constant framerate, even at the expense of picture quality. This will result in a reduced picture quality at lower bitrates, but a smoother framerate.
The fixed framerate setting is not an absolute requirement -- encoders may still skip frames even though a fixed framerate is required, but they should do it less often. Additionally, many encoders will operate at a fixed framerate at higher bitrates regardless of this setting.
By default the framerate is not fixed.
If an error occurs, this function leaves with any of the system wide error codes. Common error codes are listed below.
TBool aFixedFrameRate | ETrue to request a fixed framerate, EFalse to request a variable framerate. |
IMPORT_C void | SetVideoFrameRateL | ( | TReal32 | aFrameRate | ) |
Sets the video frame rate.
TReal32 aFrameRate | The video frame rate, in frames/second. |
IMPORT_C void | SetVideoFrameSizeL | ( | const TSize & | aSize | ) |
Sets the video frame size in pixels.
If an error occurs, this function leaves with one of the system wide error codes.
const TSize & aSize | The video frame size, in pixels |
IMPORT_C void | SetVideoQualityL | ( | TInt | aQuality | ) |
Controls video recording quality. Setting the video quality using this method will override other bitrate setting, but will not affect picture size, and framerate if VideoFrameRateFixed is set. Changing the bitrate or framerate would override the quality settings. The return value from VideoQualityL() will not reflect the quality accurately after this.
TInt aQuality | Video quality, in the range of 0 to 100, inclusive. 0 refers to lowest, 25 refers to low, 50 refers to normal, 75 refers to high, and 100 refers to lossless quality as is supported by the codec. Standard set of values defined by enum TVideoQuality. |
IMPORT_C void | SetVideoTypeL | ( | const TDesC8 & | aType | ) |
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 GetSupportedVideoTypesL() .
If an error occurs, this function leaves with one of the system wide error codes.
const TDesC8 & aType | The descriptor containing the video MIME type. |
IMPORT_C TInt | Stop | ( | ) |
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.
IMPORT_C TBool | VideoEnabledL | ( | ) | const |
Queries whether video recording is currently enabled or not. If video recording is disabled it will record audio only clip. Video recording is enabled by default.
If an error occurs, this function leaves with any of the system wide error codes. Common error codes are listed below.
IMPORT_C const TDesC8 & | VideoFormatMimeType | ( | ) | const |
Returns the video format's MIME type.
IMPORT_C TBool | VideoFrameRateFixedL | ( | ) | const |
Queries the current fixed/variable framerate setting.
If an error occurs, this function leaves with any of the system wide error codes. Common error codes are listed below.
IMPORT_C TReal32 | VideoFrameRateL | ( | ) | const |
Returns the video frame rate.
If an error occurs, this function leaves with one of the system wide error codes.
IMPORT_C TInt | VideoQualityL | ( | ) | const |
Queries the current video quality setting. The return value may not reflect bitrate and framerate settings made through SetVideoBitRateL() and SetVideoFrameRateL() . Value returned indicate just the quality level set using SetVideoQualityL() . Default value for Quality is EVideoQualityNormal (value 50).
If an error occurs, this function leaves with any of the system wide error codes. Common error codes are listed below.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.