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 __DEVVIDEORECORD_H__ williamr@2: #define __DEVVIDEORECORD_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: class MMMFDevVideoRecordObserver; williamr@2: class CMMFVideoRecordHwDevice; williamr@2: class CMMFVideoEncodeHwDevice; williamr@2: class CMMFVideoPreProcHwDevice; williamr@2: class TVideoOutputBuffer; williamr@2: williamr@2: /** williamr@2: MMMFDevVideoRecordProxy is the interface the CDevVideoRecord implementation provides for video recording williamr@2: hardware devices. The hardware devices use this interface to report events and send used pictures and williamr@2: new buffers to the client. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class MMMFDevVideoRecordProxy williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Delivers a new coded data unit to the client. The CDevVideoRecord implementation will maintain a list williamr@2: of buffers and implement NumDataBuffers() and NextBufferL() based on those. The buffers will be returned williamr@2: back to the device using ReturnBuffer(). williamr@2: williamr@2: @param "aBuffer" "The buffer containing the data to send." williamr@2: */ williamr@2: virtual void MdvrpNewBuffer(TVideoOutputBuffer* aBuffer) = 0; williamr@2: williamr@2: /** williamr@2: Returns a used input picture back to the client. Called by the encoder hardware device after the picture williamr@2: has been encoded. williamr@2: williamr@2: @param "aPicture" "The picture to return." williamr@2: */ williamr@2: virtual void MdvrpReturnPicture(TVideoPicture* aPicture) = 0; williamr@2: williamr@2: /** williamr@2: Sends a notification to the client that the current supplemental info send request has completed. williamr@2: */ williamr@2: virtual void MdvrpSupplementalInfoSent() = 0; williamr@2: williamr@2: /** williamr@2: Reports a fatal error to the client. The device must automatically stop processing video data when williamr@2: such errors occur, and may not do further processing before it has been deleted and re-created. williamr@2: williamr@2: @param "aDevice" "The device that reports the error." williamr@2: @param "aError" "The error code." williamr@2: */ williamr@2: virtual void MdvrpFatalError(CMMFVideoHwDevice* aDevice, TInt aError) = 0; williamr@2: williamr@2: /** williamr@2: Reports that an asynchronous Initialize() method has completed. The device is now ready for recording. williamr@2: williamr@2: @param "aDevice" "The device that was initialized." williamr@2: @param "aError" "Initialization result error code, KErrNone if initialization was successful." williamr@2: */ williamr@2: virtual void MdvrpInitializeComplete(CMMFVideoHwDevice* aDevice, TInt aError) = 0; williamr@2: williamr@2: /** williamr@2: Reports that the input video data end has been reached and all pictures have been processed. Called williamr@2: by each hardware device after their InputEnd() methods have been called and all data has been processed. williamr@2: The proxy implementation will notify the client about stream end when all hardware devices have called williamr@2: this method. williamr@2: */ williamr@2: virtual void MdvrpStreamEnd() = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: A video output buffer for a single output coded data unit from the encoder. In practice the encoder is williamr@2: likely to inherit its own buffer class from this class, adding its own internal bookkeeping data. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class TVideoOutputBuffer williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Coded video data for this data unit. williamr@2: */ williamr@2: TPtrC8 iData; williamr@2: williamr@2: /** williamr@2: Capture timestamp for this data unit. If a single picture is divided into multiple data units, williamr@2: all data units have the same timestamp. williamr@2: */ williamr@2: TTimeIntervalMicroSeconds iCaptureTimestamp; williamr@2: williamr@2: /** williamr@2: Identification number indicating the start of the spatial coverage of the data in the output buffer, williamr@2: for example the first macroblock number. williamr@2: */ williamr@2: TUint iCoverageStartPosition; williamr@2: williamr@2: /** williamr@2: End of the spatial coverage of the data in the buffer, for example the last macroblock number. williamr@2: The idenfication numbers can be used to match data partitions with each other. williamr@2: */ williamr@2: TUint iCoverageEndPosition; williamr@2: williamr@2: /** williamr@2: Order number of the output buffer having the same spatial coverage as an earlier output buffer williamr@2: of the same picture. Used with video pictures or segments that do not fit into an output buffer. williamr@2: The order number of the first output buffer of a particular spatial coverage area is 0. The order williamr@2: number shall be incremented by 1 for each subsequent output buffer having the same coverage in the williamr@2: same coded picture. williamr@2: */ williamr@2: TUint iOrderNumber; williamr@2: williamr@2: /** williamr@2: Lowest unequal error protection level present in the buffer. Level 0 indicates that the buffer can williamr@2: be discarded without causing temporal error propagation in the decoder, higher values indicate more williamr@2: important buffers. If unequal error protection is not used, the value is set to 1. williamr@2: */ williamr@2: TUint iMinErrorProtectionLevel; williamr@2: williamr@2: /** williamr@2: Highest unequal error protection level present in the buffer. If unequal error protection is not williamr@2: used, the value is set to 1. williamr@2: */ williamr@2: TUint iMaxErrorProtectionLevel; williamr@2: williamr@2: /** williamr@2: True if this buffer contains data that is required for decoding several pictures, for example the williamr@2: only copy of a sequence header. A picture needed for motion compensated prediction is not considered williamr@2: "required for decoding several pictures". williamr@2: */ williamr@2: TBool iRequiredSeveralPictures; williamr@2: williamr@2: /** williamr@2: True if this buffer contains data that is required for decoding other parts of the same picture, williamr@2: for example the only copy of the picture header. williamr@2: */ williamr@2: TBool iRequiredThisPicture; williamr@2: williamr@2: /** williamr@2: The layer number for this picture if layered bit-rate scalability is used. If layers are not used, williamr@2: the layer number is always zero. williamr@2: */ williamr@2: TUint iLayer; williamr@2: williamr@2: /** williamr@2: Sub-sequence identifier of the output picture. A sub-sequence is a set of coded pictures within a williamr@2: bit-rate scalability layer. A picture shall reside in one scalability layer and in one sub-sequence williamr@2: only. A sub-sequence shall not depend on any other sub-sequence in the same or in a higher layer. williamr@2: A sub-sequence in layer 0 can be decoded independently of any other sub-sequences. A sub-sequence williamr@2: identifier labels the sub-sequence within a layer. Consecutive sub-sequences within a particular williamr@2: layer in decoding order shall have a different sub-sequence identifier from each other. See Annex D williamr@2: of H.264 | MPEG-4 AVC for further details. williamr@2: */ williamr@2: TUint iSubSeqId; williamr@2: williamr@2: /** williamr@2: The in-layer scalability step for the data in the buffer if in-layer scalability is used. williamr@2: If in-layer scalability is not in use, the step is set to zero. williamr@2: */ williamr@2: TUint iInLayerScalabilityStep; williamr@2: williamr@2: /** williamr@2: iDataPartitionNumber equal to 0 indicates that data partitioning is not in use. Values of williamr@2: iDataPartitionNumber greater than 0 indicate the data partition number in descending order of williamr@2: importance, i.e. data partition 1 is the most important data partition subjectively. Data williamr@2: partitioning can be used with multiple unequal error protection levels. williamr@2: */ williamr@2: TUint iDataPartitionNumber; williamr@2: williamr@2: /** williamr@2: True if this buffer contains data for a random access point. williamr@2: */ williamr@2: TBool iRandomAccessPoint; williamr@2: williamr@2: /** williamr@2: Updated HRD/VBV parameters, valid if HRD/VBV is in use and iRandomAccessPoint is true. williamr@2: */ williamr@2: TPtrC8 iHrdVbvParams; williamr@2: williamr@2: /** williamr@2: Coding-standard specific data. williamr@2: */ williamr@2: TPtrC8 iCodingStandardSpecificData; williamr@2: williamr@2: /** williamr@2: Implementation-specific data. williamr@2: */ williamr@2: TPtrC8 iImplementationSpecificData; williamr@2: williamr@2: /** williamr@2: A queue link used internally by the MSL API. The field must not be modified while the buffer is williamr@2: in the MSL API, but can be used by the client before the buffer has been written and after the williamr@2: buffer has been returned. williamr@2: */ williamr@2: TDblQueLink iLink; williamr@2: }; williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: This class contains information about the pre-processing capabilities that an encoder or a pre-processor williamr@2: hardware has. Although it mainly contains static data, it is defined as a complete CBase-derived class williamr@2: since the data is relatively complex and proper memory management is necessary. williamr@2: williamr@2: The objects are created by the pre-processor or encoder devices, and used by the MSL video client code. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class CPreProcessorInfo : public CBase williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Creates and returns a new CPreProcessorInfo object. All data passed into this method is copied. williamr@2: @param "aUid" "The uid of the pre-processor." williamr@2: @param "aManufacturer" "The manufacturer of the pre-processor." williamr@2: @param "aIdentifier" "The manufacturer-specific identifier of the pre-processor." williamr@2: @param "aVersion" "The version of the pre-processor." williamr@2: @param "aAccelerated" "Whether the pre-processor is hw accelerated or not." williamr@2: @param "aSupportsDirectCapture" "Whether the pre-processor supports direct capture." williamr@2: @param "aInputFormats" "An array of the supported input formats." williamr@2: @param "aOutputFormats" "An array of the supported output formats." williamr@2: @param "aSupportedCombinations" "An array of the supported combinations." williamr@2: @param "aSupportsArbitraryScaling" "Whether the pre-processor supports arbitrary scaling." williamr@2: @param "aSupportsAntiAliasedScaling" "Whether the pre-processor supports anti-alias filtering on scaling."" williamr@2: @param "aSupportedScaleFactors" "An array of the supported scale factors if arbitrary scaling isn't suported" williamr@2: @param "aYuvToYuvCapabilities" "The yuv to yuv conversion capabilities of the pre-processor." williamr@2: @param "aSupportedRgbRanges" "The supported rgb ranges." williamr@2: @param "aSupportedRotations" "The supported rotations." williamr@2: @param "aImplementationSpecificInfo" "Implementation-specific information." williamr@2: @return"The newly created CPreProcessorInfo object." williamr@2: @leave "This method may leave with one of the system-wide error codes. williamr@2: */ williamr@2: IMPORT_C static CPreProcessorInfo* NewL(TUid aUid, williamr@2: const TDesC& aManufacturer, williamr@2: const TDesC& aIdentifier, williamr@2: TVersion aVersion, williamr@2: TBool aAccelerated, williamr@2: TBool aSupportsDirectCapture, williamr@2: const TArray& aInputFormats, williamr@2: const TArray& aOutputFormats, williamr@2: const TArray& aSupportedCombinations, williamr@2: TBool aSupportsArbitraryScaling, williamr@2: TBool aSupportsAntiAliasedScaling, williamr@2: const TArray& aSupportedScaleFactors, williamr@2: const TYuvToYuvCapabilities& aYuvToYuvCapabilities, williamr@2: TUint32 aSupportedRgbRanges, williamr@2: TUint32 aSupportedRotations, williamr@2: const TDesC8& aImplementationSpecificInfo); williamr@2: williamr@2: /** williamr@2: Destructor. williamr@2: */ williamr@2: IMPORT_C ~CPreProcessorInfo(); williamr@2: williamr@2: /** williamr@2: Returns the pre-processor UID. williamr@2: @return "Pre-processor UID." williamr@2: */ williamr@2: IMPORT_C TUid Uid() const; williamr@2: williamr@2: /** williamr@2: Returns the hardware device manufacturer. williamr@2: @return "The hardware device manufacturer. The reference is valid until this is destroyed." williamr@2: */ williamr@2: IMPORT_C const TDesC& Manufacturer() const; williamr@2: williamr@2: /** williamr@2: Returns the hardware device manufacturer-specific identifier. The combination of the manufacturer williamr@2: and identifier uniquely identifies the plug-in. williamr@2: @return "The hardware device identifier. The reference is valid until this object is destroyed." williamr@2: */ williamr@2: IMPORT_C const TDesC& Identifier() const; williamr@2: williamr@2: /** williamr@2: Returns the pre-processor version. williamr@2: @return "Pre-processor version." williamr@2: */ williamr@2: IMPORT_C TVersion Version() const; williamr@2: williamr@2: /** williamr@2: Returns whether the plug-in is hardware-accelerated. Hardware-accelerated pre-processors can run on williamr@2: an application DSP or dedicated hardware. williamr@2: @return "True if the pre-processor is hardware-accelerated." williamr@2: */ williamr@2: IMPORT_C TBool Accelerated() const; williamr@2: williamr@2: /** williamr@2: Returns whether the hardware device supports direct capture. Pre-processors supporting direct capture williamr@2: can get the input pictures directly from a camera, possibly using an efficient hardware-dependent data williamr@2: path. williamr@2: @return "True if the pre-processor supports direct capture." williamr@2: */ williamr@2: IMPORT_C TBool SupportsDirectCapture() const; williamr@2: williamr@2: /** williamr@2: Returns whether the pre-processor supports the given input format. williamr@2: @param "aFormat" "The format to be checked." williamr@2: @return "True if the pre-processor supports the given input format." williamr@2: */ williamr@2: IMPORT_C TBool SupportsInputFormat(const TUncompressedVideoFormat& aFormat) const; williamr@2: williamr@2: /** williamr@2: Returns the input formats that the pre-processor supports. williamr@2: @return "An RArray table of supported video formats (TUncompressedVideoFormat). The reference is valid williamr@2: until the CPreProcessorInfo object is destroyed." williamr@2: */ williamr@2: IMPORT_C const RArray& SupportedInputFormats() const; williamr@2: williamr@2: /** williamr@2: Returns whether the pre-processor supports the given output format. williamr@2: @param "aFormat" "The format to be checked." williamr@2: @return "True if the pre-processor supports the given input format." williamr@2: */ williamr@2: IMPORT_C TBool SupportsOutputFormat(const TUncompressedVideoFormat& aFormat) const; williamr@2: williamr@2: /** williamr@2: Returns the output formats that the pre-processor supports. williamr@2: @return "An RArray table of supported video formats (TUncompressedVideoFormat). The reference is valid williamr@2: until the CPreProcessorInfo object is destroyed." williamr@2: */ williamr@2: IMPORT_C const RArray& SupportedOutputFormats() const; williamr@2: williamr@2: /** williamr@2: Returns whether the pre-processor supports the given pre-processing combination. williamr@2: @param "aCombination" "Pre-processing combination, a bitwise OR of values from TPrePostProcessType." williamr@2: @return "True if the pre-processing combination is supported." williamr@2: */ williamr@2: IMPORT_C TBool SupportsCombination(TUint32 aCombination) const; williamr@2: williamr@2: /** williamr@2: Lists all supported pre-processing combinations. williamr@2: @return "An RArray table of pre-processing combinations. Each value is a bitwise OR of values from williamr@2: TPrePostProcessType. The reference is valid until the CPreProcessorInfo object is destroyed." williamr@2: */ williamr@2: IMPORT_C const RArray& SupportedCombinations() const; williamr@2: williamr@2: /** williamr@2: Returns whether the pre-processor supports arbitrary scaling. williamr@2: @return "True if arbitrary scaling is supported. If arbitrary scaling is not supported, some specific williamr@2: scale factors can still be available." williamr@2: */ williamr@2: IMPORT_C TBool SupportsArbitraryScaling() const; williamr@2: williamr@2: /** williamr@2: Returns whether the hardware device supports anti-aliasing filtering for scaling. williamr@2: @return "True if anti-aliasing filtering is supported." williamr@2: */ williamr@2: IMPORT_C TBool SupportsAntiAliasedScaling() const; williamr@2: williamr@2: /** williamr@2: Returns the scaling factors the plug-in supports. If the plug-in supports arbitrary scaling the list williamr@2: is empty - use SupportsArbitraryScaling() first. williamr@2: @return "An RArray list of supported scale factors (TScaleFactor). The reference is valid until the williamr@2: CPreProcessorInfo object is destroyed. If the pre-processor supports arbitrary scaling or williamr@2: no scaling at all, the list is empty." williamr@2: */ williamr@2: IMPORT_C const RArray& SupportedScaleFactors() const; williamr@2: williamr@2: /** williamr@2: Returns the YUV to YUV conversion capabilities for the pre-processor. williamr@2: @return "The conversion capabilities, as a TYuvToYuvCapabilities structure. The reference is valid williamr@2: until the CPreProcessorInfo object is destroyed." williamr@2: */ williamr@2: IMPORT_C const TYuvToYuvCapabilities& YuvToYuvCapabilities() const; williamr@2: williamr@2: /** williamr@2: Returns RGB value ranges the hardware device supports for RGB to YUV conversion. williamr@2: @return "The supported RGB ranges as a bitwise OR of TRgbRange values." williamr@2: */ williamr@2: IMPORT_C TUint32 SupportedRgbRanges() const; williamr@2: williamr@2: /** williamr@2: Returns the rotation types the plug-in supports. williamr@2: @return "The supported rotation types as a bitwise OR of TRotationType values. If the pre-processor williamr@2: does not support rotation, the return value is zero." williamr@2: */ williamr@2: IMPORT_C TUint32 SupportedRotations() const; williamr@2: williamr@2: /** williamr@2: Returns implementation-specific information about the pre-processor. williamr@2: @return "Implementation- specific information about the pre-processor. The data format is williamr@2: implementation-specific, and defined separately by the pre-processor supplier. The reference williamr@2: is valid until the CPreProcessorInfo object is destroyed." williamr@2: */ williamr@2: IMPORT_C const TDesC8& ImplementationSpecificInfo() const; williamr@2: private: williamr@2: CPreProcessorInfo(TUid aUid, williamr@2: TVersion aVersion, williamr@2: TBool aAccelerated, williamr@2: TBool aSupportsDirectCapture, williamr@2: TBool aSupportsArbitraryScaling, williamr@2: TBool aSupportsAntiAliasedScaling, williamr@2: const TYuvToYuvCapabilities& aYuvToYuvCapabilities, williamr@2: TUint32 aSupportedRgbRanges, williamr@2: TUint32 aSupportedRotations); williamr@2: williamr@2: void ConstructL(const TDesC& aManufacturer, williamr@2: const TDesC& aIdentifier, williamr@2: const TArray& aInputFormats, williamr@2: const TArray& aOutputFormats, williamr@2: const TArray& aSupportedCombinations, williamr@2: const TArray& aSupportedScaleFactors, williamr@2: const TDesC8& aImplementationSpecificInfo); williamr@2: private: williamr@2: TUid iUid; williamr@2: HBufC* iManufacturer; williamr@2: HBufC* iIdentifier; williamr@2: TVersion iVersion; williamr@2: TBool iAccelerated; williamr@2: TBool iSupportsDirectCapture; williamr@2: RArray iInputFormats; williamr@2: RArray iOutputFormats; williamr@2: RArray iSupportedCombinations; williamr@2: TBool iSupportsArbitraryScaling; williamr@2: TBool iSupportsAntiAliasedScaling; williamr@2: RArray iSupportedScaleFactors; williamr@2: TYuvToYuvCapabilities iYuvToYuvCapabilities; williamr@2: TUint32 iSupportedRgbRanges; williamr@2: TUint32 iSupportedRotations; williamr@2: HBufC8* iImplementationSpecificInfo; williamr@2: }; williamr@2: williamr@2: /** williamr@2: This class contains information about a video encoder hardware device and its capabilities. williamr@2: Although it mainly contains static data, it is defined as a complete CBase-derived class since the williamr@2: data is relatively complex and proper memory management is necessary. williamr@2: williamr@2: The objects are created by the encoder devices, and used by the MSL video client code. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class CVideoEncoderInfo : public CBase williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Creates and returns a new CVideoEncoderInfo object. williamr@2: All data passed in is copied on construction of the object. williamr@2: williamr@2: @param aUid williamr@2: The uid of the encoder. williamr@2: @param aManufacturer williamr@2: The video encoder manufacturer. williamr@2: @param aIdentifier williamr@2: The manufacturer-specific identifier for this encoder. williamr@2: @param aVersion williamr@2: The version of this encoder. williamr@2: @param aAccelerated williamr@2: Whether this encoder is accelerated. williamr@2: @param aSupportsDirectCapture williamr@2: Whether this encoder supports direct capture. williamr@2: @param aSupportedInputFormats williamr@2: An array of the supported input formats. williamr@2: @param aSupportedOutputFormats williamr@2: An array of the supported output formats. williamr@2: @param aMaxPictureSize williamr@2: The maximum supported picture size. williamr@2: @param aSupportedDataUnitTypes williamr@2: The supported data unit types. williamr@2: @param aSupportedDataUnitEncapsulations williamr@2: The supported data unit encapsulations. williamr@2: @param aMaxBitrateLayers williamr@2: The maximum number of bitrate layers supported. williamr@2: @param aSupportsSupplementalEnhancementInfo williamr@2: Whether supplemental enhancement info is supported. williamr@2: @param aMaxUnequalErrorProtectionLevels williamr@2: The maximum unequal error protection level supported. williamr@2: @param aMaxBitRate williamr@2: The maximum bit rate supported. williamr@2: @param aMaxPictureRates williamr@2: An array of the maximum picture size/rates supported. williamr@2: @param aMaxInLayerScalabilitySteps williamr@2: The maximum in-layer scalability steps supported. williamr@2: @param aSupportedPictureOptions williamr@2: The picture options supported. williamr@2: @param aCodingStandardSpecificInfo williamr@2: Coding standard specific info. williamr@2: @param aImplementationSpecificInfo williamr@2: Implementation specific info. williamr@2: williamr@2: @return A new CVideoEncoderInfo object. williamr@2: @leave This method may leave with one of the system-wide error codes. williamr@2: */ williamr@2: IMPORT_C static CVideoEncoderInfo* NewL(TUid aUid, williamr@2: const TDesC& aManufacturer, williamr@2: const TDesC& aIdentifier, williamr@2: TVersion aVersion, williamr@2: TBool aAccelerated, williamr@2: TBool aSupportsDirectCapture, williamr@2: const TArray& aSupportedInputFormats, williamr@2: const TArray& aSupportedOutputFormats, williamr@2: const TSize& aMaxPictureSize, williamr@2: TUint32 aSupportedDataUnitTypes, williamr@2: TUint32 aSupportedDataUnitEncapsulations, williamr@2: TUint aMaxBitrateLayers, williamr@2: TBool aSupportsSupplementalEnhancementInfo, williamr@2: TUint aMaxUnequalErrorProtectionLevels, williamr@2: TUint aMaxBitRate, williamr@2: const TArray& aMaxPictureRates, williamr@2: TUint aMaxInLayerScalabilitySteps, williamr@2: TUint32 aSupportedPictureOptions, williamr@2: TBool aSupportsPictureLoss, williamr@2: TBool aSupportsSliceLoss, williamr@2: const TDesC8& aCodingStandardSpecificInfo, williamr@2: const TDesC8& aImplementationSpecificInfo); williamr@2: williamr@2: /** williamr@2: Destructor. williamr@2: */ williamr@2: IMPORT_C ~CVideoEncoderInfo(); williamr@2: williamr@2: /** williamr@2: Returns the encoder UID. williamr@2: @return "The encoder UID." williamr@2: */ williamr@2: IMPORT_C TUid Uid() const; williamr@2: williamr@2: /** williamr@2: Returns the encoder version. williamr@2: @return "The encoder version." williamr@2: */ williamr@2: IMPORT_C TVersion Version() const; williamr@2: williamr@2: /** williamr@2: Returns the encoder hardware device manufacturer. williamr@2: @return "The manufacturer name. The reference is valid until the CVideoEncoderInfo object is destroyed." williamr@2: */ williamr@2: IMPORT_C const TDesC& Manufacturer() const; williamr@2: williamr@2: /** williamr@2: Returns the encoder hardware device manufacturer-specific identifier. The combination of the williamr@2: manufacturer and identifier uniquely identifies the plug-in. williamr@2: @return "The identifier. The reference is valid until the CVideoEncoderInfo object is destroyed." williamr@2: */ williamr@2: IMPORT_C const TDesC& Identifier() const; williamr@2: williamr@2: /** williamr@2: Returns whether the encoder is hardware-accelerated. Hardware-accelerated encoders can run on an williamr@2: application DSP or dedicated hardware. williamr@2: @return "True if the encoder is hardware-accelerated." williamr@2: */ williamr@2: IMPORT_C TBool Accelerated() const; williamr@2: williamr@2: /** williamr@2: Returns whether the encoder supports direct capture. Encoders supporting direct capture can get the williamr@2: input pictures directly from a camera, possibly using an efficient hardware-dependent data path. williamr@2: @return "True if the encoder supports direct capture." williamr@2: */ williamr@2: IMPORT_C TBool SupportsDirectCapture() const; williamr@2: williamr@2: /** williamr@2: Returns whether the encoder supports the given input format. williamr@2: @param "aFormat" "The format to check." williamr@2: @return "True if the encoder supports the given input format." williamr@2: */ williamr@2: IMPORT_C TBool SupportsInputFormat(const TUncompressedVideoFormat& aFormat) const; williamr@2: williamr@2: /** williamr@2: Returns the input formats that the encoder supports. williamr@2: @return "An RArray table of supported video formats (TUncompressedVideoFormat). The reference is williamr@2: valid until the CVideoEncoderInfo object is destroyed." williamr@2: */ williamr@2: IMPORT_C const RArray& SupportedInputFormats() const; williamr@2: williamr@2: /** williamr@2: Returns whether the encoder supports the given output format. williamr@2: @param "aFormat" "The format to check." williamr@2: @return "True if the encoder supports the given output format." williamr@2: */ williamr@2: IMPORT_C TBool SupportsOutputFormat(const CCompressedVideoFormat& aFormat) const; williamr@2: williamr@2: /** williamr@2: Returns the output formats that the encoder supports. williamr@2: @return "An RArray table of supported video formats (CCompressedVideoFormat). The reference is williamr@2: valid until the CVideoEncoderInfo object is destroyed." williamr@2: */ williamr@2: IMPORT_C const RPointerArray& SupportedOutputFormats() const; williamr@2: williamr@2: /** williamr@2: Returns the maximum picture size the encoder supports. williamr@2: @return "The maximum picture size supported. The reference is valid until the CVideoEncoderInfo williamr@2: object is destroyed." williamr@2: */ williamr@2: IMPORT_C const TSize& MaxPictureSize() const; williamr@2: williamr@2: /** williamr@2: Returns the data unit types supported by the encoder. williamr@2: @return "Supported data unit types. The value is a binary OR of values from TVideoDataUnitType." williamr@2: */ williamr@2: IMPORT_C TUint32 SupportedDataUnitTypes() const; williamr@2: williamr@2: /** williamr@2: Returns the data unit encapsulation types that the encoder supports. williamr@2: @return "Supported data unit encapsulation types. The value is a binary OR of values from williamr@2: TVideoDataUnitEncapsulation." williamr@2: */ williamr@2: IMPORT_C TUint32 SupportedDataUnitEncapsulations() const; williamr@2: williamr@2: /** williamr@2: Returns the maximum number of bit-rate scalability layers supported. williamr@2: @return "Maximum number of bit-rate scalability layers supported, one (1) if layered scalability williamr@2: is not supported." williamr@2: */ williamr@2: IMPORT_C TUint MaxBitrateLayers() const; williamr@2: williamr@2: /** williamr@2: Returns whether the encoder implements SendSupplementalInfoL(). If SendSupplementalInfoL() is williamr@2: implemented, the client can send supplemental enhancement information messages as binary strings williamr@2: using that method. If SendSupplementalInfoL() is not implemented, this is not possible, but the williamr@2: encoder can still generate and send coding standard or implementation specific supplemental williamr@2: enhancement information automatically. williamr@2: @return "True if the encoder supports supplemental enhancement information." williamr@2: */ williamr@2: IMPORT_C TBool SupportsSupplementalEnhancementInfo() const; williamr@2: williamr@2: /** williamr@2: Returns the maximum number of unequal error protection levels supported. williamr@2: @return "Maximum number of unequal error protection levels supported, one (1) if unequal error williamr@2: protection is not supported." williamr@2: */ williamr@2: IMPORT_C TUint MaxUnequalErrorProtectionLevels() const; williamr@2: williamr@2: /** williamr@2: Returns the maximum bit-rate supported by the encoder. williamr@2: @return "Maximum bit-rate supported, in bits per second. KMaxTUint32 can be used if the encoder has no williamr@2: bit-rate restrictions." williamr@2: */ williamr@2: IMPORT_C TUint MaxBitrate() const; williamr@2: williamr@2: /** williamr@2: Returns the maximum picture size/rate combinations supported by the encoder. Video encoders can have williamr@2: different maximum picture rate limitations depending on the picture size used. williamr@2: @return "A reference to an array of picture size/rate combinations. The reference remains valid until williamr@2: this object is deleted." williamr@2: */ williamr@2: IMPORT_C const RArray& MaxPictureRates() const; williamr@2: williamr@2: /** williamr@2: Returns the maximum number of in-layer scalability steps supported. williamr@2: @return "Maximum number of in-layer scalability steps supported, one (1) if in-layer scalability is williamr@2: not supported." williamr@2: */ williamr@2: IMPORT_C TUint MaxInLayerScalabilitySteps() const; williamr@2: williamr@2: /** williamr@2: Returns the input picture options that the encoder supports. williamr@2: @return "Supported input picture options, a bitwise OR of values from TVideoPicture::TVideoPictureOptions." williamr@2: */ williamr@2: IMPORT_C TUint32 SupportedPictureOptions() const; williamr@2: williamr@2: /** williamr@2: Returns whether the encoder supports picture loss indications. If true, the encoder implements williamr@2: PictureLoss(), and recovers lost picture contents when it receives the indication. williamr@2: @return "True if the encoder supports picture loss indications." williamr@2: */ williamr@2: IMPORT_C TBool SupportsPictureLoss() const; williamr@2: williamr@2: /** williamr@2: Returns whether the encoder supports slice loss indications. If true, the encoder implements williamr@2: SliceLoss(), and recovers lost or damaged macroblocks when it receives the indication. williamr@2: @return "True if the encoder supports slice loss indications." williamr@2: */ williamr@2: IMPORT_C TBool SupportsSliceLoss() const; williamr@2: williamr@2: /** williamr@2: Returns coding-standard specific information about the encoder. williamr@2: @return "Coding-standard specific information about the encoder. The data format is coding-standard williamr@2: specific, and defined separately. The reference is valid until the CVideoEncoderInfo object williamr@2: is destroyed." williamr@2: */ williamr@2: IMPORT_C const TDesC8& CodingStandardSpecificInfo() const; williamr@2: williamr@2: /** williamr@2: Returns implementation-specific information about the encoder. williamr@2: @return "Implementation-specific information about the encoder. The data format is williamr@2: implementation-specific, and defined separately by the encoder supplier. The reference is valid until williamr@2: the CVideoEncoderInfo object is destroyed." williamr@2: */ williamr@2: IMPORT_C const TDesC8& ImplementationSpecificInfo() const; williamr@2: private: williamr@2: CVideoEncoderInfo(TUid aUid, williamr@2: TVersion aVersion, williamr@2: TBool aAccelerated, williamr@2: TBool aSupportsDirectCapture, williamr@2: const TSize& aMaxPictureSize, williamr@2: TUint32 aSupportedDataUnitTypes, williamr@2: TUint32 aSupportedDataUnitEncapsulations, williamr@2: TUint aMaxBitrateLayers, williamr@2: TBool aSupportsSupplementalEnhancementInfo, williamr@2: TUint aMaxUnequalErrorProtectionLevels, williamr@2: TUint aMaxBitRate, williamr@2: TUint aMaxInLayerScalabilitySteps, williamr@2: TUint32 aSupportedPictureOptions, williamr@2: TBool aSupportsPictureLoss, williamr@2: TBool aSupportsSliceLoss); williamr@2: void ConstructL(const TDesC& aManufacturer, williamr@2: const TDesC& aIdentifier, williamr@2: const TArray& aSupportedInputFormats, williamr@2: const TArray& aSupportedOutputFormats, williamr@2: const TArray& aMaxPictureRates, williamr@2: const TDesC8& aCodingStandardSpecificInfo, williamr@2: const TDesC8& aImplementationSpecificInfo); williamr@2: private: williamr@2: TUid iUid; williamr@2: TVersion iVersion; williamr@2: HBufC* iManufacturer; williamr@2: HBufC* iIdentifier; williamr@2: TBool iAccelerated; williamr@2: TBool iSupportsDirectCapture; williamr@2: RArray iSupportedInputFormats; williamr@2: RPointerArray iSupportedOutputFormats; williamr@2: TSize iMaxPictureSize; williamr@2: TUint32 iSupportedDataUnitTypes; williamr@2: TUint32 iSupportedDataUnitEncapsulations; williamr@2: TUint iMaxBitrateLayers; williamr@2: TBool iSupportsSupplementalEnhancementInfo; williamr@2: TUint iMaxUnequalErrorProtectionLevels; williamr@2: TUint iMaxBitRate; williamr@2: RArray iMaxPictureRates; williamr@2: TUint iMaxInLayerScalabilitySteps; williamr@2: TUint32 iSupportedPictureOptions; williamr@2: TBool iSupportsPictureLoss; williamr@2: TBool iSupportsSliceLoss; williamr@2: HBufC8* iCodingStandardSpecificInfo; williamr@2: HBufC8* iImplementationSpecificInfo; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: CMMFDevVideoRecord is the main client class of DevVideoRecord. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class CMMFDevVideoRecord : public CBase, private MMMFDevVideoRecordProxy williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Class to define the picture counters available through GetPictureCounters. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class TPictureCounters williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Default constructor. Zeros all members. williamr@2: */ williamr@2: inline TPictureCounters(); williamr@2: public: williamr@2: /** The number of pictures skipped due to lack of output buffers. */ williamr@2: TUint iPicturesSkippedBufferOverflow; williamr@2: williamr@2: /** The number of pictures skipped due to lack of processing power. */ williamr@2: TUint iPicturesSkippedProcPower; williamr@2: williamr@2: /** The number of pictures skipped for bit-rate control purposes. */ williamr@2: TUint iPicturesSkippedRateControl; williamr@2: williamr@2: /** The number of processed (i.e. pre-processed and encoded) input pictures. */ williamr@2: TUint iPicturesProcessed; williamr@2: williamr@2: /** The total number of input pictures. When using direct capture, this is the total number of williamr@2: pictures captured, otherwise it is the total number of input pictures written by the client. */ williamr@2: TUint iInputPictures; williamr@2: }; williamr@2: williamr@2: williamr@2: public: williamr@2: /** williamr@2: Creates a new CMMFDevVideoRecord object. williamr@2: @param "aObserver" "The observer object to use. The observer callbacks are used to return input buffers williamr@2: back to the client." williamr@2: @return "A new CMMFDevVideoRecord object. williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrHardwareNotAvailable - Not enough free video processing hardware resources williamr@2: - KErrNoMemory - Not enough free memory available" williamr@2: */ williamr@2: IMPORT_C static CMMFDevVideoRecord* NewL(MMMFDevVideoRecordObserver& aObserver); williamr@2: williamr@2: /** williamr@2: Destructor. williamr@2: */ williamr@2: IMPORT_C ~CMMFDevVideoRecord(); williamr@2: williamr@2: /** williamr@2: Finds all available encoders for a given video type with support for certain pre-processing operations. williamr@2: The video type is specified using its MIME type, which may include parameters specifying the supported williamr@2: level, version, and other information. Encoder hardware devices can use wildcards when listing the williamr@2: supported video types in the ECom registration information, so it is possible that all the encoders williamr@2: returned do not support the specified submode, e.g. profile and level, unless aExactMatch is set. williamr@2: williamr@2: The encoder capabilities can be checked with VideoEncoderInfoLC(). williamr@2: williamr@2: @param "aMimeType" "The video type that will be encoded." williamr@2: @param "aPreProcType" "The pre-processing types that the encoder has to support, a binary OR of williamr@2: TPrePostProcessType values. If no pre-processing support is needed, set this williamr@2: value to zero." williamr@2: @param "aEncoders" "An array for the result encoder UIDs. The array must be created and destroyed williamr@2: by the caller." williamr@2: @param "aExactMatch" "True if exact matching should be used. In this case only encoders that support williamr@2: exactly the MIME-type given will be returned. Since verifying this may require williamr@2: loading the encoders into memory, this can be a fairly expensive operation, and williamr@2: if the user needs to verify their capabilities further in any case this parameter williamr@2: should be set to EFalse." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: -KErrNotFound - No encoders were found matching the search parameters." williamr@2: */ williamr@2: IMPORT_C void FindEncodersL(const TDesC8& aMimeType, williamr@2: TUint32 aPreProcType, williamr@2: RArray& aEncoders, williamr@2: TBool aExactMatch=ETrue); williamr@2: williamr@2: /** williamr@2: Finds all available pre-processors for a given set of pre-processing operations. williamr@2: williamr@2: @param "aPreProcType" "The pre-processing types that the device has to support, a binary OR of williamr@2: TPrePostProcessType values." williamr@2: @param "aPreProcessors" "An array for the result pre-processor UIDs. The array must be created and williamr@2: destroyed by the caller." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotFound - No pre-processors were found matching the search parameters." williamr@2: */ williamr@2: IMPORT_C void FindPreProcessorsL(TUint32 aPreProcType, RArray& aPreProcessors); williamr@2: williamr@2: /** williamr@2: Retrieves a list of available video encoders in the system. williamr@2: @param "aEncoders" "An array for the result encoder UIDs. The array must be created and destroyed by williamr@2: the caller." williamr@2: @leave "The method will leave if an error occurs. Not finding any encoders is not treated as an error williamr@2: condition: in this situation, aEncoders will be empty." williamr@2: */ williamr@2: IMPORT_C void GetEncoderListL(RArray& aEncoders); williamr@2: williamr@2: /** williamr@2: Retrieves a list of available video pre-processor hardware devices in the system. williamr@2: @param "aPreProcessors" "An array for the result pre-processor UIDs. The array must be created and williamr@2: destroyed by the caller." williamr@2: @leave "The method will leave if an error occurs. Not finding any pre-processors is not treated as an williamr@2: error condition: in this situation, aPreProcessors will be empty." williamr@2: */ williamr@2: IMPORT_C void GetPreProcessorListL(RArray& aPreProcessors); williamr@2: williamr@2: /** williamr@2: Retrieves information about an installed video encoder. Note that this method will need to load the williamr@2: encoder hardware device into memory, and can thus be relatively expensive. williamr@2: @param "aVideoEncoder" "The video encoder device to query." 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 "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotFound - No encoder was found with the given UID" williamr@2: */ williamr@2: IMPORT_C CVideoEncoderInfo* VideoEncoderInfoLC(TUid aVideoEncoder); williamr@2: williamr@2: /** williamr@2: Retrieves information about the pre-processing capabilities of an installed pre-processor or encoder williamr@2: hardware device. Note that this method will need to load the device into memory, and can thus be williamr@2: relatively expensive. williamr@2: @param "aPreProcessor" "The device to query." williamr@2: @return "Pre-processor information as a CPreProcessorInfo object. The object is pushed to the cleanupstack, williamr@2: and must be deallocated by the caller." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotFound - No pre-processor was found with the given UID" williamr@2: */ williamr@2: IMPORT_C CPreProcessorInfo* PreProcessorInfoLC(TUid aPreProcessor); williamr@2: williamr@2: /** williamr@2: Selects the video encoder to be used. This method must be called before any other video encoder related williamr@2: methods are used. The encoder can be changed by calling this method again before the system has been williamr@2: initialized with Initialize(). williamr@2: williamr@2: All video encoder settings are reset to their default values. By default no pre-processing is performed. williamr@2: williamr@2: @param "aEncoder" "The video encoder to use." williamr@2: @return "Hardware device ID, used in other methods for configuring the encoder." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotFound - No encoder was found with the given UID" williamr@2: @pre "This method can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C THwDeviceId SelectEncoderL(TUid aEncoder); williamr@2: williamr@2: /** williamr@2: Selects the video pre-processor to be used. This method must be called before any other pre-processor williamr@2: related methods are used. The pre-processor to use can be changed by calling this method again before williamr@2: the API has been initialized with Initialize(). williamr@2: williamr@2: All pre-processor settings are reset to their default values. By default no pre-processing is performed. williamr@2: williamr@2: @param "aPreProcessor" "The pre-processor to use." williamr@2: @return "Hardware device ID, used in other methods for configuring the pre-processor." williamr@2: @leave "The method will leave if an error occurs. Typical error codes used: williamr@2: - KErrNotFound - No pre-processor was found with the given UID" williamr@2: @pre "This method can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C THwDeviceId SelectPreProcessorL(TUid aPreProcessor); williamr@2: williamr@2: /** williamr@2: Sets the input format for a hardware device. 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 the williamr@2: first device in the system is the input format for video input data. williamr@2: williamr@2: The method has to be called for both direct capture as well as memory buffer input. The camera API williamr@2: must be initialized by the device using it for capture, since there is no way to query the current williamr@2: format from the camera API. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() williamr@2: or SelectPreProcessorL() when the device is selected." 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 can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetInputFormatL(THwDeviceId aHwDevice, williamr@2: const TUncompressedVideoFormat& aFormat, williamr@2: const TSize& aPictureSize); williamr@2: williamr@2: /** williamr@2: Sets the data source to be a camera, and sets the system to use direct capture for input. The first williamr@2: hardware device (pre-processor if both encoder and pre-processor are used, encoder otherwise) must williamr@2: support direct capture. williamr@2: williamr@2: @param "aCameraHandle" "A camera handle for the camera to use. The handle is passed to williamr@2: 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 can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetSourceCameraL(TInt aCameraHandle, TReal aPictureRate); 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. If pictures may be skipped williamr@2: in the input data due to performance reasons, this flag cannot be set." williamr@2: @param "aProcessRealtime" "True if real-time processing is needed, false if not. Real-time williamr@2: processing is typically needed 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 can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetSourceMemoryL(TReal aMaxPictureRate, TBool aConstantPictureRate, TBool aProcessRealtime); williamr@2: williamr@2: /** williamr@2: Sets the output format for a hardware device to a compressed video format. Only applicable for encoder williamr@2: devices. The picture size depends on the input data format and possible scaling performed. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from williamr@2: SelectEncoderL()when the device is selected." 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 can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetOutputFormatL(THwDeviceId aHwDevice, williamr@2: const CCompressedVideoFormat& aFormat, williamr@2: TVideoDataUnitType aDataUnitType, williamr@2: TVideoDataUnitEncapsulation aDataEncapsulation, williamr@2: TBool aSegmentationAllowed=EFalse); williamr@2: williamr@2: /** williamr@2: Sets the output format for a hardware device to an uncompressed video format. Only applicable for williamr@2: pre-processor devices. The picture size depends on the input data format and possible scaling performed. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from SelectPreProcessorL() williamr@2: when the device is selected." 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetOutputFormatL(THwDeviceId aHwDevice, const TUncompressedVideoFormat& aFormat); williamr@2: williamr@2: /** williamr@2: Sets the clock source to use for video timing. When video recording is synchronized with audio, the clock williamr@2: source is implemented by the audio playback subsystem, otherwise the clock source should get the time williamr@2: from the system clock. This method can be called after all hardware devices have been selected, but williamr@2: before calling Initialize(). 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 a williamr@2: clock source, the timestamps in the output data may not be valid. All encoders must support williamr@2: synchronization with an external clock source, as well as unsynchronized non-realtime operation. williamr@2: williamr@2: @param "aClock" "The clock source to use." williamr@2: @pre "This method can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetClockSource(MMMFClockSource* aClock); 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 williamr@2: output format, so typically calling this method is not necessary. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() williamr@2: or SelectPreProcessorL() when the device is selected." williamr@2: @param "aRgbRange" "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 can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetRgbToYuvOptionsL(THwDeviceId aHwDevice, TRgbRange aRgbRange, const TYuvFormat& aOutputFormat); williamr@2: williamr@2: /** williamr@2: Sets pre-processing options for YUV to YUV data format conversion. By default, the hardware device williamr@2: input and output data formats are used. For encoder devices, the device input format and the closest williamr@2: matching format supported by the encoding process are used. Typically calling this method is not williamr@2: necessary. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() williamr@2: or SelectPreProcessorL() when the device is selected." 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 can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetYuvToYuvOptionsL(THwDeviceId aHwDevice, williamr@2: const TYuvFormat& aInputFormat, williamr@2: const TYuvFormat& aOutputFormat); 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 williamr@2: addition to the base layer. The quality of the encoded video stream progressively improves as williamr@2: enhancement layers 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 can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetNumBitrateLayersL(TUint aNumLayers); 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 williamr@2: from the other 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 supported." williamr@2: @pre "This method can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetScalabilityLayerTypeL(TUint aLayer, TScalabilityType aScalabilityType); williamr@2: williamr@2: williamr@2: /** williamr@2: Sets the reference picture options to be used for all scalability layers. The settings can be williamr@2: overridden 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 number 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 that williamr@2: pictures must be coded in capture/display order." williamr@2: @pre "This method can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetGlobalReferenceOptions(TUint aMaxReferencePictures, TUint aMaxPictureOrderDelay); 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 can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetLayerReferenceOptions(TUint aLayer, TUint aMaxReferencePictures, TUint aMaxPictureOrderDelay); 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 can only be called before the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetBufferOptionsL(const TEncoderBufferOptions& aOptions); williamr@2: williamr@2: /** williamr@2: Sets the encoder output rectangle for encoded video output. This rectangle specifies the part of the williamr@2: input and output pictures which is displayed after encoding. Many video codecs process data in 16x16 williamr@2: pixel units but enable specifying and coding the decoder output rectangle for image sizes that are not williamr@2: multiple of 16 pixels (e.g 160x120). williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() williamr@2: when the device is selected." 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetOutputRectL(THwDeviceId aHwDevice, const TRect& aRect); williamr@2: williamr@2: /** williamr@2: Sets the pre-processing types to be used in a hardware device. [1 #191] If separate encoder and williamr@2: pre-processor devices are used, both can be configured to perform different pre-processing operations. williamr@2: williamr@2: Pre-processing operations are carried out in the following order: williamr@2: williamr@2: 1. Frame stabilisation williamr@2: 2. Input cropping williamr@2: 3. Mirroring williamr@2: 4. Rotating williamr@2: 5. Scaling williamr@2: 6. Output cropping williamr@2: 7. Output padding williamr@2: williamr@2: Color space conversion and color enhancement can be performed at any point in the pre-processing flow. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from williamr@2: SelectEncoderL() or SelectPreProcessorL() when the device is selected." 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetPreProcessTypesL(THwDeviceId aHwDevice, TUint32 aPreProcessTypes); williamr@2: williamr@2: /** williamr@2: Sets pre-processing options for rotation. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() williamr@2: or SelectPreProcessorL() when the device is selected." 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetRotateOptionsL(THwDeviceId aHwDevice, TRotationType aRotationType); williamr@2: williamr@2: /** williamr@2: Sets pre-processing options for scaling. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from williamr@2: SelectEncoderL() or SelectPreProcessorL() when the device is selected." 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetScaleOptionsL(THwDeviceId aHwDevice, const TSize& aTargetSize, TBool aAntiAliasFiltering); 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 "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() or williamr@2: SelectPreProcessorL() when the device is selected." williamr@2: @param "aRect" "The input cropping rectangle specifying the area of the picture to use. The williamr@2: rectangle 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetInputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect); williamr@2: williamr@2: /** williamr@2: Sets pre-processing options for output cropping. Output cropping is performed after other pre-processing williamr@2: operations but before output padding. Output cropping and padding can be used in combination to prepare williamr@2: the picture size to suit the encoder, typically video encoders only support picture sizes that are williamr@2: multiples of 16 pixels. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() or williamr@2: SelectPreProcessorL() when the device is selected." 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetOutputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect); 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 "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() williamr@2: or SelectPreProcessorL() when the device is selected." 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetOutputPadOptionsL(THwDeviceId aHwDevice, const TSize& aOutputSize, const TPoint& aPicturePos); williamr@2: williamr@2: /** williamr@2: Sets color enhancement pre-processing options. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() williamr@2: or SelectPreProcessorL() when the device is selected." 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetColorEnhancementOptionsL(THwDeviceId aHwDevice, const TColorEnhancementOptions& aOptions); williamr@2: williamr@2: /** williamr@2: Sets frame stabilisation options. williamr@2: williamr@2: Frame stabilisation is performed as the first pre-processing operation in the hardware device. The williamr@2: stabilisation process gets the complete hardware device input picture as its input, and it produces a williamr@2: smaller stabilised output picture. The rest of the processing in the hardware device is done using the williamr@2: stabilisation output picture. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() williamr@2: or SelectPreProcessorL() when the device is selected." williamr@2: @param "aOutputSize" "Output picture size. The output picture must 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 williamr@2: is 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetFrameStabilisationOptionsL(THwDeviceId aHwDevice, williamr@2: const TSize& aOutputSize, williamr@2: TBool aFrameStabilisation); williamr@2: williamr@2: /** williamr@2: Sets custom implementation-specific pre-processing options. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() williamr@2: or SelectPreProcessorL() when the device is selected." 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetCustomPreProcessOptionsL(THwDeviceId aHwDevice, const TDesC8& aOptions); williamr@2: williamr@2: /** williamr@2: Sets whether bit errors or packets losses can be expected in the video transmission channel. The williamr@2: video encoder 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetErrorsExpected(TBool aBitErrors, TBool aPacketLosses); williamr@2: williamr@2: /** williamr@2: Sets the minimum frequency (in time) for instantaneous random access points in the bitstream. williamr@2: An instantaneous random access point is such where the encoder can achieve a full output picture williamr@2: immediately by encoding 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 of williamr@2: 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetMinRandomAccessRate(TReal aRate); 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 seperately." 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetCodingStandardSpecificOptionsL(const TDesC8& aOptions); 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 implementor." 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 API has been initialized with Initialize(). williamr@2: If called after initialization, the change will only be committed once CommitL() is called." williamr@2: */ williamr@2: IMPORT_C void SetImplementationSpecificEncoderOptionsL(const TDesC8& aOptions); williamr@2: williamr@2: /** williamr@2: Initializes the video devices, and reserves hardware resources. This method is asynchronous, williamr@2: DevVideoRecord will call MMMFDevVideoRecordObserver::MdvroInitializeComplete() after initialization has williamr@2: completed. If direct capture is used, this method also prepares the camera API for capture by calling williamr@2: PrepareVideoCaptureL(). No DevVideoRecord method may be called while initialization is in progress, the williamr@2: initialization process can only be cancelled by destroying the DevVideoRecord object. williamr@2: williamr@2: After initialization has successfully been completed, video capturing and encoding can be started with williamr@2: Start() with a relatively low delay since the hardware has already been set up. williamr@2: williamr@2: If Initialize() fails, the DevVideoRecord object must be destroyed, and set up from scratch. williamr@2: williamr@2: Error handling: Errors are reported using the MdvroInitializeComplete() 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: williamr@2: @pre "This method can only be called before the API has been initialized." williamr@2: */ williamr@2: IMPORT_C void Initialize(); williamr@2: williamr@2: /** williamr@2: Commit all configuration changes since the last CommitL(), Revert() or Initialize(). This only applies williamr@2: to methods that can be called both before AND after DevVideoRecord has been initialized. williamr@2: See the following methods for details. williamr@2: williamr@2: @see SetOutputRectL williamr@2: @see SetPreProcessTypesL williamr@2: @see SetRotateOptionsL williamr@2: @see SetScaleOptionsL williamr@2: @see SetInputCropOptionsL williamr@2: @see SetOutputCropOptionsL williamr@2: @see SetOutputPadOptionsL williamr@2: @see SetColorEnhancementOptionsL williamr@2: @see SetFrameStabilisationOptionsL williamr@2: @see SetCustomPreProcessOptionsL williamr@2: @see SetCodingStandardSpecificOptionsL williamr@2: @see 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void CommitL(); williamr@2: williamr@2: /** williamr@2: Revert any configuration changes that have not yet been committed using CommitL(). This only applies williamr@2: to methods that can be called both before AND after DevVideoRecord has been initialized. williamr@2: See the following methods for details. williamr@2: williamr@2: @see SetOutputRectL williamr@2: @see SetPreProcessTypesL williamr@2: @see SetRotateOptionsL williamr@2: @see SetScaleOptionsL williamr@2: @see SetInputCropOptionsL williamr@2: @see SetOutputCropOptionsL williamr@2: @see SetOutputPadOptionsL williamr@2: @see SetColorEnhancementOptionsL williamr@2: @see SetFrameStabilisationOptionsL williamr@2: @see SetCustomPreProcessOptionsL williamr@2: @see SetCodingStandardSpecificOptionsL williamr@2: @see SetImplementationSpecificEncoderOptionsL williamr@2: williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void Revert(); 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C HBufC8* CodingStandardSpecificInitOutputLC(); 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C HBufC8* ImplementationSpecificInitOutputLC(); 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. When unequal error protection is used, williamr@2: the encoder should code pictures so that they can be divided into number of williamr@2: unequal error protection levels having an ascending order of importance in williamr@2: the quality of decoded pictures, with level zero indicating the least important level. williamr@2: The encoder should map the requested bit-rate scalability layers and in-layer williamr@2: bit-rate scalability steps to the unequal error protection levels. In williamr@2: addition, the encoder may use coded sub-pictures to divide coded pictures williamr@2: to different regions of interest or data partitions to divide coded segments williamr@2: into pieces of different importance." 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. If each unequal error protection level (e.g. a data partition) williamr@2: of coded data unit is encapsulated in its own output buffer, the caller can williamr@2: transmit the output buffers in different logical channels or can apply a williamr@2: different amount of application-level forward error coding for different williamr@2: output buffers. If all unequal error protection levels (e.g. data partitions) williamr@2: of coded data unit are encapsulated in the same output buffer, the caller can williamr@2: apply a forward error control mechanism that protects the beginning of the williamr@2: output buffer better than the remaining of the output buffer." 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetErrorProtectionLevelsL(TUint aNumLevels, TBool aSeparateBuffers); 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 williamr@2: protection 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 can be williamr@2: specified using values from TErrorControlStrength (EFecStrengthNone, EFecStrengthLow, williamr@2: EFecStrengthNormal, EFecStrengthHigh), or with intermediate values between those williamr@2: 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetErrorProtectionLevelL(TUint aLevel, TUint aBitrate, TUint aStrength); 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 williamr@2: 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 williamr@2: is not available." williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetChannelPacketLossRate(TUint aLevel, TReal aLossRate, TTimeIntervalMicroSeconds32 aLossBurstLength); 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetChannelBitErrorRate(TUint aLevel, TReal aErrorRate, TReal aStdDeviation); williamr@2: williamr@2: /** williamr@2: Sets the target size of each coded video segment. The segment target size can be specified in terms williamr@2: of 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 layers williamr@2: 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetSegmentTargetSize(TUint aLayer, TUint aSizeBytes, TUint aSizeMacroblocks); 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 available. williamr@2: 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetRateControlOptions(TUint aLayer, const TRateControlOptions& aOptions); 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. See the definition of TInLayerScalabilityType williamr@2: for more information." 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 possible williamr@2: 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetInLayerScalabilityL(TUint aLayer, williamr@2: TUint aNumSteps, williamr@2: TInLayerScalabilityType aScalabilityType, williamr@2: const TArray& aBitrateShare, williamr@2: const TArray& aPictureShare); 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 encoding this enhancement layer if only the lower layers were williamr@2: encoded 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetLayerPromotionPointPeriod(TUint aLayer, TUint aPeriod); 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 output. The data format is coding-standard specific and defined williamr@2: separately. The buffer is pushed to the cleanup stack, and the caller is responsible for williamr@2: deallocating it." williamr@2: @leave "The method will leave if an error occurs." williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C HBufC8* CodingStandardSpecificSettingsOutputLC(); 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C HBufC8* ImplementationSpecificSettingsOutputLC(); williamr@2: williamr@2: /** williamr@2: Writes an uncompressed input picture. The picture must remain valid and unmodified until it is returned williamr@2: with the MdvroReturnPicture() callback. This method must not be called if direct capture is 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void WritePictureL(TVideoPicture* aPicture); 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. williamr@2: This variant encodes the information to the next possible picture. williamr@2: williamr@2: @param "aData" "Supplemental information data to send. The buffer can be reused immediately after the williamr@2: method returns." 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SendSupplementalInfoL(const TDesC8& aData); williamr@2: williamr@2: /** williamr@2: Requests the encoder to send 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 whose presentation timestamp is equal to or greater than williamr@2: and closest to the value of aTimestamp. williamr@2: williamr@2: @param "aData" "Supplemental information data to send. The buffer can be reused immediately williamr@2: after the method returns." williamr@2: @param "aTimestamp" "Timestamp for the picture in which the supplemental information should be williamr@2: included. If the timestamp is in the past, the supplemental information will williamr@2: 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SendSupplementalInfoL(const TDesC8& aData, const TTimeIntervalMicroSeconds& aTimestamp); 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void CancelSupplementalInfo(); williamr@2: williamr@2: /** williamr@2: Notifies the system that the end of input data has been reached. No more input data can be written williamr@2: through the API. The encoder and pre-processor can use this signal to ensure that the remaining data williamr@2: gets processed, without waiting for new data. After the remaining data has been processed, the client williamr@2: gets notified by the MdvroStreamEnd() callback. williamr@2: williamr@2: This method is mainly useful for file-to-file conversions and other non-realtime processing. For williamr@2: real-time recording all pictures are processed or discarded according to their timestamps. williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void InputEnd(); 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void Start(); 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void Stop(); williamr@2: williamr@2: /** williamr@2: Pauses video recording. Recording can be resumed using Resume(). williamr@2: williamr@2: While video is paused, new pictures are not captured, and input pictures written using WritePictureL() williamr@2: are discarded. Timestamps are not incremented - the encoder assumes that the clock source is paused as williamr@2: well, and input picture timestamps are adjusted accordingly. Pause is typically used in video recording williamr@2: applications to pause recording, conversational applications should use Freeze() instead. williamr@2: williamr@2: Note: The client has to ensure that the clock source is paused properly. If the paused picture should williamr@2: be shown longer than normal, the client should either adjust input picture timestamps, or start williamr@2: recording (when using direct capture) some time after restarting the clock source. williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void Pause(); williamr@2: williamr@2: /** williamr@2: Resumes video recording after a pause. williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void Resume(); williamr@2: williamr@2: /** williamr@2: Freezes the input picture. Freezing is similar to a pause, except that timestamps are incremented williamr@2: normally during a freeze. Normal encoding can be continued using ReleaseFreeze(). williamr@2: williamr@2: Freeze is typically used in video telephony applications to stop sending new pictures. In that situation williamr@2: the audio encoding can still continue normally, and thus the clock source timestamps are incremented williamr@2: normally. When the freeze is released, the encoder assumes that input picture timestamps have been williamr@2: incremented normally. If direct capture is used, the picture timestamps are updated as if encoding had williamr@2: been going on throughout the freeze. williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void Freeze(); 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void ReleaseFreeze(); 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C TTimeIntervalMicroSeconds RecordingPosition(); 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void GetOutputBufferStatus(TUint& aNumFreeBuffers, TUint& aTotalFreeBytes); 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void GetPictureCounters(TPictureCounters& aCounters); williamr@2: williamr@2: /** williamr@2: Reads the frame stabilisation output picture position. This information can be used for positioning williamr@2: the viewfinder. The position returned is the stabilisation result for the most recent input picture. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to query. The value is returned from SelectEncoderL() or williamr@2: SelectPreProcessorL() when the device is selected." williamr@2: @param "aRect" "The position of the stabilisation output picture inside the input picture. If williamr@2: frame stabilisation is not used, the rectangle is set to cover the entire input williamr@2: picture." williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void GetFrameStabilisationOutput(THwDeviceId aHwDevice, TRect& aRect); williamr@2: williamr@2: /** williamr@2: Returns the number of output buffers currently containing valid output data. williamr@2: williamr@2: @return "The number of output buffers with valid output data." williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C TUint NumDataBuffers(); williamr@2: williamr@2: /** williamr@2: Retrieves the next output buffer, in coding order. The buffer must be returned using ReturnBuffer() when williamr@2: it is no longer used. The maximum amount of buffers that the caller can keep in its use is controlled by williamr@2: the iMinNumOutputBuffers and iMinTotalOutputBufferSize fields in the TEncoderBufferOptions settings. williamr@2: williamr@2: @return "The next output buffer, in coding order. If no new buffers are available, the return value williamr@2: is NULL." williamr@2: @leave "The method will leave if an error occurs." williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C TVideoOutputBuffer* NextBufferL(); williamr@2: williamr@2: /** williamr@2: Returns a used output buffer back to the encoder. The buffer can no longer be used by the client. williamr@2: williamr@2: @param "aBuffer" "The buffer to return." williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void ReturnBuffer(TVideoOutputBuffer* aBuffer); williamr@2: williamr@2: /** williamr@2: Indicates a picture loss to the encoder, without specifying the lost picture. The encoder can react to williamr@2: this by transmitting an intra-picture. williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void PictureLoss(); 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: williamr@2: @param "aPictures" "Picture identifiers for the lost pictures. See [6] for a definition of TPictureId." williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void PictureLoss(const TArray& aPictures); williamr@2: williamr@2: /** williamr@2: Indicates a loss of consecutive macroblocks in raster scan order 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 lost macroblocks that are consecutive in raster scan order." williamr@2: @param "aPicture" "The picture number for the picture where the macroblocks were lost. williamr@2: If the picture is not known, aPicture.iIdType is set to ENone." williamr@2: @pre "This method can only be called after the API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture); williamr@2: williamr@2: /** williamr@2: Sends a reference picture selection request to the encoder. The request is delivered as a coding-standard williamr@2: specific binary message. Reference picture selection can be used to select a previous correctly williamr@2: 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void ReferencePictureSelection(const TDesC8& aSelectionData); williamr@2: williamr@2: /** williamr@2: Retrieves the number of complexity control levels available for a hardware device. Devices can support williamr@2: processing the same input data with different computational complexity levels. The complexity level williamr@2: can affect, for example, the motion vector search range used in an encoder. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() or williamr@2: SelectPreProcessorL() when the device is selected." 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C TUint NumComplexityLevels(THwDeviceId aHwDevice); williamr@2: williamr@2: /** williamr@2: Sets the complexity level to use for video processing in a hardware device. The level can be changed at williamr@2: any time. williamr@2: williamr@2: @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() or williamr@2: SelectPreProcessorL() when the device is selected." 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 API has been initialized with Initialize()." williamr@2: */ williamr@2: IMPORT_C void SetComplexityLevel(THwDeviceId aHwDevice, TUint aLevel); williamr@2: williamr@2: /** williamr@2: Retrieves a custom interface to the specified hardware device. williamr@2: @param "aHwDevice" "The hardware device from which the custom interface shall be requested. williamr@2: The value is returned from SelectDecoderL() or SelectPostProcessorL() when williamr@2: the device is selected." williamr@2: @param "aInterface" "Interface UID, defined with the custom interface." williamr@2: @return "Pointer to the interface implementation, or NULL if the device does not williamr@2: implement the interface requested. The return value must be cast to the williamr@2: correct type by the user." williamr@2: */ williamr@2: IMPORT_C TAny* CustomInterface(THwDeviceId aHwDevice, TUid aInterface); williamr@2: williamr@2: private: williamr@2: enum TInitializationState williamr@2: { williamr@2: ENotInitialized = 0x01, williamr@2: EInitializing = 0x02, williamr@2: EInitialized = 0x04, williamr@2: EInitializationFailed = 0x08 williamr@2: }; williamr@2: williamr@2: private: williamr@2: CMMFDevVideoRecord(MMMFDevVideoRecordObserver& aObserver); williamr@2: williamr@2: // Methods to check aHwDevice is valid and return the appropriate HwDevice williamr@2: CMMFVideoRecordHwDevice& VideoRecordHwDevice(THwDeviceId aHwDevice) const; williamr@2: CMMFVideoRecordHwDevice& CapturingHwDevice() const; //returns the first plugin in the chain williamr@2: CMMFVideoEncodeHwDevice& VideoEncodeHwDevice(THwDeviceId aHwDevice) const;// Checks that aHwDevice is valid williamr@2: CMMFVideoPreProcHwDevice& VideoPreProcHwDevice(THwDeviceId aHwDevice) const;// Checks that aHwDevice is valid williamr@2: CMMFVideoEncodeHwDevice& VideoEncodeHwDevice() const; williamr@2: CMMFVideoPreProcHwDevice& VideoPreProcHwDevice() const; williamr@2: CMMFVideoHwDevice& VideoHwDevice(THwDeviceId aHwDevice) const; williamr@2: williamr@2: // Connects the plugins together williamr@2: void ConnectPlugins(); williamr@2: williamr@2: // Check that we are in a valid initialization state williamr@2: // Panics if iInitializationState is not one of aExpected williamr@2: void CheckInitializationState(TUint aExpected); williamr@2: williamr@2: // Methods to handle init complete callbacks from the hw devices williamr@2: void HandlePreProcInitializeComplete(TInt aError); williamr@2: void HandleEncoderInitializeComplete(TInt aError); williamr@2: williamr@2: CMMFVideoEncodeHwDevice* CreateEncoderL(TUid aVideoEncoder); williamr@2: williamr@2: // from MMMFDevVideoRecordProxy williamr@2: virtual void MdvrpNewBuffer(TVideoOutputBuffer* aBuffer); williamr@2: virtual void MdvrpReturnPicture(TVideoPicture* aPicture); williamr@2: virtual void MdvrpSupplementalInfoSent(); williamr@2: virtual void MdvrpFatalError(CMMFVideoHwDevice* aDevice, TInt aError); williamr@2: virtual void MdvrpInitializeComplete(CMMFVideoHwDevice* aDevice, TInt aError); williamr@2: virtual void MdvrpStreamEnd(); williamr@2: williamr@2: private: williamr@2: MMMFDevVideoRecordObserver& iObserver; williamr@2: CMMFVideoEncodeHwDevice* iVideoEncodeHwDevice; williamr@2: CMMFVideoPreProcHwDevice* iVideoPreProcHwDevice; williamr@2: TUint iInitializationState; williamr@2: TUint iNumberOfMdvrpStreamEndCallbacks; williamr@2: williamr@2: TDblQue iVideoOutputBufferQue; williamr@2: TDblQueIter iVideoOutputBufferQueIter; williamr@2: TUint iNumberOfVideoOutputBuffers; williamr@2: TBool iIsPreProcComplete; williamr@2: williamr@2: #ifdef SYMBIAN_MULTIMEDIA_CODEC_API williamr@2: TBool iPuListCreated; williamr@2: RImplInfoPtrArray iPuImplementations; williamr@2: #endif // SYMBIAN_MULTIMEDIA_CODEC_API williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: The MMMFDevVideoObserver class defines the observer mixin-interface that any client using CMMFDevVideoRecord williamr@2: must implement. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class MMMFDevVideoRecordObserver williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Returns a used input video picture back to the caller. The picture memory can be re-used or freed. williamr@2: @param "aPicture" "The picture to return." williamr@2: */ williamr@2: virtual void MdvroReturnPicture(TVideoPicture* aPicture) = 0; williamr@2: williamr@2: /** williamr@2: Signals that the supplemental info send request has completed. The buffer used for supplemental williamr@2: information can be re-used or freed. williamr@2: */ williamr@2: virtual void MdvroSupplementalInfoSent() = 0; williamr@2: williamr@2: /** williamr@2: Notifies the client that one or more new output buffers are available. The client can then use williamr@2: NextBufferL() and related methods to fetch the data. williamr@2: */ williamr@2: virtual void MdvroNewBuffers() = 0; williamr@2: williamr@2: /** williamr@2: Reports a fatal encoding or capturing error to the client. When these williamr@2: errors occur, capturing and encoding is stopped automatically. The client williamr@2: must destroy the CMMFDevVideoRecord object and create a new instance before williamr@2: attempting to continue. Note that scenarios have been identified where williamr@2: MdvroFatalError may get referenced at some point during the execution of a williamr@2: CMMFDevVideoRecord procedure. Therefore CMMFDevVideoRecord object should be williamr@2: deleted outside of MdvroFatalError context in order to avoid accidental williamr@2: access to de-allocated CMMFDevVideoRecord data members. williamr@2: @param "aError" "The error code." williamr@2: */ williamr@2: virtual void MdvroFatalError(TInt aError) = 0; williamr@2: williamr@2: /** williamr@2: Reports that DevVideoRecord initialization has completed. The interface can now be used for video williamr@2: recording. williamr@2: @param "aError" "Initialization error code, KErrNone if no error occurred." williamr@2: */ williamr@2: virtual void MdvroInitializeComplete(TInt aError) = 0; williamr@2: williamr@2: /** williamr@2: Reports that the input video data end has been reached and all pictures have been processed. This williamr@2: method is only called after the client has called InputEnd(). No more output data will be available. williamr@2: */ williamr@2: virtual void MdvroStreamEnd() = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: #include williamr@2: williamr@2: #endif