mp4asp_dec/arimpeg4aspdecwrapper/export_hdr/arimpeg4aspdecwrapper.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 the Mpeg4Asp Decoder wrapper Implementation.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef ARIMPEG4ASPDECWRAPPER_H
       
    20 #define ARIMPEG4ASPDECWRAPPER_H
       
    21 
       
    22 //System includes
       
    23 #include <e32def.h>
       
    24 #include <e32base.h>
       
    25 #include <devvideoconstants.h>
       
    26 
       
    27 //User includes
       
    28 #include "aribasecodec.h"
       
    29 #include "ariprint.h"
       
    30 
       
    31 const TInt KMaxFrameWidth			= 640;//should be 1280 for enabling 720P decoding;
       
    32 const TInt KMaxFrameHeight			= 480;//should be 720 for enabling 720P decoding;
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class TUncompressedVideoFormat;
       
    36 class TVideoInputBuffer;
       
    37 class TVideoPictureHeader;
       
    38 
       
    39 /**
       
    40  *	Class MCodecObserver
       
    41  *  whenever a new configuration information finds in the file, ti should
       
    42  *  be informated to the hwdevice. so that it will delete the existing
       
    43  *  codec object and wil create a new object and configures the codec with
       
    44  *  the new configuration information.
       
    45  */
       
    46 
       
    47 class MCodecObserver
       
    48 	{
       
    49 	public:
       
    50 		/**
       
    51 		 * Callback to inform the HW device when there is new config.
       
    52 		 * @return "None"
       
    53 		 */
       
    54 		virtual void NewConfigFound()=0;
       
    55 
       
    56 		/**
       
    57 		 * Callback to inform the HW device when there is new config.
       
    58 		 * @return "None"
       
    59 		 */
       
    60 		virtual void EInputConsumed()=0;
       
    61 	};
       
    62 /**
       
    63  *	Class CCodecInterface
       
    64  *	This class is base class whish is part of Aricent's Mpeg4 ASP/H263 decoder wrapper
       
    65  *	used by the Mpeg4 ASP/H263. This HwDevice Plugin to decode Mpeg4 ASP/H263 content to
       
    66  *	yuv420.
       
    67  *
       
    68  */
       
    69 class CAriMpeg4aspdecWrapper: public MBaseCodec, public CBase
       
    70 	{
       
    71 	public:// Constructor and Destructor
       
    72 
       
    73 		/**
       
    74 		 * Two-phased constructor.
       
    75 		 * @return pointer to an instance of CAriMpeg4aspdecWrapper
       
    76 		 */
       
    77 		IMPORT_C static CAriMpeg4aspdecWrapper* NewL(
       
    78 				                                  MCodecObserver* aObserver );
       
    79 
       
    80 		/**
       
    81 		 * Destructor
       
    82 		 */
       
    83 		virtual ~CAriMpeg4aspdecWrapper();
       
    84 
       
    85 
       
    86 	public:// MBaseCodec functions
       
    87 
       
    88 		/**
       
    89 		* Retrieves a custom interface to the specified hardware device
       
    90 
       
    91 		* @param	aInpBuf	Coded input data passed by Engine.
       
    92 		* @param	aOutBuf	Decoded output data.
       
    93 
       
    94 		* @leave	"The method will leave if an error occurs".
       
    95 
       
    96 		* @return	one of the TCodecState
       
    97 		*/
       
    98 		virtual TInt DoProcessL( TAny *aInpBuf, TAny* aOutBuf = NULL ) = 0;
       
    99 
       
   100 		/**
       
   101 		 * Resets the Decoder
       
   102 		 * @return None
       
   103 		 */
       
   104 		virtual void Reset() = 0;
       
   105 
       
   106     public: // New Functions
       
   107   	   /**
       
   108   		* Common API to set the values to the decoder.
       
   109   		* @param	aCommand	indicates the action to do.
       
   110   		* @param	aCmdData	Any input data required
       
   111 
       
   112   		* @leave	"The method will leave if an error occurs".
       
   113   		*/
       
   114 		virtual TInt SetParam( TInt aCommand, TAny* aCmdData ) = 0;
       
   115 
       
   116 	   /**
       
   117 		* Common API to get the values to the decoder.
       
   118 		* @param	aCommand	indicates the action to do.
       
   119 		* @param	aCmdData	Any output data required
       
   120 
       
   121 		* @leave	"The method will leave if an error occurs".
       
   122 		*/
       
   123 		virtual TInt GetParam( TInt aCommand, TAny* aCmdData ) = 0;
       
   124 		/**
       
   125 		* Returns the stream information and creates the decoder
       
   126 		* @param	aInpBuf	Coded input data.
       
   127 		* @param	aOutBuf	Decoded output data.
       
   128 
       
   129 		* @leave	The method will leave if an error occurs.
       
   130 		*/
       
   131 		virtual void SetFormatsL( TVideoDataUnitType &aInputFormat,
       
   132                                 TUncompressedVideoFormat &aOutputFormat ) = 0;
       
   133 
       
   134 		/**
       
   135 		* Configure the decoder using the stream passed
       
   136 		* @param	aInpBuf	Coded input data.
       
   137 
       
   138 		* @leave	The method will leave if an error occurs.
       
   139 		*/
       
   140         virtual void ConfigDecoderL( const TDesC8* aInpBuf ) = 0;
       
   141 
       
   142         /**
       
   143 		* Returns the length of the ouput frame
       
   144         * @return
       
   145 
       
   146 		* @leave	The method will leave if an error occurs.
       
   147 		*/
       
   148 		virtual TInt GetOutputBufferLength() = 0;
       
   149 
       
   150 		/**
       
   151 		* Gets the slice loss information
       
   152 		* @param aFirstMacroBlock
       
   153 		* @param aNumMacroBlocks
       
   154 		*/
       
   155 		virtual void GetSliceLossInfo( TUint& aFirstMacroblock,
       
   156 				                       TUint& aNumMacroblocks ) = 0;
       
   157 
       
   158 		/**
       
   159 		* Gets the picture Loss Information
       
   160 		* @return percentage value
       
   161 		*/
       
   162 		virtual TUint GetPictureLossInfo() = 0;
       
   163 
       
   164 		/**
       
   165 		* Gets the Last frame
       
   166 		* @return none
       
   167 		*/
       
   168 		virtual TInt GetLastFrame( TAny* aOutput ) = 0;
       
   169 
       
   170 		/**
       
   171 		* Gets the header info
       
   172 		* @param	aDataUnit	Input stream data.
       
   173 		* @param	aHeaderPtr  Output header information returned.
       
   174 
       
   175 		* @leave	The method will leave if an error occurs
       
   176                     KErrArgument  - input data is null or zero length
       
   177                     KErrCorrupt   - input stream is corrupt
       
   178                     KErrUnderflow - input stream is insufficient.
       
   179 		*/
       
   180 		IMPORT_C
       
   181 		static void  GetHeaderInfoL( TVideoInputBuffer& aDataUnit,
       
   182                                     TVideoPictureHeader& aHeaderPtr );
       
   183 	};
       
   184 
       
   185 #endif //ARIMPEG4ASPDECWRAPPER_H