1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mmf/devvideo/devvideorecord.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,1983 @@
1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __DEVVIDEORECORD_H__
1.20 +#define __DEVVIDEORECORD_H__
1.21 +
1.22 +#include <e32std.h>
1.23 +#include <mmf/devvideo/devvideobase.h>
1.24 +
1.25 +class MMMFDevVideoRecordObserver;
1.26 +class CMMFVideoRecordHwDevice;
1.27 +class CMMFVideoEncodeHwDevice;
1.28 +class CMMFVideoPreProcHwDevice;
1.29 +class TVideoOutputBuffer;
1.30 +
1.31 +/**
1.32 +MMMFDevVideoRecordProxy is the interface the CDevVideoRecord implementation provides for video recording
1.33 +hardware devices. The hardware devices use this interface to report events and send used pictures and
1.34 +new buffers to the client.
1.35 +@publishedAll
1.36 +@released
1.37 +*/
1.38 +class MMMFDevVideoRecordProxy
1.39 + {
1.40 +public:
1.41 + /**
1.42 + Delivers a new coded data unit to the client. The CDevVideoRecord implementation will maintain a list
1.43 + of buffers and implement NumDataBuffers() and NextBufferL() based on those. The buffers will be returned
1.44 + back to the device using ReturnBuffer().
1.45 +
1.46 + @param "aBuffer" "The buffer containing the data to send."
1.47 + */
1.48 + virtual void MdvrpNewBuffer(TVideoOutputBuffer* aBuffer) = 0;
1.49 +
1.50 + /**
1.51 + Returns a used input picture back to the client. Called by the encoder hardware device after the picture
1.52 + has been encoded.
1.53 +
1.54 + @param "aPicture" "The picture to return."
1.55 + */
1.56 + virtual void MdvrpReturnPicture(TVideoPicture* aPicture) = 0;
1.57 +
1.58 + /**
1.59 + Sends a notification to the client that the current supplemental info send request has completed.
1.60 + */
1.61 + virtual void MdvrpSupplementalInfoSent() = 0;
1.62 +
1.63 + /**
1.64 + Reports a fatal error to the client. The device must automatically stop processing video data when
1.65 + such errors occur, and may not do further processing before it has been deleted and re-created.
1.66 +
1.67 + @param "aDevice" "The device that reports the error."
1.68 + @param "aError" "The error code."
1.69 + */
1.70 + virtual void MdvrpFatalError(CMMFVideoHwDevice* aDevice, TInt aError) = 0;
1.71 +
1.72 + /**
1.73 + Reports that an asynchronous Initialize() method has completed. The device is now ready for recording.
1.74 +
1.75 + @param "aDevice" "The device that was initialized."
1.76 + @param "aError" "Initialization result error code, KErrNone if initialization was successful."
1.77 + */
1.78 + virtual void MdvrpInitializeComplete(CMMFVideoHwDevice* aDevice, TInt aError) = 0;
1.79 +
1.80 + /**
1.81 + Reports that the input video data end has been reached and all pictures have been processed. Called
1.82 + by each hardware device after their InputEnd() methods have been called and all data has been processed.
1.83 + The proxy implementation will notify the client about stream end when all hardware devices have called
1.84 + this method.
1.85 + */
1.86 + virtual void MdvrpStreamEnd() = 0;
1.87 + };
1.88 +
1.89 +
1.90 +/**
1.91 +A video output buffer for a single output coded data unit from the encoder. In practice the encoder is
1.92 +likely to inherit its own buffer class from this class, adding its own internal bookkeeping data.
1.93 +@publishedAll
1.94 +@released
1.95 +*/
1.96 +class TVideoOutputBuffer
1.97 + {
1.98 +public:
1.99 + /**
1.100 + Coded video data for this data unit.
1.101 + */
1.102 + TPtrC8 iData;
1.103 +
1.104 + /**
1.105 + Capture timestamp for this data unit. If a single picture is divided into multiple data units,
1.106 + all data units have the same timestamp.
1.107 + */
1.108 + TTimeIntervalMicroSeconds iCaptureTimestamp;
1.109 +
1.110 + /**
1.111 + Identification number indicating the start of the spatial coverage of the data in the output buffer,
1.112 + for example the first macroblock number.
1.113 + */
1.114 + TUint iCoverageStartPosition;
1.115 +
1.116 + /**
1.117 + End of the spatial coverage of the data in the buffer, for example the last macroblock number.
1.118 + The idenfication numbers can be used to match data partitions with each other.
1.119 + */
1.120 + TUint iCoverageEndPosition;
1.121 +
1.122 + /**
1.123 + Order number of the output buffer having the same spatial coverage as an earlier output buffer
1.124 + of the same picture. Used with video pictures or segments that do not fit into an output buffer.
1.125 + The order number of the first output buffer of a particular spatial coverage area is 0. The order
1.126 + number shall be incremented by 1 for each subsequent output buffer having the same coverage in the
1.127 + same coded picture.
1.128 + */
1.129 + TUint iOrderNumber;
1.130 +
1.131 + /**
1.132 + Lowest unequal error protection level present in the buffer. Level 0 indicates that the buffer can
1.133 + be discarded without causing temporal error propagation in the decoder, higher values indicate more
1.134 + important buffers. If unequal error protection is not used, the value is set to 1.
1.135 + */
1.136 + TUint iMinErrorProtectionLevel;
1.137 +
1.138 + /**
1.139 + Highest unequal error protection level present in the buffer. If unequal error protection is not
1.140 + used, the value is set to 1.
1.141 + */
1.142 + TUint iMaxErrorProtectionLevel;
1.143 +
1.144 + /**
1.145 + True if this buffer contains data that is required for decoding several pictures, for example the
1.146 + only copy of a sequence header. A picture needed for motion compensated prediction is not considered
1.147 + "required for decoding several pictures".
1.148 + */
1.149 + TBool iRequiredSeveralPictures;
1.150 +
1.151 + /**
1.152 + True if this buffer contains data that is required for decoding other parts of the same picture,
1.153 + for example the only copy of the picture header.
1.154 + */
1.155 + TBool iRequiredThisPicture;
1.156 +
1.157 + /**
1.158 + The layer number for this picture if layered bit-rate scalability is used. If layers are not used,
1.159 + the layer number is always zero.
1.160 + */
1.161 + TUint iLayer;
1.162 +
1.163 + /**
1.164 + Sub-sequence identifier of the output picture. A sub-sequence is a set of coded pictures within a
1.165 + bit-rate scalability layer. A picture shall reside in one scalability layer and in one sub-sequence
1.166 + only. A sub-sequence shall not depend on any other sub-sequence in the same or in a higher layer.
1.167 + A sub-sequence in layer 0 can be decoded independently of any other sub-sequences. A sub-sequence
1.168 + identifier labels the sub-sequence within a layer. Consecutive sub-sequences within a particular
1.169 + layer in decoding order shall have a different sub-sequence identifier from each other. See Annex D
1.170 + of H.264 | MPEG-4 AVC for further details.
1.171 + */
1.172 + TUint iSubSeqId;
1.173 +
1.174 + /**
1.175 + The in-layer scalability step for the data in the buffer if in-layer scalability is used.
1.176 + If in-layer scalability is not in use, the step is set to zero.
1.177 + */
1.178 + TUint iInLayerScalabilityStep;
1.179 +
1.180 + /**
1.181 + iDataPartitionNumber equal to 0 indicates that data partitioning is not in use. Values of
1.182 + iDataPartitionNumber greater than 0 indicate the data partition number in descending order of
1.183 + importance, i.e. data partition 1 is the most important data partition subjectively. Data
1.184 + partitioning can be used with multiple unequal error protection levels.
1.185 + */
1.186 + TUint iDataPartitionNumber;
1.187 +
1.188 + /**
1.189 + True if this buffer contains data for a random access point.
1.190 + */
1.191 + TBool iRandomAccessPoint;
1.192 +
1.193 + /**
1.194 + Updated HRD/VBV parameters, valid if HRD/VBV is in use and iRandomAccessPoint is true.
1.195 + */
1.196 + TPtrC8 iHrdVbvParams;
1.197 +
1.198 + /**
1.199 + Coding-standard specific data.
1.200 + */
1.201 + TPtrC8 iCodingStandardSpecificData;
1.202 +
1.203 + /**
1.204 + Implementation-specific data.
1.205 + */
1.206 + TPtrC8 iImplementationSpecificData;
1.207 +
1.208 + /**
1.209 + A queue link used internally by the MSL API. The field must not be modified while the buffer is
1.210 + in the MSL API, but can be used by the client before the buffer has been written and after the
1.211 + buffer has been returned.
1.212 + */
1.213 + TDblQueLink iLink;
1.214 + };
1.215 +
1.216 +
1.217 +
1.218 +/**
1.219 +This class contains information about the pre-processing capabilities that an encoder or a pre-processor
1.220 +hardware has. Although it mainly contains static data, it is defined as a complete CBase-derived class
1.221 +since the data is relatively complex and proper memory management is necessary.
1.222 +
1.223 +The objects are created by the pre-processor or encoder devices, and used by the MSL video client code.
1.224 +
1.225 +@publishedAll
1.226 +@released
1.227 +*/
1.228 +class CPreProcessorInfo : public CBase
1.229 + {
1.230 +public:
1.231 + /**
1.232 + Creates and returns a new CPreProcessorInfo object. All data passed into this method is copied.
1.233 + @param "aUid" "The uid of the pre-processor."
1.234 + @param "aManufacturer" "The manufacturer of the pre-processor."
1.235 + @param "aIdentifier" "The manufacturer-specific identifier of the pre-processor."
1.236 + @param "aVersion" "The version of the pre-processor."
1.237 + @param "aAccelerated" "Whether the pre-processor is hw accelerated or not."
1.238 + @param "aSupportsDirectCapture" "Whether the pre-processor supports direct capture."
1.239 + @param "aInputFormats" "An array of the supported input formats."
1.240 + @param "aOutputFormats" "An array of the supported output formats."
1.241 + @param "aSupportedCombinations" "An array of the supported combinations."
1.242 + @param "aSupportsArbitraryScaling" "Whether the pre-processor supports arbitrary scaling."
1.243 + @param "aSupportsAntiAliasedScaling" "Whether the pre-processor supports anti-alias filtering on scaling.""
1.244 + @param "aSupportedScaleFactors" "An array of the supported scale factors if arbitrary scaling isn't suported"
1.245 + @param "aYuvToYuvCapabilities" "The yuv to yuv conversion capabilities of the pre-processor."
1.246 + @param "aSupportedRgbRanges" "The supported rgb ranges."
1.247 + @param "aSupportedRotations" "The supported rotations."
1.248 + @param "aImplementationSpecificInfo" "Implementation-specific information."
1.249 + @return"The newly created CPreProcessorInfo object."
1.250 + @leave "This method may leave with one of the system-wide error codes.
1.251 + */
1.252 + IMPORT_C static CPreProcessorInfo* NewL(TUid aUid,
1.253 + const TDesC& aManufacturer,
1.254 + const TDesC& aIdentifier,
1.255 + TVersion aVersion,
1.256 + TBool aAccelerated,
1.257 + TBool aSupportsDirectCapture,
1.258 + const TArray<TUncompressedVideoFormat>& aInputFormats,
1.259 + const TArray<TUncompressedVideoFormat>& aOutputFormats,
1.260 + const TArray<TUint32>& aSupportedCombinations,
1.261 + TBool aSupportsArbitraryScaling,
1.262 + TBool aSupportsAntiAliasedScaling,
1.263 + const TArray<TScaleFactor>& aSupportedScaleFactors,
1.264 + const TYuvToYuvCapabilities& aYuvToYuvCapabilities,
1.265 + TUint32 aSupportedRgbRanges,
1.266 + TUint32 aSupportedRotations,
1.267 + const TDesC8& aImplementationSpecificInfo);
1.268 +
1.269 + /**
1.270 + Destructor.
1.271 + */
1.272 + IMPORT_C ~CPreProcessorInfo();
1.273 +
1.274 + /**
1.275 + Returns the pre-processor UID.
1.276 + @return "Pre-processor UID."
1.277 + */
1.278 + IMPORT_C TUid Uid() const;
1.279 +
1.280 + /**
1.281 + Returns the hardware device manufacturer.
1.282 + @return "The hardware device manufacturer. The reference is valid until this is destroyed."
1.283 + */
1.284 + IMPORT_C const TDesC& Manufacturer() const;
1.285 +
1.286 + /**
1.287 + Returns the hardware device manufacturer-specific identifier. The combination of the manufacturer
1.288 + and identifier uniquely identifies the plug-in.
1.289 + @return "The hardware device identifier. The reference is valid until this object is destroyed."
1.290 + */
1.291 + IMPORT_C const TDesC& Identifier() const;
1.292 +
1.293 + /**
1.294 + Returns the pre-processor version.
1.295 + @return "Pre-processor version."
1.296 + */
1.297 + IMPORT_C TVersion Version() const;
1.298 +
1.299 + /**
1.300 + Returns whether the plug-in is hardware-accelerated. Hardware-accelerated pre-processors can run on
1.301 + an application DSP or dedicated hardware.
1.302 + @return "True if the pre-processor is hardware-accelerated."
1.303 + */
1.304 + IMPORT_C TBool Accelerated() const;
1.305 +
1.306 + /**
1.307 + Returns whether the hardware device supports direct capture. Pre-processors supporting direct capture
1.308 + can get the input pictures directly from a camera, possibly using an efficient hardware-dependent data
1.309 + path.
1.310 + @return "True if the pre-processor supports direct capture."
1.311 + */
1.312 + IMPORT_C TBool SupportsDirectCapture() const;
1.313 +
1.314 + /**
1.315 + Returns whether the pre-processor supports the given input format.
1.316 + @param "aFormat" "The format to be checked."
1.317 + @return "True if the pre-processor supports the given input format."
1.318 + */
1.319 + IMPORT_C TBool SupportsInputFormat(const TUncompressedVideoFormat& aFormat) const;
1.320 +
1.321 + /**
1.322 + Returns the input formats that the pre-processor supports.
1.323 + @return "An RArray table of supported video formats (TUncompressedVideoFormat). The reference is valid
1.324 + until the CPreProcessorInfo object is destroyed."
1.325 + */
1.326 + IMPORT_C const RArray<TUncompressedVideoFormat>& SupportedInputFormats() const;
1.327 +
1.328 + /**
1.329 + Returns whether the pre-processor supports the given output format.
1.330 + @param "aFormat" "The format to be checked."
1.331 + @return "True if the pre-processor supports the given input format."
1.332 + */
1.333 + IMPORT_C TBool SupportsOutputFormat(const TUncompressedVideoFormat& aFormat) const;
1.334 +
1.335 + /**
1.336 + Returns the output formats that the pre-processor supports.
1.337 + @return "An RArray table of supported video formats (TUncompressedVideoFormat). The reference is valid
1.338 + until the CPreProcessorInfo object is destroyed."
1.339 + */
1.340 + IMPORT_C const RArray<TUncompressedVideoFormat>& SupportedOutputFormats() const;
1.341 +
1.342 + /**
1.343 + Returns whether the pre-processor supports the given pre-processing combination.
1.344 + @param "aCombination" "Pre-processing combination, a bitwise OR of values from TPrePostProcessType."
1.345 + @return "True if the pre-processing combination is supported."
1.346 + */
1.347 + IMPORT_C TBool SupportsCombination(TUint32 aCombination) const;
1.348 +
1.349 + /**
1.350 + Lists all supported pre-processing combinations.
1.351 + @return "An RArray table of pre-processing combinations. Each value is a bitwise OR of values from
1.352 + TPrePostProcessType. The reference is valid until the CPreProcessorInfo object is destroyed."
1.353 + */
1.354 + IMPORT_C const RArray<TUint32>& SupportedCombinations() const;
1.355 +
1.356 + /**
1.357 + Returns whether the pre-processor supports arbitrary scaling.
1.358 + @return "True if arbitrary scaling is supported. If arbitrary scaling is not supported, some specific
1.359 + scale factors can still be available."
1.360 + */
1.361 + IMPORT_C TBool SupportsArbitraryScaling() const;
1.362 +
1.363 + /**
1.364 + Returns whether the hardware device supports anti-aliasing filtering for scaling.
1.365 + @return "True if anti-aliasing filtering is supported."
1.366 + */
1.367 + IMPORT_C TBool SupportsAntiAliasedScaling() const;
1.368 +
1.369 + /**
1.370 + Returns the scaling factors the plug-in supports. If the plug-in supports arbitrary scaling the list
1.371 + is empty - use SupportsArbitraryScaling() first.
1.372 + @return "An RArray list of supported scale factors (TScaleFactor). The reference is valid until the
1.373 + CPreProcessorInfo object is destroyed. If the pre-processor supports arbitrary scaling or
1.374 + no scaling at all, the list is empty."
1.375 + */
1.376 + IMPORT_C const RArray<TScaleFactor>& SupportedScaleFactors() const;
1.377 +
1.378 + /**
1.379 + Returns the YUV to YUV conversion capabilities for the pre-processor.
1.380 + @return "The conversion capabilities, as a TYuvToYuvCapabilities structure. The reference is valid
1.381 + until the CPreProcessorInfo object is destroyed."
1.382 + */
1.383 + IMPORT_C const TYuvToYuvCapabilities& YuvToYuvCapabilities() const;
1.384 +
1.385 + /**
1.386 + Returns RGB value ranges the hardware device supports for RGB to YUV conversion.
1.387 + @return "The supported RGB ranges as a bitwise OR of TRgbRange values."
1.388 + */
1.389 + IMPORT_C TUint32 SupportedRgbRanges() const;
1.390 +
1.391 + /**
1.392 + Returns the rotation types the plug-in supports.
1.393 + @return "The supported rotation types as a bitwise OR of TRotationType values. If the pre-processor
1.394 + does not support rotation, the return value is zero."
1.395 + */
1.396 + IMPORT_C TUint32 SupportedRotations() const;
1.397 +
1.398 + /**
1.399 + Returns implementation-specific information about the pre-processor.
1.400 + @return "Implementation- specific information about the pre-processor. The data format is
1.401 + implementation-specific, and defined separately by the pre-processor supplier. The reference
1.402 + is valid until the CPreProcessorInfo object is destroyed."
1.403 + */
1.404 + IMPORT_C const TDesC8& ImplementationSpecificInfo() const;
1.405 +private:
1.406 + CPreProcessorInfo(TUid aUid,
1.407 + TVersion aVersion,
1.408 + TBool aAccelerated,
1.409 + TBool aSupportsDirectCapture,
1.410 + TBool aSupportsArbitraryScaling,
1.411 + TBool aSupportsAntiAliasedScaling,
1.412 + const TYuvToYuvCapabilities& aYuvToYuvCapabilities,
1.413 + TUint32 aSupportedRgbRanges,
1.414 + TUint32 aSupportedRotations);
1.415 +
1.416 + void ConstructL(const TDesC& aManufacturer,
1.417 + const TDesC& aIdentifier,
1.418 + const TArray<TUncompressedVideoFormat>& aInputFormats,
1.419 + const TArray<TUncompressedVideoFormat>& aOutputFormats,
1.420 + const TArray<TUint32>& aSupportedCombinations,
1.421 + const TArray<TScaleFactor>& aSupportedScaleFactors,
1.422 + const TDesC8& aImplementationSpecificInfo);
1.423 +private:
1.424 + TUid iUid;
1.425 + HBufC* iManufacturer;
1.426 + HBufC* iIdentifier;
1.427 + TVersion iVersion;
1.428 + TBool iAccelerated;
1.429 + TBool iSupportsDirectCapture;
1.430 + RArray<TUncompressedVideoFormat> iInputFormats;
1.431 + RArray<TUncompressedVideoFormat> iOutputFormats;
1.432 + RArray<TUint32> iSupportedCombinations;
1.433 + TBool iSupportsArbitraryScaling;
1.434 + TBool iSupportsAntiAliasedScaling;
1.435 + RArray<TScaleFactor> iSupportedScaleFactors;
1.436 + TYuvToYuvCapabilities iYuvToYuvCapabilities;
1.437 + TUint32 iSupportedRgbRanges;
1.438 + TUint32 iSupportedRotations;
1.439 + HBufC8* iImplementationSpecificInfo;
1.440 + };
1.441 +
1.442 +/**
1.443 +This class contains information about a video encoder hardware device and its capabilities.
1.444 +Although it mainly contains static data, it is defined as a complete CBase-derived class since the
1.445 +data is relatively complex and proper memory management is necessary.
1.446 +
1.447 +The objects are created by the encoder devices, and used by the MSL video client code.
1.448 +
1.449 +@publishedAll
1.450 +@released
1.451 +*/
1.452 +class CVideoEncoderInfo : public CBase
1.453 + {
1.454 +public:
1.455 + /**
1.456 + Creates and returns a new CVideoEncoderInfo object.
1.457 + All data passed in is copied on construction of the object.
1.458 +
1.459 + @param aUid
1.460 + The uid of the encoder.
1.461 + @param aManufacturer
1.462 + The video encoder manufacturer.
1.463 + @param aIdentifier
1.464 + The manufacturer-specific identifier for this encoder.
1.465 + @param aVersion
1.466 + The version of this encoder.
1.467 + @param aAccelerated
1.468 + Whether this encoder is accelerated.
1.469 + @param aSupportsDirectCapture
1.470 + Whether this encoder supports direct capture.
1.471 + @param aSupportedInputFormats
1.472 + An array of the supported input formats.
1.473 + @param aSupportedOutputFormats
1.474 + An array of the supported output formats.
1.475 + @param aMaxPictureSize
1.476 + The maximum supported picture size.
1.477 + @param aSupportedDataUnitTypes
1.478 + The supported data unit types.
1.479 + @param aSupportedDataUnitEncapsulations
1.480 + The supported data unit encapsulations.
1.481 + @param aMaxBitrateLayers
1.482 + The maximum number of bitrate layers supported.
1.483 + @param aSupportsSupplementalEnhancementInfo
1.484 + Whether supplemental enhancement info is supported.
1.485 + @param aMaxUnequalErrorProtectionLevels
1.486 + The maximum unequal error protection level supported.
1.487 + @param aMaxBitRate
1.488 + The maximum bit rate supported.
1.489 + @param aMaxPictureRates
1.490 + An array of the maximum picture size/rates supported.
1.491 + @param aMaxInLayerScalabilitySteps
1.492 + The maximum in-layer scalability steps supported.
1.493 + @param aSupportedPictureOptions
1.494 + The picture options supported.
1.495 + @param aCodingStandardSpecificInfo
1.496 + Coding standard specific info.
1.497 + @param aImplementationSpecificInfo
1.498 + Implementation specific info.
1.499 +
1.500 + @return A new CVideoEncoderInfo object.
1.501 + @leave This method may leave with one of the system-wide error codes.
1.502 + */
1.503 + IMPORT_C static CVideoEncoderInfo* NewL(TUid aUid,
1.504 + const TDesC& aManufacturer,
1.505 + const TDesC& aIdentifier,
1.506 + TVersion aVersion,
1.507 + TBool aAccelerated,
1.508 + TBool aSupportsDirectCapture,
1.509 + const TArray<TUncompressedVideoFormat>& aSupportedInputFormats,
1.510 + const TArray<CCompressedVideoFormat*>& aSupportedOutputFormats,
1.511 + const TSize& aMaxPictureSize,
1.512 + TUint32 aSupportedDataUnitTypes,
1.513 + TUint32 aSupportedDataUnitEncapsulations,
1.514 + TUint aMaxBitrateLayers,
1.515 + TBool aSupportsSupplementalEnhancementInfo,
1.516 + TUint aMaxUnequalErrorProtectionLevels,
1.517 + TUint aMaxBitRate,
1.518 + const TArray<TPictureRateAndSize>& aMaxPictureRates,
1.519 + TUint aMaxInLayerScalabilitySteps,
1.520 + TUint32 aSupportedPictureOptions,
1.521 + TBool aSupportsPictureLoss,
1.522 + TBool aSupportsSliceLoss,
1.523 + const TDesC8& aCodingStandardSpecificInfo,
1.524 + const TDesC8& aImplementationSpecificInfo);
1.525 +
1.526 + /**
1.527 + Destructor.
1.528 + */
1.529 + IMPORT_C ~CVideoEncoderInfo();
1.530 +
1.531 + /**
1.532 + Returns the encoder UID.
1.533 + @return "The encoder UID."
1.534 + */
1.535 + IMPORT_C TUid Uid() const;
1.536 +
1.537 + /**
1.538 + Returns the encoder version.
1.539 + @return "The encoder version."
1.540 + */
1.541 + IMPORT_C TVersion Version() const;
1.542 +
1.543 + /**
1.544 + Returns the encoder hardware device manufacturer.
1.545 + @return "The manufacturer name. The reference is valid until the CVideoEncoderInfo object is destroyed."
1.546 + */
1.547 + IMPORT_C const TDesC& Manufacturer() const;
1.548 +
1.549 + /**
1.550 + Returns the encoder hardware device manufacturer-specific identifier. The combination of the
1.551 + manufacturer and identifier uniquely identifies the plug-in.
1.552 + @return "The identifier. The reference is valid until the CVideoEncoderInfo object is destroyed."
1.553 + */
1.554 + IMPORT_C const TDesC& Identifier() const;
1.555 +
1.556 + /**
1.557 + Returns whether the encoder is hardware-accelerated. Hardware-accelerated encoders can run on an
1.558 + application DSP or dedicated hardware.
1.559 + @return "True if the encoder is hardware-accelerated."
1.560 + */
1.561 + IMPORT_C TBool Accelerated() const;
1.562 +
1.563 + /**
1.564 + Returns whether the encoder supports direct capture. Encoders supporting direct capture can get the
1.565 + input pictures directly from a camera, possibly using an efficient hardware-dependent data path.
1.566 + @return "True if the encoder supports direct capture."
1.567 + */
1.568 + IMPORT_C TBool SupportsDirectCapture() const;
1.569 +
1.570 + /**
1.571 + Returns whether the encoder supports the given input format.
1.572 + @param "aFormat" "The format to check."
1.573 + @return "True if the encoder supports the given input format."
1.574 + */
1.575 + IMPORT_C TBool SupportsInputFormat(const TUncompressedVideoFormat& aFormat) const;
1.576 +
1.577 + /**
1.578 + Returns the input formats that the encoder supports.
1.579 + @return "An RArray table of supported video formats (TUncompressedVideoFormat). The reference is
1.580 + valid until the CVideoEncoderInfo object is destroyed."
1.581 + */
1.582 + IMPORT_C const RArray<TUncompressedVideoFormat>& SupportedInputFormats() const;
1.583 +
1.584 + /**
1.585 + Returns whether the encoder supports the given output format.
1.586 + @param "aFormat" "The format to check."
1.587 + @return "True if the encoder supports the given output format."
1.588 + */
1.589 + IMPORT_C TBool SupportsOutputFormat(const CCompressedVideoFormat& aFormat) const;
1.590 +
1.591 + /**
1.592 + Returns the output formats that the encoder supports.
1.593 + @return "An RArray table of supported video formats (CCompressedVideoFormat). The reference is
1.594 + valid until the CVideoEncoderInfo object is destroyed."
1.595 + */
1.596 + IMPORT_C const RPointerArray<CCompressedVideoFormat>& SupportedOutputFormats() const;
1.597 +
1.598 + /**
1.599 + Returns the maximum picture size the encoder supports.
1.600 + @return "The maximum picture size supported. The reference is valid until the CVideoEncoderInfo
1.601 + object is destroyed."
1.602 + */
1.603 + IMPORT_C const TSize& MaxPictureSize() const;
1.604 +
1.605 + /**
1.606 + Returns the data unit types supported by the encoder.
1.607 + @return "Supported data unit types. The value is a binary OR of values from TVideoDataUnitType."
1.608 + */
1.609 + IMPORT_C TUint32 SupportedDataUnitTypes() const;
1.610 +
1.611 + /**
1.612 + Returns the data unit encapsulation types that the encoder supports.
1.613 + @return "Supported data unit encapsulation types. The value is a binary OR of values from
1.614 + TVideoDataUnitEncapsulation."
1.615 + */
1.616 + IMPORT_C TUint32 SupportedDataUnitEncapsulations() const;
1.617 +
1.618 + /**
1.619 + Returns the maximum number of bit-rate scalability layers supported.
1.620 + @return "Maximum number of bit-rate scalability layers supported, one (1) if layered scalability
1.621 + is not supported."
1.622 + */
1.623 + IMPORT_C TUint MaxBitrateLayers() const;
1.624 +
1.625 + /**
1.626 + Returns whether the encoder implements SendSupplementalInfoL(). If SendSupplementalInfoL() is
1.627 + implemented, the client can send supplemental enhancement information messages as binary strings
1.628 + using that method. If SendSupplementalInfoL() is not implemented, this is not possible, but the
1.629 + encoder can still generate and send coding standard or implementation specific supplemental
1.630 + enhancement information automatically.
1.631 + @return "True if the encoder supports supplemental enhancement information."
1.632 + */
1.633 + IMPORT_C TBool SupportsSupplementalEnhancementInfo() const;
1.634 +
1.635 + /**
1.636 + Returns the maximum number of unequal error protection levels supported.
1.637 + @return "Maximum number of unequal error protection levels supported, one (1) if unequal error
1.638 + protection is not supported."
1.639 + */
1.640 + IMPORT_C TUint MaxUnequalErrorProtectionLevels() const;
1.641 +
1.642 + /**
1.643 + Returns the maximum bit-rate supported by the encoder.
1.644 + @return "Maximum bit-rate supported, in bits per second. KMaxTUint32 can be used if the encoder has no
1.645 + bit-rate restrictions."
1.646 + */
1.647 + IMPORT_C TUint MaxBitrate() const;
1.648 +
1.649 + /**
1.650 + Returns the maximum picture size/rate combinations supported by the encoder. Video encoders can have
1.651 + different maximum picture rate limitations depending on the picture size used.
1.652 + @return "A reference to an array of picture size/rate combinations. The reference remains valid until
1.653 + this object is deleted."
1.654 + */
1.655 + IMPORT_C const RArray<TPictureRateAndSize>& MaxPictureRates() const;
1.656 +
1.657 + /**
1.658 + Returns the maximum number of in-layer scalability steps supported.
1.659 + @return "Maximum number of in-layer scalability steps supported, one (1) if in-layer scalability is
1.660 + not supported."
1.661 + */
1.662 + IMPORT_C TUint MaxInLayerScalabilitySteps() const;
1.663 +
1.664 + /**
1.665 + Returns the input picture options that the encoder supports.
1.666 + @return "Supported input picture options, a bitwise OR of values from TVideoPicture::TVideoPictureOptions."
1.667 + */
1.668 + IMPORT_C TUint32 SupportedPictureOptions() const;
1.669 +
1.670 + /**
1.671 + Returns whether the encoder supports picture loss indications. If true, the encoder implements
1.672 + PictureLoss(), and recovers lost picture contents when it receives the indication.
1.673 + @return "True if the encoder supports picture loss indications."
1.674 + */
1.675 + IMPORT_C TBool SupportsPictureLoss() const;
1.676 +
1.677 + /**
1.678 + Returns whether the encoder supports slice loss indications. If true, the encoder implements
1.679 + SliceLoss(), and recovers lost or damaged macroblocks when it receives the indication.
1.680 + @return "True if the encoder supports slice loss indications."
1.681 + */
1.682 + IMPORT_C TBool SupportsSliceLoss() const;
1.683 +
1.684 + /**
1.685 + Returns coding-standard specific information about the encoder.
1.686 + @return "Coding-standard specific information about the encoder. The data format is coding-standard
1.687 + specific, and defined separately. The reference is valid until the CVideoEncoderInfo object
1.688 + is destroyed."
1.689 + */
1.690 + IMPORT_C const TDesC8& CodingStandardSpecificInfo() const;
1.691 +
1.692 + /**
1.693 + Returns implementation-specific information about the encoder.
1.694 + @return "Implementation-specific information about the encoder. The data format is
1.695 + implementation-specific, and defined separately by the encoder supplier. The reference is valid until
1.696 + the CVideoEncoderInfo object is destroyed."
1.697 + */
1.698 + IMPORT_C const TDesC8& ImplementationSpecificInfo() const;
1.699 +private:
1.700 + CVideoEncoderInfo(TUid aUid,
1.701 + TVersion aVersion,
1.702 + TBool aAccelerated,
1.703 + TBool aSupportsDirectCapture,
1.704 + const TSize& aMaxPictureSize,
1.705 + TUint32 aSupportedDataUnitTypes,
1.706 + TUint32 aSupportedDataUnitEncapsulations,
1.707 + TUint aMaxBitrateLayers,
1.708 + TBool aSupportsSupplementalEnhancementInfo,
1.709 + TUint aMaxUnequalErrorProtectionLevels,
1.710 + TUint aMaxBitRate,
1.711 + TUint aMaxInLayerScalabilitySteps,
1.712 + TUint32 aSupportedPictureOptions,
1.713 + TBool aSupportsPictureLoss,
1.714 + TBool aSupportsSliceLoss);
1.715 + void ConstructL(const TDesC& aManufacturer,
1.716 + const TDesC& aIdentifier,
1.717 + const TArray<TUncompressedVideoFormat>& aSupportedInputFormats,
1.718 + const TArray<CCompressedVideoFormat*>& aSupportedOutputFormats,
1.719 + const TArray<TPictureRateAndSize>& aMaxPictureRates,
1.720 + const TDesC8& aCodingStandardSpecificInfo,
1.721 + const TDesC8& aImplementationSpecificInfo);
1.722 +private:
1.723 + TUid iUid;
1.724 + TVersion iVersion;
1.725 + HBufC* iManufacturer;
1.726 + HBufC* iIdentifier;
1.727 + TBool iAccelerated;
1.728 + TBool iSupportsDirectCapture;
1.729 + RArray<TUncompressedVideoFormat> iSupportedInputFormats;
1.730 + RPointerArray<CCompressedVideoFormat> iSupportedOutputFormats;
1.731 + TSize iMaxPictureSize;
1.732 + TUint32 iSupportedDataUnitTypes;
1.733 + TUint32 iSupportedDataUnitEncapsulations;
1.734 + TUint iMaxBitrateLayers;
1.735 + TBool iSupportsSupplementalEnhancementInfo;
1.736 + TUint iMaxUnequalErrorProtectionLevels;
1.737 + TUint iMaxBitRate;
1.738 + RArray<TPictureRateAndSize> iMaxPictureRates;
1.739 + TUint iMaxInLayerScalabilitySteps;
1.740 + TUint32 iSupportedPictureOptions;
1.741 + TBool iSupportsPictureLoss;
1.742 + TBool iSupportsSliceLoss;
1.743 + HBufC8* iCodingStandardSpecificInfo;
1.744 + HBufC8* iImplementationSpecificInfo;
1.745 + };
1.746 +
1.747 +
1.748 +/**
1.749 +CMMFDevVideoRecord is the main client class of DevVideoRecord.
1.750 +@publishedAll
1.751 +@released
1.752 +*/
1.753 +class CMMFDevVideoRecord : public CBase, private MMMFDevVideoRecordProxy
1.754 + {
1.755 +public:
1.756 + /**
1.757 + Class to define the picture counters available through GetPictureCounters.
1.758 + @publishedAll
1.759 + @released
1.760 + */
1.761 + class TPictureCounters
1.762 + {
1.763 + public:
1.764 + /**
1.765 + Default constructor. Zeros all members.
1.766 + */
1.767 + inline TPictureCounters();
1.768 + public:
1.769 + /** The number of pictures skipped due to lack of output buffers. */
1.770 + TUint iPicturesSkippedBufferOverflow;
1.771 +
1.772 + /** The number of pictures skipped due to lack of processing power. */
1.773 + TUint iPicturesSkippedProcPower;
1.774 +
1.775 + /** The number of pictures skipped for bit-rate control purposes. */
1.776 + TUint iPicturesSkippedRateControl;
1.777 +
1.778 + /** The number of processed (i.e. pre-processed and encoded) input pictures. */
1.779 + TUint iPicturesProcessed;
1.780 +
1.781 + /** The total number of input pictures. When using direct capture, this is the total number of
1.782 + pictures captured, otherwise it is the total number of input pictures written by the client. */
1.783 + TUint iInputPictures;
1.784 + };
1.785 +
1.786 +
1.787 +public:
1.788 + /**
1.789 + Creates a new CMMFDevVideoRecord object.
1.790 + @param "aObserver" "The observer object to use. The observer callbacks are used to return input buffers
1.791 + back to the client."
1.792 + @return "A new CMMFDevVideoRecord object.
1.793 + @leave "The method will leave if an error occurs. Typical error codes used:
1.794 + - KErrHardwareNotAvailable - Not enough free video processing hardware resources
1.795 + - KErrNoMemory - Not enough free memory available"
1.796 + */
1.797 + IMPORT_C static CMMFDevVideoRecord* NewL(MMMFDevVideoRecordObserver& aObserver);
1.798 +
1.799 + /**
1.800 + Destructor.
1.801 + */
1.802 + IMPORT_C ~CMMFDevVideoRecord();
1.803 +
1.804 + /**
1.805 + Finds all available encoders for a given video type with support for certain pre-processing operations.
1.806 + The video type is specified using its MIME type, which may include parameters specifying the supported
1.807 + level, version, and other information. Encoder hardware devices can use wildcards when listing the
1.808 + supported video types in the ECom registration information, so it is possible that all the encoders
1.809 + returned do not support the specified submode, e.g. profile and level, unless aExactMatch is set.
1.810 +
1.811 + The encoder capabilities can be checked with VideoEncoderInfoLC().
1.812 +
1.813 + @param "aMimeType" "The video type that will be encoded."
1.814 + @param "aPreProcType" "The pre-processing types that the encoder has to support, a binary OR of
1.815 + TPrePostProcessType values. If no pre-processing support is needed, set this
1.816 + value to zero."
1.817 + @param "aEncoders" "An array for the result encoder UIDs. The array must be created and destroyed
1.818 + by the caller."
1.819 + @param "aExactMatch" "True if exact matching should be used. In this case only encoders that support
1.820 + exactly the MIME-type given will be returned. Since verifying this may require
1.821 + loading the encoders into memory, this can be a fairly expensive operation, and
1.822 + if the user needs to verify their capabilities further in any case this parameter
1.823 + should be set to EFalse."
1.824 + @leave "The method will leave if an error occurs. Typical error codes used:
1.825 + -KErrNotFound - No encoders were found matching the search parameters."
1.826 + */
1.827 + IMPORT_C void FindEncodersL(const TDesC8& aMimeType,
1.828 + TUint32 aPreProcType,
1.829 + RArray<TUid>& aEncoders,
1.830 + TBool aExactMatch=ETrue);
1.831 +
1.832 + /**
1.833 + Finds all available pre-processors for a given set of pre-processing operations.
1.834 +
1.835 + @param "aPreProcType" "The pre-processing types that the device has to support, a binary OR of
1.836 + TPrePostProcessType values."
1.837 + @param "aPreProcessors" "An array for the result pre-processor UIDs. The array must be created and
1.838 + destroyed by the caller."
1.839 + @leave "The method will leave if an error occurs. Typical error codes used:
1.840 + - KErrNotFound - No pre-processors were found matching the search parameters."
1.841 + */
1.842 + IMPORT_C void FindPreProcessorsL(TUint32 aPreProcType, RArray<TUid>& aPreProcessors);
1.843 +
1.844 + /**
1.845 + Retrieves a list of available video encoders in the system.
1.846 + @param "aEncoders" "An array for the result encoder UIDs. The array must be created and destroyed by
1.847 + the caller."
1.848 + @leave "The method will leave if an error occurs. Not finding any encoders is not treated as an error
1.849 + condition: in this situation, aEncoders will be empty."
1.850 + */
1.851 + IMPORT_C void GetEncoderListL(RArray<TUid>& aEncoders);
1.852 +
1.853 + /**
1.854 + Retrieves a list of available video pre-processor hardware devices in the system.
1.855 + @param "aPreProcessors" "An array for the result pre-processor UIDs. The array must be created and
1.856 + destroyed by the caller."
1.857 + @leave "The method will leave if an error occurs. Not finding any pre-processors is not treated as an
1.858 + error condition: in this situation, aPreProcessors will be empty."
1.859 + */
1.860 + IMPORT_C void GetPreProcessorListL(RArray<TUid>& aPreProcessors);
1.861 +
1.862 + /**
1.863 + Retrieves information about an installed video encoder. Note that this method will need to load the
1.864 + encoder hardware device into memory, and can thus be relatively expensive.
1.865 + @param "aVideoEncoder" "The video encoder device to query."
1.866 + @return "Encoder information as a CVideoEncoderInfo object. The object is pushed to the cleanup stack,
1.867 + and must be deallocated by the caller."
1.868 + @leave "The method will leave if an error occurs. Typical error codes used:
1.869 + - KErrNotFound - No encoder was found with the given UID"
1.870 + */
1.871 + IMPORT_C CVideoEncoderInfo* VideoEncoderInfoLC(TUid aVideoEncoder);
1.872 +
1.873 + /**
1.874 + Retrieves information about the pre-processing capabilities of an installed pre-processor or encoder
1.875 + hardware device. Note that this method will need to load the device into memory, and can thus be
1.876 + relatively expensive.
1.877 + @param "aPreProcessor" "The device to query."
1.878 + @return "Pre-processor information as a CPreProcessorInfo object. The object is pushed to the cleanupstack,
1.879 + and must be deallocated by the caller."
1.880 + @leave "The method will leave if an error occurs. Typical error codes used:
1.881 + - KErrNotFound - No pre-processor was found with the given UID"
1.882 + */
1.883 + IMPORT_C CPreProcessorInfo* PreProcessorInfoLC(TUid aPreProcessor);
1.884 +
1.885 + /**
1.886 + Selects the video encoder to be used. This method must be called before any other video encoder related
1.887 + methods are used. The encoder can be changed by calling this method again before the system has been
1.888 + initialized with Initialize().
1.889 +
1.890 + All video encoder settings are reset to their default values. By default no pre-processing is performed.
1.891 +
1.892 + @param "aEncoder" "The video encoder to use."
1.893 + @return "Hardware device ID, used in other methods for configuring the encoder."
1.894 + @leave "The method will leave if an error occurs. Typical error codes used:
1.895 + - KErrNotFound - No encoder was found with the given UID"
1.896 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.897 + */
1.898 + IMPORT_C THwDeviceId SelectEncoderL(TUid aEncoder);
1.899 +
1.900 + /**
1.901 + Selects the video pre-processor to be used. This method must be called before any other pre-processor
1.902 + related methods are used. The pre-processor to use can be changed by calling this method again before
1.903 + the API has been initialized with Initialize().
1.904 +
1.905 + All pre-processor settings are reset to their default values. By default no pre-processing is performed.
1.906 +
1.907 + @param "aPreProcessor" "The pre-processor to use."
1.908 + @return "Hardware device ID, used in other methods for configuring the pre-processor."
1.909 + @leave "The method will leave if an error occurs. Typical error codes used:
1.910 + - KErrNotFound - No pre-processor was found with the given UID"
1.911 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.912 + */
1.913 + IMPORT_C THwDeviceId SelectPreProcessorL(TUid aPreProcessor);
1.914 +
1.915 + /**
1.916 + Sets the input format for a hardware device. If both a pre-processor and an encoder are used, the
1.917 + pre-processor output format and the encoder input format must be the same. The input format for the
1.918 + first device in the system is the input format for video input data.
1.919 +
1.920 + The method has to be called for both direct capture as well as memory buffer input. The camera API
1.921 + must be initialized by the device using it for capture, since there is no way to query the current
1.922 + format from the camera API.
1.923 +
1.924 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1.925 + or SelectPreProcessorL() when the device is selected."
1.926 + @param "aFormat" "The input format to use."
1.927 + @param "aPictureSize" "The input picture size in pixels."
1.928 + @leave "The method will leave if an error occurs. Typical error codes used:
1.929 + - KErrNotSupported - The input format specified is not supported."
1.930 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.931 + */
1.932 + IMPORT_C void SetInputFormatL(THwDeviceId aHwDevice,
1.933 + const TUncompressedVideoFormat& aFormat,
1.934 + const TSize& aPictureSize);
1.935 +
1.936 + /**
1.937 + Sets the data source to be a camera, and sets the system to use direct capture for input. The first
1.938 + hardware device (pre-processor if both encoder and pre-processor are used, encoder otherwise) must
1.939 + support direct capture.
1.940 +
1.941 + @param "aCameraHandle" "A camera handle for the camera to use. The handle is passed to
1.942 + CCamera::NewDuplicateL() in the camera API."
1.943 + @param "aPictureRate" "Video capture picture rate."
1.944 + @leave "The method will leave if an error occurs. Typical error codes used:
1.945 + - KErrNotSupported - Direct capture is not supported or the picture rate specified is not
1.946 + supported."
1.947 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.948 + */
1.949 + IMPORT_C void SetSourceCameraL(TInt aCameraHandle, TReal aPictureRate);
1.950 +
1.951 + /**
1.952 + Sets the data source to be memory buffers.
1.953 +
1.954 + @param "aMaxPictureRate" "The maximum picture rate for input pictures."
1.955 + @param "aConstantPictureRate" "True if the input picture rate is constant. In that case,
1.956 + aMaxPictureRate specifies the picture rate. If pictures may be skipped
1.957 + in the input data due to performance reasons, this flag cannot be set."
1.958 + @param "aProcessRealtime" "True if real-time processing is needed, false if not. Real-time
1.959 + processing is typically needed for video recording applications, while
1.960 + video conversion and off-line processing applications do not require it."
1.961 + @leave "The method will leave if an error occurs. Typical error codes used:
1.962 + - KErrNotSupported - The picture rate specified is not supported."
1.963 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.964 + */
1.965 + IMPORT_C void SetSourceMemoryL(TReal aMaxPictureRate, TBool aConstantPictureRate, TBool aProcessRealtime);
1.966 +
1.967 + /**
1.968 + Sets the output format for a hardware device to a compressed video format. Only applicable for encoder
1.969 + devices. The picture size depends on the input data format and possible scaling performed.
1.970 +
1.971 + @param "aHwDevice" "The hardware device to configure. The value is returned from
1.972 + SelectEncoderL()when the device is selected."
1.973 + @param "aFormat" "The video format to use."
1.974 + @param "aDataUnitType" "The type of output coded data units."
1.975 + @param "aDataEncapsulation" "Data encapsulation type for output encoded data units."
1.976 + @param "aSegmentationAllowed" "True if a coded data unit can be segmented into multiple output buffers
1.977 + if a single buffer is not large enough."
1.978 + @leave "The method will leave if an error occurs. Typical error codes used:
1.979 + - KErrNotSupported - The format specified is not supported."
1.980 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.981 + */
1.982 + IMPORT_C void SetOutputFormatL(THwDeviceId aHwDevice,
1.983 + const CCompressedVideoFormat& aFormat,
1.984 + TVideoDataUnitType aDataUnitType,
1.985 + TVideoDataUnitEncapsulation aDataEncapsulation,
1.986 + TBool aSegmentationAllowed=EFalse);
1.987 +
1.988 + /**
1.989 + Sets the output format for a hardware device to an uncompressed video format. Only applicable for
1.990 + pre-processor devices. The picture size depends on the input data format and possible scaling performed.
1.991 +
1.992 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectPreProcessorL()
1.993 + when the device is selected."
1.994 + @param "aFormat" "The video format to use."
1.995 + @leave "The method will leave if an error occurs. Typical error codes used:
1.996 + - KErrNotSupported - The format specified is not supported."
1.997 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.998 + */
1.999 + IMPORT_C void SetOutputFormatL(THwDeviceId aHwDevice, const TUncompressedVideoFormat& aFormat);
1.1000 +
1.1001 + /**
1.1002 + Sets the clock source to use for video timing. When video recording is synchronized with audio, the clock
1.1003 + source is implemented by the audio playback subsystem, otherwise the clock source should get the time
1.1004 + from the system clock. This method can be called after all hardware devices have been selected, but
1.1005 + before calling Initialize().
1.1006 +
1.1007 + If no clock source is set, video recording will not be synchronized, but will proceed as fast as
1.1008 + possible, depending on input data and output buffer availability. If direct capturing is used without a
1.1009 + clock source, the timestamps in the output data may not be valid. All encoders must support
1.1010 + synchronization with an external clock source, as well as unsynchronized non-realtime operation.
1.1011 +
1.1012 + @param "aClock" "The clock source to use."
1.1013 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.1014 + */
1.1015 + IMPORT_C void SetClockSource(MMMFClockSource* aClock);
1.1016 +
1.1017 + /**
1.1018 + Sets pre-processing options for RGB to YUV color space conversion. By default, input RGB data is
1.1019 + assumed to use the full value range ([0…255]), and the output YUV format is the hardware device
1.1020 + output format, so typically calling this method is not necessary.
1.1021 +
1.1022 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1.1023 + or SelectPreProcessorL() when the device is selected."
1.1024 + @param "aRgbRange" "Input RGB data range"
1.1025 + @param "aOutputFormat" "Conversion output YUV format."
1.1026 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1027 + - KErrNotSupported - The formats specified are not supported"
1.1028 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.1029 + */
1.1030 + IMPORT_C void SetRgbToYuvOptionsL(THwDeviceId aHwDevice, TRgbRange aRgbRange, const TYuvFormat& aOutputFormat);
1.1031 +
1.1032 + /**
1.1033 + Sets pre-processing options for YUV to YUV data format conversion. By default, the hardware device
1.1034 + input and output data formats are used. For encoder devices, the device input format and the closest
1.1035 + matching format supported by the encoding process are used. Typically calling this method is not
1.1036 + necessary.
1.1037 +
1.1038 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1.1039 + or SelectPreProcessorL() when the device is selected."
1.1040 + @param "aInputFormat" "Conversion input format."
1.1041 + @param "aOutputFormat" "Conversion output format."
1.1042 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1043 + - KErrNotSupported - The formats specified are not supported"
1.1044 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.1045 + */
1.1046 + IMPORT_C void SetYuvToYuvOptionsL(THwDeviceId aHwDevice,
1.1047 + const TYuvFormat& aInputFormat,
1.1048 + const TYuvFormat& aOutputFormat);
1.1049 +
1.1050 + /**
1.1051 + Sets the number of bit-rate scalability layers to use. Set to 1 to disable layered scalability.
1.1052 +
1.1053 + Bit-rate scalability refers to the ability of a coded stream to be decoded at different bit-rates.
1.1054 + Scalable video is typically ordered into hierarchical layers of data. A base layer contains an
1.1055 + individual representation of a video stream and enhancement layers contain refinement data in
1.1056 + addition to the base layer. The quality of the encoded video stream progressively improves as
1.1057 + enhancement layers are added to the base layer.
1.1058 +
1.1059 + @param "aNumLayers" "The number of bit-rate scalability layers to use, set to 1 to disable
1.1060 + scalability."
1.1061 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1062 + - KErrNotSupported - The scalability layers are not supported or too many layers specified."
1.1063 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.1064 + */
1.1065 + IMPORT_C void SetNumBitrateLayersL(TUint aNumLayers);
1.1066 +
1.1067 + /**
1.1068 + Sets the scalability type for a bit-rate scalability layer.
1.1069 +
1.1070 + @param "aLayer" "Layer number. Layers are numbered [0…n-1], where n is the number of layers
1.1071 + available. The first layer is the base layer, it can be decoded independently
1.1072 + from the other layers, and it has the lowest total bitrate."
1.1073 + @param "aScalabilityType" "Layer scalability type."
1.1074 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1075 + - KErrNotSupported - The scalability layers or the specified scalability type are not supported."
1.1076 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.1077 + */
1.1078 + IMPORT_C void SetScalabilityLayerTypeL(TUint aLayer, TScalabilityType aScalabilityType);
1.1079 +
1.1080 +
1.1081 + /**
1.1082 + Sets the reference picture options to be used for all scalability layers. The settings can be
1.1083 + overridden for an individual scalability layer by using SetLayerReferenceOptions().
1.1084 +
1.1085 + @param "aMaxReferencePictures" "The maximum number of reference pictures to be used. More than one
1.1086 + reference frame can be used in the H.264 | MPEG-4 AVC and in some
1.1087 + advanced profiles of MPEG-4 Part 2 and H.263. The minimum value is one."
1.1088 + @param "aMaxPictureOrderDelay" "The maximum picture order delay, in number of pictures. This specifies
1.1089 + the maximum number of pictures that precede any picture in the sequence
1.1090 + in decoding order and follow the picture in presentation order. Pictures
1.1091 + may be coded/decoded in different order from their capture/display order.
1.1092 + Thus, decoded pictures have to be buffered to order them in correct
1.1093 + display order. For example, if one conventional B picture is coded
1.1094 + between P pictures, a one-picture display ordering delay has to be
1.1095 + applied in the decoder. The minimum value is zero, which indicates that
1.1096 + pictures must be coded in capture/display order."
1.1097 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.1098 + */
1.1099 + IMPORT_C void SetGlobalReferenceOptions(TUint aMaxReferencePictures, TUint aMaxPictureOrderDelay);
1.1100 +
1.1101 + /**
1.1102 + Sets the reference picture options to be used for a single scalability layer. These settings override
1.1103 + those set with SetGlobalReferenceOptions().
1.1104 +
1.1105 + @param "aLayer" "Layer number."
1.1106 + @param "aMaxReferencePictures" "The maximum number of reference pictures to be used."
1.1107 + @param "aMaxPictureOrderDelay" "The maximum picture order delay, in number of pictures."
1.1108 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.1109 + */
1.1110 + IMPORT_C void SetLayerReferenceOptions(TUint aLayer, TUint aMaxReferencePictures, TUint aMaxPictureOrderDelay);
1.1111 +
1.1112 + /**
1.1113 + Sets encoder buffering options.
1.1114 +
1.1115 + @param "aOptions" "The buffering options."
1.1116 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1117 + - KErrNotSupported - The specified settings are not supported."
1.1118 + @pre "This method can only be called before the API has been initialized with Initialize()."
1.1119 + */
1.1120 + IMPORT_C void SetBufferOptionsL(const TEncoderBufferOptions& aOptions);
1.1121 +
1.1122 + /**
1.1123 + Sets the encoder output rectangle for encoded video output. This rectangle specifies the part of the
1.1124 + input and output pictures which is displayed after encoding. Many video codecs process data in 16x16
1.1125 + pixel units but enable specifying and coding the decoder output rectangle for image sizes that are not
1.1126 + multiple of 16 pixels (e.g 160x120).
1.1127 +
1.1128 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1.1129 + when the device is selected."
1.1130 + @param "aRect" "The encoder output rectangle."
1.1131 + @leave "The method will leave if an error occurs."
1.1132 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1133 + If called after initialization, the change will only be committed once CommitL() is called."
1.1134 + */
1.1135 + IMPORT_C void SetOutputRectL(THwDeviceId aHwDevice, const TRect& aRect);
1.1136 +
1.1137 + /**
1.1138 + Sets the pre-processing types to be used in a hardware device. [1 #191] If separate encoder and
1.1139 + pre-processor devices are used, both can be configured to perform different pre-processing operations.
1.1140 +
1.1141 + Pre-processing operations are carried out in the following order:
1.1142 +
1.1143 + 1. Frame stabilisation
1.1144 + 2. Input cropping
1.1145 + 3. Mirroring
1.1146 + 4. Rotating
1.1147 + 5. Scaling
1.1148 + 6. Output cropping
1.1149 + 7. Output padding
1.1150 +
1.1151 + Color space conversion and color enhancement can be performed at any point in the pre-processing flow.
1.1152 +
1.1153 + @param "aHwDevice" "The hardware device to configure. The value is returned from
1.1154 + SelectEncoderL() or SelectPreProcessorL() when the device is selected."
1.1155 + @param "aPreProcessTypes" "The pre-processing steps to perform, a bitwise OR of values from
1.1156 + TPrePostProcessType."
1.1157 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1158 + - KErrNotSupported - The pre-processing combination is not supported"
1.1159 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1160 + If called after initialization, the change will only be committed once CommitL() is called."
1.1161 + */
1.1162 + IMPORT_C void SetPreProcessTypesL(THwDeviceId aHwDevice, TUint32 aPreProcessTypes);
1.1163 +
1.1164 + /**
1.1165 + Sets pre-processing options for rotation.
1.1166 +
1.1167 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1.1168 + or SelectPreProcessorL() when the device is selected."
1.1169 + @param "aRotationType" "The rotation to perform."
1.1170 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1171 + - KErrNotSupported - The rotation type is not supported."
1.1172 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1173 + If called after initialization, the change will only be committed once CommitL() is called."
1.1174 + */
1.1175 + IMPORT_C void SetRotateOptionsL(THwDeviceId aHwDevice, TRotationType aRotationType);
1.1176 +
1.1177 + /**
1.1178 + Sets pre-processing options for scaling.
1.1179 +
1.1180 + @param "aHwDevice" "The hardware device to configure. The value is returned from
1.1181 + SelectEncoderL() or SelectPreProcessorL() when the device is selected."
1.1182 + @param "aTargetSize" "Target picture size. If a fixed scale factor size is used, the new
1.1183 + dimensions must be set to:
1.1184 + width=floor(factor*width), height=floor(factor*height).
1.1185 + For example, scaling a QCIF (176x144) picture up by a factor of 4/3
1.1186 + yields a size of 234x192."
1.1187 + @param "aAntiAliasFiltering" "True if anti-aliasing filtering should be used. If the pre-processor
1.1188 + does not support anti-aliased scaling, or supports anti-aliased scaling
1.1189 + only, this argument is ignored."
1.1190 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1191 + - KErrNotSupported - The specified target size is not supported."
1.1192 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1193 + If called after initialization, the change will only be committed once CommitL() is called."
1.1194 + */
1.1195 + IMPORT_C void SetScaleOptionsL(THwDeviceId aHwDevice, const TSize& aTargetSize, TBool aAntiAliasFiltering);
1.1196 +
1.1197 + /**
1.1198 + Sets pre-processing options for input cropping. Input cropping is typically used for digital zooming.
1.1199 +
1.1200 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() or
1.1201 + SelectPreProcessorL() when the device is selected."
1.1202 + @param "aRect" "The input cropping rectangle specifying the area of the picture to use. The
1.1203 + rectangle must fit completely inside the input picture."
1.1204 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1205 + - KErrNotSupported - The specified cropping rectangle is not supported."
1.1206 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1207 + If called after initialization, the change will only be committed once CommitL() is called."
1.1208 + */
1.1209 + IMPORT_C void SetInputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect);
1.1210 +
1.1211 + /**
1.1212 + Sets pre-processing options for output cropping. Output cropping is performed after other pre-processing
1.1213 + operations but before output padding. Output cropping and padding can be used in combination to prepare
1.1214 + the picture size to suit the encoder, typically video encoders only support picture sizes that are
1.1215 + multiples of 16 pixels.
1.1216 +
1.1217 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() or
1.1218 + SelectPreProcessorL() when the device is selected."
1.1219 + @param "aRect" "The output cropping rectangle specifying the area of the picture to use. The
1.1220 + rectangle must fit completely inside the picture."
1.1221 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1222 + - KErrNotSupported - The specified cropping rectangle is not supported."
1.1223 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1224 + If called after initialization, the change will only be committed once CommitL() is called."
1.1225 + */
1.1226 + IMPORT_C void SetOutputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect);
1.1227 +
1.1228 + /**
1.1229 + Sets pre-processing options for output padding. Output padding is performed as the last pre-processing
1.1230 + operation, and typically used to prepare the picture size to suit the encoder. The image is padded with
1.1231 + black pixels.
1.1232 +
1.1233 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1.1234 + or SelectPreProcessorL() when the device is selected."
1.1235 + @param "aOutputSize" "The padded output picture size. The output size must be large enough for the
1.1236 + picture in its new position."
1.1237 + @param "aPicturePos" "The position for the original picture in the new padded picture. The original
1.1238 + picture in its new position must fit completely inside the new picture."
1.1239 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1240 + - KErrNotSupported - The specified padding settings are not supported."
1.1241 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1242 + If called after initialization, the change will only be committed once CommitL() is called."
1.1243 + */
1.1244 + IMPORT_C void SetOutputPadOptionsL(THwDeviceId aHwDevice, const TSize& aOutputSize, const TPoint& aPicturePos);
1.1245 +
1.1246 + /**
1.1247 + Sets color enhancement pre-processing options.
1.1248 +
1.1249 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1.1250 + or SelectPreProcessorL() when the device is selected."
1.1251 + @param "aOptions" "Color enchancement options."
1.1252 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1253 + - KErrNotSupported - The specified settings are not supported."
1.1254 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1255 + If called after initialization, the change will only be committed once CommitL() is called."
1.1256 + */
1.1257 + IMPORT_C void SetColorEnhancementOptionsL(THwDeviceId aHwDevice, const TColorEnhancementOptions& aOptions);
1.1258 +
1.1259 + /**
1.1260 + Sets frame stabilisation options.
1.1261 +
1.1262 + Frame stabilisation is performed as the first pre-processing operation in the hardware device. The
1.1263 + stabilisation process gets the complete hardware device input picture as its input, and it produces a
1.1264 + smaller stabilised output picture. The rest of the processing in the hardware device is done using the
1.1265 + stabilisation output picture.
1.1266 +
1.1267 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1.1268 + or SelectPreProcessorL() when the device is selected."
1.1269 + @param "aOutputSize" "Output picture size. The output picture must size must be smaller than
1.1270 + or equal to the hardware device input picture size."
1.1271 + @param "aFrameStabilisation" "True if frame stabilisation should be used. By default stabilisation
1.1272 + is not used."
1.1273 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1274 + - KErrNotSupported - The specified settings are not supported."
1.1275 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1276 + If called after initialization, the change will only be committed once CommitL() is called."
1.1277 + */
1.1278 + IMPORT_C void SetFrameStabilisationOptionsL(THwDeviceId aHwDevice,
1.1279 + const TSize& aOutputSize,
1.1280 + TBool aFrameStabilisation);
1.1281 +
1.1282 + /**
1.1283 + Sets custom implementation-specific pre-processing options.
1.1284 +
1.1285 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1.1286 + or SelectPreProcessorL() when the device is selected."
1.1287 + @param "aOptions" "Post-processing options. The data format is implementation-specific."
1.1288 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1289 + - KErrNotSupported - The options are not supported."
1.1290 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1291 + If called after initialization, the change will only be committed once CommitL() is called."
1.1292 + */
1.1293 + IMPORT_C void SetCustomPreProcessOptionsL(THwDeviceId aHwDevice, const TDesC8& aOptions);
1.1294 +
1.1295 + /**
1.1296 + Sets whether bit errors or packets losses can be expected in the video transmission channel. The
1.1297 + video encoder can use this information to optimize the bitstream.
1.1298 +
1.1299 + @param "aBitErrors" "True if bit errors can be expected."
1.1300 + @param "aPacketLosses" "True if packet losses can be expected."
1.1301 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1302 + If called after initialization, the change will only be committed once CommitL() is called."
1.1303 + */
1.1304 + IMPORT_C void SetErrorsExpected(TBool aBitErrors, TBool aPacketLosses);
1.1305 +
1.1306 + /**
1.1307 + Sets the minimum frequency (in time) for instantaneous random access points in the bitstream.
1.1308 + An instantaneous random access point is such where the encoder can achieve a full output picture
1.1309 + immediately by encoding data starting from the random access point. The random access point frequency
1.1310 + may be higher than signalled, if the sequence contains scene cuts which typically cause a coding of
1.1311 + a random access point.
1.1312 +
1.1313 + @param "aRate" "Random access point rate, in pictures per second. For example, to request a random
1.1314 + access point every ten seconds, set the value to 0.1."
1.1315 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1316 + If called after initialization, the change will only be committed once CommitL() is called."
1.1317 + */
1.1318 + IMPORT_C void SetMinRandomAccessRate(TReal aRate);
1.1319 +
1.1320 + /**
1.1321 + Sets coding-standard specific encoder options.
1.1322 +
1.1323 + @param "aOptions" "The options to use. The data format for the options is coding-standard specific,
1.1324 + and defined seperately."
1.1325 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1326 + - KErrNotSupported - The specified settings are not supported."
1.1327 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1328 + If called after initialization, the change will only be committed once CommitL() is called."
1.1329 + */
1.1330 + IMPORT_C void SetCodingStandardSpecificOptionsL(const TDesC8& aOptions);
1.1331 +
1.1332 + /**
1.1333 + Sets implementation-specific encoder options.
1.1334 +
1.1335 + @param "aOptions" "The options to use. The data format for the options is specific to the encoder
1.1336 + implementation, and defined separately by the encoder implementor."
1.1337 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1338 + - KErrNotSupported - The specified settings are not supported."
1.1339 + @pre "This method can be called either before or after the API has been initialized with Initialize().
1.1340 + If called after initialization, the change will only be committed once CommitL() is called."
1.1341 + */
1.1342 + IMPORT_C void SetImplementationSpecificEncoderOptionsL(const TDesC8& aOptions);
1.1343 +
1.1344 + /**
1.1345 + Initializes the video devices, and reserves hardware resources. This method is asynchronous,
1.1346 + DevVideoRecord will call MMMFDevVideoRecordObserver::MdvroInitializeComplete() after initialization has
1.1347 + completed. If direct capture is used, this method also prepares the camera API for capture by calling
1.1348 + PrepareVideoCaptureL(). No DevVideoRecord method may be called while initialization is in progress, the
1.1349 + initialization process can only be cancelled by destroying the DevVideoRecord object.
1.1350 +
1.1351 + After initialization has successfully been completed, video capturing and encoding can be started with
1.1352 + Start() with a relatively low delay since the hardware has already been set up.
1.1353 +
1.1354 + If Initialize() fails, the DevVideoRecord object must be destroyed, and set up from scratch.
1.1355 +
1.1356 + Error handling: Errors are reported using the MdvroInitializeComplete() callback method. Typical error
1.1357 + codes used:
1.1358 + - KErrHardwareNotAvailable - Not enough free video processing hardware resources
1.1359 + - KErrNotSupported - The current configuration is not supported.
1.1360 +
1.1361 + @pre "This method can only be called before the API has been initialized."
1.1362 + */
1.1363 + IMPORT_C void Initialize();
1.1364 +
1.1365 + /**
1.1366 + Commit all configuration changes since the last CommitL(), Revert() or Initialize(). This only applies
1.1367 + to methods that can be called both before AND after DevVideoRecord has been initialized.
1.1368 + See the following methods for details.
1.1369 +
1.1370 + @see SetOutputRectL
1.1371 + @see SetPreProcessTypesL
1.1372 + @see SetRotateOptionsL
1.1373 + @see SetScaleOptionsL
1.1374 + @see SetInputCropOptionsL
1.1375 + @see SetOutputCropOptionsL
1.1376 + @see SetOutputPadOptionsL
1.1377 + @see SetColorEnhancementOptionsL
1.1378 + @see SetFrameStabilisationOptionsL
1.1379 + @see SetCustomPreProcessOptionsL
1.1380 + @see SetCodingStandardSpecificOptionsL
1.1381 + @see SetImplementationSpecificEncoderOptionsL
1.1382 +
1.1383 + @leave "The method will leave if an error occurs."
1.1384 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1385 + */
1.1386 + IMPORT_C void CommitL();
1.1387 +
1.1388 + /**
1.1389 + Revert any configuration changes that have not yet been committed using CommitL(). This only applies
1.1390 + to methods that can be called both before AND after DevVideoRecord has been initialized.
1.1391 + See the following methods for details.
1.1392 +
1.1393 + @see SetOutputRectL
1.1394 + @see SetPreProcessTypesL
1.1395 + @see SetRotateOptionsL
1.1396 + @see SetScaleOptionsL
1.1397 + @see SetInputCropOptionsL
1.1398 + @see SetOutputCropOptionsL
1.1399 + @see SetOutputPadOptionsL
1.1400 + @see SetColorEnhancementOptionsL
1.1401 + @see SetFrameStabilisationOptionsL
1.1402 + @see SetCustomPreProcessOptionsL
1.1403 + @see SetCodingStandardSpecificOptionsL
1.1404 + @see SetImplementationSpecificEncoderOptionsL
1.1405 +
1.1406 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1407 + */
1.1408 + IMPORT_C void Revert();
1.1409 +
1.1410 + /**
1.1411 + Returns coding-standard specific initialization output from the encoder. The information can contain,
1.1412 + for example, the MPEG-4 VOL header. This method can be called after Initialize() has been called.
1.1413 +
1.1414 + @return "Coding-standard specific initialization output. The data format is coding-standard specific
1.1415 + and defined separately. The buffer is pushed to the cleanup stack, and the caller is responsible
1.1416 + for deallocating it."
1.1417 + @leave "The method will leave if an error occurs."
1.1418 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1419 + */
1.1420 + IMPORT_C HBufC8* CodingStandardSpecificInitOutputLC();
1.1421 +
1.1422 + /**
1.1423 + Returns implementation-specific initialization output from the encoder. This method can be called after
1.1424 + Initialize() has been called.
1.1425 +
1.1426 + @return "Implementation-specific initialization output. The data format is specific to the encoder
1.1427 + implementation, and defined by the encoder supplier. The buffer is pushed to the cleanup stack,
1.1428 + and the caller is responsible for deallocating it."
1.1429 + @leave "The method will leave if an error occurs."
1.1430 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1431 + */
1.1432 + IMPORT_C HBufC8* ImplementationSpecificInitOutputLC();
1.1433 +
1.1434 + /**
1.1435 + Sets the number of unequal error protection levels. By default unequal error protection is not used.
1.1436 +
1.1437 + @param "aNumLevels" "The number of unequal error protection levels. To disable unequal error
1.1438 + protection, set this value to one. When unequal error protection is used,
1.1439 + the encoder should code pictures so that they can be divided into number of
1.1440 + unequal error protection levels having an ascending order of importance in
1.1441 + the quality of decoded pictures, with level zero indicating the least important level.
1.1442 + The encoder should map the requested bit-rate scalability layers and in-layer
1.1443 + bit-rate scalability steps to the unequal error protection levels. In
1.1444 + addition, the encoder may use coded sub-pictures to divide coded pictures
1.1445 + to different regions of interest or data partitions to divide coded segments
1.1446 + into pieces of different importance."
1.1447 + @param "aSeparateBuffers" "True if each unequal error protection level of a coded data unit shall be
1.1448 + encapsulated in its own output buffer. Ignored if unequal error protection
1.1449 + is not used. If each unequal error protection level (e.g. a data partition)
1.1450 + of coded data unit is encapsulated in its own output buffer, the caller can
1.1451 + transmit the output buffers in different logical channels or can apply a
1.1452 + different amount of application-level forward error coding for different
1.1453 + output buffers. If all unequal error protection levels (e.g. data partitions)
1.1454 + of coded data unit are encapsulated in the same output buffer, the caller can
1.1455 + apply a forward error control mechanism that protects the beginning of the
1.1456 + output buffer better than the remaining of the output buffer."
1.1457 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1458 + - KErrNotSupported - Unequal error protection is not supported."
1.1459 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1460 + */
1.1461 + IMPORT_C void SetErrorProtectionLevelsL(TUint aNumLevels, TBool aSeparateBuffers);
1.1462 +
1.1463 + /**
1.1464 + Sets up an unequal error protection level. If unequal error protection is not used, this method can be
1.1465 + used to control settings for the whole encoded bitstream.
1.1466 +
1.1467 + @param "aLevel" "Error protection level number. This argument is ignored if unequal error
1.1468 + protection is not in use."
1.1469 + @param "aBitrate" "Target bit-rate for this error protection level."
1.1470 + @param "aStrength" "Forward error control strength for this error protection level. The strength can be
1.1471 + specified using values from TErrorControlStrength (EFecStrengthNone, EFecStrengthLow,
1.1472 + EFecStrengthNormal, EFecStrengthHigh), or with intermediate values between those
1.1473 + constants."
1.1474 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1475 + - KErrNotSupported - The specified bit-rate cannot be supported. "
1.1476 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1477 + */
1.1478 + IMPORT_C void SetErrorProtectionLevelL(TUint aLevel, TUint aBitrate, TUint aStrength);
1.1479 +
1.1480 + /**
1.1481 + Sets the expected or prevailing channel conditions for an unequal error protection level, in terms of
1.1482 + expected packet loss rate. The video encoder can use this information to optimize the generated
1.1483 + bitstream.
1.1484 +
1.1485 + @param "aLevel" "Error protection level number. This argument is ignored if unequal error
1.1486 + protection is not in use."
1.1487 + @param "aLossRate" "Packet loss rate, in number of packets lost per second. Set to 0.0 if
1.1488 + packet losses are not expected."
1.1489 + @param "aLossBurstLength" "Expected average packet loss burst length. Set to zero if the information
1.1490 + is not available."
1.1491 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1492 + */
1.1493 + IMPORT_C void SetChannelPacketLossRate(TUint aLevel, TReal aLossRate, TTimeIntervalMicroSeconds32 aLossBurstLength);
1.1494 +
1.1495 + /**
1.1496 + Sets the expected or prevailing channel conditions for an unequal error protection level, in terms of
1.1497 + expected bit error rate. The video encoder can use this information to optimize the generated bitstream.
1.1498 +
1.1499 + @param "aLevel" "Error protection level number. This argument is ignored if unequal error
1.1500 + protection is not in use."
1.1501 + @param "aErrorRate" "Expected bit error rate, as a fraction of the total bits transmitted. Set
1.1502 + to 0.0 if bit errors are not expected."
1.1503 + @param "aStdDeviation" "Expected bit error rate standard deviation."
1.1504 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1505 + */
1.1506 + IMPORT_C void SetChannelBitErrorRate(TUint aLevel, TReal aErrorRate, TReal aStdDeviation);
1.1507 +
1.1508 + /**
1.1509 + Sets the target size of each coded video segment. The segment target size can be specified in terms
1.1510 + of number of bytes per segment, number of macroblocks per segment, or both.
1.1511 +
1.1512 + @param "aLayer" "Layer number. Layers are numbered [0…n-1], where n is the number of layers
1.1513 + available. Use zero if layered bit-rate scalability is not used."
1.1514 + @param "aSizeBytes" "Segment target size in bytes. Set to zero to use unlimited segment size. The
1.1515 + segment size in bytes should include all data that is typically stored or
1.1516 + transmitted for each segment in the format currently in use. This includes all
1.1517 + related headers."
1.1518 + @param "aSizeMacroblocks" "Segment target size in number of macroblocks per segment. Set to zero to
1.1519 + use unlimited segment size."
1.1520 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1521 + */
1.1522 + IMPORT_C void SetSegmentTargetSize(TUint aLayer, TUint aSizeBytes, TUint aSizeMacroblocks);
1.1523 +
1.1524 + /**
1.1525 + Sets the bit-rate control options for a layer. If layered bit-rate scalability is not used, the options
1.1526 + are set for the whole bitstream.
1.1527 +
1.1528 + @param "aLayer" "Layer number. Layers are numbered [0…n-1], where n is the number of layers available.
1.1529 + Use zero if layered bit-rate scalability is not used."
1.1530 + @param "aOptions" "Bit-rate control options."
1.1531 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1532 + */
1.1533 + IMPORT_C void SetRateControlOptions(TUint aLayer, const TRateControlOptions& aOptions);
1.1534 +
1.1535 + /**
1.1536 + Sets in-layer scalability options for a layer. In-layer bit-rate scalability refers to techniques where
1.1537 + a specific part of a single-layer coded stream can be decoded correctly without decoding the leftover
1.1538 + part. For example, B-pictures can be used for this. By default in-layer scalability is not used.
1.1539 +
1.1540 + @param "aLayer" "Layer number. Layers are numbered [0…n-1], where n is the number of layers
1.1541 + available. Use zero if layered bit-rate scalability is not used."
1.1542 + @param "aNumSteps" "The number of in-layer scalability steps to use. Set to one to disable
1.1543 + in-layer scalability."
1.1544 + @param "aScalabilityType" "The scalability type to use. See the definition of TInLayerScalabilityType
1.1545 + for more information."
1.1546 + @param "aBitrateShare" "Bit-rate share for each scalability step. The bit-rate shares are defined
1.1547 + as fractions of total layer bit-rate, with the share for one layer being
1.1548 + aBitrateShare[i]/sum(aBitrateShare). For example, to use 2/3 of the total
1.1549 + bitrate for the first layer and the remaining 1/3 for the second, the array
1.1550 + contents would be {2,1}."
1.1551 + @param "aPictureShare" "Picture rate share for each scalability step. The picture rate shares are
1.1552 + defined similarly to the bit-rate shares. For example, a client wishing to
1.1553 + use two B-pictures between each pair of reference pictures should set the
1.1554 + array contents to {1,2}."
1.1555 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1556 + - KErrNotSupported - In-layer scalability is not supported.
1.1557 + - KErrArgument - Some of the arguments are out of range. For example, it is not possible
1.1558 + to use the specified in-layer scalability setup due to other
1.1559 + constraints (such as the maximum picture order delay)."
1.1560 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1561 + */
1.1562 + IMPORT_C void SetInLayerScalabilityL(TUint aLayer,
1.1563 + TUint aNumSteps,
1.1564 + TInLayerScalabilityType aScalabilityType,
1.1565 + const TArray<TUint>& aBitrateShare,
1.1566 + const TArray<TUint>& aPictureShare);
1.1567 +
1.1568 + /**
1.1569 + Sets the period for layer promotions points for a scalability layer. A layer promotion point is a
1.1570 + picture where it is possible to start encoding this enhancement layer if only the lower layers were
1.1571 + encoded earlier.
1.1572 +
1.1573 + @param "aLayer" "Layer number."
1.1574 + @param "aPeriod" "Layer promotion point period. A value of one signals that each picture should be a
1.1575 + layer promotion point, value two that there is one picture between each promotion
1.1576 + point etc."
1.1577 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1578 + */
1.1579 + IMPORT_C void SetLayerPromotionPointPeriod(TUint aLayer, TUint aPeriod);
1.1580 +
1.1581 + /**
1.1582 + Returns coding-standard specific settings output from the encoder. The information can contain, for
1.1583 + example, some bitstream headers that can change based on settings modified while encoding is in progress.
1.1584 +
1.1585 + @return "Coding-standard specific output. The data format is coding-standard specific and defined
1.1586 + separately. The buffer is pushed to the cleanup stack, and the caller is responsible for
1.1587 + deallocating it."
1.1588 + @leave "The method will leave if an error occurs."
1.1589 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1590 + */
1.1591 + IMPORT_C HBufC8* CodingStandardSpecificSettingsOutputLC();
1.1592 +
1.1593 + /**
1.1594 + Returns implementation-specific settings output from the encoder. The information can contain, for
1.1595 + example, some bitstream headers that can change based on settings modified while encoding is in progress.
1.1596 +
1.1597 + @return "Implementation-specific initialization output. The data format is implementation-specific and
1.1598 + defined separately by the encoder supplier. The buffer is pushed to the cleanup stack, and the
1.1599 + caller is responsible for deallocating it."
1.1600 + @leave "The method will leave if an error occurs."
1.1601 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1602 + */
1.1603 + IMPORT_C HBufC8* ImplementationSpecificSettingsOutputLC();
1.1604 +
1.1605 + /**
1.1606 + Writes an uncompressed input picture. The picture must remain valid and unmodified until it is returned
1.1607 + with the MdvroReturnPicture() callback. This method must not be called if direct capture is used.
1.1608 +
1.1609 + @param "aPicture" "The picture to write."
1.1610 + @leave "The method will leave if an error occurs."
1.1611 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1612 + */
1.1613 + IMPORT_C void WritePictureL(TVideoPicture* aPicture);
1.1614 +
1.1615 + /**
1.1616 + Requests the encoder to sends supplemental information in the bitstream. The information data format is
1.1617 + coding-standard dependent. Only one supplemental information send request can be active at a time.
1.1618 + This variant encodes the information to the next possible picture.
1.1619 +
1.1620 + @param "aData" "Supplemental information data to send. The buffer can be reused immediately after the
1.1621 + method returns."
1.1622 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1623 + - KErrNotSupported - Supplemental information is not supported"
1.1624 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1625 + */
1.1626 + IMPORT_C void SendSupplementalInfoL(const TDesC8& aData);
1.1627 +
1.1628 + /**
1.1629 + Requests the encoder to send supplemental information in the bitstream. The information data format is
1.1630 + coding-standard dependent. Only one supplemental information send request can be active at a time. This
1.1631 + variant encodes the information to the picture whose presentation timestamp is equal to or greater than
1.1632 + and closest to the value of aTimestamp.
1.1633 +
1.1634 + @param "aData" "Supplemental information data to send. The buffer can be reused immediately
1.1635 + after the method returns."
1.1636 + @param "aTimestamp" "Timestamp for the picture in which the supplemental information should be
1.1637 + included. If the timestamp is in the past, the supplemental information will
1.1638 + not be sent."
1.1639 + @leave "The method will leave if an error occurs. Typical error codes used:
1.1640 + - KErrNotSupported - Supplemental information is not supported"
1.1641 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1642 + */
1.1643 + IMPORT_C void SendSupplementalInfoL(const TDesC8& aData, const TTimeIntervalMicroSeconds& aTimestamp);
1.1644 +
1.1645 + /**
1.1646 + Cancels the current supplemental information send request. The memory buffer reserved for supplemental
1.1647 + information data can be reused or deallocated after the method returns.
1.1648 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1649 + */
1.1650 + IMPORT_C void CancelSupplementalInfo();
1.1651 +
1.1652 + /**
1.1653 + Notifies the system that the end of input data has been reached. No more input data can be written
1.1654 + through the API. The encoder and pre-processor can use this signal to ensure that the remaining data
1.1655 + gets processed, without waiting for new data. After the remaining data has been processed, the client
1.1656 + gets notified by the MdvroStreamEnd() callback.
1.1657 +
1.1658 + This method is mainly useful for file-to-file conversions and other non-realtime processing. For
1.1659 + real-time recording all pictures are processed or discarded according to their timestamps.
1.1660 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1661 + */
1.1662 + IMPORT_C void InputEnd();
1.1663 +
1.1664 + /**
1.1665 + Starts recording video. This includes capturing pictures from the camera (if direct capture is used),
1.1666 + pre-processing and encoding. Recording will proceed until it is stopped or paused. Initally recording
1.1667 + is stopped.
1.1668 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1669 + */
1.1670 + IMPORT_C void Start();
1.1671 +
1.1672 + /**
1.1673 + Stops recording video. No new pictures will be captured, pre-processed, or encoded. If input pictures
1.1674 + are written while recording is stopped, they will be returned immediately.
1.1675 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1676 + */
1.1677 + IMPORT_C void Stop();
1.1678 +
1.1679 + /**
1.1680 + Pauses video recording. Recording can be resumed using Resume().
1.1681 +
1.1682 + While video is paused, new pictures are not captured, and input pictures written using WritePictureL()
1.1683 + are discarded. Timestamps are not incremented - the encoder assumes that the clock source is paused as
1.1684 + well, and input picture timestamps are adjusted accordingly. Pause is typically used in video recording
1.1685 + applications to pause recording, conversational applications should use Freeze() instead.
1.1686 +
1.1687 + Note: The client has to ensure that the clock source is paused properly. If the paused picture should
1.1688 + be shown longer than normal, the client should either adjust input picture timestamps, or start
1.1689 + recording (when using direct capture) some time after restarting the clock source.
1.1690 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1691 + */
1.1692 + IMPORT_C void Pause();
1.1693 +
1.1694 + /**
1.1695 + Resumes video recording after a pause.
1.1696 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1697 + */
1.1698 + IMPORT_C void Resume();
1.1699 +
1.1700 + /**
1.1701 + Freezes the input picture. Freezing is similar to a pause, except that timestamps are incremented
1.1702 + normally during a freeze. Normal encoding can be continued using ReleaseFreeze().
1.1703 +
1.1704 + Freeze is typically used in video telephony applications to stop sending new pictures. In that situation
1.1705 + the audio encoding can still continue normally, and thus the clock source timestamps are incremented
1.1706 + normally. When the freeze is released, the encoder assumes that input picture timestamps have been
1.1707 + incremented normally. If direct capture is used, the picture timestamps are updated as if encoding had
1.1708 + been going on throughout the freeze.
1.1709 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1710 + */
1.1711 + IMPORT_C void Freeze();
1.1712 +
1.1713 + /**
1.1714 + Releases a frozen input picture. Video capturing and encoding continues normally.
1.1715 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1716 + */
1.1717 + IMPORT_C void ReleaseFreeze();
1.1718 +
1.1719 + /**
1.1720 + Returns the current recording position. The position is the capture timestamp from the latest input
1.1721 + picture, or the capture timestamp for the latest picture captured from the camera when direct capture
1.1722 + is used.
1.1723 +
1.1724 + @return "The current recording position."
1.1725 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1726 + */
1.1727 + IMPORT_C TTimeIntervalMicroSeconds RecordingPosition();
1.1728 +
1.1729 + /**
1.1730 + Gets the current output buffer status. The information includes the number of free output buffers and
1.1731 + the total size of free buffers in bytes.
1.1732 +
1.1733 + @param "aNumFreeBuffers" "Target for the number of free output buffers."
1.1734 + @param "aTotalFreeBytes" "Target for the total free buffer size in bytes."
1.1735 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1736 + */
1.1737 + IMPORT_C void GetOutputBufferStatus(TUint& aNumFreeBuffers, TUint& aTotalFreeBytes);
1.1738 +
1.1739 + /**
1.1740 + Reads various counters related to processed video pictures. See the definition of TPictureCounters
1.1741 + for a description of the counters. The counters are reset when Initialize() or this method is called,
1.1742 + and thus they only include pictures processed since the last call.
1.1743 +
1.1744 + @param "aCounters" "The counter structure to fill."
1.1745 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1746 + */
1.1747 + IMPORT_C void GetPictureCounters(TPictureCounters& aCounters);
1.1748 +
1.1749 + /**
1.1750 + Reads the frame stabilisation output picture position. This information can be used for positioning
1.1751 + the viewfinder. The position returned is the stabilisation result for the most recent input picture.
1.1752 +
1.1753 + @param "aHwDevice" "The hardware device to query. The value is returned from SelectEncoderL() or
1.1754 + SelectPreProcessorL() when the device is selected."
1.1755 + @param "aRect" "The position of the stabilisation output picture inside the input picture. If
1.1756 + frame stabilisation is not used, the rectangle is set to cover the entire input
1.1757 + picture."
1.1758 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1759 + */
1.1760 + IMPORT_C void GetFrameStabilisationOutput(THwDeviceId aHwDevice, TRect& aRect);
1.1761 +
1.1762 + /**
1.1763 + Returns the number of output buffers currently containing valid output data.
1.1764 +
1.1765 + @return "The number of output buffers with valid output data."
1.1766 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1767 + */
1.1768 + IMPORT_C TUint NumDataBuffers();
1.1769 +
1.1770 + /**
1.1771 + Retrieves the next output buffer, in coding order. The buffer must be returned using ReturnBuffer() when
1.1772 + it is no longer used. The maximum amount of buffers that the caller can keep in its use is controlled by
1.1773 + the iMinNumOutputBuffers and iMinTotalOutputBufferSize fields in the TEncoderBufferOptions settings.
1.1774 +
1.1775 + @return "The next output buffer, in coding order. If no new buffers are available, the return value
1.1776 + is NULL."
1.1777 + @leave "The method will leave if an error occurs."
1.1778 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1779 + */
1.1780 + IMPORT_C TVideoOutputBuffer* NextBufferL();
1.1781 +
1.1782 + /**
1.1783 + Returns a used output buffer back to the encoder. The buffer can no longer be used by the client.
1.1784 +
1.1785 + @param "aBuffer" "The buffer to return."
1.1786 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1787 + */
1.1788 + IMPORT_C void ReturnBuffer(TVideoOutputBuffer* aBuffer);
1.1789 +
1.1790 + /**
1.1791 + Indicates a picture loss to the encoder, without specifying the lost picture. The encoder can react to
1.1792 + this by transmitting an intra-picture.
1.1793 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1794 + */
1.1795 + IMPORT_C void PictureLoss();
1.1796 +
1.1797 + /**
1.1798 + Indicates to the encoder the pictures that have been lost. The encoder can react to this by
1.1799 + transmitting an intra-picture.
1.1800 +
1.1801 + @param "aPictures" "Picture identifiers for the lost pictures. See [6] for a definition of TPictureId."
1.1802 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1803 + */
1.1804 + IMPORT_C void PictureLoss(const TArray<TPictureId>& aPictures);
1.1805 +
1.1806 + /**
1.1807 + Indicates a loss of consecutive macroblocks in raster scan order to the encoder.
1.1808 +
1.1809 + @param "aFirstMacroblock" "The first lost macroblock. The macroblocks are numbered such
1.1810 + that the macroblock in the upper left corner of the picture is considered
1.1811 + macroblock number 1 and the number for each macroblock increases from left
1.1812 + to right and then from top to bottom in raster-scan order."
1.1813 + @param "aNumMacroblocks" "The number of lost macroblocks that are consecutive in raster scan order."
1.1814 + @param "aPicture" "The picture number for the picture where the macroblocks were lost.
1.1815 + If the picture is not known, aPicture.iIdType is set to ENone."
1.1816 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1817 + */
1.1818 + IMPORT_C void SliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture);
1.1819 +
1.1820 + /**
1.1821 + Sends a reference picture selection request to the encoder. The request is delivered as a coding-standard
1.1822 + specific binary message. Reference picture selection can be used to select a previous correctly
1.1823 + transmitted picture to use as a reference in case later pictures have been lost.
1.1824 +
1.1825 + @param "aSelectionData" "The reference picture selection request message. The message format is
1.1826 + coding-standard specific, and defined separately."
1.1827 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1828 + */
1.1829 + IMPORT_C void ReferencePictureSelection(const TDesC8& aSelectionData);
1.1830 +
1.1831 + /**
1.1832 + Retrieves the number of complexity control levels available for a hardware device. Devices can support
1.1833 + processing the same input data with different computational complexity levels. The complexity level
1.1834 + can affect, for example, the motion vector search range used in an encoder.
1.1835 +
1.1836 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() or
1.1837 + SelectPreProcessorL() when the device is selected."
1.1838 + @return "The number of complexity control levels available, one if multiple levels are not supported."
1.1839 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1840 + */
1.1841 + IMPORT_C TUint NumComplexityLevels(THwDeviceId aHwDevice);
1.1842 +
1.1843 + /**
1.1844 + Sets the complexity level to use for video processing in a hardware device. The level can be changed at
1.1845 + any time.
1.1846 +
1.1847 + @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() or
1.1848 + SelectPreProcessorL() when the device is selected."
1.1849 + @param "aLevel" "The computational complexity level to use. Level zero (0) is the most complex one,
1.1850 + with the highest quality. Higher level numbers require less processing and may have
1.1851 + lower quality."
1.1852 + @pre "This method can only be called after the API has been initialized with Initialize()."
1.1853 + */
1.1854 + IMPORT_C void SetComplexityLevel(THwDeviceId aHwDevice, TUint aLevel);
1.1855 +
1.1856 + /**
1.1857 + Retrieves a custom interface to the specified hardware device.
1.1858 + @param "aHwDevice" "The hardware device from which the custom interface shall be requested.
1.1859 + The value is returned from SelectDecoderL() or SelectPostProcessorL() when
1.1860 + the device is selected."
1.1861 + @param "aInterface" "Interface UID, defined with the custom interface."
1.1862 + @return "Pointer to the interface implementation, or NULL if the device does not
1.1863 + implement the interface requested. The return value must be cast to the
1.1864 + correct type by the user."
1.1865 + */
1.1866 + IMPORT_C TAny* CustomInterface(THwDeviceId aHwDevice, TUid aInterface);
1.1867 +
1.1868 +private:
1.1869 + enum TInitializationState
1.1870 + {
1.1871 + ENotInitialized = 0x01,
1.1872 + EInitializing = 0x02,
1.1873 + EInitialized = 0x04,
1.1874 + EInitializationFailed = 0x08
1.1875 + };
1.1876 +
1.1877 +private:
1.1878 + CMMFDevVideoRecord(MMMFDevVideoRecordObserver& aObserver);
1.1879 +
1.1880 + // Methods to check aHwDevice is valid and return the appropriate HwDevice
1.1881 + CMMFVideoRecordHwDevice& VideoRecordHwDevice(THwDeviceId aHwDevice) const;
1.1882 + CMMFVideoRecordHwDevice& CapturingHwDevice() const; //returns the first plugin in the chain
1.1883 + CMMFVideoEncodeHwDevice& VideoEncodeHwDevice(THwDeviceId aHwDevice) const;// Checks that aHwDevice is valid
1.1884 + CMMFVideoPreProcHwDevice& VideoPreProcHwDevice(THwDeviceId aHwDevice) const;// Checks that aHwDevice is valid
1.1885 + CMMFVideoEncodeHwDevice& VideoEncodeHwDevice() const;
1.1886 + CMMFVideoPreProcHwDevice& VideoPreProcHwDevice() const;
1.1887 + CMMFVideoHwDevice& VideoHwDevice(THwDeviceId aHwDevice) const;
1.1888 +
1.1889 + // Connects the plugins together
1.1890 + void ConnectPlugins();
1.1891 +
1.1892 + // Check that we are in a valid initialization state
1.1893 + // Panics if iInitializationState is not one of aExpected
1.1894 + void CheckInitializationState(TUint aExpected);
1.1895 +
1.1896 + // Methods to handle init complete callbacks from the hw devices
1.1897 + void HandlePreProcInitializeComplete(TInt aError);
1.1898 + void HandleEncoderInitializeComplete(TInt aError);
1.1899 +
1.1900 + CMMFVideoEncodeHwDevice* CreateEncoderL(TUid aVideoEncoder);
1.1901 +
1.1902 + // from MMMFDevVideoRecordProxy
1.1903 + virtual void MdvrpNewBuffer(TVideoOutputBuffer* aBuffer);
1.1904 + virtual void MdvrpReturnPicture(TVideoPicture* aPicture);
1.1905 + virtual void MdvrpSupplementalInfoSent();
1.1906 + virtual void MdvrpFatalError(CMMFVideoHwDevice* aDevice, TInt aError);
1.1907 + virtual void MdvrpInitializeComplete(CMMFVideoHwDevice* aDevice, TInt aError);
1.1908 + virtual void MdvrpStreamEnd();
1.1909 +
1.1910 +private:
1.1911 + MMMFDevVideoRecordObserver& iObserver;
1.1912 + CMMFVideoEncodeHwDevice* iVideoEncodeHwDevice;
1.1913 + CMMFVideoPreProcHwDevice* iVideoPreProcHwDevice;
1.1914 + TUint iInitializationState;
1.1915 + TUint iNumberOfMdvrpStreamEndCallbacks;
1.1916 +
1.1917 + TDblQue<TVideoOutputBuffer> iVideoOutputBufferQue;
1.1918 + TDblQueIter<TVideoOutputBuffer> iVideoOutputBufferQueIter;
1.1919 + TUint iNumberOfVideoOutputBuffers;
1.1920 + TBool iIsPreProcComplete;
1.1921 +
1.1922 +#ifdef SYMBIAN_MULTIMEDIA_CODEC_API
1.1923 + TBool iPuListCreated;
1.1924 + RImplInfoPtrArray iPuImplementations;
1.1925 +#endif // SYMBIAN_MULTIMEDIA_CODEC_API
1.1926 + };
1.1927 +
1.1928 +
1.1929 +/**
1.1930 +The MMMFDevVideoObserver class defines the observer mixin-interface that any client using CMMFDevVideoRecord
1.1931 +must implement.
1.1932 +@publishedAll
1.1933 +@released
1.1934 +*/
1.1935 +class MMMFDevVideoRecordObserver
1.1936 + {
1.1937 +public:
1.1938 + /**
1.1939 + Returns a used input video picture back to the caller. The picture memory can be re-used or freed.
1.1940 + @param "aPicture" "The picture to return."
1.1941 + */
1.1942 + virtual void MdvroReturnPicture(TVideoPicture* aPicture) = 0;
1.1943 +
1.1944 + /**
1.1945 + Signals that the supplemental info send request has completed. The buffer used for supplemental
1.1946 + information can be re-used or freed.
1.1947 + */
1.1948 + virtual void MdvroSupplementalInfoSent() = 0;
1.1949 +
1.1950 + /**
1.1951 + Notifies the client that one or more new output buffers are available. The client can then use
1.1952 + NextBufferL() and related methods to fetch the data.
1.1953 + */
1.1954 + virtual void MdvroNewBuffers() = 0;
1.1955 +
1.1956 + /**
1.1957 + Reports a fatal encoding or capturing error to the client. When these
1.1958 + errors occur, capturing and encoding is stopped automatically. The client
1.1959 + must destroy the CMMFDevVideoRecord object and create a new instance before
1.1960 + attempting to continue. Note that scenarios have been identified where
1.1961 + MdvroFatalError may get referenced at some point during the execution of a
1.1962 + CMMFDevVideoRecord procedure. Therefore CMMFDevVideoRecord object should be
1.1963 + deleted outside of MdvroFatalError context in order to avoid accidental
1.1964 + access to de-allocated CMMFDevVideoRecord data members.
1.1965 + @param "aError" "The error code."
1.1966 + */
1.1967 + virtual void MdvroFatalError(TInt aError) = 0;
1.1968 +
1.1969 + /**
1.1970 + Reports that DevVideoRecord initialization has completed. The interface can now be used for video
1.1971 + recording.
1.1972 + @param "aError" "Initialization error code, KErrNone if no error occurred."
1.1973 + */
1.1974 + virtual void MdvroInitializeComplete(TInt aError) = 0;
1.1975 +
1.1976 + /**
1.1977 + Reports that the input video data end has been reached and all pictures have been processed. This
1.1978 + method is only called after the client has called InputEnd(). No more output data will be available.
1.1979 + */
1.1980 + virtual void MdvroStreamEnd() = 0;
1.1981 + };
1.1982 +
1.1983 +
1.1984 +#include <mmf/devvideo/devvideorecord.inl>
1.1985 +
1.1986 +#endif