williamr@2: // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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 williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef __VIDEORECORDHWDEVICE_H__ williamr@2: #define __VIDEORECORDHWDEVICE_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: /** williamr@2: A base class for all video recording (encoding and pre-processing) hardware devices. Since both encoders williamr@2: and pre-processors can implement pre-processing functionality, this class includes all pre-processing williamr@2: related methods. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class CMMFVideoRecordHwDevice : public CMMFVideoHwDevice williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Retrieves information about the pre-processing capabilities of this hardware device. williamr@2: williamr@2: @return "Pre-processor information as a CPreProcessorInfo object. The object is pushed to the williamr@2: cleanup stack, and must be deallocated by the client." williamr@2: @leave "The method will leave if an error occurs." williamr@2: */ williamr@2: virtual CPreProcessorInfo* PreProcessorInfoLC() = 0; williamr@2: williamr@2: /** williamr@2: Sets the hardware device input format. If both a pre-processor and an encoder are used, the williamr@2: pre-processor output format and the encoder input format must be the same. The input format for williamr@2: the first device in the system is the input format for video input data. The method has to be called williamr@2: for both direct capture as well as memory buffer input. williamr@2: williamr@2: @param "aFormat" "The input format to use." williamr@2: @param "aPictureSize" "The input picture size in pixels." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The input format specified is not supported." williamr@2: @pre "This method may only be called before the hwdevice has been initialized using Initialize()." williamr@2: */ williamr@2: virtual void SetInputFormatL(const TUncompressedVideoFormat& aFormat, const TSize& aPictureSize) = 0; williamr@2: williamr@2: /** williamr@2: Sets the data source to be a camera, and sets the device to use direct capture for input. williamr@2: williamr@2: @param "aCameraHandle" "A camera handle for the camera to use. The handle is passed williamr@2: to CCamera::NewDuplicateL() in the camera API " williamr@2: @param "aPictureRate" "Video capture picture rate." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - Direct capture is not supported or the picture rate specified is not williamr@2: supported." williamr@2: @pre "This method may only be called before the hwdevice has been initialized using Initialize()." williamr@2: */ williamr@2: virtual void SetSourceCameraL(TInt aCameraHandle, TReal aPictureRate) = 0; williamr@2: williamr@2: /** williamr@2: Sets the data source to be memory buffers. williamr@2: williamr@2: @param "aMaxPictureRate" "The maximum picture rate for input pictures." williamr@2: @param "aConstantPictureRate" "True if the input picture rate is constant. In that case, williamr@2: aMaxPictureRate specifies the picture rate." williamr@2: @param "aProcessRealtime" "True if real-time processing is needed, false if not. Real-time williamr@2: processing is typically neede for video recording applications, while williamr@2: video conversion and off-line processing applications do not require it." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The picture rate specified is not supported." williamr@2: @pre "This method may only be called before the hwdevice has been initialized using Initialize()." williamr@2: */ williamr@2: virtual void SetSourceMemoryL(TReal aMaxPictureRate, TBool aConstantPictureRate, TBool aProcessRealtime) = 0; williamr@2: williamr@2: /** williamr@2: Sets the clock source to use for video timing. When video recording is synchronized with audio, williamr@2: the clock source is implemented by the audio playback subsystem, otherwise the clock source should williamr@2: get the time from the system clock. williamr@2: williamr@2: If no clock source is set, video recording will not be synchronized, but will proceed as fast as williamr@2: possible, depending on input data and output buffer availability. If direct capturing is used without williamr@2: a clock source, the timestamps in the output data may not be valid. williamr@2: williamr@2: @param "aClock" "The clock source to use." williamr@2: @pre "This method may only be called before the hwdevice has been initialized using Initialize()." williamr@2: */ williamr@2: virtual void SetClockSource(MMMFClockSource* aClock) = 0; williamr@2: williamr@2: /** williamr@2: Sets pre-processing options for RGB to YUV color space conversion. By default, input RGB data is williamr@2: assumed to use the full value range ([0…255]), and the output YUV format is the hardware device output williamr@2: format, so typically calling this method is not necessary. williamr@2: williamr@2: @param "aRange" "Input RGB data range" williamr@2: @param "aOutputFormat" "Conversion output YUV format." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The formats specified are not supported" williamr@2: @pre "This method may only be called before the hwdevice has been initialized using Initialize()." williamr@2: */ williamr@2: virtual void SetRgbToYuvOptionsL(TRgbRange aRange, const TYuvFormat& aOutputFormat) = 0; williamr@2: williamr@2: /** williamr@2: Sets pre-processing options for YUV to YUV data format conversion. By default, the hardware device input williamr@2: and output data formats are used. For encoder devices, the device input format and a the closest matching williamr@2: format supported by the encoding process are used. Typically calling this method is not necessary. williamr@2: williamr@2: @param "aInputFormat" "Conversion input format." williamr@2: @param "aOutputFormat" "Conversion output format." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The formats specified are not supported" williamr@2: @pre "This method may only be called before the hwdevice has been initialized using Initialize()." williamr@2: */ williamr@2: virtual void SetYuvToYuvOptionsL(const TYuvFormat& aInputFormat, const TYuvFormat& aOutputFormat) = 0; williamr@2: williamr@2: /** williamr@2: Sets the pre-processing types to be used. williamr@2: williamr@2: @param "aPreProcessTypes" "The pre-processing steps to perform, a bitwise OR of values from williamr@2: TPrePostProcessType." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The pre-processing combination is not supported" williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetPreProcessTypesL(TUint32 aPreProcessTypes) = 0; williamr@2: williamr@2: /** williamr@2: Sets pre-processing options for rotation. williamr@2: williamr@2: @param "aRotationType" "The rotation to perform." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The rotation type is not supported." williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetRotateOptionsL(TRotationType aRotationType) = 0; williamr@2: williamr@2: /** williamr@2: Sets pre-processing options for scaling. williamr@2: williamr@2: @param "aTargetSize" "Target picture size. If a fixed scale factor size is used, the new williamr@2: dimensions must be set to: williamr@2: width=floor(factor*width), height=floor(factor*height). williamr@2: For example, scaling a QCIF (176x144) picture up by a factor of 4/3 williamr@2: yields a size of 234x192." williamr@2: @param "aAntiAliasFiltering" "True if anti-aliasing filtering should be used. If the pre-processor williamr@2: does not support anti-aliased scaling, or supports anti-aliased scaling williamr@2: only, this argument is ignored." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The specified target size is not supported." williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetScaleOptionsL(const TSize& aTargetSize, TBool aAntiAliasFiltering) = 0; williamr@2: williamr@2: /** williamr@2: Sets pre-processing options for input cropping. Input cropping is typically used for digital zooming. williamr@2: williamr@2: @param "aRect" "The input cropping rectangle specifying the area of the picture to use. The rectangle williamr@2: must fit completely inside the input picture." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The specified cropping rectangle is not supported." williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetInputCropOptionsL(const TRect& aRect) = 0; williamr@2: williamr@2: /** williamr@2: Sets pre-processing options for output cropping. Output cropping is performed after other williamr@2: pre-processing operations but before output padding. Output cropping and padding can be used in williamr@2: combination to prepare the picture size to suit the encoder, typically video encoders only support williamr@2: picture sizes that are multiples of 16 pixels. williamr@2: williamr@2: @param "aRect" "The output cropping rectangle specifying the area of the picture to use. The williamr@2: rectangle must fit completely inside the picture." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The specified cropping rectangle is not supported." williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetOutputCropOptionsL(const TRect& aRect) = 0; williamr@2: williamr@2: /** williamr@2: Sets pre-processing options for output padding. Output padding is performed as the last pre-processing williamr@2: operation, and typically used to prepare the picture size to suit the encoder. The image is padded with williamr@2: black pixels. williamr@2: williamr@2: @param "aOutputSize" "The padded output picture size. The output size must be large enough for the williamr@2: picture in its new position." williamr@2: @param "aPicturePos" "The position for the original picture in the new padded picture. The original williamr@2: picture in its new position must fit completely inside the new picture." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The specified padding settings are not supported." williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetOutputPadOptionsL(const TSize& aOutputSize, const TPoint& aPicturePos) = 0; williamr@2: williamr@2: /** williamr@2: Sets color enhancement pre-processing options. williamr@2: williamr@2: @param "aOptions" "Color enchancement options." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The specified settings are not supported." williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetColorEnhancementOptionsL(const TColorEnhancementOptions& aOptions) = 0; williamr@2: williamr@2: /** williamr@2: Sets frame stabilisation options. williamr@2: williamr@2: @param "aOutputSize" "Output picture size. The output picture size must be smaller than williamr@2: or equal to the hardware device input picture size." williamr@2: @param "aFrameStabilisation" "True if frame stabilisation should be used. By default stabilisation is williamr@2: not used." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The specified settings are not supported." williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetFrameStabilisationOptionsL(const TSize& aOutputSize, TBool aFrameStabilisation) = 0; williamr@2: williamr@2: /** williamr@2: Sets custom implementation-specific pre-processing options. williamr@2: williamr@2: @param "aOptions" "Post-processing options. The data format is implementation-specific." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The options are not supported." williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetCustomPreProcessOptionsL(const TDesC8& aOptions) = 0; williamr@2: williamr@2: /** williamr@2: Initializes the device, and reserves hardware resources. If direct capture is used, this method also williamr@2: prepares the camera API for capture by calling PrepareVideoCaptureL(). This method is asynchronous, williamr@2: the device will call MMMFDevVideoRecordProxy::MdvrpInitializeComplete() after initialization has completed. williamr@2: Video capturing and encoding can be started with Start() with a relatively low delay since the hardware williamr@2: has already been set up. williamr@2: williamr@2: Error handling: Errors are reported using the MdvrpInitializeComplete() callback method. Typical error williamr@2: codes used: williamr@2: - KErrHardwareNotAvailable - Not enough free video processing hardware resources williamr@2: - KErrNotSupported - The current configuration is not supported. williamr@2: @pre "This method can only be called before the hwdevice has been initialized." williamr@2: */ williamr@2: virtual void Initialize() = 0; williamr@2: williamr@2: /** williamr@2: Commit all changes since the last CommitL(), Revert() or Initialize() williamr@2: to the hardware device. This only applies to methods which can be called both williamr@2: before AND after DevVideoPlay has been initialized. williamr@2: williamr@2: @see CMMFVideoEncodeHwDevice::SetOutputRectL williamr@2: @see CMMFVideoRecordHwDevice::SetPreProcessTypesL williamr@2: @see CMMFVideoRecordHwDevice::SetRotateOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetScaleOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetInputCropOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetOutputCropOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetOutputPadOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetColorEnhancementOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetFrameStabilisationOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetCustomPreProcessOptionsL williamr@2: @see CMMFVideoEncodeHwDevice::SetCodingStandardSpecificOptionsL williamr@2: @see CMMFVideoEncodeHwDevice::SetImplementationSpecificEncoderOptionsL williamr@2: williamr@2: @leave "The method will leave if an error occurs." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void CommitL() = 0; williamr@2: williamr@2: /** williamr@2: Revert all changes since the last CommitL(), Revert() or Initialize() williamr@2: back to their previous settings. This only applies to methods which can williamr@2: be called both before AND after DevVideoPlay has been initialized. williamr@2: williamr@2: @see CMMFVideoEncodeHwDevice::SetOutputRectL williamr@2: @see CMMFVideoRecordHwDevice::SetPreProcessTypesL williamr@2: @see CMMFVideoRecordHwDevice::SetRotateOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetScaleOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetInputCropOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetOutputCropOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetOutputPadOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetColorEnhancementOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetFrameStabilisationOptionsL williamr@2: @see CMMFVideoRecordHwDevice::SetCustomPreProcessOptionsL williamr@2: @see CMMFVideoEncodeHwDevice::SetCodingStandardSpecificOptionsL williamr@2: @see CMMFVideoEncodeHwDevice::SetImplementationSpecificEncoderOptionsL williamr@2: williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void Revert() = 0; williamr@2: williamr@2: /** williamr@2: Writes an uncompressed input picture. When the picture has been used, it must be returned to the client williamr@2: with MMMFDevVideoRecordProxy::MdvrpReturnPicture(). This method must not be called if direct capture is williamr@2: used. williamr@2: williamr@2: @param "aPicture" "The picture to write." williamr@2: @leave "The method will leave if an error occurs." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void WritePictureL(TVideoPicture* aPicture) = 0; williamr@2: williamr@2: /** williamr@2: Notifies the hardware device that the end of input data has been reached and no more input pictures williamr@2: will be written. The hardware device can use this signal to ensure that the remaining data gets williamr@2: processed, without waiting for new data. After the remaining data has been processed, the hardware williamr@2: device must call the proxy callback MdvrpStreamEnd(). williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void InputEnd() = 0; williamr@2: williamr@2: /** williamr@2: Starts recording video. This includes capturing pictures from the camera (if direct capture is used), williamr@2: pre-processing and encoding. Recording will proceed until it is stopped or paused. Initally recording williamr@2: is stopped. williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void Start() = 0; williamr@2: williamr@2: /** williamr@2: Stops recording video. No new pictures will be captured, pre-processed, or encoded. If input pictures williamr@2: are written while recording is stopped, they will be returned immediately. williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void Stop() = 0; williamr@2: williamr@2: /** williamr@2: Pauses video recording. Recording can be resumed using Resume(). williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void Pause() = 0; williamr@2: williamr@2: /** williamr@2: Resumes video recording after a pause. williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void Resume() = 0; williamr@2: williamr@2: /** williamr@2: Freezes the input picture. Normal encoding can be continued using ReleaseFreeze(). williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void Freeze() = 0; williamr@2: williamr@2: /** williamr@2: Releases a frozen input picture. Video capturing and encoding continues normally. williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void ReleaseFreeze() = 0; williamr@2: williamr@2: /** williamr@2: Returns the current recording position. The position is the capture timestamp from the latest input williamr@2: picture, or the capture timestamp for the latest picture captured from the camera when direct capture williamr@2: is used. williamr@2: williamr@2: @return "The current recording position." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual TTimeIntervalMicroSeconds RecordingPosition() = 0; williamr@2: williamr@2: /** williamr@2: Reads various counters related to processed video pictures. See the definition of TPictureCounters williamr@2: for a description of the counters. The counters are reset when Initialize() or this method is called, williamr@2: and thus they only include pictures processed since the last call. williamr@2: williamr@2: @param "aCounters" "The counter structure to fill." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void GetPictureCounters(CMMFDevVideoRecord::TPictureCounters& aCounters) = 0; williamr@2: williamr@2: /** williamr@2: Reads the frame stabilisation output picture position. This information can be used for positioning the williamr@2: viewfinder. The position returned is the stabilisation result for the most recent input picture. williamr@2: williamr@2: @param ""aRect "The position of the stabilisation output picture inside the input picture. If frame williamr@2: stabilisation is not used, the rectangle is set to cover the entire input picture." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void GetFrameStabilisationOutput(TRect& aRect) = 0; williamr@2: williamr@2: /** williamr@2: Retrieves the number of complexity control levels available for this hardware device. Devices can williamr@2: support processing the same input data with different computational complexity levels. The complexity williamr@2: level can affect, for example, the motion vector search range used in an encoder. williamr@2: williamr@2: @return "The number of complexity control levels available, one if multiple levels are not supported." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual TUint NumComplexityLevels() = 0; williamr@2: williamr@2: /** williamr@2: Sets the complexity level to use for video processing in a hardware device. The level can be changed williamr@2: at any time. williamr@2: williamr@2: @param "aLevel" "The computational complexity level to use. Level zero (0) is the most complex one, williamr@2: with the highest quality. Higher level numbers require less processing and may have williamr@2: lower quality." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SetComplexityLevel(TUint aLevel) = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: CMMFVideoEncodeHwDevice is the MSL video encoder hardware device interface. All video encoders must williamr@2: implement this interface. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class CMMFVideoEncodeHwDevice : public CMMFVideoRecordHwDevice williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Creates a new video encoder hardware device object, based on the implementation UID. williamr@2: williamr@2: @param "aUid" "Encoder implementation UID." williamr@2: @param "aProxy" "The proxy implementation to use." williamr@2: @return "A new CMMFVideoEncodeHwDevice object." williamr@2: @leave "This method will leave if an error occurs." williamr@2: */ williamr@2: IMPORT_C static CMMFVideoEncodeHwDevice* NewL(TUid aUid, MMMFDevVideoRecordProxy& aProxy); williamr@2: williamr@2: /** williamr@2: Creates a new video encoder hardware device adapter object, based on the Interface Implementation of a Processing Unit. williamr@2: williamr@2: @param "aImplInfo" "The registration data relating to the Interface Implementation of the Processing Unit." williamr@2: @param "aProxy" "The proxy implementation to use." williamr@2: @return "A new CMMFVideoEncodeHwDevice object." williamr@2: @leave "This method will leave if an error occurs." williamr@2: */ williamr@2: IMPORT_C static CMMFVideoEncodeHwDevice* NewPuAdapterL(const CImplementationInformation& aImplInfo, MMMFDevVideoRecordProxy& aProxy); williamr@2: williamr@2: /** williamr@2: Destructor. williamr@2: */ williamr@2: IMPORT_C virtual ~CMMFVideoEncodeHwDevice(); williamr@2: williamr@2: /** williamr@2: Retrieves information about the video encoder. williamr@2: williamr@2: @return "Encoder information as a CVideoEncoderInfo object. The object is pushed to the cleanup stack, williamr@2: and must be deallocated by the caller." williamr@2: @leave "This method will leave if an error occurs." williamr@2: */ williamr@2: virtual CVideoEncoderInfo* VideoEncoderInfoLC() = 0; williamr@2: williamr@2: /** williamr@2: Sets the encoder output format. The picture size depends on the input data format and possible williamr@2: scaling performed. williamr@2: williamr@2: @param "aFormat" "The video format to use." williamr@2: @param "aDataUnitType" "The type of output coded data units." williamr@2: @param "aDataEncapsulation" "Data encapsulation type for output encoded data units." williamr@2: @param "aSegmentationAllowed" "True if a coded data unit can be segmented into multiple output buffers williamr@2: if a single buffer is not large enough." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The format specified is not supported." williamr@2: @pre "This method may only be called before the hwdevice has been initialized using Initialize()." williamr@2: */ williamr@2: virtual void SetOutputFormatL(const CCompressedVideoFormat& aFormat, williamr@2: TVideoDataUnitType aDataUnitType, williamr@2: TVideoDataUnitEncapsulation aDataEncapsulation, williamr@2: TBool aSegmentationAllowed=EFalse) = 0; williamr@2: williamr@2: /** williamr@2: Sets the pre-processor device that will write data to this encoder. Uncompressed pictures will be williamr@2: written with WritePictureL() or through a custom interface. After pictures have been processed, williamr@2: they must be returned to the pre-processor using ReturnPicture(). williamr@2: williamr@2: @param "aDevice" "The input pre-processor device to use." williamr@2: @pre "This method may only be called before the hwdevice has been initialized using Initialize()." williamr@2: */ williamr@2: virtual void SetInputDevice(CMMFVideoPreProcHwDevice* aDevice) = 0; williamr@2: williamr@2: /** williamr@2: Sets the number of bit-rate scalability layers to use. Set to 1 to disable layered scalability. williamr@2: williamr@2: Bit-rate scalability refers to the ability of a coded stream to be decoded at different bit-rates. williamr@2: Scalable video is typically ordered into hierarchical layers of data. A base layer contains an williamr@2: individual representation of a video stream and enhancement layers contain refinement data in addition williamr@2: to the base layer. The quality of the decoded video stream progressively improves as enhancement layers williamr@2: are added to the base layer. williamr@2: williamr@2: @param "aNumLayers" "The number of bit-rate scalability layers to use, set to 1 to disable williamr@2: scalability." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The scalability layers are not supported or too many layers specified." williamr@2: @pre "This method may only be called before the hwdevice has been initialized using Initialize()." williamr@2: */ williamr@2: virtual void SetNumBitrateLayersL(TUint aNumLayers) = 0; williamr@2: williamr@2: /** williamr@2: Sets the scalability type for a bit-rate scalability layer. williamr@2: williamr@2: @param "aLayer" "Layer number. Layers are numbered [0...n-1], where n is the number of layers williamr@2: available. The first layer is the base layer, it can be decoded independently from the other williamr@2: layers, and it has the lowest total bitrate." williamr@2: @param "aScalabilityType" "Layer scalability type." williamr@2: @leave " The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The scalability layers or the specified scalability type are not williamr@2: supported." williamr@2: @pre "This method may only be called before the hwdevice has been initialized using Initialize()." williamr@2: */ williamr@2: virtual void SetScalabilityLayerTypeL(TUint aLayer, TScalabilityType aScalabilityType) = 0; williamr@2: williamr@2: /** williamr@2: Sets the reference picture options to be used for all scalability layers. The settings can be overridden williamr@2: for an individual scalability layer by using SetLayerReferenceOptions(). williamr@2: williamr@2: @param "aMaxReferencePictures" "The maximum number of reference pictures to be used. More than one williamr@2: reference frame can be used in the H.264 | MPEG-4 AVC and in some williamr@2: advanced profiles of MPEG-4 Part 2 and H.263. The minimum value is one." williamr@2: @param "aMaxPictureOrderDelay" "The maximum picture order delay, in number of pictures. This specifies williamr@2: the maximum amount of pictures that precede any picture in the sequence williamr@2: in decoding order and follow the picture in presentation order. Pictures williamr@2: may be coded/decoded in different order from their capture/display order. williamr@2: Thus, decoded pictures have to be buffered to order them in correct williamr@2: display order. For example, if one conventional B picture is coded williamr@2: between P pictures, a one-picture display ordering delay has to be williamr@2: applied in the decoder. The minimum value is zero, which indicates williamr@2: that pictures must be coded in capture/display order." williamr@2: @pre "This method may only be called before the hwdevice has been initialized using Initialize()." williamr@2: */ williamr@2: virtual void SetGlobalReferenceOptions(TUint aMaxReferencePictures, TUint aMaxPictureOrderDelay) = 0; williamr@2: williamr@2: /** williamr@2: Sets the reference picture options to be used for a single scalability layer. These settings override williamr@2: those set with SetGlobalReferenceOptions(). williamr@2: williamr@2: @param "aLayer" "Layer number." williamr@2: @param "aMaxReferencePictures" "The maximum number of reference pictures to be used." williamr@2: @param "aMaxPictureOrderDelay" "The maximum picture order delay, in number of pictures." williamr@2: @pre "This method may only be called before the hwdevice has been initialized using Initialize()." williamr@2: */ williamr@2: virtual void SetLayerReferenceOptions(TUint aLayer, TUint aMaxReferencePictures, TUint aMaxPictureOrderDelay) = 0; williamr@2: williamr@2: /** williamr@2: Sets encoder buffering options. williamr@2: williamr@2: @param "aOptions" "The buffering options." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The specified settings are not supported." williamr@2: @pre "This method may only be called before the hwdevice has been initialized using Initialize()." williamr@2: */ williamr@2: virtual void SetBufferOptionsL(const TEncoderBufferOptions& aOptions) = 0; williamr@2: williamr@2: /** williamr@2: Sets the encoder output rectangle. This rectangle specifies the part of the input and output pictures williamr@2: which is displayed after encoding. Many video codecs process data in 16x16 pixel units but enable williamr@2: specifying and coding the encoder output rectangle for image sizes that are not multiple of 16 pixels williamr@2: (e.g 160x120). williamr@2: williamr@2: @param "aRect" "The encoder output rectangle." williamr@2: @leave "The method will leave if an error occurs." williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetOutputRectL(const TRect& aRect) = 0; williamr@2: williamr@2: /** williamr@2: Sets whether bit errors or packets losses can be expected in the video transmission. The video encoder williamr@2: can use this information to optimize the bitstream. williamr@2: williamr@2: @param "aBitErrors" "True if bit errors can be expected." williamr@2: @param "aPacketLosses" "True if packet losses can be expected." williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetErrorsExpected(TBool aBitErrors, TBool aPacketLosses) = 0; williamr@2: williamr@2: /** williamr@2: Sets the minimum frequency (in time) for instantaneous random access points in the bitstream. An williamr@2: instantaneous random access point is such where the decoder can achieve a full output picture williamr@2: immediately by decoding data starting from the random access point. The random access point frequency williamr@2: may be higher than signalled, if the sequence contains scene cuts which typically cause a coding williamr@2: of a random access point. williamr@2: williamr@2: @param "aRate" "Random access point rate, in pictures per second. For example, to request a random williamr@2: access point every ten seconds, set the value to 0.1." williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetMinRandomAccessRate(TReal aRate) = 0; williamr@2: williamr@2: /** williamr@2: Sets coding-standard specific encoder options. williamr@2: williamr@2: @param "aOptions" "The options to use. The data format for the options is coding-standard specific, williamr@2: and defined separately." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The specified settings are not supported." williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetCodingStandardSpecificOptionsL(const TDesC8& aOptions) = 0; williamr@2: williamr@2: /** williamr@2: Sets implementation-specific encoder options. williamr@2: williamr@2: @param "aOptions" "The options to use. The data format for the options is specific to the encoder williamr@2: implementation, and defined separately by the encoder implementer." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The specified settings are not supported." williamr@2: @pre "This method can be called either before or after the hwdevice has been initialized with Initialize(). williamr@2: If called after initialization, the change must only be committed when CommitL() is called." williamr@2: */ williamr@2: virtual void SetImplementationSpecificEncoderOptionsL(const TDesC8& aOptions) = 0; williamr@2: williamr@2: /** williamr@2: Returns coding-standard specific initialization output from the encoder. The information can contain, williamr@2: for example, the MPEG-4 VOL header. This method can be called after Initialize() has been called. williamr@2: williamr@2: @return "Coding-standard specific initialization output. The data format is coding-standard specific williamr@2: and defined separately. The buffer is pushed to the cleanup stack, and the caller is responsible williamr@2: for deallocating it." williamr@2: @leave "The method will leave if an error occurs." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual HBufC8* CodingStandardSpecificInitOutputLC() = 0; williamr@2: williamr@2: /** williamr@2: Returns implementation-specific initialization output from the encoder. This method can be called after williamr@2: Initialize() has been called. williamr@2: williamr@2: @return "Implementation-specific initialization output. The data format is specific to the encoder williamr@2: implementation, and defined by the encoder supplier. The buffer is pushed to the cleanup stack, williamr@2: and the caller is responsible for deallocating it." williamr@2: @leave "The method will leave if an error occurs." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual HBufC8* ImplementationSpecificInitOutputLC() = 0; williamr@2: williamr@2: /** williamr@2: Sets the number of unequal error protection levels. By default unequal error protection is not used. williamr@2: williamr@2: @param "aNumLevels" "The number of unequal error protection levels. To disable unequal error williamr@2: protection, set this value to one" williamr@2: @param "aSeparateBuffers" "True if each unequal error protection level of a coded data unit shall be williamr@2: encapsulated in its own output buffer. Ignored if unequal error protection williamr@2: is not used." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - Unequal error protection is not supported." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SetErrorProtectionLevelsL(TUint aNumLevels, TBool aSeparateBuffers) = 0; williamr@2: williamr@2: /** williamr@2: Sets up an unequal error protection level. If unequal error protection is not used, this method can be williamr@2: used to control settings for the whole encoded bitstream. williamr@2: williamr@2: @param "aLevel" "Error protection level number. This argument is ignored if unequal error protection williamr@2: is not in use." williamr@2: @param "aBitrate" "Target bit-rate for this error protection level." williamr@2: @param "aStrength" "Forward error control strength for this error protection level. The strength williamr@2: can be specified using values from TErrorControlStrength (EFecStrengthNone, williamr@2: EFecStrengthLow, EFecStrengthNormal, EFecStrengthHigh), or with intermediate williamr@2: values between those constants." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The specified bit-rate cannot be supported. " williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SetErrorProtectionLevelL(TUint aLevel, TUint aBitrate, TUint aStrength) = 0; williamr@2: williamr@2: /** williamr@2: Sets the expected or prevailing channel conditions for an unequal error protection level, in terms of williamr@2: expected packet loss rate. The video encoder can use this information to optimize the generated bitstream. williamr@2: williamr@2: @param "aLevel" "Error protection level number. This argument is ignored if unequal error williamr@2: protection is not in use." williamr@2: @param "aLossRate" "Packet loss rate, in number of packets lost per second. Set to 0.0 if williamr@2: packet losses are not expected." williamr@2: @param "aLossBurstLength" "Expected average packet loss burst length. Set to zero if the information is williamr@2: not available." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SetChannelPacketLossRate(TUint aLevel, williamr@2: TReal aLossRate, williamr@2: TTimeIntervalMicroSeconds32 aLossBurstLength) = 0; williamr@2: williamr@2: /** williamr@2: Sets the expected or prevailing channel conditions for an unequal error protection level, in terms of williamr@2: expected bit error rate. The video encoder can use this information to optimize the generated bitstream. williamr@2: williamr@2: @param "aLevel" "Error protection level number. This argument is ignored if unequal error williamr@2: protection is not in use." williamr@2: @param "aErrorRate" "Expected bit error rate, as a fraction of the total bits transmitted. Set williamr@2: to 0.0 if bit errors are not expected." williamr@2: @param "aStdDeviation" "Expected bit error rate standard deviation." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SetChannelBitErrorRate(TUint aLevel, TReal aErrorRate, TReal aStdDeviation) = 0; williamr@2: williamr@2: /** williamr@2: Sets the target size of each coded video segment. The segment target size can be specified in terms of williamr@2: number of bytes per segment, number of macroblocks per segment, or both. williamr@2: williamr@2: @param "aLayer" "Layer number. Layers are numbered [0...n-1], where n is the number of williamr@2: layers available. Use zero if layered bit-rate scalability is not used." williamr@2: @param "aSizeBytes" "Segment target size in bytes. Set to zero to use unlimited segment size. The williamr@2: segment size in bytes should include all data that is typically stored or williamr@2: transmitted for each segment in the format currently in use. This includes all williamr@2: related headers." williamr@2: @param "aSizeMacroblocks" "Segment target size in number of macroblocks per segment. Set to zero to williamr@2: use unlimited segment size." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SetSegmentTargetSize(TUint aLayer, TUint aSizeBytes, TUint aSizeMacroblocks) = 0; williamr@2: williamr@2: /** williamr@2: Sets the bit-rate control options for a layer. If layered bit-rate scalability is not used, the options williamr@2: are set for the whole bitstream. williamr@2: williamr@2: @param "aLayer" "Layer number. Layers are numbered [0...n-1], where n is the number of layers williamr@2: available. Use zero if layered bit-rate scalability is not used." williamr@2: @param "aOptions" "Bit-rate control options." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SetRateControlOptions(TUint aLayer, const TRateControlOptions& aOptions) = 0; williamr@2: williamr@2: /** williamr@2: Sets in-layer scalability options for a layer. In-layer bit-rate scalability refers to techniques where williamr@2: a specific part of a single-layer coded stream can be decoded correctly without decoding the leftover williamr@2: part. For example, B-pictures can be used for this. By default in-layer scalability is not used. williamr@2: williamr@2: @param "aLayer" "Layer number. Layers are numbered [0…n-1], where n is the number of layers williamr@2: available. Use zero if layered bit-rate scalability is not used." williamr@2: @param "aNumSteps" "The number of in-layer scalability steps to use. Set to one to disable williamr@2: in-layer scalability." williamr@2: @param "aScalabilityType" "The scalability type to use." williamr@2: @param "aBitrateShare" "Bit-rate share for each scalability step. The bit-rate shares are defined williamr@2: as fractions of total layer bit-rate, with the share for one layer being williamr@2: aBitrateShare[i]/sum(aBitrateShare). For example, to use 2/3 of the total williamr@2: bitrate for the first layer and the remaining 1/3 for the second, the array williamr@2: contents would be {2,1}." williamr@2: @param "aPictureShare" "Picture rate share for each scalability step. The picture rate shares are williamr@2: defined similarly to the bit-rate shares. For example, a client wishing to williamr@2: use two B-pictures between each pair of reference pictures should set the williamr@2: array contents to {1,2}." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - In-layer scalability is not supported. williamr@2: - KErrArgument - Some of the arguments are out of range. For example, it is not williamr@2: possible to use the specified in-layer scalability setup due to other williamr@2: constraints (such as the maximum picture order delay)." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SetInLayerScalabilityL(TUint aLayer, williamr@2: TUint aNumSteps, williamr@2: TInLayerScalabilityType aScalabilityType, williamr@2: const TArray& aBitrateShare, williamr@2: const TArray& aPictureShare) = 0; williamr@2: williamr@2: /** williamr@2: Sets the period for layer promotions points for a scalability layer. A layer promotion point is a williamr@2: picture where it is possible to start decoding this enhancement layer if only the lower layers were williamr@2: decoded earlier. williamr@2: williamr@2: @param "aLayer" "Layer number." williamr@2: @param "aPeriod" "Layer promotion point period. A value of one signals that each picture should be a williamr@2: layer promotion point, value two that there is one picture between each promotion williamr@2: point etc." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SetLayerPromotionPointPeriod(TUint aLayer, TUint aPeriod) = 0; williamr@2: williamr@2: /** williamr@2: Returns coding-standard specific settings output from the encoder. The information can contain, for williamr@2: example, some bitstream headers that can change based on settings modified while encoding is in progress. williamr@2: williamr@2: @return "Coding-standard specific initialization output. The data format is coding-standard specific williamr@2: and defined separately. The buffer is pushed to the cleanup stack, and the caller is responsible williamr@2: for deallocating it." williamr@2: @leave "The method will leave if an error occurs." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual HBufC8* CodingStandardSpecificSettingsOutputLC() = 0; williamr@2: williamr@2: /** williamr@2: Returns implementation-specific settings output from the encoder. The information can contain, for williamr@2: example, some bitstream headers that can change based on settings modified while encoding is in progress. williamr@2: williamr@2: @return "Implementation-specific initialization output. The data format is implementation-specific and williamr@2: defined separately by the encoder supplier. The buffer is pushed to the cleanup stack, and the williamr@2: caller is responsible for deallocating it." williamr@2: @leave "The method will leave if an error occurs." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual HBufC8* ImplementationSpecificSettingsOutputLC() = 0; williamr@2: williamr@2: /** williamr@2: Requests the encoder to sends supplemental information in the bitstream. The information data format is williamr@2: coding-standard dependent. Only one supplemental information send request can be active at a time. This williamr@2: variant encodes the information to the next possible picture. williamr@2: williamr@2: The client must be notified after then information has been sent by calling williamr@2: MMMFDevVideoRecordProxy::MdvrpSupplementalInfoSent(). williamr@2: williamr@2: @param "aData" "Supplemental information data to send." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - Supplemental information is not supported" williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SendSupplementalInfoL(const TDesC8& aData) = 0; williamr@2: williamr@2: /** williamr@2: Requests the encoder to sends supplemental information in the bitstream. The information data format is williamr@2: coding-standard dependent. Only one supplemental information send request can be active at a time. This williamr@2: variant encodes the information to the picture specified. williamr@2: williamr@2: @param "aData" "Supplemental information data to send." williamr@2: @param "aTimestamp" "Timestamp for the picture in which the supplemental information should be williamr@2: included. If a picture with the matching timestamp is never encoded, or the williamr@2: timestamp is in the past, the supplemental information will not be sent." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - Supplemental information is not supported" williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SendSupplementalInfoL(const TDesC8& aData, const TTimeIntervalMicroSeconds& aTimestamp) = 0; williamr@2: williamr@2: /** williamr@2: Cancels the current supplemental information send request. The memory buffer reserved for supplemental williamr@2: information data can be reused or deallocated after the method returns. williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void CancelSupplementalInfo() = 0; williamr@2: williamr@2: /** williamr@2: Gets the current output buffer status. The information includes the number of free output buffers and williamr@2: the total size of free buffers in bytes. williamr@2: williamr@2: @param "aNumFreeBuffers" "Target for the number of free output buffers." williamr@2: @param "aTotalFreeBytes" "Target for the total free buffer size in bytes." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void GetOutputBufferStatus(TUint& aNumFreeBuffers, TUint& aTotalFreeBytes) = 0; williamr@2: williamr@2: /** williamr@2: Returns a used output buffer back to the encoder. The buffer can be reused or deallocated. williamr@2: williamr@2: @param "aBuffer" "The buffer to return." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void ReturnBuffer(TVideoOutputBuffer* aBuffer) = 0; williamr@2: williamr@2: /** williamr@2: Indicates a picture loss to the encoder, without specifying the lost picture. The encoder can react williamr@2: to this by transmitting an intra-picture. williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void PictureLoss() = 0; williamr@2: williamr@2: /** williamr@2: Indicates to the encoder the pictures that have been lost. The encoder can react to this by williamr@2: transmitting an intra-picture. williamr@2: @param "aPictures" "Picture identifiers for the lost pictures." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void PictureLoss(const TArray& aPictures) = 0; williamr@2: williamr@2: /** williamr@2: Indicates a slice loss to the encoder. williamr@2: williamr@2: @param "aFirstMacroblock" "The first lost macroblock. The macroblocks are numbered such williamr@2: that the macroblock in the upper left corner of the picture is considered williamr@2: macroblock number 1 and the number for each macroblock increases from left williamr@2: to right and then from top to bottom in raster-scan order." williamr@2: @param "aNumMacroblocks" "The number of macroblocks in the lost slice." williamr@2: @param "aPicture" "The picture identified for the picture where the slice was lost. If the williamr@2: picture is not known, aPicture.iIdType is set to ENone." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture) = 0; williamr@2: williamr@2: /** williamr@2: Sends a reference picture selection request to the encoder. The request is delivered as a williamr@2: coding-standard specific binary message. Reference picture selection can be used to select a previous williamr@2: correctly transmitted picture to use as a reference in case later pictures have been lost. williamr@2: williamr@2: @param "aSelectionData" "The reference picture selection request message. The message format is williamr@2: coding-standard specific, and defined separately." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void ReferencePictureSelection(const TDesC8& aSelectionData) = 0; williamr@2: williamr@2: protected: williamr@2: /** williamr@2: Constructor. williamr@2: */ williamr@2: IMPORT_C CMMFVideoEncodeHwDevice(); williamr@2: williamr@2: /** williamr@2: Set the proxy implementation to be used. Called just after the object is constructed. williamr@2: @param "aProxy" "The proxy to use." williamr@2: */ williamr@2: virtual void SetProxy(MMMFDevVideoRecordProxy& aProxy) = 0; williamr@2: private: williamr@2: TUid iDtor_ID_Key; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: CMMFVideoPreProcHwDevice is the MSL video pre-processor plug-in interface. All MSL video pre-processors williamr@2: must implement this interface. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class CMMFVideoPreProcHwDevice : public CMMFVideoRecordHwDevice williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Creates a new video pre-processor hardware device object, based on the implementation UID. williamr@2: @param "aUid" "Pre-processor implementation UID." williamr@2: @param "aProxy" "The proxy implementation to use." williamr@2: @return "A new CMMFVideoPreProcHwDevice object." williamr@2: @leave "This method will leave if an error occurs." williamr@2: */ williamr@2: IMPORT_C static CMMFVideoPreProcHwDevice* NewL(TUid aUid, MMMFDevVideoRecordProxy& aProxy); williamr@2: williamr@2: /** williamr@2: Destructor. williamr@2: */ williamr@2: IMPORT_C virtual ~CMMFVideoPreProcHwDevice(); williamr@2: williamr@2: /** williamr@2: Sets the device output format. The picture size depends on the input data format and possible williamr@2: scaling performed. williamr@2: williamr@2: @param "aFormat" "The video format to use." williamr@2: @leave " The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotSupported - The format specified is not supported." williamr@2: @pre "This method can only be called before the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SetOutputFormatL(const TUncompressedVideoFormat& aFormat) = 0; williamr@2: williamr@2: /** williamr@2: Sets the video encoder device that will receive data from this pre-processor. Pre-processed pictures williamr@2: will be written with WritePictureL() or through a custom interface, and the encoder will return used williamr@2: pictures using ReturnPicture(). williamr@2: williamr@2: @param "aDevice" "The output encoder device to use." williamr@2: @pre "This method can only be called before the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void SetOutputDevice(CMMFVideoEncodeHwDevice* aDevice) = 0; williamr@2: williamr@2: /** williamr@2: Returns a used picture back to the pre-processor. Called by an encoder device when used as output williamr@2: device from a pre-processor. williamr@2: williamr@2: @param "aPicture" "The picture to return." williamr@2: @pre "This method can only be called after the hwdevice has been initialized with Initialize()." williamr@2: */ williamr@2: virtual void ReturnPicture(TVideoPicture* aPicture) = 0; williamr@2: williamr@2: protected: williamr@2: /** williamr@2: Constructor. williamr@2: */ williamr@2: IMPORT_C CMMFVideoPreProcHwDevice(); williamr@2: williamr@2: /** williamr@2: Set the proxy implementation to be used. Called just after the object is constructed. williamr@2: @param "aProxy" "The proxy to use." williamr@2: */ williamr@2: virtual void SetProxy(MMMFDevVideoRecordProxy& aProxy) = 0; williamr@2: private: williamr@2: TUid iDtor_ID_Key; williamr@2: }; williamr@2: williamr@2: #endif