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 __DEVVIDEOPLAY_H__
17 #define __DEVVIDEOPLAY_H__
20 #include <mmf/devvideo/devvideobase.h>
22 class MMMFDevVideoPlayObserver;
23 class CMMFVideoPlayHwDevice;
24 class CMMFVideoDecodeHwDevice;
25 class CMMFVideoPostProcHwDevice;
29 MMMFDevVideoPlayProxy is the interface to the CMMFDevVideoPlay API implementation that the hardware devices
30 use to deliver data back to the client and report their progress to the API implementation.
34 class MMMFDevVideoPlayProxy
38 Delivers a new decoded picture to the client. The CMMFDevVideoPlay implementation will maintain
39 a list of decoded pictures and implement GetNewPictureInfo() and NextPictureL() based on those.
40 The pictures will be returned back to the hardware device using ReturnPicture().
42 @param "aPicture" "The newly processed picture."
44 virtual void MdvppNewPicture(TVideoPicture* aPicture) = 0;
47 Notifies the client that one or more new empty input buffers are available. Called by the decoder
50 virtual void MdvppNewBuffers() = 0;
53 Returns a used input video picture back to the caller. Called by a post-processor hardware device
54 after the picture has been processed and the picture source was the client, not another plug-in.
56 @param "aPicture" "The picture to return."
58 virtual void MdvppReturnPicture(TVideoPicture* aPicture) = 0;
61 Delivers supplemental information from a decoder hardware device to the client.
62 The information is codec-dependent. The method is synchronous - the client
63 MMMFDevVideoPlayObserver::MdvppSupplementalInformation() method is called immediately,
64 and the memory for the supplemental information can be re-used when the call returns.
66 @param "aData" "The supplemental data."
67 @param "aTimestamp" "The presentation timestamp for the picture that the supplemental data is part of."
68 @param "aPictureId" "Picture identifier for the picture. If a picture ID is not available,
69 aPictureId.iIdType is set to ENone."
71 virtual void MdvppSupplementalInformation(const TDesC8& aData,
72 const TTimeIntervalMicroSeconds& aTimestamp, const TPictureId& aPictureId) = 0;
75 Back channel information, indicating a picture loss without specifying the lost picture.
77 virtual void MdvppPictureLoss() = 0;
80 Back channel information, indicating the pictures that have been lost.
82 @param "aPictures" "Picture identifiers for the lost pictures. The reference is only valid
83 until the method returns."
85 virtual void MdvppPictureLoss(const TArray<TPictureId>& aPictures) = 0;
88 Back channel information, indicating the loss of consecutive macroblocks in raster scan order.
90 @param "aFirstMacroblock" "The first lost macroblock. The macroblocks are numbered
91 such that the macroblock in the upper left corner of the picture is
92 considered macroblock number 1 and the number for each macroblock increases
93 from left to right and then from top to bottom in raster-scan order."
94 @param "aNumMacroblocks" "The number of lost macroblocks that are consecutive in raster-scan order."
95 @param "aPicture" "The picture identifier for the picture where the macroblocks were lost.
96 If the picture is not known, aPicture.iIdType is set to ENone. The
97 reference is only valid until the method returns."
99 virtual void MdvppSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture)= 0;
102 Back channel information from the decoder, indicating a reference picture selection request.
103 The request is delivered as a coding-standard specific binary message. Reference picture selection
104 can be used to select a pervious correctly transmitted picture to use as a reference in case later
105 pictures have been lost.
107 @param "aSelectionData" "The reference picture selection request message. The message format is
108 coding-standard specific, and defined separately. The reference is only
109 valid until the method returns."
111 virtual void MdvppReferencePictureSelection(const TDesC8& aSelectionData)= 0;
114 Delivers a timed snapshot result to the client. The memory reserved for the snapshot picture
115 can no longer be used in the device.
117 @param "aError" "An error code, KErrNone if no errors occurred.
118 If an error occurred, the data in the snapshot may not be valid,
119 but the memory can still be freed."
120 @param "aPictureData" "The snapshot picture data."
121 @param "aPresentationTimestamp" "The presentation timestamp for the snapshot picture."
122 @param "aPictureId" "Picture identifier for the picture. If a picture ID is not
123 available, aPictureId.iIdType is set to ENone."
125 virtual void MdvppTimedSnapshotComplete(TInt aError, TPictureData* aPictureData,
126 const TTimeIntervalMicroSeconds& aPresentationTimestamp, const TPictureId& aPictureId) = 0;
129 Reports a fatal error to the client. The device must automatically stop processing
130 video data when such errors occur, and may not do further processing before it has
131 been deleted and re-created.
133 @param "aDevice" "The device that reported the error."
134 @param "aError" "The error code."
136 virtual void MdvppFatalError(CMMFVideoHwDevice* aDevice, TInt aError) = 0;
139 Reports that an asynchronous Initialize() method has completed.
140 The device is now ready for playback.
142 @param "aDevice" "The device that was initialzied."
143 @param "aError" "Initialization result error code, KErrNone if initialization was successful."
145 virtual void MdvppInitializeComplete(CMMFVideoHwDevice* aDevice, TInt aError) = 0;
148 Reports that the input video stream end has been reached and all pictures have been processed.
149 Called by each hardware device after their InputEnd() methods have been called and all data has
150 been processed. The proxy implementation will notify the client about stream end when all
151 hardware devices have called this method.
153 virtual void MdvppStreamEnd() = 0;
158 A buffer for compressed video data, contains one coded data unit. Video buffers are used for writing
159 video data to the API.
164 class TVideoInputBuffer
168 Default constructor. Zeroes all members (including iData which will point to garbage until manually
169 set to point to the real video buffer memory data area by the user).
171 IMPORT_C TVideoInputBuffer();
176 enum TVideoBufferOptions
178 /** The sequence number field is valid. */
179 ESequenceNumber = 0x00000001,
180 /** The decoding timestamp field is valid */
181 EDecodingTimestamp = 0x00000002,
182 /** The presentation timestamp field is valid.*/
183 EPresentationTimestamp = 0x00000004,
184 /** Content protected pictures cannot be displayed on unprotected
185 external displays such as TV-out.
187 EContentProtected = 0x00000008
191 Pointer to the video data.
196 Data unit options. The value is a bitfield combined from values from TVideoBufferOptions.
197 @see TVideoBufferOptions
202 Data unit decoding timestamp. Valid if EDecodingTimestamp is set in the options.
204 TTimeIntervalMicroSeconds iDecodingTimestamp;
207 Data unit presentation timestamp. Valid if EPresentationTimestamp is set in the options.
208 If the input bitstream does not contain timestamp information, this field should be valid,
209 otherwise pictures cannot be displayed at the correct time. If the input bitstream contains
210 timestamp information (such as the TR syntax element of H.263 bitstreams) and valid
211 iPresentationTimestamp is provided, the value of iPresentationTimestamp is used in playback.
213 TTimeIntervalMicroSeconds iPresentationTimestamp;
216 True if the data is part of a pre-roll period and may not be drawn. The decoder may skip
217 display-related operations, but must still decode normally since pre-roll may not end in a key
223 Data unit sequence number. Valid if ESequenceNumber is set in the options. If present, the
224 sequence number is incremented once per coded data unit, a gap in the numbers indicates missing
227 TUint iSequenceNumber;
230 True if the data unit is known to contain erroneous data.
235 A queue link used internally by the MSL API. The field must not be modified while the buffer is
236 in the MSL API, but can be used by the client before the buffer has been written and after the
237 buffer has been returned.
242 A pointer for free-form user data. The pointer is set by the module that created the buffer, and
243 is usually used for memory management purposes.
250 This class contains information about the post-processing functionality that a single post-processor
251 or decoder hardware device has. Although it mainly contains static data, it is defined as a complete
252 CBase-derived class since the data is relatively complex and proper memory management is necessary.
254 The objects are created by the post-processor or decoder devices, and used by the MSL video client code.
258 class CPostProcessorInfo : public CBase
262 Creates and returns a new CPostProcessorInfo object.
264 @param "aUid" "The UID of the post-processor."
265 @param "aManufacturer" "The manufacturer of the post-processor hw device."
266 @param "aIdentifier" "The post-processor hw device manufacturer-specific
268 @param "aVersion" "The post-processor version."
269 @param "aSupportedFormats" "The source formats supported by the post-processor."
270 @param "aSupportedCombinations" "The supported post-processing combinations. An array of
271 values created by the bitwise OR-ing of values from
272 TPrePostProcessType."
273 @param "aAccelerated" "Whether the post processor is hardware-accelerated.
274 Accelerated post-processors can run on an application DSP
275 or dedicated hardware."
276 @param "aSupportsDirectDisplay" "Whether the hw device supports output directly to the
278 @param "aYuvToRgbCapabilities" "The post-processor YUV to RGB conversion capabilities."
279 @param "aSupportedRotations" "A bitwise OR of values of TRotationType to indicate the
280 supported rotation types."
281 @param "aSupportArbitraryScaling" "Whether the post-processor supports arbitrary scaling."
282 @param "aSupportedScaleFactors" "A list of the discrete scaling factors supported. If the
283 post-processor supports arbitrary scaling, this list should
284 be left zero-length."
285 @param "aAntiAliasedScaling" "Whether anti-aliasing filtering for scaling is supported."
286 @param "aImplementationSpecificInfo" "Implementation-specific information."
288 @return "A new CPostProcessorInfo object."
289 @leave "This method may leave with one of the system-wide error codes."
291 IMPORT_C static CPostProcessorInfo* NewL(TUid aUid,
292 const TDesC& aManufacturer,
293 const TDesC& aIdentifier,
295 const TArray<TUncompressedVideoFormat>& aSupportedFormats,
296 const TArray<TUint32>& aSupportedCombinations,
298 TBool aSupportsDirectDisplay,
299 const TYuvToRgbCapabilities& aYuvToRgbCapabilities,
300 TUint32 aSupportedRotations,
301 TBool aSupportArbitraryScaling,
302 const TArray<TScaleFactor>& aSupportedScaleFactors,
303 TBool aAntiAliasedScaling,
304 const TDesC8& aImplementationSpecificInfo = KNullDesC8);
309 IMPORT_C ~CPostProcessorInfo();
312 Returns the post-processor UID.
313 @return "Post-processor UID"
315 IMPORT_C TUid Uid() const;
318 Returns the post-processor hardware device manufacturer.
319 @return "The manufacturer name as a standard Symbian descriptor. The reference is valid until the
320 CPostProcessorInfo object is destroyed."
322 IMPORT_C const TDesC& Manufacturer() const;
325 Returns the post-processor hardware device manufacturer-specific identifier.
326 The combination of the manufacturer and identifier uniquely identifies the device.
327 @return "The identifier as a standard Symbian descriptor. The reference is valid until the
328 CPostProcessorInfo object is destroyed."
330 IMPORT_C const TDesC& Identifier() const;
333 Returns the post-processor version.
334 @return "Post-processor version."
336 IMPORT_C TVersion Version() const;
339 Checks if the post-processor supports the given format as a source format.
340 @param "aFormat" "The format to check. The reference is not used after the method returns."
341 @return "ETrue if the post-processor supports the given format, EFalse if not."
343 IMPORT_C TBool SupportsFormat(const TUncompressedVideoFormat& aFormat) const;
346 Lists the source formats supported by the post-processor.
347 @return "A RArray table of supported video formats (TUncompressedVideoFormat). The reference is
348 valid until the CPostProcessorInfo object is destroyed."
350 IMPORT_C const RArray<TUncompressedVideoFormat>& SupportedFormats() const;
353 Checks if the post-processor supports the given post-processing combination.
354 @param "aCombination" "Post-processing combination, a bitwise OR of values from TPrePostProcessType."
355 @return "ETrue if the post-processing combination is supported, EFalse if not."
357 IMPORT_C TBool SupportsCombination(TUint32 aCombination) const;
360 Lists all supported post-processing combinations.
361 @return "A RArray table or post-processing combinations. Each value is a bitwise OR of values from
362 TPrePostProcessType. The reference is valid until the CPostProcessorInfo object is destroyed."
364 IMPORT_C const RArray<TUint32>& SupportedCombinations() const;
367 Returns whether the hardware device is hardware-accelerated. Hardware-accelerated post-processors
368 can run on an application DSP or dedicated hardware.
369 @return "ETrue if the device is hardware-accelerated."
371 IMPORT_C TBool Accelerated() const;
374 Returns whether the hardware device supports output directly to the screen. Output to memory buffers
376 @return "ETrue if the post-processor supports direct screen output."
378 IMPORT_C TBool SupportsDirectDisplay() const;
381 Returns the post-processor YUV to RGB color conversion capabilities.
382 @return "The conversion capabilities as a TYuvToRgbCapabilities structure. The reference is valid
383 until the CPostProcessorInfo object is destroyed. If the post-processor does not support
384 YUV to RGB conversion, the contents are undefined."
386 IMPORT_C const TYuvToRgbCapabilities& YuvToRgbCapabilities() const;
389 Returns the rotation types the post-processor supports.
390 @return "The supported rotation types as a bitwise OR of TRotationType values. If the
391 post-processor does not support rotation, the return value is zero."
393 IMPORT_C TUint32 SupportedRotations() const;
396 Returns whether the post-processor supports arbitrary scaling. If arbitrary scaling is not
397 supported, a limited selection of scaling factors may still be available, use
398 SupportedScaleFactors() to retrieve those.
399 @return "ETrue if the post-processor supports arbitrary scaling, EFalse if not."
401 IMPORT_C TBool SupportsArbitraryScaling() const;
404 Returns the scaling factors the post-processor supports. If the post-processor supports arbitrary
405 scaling the list is empty - use SupportsArbitraryScaling() first.
406 @return "A RArray list of supported scale factors (TScaleFactor). The reference is valid until the
407 CPostProcessorInfo object is destroyed. If the post-processor supports arbitrary scaling
408 or no scaling at all, the list is empty."
410 IMPORT_C const RArray<TScaleFactor>& SupportedScaleFactors() const;
413 Returns whether the hardware device supports anti-aliasing filtering for scaling.
414 @return "True if anti-aliasing filtering is supported."
416 IMPORT_C TBool AntiAliasedScaling() const;
419 Returns implementation-specific information about the post-processor.
420 @return "Implementation- specific information about the post-processor. The data format is
421 implementation-specific, and defined separately by the post-processor supplier. The
422 reference is valid until the CPostProcessorInfo object is destroyed."
424 IMPORT_C const TDesC8& ImplementationSpecificInfo() const;
427 Adds the screen number into the list of screens supported by the post processor.
428 @leave "KErrNoMemory when there is no memory to expand the list of supported screens.
429 KErrNotSupported if the secondary screen display is not supported in Multimedia Framework."
431 IMPORT_C void AddSupportedScreenL(TInt aScreenNo);
434 Lists the screens supported by the post processor.
435 @param "aSupportedScreens" "An array to retrieve the list of supported screens.
436 This method resets the array before adding elements to it.
437 The array must be created and destroyed by the caller."
438 @leave "KErrNotSupported if the secondary screen display is not supported in Multimedia Framework.
439 KErrNoMemory when there is no memory to expand the list."
441 IMPORT_C void GetSupportedScreensL(RArray<TInt>& aSupportedScreens) const;
443 /** Sets a flag indicating whether the PostProcessor supports per picture content protection.
444 E.g. Where content protection within a video stream can alter.
445 @param "aSetting" "Set to TRUE to indicate PostProcessor supports content protection.
446 @See TVideoPicture::TVideoPictureOptions::EContentProtected
447 @See TVideoInputBuffer::TVideoBufferOptions::EContentProtected
449 IMPORT_C void SetSupportsContentProtected(const TBool aSetting);
451 /** Returns whether the PostProcessor supports per picture content protection.
452 E.g. Where content protection within a video stream can alter.
453 @return "True if the PostProcessor supports Content Protection."
454 @See TVideoPicture::TVideoPictureOptions::EContentProtected
455 @See TVideoInputBuffer::TVideoBufferOptions::EContentProtected
457 IMPORT_C TBool SupportsContentProtected() const;
460 CPostProcessorInfo(TUid aUid,
463 TBool aSupportDirectDisplay,
464 const TYuvToRgbCapabilities& aYuvToRgbCapabilities,
465 TUint32 aSupportedRotations,
466 TBool aSupportArbitraryScaling,
467 TBool aAntiAliasedScaling);
469 void ConstructL(const TDesC& aManufacturer,
470 const TDesC& aIdentifier,
471 const TArray<TUncompressedVideoFormat>& aSupportedFormats,
472 const TArray<TUint32>& aSupportedCombinations,
473 const TArray<TScaleFactor>& aSupportedScaleFactors,
474 const TDesC8& aImplementationSpecificInfo);
479 TBool iSupportDirectDisplay;
480 TYuvToRgbCapabilities iYuvToRgbCapabilities;
481 TUint32 iSupportedRotations;
482 TBool iSupportArbitraryScaling;
483 TBool iAntiAliasedScaling;
484 HBufC* iManufacturer;
486 HBufC8* iImplementationSpecificInfo;
487 RArray<TUncompressedVideoFormat> iSupportedFormats;
488 RArray<TUint32> iSupportedCombinations;
489 RArray<TScaleFactor> iSupportedScaleFactors;
490 RArray<TInt> iSupportedScreens;
491 TBool iSupportsContentProtected;
496 This class contains information about a single video decoder. Although it mainly contains static data,
497 it is defined as a complete CBase-derived class since the data is relatively complex and proper memory
498 management is necessary.
500 The objects are created by the video decoder hardware devices, and used by the MSL video client code.
504 class CVideoDecoderInfo : public CBase
508 Creates and returns a new CVideoDecoderInfo object.
510 @param "aUid" "The uid of the decoder."
511 @param "aManufacturer" "The video decoder manufacturer."
512 @param "aIdentifier" "The manufacturer-specific identifier for this video decoder."
513 @param "aVersion" "The version of this video decoder."
514 @param "aSupportedFormats" "An array of the formats supported by the decoder.
515 A copy will be taken of the array and the referenced
516 CCompressedVideoFormat objects"
517 @param "aAccelerated" "Whether this decoder is accelerated or not."
518 @param "aSupportsDirectDisplay" "Whether this decoder supports direct display or not."
519 @param "aMaxPictureSize" "The maximum picture size supported by the decoder."
520 @param "aMaxBitrate" "The maximum bit rate supported by the decoder. Use KMaxTUint32 if there are no bit-rate restrictions."
521 @param "aMaxPictureRates" "An array of the maximum picture size/rate combinations supported by the decoder."
522 @param "aSupportsPictureLoss" "Whether the decoder supports picture loss indications."
523 @param "aSupportsSliceLoss" "Whether the decoder supports slice loss indications."
524 @param "aCodingStandardSpecificInfo" "Coding-standard specific information about the decoder."
525 @param "aImplementationSpecificInfo" "Implementation-specific information about the decoder."
527 @return "A new CVideoDecoderInfo object."
528 @leave "This method may leave with one of the system-wide error codes."
530 IMPORT_C static CVideoDecoderInfo* NewL(TUid aUid,
531 const TDesC& aManufacturer,
532 const TDesC& aIdentifier,
534 const TArray<CCompressedVideoFormat*>& aSupportedFormats,
536 TBool aSupportsDirectDisplay,
537 const TSize& aMaxPictureSize,
539 const TArray<TPictureRateAndSize>& aMaxPictureRates,
540 TBool aSupportsPictureLoss,
541 TBool aSupportsSliceLoss,
542 const TDesC8& aCodingStandardSpecificInfo = KNullDesC8,
543 const TDesC8& aImplementationSpecificInfo = KNullDesC8);
548 IMPORT_C ~CVideoDecoderInfo();
551 Checks if the decoder supports the given format.
552 @param "aFormat" "The format to check. The reference is not used after the method returns."
553 @return "ETrue if the codec supports the given format, EFalse if not."
555 IMPORT_C TBool SupportsFormat(const CCompressedVideoFormat& aFormat) const;
558 Lists the video formats, including submodes, supported by the decoder.
559 @return "A RPointerArray table of supported video formats (CCompressedVideoFormat). The reference
560 is valid until the CVideoDecoderInfo object is destroyed."
562 IMPORT_C const RPointerArray<CCompressedVideoFormat>& SupportedFormats() const;
565 Returns the codec device manufacturer.
566 @return "The manufacturer name as a standard Symbian descriptor. The reference is valid until the
567 CVideoDecoderInfo object is destroyed."
569 IMPORT_C const TDesC& Manufacturer() const;
572 Returns the codec device manufacturer-specific identifier. The combination of the manufacturer
573 and identifier uniquely identifies the hardware device.
574 @return "The identifier as a standard Symbian descriptor. The reference is valid until the
575 CVideoDecoderInfo object is destroyed."
577 IMPORT_C const TDesC& Identifier() const;
580 Returns the decoder version.
581 @return "Decoder version."
583 IMPORT_C TVersion Version() const;
586 Returns the decoder UID.
587 @return "Decoder UID."
589 IMPORT_C TUid Uid() const;
592 Returns whether the decoder is hardware-accelerated. A hardware-accelerated decoder can run on
593 an application DSP or dedicated hardware.
594 @return "True if the decoder is hardware-accelerated."
596 IMPORT_C TBool Accelerated() const;
599 Returns whether the hardware device supports output directly to the screen. Output to memory
600 buffers is always supported.
601 @return "True if the hardware device supports direct screen output."
603 IMPORT_C TBool SupportsDirectDisplay() const;
606 Returns the maximum picture size the decoder supports.
608 Note that if the decoder reports that it supports a certain profile and level, then it
609 shall support all bitstreams corresponding to that profile/level. This method can be used
610 to specify capabilities that are beyond the standard levels (for example some MPEG-4 bitstreams
611 are encoded with picture sizes that are larger than those specified by the profile/level of the
614 @return "The maximum picture size supported. The reference is valid until the CVideoDecoderInfo
615 object is destroyed."
617 IMPORT_C const TSize& MaxPictureSize() const;
620 Returns the maximum bit-rate supported by the decoder.
622 Note that if the decoder reports that it supports a certain profile and level, then it shall
623 support all bitstreams corresponding to that profile/level. This method can be used to
624 specify capabilities that are beyond the standard levels (for example some MPEG-4 bitstreams
625 are encoded with bit rates that are higher than those specified by the profile/level of the
628 @return "Maximum bit-rate supported, in bits per second. KMaxTUint32 can be used if the decoder
629 has no bit-rate restrictions."
631 IMPORT_C TUint MaxBitrate() const;
634 Returns the maximum picture size/rate combinations supported by the decoder.
636 Video decoders can have different maximum picture rate limitations depending on the picture size used.
637 Note that if the decoder reports that it supports a certain profile and level, then it shall
638 support all bitstreams corresponding to that profile/level. This method can be used to specify
639 capabilities that are beyond the standard levels (for example some MPEG-4 bitstreams are encoded
640 with picture rates that are beyond those specified by the profile/level of the bitstream).
642 @return "A reference to an array of picture size/rate combinations. The reference remains valid
643 until this object is deleted."
645 IMPORT_C const RArray<TPictureRateAndSize>& MaxPictureRates() const;
648 Returns whether the decoder supports picture loss indications. If true, the decoder indicates
649 lost pictures by calling MdvpoPictureLoss().
651 @return "True if the decoder supports picture loss indications."
653 IMPORT_C TBool SupportsPictureLoss() const;
656 Returns whether the decoder supports slice loss indications. If true, the decoder indicates
657 lost macroblocks by calling MdvpoSliceLoss().
659 @return "True if the decoder supports slice loss indications."
661 IMPORT_C TBool SupportsSliceLoss() const;
664 Returns coding-standard specific information about the decoder.
665 @return "Coding-standard specific information about the decoder. The data format is coding-standard
666 specific, and defined separately. The reference is valid until the CVideoDecoderInfo object
669 IMPORT_C const TDesC8& CodingStandardSpecificInfo() const;
672 Returns implementation-specific information about the decoder.
673 @return "Implementation- specific information about the decoder. The data format is
674 implementation-specific, and defined separately by the decoder supplier. The reference
675 is valid until the CVideoDecoderInfo object is destroyed."
677 IMPORT_C const TDesC8& ImplementationSpecificInfo() const;
680 Adds the screen number into the list of screens supported by the decoder.
681 @leave "KErrNoMemory when there is no memory to expand the list of supported screens.
682 KErrNotSupported if the secondary screen display is not supported in Multimedia Framework."
684 IMPORT_C void AddSupportedScreenL(TInt aScreenNo);
687 Lists the screens supported by the decoder.
688 @param "aSupportedScreens" "An array to retrieve the list of supported screens.
689 This method resets the array before adding elements to it.
690 The array must be created and destroyed by the caller."
691 @leave "KErrNotSupported if the secondary screen display is not supported in Multimedia Framework.
692 KErrNoMemory when there is no memory to expand the list."
694 IMPORT_C void GetSupportedScreensL(RArray<TInt>& aSupportedScreens) const;
696 /** Sets a flag indicating whether the Decoder supports per picture content protection.
697 E.g. Where content protection within a video stream can alter.
698 @param "aSetting" "Set to TRUE to indicate decoder supports content protection.
699 @See TVideoPicture::TVideoPictureOptions::EContentProtected
700 @See TVideoInputBuffer::TVideoBufferOptions::EContentProtected
702 IMPORT_C void SetSupportsContentProtected(const TBool aSetting);
704 /** Returns whether the Decoder supports per picture content protection.
705 E.g. Where content protection within a video stream can alter.
706 @return "True if the Decoder supports Content Protection."
707 @See TVideoPicture::TVideoPictureOptions::EContentProtected
708 @See TVideoInputBuffer::TVideoBufferOptions::EContentProtected
710 IMPORT_C TBool SupportsContentProtected() const;
713 CVideoDecoderInfo(TUid aUid,
716 TBool aSupportsDirectDisplay,
717 const TSize& aMaxPictureSize,
719 TBool aSupportsPictureLoss,
720 TBool aSupportsSliceLoss);
722 void ConstructL(const TDesC& aManufacturer,
723 const TDesC& aIdentifier,
724 const TArray<CCompressedVideoFormat*>& aSupportedFormats,
725 const TArray<TPictureRateAndSize>& aMaxPictureRates,
726 const TDesC8& aCodingStandardSpecificInfo,
727 const TDesC8& aImplementationSpecificInfo);
732 TBool iSupportsDirectDisplay;
733 TSize iMaxPictureSize;
735 TBool iSupportsPictureLoss;
736 TBool iSupportsSliceLoss;
737 HBufC* iManufacturer;
739 RPointerArray<CCompressedVideoFormat> iSupportedFormats;
740 RArray<TPictureRateAndSize> iMaxPictureRates;
741 HBufC8* iCodingStandardSpecificInfo;
742 HBufC8* iImplementationSpecificInfo;
743 RArray<TInt> iSupportedScreens;
744 TBool iSupportsContentProtected;
751 CMMFDevVideoPlay is the main client API for DevVideoPlay.
755 class CMMFDevVideoPlay : public CBase, private MMMFDevVideoPlayProxy
759 Picture statistic counters. Used for following playback progress. The counters can be retrieved
760 using GetPictureCounters() and are reset after each call. The client must keep track of the
761 cumulative values for counters and picture processing rates itself if necessary.
763 class TPictureCounters
767 Default constructor. Zeros all members.
769 inline TPictureCounters();
772 The number of pictures skipped due to lack of processing power. This does not include pictures
773 inside data bytes discarded due to buffer overflows, but includes all pictures skipped at
774 picture decoding, post-processing and rendering phase.
776 TUint iPicturesSkipped;
779 The number of pictures decoded.
781 TUint iPicturesDecoded;
784 The number of pictures "virtually" displayed. "Virtually" displayed pictures are pictures
785 that have been drawn on the screen, when using direct rendering, or pictures that have been
786 decoded, processed, and delivered to the client when not using direct rendering.
788 TUint iPicturesDisplayed;
791 The total number of pictures in the input bitstream. This figure does not include pictures that
792 have been lost due to transmission errors, since those have not been processed by the MSL
793 hardware devices, but does include pictures that have been discarded by the HW devices due
794 to buffer overflows or other reasons.
796 TUint iTotalPictures;
800 Bitstream statistic counters, used for following decoding progress. The counters can be retrieved
801 using GetBitstreamCounters() and are reset after each call. The client must keep track of the
802 cumulative values for counters itself if necessary.
804 class TBitstreamCounters
808 Default constructor. Zeros all members.
810 inline TBitstreamCounters();
813 Number of lost packets. This figure includes all packets that have been dropped by the hardware
814 devices due to buffer overruns, but it does not include packets lost due to transmission errors.
819 Total number of packets. This figure includes all the packets that have been received by the
820 decoder, including packets that have been dropped due to buffer overruns.
826 Buffer options used with SetBufferOptionsL().
832 Default constructor. Zeros all members.
834 inline TBufferOptions();
838 Pre-decoder buffer size in bytes. Set to zero to use decoder default value.
840 TUint iPreDecodeBufferSize;
843 Maximum post-decoder buffer size in bytes. Set to zero to remove limitations.
845 TUint iMaxPostDecodeBufferSize;
848 Initial pre-decoder buffering period, the amount of coded data to be buffered before decoding
849 starts. If the value is set to zero, decoding begins immediately when all data associated with
850 the first decoding timestamp is received. Default value is zero.
852 TTimeIntervalMicroSeconds iPreDecoderBufferPeriod;
855 The amount of data buffered after the decoding before playback starts. If the value is zero,
856 playback begins immediately when the first picture has been decoded. The default value is zero.
858 TTimeIntervalMicroSeconds iPostDecoderBufferPeriod;
861 The maximum input buffer size that the client will request. If the buffer options have been
862 set successfully, the decoder must be able to supply buffers of this size. If no information
863 is available about the bitstream, the client may have to set this value to a relatively large
864 value, and thus the decoder should not by default allocate buffers of this size before they
865 are explicitly requested.
867 TUint iMaxInputBufferSize;
870 The minimum number of input buffers the decoder needs to have available. This is the number of
871 buffers the client can request through GetBufferL() before writing any back using
874 TUint iMinNumInputBuffers;
878 Information about a single computational complexity level.
880 class TComplexityLevelInfo
885 /** The average picture rate field is valid. */
886 EAvgPictureRate = 0x00000001,
887 /** The picture size field is valid. */
888 EPictureSize = 0x00000002,
889 /** The relative image quality field is valid. */
890 ERelativeImageQuality = 0x00000004,
891 /** The required MIPS field is valid. */
892 ERequiredMIPS = 0x00000008,
893 /** The relative processing time field is valid. */
894 ERelativeProcessTime = 0x00000010
897 Structure options. The value is a bitfield combined from values from TOptions.
902 The average picture rate, in pictures per second. Valid only if EAvgPictureRate is set in the
903 options. This value depends on the input bitstream, and may not be available if enough
904 bitstream has not been read.
906 TReal iAvgPictureRate;
909 Picture size (spatial resolution), in pixels. Valid only if EPictureSize is set in the options.
914 Relative image quality, compared to the best available level. 1.0 is the quality at the
915 maximum quality level (level zero). Valid only if ERelativeImageQuality is set in the options.
917 TReal iRelativeImageQuality;
920 The number of MIPS required to process the data. Valid only if ERequiredMIPS is set in
926 Relative amount of processing time needed compared to standard-compliant decoding of all data.
927 1.0 is the processing time required for full processing, which usually corresponds to
928 complexity level zero. Valid only if ERelativeProcessTime is set in the options.
930 TReal iRelativeProcessTime;
936 Constructs a new MSL video client instance. Each client instance supports a single video bitstream.
939 The observer object to use.
941 @return A pointer to a new CMMFDevVideoPlay object.
942 @leave This method may leave with one of the system-wide error codes.
944 IMPORT_C static CMMFDevVideoPlay* NewL(MMMFDevVideoPlayObserver& aObserver);
949 IMPORT_C ~CMMFDevVideoPlay();
952 Finds a common format from two lists of uncompressed video formats. Used typically to find a
953 suitable intermediate format between a video decoder and a post-processor. If multiple common
954 formats are available, the lowest-cost format is selected, assuming that the cost of each format
955 is equal to its position in the input array.
956 @param "aFormats1" "The first format list."
957 @param "aFormats2" "The second format list."
958 @param "aCommonFormat" "The target variable where the common format found (if any) is stored."
959 @return "True if a common format was found, false if not. If no common format was found,
960 aCommonFormat is not modified."
962 IMPORT_C static TBool FindCommonFormat(const TArray<TUncompressedVideoFormat>& aFormats1,
963 const TArray<TUncompressedVideoFormat>& aFormats2,
964 TUncompressedVideoFormat& aCommonFormat);
967 Finds all available decoders for a given video type with support for certain post-processing
968 operations. The video type is specified using its MIME type, which may include parameters
969 specifying the supported level, version, and other information. Decoder HW devices can use
970 wildcards when listing the supported video types in the ECom registration information, so it is
971 possible that all the decoders returned do not support the specified submode, e.g. profile and
972 level, unless aExactMatch is set.
973 The decoder capabilities can be checked with VideoCodecInfoLC().
975 @param "aMimeType" "The video type that will be decoded."
976 @param "aPostProcType" "The post-processing types that the decoder has to support, a binary OR
977 of TPrePostProcessType values. If no post-processing support is needed,
978 set this value to zero."
979 @param "aDecoders" "An array for the result decoder UIDs. The array must be created and
980 destroyed by the caller."
981 @param "aExactMatch" "True if exact matching should be used. In this only decoders that support
982 exactly the MIME-type given will be returned. Since verifying this may
983 require loading the decoders into memory, this can be a fairly expensive
984 operation, and if the user needs to verify their capabilities further in
985 any case this parameter should be set to EFalse."
986 @leave "This method may leave with one of the system-wide error codes. Typical error codes used:
987 * KErrNotFound: No decoders were found matching the search parameters."
989 IMPORT_C void FindDecodersL(const TDesC8& aMimeType,
990 TUint32 aPostProcType,
991 RArray<TUid>& aDecoders,
992 TBool aExactMatch=ETrue);
995 Finds all available post-processors for a given set of post-processing operations.
996 @param "aPostProcType" "The post-processing types that the hardware device has to support,
997 a binary OR of TPrePostProcessType values."
998 @param "aPostProcessors" "An array for the result post-processor UIDs. The array must be
999 created and destroyed by the caller."
1000 @leave "This method may leave with one of the system-wide error codes. Typical error codes used:
1001 * KErrNotFound: No post-processors were found matching the search parameters."
1003 IMPORT_C void FindPostProcessorsL(TUint32 aPostProcType, RArray<TUid>& aPostProcessors);
1006 Retrieves a list of available video decoders in the system.
1007 @param "aDecoders" "An array for the result decoder UIDs. The array must be created and
1008 destroyed by the caller."
1009 @leave "This method may leave with one of the system-wide error codes. Not finding any decoders
1010 is not treated as an error condition: in this situation, aDecoders will be empty."
1012 IMPORT_C void GetDecoderListL(RArray<TUid>& aDecoders);
1015 Retrieves a list of available video post-processors in the system.
1017 @param aPostProcessors
1018 An array for the result post-processor UIDs. The array must be created and
1019 destroyed by the caller.
1021 @leave This method may leave with one of the system-wide error codes. Not finding any post-processors
1022 is not treated as an error condition: in this situation, aDecoders will be empty.
1024 IMPORT_C void GetPostProcessorListL(RArray<TUid>& aPostProcessors);
1027 Retrieves information about an installed video decoder. Note that this method will need to load
1028 the codec hardware device into memory, and can thus be relatively expensive.
1029 @param "aVideoDecoder" "The video decoder to query."
1030 @return "Decoder information as a CVideoDecoderInfo object. The object is pushed to the cleanup
1031 stack, and must be deallocated by the caller."
1032 @leave "This method may leave with one of the system-wide error codes."
1034 IMPORT_C CVideoDecoderInfo* VideoDecoderInfoLC(TUid aVideoDecoder);
1037 Retrieves information about the post-processing capabilities of an installed post-processor or
1038 decoder hardware device. Note that this method will need to load the device into memory, and can
1039 thus be relatively expensive.
1040 @param "aPostProcessor" "The post-processor to query."
1041 @return "Post-processor information as a CPostProcessorInfo object. The object is pushed to the
1042 cleanup stack, and must be deallocated by the caller."
1043 @leave "This method may leave with one of the system-wide error codes."
1045 IMPORT_C CPostProcessorInfo* PostProcessorInfoLC(TUid aPostProcessor);
1048 Selects the video decoder to be used. This method must be called before any other video decoder
1049 related methods are used. The decoder to use can be changed by calling this method again before
1050 the API has been initialized with Initialize().
1051 All video decoder settings are reset to their default values, which are up to the implementation
1052 to decide if not specified in any of the MSL specifications. By default no post-processing is
1055 @param "aDecoder" "The video decoder to use."
1056 @return "Hardware device ID, used in other methods for configuring the decoder."
1057 @leave "The method will leave if an error occurs. Typical error codes used:
1058 * KErrNotFound - No decoder was found with the given UID"
1059 @pre "This method can only be called before the API has been initialized with Initialize()."
1061 IMPORT_C THwDeviceId SelectDecoderL(TUid aDecoder);
1064 Selects the video post-processor to be used. This method must be called before any other
1065 post-processor related methods are used. The post-processor to use can be changed by calling
1066 this method again before the API has been initialized with Initialize().
1067 All post-processor settings are reset to their default values, which are up to the implementation
1068 to decide if not specified in any of the MSL specifications.
1070 @param "aPostProcessor" "The post-processor to use."
1071 @return "Hardware device ID, used in other methods for configuring the post-processor."
1072 @leave "The method will leave if an error occurs. Typical error codes used:
1073 * KErrNotFound - No post-processor was found with the given UID"
1074 @pre "This method can only be called before the API has been initialized with Initialize()."
1076 IMPORT_C THwDeviceId SelectPostProcessorL(TUid aPostProcessor);
1079 Reads header information from a coded data unit. [1 #59] This method can be called only after
1081 @param "aDataUnitType" "The type of coded data unit that is contained in aDataUnit. If the
1082 data is a simple piece of bitstream, use
1083 EDuArbitraryStreamSection."
1084 @param "aDataUnitEncapsulation" "The encapsulation type used for the coded data. If the data
1085 is a simple piece of bitstream, use EDuElementaryStream."
1086 @param "aDataUnit" "The coded data unit, contained in a TVideoInputBuffer."
1087 @return "Header information for the data unit, or NULL if the coded data unit did not contain
1088 enough data to parse the header. The header data must be returned to the API using
1089 ReturnHeader() before the API is shut down or the decoder is changed. The data remains
1090 valid until it is returned."
1091 @leave "The method will leave if an error occurs. Running out of data is not considered an error,
1092 as described above. Typical error codes used:
1093 * KErrNotSupported - The data is not in a supported format.
1094 * KErrCorrupt - The data appears to be in a supported format, but is corrupted."
1096 IMPORT_C TVideoPictureHeader* GetHeaderInformationL(TVideoDataUnitType aDataUnitType,
1097 TVideoDataUnitEncapsulation aDataUnitEncapsulation,
1098 TVideoInputBuffer* aDataUnit);
1100 IMPORT_C void ConfigureDecoderL(const TVideoPictureHeader& aVideoPictureHeader);
1103 Returns a header from GetHeaderInformationL() back to the decoder so that the memory can be freed.
1104 @param "aHeader" "The header to return."
1105 @pre "This method can only be called before the API has been initialized with Initialize()."
1107 IMPORT_C void ReturnHeader(TVideoPictureHeader* aHeader);
1110 Sets a hardware device input format to an uncompressed video format. Only post-processors support
1111 uncompressed video input.
1112 @param "aHwDevice" "The hardware device to configure. The value is returned from
1113 SelectPostProcessorL() when the device is selected."
1114 @param "aFormat" "The input format to use."
1115 @leave "The method will leave if an error occurs. Typical error codes used:
1116 * KErrNotSupported - The input format is not supported."
1117 @pre "This method can only be called before the API has been initialized with Initialize()."
1119 IMPORT_C void SetInputFormatL(THwDeviceId aHwDevice, const TUncompressedVideoFormat& aFormat);
1122 Sets a hardware device Input format to a compressed video format. Only decoders support compressed
1124 @param "aHwDevice" "The hardware device to configure. The value is returned from
1125 SelectDecoderL() when the device is selected."
1126 @param "aFormat" "The input format to use."
1127 @param "aDataUnitType" "The data unit type for input data."
1128 @param "aEncapsulation" "The encapsulation type used for the coded data."
1129 @param "aDataInOrder" "True if the input data is written in correct decoding order, false if
1130 the input data may be written in arbitrary order."
1131 @leave "The method will leave if an error occurs. Typical error codes used:
1132 * KErrNotSupported - The input format is not supported."
1133 @pre "This method can only be called before the API has been initialized with Initialize()."
1135 IMPORT_C void SetInputFormatL(THwDeviceId aHwDevice,
1136 const CCompressedVideoFormat& aFormat,
1137 TVideoDataUnitType aDataUnitType,
1138 TVideoDataUnitEncapsulation aEncapsulation,
1139 TBool aDataInOrder);
1142 Retrieves the list of the output formats a hardware device supports. The list is ordered in
1143 preference order, with the preferred formats at the beginning of the list. The list can depend
1144 on the device source format, and therefore SetSourceFormatL() must be called for the device
1145 before calling this method.
1146 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectDecoderL()
1147 or SelectPostProcessorL() when the device is selected."
1148 @param "aFormats" "An array for the result format list. The array must be created and destroyed
1150 @leave "This method may leave with one of the system-wide error codes."
1151 @pre "This method can only be called before the API has been initialized with Initialize()."
1153 IMPORT_C void GetOutputFormatListL(THwDeviceId aHwDevice, RArray<TUncompressedVideoFormat>& aFormats);
1156 Sets the output format for a hardware device. If a decoder and a post-processor are used, the
1157 decoder output format must match the post-processor source format.
1159 If direct screen access is being used, then it is not necessary to call this method on the
1160 hwdevice performing the direct screen access.
1162 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectDecoderL()
1163 or SelectPostProcessorL() when the device is selected."
1164 @param "aFormat" "The format to use."
1165 @leave "The method will leave if an error occurs. Typical error codes used:
1166 * KErrNotSupported - The output format is not supported."
1167 @pre "This method can only be called before the API has been initialized with Initialize()."
1169 IMPORT_C void SetOutputFormatL(THwDeviceId aHwDevice, const TUncompressedVideoFormat &aFormat);
1172 Sets the clock source to use for video timing. When video playback is synchronized with audio, the
1173 clock source is implemented by the audio playback subsystem, otherwise the clock source should get
1174 the time from the system clock. If no clock source is set, video playback will not be synchronized,
1175 but will proceed as fast as possible, depending on input data and output buffer availability. This
1176 method can be called after all hardware devices have been selected, but before calling Initialize().
1178 All decoders must support synchronization with an external clock source, as well as unsynchronized
1179 non-realtime operation. When a clock source is set, the decoder can skip pictures to maintain
1180 synchronization. When non-realtime operation is used and no clock source has been set, pictures
1181 may not be skipped unless a lower complexity level is used that requires this.
1183 @param "aClock" "The clock source to use"
1184 @pre "This method can only be called before the API has been initialized with Initialize()."
1186 IMPORT_C void SetClockSource(MMMFClockSource* aClock);
1189 Sets the video output destination. The destination can be the screen (using direct screen access)
1190 or memory buffers. By default memory buffers are used. This method must be called after the
1191 decoder and post-processor have been selected and their options set, since support for direct
1192 screen access can vary between hardware devices.
1193 @param "aScreen" "True if video output destination is the screen, false if memory buffers."
1194 @leave "The method will leave if an error occurs. Typical error codes used:
1195 * KErrNotSupported - The selected video destination is not supported with the
1196 current codec and post-processor settings."
1197 @pre "This method can only be called before the API has been initialized with Initialize()."
1199 IMPORT_C void SetVideoDestScreenL(TBool aScreen);
1202 Sets whether the decoder should synchronize decoding to the current clock source, if any, or
1203 should decode all pictures as soon as possible. If decoding is synchronized, decoding timestamps
1204 are used if available, presentation timestamps are used if not. When decoding is not synchronized,
1205 pictures are decoded as soon as source data is available for them and the decoder has a free
1206 output buffer. If a clock source is not available, decoding will not be synchronized.
1208 @param "aSynchronize" "True if decoding should be synchronized to a clock source."
1209 @pre "This method can only be called before the API has been initialized with Initialize()."
1211 IMPORT_C void SynchronizeDecoding(TBool aSynchronize);
1214 Sets video decoder buffering options.
1215 @param "aOptions" "Buffering options."
1216 @leave "The method will leave if an error occurs. Typical error codes used:
1217 * KErrNotSupported - The specified buffering options are not supported. If the
1218 client receives this error code, it can call GetBufferOptions() to determine
1219 the options the decoder is able to support."
1220 @pre "This method can only be called before the API has been initialized with Initialize()."
1222 IMPORT_C void SetBufferOptionsL(const TBufferOptions& aOptions);
1225 Gets the video decoder buffer options actually in use. This can be used before calling
1226 SetBufferOptionsL() to determine the default options, or afterwards to check the values actually
1227 in use (if some default values were used).
1228 @param "aOptions" "Buffering options structure to fill."
1229 @pre "This method can only be called before the API has been initialized with Initialize()."
1231 IMPORT_C void GetBufferOptions(TBufferOptions& aOptions);
1234 Indicates which HRD/VBV specification is fulfilled in the input stream and any related parameters.
1235 @param "aHrdVbvSpec" "The HRD/VBV specification fulfilled, see the definition of
1236 THrdVbvSpecification for details."
1237 @param "aHrdVbvParams" "HRD/VBV parameters. The data format depends on the parameters chosen.
1238 For 3GPP TS 26.234 parameters (aHrdVbvSpec=EHrdVbv3GPP), the data in the
1239 descriptor is a package of type TPckC<T3gppHrdVbvParams>
1240 (see T3gppHrdVbvParams). If no HRD/VBV parameters are used, the descriptor
1242 @pre "This method can only be called before the API has been initialized with Initialize()."
1244 IMPORT_C void SetHrdVbvSpec(THrdVbvSpecification aHrdVbvSpec, const TDesC8& aHrdVbvParams);
1247 Sets the post-processing types to be used. This method, like all post-processing configuration
1248 methods, must be called before Initialize().
1250 Post-processing operations are carried out in the following order:
1256 Color space conversion can be performed at any point in the post-processing flow.
1258 @param "aHwDevice" "The hardware device to configure. The value is returned from
1259 SelectDecoderL() or SelectPostProcessorL() when the device is
1261 @param "aPostProcCombination" "The post-processing steps to perform, a bitwise OR of values
1262 from TPrePostProcessType."
1263 @leave "The method will leave if an error occurs. Typical error codes used:
1264 * KErrNotSupported - The post-processing combination is not supported"
1265 @pre "This method can be called either before or after the API has been initialized with Initialize().
1266 If called after initialization, the change will only be committed once CommitL() is called."
1268 IMPORT_C void SetPostProcessTypesL(THwDeviceId aHwDevice, TUint32 aPostProcCombination);
1271 Sets post-processing options for input (pan-scan) cropping. SetPostProcessTypesL() must be called
1272 before this method is used.
1273 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectDecoderL()
1274 or SelectPostProcessorL() when the device is selected."
1275 @param "aRect" "The cropping rectangle to use."
1276 @leave "The method will leave if an error occurs. Typical error codes used:
1277 * KErrNotSupported - Pan-scan cropping is not supported"
1278 @pre "This method can be called either before or after the API has been initialized with Initialize().
1279 If called after initialization, the change will only be committed once CommitL() is called."
1281 IMPORT_C void SetInputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect);
1284 Sets post-processing options for YUV to RGB color space conversion. Specifies the input YUV and
1285 output RGB formats to use explicitly. SetSourceFormatL() and SetOutputFormatL(), and
1286 SetPostProcessTypesL() must be called before this method is used.
1287 @param "aHwDevice" "The hardware device to configure. The value is returned from
1288 SelectDecoderL() or SelectPostProcessorL() when the device is selected."
1289 @param "aOptions" "The conversion options to use."
1290 @param "aYuvFormat" "Conversion source YUV format."
1291 @param "aRgbFormat" "Conversion target RGB format."
1292 @leave "The method will leave if an error occurs. Typical error codes used:
1293 * KErrNotSupported - The conversion options are not supported."
1294 @pre "This method can be called either before or after the API has been initialized with Initialize().
1295 If called after initialization, the change will only be committed once CommitL() is called."
1297 IMPORT_C void SetYuvToRgbOptionsL(THwDeviceId aHwDevice,
1298 const TYuvToRgbOptions& aOptions,
1299 const TYuvFormat& aYuvFormat,
1300 TRgbFormat aRgbFormat);
1303 Sets post-processing options for YUV to RGB color space conversion. Uses the device input and
1304 output formats. For decoders the default YUV format used is the format specified in the input
1305 bitstream. SetSourceFormatL() and SetOutputFormatL(), and SetPostProcessTypesL() must be called
1306 before this method is used.
1307 @param "aHwDevice" "The hardware device to configure. The value is returned from
1308 SelectDecoderL() or SelectPostProcessorL() when the device is selected."
1309 @param "aOptions" "The conversion options to use."
1310 @leave "The method will leave if an error occurs. Typical error codes used:
1311 * KErrNotSupported - The conversion options are not supported."
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 SetYuvToRgbOptionsL(THwDeviceId aHwDevice, const TYuvToRgbOptions& aOptions);
1318 Sets post-processing options for rotation. SetPostProcessTypesL() must be called before this
1320 @param "aHwDevice" "The hardware device to configure. The value is returned from
1321 SelectDecoderL() or SelectPostProcessorL() when the device is selected."
1322 @param "aRotationType" "The rotation to perform."
1323 @leave "The method will leave if an error occurs. Typical error codes used:
1324 * KErrNotSupported - The rotation options are not supported."
1325 @pre "This method can be called either before or after the API has been initialized with Initialize().
1326 If called after initialization, the change will only be committed once CommitL() is called."
1328 IMPORT_C void SetRotateOptionsL(THwDeviceId aHwDevice, TRotationType aRotationType);
1331 Sets post-processing options for scaling. SetPostProcessTypesL() must be called before this method
1333 @param "aHwDevice" "The hardware device to configure. The value is returned from
1334 SelectDecoderL() or SelectPostProcessorL() when the device is
1336 @param "aTargetSize" "Scaling target size. If a fixed scale factor size is used, the
1337 new dimensions must be set to width=floor(factor*width),
1338 height=floor(factor*height). For example, scaling a QCIF (176x144)
1339 picture up by a factor of 4/3 yields a size of 234x192."
1340 @param "aAntiAliasFiltering" "True if anti-aliasing filtering should be used. If the
1341 post-processor does not support anti-aliased scaling, or supports
1342 anti-aliased scaling only, this argument is ignored."
1343 @leave "The method will leave if an error occurs. Typical error codes used:
1344 * KErrNotSupported - The scale options are not supported."
1345 @pre "This method can be called either before or after the API has been initialized with Initialize().
1346 If called after initialization, the change will only be committed once CommitL() is called."
1348 IMPORT_C void SetScaleOptionsL(THwDeviceId aHwDevice,
1349 const TSize& aTargetSize,
1350 TBool aAntiAliasFiltering);
1353 Sets post-processing options for output cropping. SetPostProcessTypesL() must be called before this
1355 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectDecoderL()
1356 # SelectPostProcessorL() when the device is selected."
1357 @param "aRect" "Output cropping area."
1358 @leave "The method will leave if an error occurs. Typical error codes used:
1359 * KErrNotSupported - Output cropping is not supported."
1360 @pre "This method can be called either before or after the API has been initialized with Initialize().
1361 If called after initialization, the change will only be committed once CommitL() is called."
1363 IMPORT_C void SetOutputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect);
1366 Sets post-processing hardware device specific options. SetPostProcessTypesL() must be called
1367 before this method is used.
1368 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectDecoderL()
1369 or SelectPostProcessorL() when the device is selected."
1370 @param "aOptions" "The options. The format is plug-in specific."
1371 @leave "The method will leave if an error occurs. Typical error codes used:
1372 * KErrNotSupported - The options are not supported."
1373 @pre "This method can be called either before or after the API has been initialized with Initialize().
1374 If called after initialization, the change will only be committed once CommitL() is called."
1376 IMPORT_C void SetPostProcSpecificOptionsL(THwDeviceId aHwDevice, const TDesC8& aOptions);
1379 Initializes the video device. This method is asynchronous, DevVideoPlay will call
1380 MMMFDevVideoPlayObserver::MdvpoInitializeComplete() after initialization has completed. No
1381 DevVideoPlay method may be called while initialization is in progress, the initialization process
1382 can only be cancelled by destroying the DevVideoPlay object. After this initialization has been
1383 successfully completed, further configuration changes are not possible except where separately
1386 If initialization fails for any reason, the DevVideoPlay object must be destroyed and set up from
1389 IMPORT_C void Initialize();
1392 Commit all configuration changes since the last CommitL(), Revert() or Initialize(). This only applies
1393 to methods that can be called both before AND after DevVideoPlay has been initialized.
1394 See the following methods for details.
1396 @see SetPostProcessTypesL
1397 @see SetInputCropOptionsL
1398 @see SetYuvToRgbOptionsL
1399 @see SetRotateOptionsL
1400 @see SetScaleOptionsL
1401 @see SetOutputCropOptionsL
1402 @see SetPostProcSpecificOptionsL
1404 @leave "The method will leave if an error occurs."
1405 @pre "This method can only be called after the API has been initialized with Initialize()."
1407 IMPORT_C void CommitL();
1410 Revert any configuration changes that have not yet been committed using CommitL(). This only applies
1411 to methods that can be called both before AND after DevVideoPlay has been initialized.
1412 See the following methods for details.
1414 @see SetPostProcessTypesL
1415 @see SetInputCropOptionsL
1416 @see SetYuvToRgbOptionsL
1417 @see SetRotateOptionsL
1418 @see SetScaleOptionsL
1419 @see SetOutputCropOptionsL
1420 @see SetPostProcSpecificOptionsL
1422 @pre "This method can only be called after the API has been initialized with Initialize()."
1424 IMPORT_C void Revert();
1427 Starts video decoding directly to the display frame buffer using Direct Screen Access.
1428 Playback to the display can start immediately.
1429 @param "aVideoRect" "The video output rectangle on screen. The rectangle size should be the
1430 same as the output video size, otherwise results are undefined. Some
1431 decoders may set limitations to the position and alignment of the
1432 rectangle. The rectangle must be aligned to a 32-bit boundary on screen
1433 (even X-coordinate on 12-bpp and 16-bpp displays) and must fit completely
1435 @param "aScreenDevice" "The screen device to use. The screen device will supply frame buffer
1436 information, and is used to update the frame buffer to screen. The screen
1437 device object must be valid in the current thread."
1438 @param "aClipRegion" "Initial clipping region to use."
1439 @leave "The method will leave if an error occurs. Typical error codes used:
1440 *KErrNotSupported - Direct Screen Access is not supported"
1441 @pre "This method can only be called after the API has been initialized with Initialize()."
1443 IMPORT_C void StartDirectScreenAccessL(const TRect& aVideoRect,
1444 CFbsScreenDevice& aScreenDevice,
1445 const TRegion& aClipRegion);
1448 Sets a new clipping region for Direct Screen Access. After the method returns, no video will be
1449 drawn outside of the region. (Note that in Symbian OS clipping regions are "positive" - that is,
1450 they define the legal area inside which an application may draw.)
1452 If clipping is not supported, or the clipping region is too complex, either playback will pause
1453 or will resume without video display, depending on the current setting of SetPauseOnClipFail(),
1454 and the result can be verified with IsPlaying(). Clipping can be disabled by setting a new
1455 clipping region that includes the whole video window.
1457 @param "aRegion" "The new clipping region. After the method returns, no video will be drawn
1458 outside the region."
1459 @pre "This method can only be called after the API has been initialized with Initialize()."
1461 IMPORT_C void SetScreenClipRegion(const TRegion& aRegion);
1464 Sets whether the system should pause playback when it gets a clipping region it cannot handle,
1465 or Direct Screen Access is aborted completely. If not, decoding will proceed normally, but no
1466 video will be drawn. By default, playback is paused.
1467 @param "aPause" "True if playback should be paused when clipping fails, false if not. If
1468 playback is not paused, it will be continued without video display."
1469 @pre "This method can only be called after the API has been initialized with Initialize()."
1471 IMPORT_C void SetPauseOnClipFail(TBool aPause);
1474 Aborts Direct Screen Access completely, to be called from MAbortDirectScreenAccess::AbortNow() and
1475 similar methods. DSA can be resumed by calling StartDirectScreenAccessL().
1476 @pre "This method can only be called after the API has been initialized with Initialize()."
1478 IMPORT_C void AbortDirectScreenAccess();
1481 Indicates whether playback is proceeding. This method can be used to check whether playback was
1482 paused or not in response to a new clipping region or DSA abort.
1483 @return "ETrue if video is still being played (even if not necessarily displayed)."
1484 @pre "This method can only be called after the API has been initialized with Initialize()."
1486 IMPORT_C TBool IsPlaying();
1489 Re-draws the latest video picture. Only available when DSA is being used. If DSA is aborted
1490 or a non-supported clipping region has been set, the request may be ignored.
1491 @pre "This method can only be called after the API has been initialized with Initialize()."
1493 IMPORT_C void Redraw();
1496 Starts video playback, including decoding, post-processing, and rendering. Playback will proceed
1497 until it has been stopped or paused, or the end of the bitstream is reached.
1498 @pre "This method can only be called after the API has been initialized with Initialize()."
1500 IMPORT_C void Start();
1503 Stops video playback. No new pictures will be decoded, post-processed, or rendered.
1504 @pre "This method can only be called after the API has been initialized with Initialize()."
1506 IMPORT_C void Stop();
1509 Pauses video playback, including decoding, post-processing, and rendering. No pictures will be
1510 decoded, post-processed, or rendered until playback has been resumed. The client is responsible
1511 for pausing the clock source (typically by pausing audio output) if necessary.
1512 @pre "This method can only be called after the API has been initialized with Initialize()."
1514 IMPORT_C void Pause();
1517 Resumes video playback after a pause. The client is responsible for restarting the clock source
1519 @pre "This method can only be called after the API has been initialized with Initialize()."
1521 IMPORT_C void Resume();
1524 Changes to a new decoding and playback position, used for randomly accessing (seeking) the input
1525 stream. The position change flushes all input and output buffers. Pre-decoder and post-decoder
1526 buffering are handled as if a new bitstream was started. If the MSL video subsystem still has
1527 buffered pictures that precede the new playback position, they will be discarded. If playback is
1528 synchronized to a clock source, the client is responsible for setting the clock source to the new
1530 @param "aPlaybackPosition" "The new playback position in the video stream."
1531 @pre "This method can only be called after the API has been initialized with Initialize()."
1533 IMPORT_C void SetPosition(const TTimeIntervalMicroSeconds& aPlaybackPosition);
1536 Freezes a picture on the screen. After the picture has been frozen, no picture is displayed until
1537 the freeze is released with ReleaseFreeze(). If the video output is being written to memory
1538 buffers, not the screen, decoded pictures will not be delivered to the client when a freeze is
1539 active, but are simply discarded.
1540 @param "aPlaybackPosition" "The presentation timestamp of the picture to freeze. The frozen
1541 picture will be the first picture with a timestamp greater than or
1542 equal to this parameter."
1543 @pre "This method can only be called after the API has been initialized with Initialize()."
1545 IMPORT_C void FreezePicture(const TTimeIntervalMicroSeconds& aPlaybackPosition);
1548 Releases a picture frozen with FreezePicture().
1549 @param "aPlaybackPosition" "The presentation timestamp of the picture to release. The first
1550 picture displayed after the release will be the first picture with a
1551 timestamp greater than or equal to this parameter. To release the
1552 freeze immediately, set the timestamp to zero."
1553 @pre "This method can only be called after the API has been initialized with Initialize()."
1555 IMPORT_C void ReleaseFreeze(const TTimeIntervalMicroSeconds& aPlaybackPosition);
1558 Returns the current decoding position, i.e. the timestamp for the most recently decoded picture.
1559 @return "Current decoding position."
1560 @pre "This method can only be called after the API has been initialized with Initialize()."
1562 IMPORT_C TTimeIntervalMicroSeconds DecodingPosition();
1565 Returns the current playback position, i.e. the timestamp for the most recently displayed or
1566 virtually displayed picture.
1567 @return "Current playback position."
1568 @pre "This method can only be called after the API has been initialized with Initialize()."
1570 IMPORT_C TTimeIntervalMicroSeconds PlaybackPosition();
1573 Returns the current pre-decoder buffer size.
1574 @return "The number of bytes of data in the pre-decoder buffer."
1575 @pre "This method can only be called after the API has been initialized with Initialize()."
1577 IMPORT_C TUint PreDecoderBufferBytes();
1580 Returns the total amount of memory allocated for uncompressed pictures.
1581 @return "Total number of bytes of memory allocated for uncompressed pictures."
1582 @pre "This method can only be called after the API has been initialized with Initialize()."
1584 IMPORT_C TUint PictureBufferBytes();
1587 Reads various counters related to decoded pictures. See the definition of TPictureCounters for a
1588 description of the counters. The counters are reset when Initialize() or this method is called,
1589 and thus they only include pictures processed since the last call.
1590 @param "aCounters" "The counter structure to fill."
1591 @pre "This method can only be called after the API has been initialized with Initialize()."
1593 IMPORT_C void GetPictureCounters(TPictureCounters& aCounters);
1596 Reads various counters related to the received input bitstream and coded data units. See the
1597 definition of TBitstreamCounters for a description about the counters. The counters are reset
1598 when Initialize() or this method is called, and thus they only include data processed since the
1600 @param "aCounters" "The counter structure to fill."
1601 @pre "This method can only be called after the API has been initialized with Initialize()."
1603 IMPORT_C void GetBitstreamCounters(TBitstreamCounters& aCounters);
1606 Retrieves the number of free input buffers the decoder has available. If only a post-processor
1607 is used, the return value is undefined.
1608 @return "Number of free input buffers the decoder has available."
1609 @pre "This method can only be called after the API has been initialized with Initialize()."
1611 IMPORT_C TUint NumFreeBuffers();
1614 Sets the computational complexity level to use. The level can be set separately for each hardware
1615 device in use. If separate complexity levels are not available, the method call is ignored. If the
1616 level specified is not available, the results are undefined. Typically the device will either
1617 ignore the request or use the nearest suitable level.
1619 The complexity level can be changed at any point during playback.
1621 @param "aHwDevice" "The plug-in to control. The value is returned from SelectDecoderL()or
1622 SelectPostProcessorL() when the device is selected."
1623 @param "aLevel" "The computational complexity level to use. Level zero (0) is the most
1624 complex one, with the highest quality. Higher level numbers require less
1625 processing and may have lower quality."
1626 @pre "This method can only be called after the API has been initialized with Initialize()."
1628 IMPORT_C void SetComplexityLevel(THwDeviceId aHwDevice, TUint aLevel);
1631 Gets the number of complexity levels available.
1632 @param "aHwDevice" "The plug-in to query. The value is returned from SelectDecoderL()or
1633 SelectPostProcessorL() when the device is selected."
1634 @return "The number of complexity control levels available, or zero if the information is not
1635 available yet. The information may not be available if the number of levels depends on
1636 the input data, and enough input data has not been read yet. In that case, using level
1638 @pre "This method can only be called after the API has been initialized with Initialize()."
1640 IMPORT_C TUint NumComplexityLevels(THwDeviceId aHwDevice);
1643 Gets information about a computational complexity level. This method can be called after
1644 NumComplexityLevels() has returned a non-zero value - at that point the information is guaranteed
1645 to be available. Some hardware device implementations may not be able to provide all values,
1646 in that case the values will be approximated.
1647 @param "aHwDevice" "The hw device to query. The value is returned from SelectDecoderL()or
1648 SelectPostProcessorL() when the device is selected."
1649 @param "aLevel" "The computational complexity level to query. The level numbers range from
1650 zero (the most complex) to NumComplexityLevels()-1."
1651 @param "aInfo" "The information structure to fill."
1652 @pre "This method can only be called after the API has been initialized with Initialize()."
1654 IMPORT_C void GetComplexityLevelInfo(THwDeviceId aHwDevice, TUint aLevel, TComplexityLevelInfo& aInfo);
1657 Retrieves an empty video input buffer from the decoder. After input data has been written to the
1658 buffer, it can be written to the decoder using WriteCodedDataL(). The maximum number of buffers
1659 the client can retrieve before returning any to the decoder is determined by the
1660 TBufferOptions.iMinNumInputBuffers value set with SetBufferOptionsL().
1662 If a buffer is not immediately available, the client can wait for a MdvpoNewBuffers() callback
1663 before trying again, or poll for new buffer availability after a delay. Note that video decoding
1664 may be performed in the same thread, in a separate active object, so the client must not block
1665 the active scheduler while waiting for buffers to become available, otherwise the system can
1666 deadlock. Assuming that the client does not keep too many buffers retrieved and playback is in
1667 progress, new buffers will be available after some time.
1669 The decoder maintains ownership of the buffers even while they have been retrieved by the client,
1670 and will take care of deallocating them. The client must not destroy the buffer objects, even if
1671 it has retrieved buffers and it is being shut down. The buffers will be destroyed by the decoder,
1672 and will not be valid after the decoder has been shut down.
1674 @param "aBufferSize" "Required buffer size, in bytes. The resulting buffer can be larger than
1675 this, but not smaller"
1676 @return "A new input data buffer. The buffer is at least as large as requested, but it may be
1677 larger. If no free buffers are available, the return value is NULL."
1678 @leave "The method will leave if an error occurs. Lack of free buffers is not considered an error."
1680 IMPORT_C TVideoInputBuffer* GetBufferL(TUint aBufferSize);
1683 Writes a piece of coded video data. The data will be passed to the video decoder and
1684 post-processor to be used in video playback. The data buffer must be retrieved from the decoder
1686 @param "aBuffer" "The coded data unit to write."
1687 @leave "The method will leave if an error occurs."
1688 @pre "This method can only be called after the API has been initialized with Initialize()."
1690 IMPORT_C void WriteCodedDataL(TVideoInputBuffer* aBuffer);
1693 Writes an uncompressed video picture. The picture must remain valid and unmodified until it is
1694 returned with the MdvpoReturnPicture() callback.
1695 @param "aPicture" "The picture to write."
1696 @leave "The method will leave if an error occurs."
1697 @pre "This method can only be called after the API has been initialized with Initialize()."
1699 IMPORT_C void WritePictureL(TVideoPicture* aPicture);
1702 Notifies the system that the end of input data has been reached.
1704 The decoder and post-processor can use this signal to ensure that the remaining data gets processed,
1705 without waiting for new data. For example when the data type is not EDuCodedPicture, calling this
1706 method is necessary otherwise a decoder implementation might be waiting for the start code for the
1707 next picture to ensure it has a complete picture before starting to decode the previous one.
1710 After the remaining data has been processed (and displayed, if applicable), the client gets
1711 notified with the MdvpoStreamEnd() callback. The client must then call Stop() on the interface.
1713 DevVideo clients are encouraged to call this method, but its use is not mandatory for synchronized
1714 processing. For synchronized playback, all video pictures are processed or discarded according to
1715 their timestamps, and so the client can easily infer when processing is complete. However, it
1716 should be noted that the last picture might not be displayed if this method is not called and the
1717 input data type is not EDuCodedPicture.
1719 For non-synchronized playback (e.g. file conversion), a client must call this method otherwise it
1720 will never find out when the hardware device has finished processing the data.
1722 @pre "This method can only be called after the API has been initialized with Initialize()."
1724 IMPORT_C void InputEnd();
1727 Gets information about new decoded pictures. "New decoded pictures" are pictures that have not
1728 been returned to the caller using NextPicture(). This method can only be called if video
1729 destination is memory buffers, i.e. Direct Screen Access is not used.
1730 @param "aNumPictures" "Target for the number of new decoded pictures. If no pictures are
1731 available, the value written is zero, and the timestamps are not
1733 @param "aEarliestTimestamp" "Timestamp for the earliest available new decoded picture. If the
1734 number of new decoded pictures (aNumPictures) is zero, the
1735 timestamp is not valid."
1736 @param "aLatestTimestamp" "Timestamp for the latest available new decoded picture. If the
1737 number of new decoded pictures (aNumPictures) is zero, the
1738 timestamp is not valid."
1739 @pre "This method can only be called after the API has been initialized with Initialize()."
1741 IMPORT_C void GetNewPictureInfo(TUint& aNumPictures,
1742 TTimeIntervalMicroSeconds& aEarliestTimestamp,
1743 TTimeIntervalMicroSeconds& aLatestTimestamp);
1746 Gets the next (in displaying order) new decoded picture. Only one picture can be retrieved at a
1747 time, the current picture must be returned with ReturnPicture() before a new one can be read.
1748 @return "The next new decoded picture. The pointer and the related data is valid until the picture
1749 is returned using ReturnPicture(), or the API is shut down. If no new picture is available,
1750 the method returns NULL."
1751 @leave "The method will leave if an error occurs."
1752 @pre "This method can only be called after the API has been initialized with Initialize()."
1754 IMPORT_C TVideoPicture* NextPictureL();
1757 Returns a picture from NextPicture() back to the device. The picture data cannot be used afterwards.
1758 @param "aPicture" "The picture to return. After this method returns, the pointer is no longer
1759 valid and the picture data cannot be used."
1760 @pre "This method can only be called after the API has been initialized with Initialize()."
1762 IMPORT_C void ReturnPicture(TVideoPicture* aPicture);
1765 Gets a copy of the latest picture displayed.
1766 @param "aPictureData" "Target picture. The memory for the picture must be allocated by the
1767 caller, and initialized properly. The data formats must match the snapshot
1769 @param "aFormat" "The picture format to use for the snapshot."
1770 @return "ETrue if the snapshot was taken, EFalse if a picture is not available. The picture may not
1771 be available if decoding has not progressed far enough yet."
1772 @leave "The method will leave if an error occurs. Typical error codes used:
1773 *KErrNotSupported - The requested data format or picture size is not supported."
1774 @pre "This method can only be called after the API has been initialized with Initialize()."
1776 IMPORT_C TBool GetSnapshotL(TPictureData& aPictureData, const TUncompressedVideoFormat& aFormat);
1779 Gets a copy of a specified picture. Timed snapshots are required for implementing the video
1780 telephony use-case. Simply using the latest picture may not work, since the latest picture
1781 is typically not the one whose supplemental information is being processed.
1783 The picture is specified using its presentation timestamp. The timestamp must match the timestamp
1784 in the picture exactly, otherwise no snapshot will be taken. The timestamp must refer to the
1785 currently displayed picture or a future picture. Typically the timestamp is received with
1786 supplemental information (with the MdvpoSupplementalInformation() callback) indicating a snapshot
1789 When the snapshot is available, it will be returned to the client using the
1790 MdvpoTimedSnapshotComplete() callback. To cancel a timed snapshot request, use
1791 CancelTimedSnapshot(). Only one timed snapshot request can be active at a time.
1793 @param "aPictureData" "Target picture. The memory for the picture must be allocated
1794 by the caller, and initialized properly. The data formats must
1795 match the snapshot format requested. The picture must remain
1796 valid until the snapshot has been taken or until the request
1797 has been cancelled with CancelTimedSnapshot()."
1798 @param "aFormat" "The picture format to use for the snapshot."
1799 @param "aPresentationTimestamp" "Presentation timestamp for the picture to copy. The timestamp
1800 must match the timestamp in the picture exactly"
1801 @leave "The method will leave if an error occurs. Typical error codes used:
1802 *KErrNotSupported - The requested data format or picture size is not supported."
1803 @pre "This method can only be called after the API has been initialized with Initialize()."
1805 IMPORT_C void GetTimedSnapshotL(TPictureData* aPictureData,
1806 const TUncompressedVideoFormat& aFormat,
1807 const TTimeIntervalMicroSeconds& aPresentationTimestamp);
1810 Gets a copy of a specified picture. Timed snapshots are required for implementing the video
1811 telephony use-case. Simply using the latest picture may not work, since the latest picture
1812 is typically not the one whose supplemental information is being processed.
1814 The picture is specified using either its picture identifier. The id must refer to the currently
1815 displayed picture or a future picture. Typically the picture ID is received with supplemental
1816 information (with the MdvpoSupplementalInformation() callback) indicating a snapshot picture.
1818 When the snapshot is available, it will be returned to the client using the
1819 MdvpoTimedSnapshotComplete() callback. To cancel a timed snapshot request, use
1820 CancelTimedSnapshot(). Only one timed snapshot request can be active at a time.
1822 @param "aPictureData" "Target picture. The memory for the picture must be allocated by the
1823 caller, and initialized properly. The data formats must match the snapshot
1824 format requested. The picture must remain valid until the snapshot has been
1825 taken or until the request has been cancelled with CancelTimedSnapshot()."
1826 @param "aFormat" "The picture format to use for the snapshot."
1827 @param "aPictureId" "Picture identifier for the picture to copy."
1828 @leave "The method will leave if an error occurs. Typical error codes used:
1829 *KErrNotSupported - The requested data format or picture size is not supported."
1830 @pre "This method can only be called after the API has been initialized with Initialize()."
1832 IMPORT_C void GetTimedSnapshotL(TPictureData* aPictureData,
1833 const TUncompressedVideoFormat& aFormat,
1834 const TPictureId& aPictureId);
1837 Cancels a timed snapshot request.
1838 @pre "This method can only be called after the API has been initialized with Initialize()."
1840 IMPORT_C void CancelTimedSnapshot();
1843 Gets a list of the supported snapshot picture formats.
1844 @param "aFormats" "An array for the result format list. The array must be created and destroyed by the caller."
1845 @leave "The method will leave if an error occurs."
1846 @pre "This method can only be called after the API has been initialized with Initialize()."
1848 IMPORT_C void GetSupportedSnapshotFormatsL(RArray<TUncompressedVideoFormat>& aFormats);
1851 Retrieves a custom interface to the specified hardware device.
1852 @param "aHwDevice" "The hardware device from which the custom interface shall be requested.
1853 The value is returned from SelectDecoderL() or SelectPostProcessorL() when
1854 the device is selected."
1855 @param "aInterface" "Interface UID, defined with the custom interface."
1856 @return "Pointer to the interface implementation, or NULL if the device does not
1857 implement the interface requested. The return value must be cast to the
1858 correct type by the user."
1860 IMPORT_C TAny* CustomInterface(THwDeviceId aHwDevice, TUid aInterface);
1863 enum TInitializationState
1865 ENotInitialized = 0x01,
1866 EInitializing = 0x02,
1867 EInitialized = 0x04,
1868 EInitializationFailed = 0x08
1871 CMMFDevVideoPlay(MMMFDevVideoPlayObserver& aObserver);
1873 // Methods to check aHwDevice is valid and return the appropriate HwDevice
1874 CMMFVideoPlayHwDevice& VideoPlayHwDevice(THwDeviceId aHwDevice) const;
1875 CMMFVideoPlayHwDevice& RenderingHwDevice() const; //returns the last plugin in the chain
1876 CMMFVideoDecodeHwDevice& VideoDecodeHwDevice(THwDeviceId aHwDevice) const;// Checks that aHwDevice is valid
1877 CMMFVideoPostProcHwDevice& VideoPostProcHwDevice(THwDeviceId aHwDevice) const;// Checks that aHwDevice is valid
1878 CMMFVideoDecodeHwDevice& VideoDecodeHwDevice() const;
1879 CMMFVideoPostProcHwDevice& VideoPostProcHwDevice() const;
1880 CMMFVideoHwDevice& VideoHwDevice(THwDeviceId aHwDevice) const;
1882 // Connects the plugins together
1883 void ConnectPlugins();
1885 // Check that we are in a valid initialization state
1886 // Panics if iInitializationState is not one of aExpected
1887 void CheckInitializationState(TUint aExpected);
1889 // Methods to handle init complete callbacks from the hw devices
1890 void HandlePostProcInitializeComplete(TInt aError);
1891 void HandleDecodeInitializeComplete(TInt aError);
1893 CMMFVideoDecodeHwDevice* CreateDecoderL(TUid aVideoDecoder);
1896 // From MMMFDevVideoPlayProxy
1897 virtual void MdvppNewPicture(TVideoPicture* aPicture);
1898 virtual void MdvppNewBuffers();
1899 virtual void MdvppReturnPicture(TVideoPicture* aPicture);
1900 virtual void MdvppSupplementalInformation(const TDesC8& aData,
1901 const TTimeIntervalMicroSeconds& aTimestamp,
1902 const TPictureId& aPictureId);
1903 virtual void MdvppPictureLoss();
1904 virtual void MdvppPictureLoss(const TArray<TPictureId>& aPictures);
1905 virtual void MdvppSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture);
1906 virtual void MdvppReferencePictureSelection(const TDesC8& aSelectionData);
1907 virtual void MdvppTimedSnapshotComplete(TInt aError,
1908 TPictureData* aPictureData,
1909 const TTimeIntervalMicroSeconds& aPresentationTimestamp,
1910 const TPictureId& aPictureId);
1911 virtual void MdvppFatalError(CMMFVideoHwDevice* aDevice, TInt aError);
1912 virtual void MdvppInitializeComplete(CMMFVideoHwDevice* aDevice, TInt aError);
1913 virtual void MdvppStreamEnd();
1916 MMMFDevVideoPlayObserver& iObserver;
1917 CMMFVideoDecodeHwDevice* iVideoDecodeHwDevice;
1918 CMMFVideoPostProcHwDevice* iVideoPostProcHwDevice;
1919 TUint iInitializationState;
1921 TDblQue<TVideoPicture> iVideoPictureQue;
1922 TDblQueIter<TVideoPicture> iVideoPictureQueIter;
1923 TUint iNumberOfVideoPictures;
1924 // Not to be used, but kept for BC purposes
1927 TUint iNumberOfMdvppStreamEndCallbacks;
1928 TBool iIsDecodeComplete;
1930 #ifdef SYMBIAN_MULTIMEDIA_CODEC_API
1931 RImplInfoPtrArray iPuImplementations;
1932 TBool iPuListCreated;
1933 #endif // SYMBIAN_MULTIMEDIA_CODEC_API
1938 The MMMFDevVideoPlayObserver mixin class defines a set of callback functions that the client using
1939 the MSL video API needs to implement. The callbacks are called in the context of the same thread that
1940 uses the API. DevVideo API methods can be safely called from the callbacks.
1944 class MMMFDevVideoPlayObserver
1948 Notifies the client that one or more new empty input buffers are available. The client can fetch
1949 the input buffer with GetBufferL().
1951 virtual void MdvpoNewBuffers() = 0;
1954 Returns a used input video picture back to the caller. The picture memory can be re-used or freed.
1955 @param "aPicture" "The picture to return."
1957 virtual void MdvpoReturnPicture(TVideoPicture* aPicture) = 0;
1960 Delivers supplemental information from a coded data unit. The information is codec-dependent.
1961 @param "aData" "The supplemental data. The reference is only valid until the method
1962 returns, and thus the data must be processed or copied immediately."
1963 @param "aTimestamp" "The presentation timestamp for the picture that the supplemental data
1965 @param "aPictureId" "Picture identifier for the picture. If a picture ID is not available,
1966 aPictureId.iIdType is set to ENone."
1968 virtual void MdvpoSupplementalInformation(const TDesC8& aData,
1969 const TTimeIntervalMicroSeconds& aTimestamp,
1970 const TPictureId& aPictureId) = 0;
1973 Back channel information from the decoder, indicating a picture loss without specifying the lost picture.
1975 virtual void MdvpoPictureLoss() = 0;
1978 Back channel information from the decoder, indicating the pictures that have been lost.
1980 @param "aPictures" "Picture identifiers for the lost pictures. The reference is only valid until the
1981 method returns, and thus the data must be processed or copied immediately."
1983 virtual void MdvpoPictureLoss(const TArray<TPictureId>& aPictures) = 0;
1986 Back channel information from the decoder, indicating the loss of consecutive macroblocks in raster
1989 @param "aFirstMacroblock" "The first lost macroblock. The macroblocks are numbered such
1990 that the macroblock in the upper left corner of the picture is considered
1991 macroblock number 1 and the number for each macroblock increases from left
1992 to right and then from top to bottom in raster-scan order."
1993 @param "aNumMacroblocks" "The number of lost macroblocks that are consecutive in raster-scan order."
1994 @param "aPicture" "The picture identifier for the picture where the macroblocks were lost.
1995 If the picture is not known, aPicture.iIdType is set to ENone. The reference
1996 is only valid until the method returns."
1998 virtual void MdvpoSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture)= 0;
2001 Back channel information from the decoder, indicating a reference picture selection request. The
2002 request is delivered as a coding-standard specific binary message. Reference picture selection can
2003 be used to select a pervious correctly transmitted picture to use as a reference in case later pictures
2006 @param "aSelectionData" "The reference picture selection request message. The message format is
2007 coding-standard specific, and defined separately. The reference is only
2008 valid until the method returns, and thus the data must be processed or
2009 copied immediately."
2011 virtual void MdvpoReferencePictureSelection(const TDesC8& aSelectionData)= 0;
2014 Called when a timed snapshot request has been completed. When this method is called, the snapshot
2015 has been taken, and the memory reserved for the picture can be re-used or freed.
2016 @param "aError" "An error code, KErrNone if no errors occurred. If an error
2017 occurred, the data in the snapshot may not be valid, but the
2018 memory can still be freed."
2019 @param "aPictureData" "The snapshot picture data."
2020 @param "aPresentationTimestamp" "The presentation timestamp for the snapshot picture. "
2021 @param "aPictureId" "Picture identifier for the picture. If a picture ID is not
2022 available, aPictureId.iIdType is set to ENone."
2024 virtual void MdvpoTimedSnapshotComplete(TInt aError,
2025 TPictureData* aPictureData,
2026 const TTimeIntervalMicroSeconds& aPresentationTimestamp,
2027 const TPictureId& aPictureId) = 0;
2030 Notifies the client that one or more new output pictures are available. The client can then use
2031 GetNewPictureInfo() and NextPicture() to fetch the pictures.
2033 virtual void MdvpoNewPictures() = 0;
2036 Reports a fatal decoding or playback error to the client. When these errors
2037 occur, decoding and playback is stopped automatically. The client must
2038 destroy the CMMFDevVideoPlay object and create a new instance before
2039 attempting to continue. Note that scenarios have been identified where
2040 MdvpoFatalError may get referenced at some point during the execution of a
2041 CMMFDevVideoPlay procedure. Therefore CMMFDevVideoPlay object should be
2042 deleted outside of MdvpoFatalError context in order to avoid accidental
2043 access to de-allocated CMMFDevVideoPlay data members.
2045 Note that running out of processing power or encountering corrupted
2046 bitstream data should not be classified as errors if the decoder and
2047 post-processor can recover automatically.
2049 @param "aError" "The error code."
2051 virtual void MdvpoFatalError(TInt aError) = 0;
2054 Reports that DevVideoPlay initialization has completed. The interface can now be used for video
2056 @param "aError" "Initialization error code, KErrNone if no error occurred."
2058 virtual void MdvpoInitComplete(TInt aError) = 0;
2061 Reports that the input video stream end has been reached and all pictures have been processed.
2062 This method is only called after the client has called InputEnd(). No more output pictures will
2065 virtual void MdvpoStreamEnd() = 0;
2069 #include <mmf/devvideo/devvideoplay.inl>