Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.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();
174 enum TVideoBufferOptions
176 /** The sequence number field is valid. */
177 ESequenceNumber = 0x00000001,
178 /** The decoding timestamp field is valid */
179 EDecodingTimestamp = 0x00000002,
180 /** The presentation timestamp field is valid.*/
181 EPresentationTimestamp = 0x00000004
185 Pointer to the video data.
190 Data unit options. The value is a bitfield combined from values from TVideoBufferOptions.
191 @see TVideoBufferOptions
196 Data unit decoding timestamp. Valid if EDecodingTimestamp is set in the options.
198 TTimeIntervalMicroSeconds iDecodingTimestamp;
201 Data unit presentation timestamp. Valid if EPresentationTimestamp is set in the options.
202 If the input bitstream does not contain timestamp information, this field should be valid,
203 otherwise pictures cannot be displayed at the correct time. If the input bitstream contains
204 timestamp information (such as the TR syntax element of H.263 bitstreams) and valid
205 iPresentationTimestamp is provided, the value of iPresentationTimestamp is used in playback.
207 TTimeIntervalMicroSeconds iPresentationTimestamp;
210 True if the data is part of a pre-roll period and may not be drawn. The decoder may skip
211 display-related operations, but must still decode normally since pre-roll may not end in a key
217 Data unit sequence number. Valid if ESequenceNumber is set in the options. If present, the
218 sequence number is incremented once per coded data unit, a gap in the numbers indicates missing
221 TUint iSequenceNumber;
224 True if the data unit is known to contain erroneous data.
229 A queue link used internally by the MSL API. The field must not be modified while the buffer is
230 in the MSL API, but can be used by the client before the buffer has been written and after the
231 buffer has been returned.
236 A pointer for free-form user data. The pointer is set by the module that created the buffer, and
237 is usually used for memory management purposes.
244 This class contains information about the post-processing functionality that a single post-processor
245 or decoder hardware device has. Although it mainly contains static data, it is defined as a complete
246 CBase-derived class since the data is relatively complex and proper memory management is necessary.
248 The objects are created by the post-processor or decoder devices, and used by the MSL video client code.
252 class CPostProcessorInfo : public CBase
256 Creates and returns a new CPostProcessorInfo object.
258 @param "aUid" "The UID of the post-processor."
259 @param "aManufacturer" "The manufacturer of the post-processor hw device."
260 @param "aIdentifier" "The post-processor hw device manufacturer-specific
262 @param "aVersion" "The post-processor version."
263 @param "aSupportedFormats" "The source formats supported by the post-processor."
264 @param "aSupportedCombinations" "The supported post-processing combinations. An array of
265 values created by the bitwise OR-ing of values from
266 TPrePostProcessType."
267 @param "aAccelerated" "Whether the post processor is hardware-accelerated.
268 Accelerated post-processors can run on an application DSP
269 or dedicated hardware."
270 @param "aSupportsDirectDisplay" "Whether the hw device supports output directly to the
272 @param "aYuvToRgbCapabilities" "The post-processor YUV to RGB conversion capabilities."
273 @param "aSupportedRotations" "A bitwise OR of values of TRotationType to indicate the
274 supported rotation types."
275 @param "aSupportArbitraryScaling" "Whether the post-processor supports arbitrary scaling."
276 @param "aSupportedScaleFactors" "A list of the discrete scaling factors supported. If the
277 post-processor supports arbitrary scaling, this list should
278 be left zero-length."
279 @param "aAntiAliasedScaling" "Whether anti-aliasing filtering for scaling is supported."
280 @param "aImplementationSpecificInfo" "Implementation-specific information."
282 @return "A new CPostProcessorInfo object."
283 @leave "This method may leave with one of the system-wide error codes."
285 IMPORT_C static CPostProcessorInfo* NewL(TUid aUid,
286 const TDesC& aManufacturer,
287 const TDesC& aIdentifier,
289 const TArray<TUncompressedVideoFormat>& aSupportedFormats,
290 const TArray<TUint32>& aSupportedCombinations,
292 TBool aSupportsDirectDisplay,
293 const TYuvToRgbCapabilities& aYuvToRgbCapabilities,
294 TUint32 aSupportedRotations,
295 TBool aSupportArbitraryScaling,
296 const TArray<TScaleFactor>& aSupportedScaleFactors,
297 TBool aAntiAliasedScaling,
298 const TDesC8& aImplementationSpecificInfo = KNullDesC8);
303 IMPORT_C ~CPostProcessorInfo();
306 Returns the post-processor UID.
307 @return "Post-processor UID"
309 IMPORT_C TUid Uid() const;
312 Returns the post-processor hardware device manufacturer.
313 @return "The manufacturer name as a standard Symbian descriptor. The reference is valid until the
314 CPostProcessorInfo object is destroyed."
316 IMPORT_C const TDesC& Manufacturer() const;
319 Returns the post-processor hardware device manufacturer-specific identifier.
320 The combination of the manufacturer and identifier uniquely identifies the device.
321 @return "The identifier as a standard Symbian descriptor. The reference is valid until the
322 CPostProcessorInfo object is destroyed."
324 IMPORT_C const TDesC& Identifier() const;
327 Returns the post-processor version.
328 @return "Post-processor version."
330 IMPORT_C TVersion Version() const;
333 Checks if the post-processor supports the given format as a source format.
334 @param "aFormat" "The format to check. The reference is not used after the method returns."
335 @return "ETrue if the post-processor supports the given format, EFalse if not."
337 IMPORT_C TBool SupportsFormat(const TUncompressedVideoFormat& aFormat) const;
340 Lists the source formats supported by the post-processor.
341 @return "A RArray table of supported video formats (TUncompressedVideoFormat). The reference is
342 valid until the CPostProcessorInfo object is destroyed."
344 IMPORT_C const RArray<TUncompressedVideoFormat>& SupportedFormats() const;
347 Checks if the post-processor supports the given post-processing combination.
348 @param "aCombination" "Post-processing combination, a bitwise OR of values from TPrePostProcessType."
349 @return "ETrue if the post-processing combination is supported, EFalse if not."
351 IMPORT_C TBool SupportsCombination(TUint32 aCombination) const;
354 Lists all supported post-processing combinations.
355 @return "A RArray table or post-processing combinations. Each value is a bitwise OR of values from
356 TPrePostProcessType. The reference is valid until the CPostProcessorInfo object is destroyed."
358 IMPORT_C const RArray<TUint32>& SupportedCombinations() const;
361 Returns whether the hardware device is hardware-accelerated. Hardware-accelerated post-processors
362 can run on an application DSP or dedicated hardware.
363 @return "ETrue if the device is hardware-accelerated."
365 IMPORT_C TBool Accelerated() const;
368 Returns whether the hardware device supports output directly to the screen. Output to memory buffers
370 @return "ETrue if the post-processor supports direct screen output."
372 IMPORT_C TBool SupportsDirectDisplay() const;
375 Returns the post-processor YUV to RGB color conversion capabilities.
376 @return "The conversion capabilities as a TYuvToRgbCapabilities structure. The reference is valid
377 until the CPostProcessorInfo object is destroyed. If the post-processor does not support
378 YUV to RGB conversion, the contents are undefined."
380 IMPORT_C const TYuvToRgbCapabilities& YuvToRgbCapabilities() const;
383 Returns the rotation types the post-processor supports.
384 @return "The supported rotation types as a bitwise OR of TRotationType values. If the
385 post-processor does not support rotation, the return value is zero."
387 IMPORT_C TUint32 SupportedRotations() const;
390 Returns whether the post-processor supports arbitrary scaling. If arbitrary scaling is not
391 supported, a limited selection of scaling factors may still be available, use
392 SupportedScaleFactors() to retrieve those.
393 @return "ETrue if the post-processor supports arbitrary scaling, EFalse if not."
395 IMPORT_C TBool SupportsArbitraryScaling() const;
398 Returns the scaling factors the post-processor supports. If the post-processor supports arbitrary
399 scaling the list is empty - use SupportsArbitraryScaling() first.
400 @return "A RArray list of supported scale factors (TScaleFactor). The reference is valid until the
401 CPostProcessorInfo object is destroyed. If the post-processor supports arbitrary scaling
402 or no scaling at all, the list is empty."
404 IMPORT_C const RArray<TScaleFactor>& SupportedScaleFactors() const;
407 Returns whether the hardware device supports anti-aliasing filtering for scaling.
408 @return "True if anti-aliasing filtering is supported."
410 IMPORT_C TBool AntiAliasedScaling() const;
413 Returns implementation-specific information about the post-processor.
414 @return "Implementation- specific information about the post-processor. The data format is
415 implementation-specific, and defined separately by the post-processor supplier. The
416 reference is valid until the CPostProcessorInfo object is destroyed."
418 IMPORT_C const TDesC8& ImplementationSpecificInfo() const;
421 Adds the screen number into the list of screens supported by the post processor.
422 @leave "KErrNoMemory when there is no memory to expand the list of supported screens.
423 KErrNotSupported if the secondary screen display is not supported in Multimedia Framework."
425 IMPORT_C void AddSupportedScreenL(TInt aScreenNo);
428 Lists the screens supported by the post processor.
429 @param "aSupportedScreens" "An array to retrieve the list of supported screens.
430 This method resets the array before adding elements to it.
431 The array must be created and destroyed by the caller."
432 @leave "KErrNotSupported if the secondary screen display is not supported in Multimedia Framework.
433 KErrNoMemory when there is no memory to expand the list."
435 IMPORT_C void GetSupportedScreensL(RArray<TInt>& aSupportedScreens) const;
437 CPostProcessorInfo(TUid aUid,
440 TBool aSupportDirectDisplay,
441 const TYuvToRgbCapabilities& aYuvToRgbCapabilities,
442 TUint32 aSupportedRotations,
443 TBool aSupportArbitraryScaling,
444 TBool aAntiAliasedScaling);
446 void ConstructL(const TDesC& aManufacturer,
447 const TDesC& aIdentifier,
448 const TArray<TUncompressedVideoFormat>& aSupportedFormats,
449 const TArray<TUint32>& aSupportedCombinations,
450 const TArray<TScaleFactor>& aSupportedScaleFactors,
451 const TDesC8& aImplementationSpecificInfo);
456 TBool iSupportDirectDisplay;
457 TYuvToRgbCapabilities iYuvToRgbCapabilities;
458 TUint32 iSupportedRotations;
459 TBool iSupportArbitraryScaling;
460 TBool iAntiAliasedScaling;
461 HBufC* iManufacturer;
463 HBufC8* iImplementationSpecificInfo;
464 RArray<TUncompressedVideoFormat> iSupportedFormats;
465 RArray<TUint32> iSupportedCombinations;
466 RArray<TScaleFactor> iSupportedScaleFactors;
467 RArray<TInt> iSupportedScreens;
472 This class contains information about a single video decoder. Although it mainly contains static data,
473 it is defined as a complete CBase-derived class since the data is relatively complex and proper memory
474 management is necessary.
476 The objects are created by the video decoder hardware devices, and used by the MSL video client code.
480 class CVideoDecoderInfo : public CBase
484 Creates and returns a new CVideoDecoderInfo object.
486 @param "aUid" "The uid of the decoder."
487 @param "aManufacturer" "The video decoder manufacturer."
488 @param "aIdentifier" "The manufacturer-specific identifier for this video decoder."
489 @param "aVersion" "The version of this video decoder."
490 @param "aSupportedFormats" "An array of the formats supported by the decoder.
491 A copy will be taken of the array and the referenced
492 CCompressedVideoFormat objects"
493 @param "aAccelerated" "Whether this decoder is accelerated or not."
494 @param "aSupportsDirectDisplay" "Whether this decoder supports direct display or not."
495 @param "aMaxPictureSize" "The maximum picture size supported by the decoder."
496 @param "aMaxBitrate" "The maximum bit rate supported by the decoder. Use KMaxTUint32 if there are no bit-rate restrictions."
497 @param "aMaxPictureRates" "An array of the maximum picture size/rate combinations supported by the decoder."
498 @param "aSupportsPictureLoss" "Whether the decoder supports picture loss indications."
499 @param "aSupportsSliceLoss" "Whether the decoder supports slice loss indications."
500 @param "aCodingStandardSpecificInfo" "Coding-standard specific information about the decoder."
501 @param "aImplementationSpecificInfo" "Implementation-specific information about the decoder."
503 @return "A new CVideoDecoderInfo object."
504 @leave "This method may leave with one of the system-wide error codes."
506 IMPORT_C static CVideoDecoderInfo* NewL(TUid aUid,
507 const TDesC& aManufacturer,
508 const TDesC& aIdentifier,
510 const TArray<CCompressedVideoFormat*>& aSupportedFormats,
512 TBool aSupportsDirectDisplay,
513 const TSize& aMaxPictureSize,
515 const TArray<TPictureRateAndSize>& aMaxPictureRates,
516 TBool aSupportsPictureLoss,
517 TBool aSupportsSliceLoss,
518 const TDesC8& aCodingStandardSpecificInfo = KNullDesC8,
519 const TDesC8& aImplementationSpecificInfo = KNullDesC8);
524 IMPORT_C ~CVideoDecoderInfo();
527 Checks if the decoder supports the given format.
528 @param "aFormat" "The format to check. The reference is not used after the method returns."
529 @return "ETrue if the codec supports the given format, EFalse if not."
531 IMPORT_C TBool SupportsFormat(const CCompressedVideoFormat& aFormat) const;
534 Lists the video formats, including submodes, supported by the decoder.
535 @return "A RPointerArray table of supported video formats (CCompressedVideoFormat). The reference
536 is valid until the CVideoDecoderInfo object is destroyed."
538 IMPORT_C const RPointerArray<CCompressedVideoFormat>& SupportedFormats() const;
541 Returns the codec device manufacturer.
542 @return "The manufacturer name as a standard Symbian descriptor. The reference is valid until the
543 CVideoDecoderInfo object is destroyed."
545 IMPORT_C const TDesC& Manufacturer() const;
548 Returns the codec device manufacturer-specific identifier. The combination of the manufacturer
549 and identifier uniquely identifies the hardware device.
550 @return "The identifier as a standard Symbian descriptor. The reference is valid until the
551 CVideoDecoderInfo object is destroyed."
553 IMPORT_C const TDesC& Identifier() const;
556 Returns the decoder version.
557 @return "Decoder version."
559 IMPORT_C TVersion Version() const;
562 Returns the decoder UID.
563 @return "Decoder UID."
565 IMPORT_C TUid Uid() const;
568 Returns whether the decoder is hardware-accelerated. A hardware-accelerated decoder can run on
569 an application DSP or dedicated hardware.
570 @return "True if the decoder is hardware-accelerated."
572 IMPORT_C TBool Accelerated() const;
575 Returns whether the hardware device supports output directly to the screen. Output to memory
576 buffers is always supported.
577 @return "True if the hardware device supports direct screen output."
579 IMPORT_C TBool SupportsDirectDisplay() const;
582 Returns the maximum picture size the decoder supports.
584 Note that if the decoder reports that it supports a certain profile and level, then it
585 shall support all bitstreams corresponding to that profile/level. This method can be used
586 to specify capabilities that are beyond the standard levels (for example some MPEG-4 bitstreams
587 are encoded with picture sizes that are larger than those specified by the profile/level of the
590 @return "The maximum picture size supported. The reference is valid until the CVideoDecoderInfo
591 object is destroyed."
593 IMPORT_C const TSize& MaxPictureSize() const;
596 Returns the maximum bit-rate supported by the decoder.
598 Note that if the decoder reports that it supports a certain profile and level, then it shall
599 support all bitstreams corresponding to that profile/level. This method can be used to
600 specify capabilities that are beyond the standard levels (for example some MPEG-4 bitstreams
601 are encoded with bit rates that are higher than those specified by the profile/level of the
604 @return "Maximum bit-rate supported, in bits per second. KMaxTUint32 can be used if the decoder
605 has no bit-rate restrictions."
607 IMPORT_C TUint MaxBitrate() const;
610 Returns the maximum picture size/rate combinations supported by the decoder.
612 Video decoders can have different maximum picture rate limitations depending on the picture size used.
613 Note that if the decoder reports that it supports a certain profile and level, then it shall
614 support all bitstreams corresponding to that profile/level. This method can be used to specify
615 capabilities that are beyond the standard levels (for example some MPEG-4 bitstreams are encoded
616 with picture rates that are beyond those specified by the profile/level of the bitstream).
618 @return "A reference to an array of picture size/rate combinations. The reference remains valid
619 until this object is deleted."
621 IMPORT_C const RArray<TPictureRateAndSize>& MaxPictureRates() const;
624 Returns whether the decoder supports picture loss indications. If true, the decoder indicates
625 lost pictures by calling MdvpoPictureLoss().
627 @return "True if the decoder supports picture loss indications."
629 IMPORT_C TBool SupportsPictureLoss() const;
632 Returns whether the decoder supports slice loss indications. If true, the decoder indicates
633 lost macroblocks by calling MdvpoSliceLoss().
635 @return "True if the decoder supports slice loss indications."
637 IMPORT_C TBool SupportsSliceLoss() const;
640 Returns coding-standard specific information about the decoder.
641 @return "Coding-standard specific information about the decoder. The data format is coding-standard
642 specific, and defined separately. The reference is valid until the CVideoDecoderInfo object
645 IMPORT_C const TDesC8& CodingStandardSpecificInfo() const;
648 Returns implementation-specific information about the decoder.
649 @return "Implementation- specific information about the decoder. The data format is
650 implementation-specific, and defined separately by the decoder supplier. The reference
651 is valid until the CVideoDecoderInfo object is destroyed."
653 IMPORT_C const TDesC8& ImplementationSpecificInfo() const;
656 Adds the screen number into the list of screens supported by the decoder.
657 @leave "KErrNoMemory when there is no memory to expand the list of supported screens.
658 KErrNotSupported if the secondary screen display is not supported in Multimedia Framework."
660 IMPORT_C void AddSupportedScreenL(TInt aScreenNo);
663 Lists the screens supported by the decoder.
664 @param "aSupportedScreens" "An array to retrieve the list of supported screens.
665 This method resets the array before adding elements to it.
666 The array must be created and destroyed by the caller."
667 @leave "KErrNotSupported if the secondary screen display is not supported in Multimedia Framework.
668 KErrNoMemory when there is no memory to expand the list."
670 IMPORT_C void GetSupportedScreensL(RArray<TInt>& aSupportedScreens) const;
672 CVideoDecoderInfo(TUid aUid,
675 TBool aSupportsDirectDisplay,
676 const TSize& aMaxPictureSize,
678 TBool aSupportsPictureLoss,
679 TBool aSupportsSliceLoss);
681 void ConstructL(const TDesC& aManufacturer,
682 const TDesC& aIdentifier,
683 const TArray<CCompressedVideoFormat*>& aSupportedFormats,
684 const TArray<TPictureRateAndSize>& aMaxPictureRates,
685 const TDesC8& aCodingStandardSpecificInfo,
686 const TDesC8& aImplementationSpecificInfo);
691 TBool iSupportsDirectDisplay;
692 TSize iMaxPictureSize;
694 TBool iSupportsPictureLoss;
695 TBool iSupportsSliceLoss;
696 HBufC* iManufacturer;
698 RPointerArray<CCompressedVideoFormat> iSupportedFormats;
699 RArray<TPictureRateAndSize> iMaxPictureRates;
700 HBufC8* iCodingStandardSpecificInfo;
701 HBufC8* iImplementationSpecificInfo;
702 RArray<TInt> iSupportedScreens;
709 CMMFDevVideoPlay is the main client API for DevVideoPlay.
713 class CMMFDevVideoPlay : public CBase, private MMMFDevVideoPlayProxy
717 Picture statistic counters. Used for following playback progress. The counters can be retrieved
718 using GetPictureCounters() and are reset after each call. The client must keep track of the
719 cumulative values for counters and picture processing rates itself if necessary.
721 class TPictureCounters
725 Default constructor. Zeros all members.
727 inline TPictureCounters();
730 The number of pictures skipped due to lack of processing power. This does not include pictures
731 inside data bytes discarded due to buffer overflows, but includes all pictures skipped at
732 picture decoding, post-processing and rendering phase.
734 TUint iPicturesSkipped;
737 The number of pictures decoded.
739 TUint iPicturesDecoded;
742 The number of pictures "virtually" displayed. "Virtually" displayed pictures are pictures
743 that have been drawn on the screen, when using direct rendering, or pictures that have been
744 decoded, processed, and delivered to the client when not using direct rendering.
746 TUint iPicturesDisplayed;
749 The total number of pictures in the input bitstream. This figure does not include pictures that
750 have been lost due to transmission errors, since those have not been processed by the MSL
751 hardware devices, but does include pictures that have been discarded by the HW devices due
752 to buffer overflows or other reasons.
754 TUint iTotalPictures;
758 Bitstream statistic counters, used for following decoding progress. The counters can be retrieved
759 using GetBitstreamCounters() and are reset after each call. The client must keep track of the
760 cumulative values for counters itself if necessary.
762 class TBitstreamCounters
766 Default constructor. Zeros all members.
768 inline TBitstreamCounters();
771 Number of lost packets. This figure includes all packets that have been dropped by the hardware
772 devices due to buffer overruns, but it does not include packets lost due to transmission errors.
777 Total number of packets. This figure includes all the packets that have been received by the
778 decoder, including packets that have been dropped due to buffer overruns.
784 Buffer options used with SetBufferOptionsL().
790 Default constructor. Zeros all members.
792 inline TBufferOptions();
796 Pre-decoder buffer size in bytes. Set to zero to use decoder default value.
798 TUint iPreDecodeBufferSize;
801 Maximum post-decoder buffer size in bytes. Set to zero to remove limitations.
803 TUint iMaxPostDecodeBufferSize;
806 Initial pre-decoder buffering period, the amount of coded data to be buffered before decoding
807 starts. If the value is set to zero, decoding begins immediately when all data associated with
808 the first decoding timestamp is received. Default value is zero.
810 TTimeIntervalMicroSeconds iPreDecoderBufferPeriod;
813 The amount of data buffered after the decoding before playback starts. If the value is zero,
814 playback begins immediately when the first picture has been decoded. The default value is zero.
816 TTimeIntervalMicroSeconds iPostDecoderBufferPeriod;
819 The maximum input buffer size that the client will request. If the buffer options have been
820 set successfully, the decoder must be able to supply buffers of this size. If no information
821 is available about the bitstream, the client may have to set this value to a relatively large
822 value, and thus the decoder should not by default allocate buffers of this size before they
823 are explicitly requested.
825 TUint iMaxInputBufferSize;
828 The minimum number of input buffers the decoder needs to have available. This is the number of
829 buffers the client can request through GetBufferL() before writing any back using
832 TUint iMinNumInputBuffers;
836 Information about a single computational complexity level.
838 class TComplexityLevelInfo
843 /** The average picture rate field is valid. */
844 EAvgPictureRate = 0x00000001,
845 /** The picture size field is valid. */
846 EPictureSize = 0x00000002,
847 /** The relative image quality field is valid. */
848 ERelativeImageQuality = 0x00000004,
849 /** The required MIPS field is valid. */
850 ERequiredMIPS = 0x00000008,
851 /** The relative processing time field is valid. */
852 ERelativeProcessTime = 0x00000010
855 Structure options. The value is a bitfield combined from values from TOptions.
860 The average picture rate, in pictures per second. Valid only if EAvgPictureRate is set in the
861 options. This value depends on the input bitstream, and may not be available if enough
862 bitstream has not been read.
864 TReal iAvgPictureRate;
867 Picture size (spatial resolution), in pixels. Valid only if EPictureSize is set in the options.
872 Relative image quality, compared to the best available level. 1.0 is the quality at the
873 maximum quality level (level zero). Valid only if ERelativeImageQuality is set in the options.
875 TReal iRelativeImageQuality;
878 The number of MIPS required to process the data. Valid only if ERequiredMIPS is set in
884 Relative amount of processing time needed compared to standard-compliant decoding of all data.
885 1.0 is the processing time required for full processing, which usually corresponds to
886 complexity level zero. Valid only if ERelativeProcessTime is set in the options.
888 TReal iRelativeProcessTime;
894 Constructs a new MSL video client instance. Each client instance supports a single video bitstream.
897 The observer object to use.
899 @return A pointer to a new CMMFDevVideoPlay object.
900 @leave This method may leave with one of the system-wide error codes.
902 IMPORT_C static CMMFDevVideoPlay* NewL(MMMFDevVideoPlayObserver& aObserver);
907 IMPORT_C ~CMMFDevVideoPlay();
910 Finds a common format from two lists of uncompressed video formats. Used typically to find a
911 suitable intermediate format between a video decoder and a post-processor. If multiple common
912 formats are available, the lowest-cost format is selected, assuming that the cost of each format
913 is equal to its position in the input array.
914 @param "aFormats1" "The first format list."
915 @param "aFormats2" "The second format list."
916 @param "aCommonFormat" "The target variable where the common format found (if any) is stored."
917 @return "True if a common format was found, false if not. If no common format was found,
918 aCommonFormat is not modified."
920 IMPORT_C static TBool FindCommonFormat(const TArray<TUncompressedVideoFormat>& aFormats1,
921 const TArray<TUncompressedVideoFormat>& aFormats2,
922 TUncompressedVideoFormat& aCommonFormat);
925 Finds all available decoders for a given video type with support for certain post-processing
926 operations. The video type is specified using its MIME type, which may include parameters
927 specifying the supported level, version, and other information. Decoder HW devices can use
928 wildcards when listing the supported video types in the ECom registration information, so it is
929 possible that all the decoders returned do not support the specified submode, e.g. profile and
930 level, unless aExactMatch is set.
931 The decoder capabilities can be checked with VideoCodecInfoLC().
933 @param "aMimeType" "The video type that will be decoded."
934 @param "aPostProcType" "The post-processing types that the decoder has to support, a binary OR
935 of TPrePostProcessType values. If no post-processing support is needed,
936 set this value to zero."
937 @param "aDecoders" "An array for the result decoder UIDs. The array must be created and
938 destroyed by the caller."
939 @param "aExactMatch" "True if exact matching should be used. In this only decoders that support
940 exactly the MIME-type given will be returned. Since verifying this may
941 require loading the decoders into memory, this can be a fairly expensive
942 operation, and if the user needs to verify their capabilities further in
943 any case this parameter should be set to EFalse."
944 @leave "This method may leave with one of the system-wide error codes. Typical error codes used:
945 * KErrNotFound: No decoders were found matching the search parameters."
947 IMPORT_C void FindDecodersL(const TDesC8& aMimeType,
948 TUint32 aPostProcType,
949 RArray<TUid>& aDecoders,
950 TBool aExactMatch=ETrue);
953 Finds all available post-processors for a given set of post-processing operations.
954 @param "aPostProcType" "The post-processing types that the hardware device has to support,
955 a binary OR of TPrePostProcessType values."
956 @param "aPostProcessors" "An array for the result post-processor UIDs. The array must be
957 created and destroyed by the caller."
958 @leave "This method may leave with one of the system-wide error codes. Typical error codes used:
959 * KErrNotFound: No post-processors were found matching the search parameters."
961 IMPORT_C void FindPostProcessorsL(TUint32 aPostProcType, RArray<TUid>& aPostProcessors);
964 Retrieves a list of available video decoders in the system.
965 @param "aDecoders" "An array for the result decoder UIDs. The array must be created and
966 destroyed by the caller."
967 @leave "This method may leave with one of the system-wide error codes. Not finding any decoders
968 is not treated as an error condition: in this situation, aDecoders will be empty."
970 IMPORT_C void GetDecoderListL(RArray<TUid>& aDecoders);
973 Retrieves a list of available video post-processors in the system.
975 @param aPostProcessors
976 An array for the result post-processor UIDs. The array must be created and
977 destroyed by the caller.
979 @leave This method may leave with one of the system-wide error codes. Not finding any post-processors
980 is not treated as an error condition: in this situation, aDecoders will be empty.
982 IMPORT_C void GetPostProcessorListL(RArray<TUid>& aPostProcessors);
985 Retrieves information about an installed video decoder. Note that this method will need to load
986 the codec hardware device into memory, and can thus be relatively expensive.
987 @param "aVideoDecoder" "The video decoder to query."
988 @return "Decoder information as a CVideoDecoderInfo object. The object is pushed to the cleanup
989 stack, and must be deallocated by the caller."
990 @leave "This method may leave with one of the system-wide error codes."
992 IMPORT_C CVideoDecoderInfo* VideoDecoderInfoLC(TUid aVideoDecoder);
995 Retrieves information about the post-processing capabilities of an installed post-processor or
996 decoder hardware device. Note that this method will need to load the device into memory, and can
997 thus be relatively expensive.
998 @param "aPostProcessor" "The post-processor to query."
999 @return "Post-processor information as a CPostProcessorInfo object. The object is pushed to the
1000 cleanup stack, and must be deallocated by the caller."
1001 @leave "This method may leave with one of the system-wide error codes."
1003 IMPORT_C CPostProcessorInfo* PostProcessorInfoLC(TUid aPostProcessor);
1006 Selects the video decoder to be used. This method must be called before any other video decoder
1007 related methods are used. The decoder to use can be changed by calling this method again before
1008 the API has been initialized with Initialize().
1009 All video decoder settings are reset to their default values, which are up to the implementation
1010 to decide if not specified in any of the MSL specifications. By default no post-processing is
1013 @param "aDecoder" "The video decoder to use."
1014 @return "Hardware device ID, used in other methods for configuring the decoder."
1015 @leave "The method will leave if an error occurs. Typical error codes used:
1016 * KErrNotFound - No decoder was found with the given UID"
1017 @pre "This method can only be called before the API has been initialized with Initialize()."
1019 IMPORT_C THwDeviceId SelectDecoderL(TUid aDecoder);
1022 Selects the video post-processor to be used. This method must be called before any other
1023 post-processor related methods are used. The post-processor to use can be changed by calling
1024 this method again before the API has been initialized with Initialize().
1025 All post-processor settings are reset to their default values, which are up to the implementation
1026 to decide if not specified in any of the MSL specifications.
1028 @param "aPostProcessor" "The post-processor to use."
1029 @return "Hardware device ID, used in other methods for configuring the post-processor."
1030 @leave "The method will leave if an error occurs. Typical error codes used:
1031 * KErrNotFound - No post-processor was found with the given UID"
1032 @pre "This method can only be called before the API has been initialized with Initialize()."
1034 IMPORT_C THwDeviceId SelectPostProcessorL(TUid aPostProcessor);
1037 Reads header information from a coded data unit. [1 #59] This method can be called only after
1039 @param "aDataUnitType" "The type of coded data unit that is contained in aDataUnit. If the
1040 data is a simple piece of bitstream, use
1041 EDuArbitraryStreamSection."
1042 @param "aDataUnitEncapsulation" "The encapsulation type used for the coded data. If the data
1043 is a simple piece of bitstream, use EDuElementaryStream."
1044 @param "aDataUnit" "The coded data unit, contained in a TVideoInputBuffer."
1045 @return "Header information for the data unit, or NULL if the coded data unit did not contain
1046 enough data to parse the header. The header data must be returned to the API using
1047 ReturnHeader() before the API is shut down or the decoder is changed. The data remains
1048 valid until it is returned."
1049 @leave "The method will leave if an error occurs. Running out of data is not considered an error,
1050 as described above. Typical error codes used:
1051 * KErrNotSupported - The data is not in a supported format.
1052 * KErrCorrupt - The data appears to be in a supported format, but is corrupted."
1054 IMPORT_C TVideoPictureHeader* GetHeaderInformationL(TVideoDataUnitType aDataUnitType,
1055 TVideoDataUnitEncapsulation aDataUnitEncapsulation,
1056 TVideoInputBuffer* aDataUnit);
1058 IMPORT_C void ConfigureDecoderL(const TVideoPictureHeader& aVideoPictureHeader);
1061 Returns a header from GetHeaderInformationL() back to the decoder so that the memory can be freed.
1062 @param "aHeader" "The header to return."
1063 @pre "This method can only be called before the API has been initialized with Initialize()."
1065 IMPORT_C void ReturnHeader(TVideoPictureHeader* aHeader);
1068 Sets a hardware device input format to an uncompressed video format. Only post-processors support
1069 uncompressed video input.
1070 @param "aHwDevice" "The hardware device to configure. The value is returned from
1071 SelectPostProcessorL() when the device is selected."
1072 @param "aFormat" "The input format to use."
1073 @leave "The method will leave if an error occurs. Typical error codes used:
1074 * KErrNotSupported - The input format is not supported."
1075 @pre "This method can only be called before the API has been initialized with Initialize()."
1077 IMPORT_C void SetInputFormatL(THwDeviceId aHwDevice, const TUncompressedVideoFormat& aFormat);
1080 Sets a hardware device Input format to a compressed video format. Only decoders support compressed
1082 @param "aHwDevice" "The hardware device to configure. The value is returned from
1083 SelectDecoderL() when the device is selected."
1084 @param "aFormat" "The input format to use."
1085 @param "aDataUnitType" "The data unit type for input data."
1086 @param "aEncapsulation" "The encapsulation type used for the coded data."
1087 @param "aDataInOrder" "True if the input data is written in correct decoding order, false if
1088 the input data may be written in arbitrary order."
1089 @leave "The method will leave if an error occurs. Typical error codes used:
1090 * KErrNotSupported - The input format is not supported."
1091 @pre "This method can only be called before the API has been initialized with Initialize()."
1093 IMPORT_C void SetInputFormatL(THwDeviceId aHwDevice,
1094 const CCompressedVideoFormat& aFormat,
1095 TVideoDataUnitType aDataUnitType,
1096 TVideoDataUnitEncapsulation aEncapsulation,
1097 TBool aDataInOrder);
1100 Retrieves the list of the output formats a hardware device supports. The list is ordered in
1101 preference order, with the preferred formats at the beginning of the list. The list can depend
1102 on the device source format, and therefore SetSourceFormatL() must be called for the device
1103 before calling this method.
1104 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectDecoderL()
1105 or SelectPostProcessorL() when the device is selected."
1106 @param "aFormats" "An array for the result format list. The array must be created and destroyed
1108 @leave "This method may leave with one of the system-wide error codes."
1109 @pre "This method can only be called before the API has been initialized with Initialize()."
1111 IMPORT_C void GetOutputFormatListL(THwDeviceId aHwDevice, RArray<TUncompressedVideoFormat>& aFormats);
1114 Sets the output format for a hardware device. If a decoder and a post-processor are used, the
1115 decoder output format must match the post-processor source format.
1117 If direct screen access is being used, then it is not necessary to call this method on the
1118 hwdevice performing the direct screen access.
1120 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectDecoderL()
1121 or SelectPostProcessorL() when the device is selected."
1122 @param "aFormat" "The format to use."
1123 @leave "The method will leave if an error occurs. Typical error codes used:
1124 * KErrNotSupported - The output format is not supported."
1125 @pre "This method can only be called before the API has been initialized with Initialize()."
1127 IMPORT_C void SetOutputFormatL(THwDeviceId aHwDevice, const TUncompressedVideoFormat &aFormat);
1130 Sets the clock source to use for video timing. When video playback is synchronized with audio, the
1131 clock source is implemented by the audio playback subsystem, otherwise the clock source should get
1132 the time from the system clock. If no clock source is set, video playback will not be synchronized,
1133 but will proceed as fast as possible, depending on input data and output buffer availability. This
1134 method can be called after all hardware devices have been selected, but before calling Initialize().
1136 All decoders must support synchronization with an external clock source, as well as unsynchronized
1137 non-realtime operation. When a clock source is set, the decoder can skip pictures to maintain
1138 synchronization. When non-realtime operation is used and no clock source has been set, pictures
1139 may not be skipped unless a lower complexity level is used that requires this.
1141 @param "aClock" "The clock source to use"
1142 @pre "This method can only be called before the API has been initialized with Initialize()."
1144 IMPORT_C void SetClockSource(MMMFClockSource* aClock);
1147 Sets the video output destination. The destination can be the screen (using direct screen access)
1148 or memory buffers. By default memory buffers are used. This method must be called after the
1149 decoder and post-processor have been selected and their options set, since support for direct
1150 screen access can vary between hardware devices.
1151 @param "aScreen" "True if video output destination is the screen, false if memory buffers."
1152 @leave "The method will leave if an error occurs. Typical error codes used:
1153 * KErrNotSupported - The selected video destination is not supported with the
1154 current codec and post-processor settings."
1155 @pre "This method can only be called before the API has been initialized with Initialize()."
1157 IMPORT_C void SetVideoDestScreenL(TBool aScreen);
1160 Sets whether the decoder should synchronize decoding to the current clock source, if any, or
1161 should decode all pictures as soon as possible. If decoding is synchronized, decoding timestamps
1162 are used if available, presentation timestamps are used if not. When decoding is not synchronized,
1163 pictures are decoded as soon as source data is available for them and the decoder has a free
1164 output buffer. If a clock source is not available, decoding will not be synchronized.
1166 @param "aSynchronize" "True if decoding should be synchronized to a clock source."
1167 @pre "This method can only be called before the API has been initialized with Initialize()."
1169 IMPORT_C void SynchronizeDecoding(TBool aSynchronize);
1172 Sets video decoder buffering options.
1173 @param "aOptions" "Buffering options."
1174 @leave "The method will leave if an error occurs. Typical error codes used:
1175 * KErrNotSupported - The specified buffering options are not supported. If the
1176 client receives this error code, it can call GetBufferOptions() to determine
1177 the options the decoder is able to support."
1178 @pre "This method can only be called before the API has been initialized with Initialize()."
1180 IMPORT_C void SetBufferOptionsL(const TBufferOptions& aOptions);
1183 Gets the video decoder buffer options actually in use. This can be used before calling
1184 SetBufferOptionsL() to determine the default options, or afterwards to check the values actually
1185 in use (if some default values were used).
1186 @param "aOptions" "Buffering options structure to fill."
1187 @pre "This method can only be called before the API has been initialized with Initialize()."
1189 IMPORT_C void GetBufferOptions(TBufferOptions& aOptions);
1192 Indicates which HRD/VBV specification is fulfilled in the input stream and any related parameters.
1193 @param "aHrdVbvSpec" "The HRD/VBV specification fulfilled, see the definition of
1194 THrdVbvSpecification for details."
1195 @param "aHrdVbvParams" "HRD/VBV parameters. The data format depends on the parameters chosen.
1196 For 3GPP TS 26.234 parameters (aHrdVbvSpec=EHrdVbv3GPP), the data in the
1197 descriptor is a package of type TPckC<T3gppHrdVbvParams>
1198 (see T3gppHrdVbvParams). If no HRD/VBV parameters are used, the descriptor
1200 @pre "This method can only be called before the API has been initialized with Initialize()."
1202 IMPORT_C void SetHrdVbvSpec(THrdVbvSpecification aHrdVbvSpec, const TDesC8& aHrdVbvParams);
1205 Sets the post-processing types to be used. This method, like all post-processing configuration
1206 methods, must be called before Initialize().
1208 Post-processing operations are carried out in the following order:
1214 Color space conversion can be performed at any point in the post-processing flow.
1216 @param "aHwDevice" "The hardware device to configure. The value is returned from
1217 SelectDecoderL() or SelectPostProcessorL() when the device is
1219 @param "aPostProcCombination" "The post-processing steps to perform, a bitwise OR of values
1220 from TPrePostProcessType."
1221 @leave "The method will leave if an error occurs. Typical error codes used:
1222 * KErrNotSupported - The post-processing combination is not supported"
1223 @pre "This method can be called either before or after the API has been initialized with Initialize().
1224 If called after initialization, the change will only be committed once CommitL() is called."
1226 IMPORT_C void SetPostProcessTypesL(THwDeviceId aHwDevice, TUint32 aPostProcCombination);
1229 Sets post-processing options for input (pan-scan) cropping. SetPostProcessTypesL() must be called
1230 before this method is used.
1231 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectDecoderL()
1232 or SelectPostProcessorL() when the device is selected."
1233 @param "aRect" "The cropping rectangle to use."
1234 @leave "The method will leave if an error occurs. Typical error codes used:
1235 * KErrNotSupported - Pan-scan cropping is not supported"
1236 @pre "This method can be called either before or after the API has been initialized with Initialize().
1237 If called after initialization, the change will only be committed once CommitL() is called."
1239 IMPORT_C void SetInputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect);
1242 Sets post-processing options for YUV to RGB color space conversion. Specifies the input YUV and
1243 output RGB formats to use explicitly. SetSourceFormatL() and SetOutputFormatL(), and
1244 SetPostProcessTypesL() must be called before this method is used.
1245 @param "aHwDevice" "The hardware device to configure. The value is returned from
1246 SelectDecoderL() or SelectPostProcessorL() when the device is selected."
1247 @param "aOptions" "The conversion options to use."
1248 @param "aYuvFormat" "Conversion source YUV format."
1249 @param "aRgbFormat" "Conversion target RGB format."
1250 @leave "The method will leave if an error occurs. Typical error codes used:
1251 * KErrNotSupported - The conversion options are not supported."
1252 @pre "This method can be called either before or after the API has been initialized with Initialize().
1253 If called after initialization, the change will only be committed once CommitL() is called."
1255 IMPORT_C void SetYuvToRgbOptionsL(THwDeviceId aHwDevice,
1256 const TYuvToRgbOptions& aOptions,
1257 const TYuvFormat& aYuvFormat,
1258 TRgbFormat aRgbFormat);
1261 Sets post-processing options for YUV to RGB color space conversion. Uses the device input and
1262 output formats. For decoders the default YUV format used is the format specified in the input
1263 bitstream. SetSourceFormatL() and SetOutputFormatL(), and SetPostProcessTypesL() must be called
1264 before this method is used.
1265 @param "aHwDevice" "The hardware device to configure. The value is returned from
1266 SelectDecoderL() or SelectPostProcessorL() when the device is selected."
1267 @param "aOptions" "The conversion options to use."
1268 @leave "The method will leave if an error occurs. Typical error codes used:
1269 * KErrNotSupported - The conversion options are not supported."
1270 @pre "This method can be called either before or after the API has been initialized with Initialize().
1271 If called after initialization, the change will only be committed once CommitL() is called."
1273 IMPORT_C void SetYuvToRgbOptionsL(THwDeviceId aHwDevice, const TYuvToRgbOptions& aOptions);
1276 Sets post-processing options for rotation. SetPostProcessTypesL() must be called before this
1278 @param "aHwDevice" "The hardware device to configure. The value is returned from
1279 SelectDecoderL() or SelectPostProcessorL() when the device is selected."
1280 @param "aRotationType" "The rotation to perform."
1281 @leave "The method will leave if an error occurs. Typical error codes used:
1282 * KErrNotSupported - The rotation options are not supported."
1283 @pre "This method can be called either before or after the API has been initialized with Initialize().
1284 If called after initialization, the change will only be committed once CommitL() is called."
1286 IMPORT_C void SetRotateOptionsL(THwDeviceId aHwDevice, TRotationType aRotationType);
1289 Sets post-processing options for scaling. SetPostProcessTypesL() must be called before this method
1291 @param "aHwDevice" "The hardware device to configure. The value is returned from
1292 SelectDecoderL() or SelectPostProcessorL() when the device is
1294 @param "aTargetSize" "Scaling target size. If a fixed scale factor size is used, the
1295 new dimensions must be set to width=floor(factor*width),
1296 height=floor(factor*height). For example, scaling a QCIF (176x144)
1297 picture up by a factor of 4/3 yields a size of 234x192."
1298 @param "aAntiAliasFiltering" "True if anti-aliasing filtering should be used. If the
1299 post-processor does not support anti-aliased scaling, or supports
1300 anti-aliased scaling only, this argument is ignored."
1301 @leave "The method will leave if an error occurs. Typical error codes used:
1302 * KErrNotSupported - The scale options are not supported."
1303 @pre "This method can be called either before or after the API has been initialized with Initialize().
1304 If called after initialization, the change will only be committed once CommitL() is called."
1306 IMPORT_C void SetScaleOptionsL(THwDeviceId aHwDevice,
1307 const TSize& aTargetSize,
1308 TBool aAntiAliasFiltering);
1311 Sets post-processing options for output cropping. SetPostProcessTypesL() must be called before this
1313 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectDecoderL()
1314 # SelectPostProcessorL() when the device is selected."
1315 @param "aRect" "Output cropping area."
1316 @leave "The method will leave if an error occurs. Typical error codes used:
1317 * KErrNotSupported - Output cropping is not supported."
1318 @pre "This method can be called either before or after the API has been initialized with Initialize().
1319 If called after initialization, the change will only be committed once CommitL() is called."
1321 IMPORT_C void SetOutputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect);
1324 Sets post-processing hardware device specific options. SetPostProcessTypesL() must be called
1325 before this method is used.
1326 @param "aHwDevice" "The hardware device to configure. The value is returned from SelectDecoderL()
1327 or SelectPostProcessorL() when the device is selected."
1328 @param "aOptions" "The options. The format is plug-in specific."
1329 @leave "The method will leave if an error occurs. Typical error codes used:
1330 * KErrNotSupported - The options are not supported."
1331 @pre "This method can be called either before or after the API has been initialized with Initialize().
1332 If called after initialization, the change will only be committed once CommitL() is called."
1334 IMPORT_C void SetPostProcSpecificOptionsL(THwDeviceId aHwDevice, const TDesC8& aOptions);
1337 Initializes the video device. This method is asynchronous, DevVideoPlay will call
1338 MMMFDevVideoPlayObserver::MdvpoInitializeComplete() after initialization has completed. No
1339 DevVideoPlay method may be called while initialization is in progress, the initialization process
1340 can only be cancelled by destroying the DevVideoPlay object. After this initialization has been
1341 successfully completed, further configuration changes are not possible except where separately
1344 If initialization fails for any reason, the DevVideoPlay object must be destroyed and set up from
1347 IMPORT_C void Initialize();
1350 Commit all configuration changes since the last CommitL(), Revert() or Initialize(). This only applies
1351 to methods that can be called both before AND after DevVideoPlay has been initialized.
1352 See the following methods for details.
1354 @see SetPostProcessTypesL
1355 @see SetInputCropOptionsL
1356 @see SetYuvToRgbOptionsL
1357 @see SetRotateOptionsL
1358 @see SetScaleOptionsL
1359 @see SetOutputCropOptionsL
1360 @see SetPostProcSpecificOptionsL
1362 @leave "The method will leave if an error occurs."
1363 @pre "This method can only be called after the API has been initialized with Initialize()."
1365 IMPORT_C void CommitL();
1368 Revert any configuration changes that have not yet been committed using CommitL(). This only applies
1369 to methods that can be called both before AND after DevVideoPlay has been initialized.
1370 See the following methods for details.
1372 @see SetPostProcessTypesL
1373 @see SetInputCropOptionsL
1374 @see SetYuvToRgbOptionsL
1375 @see SetRotateOptionsL
1376 @see SetScaleOptionsL
1377 @see SetOutputCropOptionsL
1378 @see SetPostProcSpecificOptionsL
1380 @pre "This method can only be called after the API has been initialized with Initialize()."
1382 IMPORT_C void Revert();
1385 Starts video decoding directly to the display frame buffer using Direct Screen Access.
1386 Playback to the display can start immediately.
1387 @param "aVideoRect" "The video output rectangle on screen. The rectangle size should be the
1388 same as the output video size, otherwise results are undefined. Some
1389 decoders may set limitations to the position and alignment of the
1390 rectangle. The rectangle must be aligned to a 32-bit boundary on screen
1391 (even X-coordinate on 12-bpp and 16-bpp displays) and must fit completely
1393 @param "aScreenDevice" "The screen device to use. The screen device will supply frame buffer
1394 information, and is used to update the frame buffer to screen. The screen
1395 device object must be valid in the current thread."
1396 @param "aClipRegion" "Initial clipping region to use."
1397 @leave "The method will leave if an error occurs. Typical error codes used:
1398 *KErrNotSupported - Direct Screen Access is not supported"
1399 @pre "This method can only be called after the API has been initialized with Initialize()."
1401 IMPORT_C void StartDirectScreenAccessL(const TRect& aVideoRect,
1402 CFbsScreenDevice& aScreenDevice,
1403 const TRegion& aClipRegion);
1406 Sets a new clipping region for Direct Screen Access. After the method returns, no video will be
1407 drawn outside of the region. (Note that in Symbian OS clipping regions are "positive" - that is,
1408 they define the legal area inside which an application may draw.)
1410 If clipping is not supported, or the clipping region is too complex, either playback will pause
1411 or will resume without video display, depending on the current setting of SetPauseOnClipFail(),
1412 and the result can be verified with IsPlaying(). Clipping can be disabled by setting a new
1413 clipping region that includes the whole video window.
1415 @param "aRegion" "The new clipping region. After the method returns, no video will be drawn
1416 outside the region."
1417 @pre "This method can only be called after the API has been initialized with Initialize()."
1419 IMPORT_C void SetScreenClipRegion(const TRegion& aRegion);
1422 Sets whether the system should pause playback when it gets a clipping region it cannot handle,
1423 or Direct Screen Access is aborted completely. If not, decoding will proceed normally, but no
1424 video will be drawn. By default, playback is paused.
1425 @param "aPause" "True if playback should be paused when clipping fails, false if not. If
1426 playback is not paused, it will be continued without video display."
1427 @pre "This method can only be called after the API has been initialized with Initialize()."
1429 IMPORT_C void SetPauseOnClipFail(TBool aPause);
1432 Aborts Direct Screen Access completely, to be called from MAbortDirectScreenAccess::AbortNow() and
1433 similar methods. DSA can be resumed by calling StartDirectScreenAccessL().
1434 @pre "This method can only be called after the API has been initialized with Initialize()."
1436 IMPORT_C void AbortDirectScreenAccess();
1439 Indicates whether playback is proceeding. This method can be used to check whether playback was
1440 paused or not in response to a new clipping region or DSA abort.
1441 @return "ETrue if video is still being played (even if not necessarily displayed)."
1442 @pre "This method can only be called after the API has been initialized with Initialize()."
1444 IMPORT_C TBool IsPlaying();
1447 Re-draws the latest video picture. Only available when DSA is being used. If DSA is aborted
1448 or a non-supported clipping region has been set, the request may be ignored.
1449 @pre "This method can only be called after the API has been initialized with Initialize()."
1451 IMPORT_C void Redraw();
1454 Starts video playback, including decoding, post-processing, and rendering. Playback will proceed
1455 until it has been stopped or paused, or the end of the bitstream is reached.
1456 @pre "This method can only be called after the API has been initialized with Initialize()."
1458 IMPORT_C void Start();
1461 Stops video playback. No new pictures will be decoded, post-processed, or rendered.
1462 @pre "This method can only be called after the API has been initialized with Initialize()."
1464 IMPORT_C void Stop();
1467 Pauses video playback, including decoding, post-processing, and rendering. No pictures will be
1468 decoded, post-processed, or rendered until playback has been resumed. The client is responsible
1469 for pausing the clock source (typically by pausing audio output) if necessary.
1470 @pre "This method can only be called after the API has been initialized with Initialize()."
1472 IMPORT_C void Pause();
1475 Resumes video playback after a pause. The client is responsible for restarting the clock source
1477 @pre "This method can only be called after the API has been initialized with Initialize()."
1479 IMPORT_C void Resume();
1482 Changes to a new decoding and playback position, used for randomly accessing (seeking) the input
1483 stream. The position change flushes all input and output buffers. Pre-decoder and post-decoder
1484 buffering are handled as if a new bitstream was started. If the MSL video subsystem still has
1485 buffered pictures that precede the new playback position, they will be discarded. If playback is
1486 synchronized to a clock source, the client is responsible for setting the clock source to the new
1488 @param "aPlaybackPosition" "The new playback position in the video stream."
1489 @pre "This method can only be called after the API has been initialized with Initialize()."
1491 IMPORT_C void SetPosition(const TTimeIntervalMicroSeconds& aPlaybackPosition);
1494 Freezes a picture on the screen. After the picture has been frozen, no picture is displayed until
1495 the freeze is released with ReleaseFreeze(). If the video output is being written to memory
1496 buffers, not the screen, decoded pictures will not be delivered to the client when a freeze is
1497 active, but are simply discarded.
1498 @param "aPlaybackPosition" "The presentation timestamp of the picture to freeze. The frozen
1499 picture will be the first picture with a timestamp greater than or
1500 equal to this parameter."
1501 @pre "This method can only be called after the API has been initialized with Initialize()."
1503 IMPORT_C void FreezePicture(const TTimeIntervalMicroSeconds& aPlaybackPosition);
1506 Releases a picture frozen with FreezePicture().
1507 @param "aPlaybackPosition" "The presentation timestamp of the picture to release. The first
1508 picture displayed after the release will be the first picture with a
1509 timestamp greater than or equal to this parameter. To release the
1510 freeze immediately, set the timestamp to zero."
1511 @pre "This method can only be called after the API has been initialized with Initialize()."
1513 IMPORT_C void ReleaseFreeze(const TTimeIntervalMicroSeconds& aPlaybackPosition);
1516 Returns the current decoding position, i.e. the timestamp for the most recently decoded picture.
1517 @return "Current decoding position."
1518 @pre "This method can only be called after the API has been initialized with Initialize()."
1520 IMPORT_C TTimeIntervalMicroSeconds DecodingPosition();
1523 Returns the current playback position, i.e. the timestamp for the most recently displayed or
1524 virtually displayed picture.
1525 @return "Current playback position."
1526 @pre "This method can only be called after the API has been initialized with Initialize()."
1528 IMPORT_C TTimeIntervalMicroSeconds PlaybackPosition();
1531 Returns the current pre-decoder buffer size.
1532 @return "The number of bytes of data in the pre-decoder buffer."
1533 @pre "This method can only be called after the API has been initialized with Initialize()."
1535 IMPORT_C TUint PreDecoderBufferBytes();
1538 Returns the total amount of memory allocated for uncompressed pictures.
1539 @return "Total number of bytes of memory allocated for uncompressed pictures."
1540 @pre "This method can only be called after the API has been initialized with Initialize()."
1542 IMPORT_C TUint PictureBufferBytes();
1545 Reads various counters related to decoded pictures. See the definition of TPictureCounters for a
1546 description of the counters. The counters are reset when Initialize() or this method is called,
1547 and thus they only include pictures processed since the last call.
1548 @param "aCounters" "The counter structure to fill."
1549 @pre "This method can only be called after the API has been initialized with Initialize()."
1551 IMPORT_C void GetPictureCounters(TPictureCounters& aCounters);
1554 Reads various counters related to the received input bitstream and coded data units. See the
1555 definition of TBitstreamCounters for a description about the counters. The counters are reset
1556 when Initialize() or this method is called, and thus they only include data processed since the
1558 @param "aCounters" "The counter structure to fill."
1559 @pre "This method can only be called after the API has been initialized with Initialize()."
1561 IMPORT_C void GetBitstreamCounters(TBitstreamCounters& aCounters);
1564 Retrieves the number of free input buffers the decoder has available. If only a post-processor
1565 is used, the return value is undefined.
1566 @return "Number of free input buffers the decoder has available."
1567 @pre "This method can only be called after the API has been initialized with Initialize()."
1569 IMPORT_C TUint NumFreeBuffers();
1572 Sets the computational complexity level to use. The level can be set separately for each hardware
1573 device in use. If separate complexity levels are not available, the method call is ignored. If the
1574 level specified is not available, the results are undefined. Typically the device will either
1575 ignore the request or use the nearest suitable level.
1577 The complexity level can be changed at any point during playback.
1579 @param "aHwDevice" "The plug-in to control. The value is returned from SelectDecoderL()or
1580 SelectPostProcessorL() when the device is selected."
1581 @param "aLevel" "The computational complexity level to use. Level zero (0) is the most
1582 complex one, with the highest quality. Higher level numbers require less
1583 processing and may have lower quality."
1584 @pre "This method can only be called after the API has been initialized with Initialize()."
1586 IMPORT_C void SetComplexityLevel(THwDeviceId aHwDevice, TUint aLevel);
1589 Gets the number of complexity levels available.
1590 @param "aHwDevice" "The plug-in to query. The value is returned from SelectDecoderL()or
1591 SelectPostProcessorL() when the device is selected."
1592 @return "The number of complexity control levels available, or zero if the information is not
1593 available yet. The information may not be available if the number of levels depends on
1594 the input data, and enough input data has not been read yet. In that case, using level
1596 @pre "This method can only be called after the API has been initialized with Initialize()."
1598 IMPORT_C TUint NumComplexityLevels(THwDeviceId aHwDevice);
1601 Gets information about a computational complexity level. This method can be called after
1602 NumComplexityLevels() has returned a non-zero value - at that point the information is guaranteed
1603 to be available. Some hardware device implementations may not be able to provide all values,
1604 in that case the values will be approximated.
1605 @param "aHwDevice" "The hw device to query. The value is returned from SelectDecoderL()or
1606 SelectPostProcessorL() when the device is selected."
1607 @param "aLevel" "The computational complexity level to query. The level numbers range from
1608 zero (the most complex) to NumComplexityLevels()-1."
1609 @param "aInfo" "The information structure to fill."
1610 @pre "This method can only be called after the API has been initialized with Initialize()."
1612 IMPORT_C void GetComplexityLevelInfo(THwDeviceId aHwDevice, TUint aLevel, TComplexityLevelInfo& aInfo);
1615 Retrieves an empty video input buffer from the decoder. After input data has been written to the
1616 buffer, it can be written to the decoder using WriteCodedDataL(). The maximum number of buffers
1617 the client can retrieve before returning any to the decoder is determined by the
1618 TBufferOptions.iMinNumInputBuffers value set with SetBufferOptionsL().
1620 If a buffer is not immediately available, the client can wait for a MdvpoNewBuffers() callback
1621 before trying again, or poll for new buffer availability after a delay. Note that video decoding
1622 may be performed in the same thread, in a separate active object, so the client must not block
1623 the active scheduler while waiting for buffers to become available, otherwise the system can
1624 deadlock. Assuming that the client does not keep too many buffers retrieved and playback is in
1625 progress, new buffers will be available after some time.
1627 The decoder maintains ownership of the buffers even while they have been retrieved by the client,
1628 and will take care of deallocating them. The client must not destroy the buffer objects, even if
1629 it has retrieved buffers and it is being shut down. The buffers will be destroyed by the decoder,
1630 and will not be valid after the decoder has been shut down.
1632 @param "aBufferSize" "Required buffer size, in bytes. The resulting buffer can be larger than
1633 this, but not smaller"
1634 @return "A new input data buffer. The buffer is at least as large as requested, but it may be
1635 larger. If no free buffers are available, the return value is NULL."
1636 @leave "The method will leave if an error occurs. Lack of free buffers is not considered an error."
1638 IMPORT_C TVideoInputBuffer* GetBufferL(TUint aBufferSize);
1641 Writes a piece of coded video data. The data will be passed to the video decoder and
1642 post-processor to be used in video playback. The data buffer must be retrieved from the decoder
1644 @param "aBuffer" "The coded data unit to write."
1645 @leave "The method will leave if an error occurs."
1646 @pre "This method can only be called after the API has been initialized with Initialize()."
1648 IMPORT_C void WriteCodedDataL(TVideoInputBuffer* aBuffer);
1651 Writes an uncompressed video picture. The picture must remain valid and unmodified until it is
1652 returned with the MdvpoReturnPicture() callback.
1653 @param "aPicture" "The picture to write."
1654 @leave "The method will leave if an error occurs."
1655 @pre "This method can only be called after the API has been initialized with Initialize()."
1657 IMPORT_C void WritePictureL(TVideoPicture* aPicture);
1660 Notifies the system that the end of input data has been reached.
1662 The decoder and post-processor can use this signal to ensure that the remaining data gets processed,
1663 without waiting for new data. For example when the data type is not EDuCodedPicture, calling this
1664 method is necessary otherwise a decoder implementation might be waiting for the start code for the
1665 next picture to ensure it has a complete picture before starting to decode the previous one.
1668 After the remaining data has been processed (and displayed, if applicable), the client gets
1669 notified with the MdvpoStreamEnd() callback. The client must then call Stop() on the interface.
1671 DevVideo clients are encouraged to call this method, but its use is not mandatory for synchronized
1672 processing. For synchronized playback, all video pictures are processed or discarded according to
1673 their timestamps, and so the client can easily infer when processing is complete. However, it
1674 should be noted that the last picture might not be displayed if this method is not called and the
1675 input data type is not EDuCodedPicture.
1677 For non-synchronized playback (e.g. file conversion), a client must call this method otherwise it
1678 will never find out when the hardware device has finished processing the data.
1680 @pre "This method can only be called after the API has been initialized with Initialize()."
1682 IMPORT_C void InputEnd();
1685 Gets information about new decoded pictures. "New decoded pictures" are pictures that have not
1686 been returned to the caller using NextPicture(). This method can only be called if video
1687 destination is memory buffers, i.e. Direct Screen Access is not used.
1688 @param "aNumPictures" "Target for the number of new decoded pictures. If no pictures are
1689 available, the value written is zero, and the timestamps are not
1691 @param "aEarliestTimestamp" "Timestamp for the earliest available new decoded picture. If the
1692 number of new decoded pictures (aNumPictures) is zero, the
1693 timestamp is not valid."
1694 @param "aLatestTimestamp" "Timestamp for the latest available new decoded picture. If the
1695 number of new decoded pictures (aNumPictures) is zero, the
1696 timestamp is not valid."
1697 @pre "This method can only be called after the API has been initialized with Initialize()."
1699 IMPORT_C void GetNewPictureInfo(TUint& aNumPictures,
1700 TTimeIntervalMicroSeconds& aEarliestTimestamp,
1701 TTimeIntervalMicroSeconds& aLatestTimestamp);
1704 Gets the next (in displaying order) new decoded picture. Only one picture can be retrieved at a
1705 time, the current picture must be returned with ReturnPicture() before a new one can be read.
1706 @return "The next new decoded picture. The pointer and the related data is valid until the picture
1707 is returned using ReturnPicture(), or the API is shut down. If no new picture is available,
1708 the method returns NULL."
1709 @leave "The method will leave if an error occurs."
1710 @pre "This method can only be called after the API has been initialized with Initialize()."
1712 IMPORT_C TVideoPicture* NextPictureL();
1715 Returns a picture from NextPicture() back to the device. The picture data cannot be used afterwards.
1716 @param "aPicture" "The picture to return. After this method returns, the pointer is no longer
1717 valid and the picture data cannot be used."
1718 @pre "This method can only be called after the API has been initialized with Initialize()."
1720 IMPORT_C void ReturnPicture(TVideoPicture* aPicture);
1723 Gets a copy of the latest picture displayed.
1724 @param "aPictureData" "Target picture. The memory for the picture must be allocated by the
1725 caller, and initialized properly. The data formats must match the snapshot
1727 @param "aFormat" "The picture format to use for the snapshot."
1728 @return "ETrue if the snapshot was taken, EFalse if a picture is not available. The picture may not
1729 be available if decoding has not progressed far enough yet."
1730 @leave "The method will leave if an error occurs. Typical error codes used:
1731 *KErrNotSupported - The requested data format or picture size is not supported."
1732 @pre "This method can only be called after the API has been initialized with Initialize()."
1734 IMPORT_C TBool GetSnapshotL(TPictureData& aPictureData, const TUncompressedVideoFormat& aFormat);
1737 Gets a copy of a specified picture. Timed snapshots are required for implementing the video
1738 telephony use-case. Simply using the latest picture may not work, since the latest picture
1739 is typically not the one whose supplemental information is being processed.
1741 The picture is specified using its presentation timestamp. The timestamp must match the timestamp
1742 in the picture exactly, otherwise no snapshot will be taken. The timestamp must refer to the
1743 currently displayed picture or a future picture. Typically the timestamp is received with
1744 supplemental information (with the MdvpoSupplementalInformation() callback) indicating a snapshot
1747 When the snapshot is available, it will be returned to the client using the
1748 MdvpoTimedSnapshotComplete() callback. To cancel a timed snapshot request, use
1749 CancelTimedSnapshot(). Only one timed snapshot request can be active at a time.
1751 @param "aPictureData" "Target picture. The memory for the picture must be allocated
1752 by the caller, and initialized properly. The data formats must
1753 match the snapshot format requested. The picture must remain
1754 valid until the snapshot has been taken or until the request
1755 has been cancelled with CancelTimedSnapshot()."
1756 @param "aFormat" "The picture format to use for the snapshot."
1757 @param "aPresentationTimestamp" "Presentation timestamp for the picture to copy. The timestamp
1758 must match the timestamp in the picture exactly"
1759 @leave "The method will leave if an error occurs. Typical error codes used:
1760 *KErrNotSupported - The requested data format or picture size is not supported."
1761 @pre "This method can only be called after the API has been initialized with Initialize()."
1763 IMPORT_C void GetTimedSnapshotL(TPictureData* aPictureData,
1764 const TUncompressedVideoFormat& aFormat,
1765 const TTimeIntervalMicroSeconds& aPresentationTimestamp);
1768 Gets a copy of a specified picture. Timed snapshots are required for implementing the video
1769 telephony use-case. Simply using the latest picture may not work, since the latest picture
1770 is typically not the one whose supplemental information is being processed.
1772 The picture is specified using either its picture identifier. The id must refer to the currently
1773 displayed picture or a future picture. Typically the picture ID is received with supplemental
1774 information (with the MdvpoSupplementalInformation() callback) indicating a snapshot picture.
1776 When the snapshot is available, it will be returned to the client using the
1777 MdvpoTimedSnapshotComplete() callback. To cancel a timed snapshot request, use
1778 CancelTimedSnapshot(). Only one timed snapshot request can be active at a time.
1780 @param "aPictureData" "Target picture. The memory for the picture must be allocated by the
1781 caller, and initialized properly. The data formats must match the snapshot
1782 format requested. The picture must remain valid until the snapshot has been
1783 taken or until the request has been cancelled with CancelTimedSnapshot()."
1784 @param "aFormat" "The picture format to use for the snapshot."
1785 @param "aPictureId" "Picture identifier for the picture to copy."
1786 @leave "The method will leave if an error occurs. Typical error codes used:
1787 *KErrNotSupported - The requested data format or picture size is not supported."
1788 @pre "This method can only be called after the API has been initialized with Initialize()."
1790 IMPORT_C void GetTimedSnapshotL(TPictureData* aPictureData,
1791 const TUncompressedVideoFormat& aFormat,
1792 const TPictureId& aPictureId);
1795 Cancels a timed snapshot request.
1796 @pre "This method can only be called after the API has been initialized with Initialize()."
1798 IMPORT_C void CancelTimedSnapshot();
1801 Gets a list of the supported snapshot picture formats.
1802 @param "aFormats" "An array for the result format list. The array must be created and destroyed by the caller."
1803 @leave "The method will leave if an error occurs."
1804 @pre "This method can only be called after the API has been initialized with Initialize()."
1806 IMPORT_C void GetSupportedSnapshotFormatsL(RArray<TUncompressedVideoFormat>& aFormats);
1809 Retrieves a custom interface to the specified hardware device.
1810 @param "aHwDevice" "The hardware device from which the custom interface shall be requested.
1811 The value is returned from SelectDecoderL() or SelectPostProcessorL() when
1812 the device is selected."
1813 @param "aInterface" "Interface UID, defined with the custom interface."
1814 @return "Pointer to the interface implementation, or NULL if the device does not
1815 implement the interface requested. The return value must be cast to the
1816 correct type by the user."
1818 IMPORT_C TAny* CustomInterface(THwDeviceId aHwDevice, TUid aInterface);
1821 enum TInitializationState
1823 ENotInitialized = 0x01,
1824 EInitializing = 0x02,
1825 EInitialized = 0x04,
1826 EInitializationFailed = 0x08
1829 CMMFDevVideoPlay(MMMFDevVideoPlayObserver& aObserver);
1831 // Methods to check aHwDevice is valid and return the appropriate HwDevice
1832 CMMFVideoPlayHwDevice& VideoPlayHwDevice(THwDeviceId aHwDevice) const;
1833 CMMFVideoPlayHwDevice& RenderingHwDevice() const; //returns the last plugin in the chain
1834 CMMFVideoDecodeHwDevice& VideoDecodeHwDevice(THwDeviceId aHwDevice) const;// Checks that aHwDevice is valid
1835 CMMFVideoPostProcHwDevice& VideoPostProcHwDevice(THwDeviceId aHwDevice) const;// Checks that aHwDevice is valid
1836 CMMFVideoDecodeHwDevice& VideoDecodeHwDevice() const;
1837 CMMFVideoPostProcHwDevice& VideoPostProcHwDevice() const;
1838 CMMFVideoHwDevice& VideoHwDevice(THwDeviceId aHwDevice) const;
1840 // Connects the plugins together
1841 void ConnectPlugins();
1843 // Check that we are in a valid initialization state
1844 // Panics if iInitializationState is not one of aExpected
1845 void CheckInitializationState(TUint aExpected);
1847 // Methods to handle init complete callbacks from the hw devices
1848 void HandlePostProcInitializeComplete(TInt aError);
1849 void HandleDecodeInitializeComplete(TInt aError);
1851 CMMFVideoDecodeHwDevice* CreateDecoderL(TUid aVideoDecoder);
1854 // From MMMFDevVideoPlayProxy
1855 virtual void MdvppNewPicture(TVideoPicture* aPicture);
1856 virtual void MdvppNewBuffers();
1857 virtual void MdvppReturnPicture(TVideoPicture* aPicture);
1858 virtual void MdvppSupplementalInformation(const TDesC8& aData,
1859 const TTimeIntervalMicroSeconds& aTimestamp,
1860 const TPictureId& aPictureId);
1861 virtual void MdvppPictureLoss();
1862 virtual void MdvppPictureLoss(const TArray<TPictureId>& aPictures);
1863 virtual void MdvppSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture);
1864 virtual void MdvppReferencePictureSelection(const TDesC8& aSelectionData);
1865 virtual void MdvppTimedSnapshotComplete(TInt aError,
1866 TPictureData* aPictureData,
1867 const TTimeIntervalMicroSeconds& aPresentationTimestamp,
1868 const TPictureId& aPictureId);
1869 virtual void MdvppFatalError(CMMFVideoHwDevice* aDevice, TInt aError);
1870 virtual void MdvppInitializeComplete(CMMFVideoHwDevice* aDevice, TInt aError);
1871 virtual void MdvppStreamEnd();
1874 MMMFDevVideoPlayObserver& iObserver;
1875 CMMFVideoDecodeHwDevice* iVideoDecodeHwDevice;
1876 CMMFVideoPostProcHwDevice* iVideoPostProcHwDevice;
1877 TUint iInitializationState;
1879 TDblQue<TVideoPicture> iVideoPictureQue;
1880 TDblQueIter<TVideoPicture> iVideoPictureQueIter;
1881 TUint iNumberOfVideoPictures;
1882 // Not to be used, but kept for BC purposes
1885 TUint iNumberOfMdvppStreamEndCallbacks;
1886 TBool iIsDecodeComplete;
1888 #ifdef SYMBIAN_MULTIMEDIA_CODEC_API
1889 RImplInfoPtrArray iPuImplementations;
1890 TBool iPuListCreated;
1891 #endif // SYMBIAN_MULTIMEDIA_CODEC_API
1896 The MMMFDevVideoPlayObserver mixin class defines a set of callback functions that the client using
1897 the MSL video API needs to implement. The callbacks are called in the context of the same thread that
1898 uses the API. DevVideo API methods can be safely called from the callbacks.
1902 class MMMFDevVideoPlayObserver
1906 Notifies the client that one or more new empty input buffers are available. The client can fetch
1907 the input buffer with GetBufferL().
1909 virtual void MdvpoNewBuffers() = 0;
1912 Returns a used input video picture back to the caller. The picture memory can be re-used or freed.
1913 @param "aPicture" "The picture to return."
1915 virtual void MdvpoReturnPicture(TVideoPicture* aPicture) = 0;
1918 Delivers supplemental information from a coded data unit. The information is codec-dependent.
1919 @param "aData" "The supplemental data. The reference is only valid until the method
1920 returns, and thus the data must be processed or copied immediately."
1921 @param "aTimestamp" "The presentation timestamp for the picture that the supplemental data
1923 @param "aPictureId" "Picture identifier for the picture. If a picture ID is not available,
1924 aPictureId.iIdType is set to ENone."
1926 virtual void MdvpoSupplementalInformation(const TDesC8& aData,
1927 const TTimeIntervalMicroSeconds& aTimestamp,
1928 const TPictureId& aPictureId) = 0;
1931 Back channel information from the decoder, indicating a picture loss without specifying the lost picture.
1933 virtual void MdvpoPictureLoss() = 0;
1936 Back channel information from the decoder, indicating the pictures that have been lost.
1938 @param "aPictures" "Picture identifiers for the lost pictures. The reference is only valid until the
1939 method returns, and thus the data must be processed or copied immediately."
1941 virtual void MdvpoPictureLoss(const TArray<TPictureId>& aPictures) = 0;
1944 Back channel information from the decoder, indicating the loss of consecutive macroblocks in raster
1947 @param "aFirstMacroblock" "The first lost macroblock. The macroblocks are numbered such
1948 that the macroblock in the upper left corner of the picture is considered
1949 macroblock number 1 and the number for each macroblock increases from left
1950 to right and then from top to bottom in raster-scan order."
1951 @param "aNumMacroblocks" "The number of lost macroblocks that are consecutive in raster-scan order."
1952 @param "aPicture" "The picture identifier for the picture where the macroblocks were lost.
1953 If the picture is not known, aPicture.iIdType is set to ENone. The reference
1954 is only valid until the method returns."
1956 virtual void MdvpoSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture)= 0;
1959 Back channel information from the decoder, indicating a reference picture selection request. The
1960 request is delivered as a coding-standard specific binary message. Reference picture selection can
1961 be used to select a pervious correctly transmitted picture to use as a reference in case later pictures
1964 @param "aSelectionData" "The reference picture selection request message. The message format is
1965 coding-standard specific, and defined separately. The reference is only
1966 valid until the method returns, and thus the data must be processed or
1967 copied immediately."
1969 virtual void MdvpoReferencePictureSelection(const TDesC8& aSelectionData)= 0;
1972 Called when a timed snapshot request has been completed. When this method is called, the snapshot
1973 has been taken, and the memory reserved for the picture can be re-used or freed.
1974 @param "aError" "An error code, KErrNone if no errors occurred. If an error
1975 occurred, the data in the snapshot may not be valid, but the
1976 memory can still be freed."
1977 @param "aPictureData" "The snapshot picture data."
1978 @param "aPresentationTimestamp" "The presentation timestamp for the snapshot picture. "
1979 @param "aPictureId" "Picture identifier for the picture. If a picture ID is not
1980 available, aPictureId.iIdType is set to ENone."
1982 virtual void MdvpoTimedSnapshotComplete(TInt aError,
1983 TPictureData* aPictureData,
1984 const TTimeIntervalMicroSeconds& aPresentationTimestamp,
1985 const TPictureId& aPictureId) = 0;
1988 Notifies the client that one or more new output pictures are available. The client can then use
1989 GetNewPictureInfo() and NextPicture() to fetch the pictures.
1991 virtual void MdvpoNewPictures() = 0;
1994 Reports a fatal decoding or playback error to the client. When these errors
1995 occur, decoding and playback is stopped automatically. The client must
1996 destroy the CMMFDevVideoPlay object and create a new instance before
1997 attempting to continue. Note that scenarios have been identified where
1998 MdvpoFatalError may get referenced at some point during the execution of a
1999 CMMFDevVideoPlay procedure. Therefore CMMFDevVideoPlay object should be
2000 deleted outside of MdvpoFatalError context in order to avoid accidental
2001 access to de-allocated CMMFDevVideoPlay data members.
2003 Note that running out of processing power or encountering corrupted
2004 bitstream data should not be classified as errors if the decoder and
2005 post-processor can recover automatically.
2007 @param "aError" "The error code."
2009 virtual void MdvpoFatalError(TInt aError) = 0;
2012 Reports that DevVideoPlay initialization has completed. The interface can now be used for video
2014 @param "aError" "Initialization error code, KErrNone if no error occurred."
2016 virtual void MdvpoInitComplete(TInt aError) = 0;
2019 Reports that the input video stream end has been reached and all pictures have been processed.
2020 This method is only called after the client has called InputEnd(). No more output pictures will
2023 virtual void MdvpoStreamEnd() = 0;
2028 #include <mmf/devvideo/devvideoplay.inl>