Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <videorecordhwdevice.h>
This item is not part of the S60 5th Edition SDK

Class CMMFVideoRecordHwDevice

class CMMFVideoRecordHwDevice : public CMMFVideoHwDevice;

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.

Derivation

Members

Defined in CMMFVideoRecordHwDevice:

Inherited from CBase:

Inherited from CMMFVideoHwDevice:


Member functions


PreProcessorInfoLC()

virtual CPreProcessorInfo* PreProcessorInfoLC()=0;

Description

Retrieves information about the pre-processing capabilities of this hardware device.

Return value

CPreProcessorInfo *

"Pre-processor information as a CPreProcessorInfo object. The object is pushed to the cleanup stack, and must be deallocated by the client."

Leave codes

"The

method will leave if an error occurs."


SetInputFormatL(const TUncompressedVideoFormat &,const TSize &)

virtual void SetInputFormatL(const TUncompressedVideoFormat &aFormat, const TSize &aPictureSize)=0;

Pre-Condition

"This method may only be called before the hwdevice has been initialized using Initialize()."

Description

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.

Parameters

const TUncompressedVideoFormat &aFormat

"The input format to use."

const TSize &aPictureSize

"The input picture size in pixels."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - The input format specified is not supported."


SetSourceCameraL(TInt,TReal)

virtual void SetSourceCameraL(TInt aCameraHandle, TReal aPictureRate)=0;

Pre-Condition

"This method may only be called before the hwdevice has been initialized using Initialize()."

Description

Sets the data source to be a camera, and sets the device to use direct capture for input.

Parameters

TInt aCameraHandle

"A camera handle for the camera to use. The handle is passed to CCamera::NewDuplicateL() in the camera API "

TReal aPictureRate

"Video capture picture rate."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - Direct capture is not supported or the picture rate specified is not supported."


SetSourceMemoryL(TReal,TBool,TBool)

virtual void SetSourceMemoryL(TReal aMaxPictureRate, TBool aConstantPictureRate, TBool aProcessRealtime)=0;

Pre-Condition

"This method may only be called before the hwdevice has been initialized using Initialize()."

Description

Sets the data source to be memory buffers.

Parameters

TReal aMaxPictureRate

"The maximum picture rate for input pictures."

TBool aConstantPictureRate

"True if the input picture rate is constant. In that case, aMaxPictureRate specifies the picture rate."

TBool 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."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - The picture rate specified is not supported."


SetClockSource(MMMFClockSource *)

virtual void SetClockSource(MMMFClockSource *aClock)=0;

Pre-Condition

"This method may only be called before the hwdevice has been initialized using Initialize()."

Description

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.

Parameters

MMMFClockSource *aClock

"The clock source to use."


SetRgbToYuvOptionsL(TRgbRange,const TYuvFormat &)

virtual void SetRgbToYuvOptionsL(TRgbRange aRange, const TYuvFormat &aOutputFormat)=0;

Pre-Condition

"This method may only be called before the hwdevice has been initialized using Initialize()."

Description

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.

Parameters

TRgbRange aRange

"Input RGB data range"

const TYuvFormat &aOutputFormat

"Conversion output YUV format."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - The formats specified are not supported"


SetYuvToYuvOptionsL(const TYuvFormat &,const TYuvFormat &)

virtual void SetYuvToYuvOptionsL(const TYuvFormat &aInputFormat, const TYuvFormat &aOutputFormat)=0;

Pre-Condition

"This method may only be called before the hwdevice has been initialized using Initialize()."

Description

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.

Parameters

const TYuvFormat &aInputFormat

"Conversion input format."

const TYuvFormat &aOutputFormat

"Conversion output format."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - The formats specified are not supported"


SetPreProcessTypesL(TUint32)

virtual void SetPreProcessTypesL(TUint32 aPreProcessTypes)=0;

Pre-Condition

"This method can be called either before or after the hwdevice has been initialized with CMMFVideoRecordHwDevice::Initialize(). If called after initialization, the change must only be committed when CMMFVideoRecordHwDevice::CommitL() is called."

Description

Sets the pre-processing types to be used.

Parameters

TUint32 aPreProcessTypes

"The pre-processing steps to perform, a bitwise OR of values from TPrePostProcessType."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - The pre-processing combination is not supported"


SetRotateOptionsL(TRotationType)

virtual void SetRotateOptionsL(TRotationType aRotationType)=0;

Pre-Condition

"This method can be called either before or after the hwdevice has been initialized with CMMFVideoRecordHwDevice::Initialize(). If called after initialization, the change must only be committed when CMMFVideoRecordHwDevice::CommitL() is called."

Description

Sets pre-processing options for rotation.

Parameters

TRotationType aRotationType

"The rotation to perform."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - The rotation type is not supported."


SetScaleOptionsL(const TSize &,TBool)

virtual void SetScaleOptionsL(const TSize &aTargetSize, TBool aAntiAliasFiltering)=0;

Pre-Condition

"This method can be called either before or after the hwdevice has been initialized with CMMFVideoRecordHwDevice::Initialize(). If called after initialization, the change must only be committed when CMMFVideoRecordHwDevice::CommitL() is called."

Description

Sets pre-processing options for scaling.

Parameters

const TSize &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."

TBool 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."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - The specified target size is not supported."


SetInputCropOptionsL(const TRect &)

virtual void SetInputCropOptionsL(const TRect &aRect)=0;

Pre-Condition

"This method can be called either before or after the hwdevice has been initialized with CMMFVideoRecordHwDevice::Initialize(). If called after initialization, the change must only be committed when CMMFVideoRecordHwDevice::CommitL() is called."

Description

Sets pre-processing options for input cropping. Input cropping is typically used for digital zooming.

Parameters

const TRect &aRect

"The input cropping rectangle specifying the area of the picture to use. The rectangle must fit completely inside the input picture."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - The specified cropping rectangle is not supported."


SetOutputCropOptionsL(const TRect &)

virtual void SetOutputCropOptionsL(const TRect &aRect)=0;

Pre-Condition

"This method can be called either before or after the hwdevice has been initialized with CMMFVideoRecordHwDevice::Initialize(). If called after initialization, the change must only be committed when CMMFVideoRecordHwDevice::CommitL() is called."

Description

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.

Parameters

const TRect &aRect

"The output cropping rectangle specifying the area of the picture to use. The rectangle must fit completely inside the picture."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - The specified cropping rectangle is not supported."


SetOutputPadOptionsL(const TSize &,const TPoint &)

virtual void SetOutputPadOptionsL(const TSize &aOutputSize, const TPoint &aPicturePos)=0;

Pre-Condition

"This method can be called either before or after the hwdevice has been initialized with CMMFVideoRecordHwDevice::Initialize(). If called after initialization, the change must only be committed when CMMFVideoRecordHwDevice::CommitL() is called."

Description

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.

Parameters

const TSize &aOutputSize

"The padded output picture size. The output size must be large enough for the picture in its new position."

const TPoint &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."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - The specified padding settings are not supported."


SetColorEnhancementOptionsL(const TColorEnhancementOptions &)

virtual void SetColorEnhancementOptionsL(const TColorEnhancementOptions &aOptions)=0;

Pre-Condition

"This method can be called either before or after the hwdevice has been initialized with CMMFVideoRecordHwDevice::Initialize(). If called after initialization, the change must only be committed when CMMFVideoRecordHwDevice::CommitL() is called."

Description

Sets color enhancement pre-processing options.

Parameters

const TColorEnhancementOptions &aOptions

"Color enchancement options."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - The specified settings are not supported."


SetFrameStabilisationOptionsL(const TSize &,TBool)

virtual void SetFrameStabilisationOptionsL(const TSize &aOutputSize, TBool aFrameStabilisation)=0;

Pre-Condition

"This method can be called either before or after the hwdevice has been initialized with CMMFVideoRecordHwDevice::Initialize(). If called after initialization, the change must only be committed when CMMFVideoRecordHwDevice::CommitL() is called."

Description

Sets frame stabilisation options.

Parameters

const TSize &aOutputSize

"Output picture size. The output picture size must be smaller than or equal to the hardware device input picture size."

TBool aFrameStabilisation

"True if frame stabilisation should be used. By default stabilisation is not used."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - The specified settings are not supported."


SetCustomPreProcessOptionsL(const TDesC8 &)

virtual void SetCustomPreProcessOptionsL(const TDesC8 &aOptions)=0;

Pre-Condition

"This method can be called either before or after the hwdevice has been initialized with CMMFVideoRecordHwDevice::Initialize(). If called after initialization, the change must only be committed when CMMFVideoRecordHwDevice::CommitL() is called."

Description

Sets custom implementation-specific pre-processing options.

Parameters

const TDesC8 &aOptions

"Post-processing options. The data format is implementation-specific."

Leave codes

"The

method will leave if an error occurs. Typical error codes used: KErrNotSupported - The options are not supported."


Initialize()

virtual void Initialize()=0;

Description

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(CMMFVideoHwDevice *,TInt) after initialization has completed. Video capturing and encoding can be started with CMMFVideoRecordHwDevice::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:


CommitL()

virtual void CommitL()=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

Commit all changes since the last CMMFVideoRecordHwDevice::CommitL(), CMMFVideoRecordHwDevice::Revert() or CMMFVideoRecordHwDevice::Initialize() to the hardware device. This only applies to methods which can be called both before AND after DevVideoPlay has been initialized.

Leave codes

"The

method will leave if an error occurs."

See also:


Revert()

virtual void Revert()=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

Revert all changes since the last CMMFVideoRecordHwDevice::CommitL(), CMMFVideoRecordHwDevice::Revert() or CMMFVideoRecordHwDevice::Initialize() back to their previous settings. This only applies to methods which can be called both before AND after DevVideoPlay has been initialized.

See also:


WritePictureL(TVideoPicture *)

virtual void WritePictureL(TVideoPicture *aPicture)=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

Writes an uncompressed input picture. When the picture has been used, it must be returned to the client with MMMFDevVideoRecordProxy::MdvrpReturnPicture(TVideoPicture *). This method must not be called if direct capture is used.

Parameters

TVideoPicture *aPicture

"The picture to write."

Leave codes

"The

method will leave if an error occurs."


InputEnd()

virtual void InputEnd()=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

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().


Start()

virtual void Start()=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

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.


Stop()

virtual void Stop()=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

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.


Pause()

virtual void Pause()=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

Pauses video recording. Recording can be resumed using CMMFVideoRecordHwDevice::Resume().


Resume()

virtual void Resume()=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

Resumes video recording after a pause.


Freeze()

virtual void Freeze()=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

Freezes the input picture. Normal encoding can be continued using CMMFVideoRecordHwDevice::ReleaseFreeze().


ReleaseFreeze()

virtual void ReleaseFreeze()=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

Releases a frozen input picture. Video capturing and encoding continues normally.


RecordingPosition()

virtual TTimeIntervalMicroSeconds RecordingPosition()=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

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.

Return value

TTimeIntervalMicroSeconds

"The current recording position."


GetPictureCounters(CMMFDevVideoRecord::TPictureCounters &)

virtual void GetPictureCounters(CMMFDevVideoRecord::TPictureCounters &aCounters)=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

Reads various counters related to processed video pictures. See the definition of TPictureCounters for a description of the counters. The counters are reset when CMMFVideoRecordHwDevice::Initialize() or this method is called, and thus they only include pictures processed since the last call.

Parameters

CMMFDevVideoRecord::TPictureCounters &aCounters

"The counter structure to fill."


GetFrameStabilisationOutput(TRect &)

virtual void GetFrameStabilisationOutput(TRect &aRect)=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

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.

Parameters

TRect &aRect


NumComplexityLevels()

virtual TUint NumComplexityLevels()=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

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.

Return value

TUint

"The number of complexity control levels available, one if multiple levels are not supported."


SetComplexityLevel(TUint)

virtual void SetComplexityLevel(TUint aLevel)=0;

Pre-Condition

"This method can only be called after the hwdevice has been initialized with Initialize()."

Description

Sets the complexity level to use for video processing in a hardware device. The level can be changed at any time.

Parameters

TUint 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."