CMMFVideoRecordHwDevice Class Reference
#include
"videorecordhwdevice.h"
class CMMFVideoRecordHwDevice : public CMMFVideoHwDevice |
Detailed Description
A base class for all video recording (encoding and pre-processing) hardware devices. Since both encoders and pre-processors can implement pre-processing functionality, this class includes all pre-processing related methods.
Member Function Documentation
CommitL ( )
void | CommitL | ( | ) | [pure virtual] |
Freeze ( )
void | Freeze | ( | ) | [pure virtual] |
Freezes the input picture. Normal encoding can be continued using
ReleaseFreeze().
- Pre-condition
- "This method can only be called after the hwdevice has been initialized with Initialize()."
GetFrameStabilisationOutput ( TRect & )
void | GetFrameStabilisationOutput | ( | TRect & | aRect | ) | [pure virtual] |
Reads the frame stabilisation output picture position. This information can be used for positioning the viewfinder. The position returned is the stabilisation result for the most recent input picture.
- Pre-condition
- "This method can only be called after the hwdevice has been initialized with Initialize()."
GetPictureCounters ( CMMFDevVideoRecord::TPictureCounters & )
Reads various counters related to processed video pictures. See the definition of TPictureCounters for a description of the counters. The counters are reset when Initialize() or this method is called, and thus they only include pictures processed since the last call.
- Pre-condition
- "This method can only be called after the hwdevice has been initialized with Initialize()."
Parameter | Description | aCounters | "The counter structure to fill." |
Initialize ( )
void | Initialize | ( | ) | [pure virtual] |
Initializes the device, and reserves hardware resources. If direct capture is used, this method also prepares the camera API for capture by calling PrepareVideoCaptureL(). This method is asynchronous, the device will call MMMFDevVideoRecordProxy::MdvrpInitializeComplete() after initialization has completed. Video capturing and encoding can be started with Start() with a relatively low delay since the hardware has already been set up.
Error handling: Errors are reported using the MdvrpInitializeComplete() callback method. Typical error codes used:
InputEnd ( )
void | InputEnd | ( | ) | [pure virtual] |
Notifies the hardware device that the end of input data has been reached and no more input pictures will be written. The hardware device can use this signal to ensure that the remaining data gets processed, without waiting for new data. After the remaining data has been processed, the hardware device must call the proxy callback MdvrpStreamEnd().
- Pre-condition
- "This method can only be called after the hwdevice has been initialized with Initialize()."
NumComplexityLevels ( )
TUint
| NumComplexityLevels | ( | ) | [pure virtual] |
Retrieves the number of complexity control levels available for this hardware device. Devices can support processing the same input data with different computational complexity levels. The complexity level can affect, for example, the motion vector search range used in an encoder.
- Pre-condition
- "This method can only be called after the hwdevice has been initialized with Initialize()."
Returns: "The number of complexity control levels available, one if multiple levels are not supported."
Pause ( )
void | Pause | ( | ) | [pure virtual] |
Pauses video recording. Recording can be resumed using
Resume().
- Pre-condition
- "This method can only be called after the hwdevice has been initialized with Initialize()."
PreProcessorInfoLC ( )
Retrieves information about the pre-processing capabilities of this hardware device.
-
leave
- "The method will leave if an error occurs."
Returns: "Pre-processor information as a CPreProcessorInfo object. The object is pushed to the
cleanup stack, and must be deallocated by the client."
RecordingPosition ( )
Returns the current recording position. The position is the capture timestamp from the latest input picture, or the capture timestamp for the latest picture captured from the camera when direct capture is used.
- Pre-condition
- "This method can only be called after the hwdevice has been initialized with Initialize()."
Returns: "The current recording position."
ReleaseFreeze ( )
void | ReleaseFreeze | ( | ) | [pure virtual] |
Releases a frozen input picture. Video capturing and encoding continues normally.
- Pre-condition
- "This method can only be called after the hwdevice has been initialized with Initialize()."
Resume ( )
void | Resume | ( | ) | [pure virtual] |
Resumes video recording after a pause.
- Pre-condition
- "This method can only be called after the hwdevice has been initialized with Initialize()."
Revert ( )
void | Revert | ( | ) | [pure virtual] |
SetClockSource ( MMMFClockSource * )
Sets the clock source to use for video timing. When video recording is synchronized with audio, the clock source is implemented by the audio playback subsystem, otherwise the clock source should get the time from the system clock.
If no clock source is set, video recording will not be synchronized, but will proceed as fast as possible, depending on input data and output buffer availability. If direct capturing is used without a clock source, the timestamps in the output data may not be valid.
- Pre-condition
- "This method may only be called before the hwdevice has been initialized using Initialize()."
Parameter | Description | aClock | "The clock source to use." |
SetColorEnhancementOptionsL ( const TColorEnhancementOptions & )
Sets color enhancement pre-processing options.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
- KErrNotSupported - The specified settings are not supported."
- Pre-condition
- "This method can be called either before or after the hwdevice has been initialized with Initialize().
If called after initialization, the change must only be committed when CommitL() is called."
Parameter | Description | aOptions | "Color enchancement options." |
SetComplexityLevel ( TUint )
void | SetComplexityLevel | ( | TUint | aLevel | ) | [pure virtual] |
Sets the complexity level to use for video processing in a hardware device. The level can be changed at any time.
Parameter | Description | aLevel | "The computational complexity level to use. Level zero (0) is the most complex one, with the highest quality. Higher level numbers require less processing and may have lower quality."
@pre "This method can only be called after the hwdevice has been initialized with Initialize()." |
SetCustomPreProcessOptionsL ( const TDesC8 & )
void | SetCustomPreProcessOptionsL | ( | const TDesC8 & | aOptions | ) | [pure virtual] |
Sets custom implementation-specific pre-processing options.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
- KErrNotSupported - The options are not supported."
- Pre-condition
- "This method can be called either before or after the hwdevice has been initialized with Initialize().
If called after initialization, the change must only be committed when CommitL() is called."
Parameter | Description | aOptions | "Post-processing options. The data format is implementation-specific." |
SetFrameStabilisationOptionsL ( const TSize &, TBool )
void | SetFrameStabilisationOptionsL | ( | const TSize & | aOutputSize, |
| TBool | aFrameStabilisation |
| ) | [pure virtual] |
Sets frame stabilisation options.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
- KErrNotSupported - The specified settings are not supported."
- Pre-condition
- "This method can be called either before or after the hwdevice has been initialized with Initialize().
If called after initialization, the change must only be committed when CommitL() is called."
Parameter | Description | aOutputSize | "Output picture size. The output picture size must be smaller than
or equal to the hardware device input picture size." |
aFrameStabilisation | "True if frame stabilisation should be used. By default stabilisation is
not used." |
SetInputCropOptionsL ( const TRect & )
void | SetInputCropOptionsL | ( | const TRect & | aRect | ) | [pure virtual] |
Sets pre-processing options for input cropping. Input cropping is typically used for digital zooming.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
- KErrNotSupported - The specified cropping rectangle is not supported."
- Pre-condition
- "This method can be called either before or after the hwdevice has been initialized with Initialize().
If called after initialization, the change must only be committed when CommitL() is called."
Parameter | Description | aRect | "The input cropping rectangle specifying the area of the picture to use. The rectangle
must fit completely inside the input picture." |
SetInputFormatL ( const TUncompressedVideoFormat &, const TSize & )
Sets the hardware device input format. If both a pre-processor and an encoder are used, the pre-processor output format and the encoder input format must be the same. The input format for the first device in the system is the input format for video input data. The method has to be called for both direct capture as well as memory buffer input.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
- KErrNotSupported - The input format specified is not supported."
- Pre-condition
- "This method may only be called before the hwdevice has been initialized using Initialize()."
Parameter | Description | aFormat | "The input format to use." |
aPictureSize | "The input picture size in pixels." |
SetOutputCropOptionsL ( const TRect & )
void | SetOutputCropOptionsL | ( | const TRect & | aRect | ) | [pure virtual] |
Sets pre-processing options for output cropping. Output cropping is performed after other pre-processing operations but before output padding. Output cropping and padding can be used in combination to prepare the picture size to suit the encoder, typically video encoders only support picture sizes that are multiples of 16 pixels.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
- KErrNotSupported - The specified cropping rectangle is not supported."
- Pre-condition
- "This method can be called either before or after the hwdevice has been initialized with Initialize().
If called after initialization, the change must only be committed when CommitL() is called."
Parameter | Description | aRect | "The output cropping rectangle specifying the area of the picture to use. The
rectangle must fit completely inside the picture." |
SetOutputPadOptionsL ( const TSize &, const TPoint & )
void | SetOutputPadOptionsL | ( | const TSize & | aOutputSize, |
| const TPoint & | aPicturePos |
| ) | [pure virtual] |
Sets pre-processing options for output padding. Output padding is performed as the last pre-processing operation, and typically used to prepare the picture size to suit the encoder. The image is padded with black pixels.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
- KErrNotSupported - The specified padding settings are not supported."
- Pre-condition
- "This method can be called either before or after the hwdevice has been initialized with Initialize().
If called after initialization, the change must only be committed when CommitL() is called."
Parameter | Description | aOutputSize | "The padded output picture size. The output size must be large enough for the
picture in its new position." |
aPicturePos | "The position for the original picture in the new padded picture. The original
picture in its new position must fit completely inside the new picture." |
SetPreProcessTypesL ( TUint32 )
void | SetPreProcessTypesL | ( | TUint32 | aPreProcessTypes | ) | [pure virtual] |
Sets the pre-processing types to be used.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
- KErrNotSupported - The pre-processing combination is not supported"
- Pre-condition
- "This method can be called either before or after the hwdevice has been initialized with Initialize().
If called after initialization, the change must only be committed when CommitL() is called."
Parameter | Description | aPreProcessTypes | "The pre-processing steps to perform, a bitwise OR of values from
TPrePostProcessType." |
SetRgbToYuvOptionsL ( TRgbRange, const TYuvFormat & )
Sets pre-processing options for RGB to YUV color space conversion. By default, input RGB data is assumed to use the full value range ([0 255]), and the output YUV format is the hardware device output format, so typically calling this method is not necessary.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
- KErrNotSupported - The formats specified are not supported"
- Pre-condition
- "This method may only be called before the hwdevice has been initialized using Initialize()."
Parameter | Description | aRange | "Input RGB data range" |
aOutputFormat | "Conversion output YUV format." |
SetRotateOptionsL ( TRotationType )
Sets pre-processing options for rotation.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
- KErrNotSupported - The rotation type is not supported."
- Pre-condition
- "This method can be called either before or after the hwdevice has been initialized with Initialize().
If called after initialization, the change must only be committed when CommitL() is called."
Parameter | Description | aRotationType | "The rotation to perform." |
SetScaleOptionsL ( const TSize &, TBool )
void | SetScaleOptionsL | ( | const TSize & | aTargetSize, |
| TBool | aAntiAliasFiltering |
| ) | [pure virtual] |
Sets pre-processing options for scaling.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
- KErrNotSupported - The specified target size is not supported."
- Pre-condition
- "This method can be called either before or after the hwdevice has been initialized with Initialize().
If called after initialization, the change must only be committed when CommitL() is called."
Parameter | Description | aTargetSize | "Target picture size. If a fixed scale factor size is used, the new dimensions must be set to: width=floor(factor*width), height=floor(factor*height). For example, scaling a QCIF (176x144) picture up by a factor of 4/3 yields a size of 234x192."
@param "aAntiAliasFiltering" "True if anti-aliasing filtering should be used. If the pre-processor does not support anti-aliased scaling, or supports anti-aliased scaling only, this argument is ignored." |
SetSourceCameraL ( TInt, TReal )
void | SetSourceCameraL | ( | TInt | aCameraHandle, |
| TReal | aPictureRate |
| ) | [pure virtual] |
Sets the data source to be a camera, and sets the device to use direct capture for input.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
Parameter | Description | aCameraHandle | "A camera handle for the camera to use. The handle is passed
to CCamera::NewDuplicateL() in the camera API " |
aPictureRate | "Video capture picture rate." |
SetSourceMemoryL ( TReal, TBool, TBool )
void | SetSourceMemoryL | ( | TReal | aMaxPictureRate, |
| TBool | aConstantPictureRate, |
| TBool | aProcessRealtime |
| ) | [pure virtual] |
Sets the data source to be memory buffers.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
- KErrNotSupported - The picture rate specified is not supported."
- Pre-condition
- "This method may only be called before the hwdevice has been initialized using Initialize()."
Parameter | Description | aMaxPictureRate | "The maximum picture rate for input pictures." |
aConstantPictureRate | "True if the input picture rate is constant. In that case,
aMaxPictureRate specifies the picture rate." |
aProcessRealtime | "True if real-time processing is needed, false if not. Real-time processing is typically neede for video recording applications, while video conversion and off-line processing applications do not require it." |
SetYuvToYuvOptionsL ( const TYuvFormat &, const TYuvFormat & )
void | SetYuvToYuvOptionsL | ( | const TYuvFormat & | aInputFormat, |
| const TYuvFormat & | aOutputFormat |
| ) | [pure virtual] |
Sets pre-processing options for YUV to YUV data format conversion. By default, the hardware device input and output data formats are used. For encoder devices, the device input format and a the closest matching format supported by the encoding process are used. Typically calling this method is not necessary.
-
leave
- "The method will leave if an error occurs. Typical error codes used:
- KErrNotSupported - The formats specified are not supported"
- Pre-condition
- "This method may only be called before the hwdevice has been initialized using Initialize()."
Parameter | Description | aInputFormat | "Conversion input format." |
aOutputFormat | "Conversion output format." |
Start ( )
void | Start | ( | ) | [pure virtual] |
Starts recording video. This includes capturing pictures from the camera (if direct capture is used), pre-processing and encoding. Recording will proceed until it is stopped or paused. Initally recording is stopped.
- Pre-condition
- "This method can only be called after the hwdevice has been initialized with Initialize()."
Stop ( )
Stops recording video. No new pictures will be captured, pre-processed, or encoded. If input pictures are written while recording is stopped, they will be returned immediately.
- Pre-condition
- "This method can only be called after the hwdevice has been initialized with Initialize()."
WritePictureL ( TVideoPicture * )
Writes an uncompressed input picture. When the picture has been used, it must be returned to the client with MMMFDevVideoRecordProxy::MdvrpReturnPicture(). This method must not be called if direct capture is used.
-
leave
- "The method will leave if an error occurs."
- Pre-condition
- "This method can only be called after the hwdevice has been initialized with Initialize()."
Parameter | Description | aPicture | "The picture to write." |