epoc32/include/mmf/devvideo/devvideoplay.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
child 4 837f303aceeb
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __DEVVIDEOPLAY_H__
    17 #define __DEVVIDEOPLAY_H__
    18 
    19 #include <e32std.h>
    20 #include <mmf/devvideo/devvideobase.h>
    21 
    22 class MMMFDevVideoPlayObserver;
    23 class CMMFVideoPlayHwDevice;
    24 class CMMFVideoDecodeHwDevice;
    25 class CMMFVideoPostProcHwDevice;
    26 
    27 
    28 /**
    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.
    31 @publishedAll
    32 @released
    33 */
    34 class MMMFDevVideoPlayProxy
    35 	{
    36 public:
    37 	/**
    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().
    41 
    42 	@param "aPicture" "The newly processed picture."
    43 	*/
    44 	virtual void MdvppNewPicture(TVideoPicture* aPicture) = 0;
    45 
    46 	/**
    47 	Notifies the client that one or more new empty input buffers are available. Called by the decoder 
    48 	hardware device.
    49 	*/
    50 	virtual void MdvppNewBuffers() = 0;
    51 
    52 	/**
    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.
    55 
    56 	@param "aPicture" "The picture to return."
    57 	*/
    58 	virtual void MdvppReturnPicture(TVideoPicture* aPicture) = 0;
    59 
    60 	/**
    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.
    65 
    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."
    70 	*/
    71 	virtual void MdvppSupplementalInformation(const TDesC8& aData, 
    72 		const TTimeIntervalMicroSeconds& aTimestamp, const TPictureId& aPictureId) = 0;
    73 
    74 	/**
    75 	Back channel information, indicating a picture loss without specifying the lost picture.
    76 	*/
    77 	virtual void MdvppPictureLoss() = 0;
    78 
    79 	/**
    80 	Back channel information, indicating the pictures that have been lost.
    81 	
    82 	@param "aPictures"	"Picture identifiers for the lost pictures. The reference is only valid
    83 						until the method returns."
    84 	*/
    85 	virtual void MdvppPictureLoss(const TArray<TPictureId>& aPictures) = 0;
    86 
    87 	/**
    88 	Back channel information, indicating the loss of consecutive macroblocks in raster scan order.
    89 
    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."
    98 	*/
    99 	virtual void MdvppSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture)= 0;
   100 
   101 	/**
   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.
   106 	
   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."
   110 	*/
   111 	virtual void MdvppReferencePictureSelection(const TDesC8& aSelectionData)= 0;
   112 
   113 	/**
   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.
   116 
   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."
   124 	*/
   125 	virtual void MdvppTimedSnapshotComplete(TInt aError, TPictureData* aPictureData, 
   126 		const TTimeIntervalMicroSeconds& aPresentationTimestamp, const TPictureId& aPictureId) = 0;
   127 
   128 	/**
   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.
   132 
   133 	@param "aDevice" "The device that reported the error."
   134 	@param "aError"	 "The error code."	
   135 	*/
   136 	virtual void MdvppFatalError(CMMFVideoHwDevice* aDevice, TInt aError) = 0;
   137 
   138 	/**
   139 	Reports that an asynchronous Initialize() method has completed. 
   140 	The device is now ready for playback.
   141 
   142 	@param "aDevice" "The device that was initialzied."
   143 	@param "aError"	 "Initialization result error code, KErrNone if initialization was successful."	
   144 	*/
   145 	virtual void MdvppInitializeComplete(CMMFVideoHwDevice* aDevice, TInt aError) = 0;
   146 
   147 	/**
   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.
   152 	*/
   153 	virtual void MdvppStreamEnd() = 0;
   154 	};
   155 
   156 
   157 /**
   158 A buffer for compressed video data, contains one coded data unit. Video buffers are used for writing 
   159 video data to the API.
   160 
   161 @publishedAll
   162 @released
   163 */
   164 class TVideoInputBuffer
   165 	{
   166 public:
   167 	/**
   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).
   170 	*/
   171 	IMPORT_C TVideoInputBuffer();
   172 
   173 public:
   174 	enum TVideoBufferOptions
   175 		{
   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
   182 		};
   183 
   184 	/**
   185 	Pointer to the video data.
   186 	*/
   187 	TPtr8 iData;
   188 
   189 	/**
   190 	Data unit options. The value is a bitfield combined from values from TVideoBufferOptions.
   191 	@see TVideoBufferOptions
   192 	*/
   193 	TUint32 iOptions;
   194 
   195 	/**
   196 	Data unit decoding timestamp. Valid if EDecodingTimestamp is set in the options.
   197 	*/
   198 	TTimeIntervalMicroSeconds iDecodingTimestamp;
   199 
   200 	/**
   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.
   206 	*/
   207 	TTimeIntervalMicroSeconds iPresentationTimestamp;
   208 
   209 	/**
   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 
   212 	frame.
   213 	*/
   214 	TBool iPreRoll;
   215 
   216 	/**
   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 
   219 	data.
   220 	*/
   221 	TUint iSequenceNumber;
   222 
   223 	/**
   224 	True if the data unit is known to contain erroneous data.
   225 	*/
   226 	TBool iError;
   227 
   228 	/**
   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.
   232 	*/
   233 	TDblQueLink iLink;
   234 
   235 	/**
   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.
   238 	*/
   239 	TAny* iUser;
   240 	};
   241 
   242 
   243 /**
   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.
   247 
   248 The objects are created by the post-processor or decoder devices, and used by the MSL video client code.
   249 @publishedAll
   250 @released
   251 */
   252 class CPostProcessorInfo : public CBase
   253 	{
   254 public:
   255 	/**
   256 	Creates and returns a new CPostProcessorInfo object.
   257 
   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 
   261 											identifier."
   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 
   271 											screen."
   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."
   281 
   282 	@return "A new CPostProcessorInfo object."
   283 	@leave	"This method may leave with one of the system-wide error codes."
   284 	*/
   285 	IMPORT_C static CPostProcessorInfo* NewL(TUid aUid,
   286 											 const TDesC& aManufacturer,
   287 											 const TDesC& aIdentifier,
   288 											 TVersion aVersion,
   289 											 const TArray<TUncompressedVideoFormat>& aSupportedFormats,
   290 											 const TArray<TUint32>& aSupportedCombinations,
   291 											 TBool aAccelerated,
   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);
   299 
   300 	/**
   301 	Destructor
   302 	*/
   303 	IMPORT_C ~CPostProcessorInfo();
   304 
   305 	/**
   306 	Returns the post-processor UID.
   307 	@return "Post-processor UID"
   308 	*/
   309 	IMPORT_C TUid Uid() const;
   310 
   311 	/**
   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."
   315 	*/
   316 	IMPORT_C const TDesC& Manufacturer() const;
   317 
   318 	/**
   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."
   323 	*/
   324 	IMPORT_C const TDesC& Identifier() const;
   325 
   326 	/**
   327 	Returns the post-processor version.
   328 	@return "Post-processor version."
   329 	*/
   330 	IMPORT_C TVersion Version() const;
   331 
   332 	/**
   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."
   336 	*/
   337 	IMPORT_C TBool SupportsFormat(const TUncompressedVideoFormat& aFormat) const;
   338 
   339 	/**
   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."
   343 	*/
   344 	IMPORT_C const RArray<TUncompressedVideoFormat>& SupportedFormats() const;
   345 
   346 	/**
   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."
   350 	*/
   351 	IMPORT_C TBool SupportsCombination(TUint32 aCombination) const;
   352 
   353 	/**
   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."
   357 	*/
   358 	IMPORT_C const RArray<TUint32>& SupportedCombinations() const;
   359 
   360 	/**
   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."
   364 	*/
   365 	IMPORT_C TBool Accelerated() const;
   366 
   367 	/**
   368 	Returns whether the hardware device supports output directly to the screen. Output to memory buffers 
   369 	is always supported.
   370 	@return "ETrue if the post-processor supports direct screen output."
   371 	*/
   372 	IMPORT_C TBool SupportsDirectDisplay() const;
   373 
   374 	/**
   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."
   379 	*/
   380 	IMPORT_C const TYuvToRgbCapabilities& YuvToRgbCapabilities() const;
   381 
   382 	/**
   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."
   386 	*/
   387 	IMPORT_C TUint32 SupportedRotations() const;
   388 
   389 	/**
   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."
   394 	*/
   395 	IMPORT_C TBool SupportsArbitraryScaling() const;
   396 
   397 	/**
   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."
   403 	*/
   404 	IMPORT_C const RArray<TScaleFactor>& SupportedScaleFactors() const;
   405 
   406 	/**
   407 	Returns whether the hardware device supports anti-aliasing filtering for scaling.
   408 	@return "True if anti-aliasing filtering is supported."
   409 	*/
   410 	IMPORT_C TBool AntiAliasedScaling() const;
   411 
   412 	/**
   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."
   417 	*/
   418 	IMPORT_C const TDesC8& ImplementationSpecificInfo() const;
   419 	
   420 	/**
   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."
   424 	*/
   425 	IMPORT_C void AddSupportedScreenL(TInt aScreenNo);
   426 	
   427 	/**
   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."
   434 	*/
   435 	IMPORT_C void GetSupportedScreensL(RArray<TInt>& aSupportedScreens) const;
   436 private:
   437 	CPostProcessorInfo(TUid aUid,
   438 					   TVersion aVersion,
   439 					   TBool aAccelerated,
   440 					   TBool aSupportDirectDisplay,
   441 					   const TYuvToRgbCapabilities& aYuvToRgbCapabilities,
   442 					   TUint32 aSupportedRotations,
   443 					   TBool aSupportArbitraryScaling,
   444 					   TBool aAntiAliasedScaling);
   445 
   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);
   452 private:
   453 	TUid iUid;
   454 	TVersion iVersion;
   455 	TBool iAccelerated;
   456 	TBool iSupportDirectDisplay;
   457 	TYuvToRgbCapabilities iYuvToRgbCapabilities;
   458 	TUint32 iSupportedRotations;
   459 	TBool iSupportArbitraryScaling;
   460 	TBool iAntiAliasedScaling;
   461 	HBufC* iManufacturer;
   462 	HBufC* iIdentifier;
   463 	HBufC8* iImplementationSpecificInfo;
   464  	RArray<TUncompressedVideoFormat> iSupportedFormats;
   465 	RArray<TUint32> iSupportedCombinations;
   466 	RArray<TScaleFactor> iSupportedScaleFactors;
   467 	RArray<TInt> iSupportedScreens;
   468 	};
   469 
   470 
   471 /**
   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.
   475 
   476 The objects are created by the video decoder hardware devices, and used by the MSL video client code.
   477 @publishedAll
   478 @released
   479 */
   480 class CVideoDecoderInfo : public CBase
   481 	{
   482 public:
   483 	/**
   484 	Creates and returns a new CVideoDecoderInfo object.
   485 
   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."
   502 
   503 	@return "A new CVideoDecoderInfo object."
   504 	@leave	"This method may leave with one of the system-wide error codes."
   505 	*/
   506 	IMPORT_C static CVideoDecoderInfo* NewL(TUid aUid,
   507 											const TDesC& aManufacturer,
   508 											const TDesC& aIdentifier,
   509 											TVersion aVersion,
   510 											const TArray<CCompressedVideoFormat*>& aSupportedFormats,
   511 											TBool aAccelerated,
   512 											TBool aSupportsDirectDisplay,
   513 											const TSize& aMaxPictureSize,
   514 											TUint aMaxBitrate,
   515 											const TArray<TPictureRateAndSize>& aMaxPictureRates,
   516 											TBool aSupportsPictureLoss,
   517 											TBool aSupportsSliceLoss,
   518 											const TDesC8& aCodingStandardSpecificInfo = KNullDesC8,
   519 											const TDesC8& aImplementationSpecificInfo = KNullDesC8);
   520 
   521 	/**
   522 	Destructor.
   523 	*/
   524 	IMPORT_C ~CVideoDecoderInfo();
   525 
   526 	/**
   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."
   530 	*/
   531 	IMPORT_C TBool SupportsFormat(const CCompressedVideoFormat& aFormat) const;
   532 
   533 	/**
   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."
   537 	*/
   538 	IMPORT_C const RPointerArray<CCompressedVideoFormat>& SupportedFormats() const;
   539 
   540 	/**
   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."
   544 	*/
   545 	IMPORT_C const TDesC& Manufacturer() const;
   546 
   547 	/**
   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."
   552 	*/
   553 	IMPORT_C const TDesC& Identifier() const;
   554 
   555 	/**
   556 	Returns the decoder version.
   557 	@return "Decoder version."
   558 	*/
   559 	IMPORT_C TVersion Version() const;
   560 
   561 	/**
   562 	Returns the decoder UID.
   563 	@return "Decoder UID."
   564 	*/
   565 	IMPORT_C TUid Uid() const;
   566 
   567 	/**
   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."
   571 	*/
   572 	IMPORT_C TBool Accelerated() const;
   573 
   574 	/**
   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."
   578 	*/
   579 	IMPORT_C TBool SupportsDirectDisplay() const;
   580 
   581 	/**
   582 	Returns the maximum picture size the decoder supports.
   583 
   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 
   588 	bitstream).
   589 
   590 	@return "The maximum picture size supported. The reference is valid until the CVideoDecoderInfo 
   591 			object is destroyed."
   592 	*/
   593 	IMPORT_C const TSize& MaxPictureSize() const;
   594 
   595 	/**
   596 	Returns the maximum bit-rate supported by the decoder.
   597 
   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
   602 	bitstream).
   603 
   604 	@return "Maximum bit-rate supported, in bits per second. KMaxTUint32 can be used if the decoder 
   605 			has no bit-rate restrictions."
   606 	*/
   607 	IMPORT_C TUint MaxBitrate() const;
   608 
   609 	/**
   610 	Returns the maximum picture size/rate combinations supported by the decoder.  
   611 	
   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).
   617 
   618 	@return "A reference to an array of picture size/rate combinations.  The reference remains valid
   619 			until this object is deleted."
   620 	*/
   621 	IMPORT_C const RArray<TPictureRateAndSize>& MaxPictureRates() const;
   622 
   623 	/**
   624 	Returns whether the decoder supports picture loss indications. If true, the decoder indicates
   625 	lost pictures by calling MdvpoPictureLoss().
   626 
   627 	@return "True if the decoder supports picture loss indications."
   628 	*/
   629 	IMPORT_C TBool SupportsPictureLoss() const;
   630 
   631 	/**
   632 	Returns whether the decoder supports slice loss indications. If true, the decoder indicates 
   633 	lost macroblocks by calling MdvpoSliceLoss().
   634 
   635 	@return "True if the decoder supports slice loss indications."
   636 	*/
   637 	IMPORT_C TBool SupportsSliceLoss() const;
   638 
   639 	/**
   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
   643 			is destroyed."
   644 	*/
   645 	IMPORT_C const TDesC8& CodingStandardSpecificInfo() const;
   646 
   647 	/**
   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."
   652 	*/
   653 	IMPORT_C const TDesC8& ImplementationSpecificInfo() const;
   654 	
   655 	/**
   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."
   659 	*/
   660 	IMPORT_C void AddSupportedScreenL(TInt aScreenNo);
   661 	
   662 	/**
   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."
   669 	*/
   670 	IMPORT_C void GetSupportedScreensL(RArray<TInt>& aSupportedScreens) const;
   671 private:
   672 	CVideoDecoderInfo(TUid aUid,
   673 					  TVersion aVersion,
   674 					  TBool aAccelerated,
   675 					  TBool aSupportsDirectDisplay,
   676 					  const TSize& aMaxPictureSize,
   677 					  TUint aMaxBitrate,
   678 					  TBool aSupportsPictureLoss,
   679 					  TBool aSupportsSliceLoss);
   680 
   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);
   687 private:
   688 	TUid iUid;
   689 	TVersion iVersion;
   690 	TBool iAccelerated;
   691 	TBool iSupportsDirectDisplay;
   692 	TSize iMaxPictureSize;
   693 	TUint iMaxBitrate;
   694 	TBool iSupportsPictureLoss;
   695 	TBool iSupportsSliceLoss;
   696 	HBufC* iManufacturer;
   697 	HBufC* iIdentifier;
   698 	RPointerArray<CCompressedVideoFormat> iSupportedFormats;
   699 	RArray<TPictureRateAndSize> iMaxPictureRates;
   700 	HBufC8* iCodingStandardSpecificInfo;
   701 	HBufC8* iImplementationSpecificInfo;
   702 	RArray<TInt> iSupportedScreens;
   703 	};
   704 
   705 
   706 
   707 
   708 /**
   709 CMMFDevVideoPlay is the main client API for DevVideoPlay.
   710 @publishedAll
   711 @released
   712 */
   713 class CMMFDevVideoPlay : public CBase, private MMMFDevVideoPlayProxy
   714 	{
   715 public:
   716 	/**
   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.
   720 	*/
   721 	class TPictureCounters
   722 		{
   723 	public:
   724 		/**
   725 		Default constructor.  Zeros all members.
   726 		*/
   727 		inline TPictureCounters();
   728 	public:
   729 		/**
   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.
   733 		*/
   734 		TUint iPicturesSkipped;
   735 
   736 		/**
   737 		The number of pictures decoded.
   738 		*/
   739 		TUint iPicturesDecoded;
   740 
   741 		/**
   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.
   745 		*/
   746 		TUint iPicturesDisplayed;
   747 
   748 		/**
   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.
   753 		*/
   754 		TUint iTotalPictures;
   755 		};
   756 
   757 	/**
   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.
   761 	*/
   762 	class TBitstreamCounters
   763 		{
   764 	public:
   765 		/**
   766 		Default constructor.  Zeros all members.
   767 		*/
   768 		inline TBitstreamCounters();
   769 	public:
   770 		/**
   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.
   773 		*/
   774 		TUint iLostPackets;
   775 
   776 		/**
   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.
   779 		*/
   780 		TUint iTotalPackets;
   781 		};
   782 
   783 	/**
   784 	Buffer options used with SetBufferOptionsL().
   785 	*/
   786 	class TBufferOptions
   787 		{
   788 	public:
   789 		/**
   790 		Default constructor.  Zeros all members.
   791 		*/
   792 		inline TBufferOptions();
   793 
   794 	public:
   795 		/**
   796 		Pre-decoder buffer size in bytes. Set to zero to use decoder default value.
   797 		*/
   798 		TUint iPreDecodeBufferSize;
   799 
   800 		/**
   801 		Maximum post-decoder buffer size in bytes. Set to zero to remove limitations.
   802 		*/
   803 		TUint iMaxPostDecodeBufferSize;
   804 
   805 		/**
   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.
   809 		*/
   810 		TTimeIntervalMicroSeconds iPreDecoderBufferPeriod;
   811 
   812 		/**
   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.
   815 		*/
   816 		TTimeIntervalMicroSeconds iPostDecoderBufferPeriod;
   817 
   818 		/**
   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.
   824 		*/
   825 		TUint iMaxInputBufferSize;
   826 
   827 		/**
   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 
   830 		WriteCodedDataL().
   831 		*/
   832 		TUint iMinNumInputBuffers;
   833 		};
   834 
   835 	/**
   836 	Information about a single computational complexity level.
   837 	*/
   838 	class TComplexityLevelInfo
   839 		{
   840 	public:
   841 		enum TOptions
   842 			{
   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
   853 			};
   854 		/**
   855 		Structure options. The value is a bitfield combined from values from TOptions.
   856 		*/
   857 		TUint32 iOptions;
   858 
   859 		/**
   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.
   863 		*/
   864 		TReal iAvgPictureRate;
   865 
   866 		/**
   867 		Picture size (spatial resolution), in pixels. Valid only if EPictureSize is set in the options.
   868 		*/
   869 		TSize iPictureSize;
   870 
   871 		/**
   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.
   874 		*/
   875 		TReal iRelativeImageQuality;
   876 
   877 		/**
   878 		The number of MIPS required to process the data. Valid only if ERequiredMIPS is set in 
   879 		the options.
   880 		*/
   881 		TUint iRequiredMIPS;
   882 
   883 		/**
   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.
   887 		*/
   888 		TReal iRelativeProcessTime;
   889 		};
   890 
   891 public:
   892 
   893 	/**
   894 	Constructs a new MSL video client instance. Each client instance supports a single video bitstream.
   895 
   896 	@param  aObserver
   897 	        The observer object to use.
   898 
   899 	@return A pointer to a new CMMFDevVideoPlay object.
   900 	@leave  This method may leave with one of the system-wide error codes.
   901 	*/
   902 	IMPORT_C static CMMFDevVideoPlay* NewL(MMMFDevVideoPlayObserver& aObserver);
   903 
   904 	/**
   905 	Destructor.
   906 	*/
   907 	IMPORT_C ~CMMFDevVideoPlay();
   908 
   909 	/**
   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."
   919 	*/
   920 	IMPORT_C static TBool FindCommonFormat(const TArray<TUncompressedVideoFormat>& aFormats1, 
   921 										   const TArray<TUncompressedVideoFormat>& aFormats2, 
   922 										   TUncompressedVideoFormat& aCommonFormat);
   923 
   924 	/**
   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().
   932  
   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."
   946 	*/
   947 	IMPORT_C void FindDecodersL(const TDesC8& aMimeType, 
   948 								TUint32 aPostProcType, 
   949 								RArray<TUid>& aDecoders, 
   950 								TBool aExactMatch=ETrue);
   951 
   952 	/**
   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."
   960 	*/
   961 	IMPORT_C void FindPostProcessorsL(TUint32 aPostProcType, RArray<TUid>& aPostProcessors);
   962 
   963 	/**
   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."
   969 	*/
   970 	IMPORT_C void GetDecoderListL(RArray<TUid>& aDecoders);
   971 
   972 	/**
   973 	Retrieves a list of available video post-processors in the system.
   974 
   975 	@param  aPostProcessors
   976 	        An array for the result post-processor UIDs. The array must be created and
   977 	        destroyed by the caller.
   978 
   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.
   981 	*/
   982 	IMPORT_C void GetPostProcessorListL(RArray<TUid>& aPostProcessors);
   983 
   984 	/**
   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."
   991 	*/
   992 	IMPORT_C CVideoDecoderInfo* VideoDecoderInfoLC(TUid aVideoDecoder);
   993 
   994 	/**
   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."
  1002 	*/
  1003 	IMPORT_C CPostProcessorInfo* PostProcessorInfoLC(TUid aPostProcessor);
  1004 
  1005 	/**
  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 
  1011 	performed.
  1012 
  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()."
  1018 	*/
  1019 	IMPORT_C THwDeviceId SelectDecoderL(TUid aDecoder);
  1020 
  1021 	/**
  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.
  1027 
  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()."
  1033 	*/
  1034 	IMPORT_C THwDeviceId SelectPostProcessorL(TUid aPostProcessor);
  1035 
  1036 	/**
  1037 	Reads header information from a coded data unit. [1 #59] This method can be called only after 
  1038 	SelectDecoderL().
  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."
  1053 	*/
  1054 	IMPORT_C TVideoPictureHeader* GetHeaderInformationL(TVideoDataUnitType aDataUnitType, 
  1055 														TVideoDataUnitEncapsulation aDataUnitEncapsulation, 
  1056 														TVideoInputBuffer* aDataUnit);
  1057 
  1058 	IMPORT_C void ConfigureDecoderL(const TVideoPictureHeader& aVideoPictureHeader);
  1059 
  1060 	/**
  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()."
  1064 	*/
  1065 	IMPORT_C void ReturnHeader(TVideoPictureHeader* aHeader);
  1066 
  1067 	/**
  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()."
  1076 	*/
  1077 	IMPORT_C void SetInputFormatL(THwDeviceId aHwDevice, const TUncompressedVideoFormat& aFormat);
  1078 
  1079 	/**
  1080 	Sets a hardware device Input format to a compressed video format. Only decoders support compressed 
  1081 	video input.
  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()."
  1092 	*/
  1093 	IMPORT_C void SetInputFormatL(THwDeviceId aHwDevice, 
  1094 								  const CCompressedVideoFormat& aFormat, 
  1095 								  TVideoDataUnitType aDataUnitType, 
  1096 								  TVideoDataUnitEncapsulation aEncapsulation, 
  1097 								  TBool aDataInOrder);
  1098 
  1099 	/**
  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 
  1107 						by the caller."
  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()."
  1110 	*/
  1111 	IMPORT_C void GetOutputFormatListL(THwDeviceId aHwDevice, RArray<TUncompressedVideoFormat>& aFormats);
  1112 
  1113 	/**
  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.
  1116 
  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.
  1119 	
  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()."
  1126 	*/
  1127 	IMPORT_C void SetOutputFormatL(THwDeviceId aHwDevice, const TUncompressedVideoFormat &aFormat);
  1128 
  1129 	/**
  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().
  1135 
  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.
  1140 
  1141 	@param	"aClock"	"The clock source to use"
  1142 	@pre	"This method can only be called before the API has been initialized with Initialize()."
  1143 	*/
  1144 	IMPORT_C void SetClockSource(MMMFClockSource* aClock);
  1145 
  1146 	/**
  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()."
  1156 	*/
  1157 	IMPORT_C void SetVideoDestScreenL(TBool aScreen);
  1158 
  1159 	/**
  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.
  1165 
  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()."
  1168 	*/
  1169 	IMPORT_C void SynchronizeDecoding(TBool aSynchronize);
  1170 
  1171 	/**
  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()."
  1179 	*/
  1180 	IMPORT_C void SetBufferOptionsL(const TBufferOptions& aOptions);
  1181 
  1182 	/**
  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()."
  1188 	*/
  1189 	IMPORT_C void GetBufferOptions(TBufferOptions& aOptions);
  1190 
  1191 	/**
  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 
  1199 							is empty."
  1200 	@pre	"This method can only be called before the API has been initialized with Initialize()."
  1201 	*/
  1202 	IMPORT_C void SetHrdVbvSpec(THrdVbvSpecification aHrdVbvSpec, const TDesC8& aHrdVbvParams);
  1203 
  1204 	/**
  1205 	Sets the post-processing types to be used. This method, like all post-processing configuration 
  1206 	methods, must be called before Initialize().
  1207 
  1208 	Post-processing operations are carried out in the following order:
  1209 		1. Input cropping
  1210 		2. Mirroring
  1211 		3. Rotating
  1212 		4. Scaling
  1213 		5. Output cropping
  1214 	Color space conversion can be performed at any point in the post-processing flow.
  1215 
  1216 	@param	"aHwDevice"				"The hardware device to configure. The value is returned from 
  1217 									SelectDecoderL() or SelectPostProcessorL() when the device is 
  1218 									selected."
  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."
  1225 	*/
  1226 	IMPORT_C void SetPostProcessTypesL(THwDeviceId aHwDevice, TUint32 aPostProcCombination);
  1227 
  1228 	/**
  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."
  1238 	*/
  1239 	IMPORT_C void SetInputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect);
  1240 
  1241 	/**
  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."
  1254 	*/
  1255 	IMPORT_C void SetYuvToRgbOptionsL(THwDeviceId aHwDevice, 
  1256 									  const TYuvToRgbOptions& aOptions, 
  1257 									  const TYuvFormat& aYuvFormat, 
  1258 									  TRgbFormat aRgbFormat);
  1259 
  1260 	/**
  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."
  1272 	*/
  1273 	IMPORT_C void SetYuvToRgbOptionsL(THwDeviceId aHwDevice, const TYuvToRgbOptions& aOptions);
  1274 
  1275 	/**
  1276 	Sets post-processing options for rotation. SetPostProcessTypesL() must be called before this 
  1277 	method is used.
  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."
  1285 	*/
  1286 	IMPORT_C void SetRotateOptionsL(THwDeviceId aHwDevice, TRotationType aRotationType);
  1287 
  1288 	/**
  1289 	Sets post-processing options for scaling. SetPostProcessTypesL() must be called before this method 
  1290 	is used.
  1291 	@param	"aHwDevice"				"The hardware device to configure. The value is returned from 
  1292 									SelectDecoderL() or SelectPostProcessorL() when the device is 
  1293 									selected."
  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."
  1305 	*/
  1306 	IMPORT_C void SetScaleOptionsL(THwDeviceId aHwDevice, 
  1307 								   const TSize& aTargetSize, 
  1308 								   TBool aAntiAliasFiltering);
  1309 
  1310 	/**
  1311 	Sets post-processing options for output cropping. SetPostProcessTypesL() must be called before this
  1312 	method is used.
  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."
  1320 	*/
  1321 	IMPORT_C void SetOutputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect);
  1322 
  1323 	/**
  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."
  1333 	*/
  1334 	IMPORT_C void SetPostProcSpecificOptionsL(THwDeviceId aHwDevice, const TDesC8& aOptions);
  1335 
  1336 	/**
  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 
  1342 	noted.
  1343 
  1344 	If initialization fails for any reason, the DevVideoPlay object must be destroyed and set up from
  1345 	scratch.
  1346 	*/
  1347 	IMPORT_C void Initialize();
  1348 
  1349 	/**
  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.
  1353 
  1354 	@see	SetPostProcessTypesL
  1355 	@see	SetInputCropOptionsL
  1356 	@see	SetYuvToRgbOptionsL
  1357 	@see	SetRotateOptionsL
  1358 	@see	SetScaleOptionsL
  1359 	@see	SetOutputCropOptionsL
  1360 	@see	SetPostProcSpecificOptionsL
  1361 
  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()."
  1364 	*/
  1365 	IMPORT_C void CommitL();
  1366 
  1367 	/**
  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.
  1371 
  1372 	@see	SetPostProcessTypesL
  1373 	@see	SetInputCropOptionsL
  1374 	@see	SetYuvToRgbOptionsL
  1375 	@see	SetRotateOptionsL
  1376 	@see	SetScaleOptionsL
  1377 	@see	SetOutputCropOptionsL
  1378 	@see	SetPostProcSpecificOptionsL
  1379 
  1380 	@pre	"This method can only be called after the API has been initialized with Initialize()."
  1381 	*/
  1382 	IMPORT_C void Revert();
  1383 
  1384 	/**
  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 
  1392 							on the screen."
  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()."
  1400 	*/
  1401 	IMPORT_C void StartDirectScreenAccessL(const TRect& aVideoRect, 
  1402 										   CFbsScreenDevice& aScreenDevice, 
  1403 										   const TRegion& aClipRegion);
  1404 
  1405 	/**
  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.) 
  1409 
  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.
  1414 
  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()."
  1418 	*/
  1419 	IMPORT_C void SetScreenClipRegion(const TRegion& aRegion);
  1420 
  1421 	/**
  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()."
  1428 	*/
  1429 	IMPORT_C void SetPauseOnClipFail(TBool aPause);
  1430 
  1431 	/**
  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()."
  1435 	*/
  1436 	IMPORT_C void AbortDirectScreenAccess();
  1437 
  1438 	/**
  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()."
  1443 	*/
  1444 	IMPORT_C TBool IsPlaying();
  1445 
  1446 	/**
  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()."
  1450 	*/
  1451 	IMPORT_C void Redraw();
  1452 
  1453 	/**
  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()."
  1457 	*/
  1458 	IMPORT_C void Start();
  1459 
  1460 	/**
  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()."
  1463 	*/
  1464 	IMPORT_C void Stop();
  1465 
  1466 	/**
  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()."
  1471 	*/
  1472 	IMPORT_C void Pause();
  1473 
  1474 	/**
  1475 	Resumes video playback after a pause. The client is responsible for restarting the clock source 
  1476 	if necessary.
  1477 	@pre	"This method can only be called after the API has been initialized with Initialize()."
  1478 	*/
  1479 	IMPORT_C void Resume();
  1480 
  1481 	/**
  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 
  1487 	position.
  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()."
  1490 	*/
  1491 	IMPORT_C void SetPosition(const TTimeIntervalMicroSeconds& aPlaybackPosition);
  1492 
  1493 	/**
  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()."
  1502 	*/
  1503 	IMPORT_C void FreezePicture(const TTimeIntervalMicroSeconds& aPlaybackPosition);
  1504 
  1505 	/**
  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()."
  1512 	*/
  1513 	IMPORT_C void ReleaseFreeze(const TTimeIntervalMicroSeconds& aPlaybackPosition);
  1514 
  1515 	/**
  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()."
  1519 	*/
  1520 	IMPORT_C TTimeIntervalMicroSeconds DecodingPosition();
  1521 
  1522 	/**
  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()."
  1527 	*/
  1528 	IMPORT_C TTimeIntervalMicroSeconds PlaybackPosition();
  1529 	
  1530 	/**
  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()."
  1534 	*/
  1535 	IMPORT_C TUint PreDecoderBufferBytes();
  1536 
  1537 	/**
  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()."
  1541 	*/
  1542 	IMPORT_C TUint PictureBufferBytes();
  1543 
  1544 	/**
  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()."
  1550 	*/
  1551 	IMPORT_C void GetPictureCounters(TPictureCounters& aCounters);
  1552 
  1553 	/**
  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 
  1557 	last call.
  1558 	@param	"aCounters"	"The counter structure to fill."
  1559 	@pre	"This method can only be called after the API has been initialized with Initialize()."
  1560 	*/
  1561 	IMPORT_C void GetBitstreamCounters(TBitstreamCounters& aCounters);
  1562 
  1563 	/**
  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()."
  1568 	*/
  1569 	IMPORT_C TUint NumFreeBuffers();
  1570 
  1571 	/**
  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.
  1576 
  1577 	The complexity level can be changed at any point during playback.
  1578 
  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()."
  1585 	*/
  1586 	IMPORT_C void SetComplexityLevel(THwDeviceId aHwDevice, TUint aLevel);
  1587 
  1588 	/**
  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 
  1595 			zero is safe."
  1596 	@pre	"This method can only be called after the API has been initialized with Initialize()."
  1597 	*/
  1598 	IMPORT_C TUint NumComplexityLevels(THwDeviceId aHwDevice);
  1599 
  1600 	/**
  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()."
  1611 	*/
  1612 	IMPORT_C void GetComplexityLevelInfo(THwDeviceId aHwDevice, TUint aLevel, TComplexityLevelInfo& aInfo);
  1613 
  1614 	/**
  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().
  1619 
  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.
  1626 
  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.
  1631 
  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."
  1637 	*/
  1638 	IMPORT_C TVideoInputBuffer* GetBufferL(TUint aBufferSize);
  1639 
  1640 	/**
  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 
  1643 	with GetBufferL().
  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()."
  1647 	*/
  1648 	IMPORT_C void WriteCodedDataL(TVideoInputBuffer* aBuffer);
  1649 
  1650 	/**
  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()."
  1656 	*/
  1657 	IMPORT_C void WritePictureL(TVideoPicture* aPicture);
  1658 
  1659 	/**
  1660 	Notifies the system that the end of input data has been reached.
  1661 	
  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. 
  1666 	
  1667 	  
  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.
  1670 
  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.
  1676 
  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.
  1679 
  1680 	@pre	"This method can only be called after the API has been initialized with Initialize()."
  1681 	*/
  1682 	IMPORT_C void InputEnd();
  1683 
  1684 	/**
  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 
  1690 									valid."
  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()."
  1698 	*/
  1699 	IMPORT_C void GetNewPictureInfo(TUint& aNumPictures, 
  1700 									TTimeIntervalMicroSeconds& aEarliestTimestamp, 
  1701 									TTimeIntervalMicroSeconds& aLatestTimestamp);
  1702 
  1703 	/**
  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()."
  1711 	*/
  1712 	IMPORT_C TVideoPicture* NextPictureL();
  1713 
  1714 	/**
  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()."
  1719 	*/
  1720 	IMPORT_C void ReturnPicture(TVideoPicture* aPicture);
  1721 
  1722 	/**
  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 
  1726 							format requested."
  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()."
  1733 	*/
  1734 	IMPORT_C TBool GetSnapshotL(TPictureData& aPictureData, const TUncompressedVideoFormat& aFormat);
  1735 
  1736 	/**
  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.
  1740 
  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 
  1745 	picture.
  1746 
  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.
  1750 
  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()."
  1762 	*/
  1763 	IMPORT_C void GetTimedSnapshotL(TPictureData* aPictureData, 
  1764 									const TUncompressedVideoFormat& aFormat, 
  1765 									const TTimeIntervalMicroSeconds& aPresentationTimestamp);
  1766 
  1767 	/**
  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.
  1771 
  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.
  1775 
  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.
  1779 
  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()."
  1789 	*/
  1790 	IMPORT_C void GetTimedSnapshotL(TPictureData* aPictureData, 
  1791 									const TUncompressedVideoFormat& aFormat, 
  1792 									const TPictureId& aPictureId);
  1793 
  1794 	/**
  1795 	Cancels a timed snapshot request.
  1796 	@pre	"This method can only be called after the API has been initialized with Initialize()."
  1797 	*/
  1798 	IMPORT_C void CancelTimedSnapshot();
  1799 
  1800 	/**
  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()."
  1805 	*/
  1806 	IMPORT_C void GetSupportedSnapshotFormatsL(RArray<TUncompressedVideoFormat>& aFormats);
  1807 
  1808 	/**
  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."
  1817 	*/
  1818 	IMPORT_C TAny* CustomInterface(THwDeviceId aHwDevice, TUid aInterface);
  1819 	
  1820 private:
  1821 	enum TInitializationState 
  1822 		{
  1823 		ENotInitialized = 0x01, 
  1824 		EInitializing = 0x02,
  1825 		EInitialized = 0x04,
  1826 		EInitializationFailed = 0x08
  1827 		};
  1828 private:
  1829 	CMMFDevVideoPlay(MMMFDevVideoPlayObserver& aObserver);
  1830 
  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;
  1839 
  1840 	// Connects the plugins together
  1841 	void ConnectPlugins();
  1842 
  1843 	// Check that we are in a valid initialization state
  1844 	// Panics if iInitializationState is not one of aExpected
  1845 	void CheckInitializationState(TUint aExpected);
  1846 
  1847 	// Methods to handle init complete callbacks from the hw devices
  1848 	void HandlePostProcInitializeComplete(TInt aError);
  1849 	void HandleDecodeInitializeComplete(TInt aError);
  1850 		
  1851 	CMMFVideoDecodeHwDevice* CreateDecoderL(TUid aVideoDecoder);
  1852 
  1853 
  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();
  1872 	
  1873 private:
  1874 	MMMFDevVideoPlayObserver& iObserver;
  1875 	CMMFVideoDecodeHwDevice* iVideoDecodeHwDevice;
  1876 	CMMFVideoPostProcHwDevice* iVideoPostProcHwDevice;
  1877 	TUint iInitializationState;
  1878 
  1879 	TDblQue<TVideoPicture> iVideoPictureQue;
  1880 	TDblQueIter<TVideoPicture> iVideoPictureQueIter;
  1881 	TUint iNumberOfVideoPictures;
  1882 	// Not to be used, but kept for BC purposes
  1883 	TInt iReserved;
  1884 
  1885 	TUint iNumberOfMdvppStreamEndCallbacks;
  1886 	TBool iIsDecodeComplete;
  1887 	
  1888 #ifdef SYMBIAN_MULTIMEDIA_CODEC_API
  1889 	RImplInfoPtrArray iPuImplementations;
  1890 	TBool iPuListCreated;
  1891 #endif // SYMBIAN_MULTIMEDIA_CODEC_API
  1892 	};
  1893 
  1894 
  1895 /**
  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.
  1899 @publishedAll
  1900 @released
  1901 */
  1902 class MMMFDevVideoPlayObserver
  1903 	{
  1904 public:
  1905 	/**
  1906 	Notifies the client that one or more new empty input buffers are available. The client can fetch 
  1907 	the input buffer with GetBufferL().
  1908 	*/
  1909 	virtual void MdvpoNewBuffers() = 0;
  1910 
  1911 	/**
  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."
  1914 	*/
  1915 	virtual void MdvpoReturnPicture(TVideoPicture* aPicture) = 0;
  1916 
  1917 	/**
  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 
  1922 							is part of."
  1923 	@param	"aPictureId"	"Picture identifier for the picture. If a picture ID is not available, 
  1924 							aPictureId.iIdType is set to ENone."
  1925 	*/
  1926 	virtual void MdvpoSupplementalInformation(const TDesC8& aData, 
  1927 											  const TTimeIntervalMicroSeconds& aTimestamp, 
  1928 											  const TPictureId& aPictureId) = 0;
  1929 
  1930 	/**
  1931 	Back channel information from the decoder, indicating a picture loss without specifying the lost picture.
  1932 	*/
  1933 	virtual void MdvpoPictureLoss() = 0;
  1934 
  1935 	/**
  1936 	Back channel information from the decoder, indicating the pictures that have been lost.
  1937 
  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."
  1940 	*/
  1941 	virtual void MdvpoPictureLoss(const TArray<TPictureId>& aPictures) = 0;
  1942 
  1943 	/**
  1944 	Back channel information from the decoder, indicating the loss of consecutive macroblocks in raster 
  1945 	scan order.
  1946 
  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."
  1955 	*/
  1956 	virtual void MdvpoSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture)= 0;
  1957 
  1958 	/**
  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 
  1962 	have been lost.
  1963 	
  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."
  1968 	*/
  1969 	virtual void MdvpoReferencePictureSelection(const TDesC8& aSelectionData)= 0;
  1970 
  1971 	/**
  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."
  1981 	*/
  1982 	virtual void MdvpoTimedSnapshotComplete(TInt aError, 
  1983 											TPictureData* aPictureData, 
  1984 											const TTimeIntervalMicroSeconds& aPresentationTimestamp, 
  1985 											const TPictureId& aPictureId) = 0;
  1986 
  1987 	/**
  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.
  1990 	*/
  1991 	virtual void MdvpoNewPictures() = 0;
  1992 
  1993 	/**
  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.
  2002 
  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.
  2006 	
  2007 	@param	"aError"	"The error code."
  2008 	*/
  2009 	virtual void MdvpoFatalError(TInt aError) = 0;
  2010 
  2011 	/**
  2012 	Reports that DevVideoPlay initialization has completed. The interface can now be used for video 
  2013 	playback.
  2014 	@param	"aError"	"Initialization error code, KErrNone if no error occurred."
  2015 	*/
  2016 	virtual void MdvpoInitComplete(TInt aError) = 0;
  2017 
  2018 	/**
  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 
  2021 	be available.
  2022 	*/
  2023 	virtual void MdvpoStreamEnd() = 0;
  2024 	};
  2025 
  2026 
  2027 
  2028 #include <mmf/devvideo/devvideoplay.inl>
  2029 
  2030 #endif