1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __DEVVIDEORECORD_H__
17 #define __DEVVIDEORECORD_H__
20 #include <mmf/devvideo/devvideobase.h>
22 class MMMFDevVideoRecordObserver;
23 class CMMFVideoRecordHwDevice;
24 class CMMFVideoEncodeHwDevice;
25 class CMMFVideoPreProcHwDevice;
26 class TVideoOutputBuffer;
29 MMMFDevVideoRecordProxy is the interface the CDevVideoRecord implementation provides for video recording
30 hardware devices. The hardware devices use this interface to report events and send used pictures and
31 new buffers to the client.
35 class MMMFDevVideoRecordProxy
39 Delivers a new coded data unit to the client. The CDevVideoRecord implementation will maintain a list
40 of buffers and implement NumDataBuffers() and NextBufferL() based on those. The buffers will be returned
41 back to the device using ReturnBuffer().
43 @param "aBuffer" "The buffer containing the data to send."
45 virtual void MdvrpNewBuffer(TVideoOutputBuffer* aBuffer) = 0;
48 Returns a used input picture back to the client. Called by the encoder hardware device after the picture
51 @param "aPicture" "The picture to return."
53 virtual void MdvrpReturnPicture(TVideoPicture* aPicture) = 0;
56 Sends a notification to the client that the current supplemental info send request has completed.
58 virtual void MdvrpSupplementalInfoSent() = 0;
61 Reports a fatal error to the client. The device must automatically stop processing video data when
62 such errors occur, and may not do further processing before it has been deleted and re-created.
64 @param "aDevice" "The device that reports the error."
65 @param "aError" "The error code."
67 virtual void MdvrpFatalError(CMMFVideoHwDevice* aDevice, TInt aError) = 0;
70 Reports that an asynchronous Initialize() method has completed. The device is now ready for recording.
72 @param "aDevice" "The device that was initialized."
73 @param "aError" "Initialization result error code, KErrNone if initialization was successful."
75 virtual void MdvrpInitializeComplete(CMMFVideoHwDevice* aDevice, TInt aError) = 0;
78 Reports that the input video data end has been reached and all pictures have been processed. Called
79 by each hardware device after their InputEnd() methods have been called and all data has been processed.
80 The proxy implementation will notify the client about stream end when all hardware devices have called
83 virtual void MdvrpStreamEnd() = 0;
88 A video output buffer for a single output coded data unit from the encoder. In practice the encoder is
89 likely to inherit its own buffer class from this class, adding its own internal bookkeeping data.
93 class TVideoOutputBuffer
97 Coded video data for this data unit.
102 Capture timestamp for this data unit. If a single picture is divided into multiple data units,
103 all data units have the same timestamp.
105 TTimeIntervalMicroSeconds iCaptureTimestamp;
108 Identification number indicating the start of the spatial coverage of the data in the output buffer,
109 for example the first macroblock number.
111 TUint iCoverageStartPosition;
114 End of the spatial coverage of the data in the buffer, for example the last macroblock number.
115 The idenfication numbers can be used to match data partitions with each other.
117 TUint iCoverageEndPosition;
120 Order number of the output buffer having the same spatial coverage as an earlier output buffer
121 of the same picture. Used with video pictures or segments that do not fit into an output buffer.
122 The order number of the first output buffer of a particular spatial coverage area is 0. The order
123 number shall be incremented by 1 for each subsequent output buffer having the same coverage in the
129 Lowest unequal error protection level present in the buffer. Level 0 indicates that the buffer can
130 be discarded without causing temporal error propagation in the decoder, higher values indicate more
131 important buffers. If unequal error protection is not used, the value is set to 1.
133 TUint iMinErrorProtectionLevel;
136 Highest unequal error protection level present in the buffer. If unequal error protection is not
137 used, the value is set to 1.
139 TUint iMaxErrorProtectionLevel;
142 True if this buffer contains data that is required for decoding several pictures, for example the
143 only copy of a sequence header. A picture needed for motion compensated prediction is not considered
144 "required for decoding several pictures".
146 TBool iRequiredSeveralPictures;
149 True if this buffer contains data that is required for decoding other parts of the same picture,
150 for example the only copy of the picture header.
152 TBool iRequiredThisPicture;
155 The layer number for this picture if layered bit-rate scalability is used. If layers are not used,
156 the layer number is always zero.
161 Sub-sequence identifier of the output picture. A sub-sequence is a set of coded pictures within a
162 bit-rate scalability layer. A picture shall reside in one scalability layer and in one sub-sequence
163 only. A sub-sequence shall not depend on any other sub-sequence in the same or in a higher layer.
164 A sub-sequence in layer 0 can be decoded independently of any other sub-sequences. A sub-sequence
165 identifier labels the sub-sequence within a layer. Consecutive sub-sequences within a particular
166 layer in decoding order shall have a different sub-sequence identifier from each other. See Annex D
167 of H.264 | MPEG-4 AVC for further details.
172 The in-layer scalability step for the data in the buffer if in-layer scalability is used.
173 If in-layer scalability is not in use, the step is set to zero.
175 TUint iInLayerScalabilityStep;
178 iDataPartitionNumber equal to 0 indicates that data partitioning is not in use. Values of
179 iDataPartitionNumber greater than 0 indicate the data partition number in descending order of
180 importance, i.e. data partition 1 is the most important data partition subjectively. Data
181 partitioning can be used with multiple unequal error protection levels.
183 TUint iDataPartitionNumber;
186 True if this buffer contains data for a random access point.
188 TBool iRandomAccessPoint;
191 Updated HRD/VBV parameters, valid if HRD/VBV is in use and iRandomAccessPoint is true.
193 TPtrC8 iHrdVbvParams;
196 Coding-standard specific data.
198 TPtrC8 iCodingStandardSpecificData;
201 Implementation-specific data.
203 TPtrC8 iImplementationSpecificData;
206 A queue link used internally by the MSL API. The field must not be modified while the buffer is
207 in the MSL API, but can be used by the client before the buffer has been written and after the
208 buffer has been returned.
216 This class contains information about the pre-processing capabilities that an encoder or a pre-processor
217 hardware has. Although it mainly contains static data, it is defined as a complete CBase-derived class
218 since the data is relatively complex and proper memory management is necessary.
220 The objects are created by the pre-processor or encoder devices, and used by the MSL video client code.
225 class CPreProcessorInfo : public CBase
229 Creates and returns a new CPreProcessorInfo object. All data passed into this method is copied.
230 @param "aUid" "The uid of the pre-processor."
231 @param "aManufacturer" "The manufacturer of the pre-processor."
232 @param "aIdentifier" "The manufacturer-specific identifier of the pre-processor."
233 @param "aVersion" "The version of the pre-processor."
234 @param "aAccelerated" "Whether the pre-processor is hw accelerated or not."
235 @param "aSupportsDirectCapture" "Whether the pre-processor supports direct capture."
236 @param "aInputFormats" "An array of the supported input formats."
237 @param "aOutputFormats" "An array of the supported output formats."
238 @param "aSupportedCombinations" "An array of the supported combinations."
239 @param "aSupportsArbitraryScaling" "Whether the pre-processor supports arbitrary scaling."
240 @param "aSupportsAntiAliasedScaling" "Whether the pre-processor supports anti-alias filtering on scaling.""
241 @param "aSupportedScaleFactors" "An array of the supported scale factors if arbitrary scaling isn't suported"
242 @param "aYuvToYuvCapabilities" "The yuv to yuv conversion capabilities of the pre-processor."
243 @param "aSupportedRgbRanges" "The supported rgb ranges."
244 @param "aSupportedRotations" "The supported rotations."
245 @param "aImplementationSpecificInfo" "Implementation-specific information."
246 @return"The newly created CPreProcessorInfo object."
247 @leave "This method may leave with one of the system-wide error codes.
249 IMPORT_C static CPreProcessorInfo* NewL(TUid aUid,
250 const TDesC& aManufacturer,
251 const TDesC& aIdentifier,
254 TBool aSupportsDirectCapture,
255 const TArray<TUncompressedVideoFormat>& aInputFormats,
256 const TArray<TUncompressedVideoFormat>& aOutputFormats,
257 const TArray<TUint32>& aSupportedCombinations,
258 TBool aSupportsArbitraryScaling,
259 TBool aSupportsAntiAliasedScaling,
260 const TArray<TScaleFactor>& aSupportedScaleFactors,
261 const TYuvToYuvCapabilities& aYuvToYuvCapabilities,
262 TUint32 aSupportedRgbRanges,
263 TUint32 aSupportedRotations,
264 const TDesC8& aImplementationSpecificInfo);
269 IMPORT_C ~CPreProcessorInfo();
272 Returns the pre-processor UID.
273 @return "Pre-processor UID."
275 IMPORT_C TUid Uid() const;
278 Returns the hardware device manufacturer.
279 @return "The hardware device manufacturer. The reference is valid until this is destroyed."
281 IMPORT_C const TDesC& Manufacturer() const;
284 Returns the hardware device manufacturer-specific identifier. The combination of the manufacturer
285 and identifier uniquely identifies the plug-in.
286 @return "The hardware device identifier. The reference is valid until this object is destroyed."
288 IMPORT_C const TDesC& Identifier() const;
291 Returns the pre-processor version.
292 @return "Pre-processor version."
294 IMPORT_C TVersion Version() const;
297 Returns whether the plug-in is hardware-accelerated. Hardware-accelerated pre-processors can run on
298 an application DSP or dedicated hardware.
299 @return "True if the pre-processor is hardware-accelerated."
301 IMPORT_C TBool Accelerated() const;
304 Returns whether the hardware device supports direct capture. Pre-processors supporting direct capture
305 can get the input pictures directly from a camera, possibly using an efficient hardware-dependent data
307 @return "True if the pre-processor supports direct capture."
309 IMPORT_C TBool SupportsDirectCapture() const;
312 Returns whether the pre-processor supports the given input format.
313 @param "aFormat" "The format to be checked."
314 @return "True if the pre-processor supports the given input format."
316 IMPORT_C TBool SupportsInputFormat(const TUncompressedVideoFormat& aFormat) const;
319 Returns the input formats that the pre-processor supports.
320 @return "An RArray table of supported video formats (TUncompressedVideoFormat). The reference is valid
321 until the CPreProcessorInfo object is destroyed."
323 IMPORT_C const RArray<TUncompressedVideoFormat>& SupportedInputFormats() const;
326 Returns whether the pre-processor supports the given output format.
327 @param "aFormat" "The format to be checked."
328 @return "True if the pre-processor supports the given input format."
330 IMPORT_C TBool SupportsOutputFormat(const TUncompressedVideoFormat& aFormat) const;
333 Returns the output formats that the pre-processor supports.
334 @return "An RArray table of supported video formats (TUncompressedVideoFormat). The reference is valid
335 until the CPreProcessorInfo object is destroyed."
337 IMPORT_C const RArray<TUncompressedVideoFormat>& SupportedOutputFormats() const;
340 Returns whether the pre-processor supports the given pre-processing combination.
341 @param "aCombination" "Pre-processing combination, a bitwise OR of values from TPrePostProcessType."
342 @return "True if the pre-processing combination is supported."
344 IMPORT_C TBool SupportsCombination(TUint32 aCombination) const;
347 Lists all supported pre-processing combinations.
348 @return "An RArray table of pre-processing combinations. Each value is a bitwise OR of values from
349 TPrePostProcessType. The reference is valid until the CPreProcessorInfo object is destroyed."
351 IMPORT_C const RArray<TUint32>& SupportedCombinations() const;
354 Returns whether the pre-processor supports arbitrary scaling.
355 @return "True if arbitrary scaling is supported. If arbitrary scaling is not supported, some specific
356 scale factors can still be available."
358 IMPORT_C TBool SupportsArbitraryScaling() const;
361 Returns whether the hardware device supports anti-aliasing filtering for scaling.
362 @return "True if anti-aliasing filtering is supported."
364 IMPORT_C TBool SupportsAntiAliasedScaling() const;
367 Returns the scaling factors the plug-in supports. If the plug-in supports arbitrary scaling the list
368 is empty - use SupportsArbitraryScaling() first.
369 @return "An RArray list of supported scale factors (TScaleFactor). The reference is valid until the
370 CPreProcessorInfo object is destroyed. If the pre-processor supports arbitrary scaling or
371 no scaling at all, the list is empty."
373 IMPORT_C const RArray<TScaleFactor>& SupportedScaleFactors() const;
376 Returns the YUV to YUV conversion capabilities for the pre-processor.
377 @return "The conversion capabilities, as a TYuvToYuvCapabilities structure. The reference is valid
378 until the CPreProcessorInfo object is destroyed."
380 IMPORT_C const TYuvToYuvCapabilities& YuvToYuvCapabilities() const;
383 Returns RGB value ranges the hardware device supports for RGB to YUV conversion.
384 @return "The supported RGB ranges as a bitwise OR of TRgbRange values."
386 IMPORT_C TUint32 SupportedRgbRanges() const;
389 Returns the rotation types the plug-in supports.
390 @return "The supported rotation types as a bitwise OR of TRotationType values. If the pre-processor
391 does not support rotation, the return value is zero."
393 IMPORT_C TUint32 SupportedRotations() const;
396 Returns implementation-specific information about the pre-processor.
397 @return "Implementation- specific information about the pre-processor. The data format is
398 implementation-specific, and defined separately by the pre-processor supplier. The reference
399 is valid until the CPreProcessorInfo object is destroyed."
401 IMPORT_C const TDesC8& ImplementationSpecificInfo() const;
403 CPreProcessorInfo(TUid aUid,
406 TBool aSupportsDirectCapture,
407 TBool aSupportsArbitraryScaling,
408 TBool aSupportsAntiAliasedScaling,
409 const TYuvToYuvCapabilities& aYuvToYuvCapabilities,
410 TUint32 aSupportedRgbRanges,
411 TUint32 aSupportedRotations);
413 void ConstructL(const TDesC& aManufacturer,
414 const TDesC& aIdentifier,
415 const TArray<TUncompressedVideoFormat>& aInputFormats,
416 const TArray<TUncompressedVideoFormat>& aOutputFormats,
417 const TArray<TUint32>& aSupportedCombinations,
418 const TArray<TScaleFactor>& aSupportedScaleFactors,
419 const TDesC8& aImplementationSpecificInfo);
422 HBufC* iManufacturer;
426 TBool iSupportsDirectCapture;
427 RArray<TUncompressedVideoFormat> iInputFormats;
428 RArray<TUncompressedVideoFormat> iOutputFormats;
429 RArray<TUint32> iSupportedCombinations;
430 TBool iSupportsArbitraryScaling;
431 TBool iSupportsAntiAliasedScaling;
432 RArray<TScaleFactor> iSupportedScaleFactors;
433 TYuvToYuvCapabilities iYuvToYuvCapabilities;
434 TUint32 iSupportedRgbRanges;
435 TUint32 iSupportedRotations;
436 HBufC8* iImplementationSpecificInfo;
440 This class contains information about a video encoder hardware device and its capabilities.
441 Although it mainly contains static data, it is defined as a complete CBase-derived class since the
442 data is relatively complex and proper memory management is necessary.
444 The objects are created by the encoder devices, and used by the MSL video client code.
449 class CVideoEncoderInfo : public CBase
453 Creates and returns a new CVideoEncoderInfo object.
454 All data passed in is copied on construction of the object.
457 The uid of the encoder.
459 The video encoder manufacturer.
461 The manufacturer-specific identifier for this encoder.
463 The version of this encoder.
465 Whether this encoder is accelerated.
466 @param aSupportsDirectCapture
467 Whether this encoder supports direct capture.
468 @param aSupportedInputFormats
469 An array of the supported input formats.
470 @param aSupportedOutputFormats
471 An array of the supported output formats.
472 @param aMaxPictureSize
473 The maximum supported picture size.
474 @param aSupportedDataUnitTypes
475 The supported data unit types.
476 @param aSupportedDataUnitEncapsulations
477 The supported data unit encapsulations.
478 @param aMaxBitrateLayers
479 The maximum number of bitrate layers supported.
480 @param aSupportsSupplementalEnhancementInfo
481 Whether supplemental enhancement info is supported.
482 @param aMaxUnequalErrorProtectionLevels
483 The maximum unequal error protection level supported.
485 The maximum bit rate supported.
486 @param aMaxPictureRates
487 An array of the maximum picture size/rates supported.
488 @param aMaxInLayerScalabilitySteps
489 The maximum in-layer scalability steps supported.
490 @param aSupportedPictureOptions
491 The picture options supported.
492 @param aCodingStandardSpecificInfo
493 Coding standard specific info.
494 @param aImplementationSpecificInfo
495 Implementation specific info.
497 @return A new CVideoEncoderInfo object.
498 @leave This method may leave with one of the system-wide error codes.
500 IMPORT_C static CVideoEncoderInfo* NewL(TUid aUid,
501 const TDesC& aManufacturer,
502 const TDesC& aIdentifier,
505 TBool aSupportsDirectCapture,
506 const TArray<TUncompressedVideoFormat>& aSupportedInputFormats,
507 const TArray<CCompressedVideoFormat*>& aSupportedOutputFormats,
508 const TSize& aMaxPictureSize,
509 TUint32 aSupportedDataUnitTypes,
510 TUint32 aSupportedDataUnitEncapsulations,
511 TUint aMaxBitrateLayers,
512 TBool aSupportsSupplementalEnhancementInfo,
513 TUint aMaxUnequalErrorProtectionLevels,
515 const TArray<TPictureRateAndSize>& aMaxPictureRates,
516 TUint aMaxInLayerScalabilitySteps,
517 TUint32 aSupportedPictureOptions,
518 TBool aSupportsPictureLoss,
519 TBool aSupportsSliceLoss,
520 const TDesC8& aCodingStandardSpecificInfo,
521 const TDesC8& aImplementationSpecificInfo);
526 IMPORT_C ~CVideoEncoderInfo();
529 Returns the encoder UID.
530 @return "The encoder UID."
532 IMPORT_C TUid Uid() const;
535 Returns the encoder version.
536 @return "The encoder version."
538 IMPORT_C TVersion Version() const;
541 Returns the encoder hardware device manufacturer.
542 @return "The manufacturer name. The reference is valid until the CVideoEncoderInfo object is destroyed."
544 IMPORT_C const TDesC& Manufacturer() const;
547 Returns the encoder hardware device manufacturer-specific identifier. The combination of the
548 manufacturer and identifier uniquely identifies the plug-in.
549 @return "The identifier. The reference is valid until the CVideoEncoderInfo object is destroyed."
551 IMPORT_C const TDesC& Identifier() const;
554 Returns whether the encoder is hardware-accelerated. Hardware-accelerated encoders can run on an
555 application DSP or dedicated hardware.
556 @return "True if the encoder is hardware-accelerated."
558 IMPORT_C TBool Accelerated() const;
561 Returns whether the encoder supports direct capture. Encoders supporting direct capture can get the
562 input pictures directly from a camera, possibly using an efficient hardware-dependent data path.
563 @return "True if the encoder supports direct capture."
565 IMPORT_C TBool SupportsDirectCapture() const;
568 Returns whether the encoder supports the given input format.
569 @param "aFormat" "The format to check."
570 @return "True if the encoder supports the given input format."
572 IMPORT_C TBool SupportsInputFormat(const TUncompressedVideoFormat& aFormat) const;
575 Returns the input formats that the encoder supports.
576 @return "An RArray table of supported video formats (TUncompressedVideoFormat). The reference is
577 valid until the CVideoEncoderInfo object is destroyed."
579 IMPORT_C const RArray<TUncompressedVideoFormat>& SupportedInputFormats() const;
582 Returns whether the encoder supports the given output format.
583 @param "aFormat" "The format to check."
584 @return "True if the encoder supports the given output format."
586 IMPORT_C TBool SupportsOutputFormat(const CCompressedVideoFormat& aFormat) const;
589 Returns the output formats that the encoder supports.
590 @return "An RArray table of supported video formats (CCompressedVideoFormat). The reference is
591 valid until the CVideoEncoderInfo object is destroyed."
593 IMPORT_C const RPointerArray<CCompressedVideoFormat>& SupportedOutputFormats() const;
596 Returns the maximum picture size the encoder supports.
597 @return "The maximum picture size supported. The reference is valid until the CVideoEncoderInfo
598 object is destroyed."
600 IMPORT_C const TSize& MaxPictureSize() const;
603 Returns the data unit types supported by the encoder.
604 @return "Supported data unit types. The value is a binary OR of values from TVideoDataUnitType."
606 IMPORT_C TUint32 SupportedDataUnitTypes() const;
609 Returns the data unit encapsulation types that the encoder supports.
610 @return "Supported data unit encapsulation types. The value is a binary OR of values from
611 TVideoDataUnitEncapsulation."
613 IMPORT_C TUint32 SupportedDataUnitEncapsulations() const;
616 Returns the maximum number of bit-rate scalability layers supported.
617 @return "Maximum number of bit-rate scalability layers supported, one (1) if layered scalability
620 IMPORT_C TUint MaxBitrateLayers() const;
623 Returns whether the encoder implements SendSupplementalInfoL(). If SendSupplementalInfoL() is
624 implemented, the client can send supplemental enhancement information messages as binary strings
625 using that method. If SendSupplementalInfoL() is not implemented, this is not possible, but the
626 encoder can still generate and send coding standard or implementation specific supplemental
627 enhancement information automatically.
628 @return "True if the encoder supports supplemental enhancement information."
630 IMPORT_C TBool SupportsSupplementalEnhancementInfo() const;
633 Returns the maximum number of unequal error protection levels supported.
634 @return "Maximum number of unequal error protection levels supported, one (1) if unequal error
635 protection is not supported."
637 IMPORT_C TUint MaxUnequalErrorProtectionLevels() const;
640 Returns the maximum bit-rate supported by the encoder.
641 @return "Maximum bit-rate supported, in bits per second. KMaxTUint32 can be used if the encoder has no
642 bit-rate restrictions."
644 IMPORT_C TUint MaxBitrate() const;
647 Returns the maximum picture size/rate combinations supported by the encoder. Video encoders can have
648 different maximum picture rate limitations depending on the picture size used.
649 @return "A reference to an array of picture size/rate combinations. The reference remains valid until
650 this object is deleted."
652 IMPORT_C const RArray<TPictureRateAndSize>& MaxPictureRates() const;
655 Returns the maximum number of in-layer scalability steps supported.
656 @return "Maximum number of in-layer scalability steps supported, one (1) if in-layer scalability is
659 IMPORT_C TUint MaxInLayerScalabilitySteps() const;
662 Returns the input picture options that the encoder supports.
663 @return "Supported input picture options, a bitwise OR of values from TVideoPicture::TVideoPictureOptions."
665 IMPORT_C TUint32 SupportedPictureOptions() const;
668 Returns whether the encoder supports picture loss indications. If true, the encoder implements
669 PictureLoss(), and recovers lost picture contents when it receives the indication.
670 @return "True if the encoder supports picture loss indications."
672 IMPORT_C TBool SupportsPictureLoss() const;
675 Returns whether the encoder supports slice loss indications. If true, the encoder implements
676 SliceLoss(), and recovers lost or damaged macroblocks when it receives the indication.
677 @return "True if the encoder supports slice loss indications."
679 IMPORT_C TBool SupportsSliceLoss() const;
682 Returns coding-standard specific information about the encoder.
683 @return "Coding-standard specific information about the encoder. The data format is coding-standard
684 specific, and defined separately. The reference is valid until the CVideoEncoderInfo object
687 IMPORT_C const TDesC8& CodingStandardSpecificInfo() const;
690 Returns implementation-specific information about the encoder.
691 @return "Implementation-specific information about the encoder. The data format is
692 implementation-specific, and defined separately by the encoder supplier. The reference is valid until
693 the CVideoEncoderInfo object is destroyed."
695 IMPORT_C const TDesC8& ImplementationSpecificInfo() const;
697 CVideoEncoderInfo(TUid aUid,
700 TBool aSupportsDirectCapture,
701 const TSize& aMaxPictureSize,
702 TUint32 aSupportedDataUnitTypes,
703 TUint32 aSupportedDataUnitEncapsulations,
704 TUint aMaxBitrateLayers,
705 TBool aSupportsSupplementalEnhancementInfo,
706 TUint aMaxUnequalErrorProtectionLevels,
708 TUint aMaxInLayerScalabilitySteps,
709 TUint32 aSupportedPictureOptions,
710 TBool aSupportsPictureLoss,
711 TBool aSupportsSliceLoss);
712 void ConstructL(const TDesC& aManufacturer,
713 const TDesC& aIdentifier,
714 const TArray<TUncompressedVideoFormat>& aSupportedInputFormats,
715 const TArray<CCompressedVideoFormat*>& aSupportedOutputFormats,
716 const TArray<TPictureRateAndSize>& aMaxPictureRates,
717 const TDesC8& aCodingStandardSpecificInfo,
718 const TDesC8& aImplementationSpecificInfo);
722 HBufC* iManufacturer;
725 TBool iSupportsDirectCapture;
726 RArray<TUncompressedVideoFormat> iSupportedInputFormats;
727 RPointerArray<CCompressedVideoFormat> iSupportedOutputFormats;
728 TSize iMaxPictureSize;
729 TUint32 iSupportedDataUnitTypes;
730 TUint32 iSupportedDataUnitEncapsulations;
731 TUint iMaxBitrateLayers;
732 TBool iSupportsSupplementalEnhancementInfo;
733 TUint iMaxUnequalErrorProtectionLevels;
735 RArray<TPictureRateAndSize> iMaxPictureRates;
736 TUint iMaxInLayerScalabilitySteps;
737 TUint32 iSupportedPictureOptions;
738 TBool iSupportsPictureLoss;
739 TBool iSupportsSliceLoss;
740 HBufC8* iCodingStandardSpecificInfo;
741 HBufC8* iImplementationSpecificInfo;
746 CMMFDevVideoRecord is the main client class of DevVideoRecord.
750 class CMMFDevVideoRecord : public CBase, private MMMFDevVideoRecordProxy
754 Class to define the picture counters available through GetPictureCounters.
758 class TPictureCounters
762 Default constructor. Zeros all members.
764 inline TPictureCounters();
766 /** The number of pictures skipped due to lack of output buffers. */
767 TUint iPicturesSkippedBufferOverflow;
769 /** The number of pictures skipped due to lack of processing power. */
770 TUint iPicturesSkippedProcPower;
772 /** The number of pictures skipped for bit-rate control purposes. */
773 TUint iPicturesSkippedRateControl;
775 /** The number of processed (i.e. pre-processed and encoded) input pictures. */
776 TUint iPicturesProcessed;
778 /** The total number of input pictures. When using direct capture, this is the total number of
779 pictures captured, otherwise it is the total number of input pictures written by the client. */
780 TUint iInputPictures;
786 Creates a new CMMFDevVideoRecord object.
787 @param "aObserver" "The observer object to use. The observer callbacks are used to return input buffers
789 @return "A new CMMFDevVideoRecord object.
790 @leave "The method will leave if an error occurs. Typical error codes used:
791 - KErrHardwareNotAvailable - Not enough free video processing hardware resources
792 - KErrNoMemory - Not enough free memory available"
794 IMPORT_C static CMMFDevVideoRecord* NewL(MMMFDevVideoRecordObserver& aObserver);
799 IMPORT_C ~CMMFDevVideoRecord();
802 Finds all available encoders for a given video type with support for certain pre-processing operations.
803 The video type is specified using its MIME type, which may include parameters specifying the supported
804 level, version, and other information. Encoder hardware devices can use wildcards when listing the
805 supported video types in the ECom registration information, so it is possible that all the encoders
806 returned do not support the specified submode, e.g. profile and level, unless aExactMatch is set.
808 The encoder capabilities can be checked with VideoEncoderInfoLC().
810 @param "aMimeType" "The video type that will be encoded."
811 @param "aPreProcType" "The pre-processing types that the encoder has to support, a binary OR of
812 TPrePostProcessType values. If no pre-processing support is needed, set this
814 @param "aEncoders" "An array for the result encoder UIDs. The array must be created and destroyed
816 @param "aExactMatch" "True if exact matching should be used. In this case only encoders that support
817 exactly the MIME-type given will be returned. Since verifying this may require
818 loading the encoders into memory, this can be a fairly expensive operation, and
819 if the user needs to verify their capabilities further in any case this parameter
820 should be set to EFalse."
821 @leave "The method will leave if an error occurs. Typical error codes used:
822 -KErrNotFound - No encoders were found matching the search parameters."
824 IMPORT_C void FindEncodersL(const TDesC8& aMimeType,
825 TUint32 aPreProcType,
826 RArray<TUid>& aEncoders,
827 TBool aExactMatch=ETrue);
830 Finds all available pre-processors for a given set of pre-processing operations.
832 @param "aPreProcType" "The pre-processing types that the device has to support, a binary OR of
833 TPrePostProcessType values."
834 @param "aPreProcessors" "An array for the result pre-processor UIDs. The array must be created and
835 destroyed by the caller."
836 @leave "The method will leave if an error occurs. Typical error codes used:
837 - KErrNotFound - No pre-processors were found matching the search parameters."
839 IMPORT_C void FindPreProcessorsL(TUint32 aPreProcType, RArray<TUid>& aPreProcessors);
842 Retrieves a list of available video encoders in the system.
843 @param "aEncoders" "An array for the result encoder UIDs. The array must be created and destroyed by
845 @leave "The method will leave if an error occurs. Not finding any encoders is not treated as an error
846 condition: in this situation, aEncoders will be empty."
848 IMPORT_C void GetEncoderListL(RArray<TUid>& aEncoders);
851 Retrieves a list of available video pre-processor hardware devices in the system.
852 @param "aPreProcessors" "An array for the result pre-processor UIDs. The array must be created and
853 destroyed by the caller."
854 @leave "The method will leave if an error occurs. Not finding any pre-processors is not treated as an
855 error condition: in this situation, aPreProcessors will be empty."
857 IMPORT_C void GetPreProcessorListL(RArray<TUid>& aPreProcessors);
860 Retrieves information about an installed video encoder. Note that this method will need to load the
861 encoder hardware device into memory, and can thus be relatively expensive.
862 @param "aVideoEncoder" "The video encoder device to query."
863 @return "Encoder information as a CVideoEncoderInfo object. The object is pushed to the cleanup stack,
864 and must be deallocated by the caller."
865 @leave "The method will leave if an error occurs. Typical error codes used:
866 - KErrNotFound - No encoder was found with the given UID"
868 IMPORT_C CVideoEncoderInfo* VideoEncoderInfoLC(TUid aVideoEncoder);
871 Retrieves information about the pre-processing capabilities of an installed pre-processor or encoder
872 hardware device. Note that this method will need to load the device into memory, and can thus be
873 relatively expensive.
874 @param "aPreProcessor" "The device to query."
875 @return "Pre-processor information as a CPreProcessorInfo object. The object is pushed to the cleanupstack,
876 and must be deallocated by the caller."
877 @leave "The method will leave if an error occurs. Typical error codes used:
878 - KErrNotFound - No pre-processor was found with the given UID"
880 IMPORT_C CPreProcessorInfo* PreProcessorInfoLC(TUid aPreProcessor);
883 Selects the video encoder to be used. This method must be called before any other video encoder related
884 methods are used. The encoder can be changed by calling this method again before the system has been
885 initialized with Initialize().
887 All video encoder settings are reset to their default values. By default no pre-processing is performed.
889 @param "aEncoder" "The video encoder to use."
890 @return "Hardware device ID, used in other methods for configuring the encoder."
891 @leave "The method will leave if an error occurs. Typical error codes used:
892 - KErrNotFound - No encoder was found with the given UID"
893 @pre "This method can only be called before the API has been initialized with Initialize()."
895 IMPORT_C THwDeviceId SelectEncoderL(TUid aEncoder);
898 Selects the video pre-processor to be used. This method must be called before any other pre-processor
899 related methods are used. The pre-processor to use can be changed by calling this method again before
900 the API has been initialized with Initialize().
902 All pre-processor settings are reset to their default values. By default no pre-processing is performed.
904 @param "aPreProcessor" "The pre-processor to use."
905 @return "Hardware device ID, used in other methods for configuring the pre-processor."
906 @leave "The method will leave if an error occurs. Typical error codes used:
907 - KErrNotFound - No pre-processor was found with the given UID"
908 @pre "This method can only be called before the API has been initialized with Initialize()."
910 IMPORT_C THwDeviceId SelectPreProcessorL(TUid aPreProcessor);
913 Sets the input format for a hardware device. If both a pre-processor and an encoder are used, the
914 pre-processor output format and the encoder input format must be the same. The input format for the
915 first device in the system is the input format for video input data.
917 The method has to be called for both direct capture as well as memory buffer input. The camera API
918 must be initialized by the device using it for capture, since there is no way to query the current
919 format from the camera API.
921 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
922 or SelectPreProcessorL() when the device is selected."
923 @param "aFormat" "The input format to use."
924 @param "aPictureSize" "The input picture size in pixels."
925 @leave "The method will leave if an error occurs. Typical error codes used:
926 - KErrNotSupported - The input format specified is not supported."
927 @pre "This method can only be called before the API has been initialized with Initialize()."
929 IMPORT_C void SetInputFormatL(THwDeviceId aHwDevice,
930 const TUncompressedVideoFormat& aFormat,
931 const TSize& aPictureSize);
934 Sets the data source to be a camera, and sets the system to use direct capture for input. The first
935 hardware device (pre-processor if both encoder and pre-processor are used, encoder otherwise) must
936 support direct capture.
938 @param "aCameraHandle" "A camera handle for the camera to use. The handle is passed to
939 CCamera::NewDuplicateL() in the camera API."
940 @param "aPictureRate" "Video capture picture rate."
941 @leave "The method will leave if an error occurs. Typical error codes used:
942 - KErrNotSupported - Direct capture is not supported or the picture rate specified is not
944 @pre "This method can only be called before the API has been initialized with Initialize()."
946 IMPORT_C void SetSourceCameraL(TInt aCameraHandle, TReal aPictureRate);
949 Sets the data source to be memory buffers.
951 @param "aMaxPictureRate" "The maximum picture rate for input pictures."
952 @param "aConstantPictureRate" "True if the input picture rate is constant. In that case,
953 aMaxPictureRate specifies the picture rate. If pictures may be skipped
954 in the input data due to performance reasons, this flag cannot be set."
955 @param "aProcessRealtime" "True if real-time processing is needed, false if not. Real-time
956 processing is typically needed for video recording applications, while
957 video conversion and off-line processing applications do not require it."
958 @leave "The method will leave if an error occurs. Typical error codes used:
959 - KErrNotSupported - The picture rate specified is not supported."
960 @pre "This method can only be called before the API has been initialized with Initialize()."
962 IMPORT_C void SetSourceMemoryL(TReal aMaxPictureRate, TBool aConstantPictureRate, TBool aProcessRealtime);
965 Sets the output format for a hardware device to a compressed video format. Only applicable for encoder
966 devices. The picture size depends on the input data format and possible scaling performed.
968 @param "aHwDevice" "The hardware device to configure. The value is returned from
969 SelectEncoderL()when the device is selected."
970 @param "aFormat" "The video format to use."
971 @param "aDataUnitType" "The type of output coded data units."
972 @param "aDataEncapsulation" "Data encapsulation type for output encoded data units."
973 @param "aSegmentationAllowed" "True if a coded data unit can be segmented into multiple output buffers
974 if a single buffer is not large enough."
975 @leave "The method will leave if an error occurs. Typical error codes used:
976 - KErrNotSupported - The format specified is not supported."
977 @pre "This method can only be called before the API has been initialized with Initialize()."
979 IMPORT_C void SetOutputFormatL(THwDeviceId aHwDevice,
980 const CCompressedVideoFormat& aFormat,
981 TVideoDataUnitType aDataUnitType,
982 TVideoDataUnitEncapsulation aDataEncapsulation,
983 TBool aSegmentationAllowed=EFalse);
986 Sets the output format for a hardware device to an uncompressed video format. Only applicable for
987 pre-processor devices. The picture size depends on the input data format and possible scaling performed.
989 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectPreProcessorL()
990 when the device is selected."
991 @param "aFormat" "The video format to use."
992 @leave "The method will leave if an error occurs. Typical error codes used:
993 - KErrNotSupported - The format specified is not supported."
994 @pre "This method can only be called before the API has been initialized with Initialize()."
996 IMPORT_C void SetOutputFormatL(THwDeviceId aHwDevice, const TUncompressedVideoFormat& aFormat);
999 Sets the clock source to use for video timing. When video recording is synchronized with audio, the clock
1000 source is implemented by the audio playback subsystem, otherwise the clock source should get the time
1001 from the system clock. This method can be called after all hardware devices have been selected, but
1002 before calling Initialize().
1004 If no clock source is set, video recording will not be synchronized, but will proceed as fast as
1005 possible, depending on input data and output buffer availability. If direct capturing is used without a
1006 clock source, the timestamps in the output data may not be valid. All encoders must support
1007 synchronization with an external clock source, as well as unsynchronized non-realtime operation.
1009 @param "aClock" "The clock source to use."
1010 @pre "This method can only be called before the API has been initialized with Initialize()."
1012 IMPORT_C void SetClockSource(MMMFClockSource* aClock);
1015 Sets pre-processing options for RGB to YUV color space conversion. By default, input RGB data is
1016 assumed to use the full value range ([0…255]), and the output YUV format is the hardware device
1017 output format, so typically calling this method is not necessary.
1019 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1020 or SelectPreProcessorL() when the device is selected."
1021 @param "aRgbRange" "Input RGB data range"
1022 @param "aOutputFormat" "Conversion output YUV format."
1023 @leave "The method will leave if an error occurs. Typical error codes used:
1024 - KErrNotSupported - The formats specified are not supported"
1025 @pre "This method can only be called before the API has been initialized with Initialize()."
1027 IMPORT_C void SetRgbToYuvOptionsL(THwDeviceId aHwDevice, TRgbRange aRgbRange, const TYuvFormat& aOutputFormat);
1030 Sets pre-processing options for YUV to YUV data format conversion. By default, the hardware device
1031 input and output data formats are used. For encoder devices, the device input format and the closest
1032 matching format supported by the encoding process are used. Typically calling this method is not
1035 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1036 or SelectPreProcessorL() when the device is selected."
1037 @param "aInputFormat" "Conversion input format."
1038 @param "aOutputFormat" "Conversion output format."
1039 @leave "The method will leave if an error occurs. Typical error codes used:
1040 - KErrNotSupported - The formats specified are not supported"
1041 @pre "This method can only be called before the API has been initialized with Initialize()."
1043 IMPORT_C void SetYuvToYuvOptionsL(THwDeviceId aHwDevice,
1044 const TYuvFormat& aInputFormat,
1045 const TYuvFormat& aOutputFormat);
1048 Sets the number of bit-rate scalability layers to use. Set to 1 to disable layered scalability.
1050 Bit-rate scalability refers to the ability of a coded stream to be decoded at different bit-rates.
1051 Scalable video is typically ordered into hierarchical layers of data. A base layer contains an
1052 individual representation of a video stream and enhancement layers contain refinement data in
1053 addition to the base layer. The quality of the encoded video stream progressively improves as
1054 enhancement layers are added to the base layer.
1056 @param "aNumLayers" "The number of bit-rate scalability layers to use, set to 1 to disable
1058 @leave "The method will leave if an error occurs. Typical error codes used:
1059 - KErrNotSupported - The scalability layers are not supported or too many layers specified."
1060 @pre "This method can only be called before the API has been initialized with Initialize()."
1062 IMPORT_C void SetNumBitrateLayersL(TUint aNumLayers);
1065 Sets the scalability type for a bit-rate scalability layer.
1067 @param "aLayer" "Layer number. Layers are numbered [0…n-1], where n is the number of layers
1068 available. The first layer is the base layer, it can be decoded independently
1069 from the other layers, and it has the lowest total bitrate."
1070 @param "aScalabilityType" "Layer scalability type."
1071 @leave "The method will leave if an error occurs. Typical error codes used:
1072 - KErrNotSupported - The scalability layers or the specified scalability type are not supported."
1073 @pre "This method can only be called before the API has been initialized with Initialize()."
1075 IMPORT_C void SetScalabilityLayerTypeL(TUint aLayer, TScalabilityType aScalabilityType);
1079 Sets the reference picture options to be used for all scalability layers. The settings can be
1080 overridden for an individual scalability layer by using SetLayerReferenceOptions().
1082 @param "aMaxReferencePictures" "The maximum number of reference pictures to be used. More than one
1083 reference frame can be used in the H.264 | MPEG-4 AVC and in some
1084 advanced profiles of MPEG-4 Part 2 and H.263. The minimum value is one."
1085 @param "aMaxPictureOrderDelay" "The maximum picture order delay, in number of pictures. This specifies
1086 the maximum number of pictures that precede any picture in the sequence
1087 in decoding order and follow the picture in presentation order. Pictures
1088 may be coded/decoded in different order from their capture/display order.
1089 Thus, decoded pictures have to be buffered to order them in correct
1090 display order. For example, if one conventional B picture is coded
1091 between P pictures, a one-picture display ordering delay has to be
1092 applied in the decoder. The minimum value is zero, which indicates that
1093 pictures must be coded in capture/display order."
1094 @pre "This method can only be called before the API has been initialized with Initialize()."
1096 IMPORT_C void SetGlobalReferenceOptions(TUint aMaxReferencePictures, TUint aMaxPictureOrderDelay);
1099 Sets the reference picture options to be used for a single scalability layer. These settings override
1100 those set with SetGlobalReferenceOptions().
1102 @param "aLayer" "Layer number."
1103 @param "aMaxReferencePictures" "The maximum number of reference pictures to be used."
1104 @param "aMaxPictureOrderDelay" "The maximum picture order delay, in number of pictures."
1105 @pre "This method can only be called before the API has been initialized with Initialize()."
1107 IMPORT_C void SetLayerReferenceOptions(TUint aLayer, TUint aMaxReferencePictures, TUint aMaxPictureOrderDelay);
1110 Sets encoder buffering options.
1112 @param "aOptions" "The buffering options."
1113 @leave "The method will leave if an error occurs. Typical error codes used:
1114 - KErrNotSupported - The specified settings are not supported."
1115 @pre "This method can only be called before the API has been initialized with Initialize()."
1117 IMPORT_C void SetBufferOptionsL(const TEncoderBufferOptions& aOptions);
1120 Sets the encoder output rectangle for encoded video output. This rectangle specifies the part of the
1121 input and output pictures which is displayed after encoding. Many video codecs process data in 16x16
1122 pixel units but enable specifying and coding the decoder output rectangle for image sizes that are not
1123 multiple of 16 pixels (e.g 160x120).
1125 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1126 when the device is selected."
1127 @param "aRect" "The encoder output rectangle."
1128 @leave "The method will leave if an error occurs."
1129 @pre "This method can be called either before or after the API has been initialized with Initialize().
1130 If called after initialization, the change will only be committed once CommitL() is called."
1132 IMPORT_C void SetOutputRectL(THwDeviceId aHwDevice, const TRect& aRect);
1135 Sets the pre-processing types to be used in a hardware device. [1 #191] If separate encoder and
1136 pre-processor devices are used, both can be configured to perform different pre-processing operations.
1138 Pre-processing operations are carried out in the following order:
1140 1. Frame stabilisation
1148 Color space conversion and color enhancement can be performed at any point in the pre-processing flow.
1150 @param "aHwDevice" "The hardware device to configure. The value is returned from
1151 SelectEncoderL() or SelectPreProcessorL() when the device is selected."
1152 @param "aPreProcessTypes" "The pre-processing steps to perform, a bitwise OR of values from
1153 TPrePostProcessType."
1154 @leave "The method will leave if an error occurs. Typical error codes used:
1155 - KErrNotSupported - The pre-processing combination is not supported"
1156 @pre "This method can be called either before or after the API has been initialized with Initialize().
1157 If called after initialization, the change will only be committed once CommitL() is called."
1159 IMPORT_C void SetPreProcessTypesL(THwDeviceId aHwDevice, TUint32 aPreProcessTypes);
1162 Sets pre-processing options for rotation.
1164 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1165 or SelectPreProcessorL() when the device is selected."
1166 @param "aRotationType" "The rotation to perform."
1167 @leave "The method will leave if an error occurs. Typical error codes used:
1168 - KErrNotSupported - The rotation type is not supported."
1169 @pre "This method can be called either before or after the API has been initialized with Initialize().
1170 If called after initialization, the change will only be committed once CommitL() is called."
1172 IMPORT_C void SetRotateOptionsL(THwDeviceId aHwDevice, TRotationType aRotationType);
1175 Sets pre-processing options for scaling.
1177 @param "aHwDevice" "The hardware device to configure. The value is returned from
1178 SelectEncoderL() or SelectPreProcessorL() when the device is selected."
1179 @param "aTargetSize" "Target picture size. If a fixed scale factor size is used, the new
1180 dimensions must be set to:
1181 width=floor(factor*width), height=floor(factor*height).
1182 For example, scaling a QCIF (176x144) picture up by a factor of 4/3
1183 yields a size of 234x192."
1184 @param "aAntiAliasFiltering" "True if anti-aliasing filtering should be used. If the pre-processor
1185 does not support anti-aliased scaling, or supports anti-aliased scaling
1186 only, this argument is ignored."
1187 @leave "The method will leave if an error occurs. Typical error codes used:
1188 - KErrNotSupported - The specified target size is not supported."
1189 @pre "This method can be called either before or after the API has been initialized with Initialize().
1190 If called after initialization, the change will only be committed once CommitL() is called."
1192 IMPORT_C void SetScaleOptionsL(THwDeviceId aHwDevice, const TSize& aTargetSize, TBool aAntiAliasFiltering);
1195 Sets pre-processing options for input cropping. Input cropping is typically used for digital zooming.
1197 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() or
1198 SelectPreProcessorL() when the device is selected."
1199 @param "aRect" "The input cropping rectangle specifying the area of the picture to use. The
1200 rectangle must fit completely inside the input picture."
1201 @leave "The method will leave if an error occurs. Typical error codes used:
1202 - KErrNotSupported - The specified cropping rectangle is not supported."
1203 @pre "This method can be called either before or after the API has been initialized with Initialize().
1204 If called after initialization, the change will only be committed once CommitL() is called."
1206 IMPORT_C void SetInputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect);
1209 Sets pre-processing options for output cropping. Output cropping is performed after other pre-processing
1210 operations but before output padding. Output cropping and padding can be used in combination to prepare
1211 the picture size to suit the encoder, typically video encoders only support picture sizes that are
1212 multiples of 16 pixels.
1214 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() or
1215 SelectPreProcessorL() when the device is selected."
1216 @param "aRect" "The output cropping rectangle specifying the area of the picture to use. The
1217 rectangle must fit completely inside the picture."
1218 @leave "The method will leave if an error occurs. Typical error codes used:
1219 - KErrNotSupported - The specified cropping rectangle is not supported."
1220 @pre "This method can be called either before or after the API has been initialized with Initialize().
1221 If called after initialization, the change will only be committed once CommitL() is called."
1223 IMPORT_C void SetOutputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect);
1226 Sets pre-processing options for output padding. Output padding is performed as the last pre-processing
1227 operation, and typically used to prepare the picture size to suit the encoder. The image is padded with
1230 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1231 or SelectPreProcessorL() when the device is selected."
1232 @param "aOutputSize" "The padded output picture size. The output size must be large enough for the
1233 picture in its new position."
1234 @param "aPicturePos" "The position for the original picture in the new padded picture. The original
1235 picture in its new position must fit completely inside the new picture."
1236 @leave "The method will leave if an error occurs. Typical error codes used:
1237 - KErrNotSupported - The specified padding settings are not supported."
1238 @pre "This method can be called either before or after the API has been initialized with Initialize().
1239 If called after initialization, the change will only be committed once CommitL() is called."
1241 IMPORT_C void SetOutputPadOptionsL(THwDeviceId aHwDevice, const TSize& aOutputSize, const TPoint& aPicturePos);
1244 Sets color enhancement pre-processing options.
1246 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1247 or SelectPreProcessorL() when the device is selected."
1248 @param "aOptions" "Color enchancement options."
1249 @leave "The method will leave if an error occurs. Typical error codes used:
1250 - KErrNotSupported - The specified settings are not supported."
1251 @pre "This method can be called either before or after the API has been initialized with Initialize().
1252 If called after initialization, the change will only be committed once CommitL() is called."
1254 IMPORT_C void SetColorEnhancementOptionsL(THwDeviceId aHwDevice, const TColorEnhancementOptions& aOptions);
1257 Sets frame stabilisation options.
1259 Frame stabilisation is performed as the first pre-processing operation in the hardware device. The
1260 stabilisation process gets the complete hardware device input picture as its input, and it produces a
1261 smaller stabilised output picture. The rest of the processing in the hardware device is done using the
1262 stabilisation output picture.
1264 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1265 or SelectPreProcessorL() when the device is selected."
1266 @param "aOutputSize" "Output picture size. The output picture must size must be smaller than
1267 or equal to the hardware device input picture size."
1268 @param "aFrameStabilisation" "True if frame stabilisation should be used. By default stabilisation
1270 @leave "The method will leave if an error occurs. Typical error codes used:
1271 - KErrNotSupported - The specified settings are not supported."
1272 @pre "This method can be called either before or after the API has been initialized with Initialize().
1273 If called after initialization, the change will only be committed once CommitL() is called."
1275 IMPORT_C void SetFrameStabilisationOptionsL(THwDeviceId aHwDevice,
1276 const TSize& aOutputSize,
1277 TBool aFrameStabilisation);
1280 Sets custom implementation-specific pre-processing options.
1282 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL()
1283 or SelectPreProcessorL() when the device is selected."
1284 @param "aOptions" "Post-processing options. The data format is implementation-specific."
1285 @leave "The method will leave if an error occurs. Typical error codes used:
1286 - KErrNotSupported - The options are not supported."
1287 @pre "This method can be called either before or after the API has been initialized with Initialize().
1288 If called after initialization, the change will only be committed once CommitL() is called."
1290 IMPORT_C void SetCustomPreProcessOptionsL(THwDeviceId aHwDevice, const TDesC8& aOptions);
1293 Sets whether bit errors or packets losses can be expected in the video transmission channel. The
1294 video encoder can use this information to optimize the bitstream.
1296 @param "aBitErrors" "True if bit errors can be expected."
1297 @param "aPacketLosses" "True if packet losses can be expected."
1298 @pre "This method can be called either before or after the API has been initialized with Initialize().
1299 If called after initialization, the change will only be committed once CommitL() is called."
1301 IMPORT_C void SetErrorsExpected(TBool aBitErrors, TBool aPacketLosses);
1304 Sets the minimum frequency (in time) for instantaneous random access points in the bitstream.
1305 An instantaneous random access point is such where the encoder can achieve a full output picture
1306 immediately by encoding data starting from the random access point. The random access point frequency
1307 may be higher than signalled, if the sequence contains scene cuts which typically cause a coding of
1308 a random access point.
1310 @param "aRate" "Random access point rate, in pictures per second. For example, to request a random
1311 access point every ten seconds, set the value to 0.1."
1312 @pre "This method can be called either before or after the API has been initialized with Initialize().
1313 If called after initialization, the change will only be committed once CommitL() is called."
1315 IMPORT_C void SetMinRandomAccessRate(TReal aRate);
1318 Sets coding-standard specific encoder options.
1320 @param "aOptions" "The options to use. The data format for the options is coding-standard specific,
1321 and defined seperately."
1322 @leave "The method will leave if an error occurs. Typical error codes used:
1323 - KErrNotSupported - The specified settings are not supported."
1324 @pre "This method can be called either before or after the API has been initialized with Initialize().
1325 If called after initialization, the change will only be committed once CommitL() is called."
1327 IMPORT_C void SetCodingStandardSpecificOptionsL(const TDesC8& aOptions);
1330 Sets implementation-specific encoder options.
1332 @param "aOptions" "The options to use. The data format for the options is specific to the encoder
1333 implementation, and defined separately by the encoder implementor."
1334 @leave "The method will leave if an error occurs. Typical error codes used:
1335 - KErrNotSupported - The specified settings are not supported."
1336 @pre "This method can be called either before or after the API has been initialized with Initialize().
1337 If called after initialization, the change will only be committed once CommitL() is called."
1339 IMPORT_C void SetImplementationSpecificEncoderOptionsL(const TDesC8& aOptions);
1342 Initializes the video devices, and reserves hardware resources. This method is asynchronous,
1343 DevVideoRecord will call MMMFDevVideoRecordObserver::MdvroInitializeComplete() after initialization has
1344 completed. If direct capture is used, this method also prepares the camera API for capture by calling
1345 PrepareVideoCaptureL(). No DevVideoRecord method may be called while initialization is in progress, the
1346 initialization process can only be cancelled by destroying the DevVideoRecord object.
1348 After initialization has successfully been completed, video capturing and encoding can be started with
1349 Start() with a relatively low delay since the hardware has already been set up.
1351 If Initialize() fails, the DevVideoRecord object must be destroyed, and set up from scratch.
1353 Error handling: Errors are reported using the MdvroInitializeComplete() callback method. Typical error
1355 - KErrHardwareNotAvailable - Not enough free video processing hardware resources
1356 - KErrNotSupported - The current configuration is not supported.
1358 @pre "This method can only be called before the API has been initialized."
1360 IMPORT_C void Initialize();
1363 Commit all configuration changes since the last CommitL(), Revert() or Initialize(). This only applies
1364 to methods that can be called both before AND after DevVideoRecord has been initialized.
1365 See the following methods for details.
1368 @see SetPreProcessTypesL
1369 @see SetRotateOptionsL
1370 @see SetScaleOptionsL
1371 @see SetInputCropOptionsL
1372 @see SetOutputCropOptionsL
1373 @see SetOutputPadOptionsL
1374 @see SetColorEnhancementOptionsL
1375 @see SetFrameStabilisationOptionsL
1376 @see SetCustomPreProcessOptionsL
1377 @see SetCodingStandardSpecificOptionsL
1378 @see SetImplementationSpecificEncoderOptionsL
1380 @leave "The method will leave if an error occurs."
1381 @pre "This method can only be called after the API has been initialized with Initialize()."
1383 IMPORT_C void CommitL();
1386 Revert any configuration changes that have not yet been committed using CommitL(). This only applies
1387 to methods that can be called both before AND after DevVideoRecord has been initialized.
1388 See the following methods for details.
1391 @see SetPreProcessTypesL
1392 @see SetRotateOptionsL
1393 @see SetScaleOptionsL
1394 @see SetInputCropOptionsL
1395 @see SetOutputCropOptionsL
1396 @see SetOutputPadOptionsL
1397 @see SetColorEnhancementOptionsL
1398 @see SetFrameStabilisationOptionsL
1399 @see SetCustomPreProcessOptionsL
1400 @see SetCodingStandardSpecificOptionsL
1401 @see SetImplementationSpecificEncoderOptionsL
1403 @pre "This method can only be called after the API has been initialized with Initialize()."
1405 IMPORT_C void Revert();
1408 Returns coding-standard specific initialization output from the encoder. The information can contain,
1409 for example, the MPEG-4 VOL header. This method can be called after Initialize() has been called.
1411 @return "Coding-standard specific initialization output. The data format is coding-standard specific
1412 and defined separately. The buffer is pushed to the cleanup stack, and the caller is responsible
1413 for deallocating it."
1414 @leave "The method will leave if an error occurs."
1415 @pre "This method can only be called after the API has been initialized with Initialize()."
1417 IMPORT_C HBufC8* CodingStandardSpecificInitOutputLC();
1420 Returns implementation-specific initialization output from the encoder. This method can be called after
1421 Initialize() has been called.
1423 @return "Implementation-specific initialization output. The data format is specific to the encoder
1424 implementation, and defined by the encoder supplier. The buffer is pushed to the cleanup stack,
1425 and the caller is responsible for deallocating it."
1426 @leave "The method will leave if an error occurs."
1427 @pre "This method can only be called after the API has been initialized with Initialize()."
1429 IMPORT_C HBufC8* ImplementationSpecificInitOutputLC();
1432 Sets the number of unequal error protection levels. By default unequal error protection is not used.
1434 @param "aNumLevels" "The number of unequal error protection levels. To disable unequal error
1435 protection, set this value to one. When unequal error protection is used,
1436 the encoder should code pictures so that they can be divided into number of
1437 unequal error protection levels having an ascending order of importance in
1438 the quality of decoded pictures, with level zero indicating the least important level.
1439 The encoder should map the requested bit-rate scalability layers and in-layer
1440 bit-rate scalability steps to the unequal error protection levels. In
1441 addition, the encoder may use coded sub-pictures to divide coded pictures
1442 to different regions of interest or data partitions to divide coded segments
1443 into pieces of different importance."
1444 @param "aSeparateBuffers" "True if each unequal error protection level of a coded data unit shall be
1445 encapsulated in its own output buffer. Ignored if unequal error protection
1446 is not used. If each unequal error protection level (e.g. a data partition)
1447 of coded data unit is encapsulated in its own output buffer, the caller can
1448 transmit the output buffers in different logical channels or can apply a
1449 different amount of application-level forward error coding for different
1450 output buffers. If all unequal error protection levels (e.g. data partitions)
1451 of coded data unit are encapsulated in the same output buffer, the caller can
1452 apply a forward error control mechanism that protects the beginning of the
1453 output buffer better than the remaining of the output buffer."
1454 @leave "The method will leave if an error occurs. Typical error codes used:
1455 - KErrNotSupported - Unequal error protection is not supported."
1456 @pre "This method can only be called after the API has been initialized with Initialize()."
1458 IMPORT_C void SetErrorProtectionLevelsL(TUint aNumLevels, TBool aSeparateBuffers);
1461 Sets up an unequal error protection level. If unequal error protection is not used, this method can be
1462 used to control settings for the whole encoded bitstream.
1464 @param "aLevel" "Error protection level number. This argument is ignored if unequal error
1465 protection is not in use."
1466 @param "aBitrate" "Target bit-rate for this error protection level."
1467 @param "aStrength" "Forward error control strength for this error protection level. The strength can be
1468 specified using values from TErrorControlStrength (EFecStrengthNone, EFecStrengthLow,
1469 EFecStrengthNormal, EFecStrengthHigh), or with intermediate values between those
1471 @leave "The method will leave if an error occurs. Typical error codes used:
1472 - KErrNotSupported - The specified bit-rate cannot be supported. "
1473 @pre "This method can only be called after the API has been initialized with Initialize()."
1475 IMPORT_C void SetErrorProtectionLevelL(TUint aLevel, TUint aBitrate, TUint aStrength);
1478 Sets the expected or prevailing channel conditions for an unequal error protection level, in terms of
1479 expected packet loss rate. The video encoder can use this information to optimize the generated
1482 @param "aLevel" "Error protection level number. This argument is ignored if unequal error
1483 protection is not in use."
1484 @param "aLossRate" "Packet loss rate, in number of packets lost per second. Set to 0.0 if
1485 packet losses are not expected."
1486 @param "aLossBurstLength" "Expected average packet loss burst length. Set to zero if the information
1488 @pre "This method can only be called after the API has been initialized with Initialize()."
1490 IMPORT_C void SetChannelPacketLossRate(TUint aLevel, TReal aLossRate, TTimeIntervalMicroSeconds32 aLossBurstLength);
1493 Sets the expected or prevailing channel conditions for an unequal error protection level, in terms of
1494 expected bit error rate. The video encoder can use this information to optimize the generated bitstream.
1496 @param "aLevel" "Error protection level number. This argument is ignored if unequal error
1497 protection is not in use."
1498 @param "aErrorRate" "Expected bit error rate, as a fraction of the total bits transmitted. Set
1499 to 0.0 if bit errors are not expected."
1500 @param "aStdDeviation" "Expected bit error rate standard deviation."
1501 @pre "This method can only be called after the API has been initialized with Initialize()."
1503 IMPORT_C void SetChannelBitErrorRate(TUint aLevel, TReal aErrorRate, TReal aStdDeviation);
1506 Sets the target size of each coded video segment. The segment target size can be specified in terms
1507 of number of bytes per segment, number of macroblocks per segment, or both.
1509 @param "aLayer" "Layer number. Layers are numbered [0…n-1], where n is the number of layers
1510 available. Use zero if layered bit-rate scalability is not used."
1511 @param "aSizeBytes" "Segment target size in bytes. Set to zero to use unlimited segment size. The
1512 segment size in bytes should include all data that is typically stored or
1513 transmitted for each segment in the format currently in use. This includes all
1515 @param "aSizeMacroblocks" "Segment target size in number of macroblocks per segment. Set to zero to
1516 use unlimited segment size."
1517 @pre "This method can only be called after the API has been initialized with Initialize()."
1519 IMPORT_C void SetSegmentTargetSize(TUint aLayer, TUint aSizeBytes, TUint aSizeMacroblocks);
1522 Sets the bit-rate control options for a layer. If layered bit-rate scalability is not used, the options
1523 are set for the whole bitstream.
1525 @param "aLayer" "Layer number. Layers are numbered [0…n-1], where n is the number of layers available.
1526 Use zero if layered bit-rate scalability is not used."
1527 @param "aOptions" "Bit-rate control options."
1528 @pre "This method can only be called after the API has been initialized with Initialize()."
1530 IMPORT_C void SetRateControlOptions(TUint aLayer, const TRateControlOptions& aOptions);
1533 Sets in-layer scalability options for a layer. In-layer bit-rate scalability refers to techniques where
1534 a specific part of a single-layer coded stream can be decoded correctly without decoding the leftover
1535 part. For example, B-pictures can be used for this. By default in-layer scalability is not used.
1537 @param "aLayer" "Layer number. Layers are numbered [0…n-1], where n is the number of layers
1538 available. Use zero if layered bit-rate scalability is not used."
1539 @param "aNumSteps" "The number of in-layer scalability steps to use. Set to one to disable
1540 in-layer scalability."
1541 @param "aScalabilityType" "The scalability type to use. See the definition of TInLayerScalabilityType
1542 for more information."
1543 @param "aBitrateShare" "Bit-rate share for each scalability step. The bit-rate shares are defined
1544 as fractions of total layer bit-rate, with the share for one layer being
1545 aBitrateShare[i]/sum(aBitrateShare). For example, to use 2/3 of the total
1546 bitrate for the first layer and the remaining 1/3 for the second, the array
1547 contents would be {2,1}."
1548 @param "aPictureShare" "Picture rate share for each scalability step. The picture rate shares are
1549 defined similarly to the bit-rate shares. For example, a client wishing to
1550 use two B-pictures between each pair of reference pictures should set the
1551 array contents to {1,2}."
1552 @leave "The method will leave if an error occurs. Typical error codes used:
1553 - KErrNotSupported - In-layer scalability is not supported.
1554 - KErrArgument - Some of the arguments are out of range. For example, it is not possible
1555 to use the specified in-layer scalability setup due to other
1556 constraints (such as the maximum picture order delay)."
1557 @pre "This method can only be called after the API has been initialized with Initialize()."
1559 IMPORT_C void SetInLayerScalabilityL(TUint aLayer,
1561 TInLayerScalabilityType aScalabilityType,
1562 const TArray<TUint>& aBitrateShare,
1563 const TArray<TUint>& aPictureShare);
1566 Sets the period for layer promotions points for a scalability layer. A layer promotion point is a
1567 picture where it is possible to start encoding this enhancement layer if only the lower layers were
1570 @param "aLayer" "Layer number."
1571 @param "aPeriod" "Layer promotion point period. A value of one signals that each picture should be a
1572 layer promotion point, value two that there is one picture between each promotion
1574 @pre "This method can only be called after the API has been initialized with Initialize()."
1576 IMPORT_C void SetLayerPromotionPointPeriod(TUint aLayer, TUint aPeriod);
1579 Returns coding-standard specific settings output from the encoder. The information can contain, for
1580 example, some bitstream headers that can change based on settings modified while encoding is in progress.
1582 @return "Coding-standard specific output. The data format is coding-standard specific and defined
1583 separately. The buffer is pushed to the cleanup stack, and the caller is responsible for
1585 @leave "The method will leave if an error occurs."
1586 @pre "This method can only be called after the API has been initialized with Initialize()."
1588 IMPORT_C HBufC8* CodingStandardSpecificSettingsOutputLC();
1591 Returns implementation-specific settings output from the encoder. The information can contain, for
1592 example, some bitstream headers that can change based on settings modified while encoding is in progress.
1594 @return "Implementation-specific initialization output. The data format is implementation-specific and
1595 defined separately by the encoder supplier. The buffer is pushed to the cleanup stack, and the
1596 caller is responsible for deallocating it."
1597 @leave "The method will leave if an error occurs."
1598 @pre "This method can only be called after the API has been initialized with Initialize()."
1600 IMPORT_C HBufC8* ImplementationSpecificSettingsOutputLC();
1603 Writes an uncompressed input picture. The picture must remain valid and unmodified until it is returned
1604 with the MdvroReturnPicture() callback. This method must not be called if direct capture is used.
1606 @param "aPicture" "The picture to write."
1607 @leave "The method will leave if an error occurs."
1608 @pre "This method can only be called after the API has been initialized with Initialize()."
1610 IMPORT_C void WritePictureL(TVideoPicture* aPicture);
1613 Requests the encoder to sends supplemental information in the bitstream. The information data format is
1614 coding-standard dependent. Only one supplemental information send request can be active at a time.
1615 This variant encodes the information to the next possible picture.
1617 @param "aData" "Supplemental information data to send. The buffer can be reused immediately after the
1619 @leave "The method will leave if an error occurs. Typical error codes used:
1620 - KErrNotSupported - Supplemental information is not supported"
1621 @pre "This method can only be called after the API has been initialized with Initialize()."
1623 IMPORT_C void SendSupplementalInfoL(const TDesC8& aData);
1626 Requests the encoder to send supplemental information in the bitstream. The information data format is
1627 coding-standard dependent. Only one supplemental information send request can be active at a time. This
1628 variant encodes the information to the picture whose presentation timestamp is equal to or greater than
1629 and closest to the value of aTimestamp.
1631 @param "aData" "Supplemental information data to send. The buffer can be reused immediately
1632 after the method returns."
1633 @param "aTimestamp" "Timestamp for the picture in which the supplemental information should be
1634 included. If the timestamp is in the past, the supplemental information will
1636 @leave "The method will leave if an error occurs. Typical error codes used:
1637 - KErrNotSupported - Supplemental information is not supported"
1638 @pre "This method can only be called after the API has been initialized with Initialize()."
1640 IMPORT_C void SendSupplementalInfoL(const TDesC8& aData, const TTimeIntervalMicroSeconds& aTimestamp);
1643 Cancels the current supplemental information send request. The memory buffer reserved for supplemental
1644 information data can be reused or deallocated after the method returns.
1645 @pre "This method can only be called after the API has been initialized with Initialize()."
1647 IMPORT_C void CancelSupplementalInfo();
1650 Notifies the system that the end of input data has been reached. No more input data can be written
1651 through the API. The encoder and pre-processor can use this signal to ensure that the remaining data
1652 gets processed, without waiting for new data. After the remaining data has been processed, the client
1653 gets notified by the MdvroStreamEnd() callback.
1655 This method is mainly useful for file-to-file conversions and other non-realtime processing. For
1656 real-time recording all pictures are processed or discarded according to their timestamps.
1657 @pre "This method can only be called after the API has been initialized with Initialize()."
1659 IMPORT_C void InputEnd();
1662 Starts recording video. This includes capturing pictures from the camera (if direct capture is used),
1663 pre-processing and encoding. Recording will proceed until it is stopped or paused. Initally recording
1665 @pre "This method can only be called after the API has been initialized with Initialize()."
1667 IMPORT_C void Start();
1670 Stops recording video. No new pictures will be captured, pre-processed, or encoded. If input pictures
1671 are written while recording is stopped, they will be returned immediately.
1672 @pre "This method can only be called after the API has been initialized with Initialize()."
1674 IMPORT_C void Stop();
1677 Pauses video recording. Recording can be resumed using Resume().
1679 While video is paused, new pictures are not captured, and input pictures written using WritePictureL()
1680 are discarded. Timestamps are not incremented - the encoder assumes that the clock source is paused as
1681 well, and input picture timestamps are adjusted accordingly. Pause is typically used in video recording
1682 applications to pause recording, conversational applications should use Freeze() instead.
1684 Note: The client has to ensure that the clock source is paused properly. If the paused picture should
1685 be shown longer than normal, the client should either adjust input picture timestamps, or start
1686 recording (when using direct capture) some time after restarting the clock source.
1687 @pre "This method can only be called after the API has been initialized with Initialize()."
1689 IMPORT_C void Pause();
1692 Resumes video recording after a pause.
1693 @pre "This method can only be called after the API has been initialized with Initialize()."
1695 IMPORT_C void Resume();
1698 Freezes the input picture. Freezing is similar to a pause, except that timestamps are incremented
1699 normally during a freeze. Normal encoding can be continued using ReleaseFreeze().
1701 Freeze is typically used in video telephony applications to stop sending new pictures. In that situation
1702 the audio encoding can still continue normally, and thus the clock source timestamps are incremented
1703 normally. When the freeze is released, the encoder assumes that input picture timestamps have been
1704 incremented normally. If direct capture is used, the picture timestamps are updated as if encoding had
1705 been going on throughout the freeze.
1706 @pre "This method can only be called after the API has been initialized with Initialize()."
1708 IMPORT_C void Freeze();
1711 Releases a frozen input picture. Video capturing and encoding continues normally.
1712 @pre "This method can only be called after the API has been initialized with Initialize()."
1714 IMPORT_C void ReleaseFreeze();
1717 Returns the current recording position. The position is the capture timestamp from the latest input
1718 picture, or the capture timestamp for the latest picture captured from the camera when direct capture
1721 @return "The current recording position."
1722 @pre "This method can only be called after the API has been initialized with Initialize()."
1724 IMPORT_C TTimeIntervalMicroSeconds RecordingPosition();
1727 Gets the current output buffer status. The information includes the number of free output buffers and
1728 the total size of free buffers in bytes.
1730 @param "aNumFreeBuffers" "Target for the number of free output buffers."
1731 @param "aTotalFreeBytes" "Target for the total free buffer size in bytes."
1732 @pre "This method can only be called after the API has been initialized with Initialize()."
1734 IMPORT_C void GetOutputBufferStatus(TUint& aNumFreeBuffers, TUint& aTotalFreeBytes);
1737 Reads various counters related to processed video pictures. See the definition of TPictureCounters
1738 for a description of the counters. The counters are reset when Initialize() or this method is called,
1739 and thus they only include pictures processed since the last call.
1741 @param "aCounters" "The counter structure to fill."
1742 @pre "This method can only be called after the API has been initialized with Initialize()."
1744 IMPORT_C void GetPictureCounters(TPictureCounters& aCounters);
1747 Reads the frame stabilisation output picture position. This information can be used for positioning
1748 the viewfinder. The position returned is the stabilisation result for the most recent input picture.
1750 @param "aHwDevice" "The hardware device to query. The value is returned from SelectEncoderL() or
1751 SelectPreProcessorL() when the device is selected."
1752 @param "aRect" "The position of the stabilisation output picture inside the input picture. If
1753 frame stabilisation is not used, the rectangle is set to cover the entire input
1755 @pre "This method can only be called after the API has been initialized with Initialize()."
1757 IMPORT_C void GetFrameStabilisationOutput(THwDeviceId aHwDevice, TRect& aRect);
1760 Returns the number of output buffers currently containing valid output data.
1762 @return "The number of output buffers with valid output data."
1763 @pre "This method can only be called after the API has been initialized with Initialize()."
1765 IMPORT_C TUint NumDataBuffers();
1768 Retrieves the next output buffer, in coding order. The buffer must be returned using ReturnBuffer() when
1769 it is no longer used. The maximum amount of buffers that the caller can keep in its use is controlled by
1770 the iMinNumOutputBuffers and iMinTotalOutputBufferSize fields in the TEncoderBufferOptions settings.
1772 @return "The next output buffer, in coding order. If no new buffers are available, the return value
1774 @leave "The method will leave if an error occurs."
1775 @pre "This method can only be called after the API has been initialized with Initialize()."
1777 IMPORT_C TVideoOutputBuffer* NextBufferL();
1780 Returns a used output buffer back to the encoder. The buffer can no longer be used by the client.
1782 @param "aBuffer" "The buffer to return."
1783 @pre "This method can only be called after the API has been initialized with Initialize()."
1785 IMPORT_C void ReturnBuffer(TVideoOutputBuffer* aBuffer);
1788 Indicates a picture loss to the encoder, without specifying the lost picture. The encoder can react to
1789 this by transmitting an intra-picture.
1790 @pre "This method can only be called after the API has been initialized with Initialize()."
1792 IMPORT_C void PictureLoss();
1795 Indicates to the encoder the pictures that have been lost. The encoder can react to this by
1796 transmitting an intra-picture.
1798 @param "aPictures" "Picture identifiers for the lost pictures. See [6] for a definition of TPictureId."
1799 @pre "This method can only be called after the API has been initialized with Initialize()."
1801 IMPORT_C void PictureLoss(const TArray<TPictureId>& aPictures);
1804 Indicates a loss of consecutive macroblocks in raster scan order to the encoder.
1806 @param "aFirstMacroblock" "The first lost macroblock. The macroblocks are numbered such
1807 that the macroblock in the upper left corner of the picture is considered
1808 macroblock number 1 and the number for each macroblock increases from left
1809 to right and then from top to bottom in raster-scan order."
1810 @param "aNumMacroblocks" "The number of lost macroblocks that are consecutive in raster scan order."
1811 @param "aPicture" "The picture number for the picture where the macroblocks were lost.
1812 If the picture is not known, aPicture.iIdType is set to ENone."
1813 @pre "This method can only be called after the API has been initialized with Initialize()."
1815 IMPORT_C void SliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture);
1818 Sends a reference picture selection request to the encoder. The request is delivered as a coding-standard
1819 specific binary message. Reference picture selection can be used to select a previous correctly
1820 transmitted picture to use as a reference in case later pictures have been lost.
1822 @param "aSelectionData" "The reference picture selection request message. The message format is
1823 coding-standard specific, and defined separately."
1824 @pre "This method can only be called after the API has been initialized with Initialize()."
1826 IMPORT_C void ReferencePictureSelection(const TDesC8& aSelectionData);
1829 Retrieves the number of complexity control levels available for a hardware device. Devices can support
1830 processing the same input data with different computational complexity levels. The complexity level
1831 can affect, for example, the motion vector search range used in an encoder.
1833 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() or
1834 SelectPreProcessorL() when the device is selected."
1835 @return "The number of complexity control levels available, one if multiple levels are not supported."
1836 @pre "This method can only be called after the API has been initialized with Initialize()."
1838 IMPORT_C TUint NumComplexityLevels(THwDeviceId aHwDevice);
1841 Sets the complexity level to use for video processing in a hardware device. The level can be changed at
1844 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectEncoderL() or
1845 SelectPreProcessorL() when the device is selected."
1846 @param "aLevel" "The computational complexity level to use. Level zero (0) is the most complex one,
1847 with the highest quality. Higher level numbers require less processing and may have
1849 @pre "This method can only be called after the API has been initialized with Initialize()."
1851 IMPORT_C void SetComplexityLevel(THwDeviceId aHwDevice, TUint aLevel);
1854 Retrieves a custom interface to the specified hardware device.
1855 @param "aHwDevice" "The hardware device from which the custom interface shall be requested.
1856 The value is returned from SelectDecoderL() or SelectPostProcessorL() when
1857 the device is selected."
1858 @param "aInterface" "Interface UID, defined with the custom interface."
1859 @return "Pointer to the interface implementation, or NULL if the device does not
1860 implement the interface requested. The return value must be cast to the
1861 correct type by the user."
1863 IMPORT_C TAny* CustomInterface(THwDeviceId aHwDevice, TUid aInterface);
1866 enum TInitializationState
1868 ENotInitialized = 0x01,
1869 EInitializing = 0x02,
1870 EInitialized = 0x04,
1871 EInitializationFailed = 0x08
1875 CMMFDevVideoRecord(MMMFDevVideoRecordObserver& aObserver);
1877 // Methods to check aHwDevice is valid and return the appropriate HwDevice
1878 CMMFVideoRecordHwDevice& VideoRecordHwDevice(THwDeviceId aHwDevice) const;
1879 CMMFVideoRecordHwDevice& CapturingHwDevice() const; //returns the first plugin in the chain
1880 CMMFVideoEncodeHwDevice& VideoEncodeHwDevice(THwDeviceId aHwDevice) const;// Checks that aHwDevice is valid
1881 CMMFVideoPreProcHwDevice& VideoPreProcHwDevice(THwDeviceId aHwDevice) const;// Checks that aHwDevice is valid
1882 CMMFVideoEncodeHwDevice& VideoEncodeHwDevice() const;
1883 CMMFVideoPreProcHwDevice& VideoPreProcHwDevice() const;
1884 CMMFVideoHwDevice& VideoHwDevice(THwDeviceId aHwDevice) const;
1886 // Connects the plugins together
1887 void ConnectPlugins();
1889 // Check that we are in a valid initialization state
1890 // Panics if iInitializationState is not one of aExpected
1891 void CheckInitializationState(TUint aExpected);
1893 // Methods to handle init complete callbacks from the hw devices
1894 void HandlePreProcInitializeComplete(TInt aError);
1895 void HandleEncoderInitializeComplete(TInt aError);
1897 CMMFVideoEncodeHwDevice* CreateEncoderL(TUid aVideoEncoder);
1899 // from MMMFDevVideoRecordProxy
1900 virtual void MdvrpNewBuffer(TVideoOutputBuffer* aBuffer);
1901 virtual void MdvrpReturnPicture(TVideoPicture* aPicture);
1902 virtual void MdvrpSupplementalInfoSent();
1903 virtual void MdvrpFatalError(CMMFVideoHwDevice* aDevice, TInt aError);
1904 virtual void MdvrpInitializeComplete(CMMFVideoHwDevice* aDevice, TInt aError);
1905 virtual void MdvrpStreamEnd();
1908 MMMFDevVideoRecordObserver& iObserver;
1909 CMMFVideoEncodeHwDevice* iVideoEncodeHwDevice;
1910 CMMFVideoPreProcHwDevice* iVideoPreProcHwDevice;
1911 TUint iInitializationState;
1912 TUint iNumberOfMdvrpStreamEndCallbacks;
1914 TDblQue<TVideoOutputBuffer> iVideoOutputBufferQue;
1915 TDblQueIter<TVideoOutputBuffer> iVideoOutputBufferQueIter;
1916 TUint iNumberOfVideoOutputBuffers;
1917 TBool iIsPreProcComplete;
1919 #ifdef SYMBIAN_MULTIMEDIA_CODEC_API
1920 TBool iPuListCreated;
1921 RImplInfoPtrArray iPuImplementations;
1922 #endif // SYMBIAN_MULTIMEDIA_CODEC_API
1927 The MMMFDevVideoObserver class defines the observer mixin-interface that any client using CMMFDevVideoRecord
1932 class MMMFDevVideoRecordObserver
1936 Returns a used input video picture back to the caller. The picture memory can be re-used or freed.
1937 @param "aPicture" "The picture to return."
1939 virtual void MdvroReturnPicture(TVideoPicture* aPicture) = 0;
1942 Signals that the supplemental info send request has completed. The buffer used for supplemental
1943 information can be re-used or freed.
1945 virtual void MdvroSupplementalInfoSent() = 0;
1948 Notifies the client that one or more new output buffers are available. The client can then use
1949 NextBufferL() and related methods to fetch the data.
1951 virtual void MdvroNewBuffers() = 0;
1954 Reports a fatal encoding or capturing error to the client. When these
1955 errors occur, capturing and encoding is stopped automatically. The client
1956 must destroy the CMMFDevVideoRecord object and create a new instance before
1957 attempting to continue. Note that scenarios have been identified where
1958 MdvroFatalError may get referenced at some point during the execution of a
1959 CMMFDevVideoRecord procedure. Therefore CMMFDevVideoRecord object should be
1960 deleted outside of MdvroFatalError context in order to avoid accidental
1961 access to de-allocated CMMFDevVideoRecord data members.
1962 @param "aError" "The error code."
1964 virtual void MdvroFatalError(TInt aError) = 0;
1967 Reports that DevVideoRecord initialization has completed. The interface can now be used for video
1969 @param "aError" "Initialization error code, KErrNone if no error occurred."
1971 virtual void MdvroInitializeComplete(TInt aError) = 0;
1974 Reports that the input video data end has been reached and all pictures have been processed. This
1975 method is only called after the client has called InputEnd(). No more output data will be available.
1977 virtual void MdvroStreamEnd() = 0;
1981 #include <mmf/devvideo/devvideorecord.inl>