mp4asp_dec/arimpeg4aspdechwdevice/inc/arimpeg4aspdechwdevice.h
changeset 0 bb31fbe78861
equal deleted inserted replaced
-1:000000000000 0:bb31fbe78861
       
     1 /*
       
     2 * Copyright (c) 2009 Aricent and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Aricent - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Header file to MPEG4ASPHwDevice.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef MP4DECHWDEVICE_H
       
    20 #define MP4DECHWDEVICE_H
       
    21 
       
    22 //System includes
       
    23 #include <videoplayhwdevice.h>
       
    24 #include <ImplementationProxy.h>
       
    25 #include <buffermanagementci.h>
       
    26 
       
    27 //User includes
       
    28 #include "aribaseengine.h"
       
    29 #include "arimpeg4aspdecwrapper.h"
       
    30 #include "arimpeg4aspdechwdeviceuid.hrh"
       
    31 
       
    32 
       
    33 // CONSTANTS
       
    34 
       
    35 const TInt KMaxAllowPicLoss			= 75;
       
    36 
       
    37 const TInt KPicRate					= 30;
       
    38 
       
    39 const TInt KMP4Level11			= 11;
       
    40 const TInt KMP4Level1			= 1;
       
    41 const TInt KMP4Level2			= 2;
       
    42 const TInt KMP4Level3			= 3;
       
    43 const TInt KMP4Level4			= 4;
       
    44 const TInt KMP4Level5			= 5;
       
    45 
       
    46 const TInt KH263Level10			= 10;
       
    47 const TInt KH263Level20			= 20;
       
    48 const TInt KH263Level30			= 30;
       
    49 const TInt KH263Level45			= 45;
       
    50 
       
    51 const TInt KMaxInputBufferSize  = ( 248 * 2048 );
       
    52 const TInt KMaxOutputBuffers    = 2;
       
    53 const TInt KMaxInputBuffers		= 2;
       
    54 const TInt KMinInputBuffers		= 2;
       
    55 
       
    56 //Implementatino uid for hwdevice
       
    57 const TUid KUidMp4H263DecoderHwDevice = {KUidMp4DecoderHwDeviceImplUid};
       
    58 
       
    59 const TUint KMaxBitRate = 15*1024*1024;
       
    60 
       
    61 //Max number of mimetypes decoder supprots
       
    62 const TInt KDecoderInfoCount = 14;
       
    63 
       
    64 const TText8* const KDecoderInfoMimeArray[KDecoderInfoCount] =
       
    65 	{
       
    66 	_S8("video/mp4v-es"),
       
    67 	_S8("video/mp4v-es; profile-level-id=8"),
       
    68 	_S8("video/mp4v-es; profile-level-id=9"),
       
    69 	_S8("video/mp4v-es; profile-level-id=1"),
       
    70 	_S8("video/mp4v-es; profile-level-id=2"),
       
    71 	_S8("video/mp4v-es; profile-level-id=3"),
       
    72 	_S8("video/mp4v-es; profile-level-id=4"),
       
    73 	_S8("video/mp4v-es; profile-level-id=5"),
       
    74 	_S8("video/h263-2000"),
       
    75 	_S8("video/h263-2000;profile=0;level=10"),
       
    76 	_S8("video/h263-2000;profile=0;level=20"),
       
    77 	_S8("video/h263-2000;profile=0;level=30"),
       
    78 	_S8("video/h263-2000;profile=0;level=45"),
       
    79 	_S8("video/h263-1998")
       
    80 	};
       
    81 
       
    82 // FORWARD DECLARTIONS
       
    83 class CAriMpeg4aspdecWrapper;
       
    84 class CStateMachine;
       
    85 
       
    86 //CLASS DECLARATIONS
       
    87 
       
    88 /**
       
    89  * This class is part of Aricent's Mpeg4 ASP/H263 decoder HwDevice plugin used for
       
    90  * decoding Mpeg4 ASP/H263 content to yuv420.
       
    91  * Provides implementation for standard MDF HwDevice plugin APIs as well as private functions
       
    92  * used internal to this class for .This class also implements callback APIs from
       
    93  * MMmfVideoBufferManagementObserver and MProcessEngineObserver which are called from CBaseEngine,
       
    94  * MCodecObserver which are called from the codec wrapper.
       
    95  */
       
    96 class CAriMpeg4aspdecHwDevice: public CMMFVideoDecodeHwDevice,
       
    97 							   public MProcessEngineObserver,
       
    98 							   public MMmfVideoBufferManagementObserver,
       
    99 							   public MCodecObserver
       
   100 {
       
   101 public:	//Constructors and destructor
       
   102 
       
   103 	/**
       
   104 	 * Two-phased constructor.
       
   105 	 * @return pointer to an instance of CMMFVideoDecodeHwDevice
       
   106 	 */
       
   107 	static CMMFVideoDecodeHwDevice* NewL();
       
   108 
       
   109 	/**
       
   110 	 * Function to destroy resources allocated by this object
       
   111 	 */
       
   112 	virtual ~CAriMpeg4aspdecHwDevice();
       
   113 
       
   114 public:	//CMMFVideoHwDevice Functions
       
   115 
       
   116    /**
       
   117 	* Retrieves a custom interface to the specified hardware device
       
   118 
       
   119 	* @param	aInteface	Interface UID, defined with the custom interface
       
   120 	* @return	Pointer to the interface implementation, or NULL if the
       
   121 	*           device does not implement the interface requested.
       
   122 	*       	The return value must be cast to the correct type by the user.
       
   123 	*/
       
   124 	virtual TAny* CustomInterface( TUid aInterface );
       
   125 
       
   126 public:	//CMMFVideoDecodeHwDevice Functions
       
   127 
       
   128     /**
       
   129 	 * Retrieves decoder information about this hardware device.
       
   130 	 * The device creates a CVideoDecoderInfo structure,
       
   131 	 * fills it with correct data, pushes it to cleanup stack and returns it.
       
   132 	 * The client will delete the object when it is no longer needed
       
   133 
       
   134 	 * @return	Decoder information as a CVideoDecoderInfo object.
       
   135 	 * The object is pushed to the cleanup stack, and must be deallocated by
       
   136 	 * the caller.
       
   137 
       
   138 	 * @leave	The method will leave if an error occurs.
       
   139 	 */
       
   140 	virtual CVideoDecoderInfo* VideoDecoderInfoLC();
       
   141 
       
   142    /**
       
   143 	* Reads header information from a coded data unit.
       
   144 
       
   145 	* @param aDataUnitType   The type of the coded data unit that is contained
       
   146 	*                        in aDataUnit.
       
   147 	*						 If the data is a simple piece of bitstream, use
       
   148 	*						 EDuArbitraryStreamSection.
       
   149 	* @param aEncapsulation  The encapsulation type used for the coded data.
       
   150 	*                        If the data is a simple piece of bitstream, use
       
   151 	*                        EDuElementaryStream.
       
   152 	* @param aDataUnit	     The coded data unit, contained in a
       
   153 	*                        TVideoInputBuffer.
       
   154 
       
   155 	* @return				 Header information for the data unit, or NULL if
       
   156 	*                        the coded data unit did not contain enough data
       
   157 	*                        to parse the header.The header data must be
       
   158 	* 						 returned to device using ReturnHeader() before
       
   159 	*                        Initialize() is called or decoder is destroyed.
       
   160 	* 						 The data remains valid until it is returned.
       
   161 
       
   162 	* @leave				 This method may leave with one of the standard
       
   163 	*                        error codes.
       
   164 
       
   165 	* @pre					 This method can only be called before hwdevice
       
   166 	*                        has been initialized with Initialize()
       
   167 	*/
       
   168 	virtual TVideoPictureHeader* GetHeaderInformationL(
       
   169 			                       TVideoDataUnitType aDataUnitType,
       
   170 		                           TVideoDataUnitEncapsulation aEncapsulation,
       
   171 		                           TVideoInputBuffer* aDataUnit );
       
   172 
       
   173    /**
       
   174 	* Returns a header from GetHeaderInformationL() back to the decoder so
       
   175 	* that the memory can be freed.
       
   176 
       
   177 	* @param aHeader	The header to return
       
   178 
       
   179 	* @pre				This method can only be called before the hwdevice
       
   180 	*                    has been initialized with Initialize()
       
   181 	*/
       
   182 	virtual void ReturnHeader( TVideoPictureHeader* aHeader );
       
   183 
       
   184    /**
       
   185 	* Sets the device input format to a compressed video format.
       
   186 
       
   187 	* @param aFormat		  The input format to use
       
   188 	* @param aDataUnitType	  The encapsulation type used for the coded data
       
   189 	* @param aEncapsulation   The encapsulation type used for the coded data
       
   190 	* @param aDataInOrder	  True if the input data is written in correct
       
   191 	*                         decoding order, false if will be written in
       
   192 	*                         arbitrary order.
       
   193 
       
   194 	* @leave				  This method may leave with one of the standard
       
   195 	*                         error codes.
       
   196 
       
   197 	* @pre					  This method can only be called before hwdevice
       
   198 	*                          has been initialized with Initialize()
       
   199 	*/
       
   200 	virtual void SetInputFormatL( const CCompressedVideoFormat& aFormat,
       
   201 								   TVideoDataUnitType aDataUnitType,
       
   202 								   TVideoDataUnitEncapsulation aEncapsulation,
       
   203 								   TBool aDataInOrder );
       
   204 
       
   205    /**
       
   206 	* Sets whether decoding should be synchronzed to the current clock source,
       
   207 	* if any, or if pictures should instead be decoded as soon as possible.
       
   208 	* If decoding is synchronized, decoding timestamps are used if available,
       
   209 	* presentation timestamps are used if not. When decoding is not
       
   210 	* synchronized, pictures are decoded as soon as source data is available
       
   211 	* for them, and the decoder has a free output buffer. If a clock source is
       
   212 	* not available, decoding will not be synchronized.
       
   213 
       
   214 	* @param aSynchronize	True if decoding should be synchronized to a clock
       
   215 	*                       source.
       
   216 
       
   217 	* @pre					This method can only be called before the hwdevice
       
   218 	*                       has been initialized with Initialize()
       
   219 	*/
       
   220 	virtual void SynchronizeDecoding( TBool aSynchronize );
       
   221 
       
   222    /**
       
   223 	* Sets decoder buffering options
       
   224 
       
   225 	* @param aOptions   Buffering options
       
   226 
       
   227 	* @leave			This method may leave with one of the standard error
       
   228 	*                   codes.
       
   229 
       
   230 	* @pre				This method can only be called before the hwdevice has
       
   231 	*                   been initialized with Initialize()
       
   232 	*/
       
   233 	virtual void SetBufferOptionsL(
       
   234 			               const CMMFDevVideoPlay::TBufferOptions& aOptions );
       
   235 
       
   236    /**
       
   237 	* Gets the video decoder buffer options actually in use. This can be used
       
   238 	* before calling SetBufferOptions() to determine the default options, or
       
   239 	* afterwards to check the values actually in use ( if some default values
       
   240 	* were used ).
       
   241 
       
   242 	* @param aOptions  Buffering options structure to fill.
       
   243 
       
   244 	* @pre			   This method can only be called before the hwdevice has
       
   245 	*                  been initialized with Initialize()
       
   246 	*/
       
   247 	virtual void GetBufferOptions(
       
   248 			                     CMMFDevVideoPlay::TBufferOptions& aOptions );
       
   249 
       
   250    /**
       
   251 	* Indicates which HRD/VBV specification is fulfilled in the input stream
       
   252 	* and any related parameters.
       
   253 
       
   254 	* @param aHrdVbvSpec	The HRD/VBV specification fulfilled
       
   255 	* @param aHrdVbvParams	HRD/VBV parameters. The data format depends on the
       
   256 	*                       parameters chosen. For 3GPP TS 26.234. parameters
       
   257 	*                       aHrdVbvSpec=EHrdVbv3GPP, data in the descriptor
       
   258 	*                       is a package of type TPckC<T3gppHrdVbvParams>
       
   259 	* 						If no HRD/VBV parameters are used, the descriptor
       
   260 	*                       is empty.
       
   261 
       
   262 	* @pre					This method can only be called before the hwdevice
       
   263 	*                       has been initialized with Initialize()
       
   264 	*/
       
   265 	virtual void SetHrdVbvSpec( THrdVbvSpecification aHrdVbvSpec,
       
   266 			                   const TDesC8& aHrdVbvParams );
       
   267 
       
   268    /**
       
   269 	* Sets the output post-procesor device to use. If an output device is set,
       
   270 	* all decoded pictures are delivered to that device, and not drawn on
       
   271 	* screen or returned to the client. Pictures are written using
       
   272 	* CMMDVideoPostProcDevice::WritePictureL() or a custom interface after
       
   273 	* they have been decoded. The post-processor must then synchronize
       
   274 	* rendering to the clock source if necessary.
       
   275 	*
       
   276 	* @param aDevice	 The output post-processor device to use.
       
   277 
       
   278 	* @pre				 This method can only be called before the hwdevice
       
   279 	*                     has been initialized with Initialize()
       
   280 	*/
       
   281 	virtual void SetOutputDevice( CMMFVideoPostProcHwDevice* aDevice );
       
   282 
       
   283    /**
       
   284 	* Returns the current decoding position, i.e. the timestamp for the most
       
   285 	* recently decoded picture.
       
   286 
       
   287 	* @return		Current decoding position.
       
   288 
       
   289 	* @pre			This method can only be called before the hwdevice has
       
   290 	*                been initialized with Initialize()
       
   291 	*/
       
   292 	virtual TTimeIntervalMicroSeconds DecodingPosition();
       
   293 
       
   294    /**
       
   295 	* Returns the current pre-decoder buffer size
       
   296 
       
   297 	* @return		The number of bytes of data in the pre-decoder buffer.
       
   298 
       
   299 	* @pre			This method can only be called after the hwdevice has been
       
   300 	*               initialized with Initialize().
       
   301 	*/
       
   302 	virtual TUint PreDecoderBufferBytes();
       
   303 
       
   304    /**
       
   305 	* Reads various counters related to the received input bitstream and coded
       
   306 	* data units.
       
   307 
       
   308 	* @param aCounters     The counter structure to fill.
       
   309 
       
   310 	* @pre				   This method can only be called after the hwdevice
       
   311 	*                      has been initialized with Initialize().
       
   312 	*/
       
   313 	virtual void GetBitstreamCounters(
       
   314 			                CMMFDevVideoPlay::TBitstreamCounters& aCounters );
       
   315 
       
   316    /**
       
   317 	* Retrieves the number of free input buffers the decoder has available
       
   318 
       
   319 	* @return	Number of free input buffers the decoder has available.
       
   320 
       
   321 	* @leave	This method may leave with one of the standard error codes.
       
   322 
       
   323 	* @pre		This method can only be called after the hwdevice has been
       
   324 	*            initialized with Initialize().
       
   325 	*/
       
   326 	virtual TUint NumFreeBuffers();
       
   327 
       
   328    /**
       
   329 	* Retrieves an empty video input buffer from the decoder. After input data
       
   330 	* has been written to the buffer, it can be written to the decoder using
       
   331 	* WriteCodedDataL(). The number of buffers the decoder must be able
       
   332 	* to provide before expecting any back, and the maximum size for each
       
   333 	* buffer, are specified in the buffer options.The decoder maintains
       
   334 	* ownership of the buffers even while they have been retrieved by client,
       
   335 	* and will take care of deallocating them.
       
   336 
       
   337 	* @param aBufferSize	Required buffer size, in bytes. The resulting
       
   338 	*                        buffer can be larger than this, but not smaller
       
   339 
       
   340 	* @return				A new input data buffer. The buffer is at least
       
   341 	*                        as large as requested, but it may be larger.
       
   342 	* 						If no free buffers are available, the return value
       
   343 	*                       is NULL.
       
   344 
       
   345 	* @leave				This method may leave with one of the standard
       
   346 	*                        error codes.
       
   347 
       
   348 	* @pre					This method can only be called after the hwdevice
       
   349 	*                        has been initialized with Initialize().
       
   350 	*/
       
   351 	virtual TVideoInputBuffer* GetBufferL( TUint aBufferSize );
       
   352 
       
   353    /**
       
   354 	* Writes a piece of coded video data to the decoder. The data buffer must
       
   355 	* be retrieved from the decoder with GetBufferL().
       
   356 
       
   357 	* @param aBuffer	The coded data unit to write.
       
   358 
       
   359 	* @leave				This method may leave with one of the standard
       
   360 	*                        error codes.
       
   361 
       
   362 	* @pre				This method can only be called after the hwdevice has
       
   363 	*                    been initialized with Initialize().
       
   364 	*/
       
   365 	virtual void WriteCodedDataL( TVideoInputBuffer* aBuffer );
       
   366 
       
   367 #ifdef SYMBIAN_MDF_API_V2
       
   368    /**
       
   369 	* Configures the Decoder using header information known by the client.
       
   370 	* @param	aVideoPictureHeader	Header information to configure the
       
   371 	*                                    decoder with
       
   372 	* @leave	The method will leave if an error occurs. Running out of data
       
   373 	*            is not considered an error,
       
   374 	* 		as described above.
       
   375 	* @pre	This method can only be called before the hwdevice has been
       
   376 	*        initialized with Initialize().
       
   377 	*/
       
   378     virtual void ConfigureDecoderL(
       
   379     		                 const TVideoPictureHeader& aVideoPictureHeader );
       
   380 
       
   381 #endif
       
   382 
       
   383 public:	//Inherited from CMMFVideoPlayHwDevice
       
   384 
       
   385    /**
       
   386 	* Retrieves post-processing information about this hardware device. The
       
   387 	* device creates a CPostProcessorInfo structure defined in [3] ), fills
       
   388 	* it with correct data, pushes it to the cleanup stack and returns it. The
       
   389 	* client will delete the object when it is no longer needed.
       
   390 
       
   391 	* @return		Post-processor information as a CPostProcessorInfo object.
       
   392 	* 				The object is pushed to the cleanup stack, and must be
       
   393 	*               deallocated by the caller.
       
   394 
       
   395 	* @leave		This method may leave with one of the standard error codes
       
   396 	*/
       
   397 	virtual CPostProcessorInfo* PostProcessorInfoLC();
       
   398 
       
   399    /**
       
   400 	* Retrieves the list of the output formats that the device supports. The
       
   401 	* list is ordered in plug-in preference order, with the preferred formats
       
   402 	* at the beginning of the list. The list can depend on the device source
       
   403 	* format, and therefore SetSourceFormatL() must be called before calling
       
   404 	* this method.
       
   405 
       
   406 	* @param aFormats		An array for the result format list. The array
       
   407 	*                       must be created and destroyed by the caller.
       
   408 
       
   409 	* @leave				This method may leave with one of the standard
       
   410 	*                       error codes.
       
   411 
       
   412 	* @pre					This method can only be called after the hwdevice
       
   413 	*                       has been initialized with Initialize().
       
   414 	*/
       
   415 	virtual void GetOutputFormatListL (
       
   416 								 RArray<TUncompressedVideoFormat>& aFormats );
       
   417 
       
   418    /**
       
   419 	* Sets the device output format.
       
   420 
       
   421 	* @param aDataUnit	    The format to use.
       
   422 
       
   423 	* @leave				This method may leave with one of the standard
       
   424 	*                       error codes.
       
   425 
       
   426 	* @pre					This method can only be called after the hwdevice
       
   427 	*                       has been initialized with Initialize().
       
   428 	*/
       
   429 	virtual void SetOutputFormatL( const TUncompressedVideoFormat &aFormat );
       
   430 
       
   431    /**
       
   432 	* Sets the clock source to use for video timing. See [3] for a discussion
       
   433 	* about audio/video synchronization. If no clock source is set. video
       
   434 	* playback will not be synchronized, but will proceed as fast as possible,
       
   435 	* depending on input data and output buffer availability.
       
   436 
       
   437 	* @param aDataUnitType  The clock source to use.
       
   438 
       
   439 	* @pre					This method can only be called after the hwdevice
       
   440 	*                       has been initialized with Initialize().
       
   441 	*/
       
   442 	virtual void SetClockSource ( MMMFClockSource* aClock );
       
   443 
       
   444    /**
       
   445 	* Sets the device video output destination. The destination can be the
       
   446 	* screen using direct screen access ) or memory buffers. By default
       
   447 	* memory buffers are used. If data is written to another device, this
       
   448 	* method is ignored, and suitable memory buffers are always used.
       
   449 
       
   450 	* @param aScreen  True if video output destination is the screen, false
       
   451 	*                 if memory buffers.
       
   452 
       
   453 	* @leave		  This method may leave with one of the standard error
       
   454 	*                 codes.
       
   455 
       
   456 	* @pre			  This method can only be called after the hwdevice has
       
   457 	*                 been initialized with Initialize().
       
   458 	*/
       
   459 	virtual void SetVideoDestScreenL( TBool aScreen );
       
   460 
       
   461    /**
       
   462 	* Sets the post-processing types to be used.
       
   463 
       
   464 	* @param aPostProcCombination   The post-processing steps to perform, a
       
   465 	*                               bitwise or of values from TPostProcessType
       
   466 	* @leave						This method may leave with one of the
       
   467 	*                               standard error codes.
       
   468 
       
   469 	* @pre							This method can be called either before
       
   470 	*                               or after the hwdevice has been initialized
       
   471 	*								with Initialize(). If called after
       
   472 	*								with initialization, the change will only
       
   473 	*								with be committed once CommitL() is called
       
   474 	*/
       
   475 	virtual void SetPostProcessTypesL ( TUint32 aPostProcCombination );
       
   476 
       
   477    /**
       
   478 	* Sets post-processing options for input pan-scan ) cropping.
       
   479 
       
   480 	* @param aRect  The type of the coded data unit that is contained in
       
   481 	*               aDataUnit.
       
   482 
       
   483 	* @leave		This method may leave with one of the standard error codes
       
   484 
       
   485 	* @pre			This method can be called either before or after the
       
   486 	*               hwdevice has been initialized with Initialize(). If called
       
   487 	*               after initialization, the change will only be committed
       
   488 	*               once CommitL() is called.
       
   489 	*/
       
   490 	virtual void SetInputCropOptionsL( const TRect& aRect );
       
   491 
       
   492    /**
       
   493 	* Sets post-processing options for YUV to RGB color space conversion. The
       
   494 	* first variant specifies the input YUV and output RGB formats to use
       
   495 	* explicitly, while the second variant uses the device input and output
       
   496 	* formats. For decoder devices the default YUV format used is the format
       
   497 	* specified in the input bitstream. SetSourceFormatL(), SetOutputFormatL()
       
   498 	* and SetPostProcessTypesL() must be called before this method is used
       
   499 
       
   500 	* @param aOptions	 The conversion options to use
       
   501 	* @param aYuvFormat	 Conversion source YUV format, if specified.
       
   502 	* @param aRgbFormat	 Conversion target RGB format, if specified..
       
   503 
       
   504 	* @leave			 This method may leave with one of the standard error
       
   505 	*                    codes.
       
   506 
       
   507 	* @pre				 This method can be called either before or after the
       
   508 	*                    hwdevice has been initialized with Initialize(). If
       
   509 	*                    called after initialization, the change will only be
       
   510 	*					 committed once CommitL() is called.
       
   511 	*/
       
   512 	virtual void SetYuvToRgbOptionsL( const TYuvToRgbOptions& aOptions,
       
   513 									 const TYuvFormat& aYuvFormat,
       
   514 									 TRgbFormat aRgbFormat );
       
   515    /**
       
   516 	* Sets post-processing options for YUV to RGB color space conversion. The
       
   517 	* first variant specifies the input YUV and output RGB formats to use
       
   518 	* explicitly, while the second variant uses the device input and output
       
   519 	* formats. For decoder devices the default YUV format used is the format
       
   520 	* specified in the input bitstream. SetSourceFormatL(), SetOutputFormatL()
       
   521 	* and SetPostProcessTypesL() must be called before this method is used
       
   522 
       
   523 	* @param aOptions	 The conversion options to use
       
   524 
       
   525 	* @leave			 This method may leave with one of the standard error
       
   526 	*                    codes.
       
   527 
       
   528 	* @pre				 This method can be called either before or after the
       
   529 	*                    hwdevice has been initialized
       
   530 	*					 with Initialize(). If called after initialization,
       
   531 	*					 the change will only be committed once CommitL() is
       
   532 	*					 called
       
   533 	*/
       
   534 	virtual void SetYuvToRgbOptionsL( const TYuvToRgbOptions& aOptions );
       
   535 
       
   536    /**
       
   537 	* Sets post-processing options for YUV to RGB color space conversion. The
       
   538 	* first variant specifies the input YUV and output RGB formats to use
       
   539 	* explicitly, while the second variant uses the device input and output
       
   540 	* formats. For decoder devices the default YUV format used is the format
       
   541 	* specified in the input bitstream. SetSourceFormatL(), SetOutputFormatL()
       
   542 	* and SetPostProcessTypesL() must be called before this method is used
       
   543 
       
   544 	* @param aRotationType The rotation to perform.
       
   545 
       
   546 	* @leave			  This method may leave with one of the standard
       
   547 	*                     error codes.
       
   548 
       
   549 	* @pre				  This method can be called either before or after
       
   550 	*                     the hwdevice has been initialized with Initialize().
       
   551 	*                     If called after initialization, the change will only
       
   552 	*                     be committed once CommitL() is called.
       
   553 	*/
       
   554 	virtual void SetRotateOptionsL( TRotationType aRotationType );
       
   555 
       
   556    /**
       
   557 	* @param aRotationType The rotation to perform.
       
   558 
       
   559 	* @leave			  This method may leave with one of the standard
       
   560 	*                     error codes.
       
   561 
       
   562 	* @pre				  This method can be called either before or after
       
   563 	*                     the hwdevice has been initialized with Initialize().
       
   564 	*                     If called after initialization, the change will
       
   565 	*                     only be committed once CommitL() is called.
       
   566 	*/
       
   567 	virtual void SetScaleOptionsL( const TSize& aTargetSize,
       
   568 								  TBool aAntiAliasFiltering );
       
   569 
       
   570    /**
       
   571 	* Sets post-processing options for output cropping. SetPostProcessTypesL()
       
   572 	* must be called before this method is used.
       
   573 
       
   574 	* @param aRect Output cropping area
       
   575 
       
   576 	* @leave	   This method may leave with one of the standard error codes.
       
   577 
       
   578 	* @pre		   This method can be called either before or after the
       
   579 	*              hwdevice has been initialized with Initialize(). If called
       
   580 	*              after initialization, the change will only be committed
       
   581 	*              once CommitL() is called.
       
   582 	*/
       
   583 	virtual void SetOutputCropOptionsL( const TRect& aRect );
       
   584 
       
   585    /**
       
   586 	* Sets post-processing plug-in specific options. SetPostProcessTypesL()
       
   587 	* must be called before this method is used.
       
   588 
       
   589 	* @param aOptions  The format is plug-in specific
       
   590 
       
   591 	* @leave		   This method may leave with one of the standard error
       
   592 	*                  codes.
       
   593 
       
   594 	* @pre		       This method can be called either before or after the
       
   595 	*                  hwdevice has been initialized with Initialize(). If
       
   596 	*                  called after initialization, the change will only be
       
   597 	* 			       committed once CommitL() is called.
       
   598 	*/
       
   599 	virtual void SetPostProcSpecificOptionsL( const TDesC8& aOptions );
       
   600 
       
   601    /**
       
   602 	* Initializes the device. This method is asynchronous, the device will
       
   603 	* call MMFVideoPlayProxy::MdvppInitializeComplete() after initialization
       
   604 	* has completed. After this method has successfully completed, further
       
   605 	* configuration changes are not possible except where separately noted
       
   606 
       
   607 	* @leave	   This method may leave with one of the standard error codes.
       
   608 	*/
       
   609 	virtual void Initialize();
       
   610 
       
   611    /**
       
   612 	* Commit all configuration changes since the last CommitL(), Revert() or
       
   613 	* Initialize(). This only applies to methods that can be called both
       
   614 	* before AND after the hwdevice has been initialized.
       
   615 
       
   616 	@leave		   This method may leave with one of the standard error codes.
       
   617 	*/
       
   618 	virtual void CommitL();
       
   619 
       
   620    /**
       
   621 	* Revert any configuration changes that have not yet been committed using
       
   622 	* CommitL(). This only applies to methods that can be called both before
       
   623 	* AND after the hwdevice has been initialized.
       
   624 
       
   625 	* @leave	This method may leave with one of the standard error codes.
       
   626 
       
   627 	* @pre		This method can only be called after the hwdevice has been
       
   628 	*           initialized with Initialize().
       
   629 	*/
       
   630 	virtual void Revert();
       
   631 
       
   632    /**
       
   633 	* Starts writing output directly to the display frame buffer using Direct
       
   634 	* Screen Access.
       
   635 
       
   636 	* @param aVideoRect		The video output rectangle on screen.
       
   637 	* @param aScreenDevice	The screen device to use. The screen device object
       
   638 	*                       must be valid in the current thread.
       
   639 	* @param aClipRegion    Initial clipping region to use.
       
   640 
       
   641 	* @leave				This method may leave with one of the standard
       
   642 	*                       error codes.
       
   643 
       
   644 	* @pre					This method can only be called after the hwdevice
       
   645 	*                       has been initialized with Initialize().
       
   646 	*/
       
   647 	virtual void StartDirectScreenAccessL( const TRect& aVideoRect,
       
   648 											CFbsScreenDevice& aScreenDevice,
       
   649 											const TRegion& aClipRegion );
       
   650 
       
   651    /**
       
   652 	* Sets a new clipping region for Direct Screen Access. After the method
       
   653 	* returns, no video will be drawn outside of the region. If clipping is
       
   654 	* not supported, or the clipping region is too complex, either playback
       
   655 	* will pause or will resume without video display, depending on the
       
   656 	* current setting of SetPauseOnClipFail(), and the result can be verified
       
   657 	* with IsPlaying(). Clipping can be disabled by setting a new clipping
       
   658 	* region that includes the whole video window.
       
   659 
       
   660 	* @param aRegion		The new clipping region. After the method returns,
       
   661 	*                       no video will be drawn outside the region.
       
   662 
       
   663 	* @pre					This method can only be called after the hwdevice
       
   664 	*                       has been initialized with Initialize().
       
   665 	*/
       
   666 	virtual void SetScreenClipRegion( const TRegion& aRegion );
       
   667 
       
   668    /**
       
   669 	* Sets whether the system should pause playback when it gets a clipping
       
   670 	* region it cannot handle, or Direct Screen Access is aborted completely.
       
   671 	* If not, processing will proceed normally, but no video will be drawn.
       
   672 	* By default, playback is paused.
       
   673 
       
   674 	* @param aPause		True if playback should be paused when clipping fails,
       
   675 	*                   false if not.
       
   676 	*					If playback is not paused, it will be continued
       
   677 	*					If without video display
       
   678 	*
       
   679 	* @pre				This method can only be called after the hwdevice has
       
   680 	*                   been initialized with Initialize().
       
   681 	*/
       
   682 	virtual void SetPauseOnClipFail( TBool aPause );
       
   683 
       
   684    /**
       
   685 	* Aborts Direct Screen Access completely, to be called from
       
   686 	* MAbortDirectScreenAccess::AbortNow() and similar methods. DSA can be
       
   687 	* resumed by calling StartDirectScreenAccessL().
       
   688 
       
   689 	* @pre		This method can only be called after the hwdevice has been
       
   690 	* initialized with Initialize().
       
   691 	*/
       
   692 	virtual void AbortDirectScreenAccess();
       
   693 
       
   694    /**
       
   695 	* Indicates Whether playback is proceeding
       
   696 	* @return		ETrue if video is still being played even if not
       
   697 	*               necessarily displayed )
       
   698 
       
   699 	* @pre		    This method can only be called after the hwdevice has been
       
   700 	*               initialized with Initialize().
       
   701 	*/
       
   702 	virtual TBool IsPlaying();
       
   703 
       
   704    /**
       
   705 	* Re-draws the latest video picture.Only available when DSA is being used.
       
   706 	* If DSA is aborted or a non-supported clipping region has been set, the
       
   707 	* request may be ignored.
       
   708 
       
   709 	* @pre		This method can only be called after the hwdevice has been
       
   710 	*           initialized with Initialize().
       
   711 	*/
       
   712 	virtual void Redraw();
       
   713 
       
   714    /**
       
   715 	* Starts video playback, including decoding, post-processing, and
       
   716 	* rendering. Playback will proceed until it has been stopped or paused, or
       
   717 	* the end of the bitstream is reached.
       
   718 
       
   719 	* @pre		This method can only be called after the hwdevice has been
       
   720 	*           initialized with Initialize().
       
   721 	*/
       
   722 	virtual void Start();
       
   723 
       
   724    /**
       
   725 	* Stops video playback. No new pictures will be decoded, post-processed,
       
   726 	* or rendered.
       
   727 
       
   728 	* @pre		This method can only be called after the hwdevice has been
       
   729 	*           initialized with Initialize().
       
   730 	*/
       
   731 	virtual void Stop();
       
   732 
       
   733    /**
       
   734 	* Pauses video playback, including decoding, post-processing, and
       
   735 	* rendering. No pictures will be decoded, post-processed, or rendered
       
   736 	* until playback has been resumed.
       
   737 
       
   738 	* @pre		This method can only be called after the hwdevice has been
       
   739 	*           initialized with Initialize().
       
   740 	*/
       
   741 	virtual void Pause();
       
   742 
       
   743    /**
       
   744 	* Resumes video playback after a pause.
       
   745 
       
   746 	* @pre		This method can only be called after the hwdevice has been
       
   747 	*           initialized with Initialize().
       
   748 	*/
       
   749 	virtual void Resume();
       
   750 
       
   751    /**
       
   752 	* Changes to a new decoding and playback position, used for randomly
       
   753 	* accessing seeking ) the input stream. The position change flushes all
       
   754 	* input and output buffers, pre-decoder and post-decoder buffering are
       
   755 	* handled as if a new bitstream was. If the device still has buffered
       
   756 	* pictures that precede the new playback position, they will be discarded.
       
   757 	* If playback is synchronized to a clock source, the client is responsible
       
   758 	* for setting the clock source to the new position.
       
   759 
       
   760 	* @param aPlaybackPositio	The new playback position in the video stream.
       
   761 
       
   762 	* @pre					This method can only be called after the hwdevice
       
   763 	*                       has been initialized with Initialize().
       
   764 	*/
       
   765 	virtual void SetPosition(
       
   766 			             const TTimeIntervalMicroSeconds& aPlaybackPosition );
       
   767 
       
   768    /**
       
   769 	* Freezes a picture on the screen. After the picture has been frozen, no
       
   770 	* new pictures are displayed until the freeze is released with
       
   771 	* ReleaseFreeze(). If the device output is being written to memory buffers
       
   772 	* or to another plug-in, instead of the screen, no decoded pictures will
       
   773 	* be delivered while the freeze is active, and they are simply discarded.
       
   774 
       
   775 	* @param aTimestamp		The presentation timestamp of the picture to
       
   776 	*                       freeze. The frozen picture will be the first
       
   777 	*                       picture with a timestamp greater than or equal to
       
   778 	*                       this parameter
       
   779 
       
   780 	* @pre					This method can only be called after the hwdevice
       
   781 	*                       has been initialized with Initialize().
       
   782 	*/
       
   783 	virtual void FreezePicture( const TTimeIntervalMicroSeconds& aTimestamp );
       
   784 
       
   785    /**
       
   786 	* Releases a picture frozen with FreezePicture()
       
   787 
       
   788 	* @param aTimestamp		The presentation timestamp of the picture to
       
   789 	*                       release. The first picture displayed after the
       
   790 	*                       release will be the first picture with a timestamp
       
   791 	*						greater than or equal to this parameter. To
       
   792 	*						greater release the freeze immediately,	set the
       
   793 	*						greater timestamp to zero.
       
   794 
       
   795 	* @pre					This method can only be called after the hwdevice
       
   796 	*                       has been initialized with Initialize().
       
   797 	*/
       
   798 	virtual void ReleaseFreeze( const TTimeIntervalMicroSeconds& aTimestamp );
       
   799 
       
   800    /**
       
   801 	* Returns the current playback position, i.e. the timestamp for the most
       
   802 	* recently displayed or virtually displayed picture. If the device output
       
   803 	* is written to another device, the most recent output picture is used.
       
   804 
       
   805 	* @return	Current playback position
       
   806 
       
   807 	* @pre		This method can only be called after the hwdevice has been
       
   808 	*           initialized with Initialize().
       
   809 	*/
       
   810 	virtual TTimeIntervalMicroSeconds PlaybackPosition();
       
   811 
       
   812    /**
       
   813 	* Returns the total amount of memory allocated for uncompressed pictures.
       
   814 	* This figure only includes the pictures actually allocated by the plug-in
       
   815 	* itself, so that the total number of bytes allocated in the system can be
       
   816 	* calculated by taking the sum of the values from all plug-ins.
       
   817 
       
   818 	* @return		Total number of bytes of memory allocated for uncompressed
       
   819 	*               pictures.
       
   820 
       
   821 	* @pre		    This method can only be called after the hwdevice has been
       
   822 	*               initialized with Initialize().
       
   823 	*/
       
   824 	virtual TUint PictureBufferBytes();
       
   825 
       
   826    /**
       
   827 	* Reads various counters related to decoded pictures. See the definition
       
   828 	* of TPictureCounters for a description of the counters. The counters are
       
   829 	* reset when Initialize() or this method is called, and thus they only
       
   830 	* include pictures processed since the last call.
       
   831 
       
   832 	* @param aCounters	The counter structure to fill
       
   833 	* @pre				This method can only be called after the hwdevice has
       
   834 	*                   been initialized with Initialize().
       
   835 	*/
       
   836 	virtual void GetPictureCounters(
       
   837 			                  CMMFDevVideoPlay::TPictureCounters& aCounters );
       
   838 
       
   839    /**
       
   840 	* Sets the computational complexity level to use. If separate complexity
       
   841 	* levels are not available, the method call is ignored. If the level
       
   842 	* specified is not available, the results are undefined. Typically the
       
   843 	* device will either ignore the request or use the nearest suitable level.
       
   844 
       
   845 	* @param aLevel	The computational complexity level to use. Level zero ( 0 )
       
   846 	*               is the most complex one, with the highest quality. Higher
       
   847 	*               level numbers require less processing and may have lower
       
   848 	*               quality
       
   849 
       
   850 	* @pre			This method can only be called after the hwdevice has been
       
   851 	*               initialized with Initialize().
       
   852 	*/
       
   853 	virtual void SetComplexityLevel( TUint aLevel );
       
   854 
       
   855    /**
       
   856 	* Gets the number of complexity levels available.
       
   857 
       
   858 	* @return	The number of complexity control levels available, or zero if
       
   859 	*           the information is not available yet. The information may not
       
   860 	*           be available if the number of levels depends on the input
       
   861 	*           data, and enough input data has not	been read yet. In that
       
   862 	*           case, using level zero is safe.
       
   863 
       
   864 	* @pre		This method can only be called after the hwdevice has been
       
   865 	*           initialized with Initialize().
       
   866 	*/
       
   867 	virtual TUint NumComplexityLevels();
       
   868 
       
   869    /**
       
   870 	* Gets information about a computational complexity level. This method can
       
   871 	* be called after NumComplexityLevels() has returned a non-zero value - at
       
   872 	* that point the information is guaranteed to be available. Some hardware
       
   873 	* device implementations may not be able to provide all values, in that
       
   874 	* case the values will be approximated.
       
   875 
       
   876 	* @param aLevel		The computational complexity level to query. The level
       
   877 	*                   numbers range from zero the most complex ) to
       
   878 	*                   NumComplexityLevels()-1.
       
   879 	* @param aInfo		The information structure to fill
       
   880 
       
   881 	* @pre				This method can only be called after the hwdevice has
       
   882 	*                   been initialized with Initialize().
       
   883 	*/
       
   884 	virtual void GetComplexityLevelInfo( TUint aLevel,
       
   885 			                  CMMFDevVideoPlay::TComplexityLevelInfo& aInfo );
       
   886 
       
   887    /**
       
   888 	* Returns a picture back to the device. This method is called by
       
   889 	* CDevVideoPlay to return pictures from the client after they have been
       
   890 	* written with NewPicture() ), or by the output device when it has
       
   891 	* finished using a picture.
       
   892 
       
   893 	* @param aPicture	The picture to return. The device can re-use the
       
   894 	*                   memory for the picture.
       
   895 
       
   896 	* @pre				This method can only be called after the hwdevice has
       
   897 	*                   been initialized with Initialize().
       
   898 	*/
       
   899 	virtual void ReturnPicture( TVideoPicture* aPicture );
       
   900 
       
   901    /**
       
   902 	* Gets a copy of the latest picture sent to output
       
   903 
       
   904 	* @param aPictureData	  Target picture. The memory for the picture
       
   905 	*                         must be allocated by the caller, and
       
   906 	*                         initialized properly. The data formats must
       
   907 	*                         match the snapshot format requested.
       
   908 	* @param aFormat		  The picture format to use for the snapshot.
       
   909 
       
   910 	* @return				  ETrue if the snapshot was taken, EFalse if a
       
   911 	*                         picture is not available. The picture may not
       
   912 	*                         be available if decoding has not progressed
       
   913 	*                         far enough yet.
       
   914 
       
   915 	* @leave				  The method will leave if an error occurs.
       
   916 
       
   917 	* @pre					  This method can only be called after the
       
   918 	*                         hwdevice has been initialized with Initialize().
       
   919 	*/
       
   920 	virtual TBool GetSnapshotL( TPictureData& aPictureData,
       
   921 			                   const TUncompressedVideoFormat& aFormat );
       
   922 
       
   923    /**
       
   924 	* Gets a copy of a specified picture.When the snapshot is available, it
       
   925 	* will be returned to the client using the TimedSnapshotComplete()
       
   926 	* callback. To cancel a timed snapshot request, use CancelTimedSnapshot().
       
   927 	* Only one timed snapshot request can be active at a time.
       
   928 
       
   929 	* @param aPictureData			Target picture. The memory for the picture
       
   930 	*                               must be allocated by the caller, and
       
   931 	*                               initialized properly. The data formats
       
   932 	*                               must match the snapshot format requested.
       
   933 	*                               The picture must remain valid until
       
   934 	*								the snapshot has been taken or until the
       
   935 	*								the request has been cancelled with
       
   936 	*								the CancelTimedSnapshot().
       
   937 	* @param aFormat				The picture format to use for the snapshot
       
   938 	* @param aPresentationTimestamp	Presentation timestamp for the picture to
       
   939 	* copy. The timestamp
       
   940 	*								must match the timestamp in the picture
       
   941 	*								must exactly, so the same clock frequency
       
   942 	*								must should be used. Used for the first
       
   943 	*								must method variant
       
   944 
       
   945 	* @leave						The method will leave if an error occurs.
       
   946 
       
   947 	* @pre							This method can only be called after the
       
   948 	*                               hwdevice has been initialized with
       
   949 	*                               Initialize().
       
   950 	*/
       
   951 
       
   952 	virtual void GetTimedSnapshotL( TPictureData* aPictureData,
       
   953 			        const TUncompressedVideoFormat& aFormat,
       
   954 					const TTimeIntervalMicroSeconds& aPresentationTimestamp );
       
   955 
       
   956    /**
       
   957 	* Gets a copy of a specified picture.When the snapshot is available, it
       
   958 	* will be returned to the client using the TimedSnapshotComplete()
       
   959 	* callback. To cancel a timed snapshot request, use CancelTimedSnapshot().
       
   960 	* Only one timed snapshot request can be active at a time.
       
   961 
       
   962 	* @param aPictureData	Target picture. The memory for the picture must be
       
   963 	*                       allocated by the caller, and initialized properly.
       
   964 	*                       The data formats must match	the snapshot format
       
   965 	*                       requested. The picture must remain valid until
       
   966 							the snapshot has been taken or until the request
       
   967 							has been cancelled with CancelTimedSnapshot().
       
   968 	* @param aFormat		The picture format to use for the snapshot.
       
   969 	* @param aPictureId  	Picture identifier for the picture to copy. Used
       
   970 	*                       for the second method variant
       
   971 
       
   972 	* @leave				The method will leave if an error occurs.
       
   973 
       
   974 	* @pre					This method can only be called after the hwdevice
       
   975 	*                       has been initialized with Initialize().
       
   976 	*/
       
   977 	virtual void GetTimedSnapshotL( TPictureData* aPictureData,
       
   978 			                        const TUncompressedVideoFormat& aFormat,
       
   979 									const TPictureId& aPictureId );
       
   980 	/**
       
   981 	* Cancels a timed snapshot request
       
   982 
       
   983 	* @pre		This method can only be called after the hwdevice has been
       
   984 	*           initialized with Initialize().
       
   985 	*/
       
   986 	virtual void CancelTimedSnapshot();
       
   987 
       
   988    /**
       
   989 	* Gets a list of the supported snapshot picture formats.
       
   990 
       
   991 	* @param aFormats		An array for the result format list. The array
       
   992 	*                       must be created and destroyed by the caller
       
   993 
       
   994 	* @leave				The method will leave if an error occurs.
       
   995 
       
   996 	* @pre					This method can only be called after the hwdevice
       
   997 	*                       has been initialized with Initialize().
       
   998 	*/
       
   999 	virtual void GetSupportedSnapshotFormatsL(
       
  1000 			                     RArray<TUncompressedVideoFormat>& aFormats );
       
  1001 
       
  1002 	/**
       
  1003 	* Notifies the hardware device that the end of input data has been reached
       
  1004 	* and no more input data will be written. The hardware device can use this
       
  1005 	* signal to ensure that the remaining data gets processed, without waiting
       
  1006 	* for new data. After the remaining data has been processed, the hardware
       
  1007 	* device must notify call the proxy MdvppStreamEnd() callback.This method
       
  1008 	* is mainly useful for file-to-file conversions and other non-realtime
       
  1009 	* processing. For real-time playback all video pictures are processed or
       
  1010 	* discarded according to their timestamps.
       
  1011 
       
  1012 	* @pre		This method can only be called after the hwdevice has been
       
  1013 	*           initialized with Initialize().
       
  1014 	*/
       
  1015 	virtual void InputEnd();
       
  1016 
       
  1017 public:	// MProcessEngineObserver Function
       
  1018 
       
  1019    /**
       
  1020     * Callback from Engine to represent buffer has been consumed
       
  1021     * @param  aInp		pointer to the used input buffer
       
  1022     * @param  aError	error value
       
  1023     * @return			TInt KErrNone or KErrCancel
       
  1024     */
       
  1025 	virtual TInt InputBufferConsumed ( TAny* aInp, TInt aError );
       
  1026 
       
  1027    /**
       
  1028     * Callback to reprsent that output buffer is ready
       
  1029     * @param  aOup		pointer to the used input buffer
       
  1030     * @param  aError	error value
       
  1031     * @return TInt KErrNone or KErrCancel
       
  1032     */
       
  1033 	virtual TInt OutputBufferReady ( TAny* aOup, TInt aError );
       
  1034 
       
  1035    /**
       
  1036     * CallBack to handle error
       
  1037     * @return None
       
  1038     */
       
  1039 	virtual void FatalErrorFromProcessEngine ( TInt aError );
       
  1040 
       
  1041 	//Callback to indicate the completion of callback
       
  1042 	virtual void CommandProcessed ( TInt aCmd, TAny* aCmdData, TInt aError );
       
  1043 
       
  1044 public : // MMmfVideoBufferManagementObserver Functions
       
  1045 
       
  1046    /**
       
  1047     * Notifies the observer that one or more new input buffers are available.
       
  1048 	* The client can then use MmvbmGetBufferL() to get a buffer.
       
  1049     */
       
  1050 	virtual void MmvbmoNewBuffers() ;
       
  1051 
       
  1052    /**
       
  1053     * Notifies the observer all outstanding input buffers must be
       
  1054     * released immediately
       
  1055     */
       
  1056 	virtual void MmvbmoReleaseBuffers();
       
  1057 
       
  1058 public : //MCodedObserver Functions
       
  1059 
       
  1060    /**
       
  1061 	* Call back from the codec wrapper when there is new config information.
       
  1062 
       
  1063 	* @param	"None".
       
  1064 	*/
       
  1065     virtual void NewConfigFound ();
       
  1066 
       
  1067    /**
       
  1068  	* Call back from the codec wrapper when EInputConsumed for Not yet get I frame.
       
  1069 
       
  1070  	* @param	"None".
       
  1071  	*/
       
  1072     virtual void EInputConsumed();
       
  1073 
       
  1074 
       
  1075 protected:
       
  1076 
       
  1077    /**
       
  1078 	* Set the proxy implementation to be used. Called just after the object is
       
  1079 	* constructed.
       
  1080 
       
  1081 	* @param	aProxy	The proxy to use.
       
  1082 	*/
       
  1083 	virtual void SetProxy( MMMFDevVideoPlayProxy& aProxy );
       
  1084 
       
  1085 private:
       
  1086 	/**
       
  1087      * C++ default constructor.
       
  1088      */
       
  1089 	CAriMpeg4aspdecHwDevice();
       
  1090 
       
  1091 	/**
       
  1092      *  Symbian 2nd phase constructor .
       
  1093      */
       
  1094 	void ConstructL();
       
  1095 
       
  1096 	/**
       
  1097 	 *Creates o/p buffers based on the o/p formats supported
       
  1098 	 *@param  : None
       
  1099 	 */
       
  1100 	void CreateOutputBuffersL();
       
  1101 
       
  1102 	/**
       
  1103 	 * Gives call backs to clinet regarding slice and picture loss
       
  1104 	 * @param  : None
       
  1105 	 */
       
  1106 
       
  1107 	void SliceAndPictureLoss();
       
  1108 
       
  1109 	/**
       
  1110 	 * Allcotion and reallocation of input buffers
       
  1111 	 * @param  : None
       
  1112 	 */
       
  1113 
       
  1114 	void CreateInputBufferL( TUint aBufferSize, TBool aReallocate );
       
  1115 
       
  1116 	/**
       
  1117 	 * HandleInputEndInStopping
       
  1118 	 * @param  : None
       
  1119 	 */
       
  1120 	void HandleInputEndInStopping();
       
  1121 
       
  1122 	/**
       
  1123 	 * Function to get the last frame
       
  1124 	 * @param  : None
       
  1125 	 */
       
  1126 	void GetLastFrame();
       
  1127 
       
  1128 
       
  1129 private : //	Data
       
  1130 
       
  1131 
       
  1132 	// Reference to Input Free Buffer Queue
       
  1133 	RArray<TVideoInputBuffer*>		iInputFreeBufferQueue;
       
  1134 
       
  1135 	// Free Input Buffers
       
  1136 	TVideoInputBuffer*				iInputFreeBuffers;
       
  1137 
       
  1138 	// Reference to Output Device
       
  1139 	CMMFVideoPostProcHwDevice*		iOutputDevice;
       
  1140 
       
  1141 	// Reference to Proxy Object
       
  1142 	MMMFDevVideoPlayProxy*			iMMFDevVideoPlayProxy;
       
  1143 
       
  1144 	// Represents the state of the Decoder Hw Device
       
  1145 	CStateMachine					*iState;
       
  1146 
       
  1147 	// Reference to Video Picture Header
       
  1148 	TVideoPictureHeader*			iVideoPictureHeader;
       
  1149 
       
  1150 	// Current Decoding Position
       
  1151 	TTimeIntervalMicroSeconds		iDecodingPosition;
       
  1152 
       
  1153 	//	Handle to the Compressed video format
       
  1154 	CCompressedVideoFormat*			iInputFormat;
       
  1155 
       
  1156 	//	Uncompressed Output format
       
  1157 	TUncompressedVideoFormat		iOutputFormat;
       
  1158 
       
  1159 	// Buffer Options Set by the Client
       
  1160 	CMMFDevVideoPlay::TBufferOptions		iBufferOptions;
       
  1161 
       
  1162 	// Current Picture Counter value
       
  1163 	CMMFDevVideoPlay::TPictureCounters		iPictureCounters;
       
  1164 
       
  1165 	// Current Bit Stream Counter value
       
  1166 	CMMFDevVideoPlay::TBitstreamCounters	iBitstreamCounters;
       
  1167 
       
  1168 	// Codec Reference
       
  1169 	CAriMpeg4aspdecWrapper*					iCodec;
       
  1170 
       
  1171 	//	Base Process Engine Reference
       
  1172 	CBaseEngine*				iEngine;
       
  1173 
       
  1174 	// To Check whether inputend is called or not
       
  1175 	TBool						iInputEndCalled;
       
  1176 
       
  1177 	// OutPut  Buffers
       
  1178 	TVideoPicture*				iOutputFreeBuffer;
       
  1179 
       
  1180 	// Free OutPut Buffer Queue
       
  1181 	RArray<TVideoPicture*>		iOutputFreeBufferQueue;
       
  1182 
       
  1183 	// counter to keep track of the no of buffers added to the engine
       
  1184 	TInt						iFilledBufferCounter;
       
  1185 
       
  1186 	// data unit type set by the client
       
  1187 	TVideoDataUnitType			iDataUnitType;
       
  1188 
       
  1189 	// Encapulation set by the client
       
  1190 	TVideoDataUnitEncapsulation iEncapsulation;
       
  1191 
       
  1192 	// represents the o/p buffer size
       
  1193 	TInt						iOutputBufferSize;
       
  1194 
       
  1195 	// flag to whether o/p buffers created or not
       
  1196 	TBool						iOutputBuffersCreated;
       
  1197 
       
  1198 	// Picture Number
       
  1199 	TUint						iPictureNumber;
       
  1200 
       
  1201 	// represents the number of inputbuffers created so avoids reallocation
       
  1202 	TUint						iNumberOfInputBuffersAllocated;
       
  1203 
       
  1204 	// Reference to the custom buffer interface
       
  1205 	MMmfVideoBufferManagement*	iCustomBufferHandle;
       
  1206 
       
  1207 	// buffer options for the custom interface
       
  1208 	MMmfVideoBufferManagement::TBufferOptions *iCustomBufferOptions;
       
  1209 
       
  1210 	// represents whether the o/p buffers should be added to engine or not
       
  1211 	TBool 						iBufferAdded;
       
  1212 
       
  1213     // flag to indciate that ConfigureDecoderL is called
       
  1214 	TBool						iConfigureDecoderCalled;
       
  1215 
       
  1216 	// flag to indciate that decoder has been configured
       
  1217 	TBool						iDecoderConfigured;
       
  1218 
       
  1219 	// flag to indicate EOS reached
       
  1220 	TInt						iInputBufferConsumedCounter;
       
  1221 
       
  1222 	//Flag to indicate that the last input frame has generated an output
       
  1223 	TBool 						iNoLastOut;
       
  1224 
       
  1225 	// array which holds the list of supported formats
       
  1226 	RArray<CCompressedVideoFormat*> iSupportedFormats;
       
  1227 
       
  1228 	// array which holds the max value of the picture rates
       
  1229 	RArray<TPictureRateAndSize> iMaxPictureRates;
       
  1230 };
       
  1231 
       
  1232 #endif //__MP4DECHWDEVICE_H__