epoc32/include/mmf/devvideo/videorecordhwdevice.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mmf/devvideo/videorecordhwdevice.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,979 @@
     1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __VIDEORECORDHWDEVICE_H__
    1.20 +#define __VIDEORECORDHWDEVICE_H__
    1.21 +
    1.22 +#include <mmf/devvideo/devvideobase.h>
    1.23 +#include <mmf/devvideo/devvideorecord.h>
    1.24 +
    1.25 +/**
    1.26 +A base class for all video recording (encoding and pre-processing) hardware devices. Since both encoders 
    1.27 +and pre-processors can implement pre-processing functionality, this class includes all pre-processing 
    1.28 +related methods.
    1.29 +@publishedAll
    1.30 +@released
    1.31 +*/
    1.32 +class CMMFVideoRecordHwDevice : public CMMFVideoHwDevice
    1.33 +	{
    1.34 +public:
    1.35 +	/**
    1.36 +	Retrieves information about the pre-processing capabilities of this hardware device.
    1.37 +
    1.38 +	@return	"Pre-processor information as a CPreProcessorInfo object. The object is pushed to the 
    1.39 +			cleanup stack, and must be deallocated by the client."
    1.40 +	@leave	"The method will leave if an error occurs."
    1.41 +	*/
    1.42 +	virtual CPreProcessorInfo* PreProcessorInfoLC() = 0;
    1.43 +
    1.44 +	/**
    1.45 +	Sets the hardware device input format. If both a pre-processor and an encoder are used, the 
    1.46 +	pre-processor output format and the encoder input format must be the same. The input format for 
    1.47 +	the first device in the system is the input format for video input data. The method has to be called 
    1.48 +	for both direct capture as well as memory buffer input.
    1.49 +
    1.50 +	@param	"aFormat"		"The input format to use."
    1.51 +	@param	"aPictureSize"	"The input picture size in pixels."
    1.52 +	@leave	"The method will leave if an error occurs. Typical error codes used:
    1.53 +				- KErrNotSupported - The input format specified is not supported."
    1.54 +	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
    1.55 +	*/
    1.56 +	virtual void SetInputFormatL(const TUncompressedVideoFormat& aFormat, const TSize& aPictureSize) = 0;
    1.57 +
    1.58 +	/**
    1.59 +	Sets the data source to be a camera, and sets the device to use direct capture for input.
    1.60 +
    1.61 +	@param	"aCameraHandle"	"A camera handle for the camera to use. The handle is passed 
    1.62 +							to CCamera::NewDuplicateL() in the camera API "
    1.63 +	@param	"aPictureRate"	"Video capture picture rate."
    1.64 +	@leave	"The method will leave if an error occurs. Typical error codes used:
    1.65 +				- KErrNotSupported - Direct capture is not supported or the picture rate specified is not 
    1.66 +									 supported."
    1.67 +	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
    1.68 +	*/
    1.69 +	virtual void SetSourceCameraL(TInt aCameraHandle, TReal aPictureRate) = 0;
    1.70 +
    1.71 +	/**
    1.72 +	Sets the data source to be memory buffers.
    1.73 +
    1.74 +	@param	"aMaxPictureRate"		"The maximum picture rate for input pictures."
    1.75 +	@param	"aConstantPictureRate"	"True if the input picture rate is constant. In that case, 
    1.76 +									aMaxPictureRate specifies the picture rate."
    1.77 +	@param	"aProcessRealtime"		"True if real-time processing is needed, false if not. Real-time 
    1.78 +									processing is typically neede for video recording applications, while
    1.79 +									video conversion and off-line processing applications do not require it."
    1.80 +	@leave	"The method will leave if an error occurs. Typical error codes used:
    1.81 +				- KErrNotSupported - The picture rate specified is not supported."
    1.82 +	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
    1.83 +	*/
    1.84 +	virtual void SetSourceMemoryL(TReal aMaxPictureRate, TBool aConstantPictureRate, TBool aProcessRealtime) = 0;
    1.85 +
    1.86 +	/**
    1.87 +	Sets the clock source to use for video timing. When video recording is synchronized with audio, 
    1.88 +	the clock source is implemented by the audio playback subsystem, otherwise the clock source should 
    1.89 +	get the time from the system clock.
    1.90 +
    1.91 +	If no clock source is set, video recording will not be synchronized, but will proceed as fast as
    1.92 +	possible, depending on input data and output buffer availability. If direct capturing is used without
    1.93 +	a clock source, the timestamps in the output data may not be valid.
    1.94 +
    1.95 +	@param	"aClock"	"The clock source to use."
    1.96 +	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
    1.97 +	*/
    1.98 +	virtual void SetClockSource(MMMFClockSource* aClock) = 0;
    1.99 +
   1.100 +	/**
   1.101 +	Sets pre-processing options for RGB to YUV color space conversion. By default, input RGB data is 
   1.102 +	assumed to use the full value range ([0…255]), and the output YUV format is the hardware device output 
   1.103 +	format, so typically calling this method is not necessary.
   1.104 +
   1.105 +	@param	"aRange"		"Input RGB data range"
   1.106 +	@param	"aOutputFormat"	"Conversion output YUV format."
   1.107 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.108 +				- KErrNotSupported - The formats specified are not supported"
   1.109 +	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
   1.110 +	*/
   1.111 +	virtual void SetRgbToYuvOptionsL(TRgbRange aRange, const TYuvFormat& aOutputFormat) = 0;
   1.112 +
   1.113 +	/**
   1.114 +	Sets pre-processing options for YUV to YUV data format conversion. By default, the hardware device input 
   1.115 +	and output data formats are used. For encoder devices, the device input format and a the closest matching
   1.116 +	format supported by the encoding process are used. Typically calling this method is not necessary.
   1.117 +
   1.118 +	@param	"aInputFormat"	"Conversion input format."
   1.119 +	@param	"aOutputFormat"	"Conversion output format."
   1.120 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.121 +				- KErrNotSupported - The formats specified are not supported"
   1.122 +	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
   1.123 +	*/
   1.124 +	virtual void SetYuvToYuvOptionsL(const TYuvFormat& aInputFormat, const TYuvFormat& aOutputFormat) = 0;
   1.125 +
   1.126 +	/**
   1.127 +	Sets the pre-processing types to be used.
   1.128 +
   1.129 +	@param	"aPreProcessTypes"	"The pre-processing steps to perform, a bitwise OR of values from
   1.130 +								TPrePostProcessType."
   1.131 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.132 +				- KErrNotSupported - The pre-processing combination is not supported"
   1.133 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.134 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.135 +	*/
   1.136 +	virtual void SetPreProcessTypesL(TUint32 aPreProcessTypes) = 0;
   1.137 +
   1.138 +	/**
   1.139 +	Sets pre-processing options for rotation.
   1.140 +
   1.141 +	@param	"aRotationType"	"The rotation to perform."
   1.142 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.143 +				- KErrNotSupported - The rotation type is not supported."
   1.144 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.145 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.146 +	*/
   1.147 +	virtual void SetRotateOptionsL(TRotationType aRotationType) = 0;
   1.148 +
   1.149 +	/**
   1.150 +	Sets pre-processing options for scaling.
   1.151 +
   1.152 +	@param	"aTargetSize"			"Target picture size. If a fixed scale factor size is used, the new 
   1.153 +									dimensions must be set to: 
   1.154 +										width=floor(factor*width), height=floor(factor*height). 
   1.155 +									For example, scaling a QCIF (176x144) picture up by a factor of 4/3 
   1.156 +									yields a size of 234x192."
   1.157 +	@param	"aAntiAliasFiltering"	"True if anti-aliasing filtering should be used. If the pre-processor 
   1.158 +									does not support anti-aliased scaling, or supports anti-aliased scaling
   1.159 +									only, this argument is ignored."
   1.160 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.161 +				- KErrNotSupported - The specified target size is not supported."
   1.162 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.163 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.164 +	*/
   1.165 +	virtual void SetScaleOptionsL(const TSize& aTargetSize, TBool aAntiAliasFiltering) = 0;
   1.166 +
   1.167 +	/**
   1.168 +	Sets pre-processing options for input cropping. Input cropping is typically used for digital zooming.
   1.169 +
   1.170 +	@param	"aRect"	"The input cropping rectangle specifying the area of the picture to use. The rectangle 
   1.171 +					must fit completely inside the input picture."
   1.172 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.173 +				- KErrNotSupported - The specified cropping rectangle is not supported."
   1.174 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.175 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.176 +	*/
   1.177 +	virtual void SetInputCropOptionsL(const TRect& aRect) = 0;
   1.178 +
   1.179 +	/**
   1.180 +	Sets pre-processing options for output cropping. Output cropping is performed after other 
   1.181 +	pre-processing operations but before output padding. Output cropping and padding can be used in 
   1.182 +	combination to prepare the picture size to suit the encoder, typically video encoders only support
   1.183 +	picture sizes that are multiples of 16 pixels.
   1.184 +
   1.185 +	@param	"aRect"	"The output cropping rectangle specifying the area of the picture to use. The 
   1.186 +					rectangle must fit completely inside the picture."
   1.187 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.188 +				- KErrNotSupported - The specified cropping rectangle is not supported."
   1.189 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.190 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.191 +	*/
   1.192 +	virtual void SetOutputCropOptionsL(const TRect& aRect) = 0;
   1.193 +
   1.194 +	/**
   1.195 +	Sets pre-processing options for output padding. Output padding is performed as the last pre-processing 
   1.196 +	operation, and typically used to prepare the picture size to suit the encoder. The image is padded with 
   1.197 +	black pixels.
   1.198 +
   1.199 +	@param	"aOutputSize"	"The padded output picture size. The output size must be large enough for the 
   1.200 +							picture in its new position."
   1.201 +	@param	"aPicturePos"	"The position for the original picture in the new padded picture. The original 
   1.202 +							picture in its new position must fit completely inside the new picture."
   1.203 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.204 +				- KErrNotSupported - The specified padding settings are not supported."
   1.205 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.206 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.207 +	*/
   1.208 +	virtual void SetOutputPadOptionsL(const TSize& aOutputSize, const TPoint& aPicturePos) = 0;
   1.209 +
   1.210 +	/**
   1.211 +	Sets color enhancement pre-processing options.
   1.212 +
   1.213 +	@param	"aOptions"	"Color enchancement options."
   1.214 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.215 +				- KErrNotSupported - The specified settings are not supported."
   1.216 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.217 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.218 +	*/
   1.219 +	virtual void SetColorEnhancementOptionsL(const TColorEnhancementOptions& aOptions) = 0;
   1.220 +
   1.221 +	/**
   1.222 +	Sets frame stabilisation options.
   1.223 +
   1.224 +	@param	"aOutputSize"			"Output picture size. The output picture size must be smaller than 
   1.225 +									or equal to the hardware device input picture size."
   1.226 +	@param	"aFrameStabilisation"	"True if frame stabilisation should be used. By default stabilisation is 
   1.227 +									not used."
   1.228 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.229 +				- KErrNotSupported - The specified settings are not supported."
   1.230 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.231 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.232 +	*/
   1.233 +	virtual void SetFrameStabilisationOptionsL(const TSize& aOutputSize, TBool aFrameStabilisation) = 0;
   1.234 +
   1.235 +	/**
   1.236 +	Sets custom implementation-specific pre-processing options.
   1.237 +
   1.238 +	@param	"aOptions"	"Post-processing options. The data format is implementation-specific."
   1.239 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.240 +				- KErrNotSupported - The options are not supported."
   1.241 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.242 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.243 +	*/
   1.244 +	virtual void SetCustomPreProcessOptionsL(const TDesC8& aOptions) = 0;
   1.245 +
   1.246 +	/**
   1.247 +	Initializes the device, and reserves hardware resources. If direct capture is used, this method also 
   1.248 +	prepares the camera API for capture by calling PrepareVideoCaptureL(). This method is asynchronous, 
   1.249 +	the device will call MMMFDevVideoRecordProxy::MdvrpInitializeComplete() after initialization has completed.
   1.250 +	Video capturing and encoding can be started with Start() with a relatively low delay since the hardware
   1.251 +	has already been set up.
   1.252 +
   1.253 +	Error handling: Errors are reported using the MdvrpInitializeComplete() callback method. Typical error 
   1.254 +	codes used:
   1.255 +		- KErrHardwareNotAvailable - Not enough free video processing hardware resources
   1.256 +		- KErrNotSupported - The current configuration is not supported.
   1.257 +	@pre	"This method can only be called before the hwdevice has been initialized."
   1.258 +	*/
   1.259 +	virtual void Initialize() = 0;
   1.260 +
   1.261 +	/**
   1.262 +	Commit all changes since the last CommitL(), Revert() or Initialize()
   1.263 +	to the hardware device.  This only applies to methods which can be called both
   1.264 +	before AND after DevVideoPlay has been initialized.
   1.265 +
   1.266 +	@see	CMMFVideoEncodeHwDevice::SetOutputRectL
   1.267 +	@see	CMMFVideoRecordHwDevice::SetPreProcessTypesL
   1.268 +	@see	CMMFVideoRecordHwDevice::SetRotateOptionsL
   1.269 +	@see	CMMFVideoRecordHwDevice::SetScaleOptionsL
   1.270 +	@see	CMMFVideoRecordHwDevice::SetInputCropOptionsL
   1.271 +	@see	CMMFVideoRecordHwDevice::SetOutputCropOptionsL
   1.272 +	@see	CMMFVideoRecordHwDevice::SetOutputPadOptionsL
   1.273 +	@see	CMMFVideoRecordHwDevice::SetColorEnhancementOptionsL
   1.274 +	@see	CMMFVideoRecordHwDevice::SetFrameStabilisationOptionsL
   1.275 +	@see	CMMFVideoRecordHwDevice::SetCustomPreProcessOptionsL
   1.276 +	@see	CMMFVideoEncodeHwDevice::SetCodingStandardSpecificOptionsL
   1.277 +	@see	CMMFVideoEncodeHwDevice::SetImplementationSpecificEncoderOptionsL
   1.278 +
   1.279 +	@leave  "The method will leave if an error occurs."
   1.280 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.281 +	*/
   1.282 +	virtual void CommitL() = 0;
   1.283 +
   1.284 +	/**
   1.285 +	Revert all changes since the last CommitL(), Revert() or Initialize()
   1.286 +	back to their previous settings.  This only applies to methods which can 
   1.287 +	be called both before AND after DevVideoPlay has been initialized.
   1.288 +
   1.289 +	@see	CMMFVideoEncodeHwDevice::SetOutputRectL
   1.290 +	@see	CMMFVideoRecordHwDevice::SetPreProcessTypesL
   1.291 +	@see	CMMFVideoRecordHwDevice::SetRotateOptionsL
   1.292 +	@see	CMMFVideoRecordHwDevice::SetScaleOptionsL
   1.293 +	@see	CMMFVideoRecordHwDevice::SetInputCropOptionsL
   1.294 +	@see	CMMFVideoRecordHwDevice::SetOutputCropOptionsL
   1.295 +	@see	CMMFVideoRecordHwDevice::SetOutputPadOptionsL
   1.296 +	@see	CMMFVideoRecordHwDevice::SetColorEnhancementOptionsL
   1.297 +	@see	CMMFVideoRecordHwDevice::SetFrameStabilisationOptionsL
   1.298 +	@see	CMMFVideoRecordHwDevice::SetCustomPreProcessOptionsL
   1.299 +	@see	CMMFVideoEncodeHwDevice::SetCodingStandardSpecificOptionsL
   1.300 +	@see	CMMFVideoEncodeHwDevice::SetImplementationSpecificEncoderOptionsL
   1.301 +
   1.302 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.303 +	*/
   1.304 +	virtual void Revert() = 0;
   1.305 +
   1.306 +	/**
   1.307 +	Writes an uncompressed input picture. When the picture has been used, it must be returned to the client
   1.308 +	with MMMFDevVideoRecordProxy::MdvrpReturnPicture(). This method must not be called if direct capture is 
   1.309 +	used.
   1.310 +
   1.311 +	@param	"aPicture"	"The picture to write."
   1.312 +	@leave	"The method will leave if an error occurs."
   1.313 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.314 +	*/
   1.315 +	virtual void WritePictureL(TVideoPicture* aPicture) = 0;
   1.316 +
   1.317 +	/**
   1.318 +	Notifies the hardware device that the end of input data has been reached and no more input pictures
   1.319 +	will be written. The hardware device can use this signal to ensure that the remaining data gets 
   1.320 +	processed, without waiting for new data. After the remaining data has been processed, the hardware
   1.321 +	device must call the proxy callback MdvrpStreamEnd().
   1.322 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.323 +	*/
   1.324 +	virtual void InputEnd() = 0;
   1.325 +
   1.326 +	/**
   1.327 +	Starts recording video. This includes capturing pictures from the camera (if direct capture is used), 
   1.328 +	pre-processing and encoding. Recording will proceed until it is stopped or paused. Initally recording 
   1.329 +	is stopped.
   1.330 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.331 +	*/
   1.332 +	virtual void Start() = 0;
   1.333 +
   1.334 +	/**
   1.335 +	Stops recording video. No new pictures will be captured, pre-processed, or encoded. If input pictures
   1.336 +	are written while recording is stopped, they will be returned immediately.
   1.337 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.338 +	*/
   1.339 +	virtual void Stop() = 0;
   1.340 +
   1.341 +	/**
   1.342 +	Pauses video recording. Recording can be resumed using Resume().
   1.343 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.344 +	*/
   1.345 +	virtual void Pause() = 0;
   1.346 +
   1.347 +	/**
   1.348 +	Resumes video recording after a pause.
   1.349 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.350 +	*/
   1.351 +	virtual void Resume() = 0;
   1.352 +
   1.353 +	/**
   1.354 +	Freezes the input picture. Normal encoding can be continued using ReleaseFreeze().
   1.355 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.356 +	*/
   1.357 +	virtual void Freeze() = 0;
   1.358 +
   1.359 +	/**
   1.360 +	Releases a frozen input picture. Video capturing and encoding continues normally.
   1.361 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.362 +	*/
   1.363 +	virtual void ReleaseFreeze() = 0;
   1.364 +
   1.365 +	/**
   1.366 +	Returns the current recording position. The position is the capture timestamp from the latest input 
   1.367 +	picture, or the capture timestamp for the latest picture captured from the camera when direct capture
   1.368 +	is used.
   1.369 +
   1.370 +	@return	"The current recording position."
   1.371 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.372 +	*/
   1.373 +	virtual TTimeIntervalMicroSeconds RecordingPosition() = 0;
   1.374 +
   1.375 +	/**
   1.376 +	Reads various counters related to processed video pictures. See the definition of TPictureCounters
   1.377 +	for a description of the counters. The counters are reset when Initialize() or this method is called,
   1.378 +	and thus they only include pictures processed since the last call.
   1.379 +
   1.380 +	@param	"aCounters"	"The counter structure to fill."
   1.381 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.382 +	*/
   1.383 +	virtual void GetPictureCounters(CMMFDevVideoRecord::TPictureCounters& aCounters) = 0;
   1.384 +
   1.385 +	/**
   1.386 +	Reads the frame stabilisation output picture position. This information can be used for positioning the
   1.387 +	viewfinder. The position returned is the stabilisation result for the most recent input picture.
   1.388 +
   1.389 +	@param	""aRect	"The position of the stabilisation output picture inside the input picture. If frame 
   1.390 +					stabilisation is not used, the rectangle is set to cover the entire input picture."
   1.391 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.392 +	*/
   1.393 +	virtual void GetFrameStabilisationOutput(TRect& aRect) = 0;
   1.394 +
   1.395 +	/**
   1.396 +	Retrieves the number of complexity control levels available for this hardware device. Devices can 
   1.397 +	support processing the same input data with different computational complexity levels. The complexity
   1.398 +	level can affect, for example, the motion vector search range used in an encoder.
   1.399 +
   1.400 +	@return	"The number of complexity control levels available, one if multiple levels are not supported."
   1.401 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.402 +	*/
   1.403 +	virtual TUint NumComplexityLevels() = 0;
   1.404 +
   1.405 +	/**
   1.406 +	Sets the complexity level to use for video processing in a hardware device. The level can be changed 
   1.407 +	at any time.
   1.408 +
   1.409 +	@param	"aLevel"	"The computational complexity level to use. Level zero (0) is the most complex one, 
   1.410 +						with the highest quality. Higher level numbers require less processing and may have
   1.411 +						lower quality."
   1.412 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.413 +	*/
   1.414 +	virtual void SetComplexityLevel(TUint aLevel) = 0;
   1.415 +	};
   1.416 +
   1.417 +
   1.418 +/**
   1.419 +CMMFVideoEncodeHwDevice is the MSL video encoder hardware device interface. All video encoders must 
   1.420 +implement this interface.
   1.421 +@publishedAll
   1.422 +@released
   1.423 +*/
   1.424 +class CMMFVideoEncodeHwDevice : public CMMFVideoRecordHwDevice
   1.425 +	{
   1.426 +public:
   1.427 +	/**
   1.428 +	Creates a new video encoder hardware device object, based on the implementation UID.
   1.429 +
   1.430 +	@param	"aUid"		"Encoder implementation UID."
   1.431 +	@param	"aProxy"	"The proxy implementation to use."
   1.432 +	@return	"A new CMMFVideoEncodeHwDevice object."
   1.433 +	@leave	"This method will leave if an error occurs."
   1.434 +	*/
   1.435 +	IMPORT_C static CMMFVideoEncodeHwDevice* NewL(TUid aUid, MMMFDevVideoRecordProxy& aProxy);
   1.436 +
   1.437 +	/**
   1.438 +	Creates a new video encoder hardware device adapter object, based on the Interface Implementation of a Processing Unit.
   1.439 +
   1.440 +	@param	"aImplInfo"	"The registration data relating to the Interface Implementation of the Processing Unit."
   1.441 +	@param	"aProxy"	"The proxy implementation to use."
   1.442 +	@return	"A new CMMFVideoEncodeHwDevice object."
   1.443 +	@leave	"This method will leave if an error occurs."
   1.444 +	*/
   1.445 +	IMPORT_C static CMMFVideoEncodeHwDevice* NewPuAdapterL(const CImplementationInformation& aImplInfo, MMMFDevVideoRecordProxy& aProxy);
   1.446 +
   1.447 +	/**
   1.448 +	Destructor.
   1.449 +	*/
   1.450 +	IMPORT_C virtual ~CMMFVideoEncodeHwDevice();
   1.451 +
   1.452 +	/**
   1.453 +	Retrieves information about the video encoder.
   1.454 +
   1.455 +	@return	"Encoder information as a CVideoEncoderInfo object. The object is pushed to the cleanup stack,
   1.456 +			and must be deallocated by the caller."
   1.457 +	@leave	"This method will leave if an error occurs."
   1.458 +	*/
   1.459 +	virtual CVideoEncoderInfo* VideoEncoderInfoLC() = 0;
   1.460 +
   1.461 +	/**
   1.462 +	Sets the encoder output format. The picture size depends on the input data format and possible 
   1.463 +	scaling performed.
   1.464 +
   1.465 +	@param	"aFormat"				"The video format to use."
   1.466 +	@param	"aDataUnitType"			"The type of output coded data units."
   1.467 +	@param	"aDataEncapsulation"	"Data encapsulation type for output encoded data units."
   1.468 +	@param	"aSegmentationAllowed"	"True if a coded data unit can be segmented into multiple output buffers
   1.469 +									if a single buffer is not large enough."
   1.470 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.471 +				- KErrNotSupported - The format specified is not supported."
   1.472 +	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
   1.473 +	*/
   1.474 +	virtual void SetOutputFormatL(const CCompressedVideoFormat& aFormat, 
   1.475 +								  TVideoDataUnitType aDataUnitType, 
   1.476 +								  TVideoDataUnitEncapsulation aDataEncapsulation,
   1.477 +								  TBool aSegmentationAllowed=EFalse) = 0;
   1.478 +
   1.479 +	/**
   1.480 +	Sets the pre-processor device that will write data to this encoder. Uncompressed pictures will be 
   1.481 +	written with WritePictureL() or through a custom interface. After pictures have been processed, 
   1.482 +	they must be returned to the pre-processor using ReturnPicture().
   1.483 +
   1.484 +	@param	"aDevice"	"The input pre-processor device to use."
   1.485 +	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
   1.486 +	*/
   1.487 +	virtual void SetInputDevice(CMMFVideoPreProcHwDevice* aDevice) = 0;
   1.488 +
   1.489 +	/**
   1.490 +	Sets the number of bit-rate scalability layers to use. Set to 1 to disable layered scalability. 
   1.491 +
   1.492 +	Bit-rate scalability refers to the ability of a coded stream to be decoded at different bit-rates. 
   1.493 +	Scalable video is typically ordered into hierarchical layers of data. A base layer contains an 
   1.494 +	individual representation of a video stream and enhancement layers contain refinement data in addition
   1.495 +	to the base layer. The quality of the decoded video stream progressively improves as enhancement layers
   1.496 +	are added to the base layer.
   1.497 +
   1.498 +	@param	"aNumLayers"	"The number of bit-rate scalability layers to use, set to 1 to disable 
   1.499 +							scalability."
   1.500 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.501 +				- KErrNotSupported - The scalability layers are not supported or too many layers specified."
   1.502 +	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
   1.503 +	*/
   1.504 +	virtual void SetNumBitrateLayersL(TUint aNumLayers) = 0;
   1.505 +
   1.506 +	/**
   1.507 +	Sets the scalability type for a bit-rate scalability layer.
   1.508 +
   1.509 +	@param	"aLayer"			"Layer number. Layers are numbered [0...n-1], where n is the number of layers
   1.510 +	available. The				first layer is the base layer, it can be decoded independently from the other
   1.511 +								layers, and it has the lowest total bitrate."
   1.512 +	@param	"aScalabilityType"	"Layer scalability type."
   1.513 +	@leave	" The method will leave if an error occurs. Typical error codes used:
   1.514 +				- KErrNotSupported - The scalability layers or the specified scalability type are not 
   1.515 +									 supported."
   1.516 +	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
   1.517 +	*/
   1.518 +	virtual void SetScalabilityLayerTypeL(TUint aLayer, TScalabilityType aScalabilityType) = 0;
   1.519 +
   1.520 +	/**
   1.521 +	Sets the reference picture options to be used for all scalability layers. The settings can be overridden
   1.522 +	for an individual scalability layer by using SetLayerReferenceOptions().
   1.523 +
   1.524 +	@param	"aMaxReferencePictures"	"The maximum number of reference pictures to be used. More than one 
   1.525 +									reference frame can be used in the H.264 | MPEG-4 AVC and in some 
   1.526 +									advanced profiles of MPEG-4 Part 2 and H.263. The minimum value is one."
   1.527 +	@param	"aMaxPictureOrderDelay"	"The maximum picture order delay, in number of pictures. This specifies
   1.528 +									the maximum amount of  pictures that precede any picture in the sequence
   1.529 +									in decoding order and follow the picture in presentation order. Pictures
   1.530 +									may be coded/decoded in different order from their capture/display order.
   1.531 +									Thus, decoded pictures have to be buffered to order them in correct 
   1.532 +									display order. For example, if one conventional B picture is coded 
   1.533 +									between P pictures, a one-picture display ordering delay has to be 
   1.534 +									applied in the decoder. The minimum value is zero, which indicates 
   1.535 +									that pictures must be coded in capture/display order."
   1.536 +	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
   1.537 +	*/
   1.538 +	virtual void SetGlobalReferenceOptions(TUint aMaxReferencePictures, TUint aMaxPictureOrderDelay) = 0;
   1.539 +
   1.540 +	/**
   1.541 +	Sets the reference picture options to be used for a single scalability layer. These settings override 
   1.542 +	those set with SetGlobalReferenceOptions().
   1.543 +
   1.544 +	@param	"aLayer"				"Layer number."
   1.545 +	@param	"aMaxReferencePictures"	"The maximum number of reference pictures to be used."
   1.546 +	@param	"aMaxPictureOrderDelay"	"The maximum picture order delay, in number of pictures."
   1.547 +	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
   1.548 +	*/
   1.549 +	virtual void SetLayerReferenceOptions(TUint aLayer, TUint aMaxReferencePictures, TUint aMaxPictureOrderDelay) = 0;
   1.550 +
   1.551 +	/**
   1.552 +	Sets encoder buffering options.
   1.553 +
   1.554 +	@param	"aOptions"	"The buffering options."
   1.555 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.556 +				- KErrNotSupported - The specified settings are not supported."
   1.557 +	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
   1.558 +	*/
   1.559 +	virtual void SetBufferOptionsL(const TEncoderBufferOptions& aOptions) = 0;
   1.560 +
   1.561 +	/**
   1.562 +	Sets the encoder output rectangle. This rectangle specifies the part of the input and output pictures 
   1.563 +	which is displayed after encoding. Many video codecs process data in 16x16 pixel units but enable 
   1.564 +	specifying and coding the encoder output rectangle for image sizes that are not multiple of 16 pixels 
   1.565 +	(e.g 160x120).
   1.566 +
   1.567 +	@param	"aRect"	"The encoder output rectangle."
   1.568 +	@leave	"The method will leave if an error occurs."
   1.569 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.570 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.571 +	*/
   1.572 +	virtual void SetOutputRectL(const TRect& aRect) = 0;
   1.573 +
   1.574 +	/**
   1.575 +	Sets whether bit errors or packets losses can be expected in the video transmission. The video encoder 
   1.576 +	can use this information to optimize the bitstream.
   1.577 +
   1.578 +	@param	"aBitErrors"	"True if bit errors can be expected."
   1.579 +	@param	"aPacketLosses"	"True if packet losses can be expected."
   1.580 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.581 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.582 +	*/
   1.583 +	virtual void SetErrorsExpected(TBool aBitErrors, TBool aPacketLosses) = 0;
   1.584 +
   1.585 +	/**
   1.586 +	Sets the minimum frequency (in time) for instantaneous random access points in the bitstream. An 
   1.587 +	instantaneous random access point is such where the decoder can achieve a full output picture 
   1.588 +	immediately by decoding data starting from the random access point. The random access point frequency 
   1.589 +	may be higher than signalled, if the sequence contains scene cuts which typically cause a coding 
   1.590 +	of a random access point.
   1.591 +
   1.592 +	@param	"aRate"	"Random access point rate, in pictures per second. For example, to request a random 
   1.593 +					access point every ten seconds, set the value to 0.1."
   1.594 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.595 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.596 +	*/
   1.597 +	virtual void SetMinRandomAccessRate(TReal aRate) = 0;
   1.598 +
   1.599 +	/**
   1.600 +	Sets coding-standard specific encoder options.
   1.601 +
   1.602 +	@param	"aOptions"	"The options to use. The data format for the options is coding-standard specific, 
   1.603 +						and defined separately."
   1.604 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.605 +				- KErrNotSupported - The specified settings are not supported."
   1.606 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.607 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.608 +	*/
   1.609 +	virtual void SetCodingStandardSpecificOptionsL(const TDesC8& aOptions) = 0;
   1.610 +
   1.611 +	/**
   1.612 +	Sets implementation-specific encoder options.
   1.613 +
   1.614 +	@param	"aOptions"	"The options to use. The data format for the options is specific to the encoder 
   1.615 +						implementation, and defined separately by the encoder implementer."
   1.616 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.617 +				- KErrNotSupported - The specified settings are not supported."
   1.618 +	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.619 +			If called after initialization, the change must only be committed when CommitL() is called."
   1.620 +	*/
   1.621 +	virtual void SetImplementationSpecificEncoderOptionsL(const TDesC8& aOptions) = 0;
   1.622 +
   1.623 +	/**
   1.624 +	Returns coding-standard specific initialization output from the encoder. The information can contain, 
   1.625 +	for example, the MPEG-4 VOL header. This method can be called after Initialize() has been called.
   1.626 +
   1.627 +	@return	"Coding-standard specific initialization output. The data format is coding-standard specific 
   1.628 +			and defined separately. The buffer is pushed to the cleanup stack, and the caller is responsible
   1.629 +			for deallocating it."
   1.630 +	@leave	"The method will leave if an error occurs."
   1.631 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.632 +	*/
   1.633 +	virtual HBufC8* CodingStandardSpecificInitOutputLC() = 0;
   1.634 +
   1.635 +	/**
   1.636 +	Returns implementation-specific initialization output from the encoder. This method can be called after
   1.637 +	Initialize() has been called.
   1.638 +
   1.639 +	@return	"Implementation-specific initialization output. The data format is specific to the encoder 
   1.640 +			implementation, and defined by the encoder supplier. The buffer is pushed to the cleanup stack,
   1.641 +			and the caller is responsible for deallocating it."
   1.642 +	@leave	"The method will leave if an error occurs."
   1.643 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.644 +	*/
   1.645 +	virtual HBufC8* ImplementationSpecificInitOutputLC() = 0;
   1.646 +
   1.647 +	/**
   1.648 +	Sets the number of unequal error protection levels. By default unequal error protection is not used.
   1.649 +
   1.650 +	@param	"aNumLevels"		"The number of unequal error protection levels. To disable unequal error
   1.651 +								protection, set this value to one"
   1.652 +	@param	"aSeparateBuffers"	"True if each unequal error protection level of a coded data unit shall be
   1.653 +								encapsulated in its own output buffer. Ignored if unequal error protection
   1.654 +								is not used."
   1.655 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.656 +				- KErrNotSupported - Unequal error protection is not supported."
   1.657 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.658 +	*/
   1.659 +	virtual void SetErrorProtectionLevelsL(TUint aNumLevels, TBool aSeparateBuffers) = 0;
   1.660 +
   1.661 +	/**
   1.662 +	Sets up an unequal error protection level. If unequal error protection is not used, this method can be
   1.663 +	used to control settings for the whole encoded bitstream.
   1.664 +
   1.665 +	@param	"aLevel"	"Error protection level number. This argument is ignored if unequal error protection
   1.666 +						is not in use."
   1.667 +	@param	"aBitrate"	"Target bit-rate for this error protection level."
   1.668 +	@param	"aStrength"	"Forward error control strength for this error protection level. The strength
   1.669 +						can be specified using values from TErrorControlStrength (EFecStrengthNone, 
   1.670 +						EFecStrengthLow, EFecStrengthNormal, EFecStrengthHigh), or with intermediate 
   1.671 +						values between those constants."
   1.672 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.673 +				- KErrNotSupported - The specified bit-rate cannot be supported. "
   1.674 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.675 +	*/
   1.676 +	virtual void SetErrorProtectionLevelL(TUint aLevel, TUint aBitrate, TUint aStrength) = 0;
   1.677 +
   1.678 +	/**
   1.679 +	Sets the expected or prevailing channel conditions for an unequal error protection level, in terms of 
   1.680 +	expected packet loss rate. The video encoder can use this information to optimize the generated bitstream.
   1.681 +
   1.682 +	@param	"aLevel"			"Error protection level number. This argument is ignored if unequal error 
   1.683 +								protection is not in use."
   1.684 +	@param	"aLossRate"			"Packet loss rate, in number of packets lost per second. Set to 0.0 if
   1.685 +								packet losses are not expected."
   1.686 +	@param	"aLossBurstLength"	"Expected average packet loss burst length. Set to zero if the information is 
   1.687 +								not available."
   1.688 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.689 +	*/
   1.690 +	virtual void SetChannelPacketLossRate(TUint aLevel, 
   1.691 +										  TReal aLossRate, 
   1.692 +										  TTimeIntervalMicroSeconds32 aLossBurstLength) = 0;
   1.693 +
   1.694 +	/**
   1.695 +	Sets the expected or prevailing channel conditions for an unequal error protection level, in terms of 
   1.696 +	expected bit error rate. The video encoder can use this information to optimize the generated bitstream.
   1.697 +
   1.698 +	@param	"aLevel"		"Error protection level number. This argument is ignored if unequal error 
   1.699 +							protection is not in use."
   1.700 +	@param	"aErrorRate"	"Expected bit error rate, as a fraction of the total bits transmitted. Set 
   1.701 +							to 0.0 if bit errors are not expected."
   1.702 +	@param	"aStdDeviation"	"Expected bit error rate standard deviation."
   1.703 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.704 +	*/
   1.705 +	virtual void SetChannelBitErrorRate(TUint aLevel, TReal aErrorRate, TReal aStdDeviation) = 0;
   1.706 +
   1.707 +	/**
   1.708 +	Sets the target size of each coded video segment. The segment target size can be specified in terms of 
   1.709 +	number of bytes per segment, number of macroblocks per segment, or both.
   1.710 +
   1.711 +	@param	"aLayer"			"Layer number. Layers are numbered [0...n-1], where n is the number of 
   1.712 +								layers available. Use zero if layered bit-rate scalability is not used."
   1.713 +	@param	"aSizeBytes"		"Segment target size in bytes. Set to zero to use unlimited segment size. The
   1.714 +								segment size in bytes should include all data that is typically stored or
   1.715 +								transmitted for each segment in the format currently in use. This includes all
   1.716 +								related headers."
   1.717 +	@param	"aSizeMacroblocks"	"Segment target size in number of macroblocks per segment. Set to zero to
   1.718 +								use unlimited segment size."
   1.719 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.720 +	*/
   1.721 +	virtual void SetSegmentTargetSize(TUint aLayer, TUint aSizeBytes, TUint aSizeMacroblocks) = 0;
   1.722 +
   1.723 +	/**
   1.724 +	Sets the bit-rate control options for a layer. If layered bit-rate scalability is not used, the options
   1.725 +	are set for the whole bitstream.
   1.726 +
   1.727 +	@param	"aLayer"	"Layer number. Layers are numbered [0...n-1], where n is the number of layers 
   1.728 +						available. Use zero if layered bit-rate scalability is not used."
   1.729 +	@param	"aOptions"	"Bit-rate control options."
   1.730 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.731 +	*/
   1.732 +	virtual void SetRateControlOptions(TUint aLayer, const TRateControlOptions& aOptions) = 0;
   1.733 +
   1.734 +	/**
   1.735 +	Sets in-layer scalability options for a layer. In-layer bit-rate scalability refers to techniques where
   1.736 +	a specific part of a single-layer coded stream can be decoded correctly without decoding the leftover 
   1.737 +	part. For example, B-pictures can be used for this. By default in-layer scalability is not used.
   1.738 +
   1.739 +	@param	"aLayer"			"Layer number. Layers are numbered [0…n-1], where n is the number of layers
   1.740 +								available. Use zero if layered bit-rate scalability is not used."
   1.741 +	@param	"aNumSteps"			"The number of in-layer scalability steps to use. Set to one to disable 
   1.742 +								in-layer scalability."
   1.743 +	@param	"aScalabilityType"	"The scalability type to use."
   1.744 +	@param	"aBitrateShare"		"Bit-rate share for each scalability step. The bit-rate shares are defined 
   1.745 +								as fractions of total layer bit-rate, with the share for one layer being 
   1.746 +								aBitrateShare[i]/sum(aBitrateShare). For example, to use 2/3 of the total
   1.747 +								bitrate for the first layer and the remaining 1/3 for the second, the array
   1.748 +								contents would be {2,1}."
   1.749 +	@param	"aPictureShare"		"Picture rate share for each scalability step. The picture rate shares are 
   1.750 +								defined similarly to the bit-rate shares. For example, a client wishing to
   1.751 +								use two B-pictures between each pair of reference pictures should set the 
   1.752 +								array contents to {1,2}."
   1.753 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.754 +				- KErrNotSupported	- In-layer scalability is not supported.
   1.755 +				- KErrArgument		- Some of the arguments are out of range. For example, it is not
   1.756 +									  possible to use the specified in-layer scalability setup due to other 
   1.757 +									  constraints (such as the maximum picture order delay)."
   1.758 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.759 +	*/
   1.760 +	virtual void SetInLayerScalabilityL(TUint aLayer, 
   1.761 +										TUint aNumSteps,
   1.762 +										TInLayerScalabilityType aScalabilityType,
   1.763 +										const TArray<TUint>& aBitrateShare,
   1.764 +										const TArray<TUint>& aPictureShare) = 0;
   1.765 +
   1.766 +	/**
   1.767 +	Sets the period for layer promotions points for a scalability layer. A layer promotion point is a 
   1.768 +	picture where it is possible to start decoding this enhancement layer if only the lower layers were 
   1.769 +	decoded earlier.
   1.770 +
   1.771 +	@param	"aLayer"	"Layer number."
   1.772 +	@param	"aPeriod"	"Layer promotion point period. A value of one signals that each picture should be a
   1.773 +						layer promotion point, value two that there is one picture between each promotion
   1.774 +						point etc."
   1.775 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.776 +	*/
   1.777 +	virtual void SetLayerPromotionPointPeriod(TUint aLayer, TUint aPeriod) = 0;
   1.778 +
   1.779 +	/**
   1.780 +	Returns coding-standard specific settings output from the encoder. The information can contain, for 
   1.781 +	example, some bitstream headers that can change based on settings modified while encoding is in progress.
   1.782 +
   1.783 +	@return	"Coding-standard specific initialization output. The data format is coding-standard specific 
   1.784 +			and defined separately. The buffer is pushed to the cleanup stack, and the caller is responsible 
   1.785 +			for deallocating it."
   1.786 +	@leave	"The method will leave if an error occurs."
   1.787 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.788 +	*/
   1.789 +	virtual HBufC8* CodingStandardSpecificSettingsOutputLC() = 0;
   1.790 +
   1.791 +	/**
   1.792 +	Returns implementation-specific settings output from the encoder. The information can contain, for
   1.793 +	example, some bitstream headers that can change based on settings modified while encoding is in progress.
   1.794 +
   1.795 +	@return	"Implementation-specific initialization output. The data format is implementation-specific and 
   1.796 +			defined separately by the encoder supplier. The buffer is pushed to the cleanup stack, and the
   1.797 +			caller is responsible for deallocating it."
   1.798 +	@leave	"The method will leave if an error occurs."
   1.799 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.800 +	*/
   1.801 +	virtual HBufC8* ImplementationSpecificSettingsOutputLC() = 0;
   1.802 +
   1.803 +	/**
   1.804 +	Requests the encoder to sends supplemental information in the bitstream. The information data format is 
   1.805 +	coding-standard dependent. Only one supplemental information send request can be active at a time. This
   1.806 +	variant encodes the information to the next possible picture.
   1.807 +
   1.808 +	The client must be notified after then information has been sent by calling 
   1.809 +	MMMFDevVideoRecordProxy::MdvrpSupplementalInfoSent().
   1.810 +
   1.811 +	@param	"aData"	"Supplemental information data to send."
   1.812 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.813 +				- KErrNotSupported - Supplemental information is not supported"
   1.814 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.815 +	*/
   1.816 +	virtual void SendSupplementalInfoL(const TDesC8& aData) = 0;
   1.817 +
   1.818 +	/**
   1.819 +	Requests the encoder to sends supplemental information in the bitstream. The information data format is
   1.820 +	coding-standard dependent. Only one supplemental information send request can be active at a time. This
   1.821 +	variant encodes the information to the picture specified.
   1.822 +
   1.823 +	@param	"aData"			"Supplemental information data to send."
   1.824 +	@param	"aTimestamp"	"Timestamp for the picture in which the supplemental information should be 
   1.825 +							included. If a picture with the matching timestamp is never encoded, or the
   1.826 +							timestamp is in the past, the supplemental information will not be sent."
   1.827 +	@leave	"The method will leave if an error occurs. Typical error codes used:
   1.828 +				- KErrNotSupported - Supplemental information is not supported"
   1.829 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.830 +	*/
   1.831 +	virtual void SendSupplementalInfoL(const TDesC8& aData, const TTimeIntervalMicroSeconds& aTimestamp) = 0;
   1.832 +
   1.833 +	/**
   1.834 +	Cancels the current supplemental information send request. The memory buffer reserved for supplemental 
   1.835 +	information data can be reused or deallocated after the method returns.
   1.836 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.837 +	*/
   1.838 +	virtual void CancelSupplementalInfo() = 0;
   1.839 +
   1.840 +	/**
   1.841 +	Gets the current output buffer status. The information includes the number of free output buffers and 
   1.842 +	the total size of free buffers in bytes.
   1.843 +
   1.844 +	@param	"aNumFreeBuffers"	"Target for the number of free output buffers."
   1.845 +	@param	"aTotalFreeBytes"	"Target for the total free buffer size in bytes."
   1.846 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.847 +	*/
   1.848 +	virtual void GetOutputBufferStatus(TUint& aNumFreeBuffers, TUint& aTotalFreeBytes) = 0;
   1.849 +
   1.850 +	/**
   1.851 +	Returns a used output buffer back to the encoder. The buffer can be reused or deallocated.
   1.852 +
   1.853 +	@param	"aBuffer"	"The buffer to return."
   1.854 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.855 +	*/
   1.856 +	virtual void ReturnBuffer(TVideoOutputBuffer* aBuffer) = 0;
   1.857 +
   1.858 +	/**
   1.859 +	Indicates a picture loss to the encoder, without specifying the lost picture. The encoder can react 
   1.860 +	to this by transmitting an intra-picture.
   1.861 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.862 +	*/
   1.863 +	virtual void PictureLoss() = 0;
   1.864 +
   1.865 +	/**
   1.866 +	Indicates to the encoder the pictures that have been lost. The encoder can react to this by
   1.867 +	transmitting an intra-picture.
   1.868 +	@param	"aPictures"	"Picture identifiers for the lost pictures."
   1.869 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.870 +	*/
   1.871 +	virtual void PictureLoss(const TArray<TPictureId>& aPictures) = 0;
   1.872 +
   1.873 +	/**
   1.874 +	Indicates a slice loss to the encoder.
   1.875 +
   1.876 +	@param	"aFirstMacroblock"	"The first lost macroblock. The macroblocks are numbered such
   1.877 +								that the macroblock in the upper left corner of the picture is considered 
   1.878 +								macroblock number 1 and the number for each macroblock increases from left
   1.879 +								to right and then from top to bottom in raster-scan order."
   1.880 +	@param	"aNumMacroblocks"	"The number of macroblocks in the lost slice."
   1.881 +	@param	"aPicture"			"The picture identified for the picture where the slice was lost. If the 
   1.882 +								picture is not known, aPicture.iIdType is set to ENone."
   1.883 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.884 +	*/
   1.885 +	virtual void SliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture) = 0;
   1.886 +
   1.887 +	/**
   1.888 +	Sends a reference picture selection request to the encoder. The request is delivered as a 
   1.889 +	coding-standard specific binary message. Reference picture selection can be used to select a previous
   1.890 +	correctly transmitted picture to use as a reference in case later pictures have been lost.
   1.891 +
   1.892 +	@param	"aSelectionData"	"The reference picture selection request message. The message format is 
   1.893 +								coding-standard specific, and defined separately."
   1.894 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.895 +	*/
   1.896 +	virtual void ReferencePictureSelection(const TDesC8& aSelectionData) = 0;
   1.897 +
   1.898 +protected:
   1.899 +	/**
   1.900 +	Constructor.
   1.901 +	*/
   1.902 +	IMPORT_C CMMFVideoEncodeHwDevice();
   1.903 +
   1.904 +	/**
   1.905 +	Set the proxy implementation to be used. Called just after the object is constructed.
   1.906 +	@param	"aProxy"	"The proxy to use."
   1.907 +	*/
   1.908 +	virtual void SetProxy(MMMFDevVideoRecordProxy& aProxy) = 0;
   1.909 +private:
   1.910 +	TUid iDtor_ID_Key;
   1.911 +	};
   1.912 +
   1.913 +
   1.914 +/**
   1.915 +CMMFVideoPreProcHwDevice is the MSL video pre-processor plug-in interface. All MSL video pre-processors 
   1.916 +must implement this interface.
   1.917 +@publishedAll
   1.918 +@released
   1.919 +*/
   1.920 +class CMMFVideoPreProcHwDevice : public CMMFVideoRecordHwDevice
   1.921 +	{
   1.922 +public:
   1.923 +	/**
   1.924 +	Creates a new video pre-processor hardware device object, based on the implementation UID.
   1.925 +	@param	"aUid"		"Pre-processor implementation UID."
   1.926 +	@param	"aProxy"	"The proxy implementation to use."
   1.927 +	@return	"A new CMMFVideoPreProcHwDevice object."
   1.928 +	@leave	"This method will leave if an error occurs."
   1.929 +	*/
   1.930 +	IMPORT_C static CMMFVideoPreProcHwDevice* NewL(TUid aUid, MMMFDevVideoRecordProxy& aProxy);
   1.931 +
   1.932 +	/**
   1.933 +	Destructor.
   1.934 +	*/
   1.935 +	IMPORT_C virtual ~CMMFVideoPreProcHwDevice();
   1.936 +
   1.937 +	/**
   1.938 +	Sets the device output format. The picture size depends on the input data format and possible 
   1.939 +	scaling performed.
   1.940 +
   1.941 +	@param	"aFormat"	"The video format to use."
   1.942 +	@leave	" The method will leave if an error occurs. Typical error codes used:
   1.943 +				- KErrNotSupported - The format specified is not supported."
   1.944 +	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
   1.945 +	*/
   1.946 +	virtual void SetOutputFormatL(const TUncompressedVideoFormat& aFormat) = 0;
   1.947 +
   1.948 +	/**
   1.949 +	Sets the video encoder device that will receive data from this pre-processor. Pre-processed pictures 
   1.950 +	will be written with WritePictureL() or through a custom interface, and the encoder will return used 
   1.951 +	pictures using ReturnPicture().
   1.952 +
   1.953 +	@param	"aDevice"	"The output encoder device to use."
   1.954 +	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
   1.955 +	*/
   1.956 +	virtual void SetOutputDevice(CMMFVideoEncodeHwDevice* aDevice) = 0;
   1.957 +
   1.958 +	/**
   1.959 +	Returns a used picture back to the pre-processor. Called by an encoder device when used as output 
   1.960 +	device from a pre-processor.
   1.961 +
   1.962 +	@param	"aPicture"	"The picture to return."
   1.963 +	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
   1.964 +	*/
   1.965 +	virtual void ReturnPicture(TVideoPicture* aPicture) = 0;
   1.966 +
   1.967 +protected:
   1.968 +	/**
   1.969 +	Constructor.
   1.970 +	*/
   1.971 +	IMPORT_C CMMFVideoPreProcHwDevice();
   1.972 +
   1.973 +	/**
   1.974 +	Set the proxy implementation to be used. Called just after the object is constructed.
   1.975 +	@param	"aProxy"	"The proxy to use."
   1.976 +	*/
   1.977 +	virtual void SetProxy(MMMFDevVideoRecordProxy& aProxy) = 0;
   1.978 +private:
   1.979 +	TUid iDtor_ID_Key;
   1.980 +	};
   1.981 +
   1.982 +#endif