mmserv/thumbnailengine/TneProcessorInc/TNEProcessorImpl.h
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Header file for TNE processor implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef     __TNEPROCESSORIMPL_H__
       
    21 #define     __TNEPROCESSORIMPL_H__
       
    22 
       
    23 #ifndef __E32BASE_H__
       
    24 #include <e32base.h>
       
    25 #endif
       
    26 
       
    27 #include "TNEDecoderWrap.h"
       
    28 #include "parser.h"
       
    29 #include "mp4parser.h"
       
    30 #include "TNEVideoClipInfoImp.h"
       
    31 
       
    32 #include <TNECommon.h>
       
    33 
       
    34 //  FORWARD DECLARATIONS
       
    35 class CMP4Parser;
       
    36 class CDisplayChain;
       
    37 
       
    38 // used in image insertion
       
    39 enum TVideoOperation  
       
    40 {
       
    41     EVideoEncodeFrame = 0,
       
    42     EVideoWriteFrameToFile
       
    43 };
       
    44 		
       
    45 // video frame parameters
       
    46 struct TFrameParameters
       
    47 {	
       
    48 	TInt64 iTimeStamp;
       
    49 	TUint8 iType;	
       
    50 };
       
    51    
       
    52 
       
    53 // Logging path
       
    54 _LIT( KTNEModuleLogPath, "\\logs\\testframework\\TNEModule\\" ); 
       
    55 // Log file
       
    56 _LIT( KTNEModuleLogFile, "TNEEngine.txt" ); 
       
    57 
       
    58 
       
    59 //  CLASS DEFINITIONS
       
    60 class CTNEProcessorImpl : public CActive, public MThumbnailObserver
       
    61 {
       
    62 public:
       
    63 
       
    64     // Error codes
       
    65     enum TErrorCode
       
    66     {
       
    67         EInvalidProcessorState = -1000,
       
    68         EUnsupportedFormat = -1001,
       
    69         EVideoTooLarge = -1002,                                
       
    70         EStreamCorrupted = -1003,        
       
    71         EInvalidStreamData = -1004,
       
    72         EInvalidInternalState = -1050
       
    73         // Also error codes <EInvalidInternalState may be returned, they can be
       
    74         // considered fatal internal errors.
       
    75     };
       
    76 
       
    77     // Input data format
       
    78     enum TFileFormat
       
    79     {    
       
    80         EData3GP,  // 3GP
       
    81         EDataAutoDetect // autodetect type
       
    82     };    
       
    83 
       
    84 public:
       
    85 
       
    86     struct TStreamParameters
       
    87     {
       
    88         TUint iWidth;
       
    89         TUint iHeight;
       
    90         TInt64 iPicturePeriodNsec;
       
    91         TUint iIntraFrequency;
       
    92         TUint iReferencePicturesNeeded; // 0 = disable RPS
       
    93         TUint iNumScalabilityLayers;
       
    94         TUint iLayerFrameRates[8]; // frames per 256 sec
       
    95     };
       
    96     
       
    97 public:  // Functions from base classes
       
    98 
       
    99     /**
       
   100     * From CActive Active object running method
       
   101     */
       
   102     void RunL();
       
   103 
       
   104     /**
       
   105     * From CActive Active object cancelling method
       
   106     */    
       
   107     void DoCancel();
       
   108 
       
   109     /**
       
   110     * From CActive Active Error handling method
       
   111     */    
       
   112     TInt RunError(TInt aError);
       
   113     
       
   114     /**
       
   115     * From MThumbnailObserver. 
       
   116     * Notifies the client that the thumbnail is available
       
   117     * @param none
       
   118     * @return error code
       
   119     */
       
   120     void MNotifyThumbnailReady(TInt aError);
       
   121 
       
   122     /**
       
   123     * From MThumbnailObserver. 
       
   124     * noties the client tha decoded frame is ready
       
   125     * @param none
       
   126     * @return none
       
   127     */
       
   128     void MPictureFromDecoder(TVideoPicture* aPicture);
       
   129     
       
   130 
       
   131     /**
       
   132     * From MThumbnailObserver. 
       
   133     * Returns media bitstream buffer to the client
       
   134     * @param none
       
   135     * @return none
       
   136     */
       
   137     void MReturnCodedBuffer(TVideoBuffer* aBuffer);
       
   138 
       
   139     /**
       
   140     * From MThumbnailObserver. 
       
   141     * Request for more buffers from decoder
       
   142     * @param none
       
   143     * @return none
       
   144     */
       
   145     void MSendEncodedBuffer();
       
   146     
       
   147 
       
   148 public:  // New functions
       
   149 	
       
   150     /** 
       
   151      * Constructors for instantiating new video processors.
       
   152      * Should reserve as little resources as possible at this point.
       
   153 	 */
       
   154 	static CTNEProcessorImpl* NewL();
       
   155 	static CTNEProcessorImpl* NewLC();
       
   156 	
       
   157 	/** 
       
   158 	 * Destructor can be called at any time (i.e., also in the middle of a processing operation)
       
   159 	 * Should release all allocated resources, including releasing all allocated memory and 
       
   160 	 * *deleting* all output files that are currently being processed but not yet completed.
       
   161 	 */
       
   162 	virtual ~CTNEProcessorImpl();
       
   163 		
       
   164 	
       
   165 	/**
       
   166 	 * Do all initializations necessary to start generating a thumbnail, e.g. open files, 
       
   167 	 * allocate memory. The video clip file should be opened with EFileShareReadersOnly 
       
   168 	 * share mode. The thumbnail should be scaled to the specified resolution and 
       
   169 	 * converted to the specified display mode. If this method leaves, destructor should be called to free 
       
   170 	 * allocated resources.
       
   171 	 * 
       
   172 	 * Possible leave codes:
       
   173 	 *	- <code>KErrNoMemory</code> if memory allocation fails
       
   174 	 *	- <code>KErrNotFound</code> if there is no file with the specified name
       
   175 	 *    in the specified directory (but the directory exists)
       
   176 	 *	- <code>KErrPathNotFound</code> if the specified directory
       
   177 	 *    does not exist
       
   178 	 *	- <code>KErrUnknown</code> if the specified file is of unknown format
       
   179 	 *  - <code>KErrNotSupported</code> if the specified combination of parameters
       
   180 	 *                                  is not supported
       
   181 	 *
       
   182 	 * @param aFileHandle  file handle to the clip from which to generate the thumbnail 
       
   183      * @param aIndex       Frame index for selecting the thumbnail frame
       
   184      *                     -1 means the best thumbnail is retrieved
       
   185  	 * @param aResolution  resolution of the desired thumbnail bitmap, or
       
   186 	 *                     <code>NULL</code> if the thumbnail should be
       
   187 	 *                     in the original resolution
       
   188 	 * @param aDisplayMode desired display mode; or <code>ENone</code> if 
       
   189 	 *                     any display mode is acceptable
       
   190 	 * @param aEnhance	   apply image enhancement algorithms to improve
       
   191 	 *                     thumbnail quality; note that this may considerably
       
   192 	 *                     increase the processing time needed to prepare
       
   193 	 *                     the thumbnail
       
   194 	 */
       
   195 	void StartThumbL(RFile& aFileHandle, TInt aIndex, TSize aResolution, 
       
   196 		TDisplayMode aDisplayMode, TBool aEnhance);		
       
   197 	
       
   198 	/**
       
   199 	 * Starts thumbnail generation. Thumbnail generation is an asynchronous operation,
       
   200 	 * and its completion is informed to the caller via Active object request completion;
       
   201 	 * the iStatus member of the caller is passed as a parameter to this method.
       
   202 	 *
       
   203 	 * This method may leave if an error occurs in initiating the thumbnail generation.	
       
   204 	 * If this method leaves, destructor should be called to free allocated resources.	
       
   205 	 * 
       
   206 	 * @param aStatus     Reference to caller's iStatus member variable
       
   207 	 *
       
   208 	 * @return  
       
   209 	 *          
       
   210 	 */
       
   211 	void ProcessThumbL(TRequestStatus &aStatus);
       
   212 
       
   213 	/**
       
   214 	 * Decodes the encoded frame for thumbnail generation. Thumbnail generation is an asynchronous operation,
       
   215 	 * and its completion is informed to the caller via Active object request completion;
       
   216 	 * the iStatus member of the caller is passed as a parameter to this method.
       
   217 	 *
       
   218 	 * This method may leave if an error occurs in initiating the thumbnail generation.	
       
   219 	 * If this method leaves, destructor should be called to free allocated resources.	
       
   220 	 * 
       
   221 	 * @param aStatus     Reference to caller's iStatus member variable
       
   222 	 *
       
   223 	 * @return  
       
   224 	 *          
       
   225 	 */
       
   226 	void DecodeThumb(TBool aFirstFrame);
       
   227 
       
   228 	 /** 
       
   229 	 * Method for retrieving the completed thumbnail bitmap.
       
   230 	 * 
       
   231 	 * Video processor should not free the CFbsBitmap instance after it has passed it on 
       
   232 	 * as a return value of this function 
       
   233 	 *	 
       
   234 	 */
       
   235 	void FetchThumb(CFbsBitmap*& aThumb);
       
   236 	
       
   237 	/**
       
   238 	 * Read clip header from the specified file and return its properties.	 
       
   239 	 * This method should leave if clip is invalid, cannot be opened, etc.
       
   240 	 *
       
   241 	 * @param aFileHandle  file handle to the file for reading
       
   242 	 * @param aVideoFormat  for returning the video format
       
   243      * @param aVideoType Type of video data
       
   244 	 * @param aResolution  for returning the resolution
       
   245      * @param aVideoFrameCount Number of video frames in the clip	 
       
   246 	 */
       
   247 	void GetClipPropertiesL(RFile& aFileHandle, TTNEVideoFormat& aFormat,
       
   248 		                    TTNEVideoType& aVideoType, TSize& aResolution,
       
   249 		                    TInt& aVideoFrameCount);	
       
   250 
       
   251     /**
       
   252      * Enhances the visual quality of the frame
       
   253      *     
       
   254      */				
       
   255 	void EnhanceThumbnailL(const CFbsBitmap* aInBitmap, CFbsBitmap* aTargetBitmap); 
       
   256 
       
   257 
       
   258 	/**
       
   259 	* Get the file name of the clip
       
   260 	*     
       
   261 	* @return File name of the clip
       
   262 	*/				
       
   263 	inline TFileName GetClipFileName() const { return iClipFileName; }
       
   264 
       
   265     /**
       
   266      * Get number of frames in  clip
       
   267      *     
       
   268      * @return Number of frames in clip
       
   269      */
       
   270     inline TInt GetClipNumberOfFrames() const { return iParser->GetNumberOfFramesInClip(); }	
       
   271 	
       
   272 	/**
       
   273      * Get the timescale of the current video clip
       
   274      *     
       
   275      * @return Timescale
       
   276      */
       
   277 	inline TInt GetVideoClipTimeScale() const { return iParser->iStreamParameters.iVideoTimeScale; }
       
   278 
       
   279 
       
   280     /**
       
   281      * Get video frame index based on timestamp
       
   282      *
       
   283      * @param aTime Frame timestamp in microseconds
       
   284      * @return Frame index
       
   285      */    
       
   286     TInt GetVideoFrameIndex(TTimeIntervalMicroSeconds aTime) const;
       
   287 
       
   288     /**
       
   289      * Get frame index for the first frame in current clip
       
   290      *
       
   291      * @param aTime Timestamp in microseconds
       
   292      * @return Frame index
       
   293      */
       
   294     inline TInt GetStartFrameIndex() const { return iStartThumbIndex; }
       
   295 
       
   296     /**
       
   297      * Get frame type at specified index
       
   298      *
       
   299      * @param aIndex Frame index
       
   300      * @return Frame type
       
   301      */
       
   302     inline TInt8 GetVideoFrameType(TInt aIndex) const { return iParser->GetVideoFrameType(aIndex); };
       
   303 
       
   304 	/**
       
   305      * Retrieve a video YUV frame from the tmp file
       
   306      * @param aBuf Descriptor containing the YUV frame
       
   307      * @param aLength Length of the descriptor
       
   308      * @param aDuration The frame duration
       
   309      * @param aTimeStamp The frame timestamp
       
   310      * @return Error code
       
   311      */
       
   312     TInt GetVideoFrameFromFile(TDes8& aBuf, TInt aLength, TInt& aDuration, TInt64& aTimeStamp);
       
   313 
       
   314 	/**
       
   315      * Get the next frame duration and timestamp
       
   316      * @param aDuration The frame duration
       
   317      * @param aTimeStamp The frame timestamp
       
   318      * @param aIndex Index of timestamp to get
       
   319      * @param aTimeStampOffset Offset for timestamp
       
   320      * @return Error code
       
   321      */
       
   322     void GetNextFrameDuration(TInt& aDuration, TInt64& aTimeStamp, TInt aIndex, TInt& aTimeStampOffset);
       
   323 
       
   324 	/**
       
   325      * Get the resolution of the current video clip
       
   326      *          
       
   327      * @return resolution
       
   328      */
       
   329 	TSize GetVideoClipResolution();
       
   330 	
       
   331     /**
       
   332      * Get video timestamp in ms from timestamp in ticks
       
   333      *
       
   334      * @param aTimeStampInTicks Time in ticks
       
   335      * @param aCommonTimeScale ETrue for using the output time scale
       
   336      *                         EFalse for using the scale of current clip
       
   337      * @return Timestamp in milliseconds
       
   338      */        
       
   339     TInt64 GetVideoTimeInMsFromTicks(TInt64 aTimeStampInTicks, TBool aCommonTimeScale) const;    
       
   340     
       
   341     /**
       
   342      * Stops processing
       
   343      *
       
   344      * @return Error code
       
   345      */
       
   346 	TInt Stop();    
       
   347 
       
   348     /**
       
   349      * Stops processing and closes all submodules except status monitor & video encoder
       
   350      *
       
   351      * @return Error code
       
   352      */
       
   353     TInt Close();
       
   354 
       
   355     /**
       
   356     * Checks if a frame has "good" or "legible" quality
       
   357     *
       
   358     * @param aYUVDataPtr Pointer to the frame to be checked
       
   359     *
       
   360     * @return 1 if frame quality is OK, 0 otherwise
       
   361     */
       
   362     TInt CheckFrameQuality(TUint8* aYUVDataPtr);
       
   363 
       
   364     /**
       
   365      * Gets the average frame rate of current video clip
       
   366      *
       
   367      * @return Frame rate
       
   368      */
       
   369     TReal GetVideoClipFrameRate();
       
   370 								
       
   371 private: // Constants
       
   372 	
       
   373 	// state	
       
   374     enum TProcessorState
       
   375     {
       
   376         EStateIdle = 0,		
       
   377         EStateOpened,   // clip is open at the decoder (?)
       
   378         EStatePreparing,
       
   379         EStateReadyToProcess,
       
   380         EStateProcessing        
       
   381     };
       
   382 	
       
   383 	
       
   384 	// Video types
       
   385 	enum TVideoType
       
   386 	{
       
   387 		EVideoNone = 0,
       
   388 		EVideoH263Profile0Level10,
       
   389 		EVideoH263Profile0Level45,
       
   390 		EVideoMPEG4
       
   391 	};
       
   392 	
       
   393 	// Multiplex types
       
   394 	enum TMuxType
       
   395 	{
       
   396         EMuxNone = 0,
       
   397 		EMux3GP		
       
   398 	};     
       
   399 
       
   400     enum TDataFormat
       
   401     {
       
   402         EDataUnknown = 0,
       
   403         EDataH263,
       
   404         EDataMPEG4,
       
   405         EDataAVC
       
   406     };
       
   407     
       
   408 private:
       
   409 
       
   410     /**
       
   411     * By default Symbian OS constructor is private.
       
   412 	*/
       
   413     void ConstructL();
       
   414 
       
   415     /**
       
   416     * c++ default constructor
       
   417 	*/
       
   418     CTNEProcessorImpl();    
       
   419     
       
   420     /**
       
   421      * Opens a 3gp clip for processing
       
   422      *
       
   423      * @param aFileName Clip filename
       
   424      * @param aDataFormat Clip file format
       
   425      *
       
   426      * @return Error code
       
   427      */
       
   428 	TInt OpenStream(RFile& aFileHandle, TFileFormat aDataFormat);
       
   429 
       
   430     /**
       
   431      * Closes the processed clip from parser
       
   432      *
       
   433      * @return Error code
       
   434      */
       
   435 	TInt CloseStream();
       
   436 
       
   437     /**
       
   438      * Prepares the processor for processing a movie
       
   439      *
       
   440      * @return Error code
       
   441      */
       
   442 	TInt Prepare();
       
   443     
       
   444     /**
       
   445      * Deletes objects used in processing
       
   446      *     
       
   447      */
       
   448     void DoCloseVideoL();
       
   449 
       
   450 	/**
       
   451      * Sets output audio & video formats
       
   452      *          
       
   453      */
       
   454 	void SetOutputMediaTypesL();
       
   455 
       
   456 	/**
       
   457      * Gets bitstream modes of input clips
       
   458      *          
       
   459      */
       
   460 	void GetTranscodeFactorsL();
       
   461 
       
   462 	/**
       
   463      * Sets video transcoding parameters
       
   464      *          
       
   465      */
       
   466 	void SetupTranscodingL();
       
   467 
       
   468     /**
       
   469      * Resets variables used in processing
       
   470      *          
       
   471      */
       
   472     void Reset();
       
   473 
       
   474     /**
       
   475      * Sets suitable default values for parameters
       
   476      *          
       
   477      */
       
   478     void SetHeaderDefaults();
       
   479 
       
   480     /**
       
   481      * Parses the clip header
       
   482      *
       
   483      * @param aStreamParams Destination structure for stream parameters
       
   484      * @param Filename of the clip
       
   485      *          
       
   486      */
       
   487 	void ParseHeaderOnlyL(CParser::TStreamParameters& aStreamParams, RFile& aFileHandle); 
       
   488 
       
   489     /**
       
   490      * Copies stream parameters from source to destination structure
       
   491      *
       
   492      * @param aDestParameters Destination structure
       
   493      * @param aSrcParameters Source structure     
       
   494      *          
       
   495      */
       
   496 	void UpdateStreamParameters(CParser::TStreamParameters& aDestParameters, 
       
   497 		CParser::TStreamParameters& aSrcParameters);    
       
   498 	
       
   499     /**
       
   500      * Parse the clip header & update internal variables accordingly
       
   501      *     
       
   502      */
       
   503 	void ParseHeaderL();	
       
   504     
       
   505     /**
       
   506      * Initializes the processor for the next clip to be processed,
       
   507      * called for each clip    
       
   508      */
       
   509 	void InitializeClipL(RFile& aFileHandle);
       
   510 
       
   511     
       
   512     /**
       
   513      * Reports an error in thumbnail generator
       
   514      * to the caller
       
   515      *
       
   516      * @return ETrue if error was reported, EFalse otherwise
       
   517      */
       
   518     TBool HandleThumbnailError(TInt aError);
       
   519     
       
   520     /**
       
   521      * Create and Initialize the decoder 
       
   522      */
       
   523 	void CreateAndInitializeDecoderL();
       
   524 
       
   525     /**
       
   526      * Parse the clips mime type 
       
   527      */
       
   528 	void ParseMimeTypeL();
       
   529 
       
   530     /**
       
   531      * Get the video frame format 
       
   532      */
       
   533 	TInt GetFrameL();
       
   534 
       
   535     /**     
       
   536      * Writes a buffered frame to output file
       
   537      *
       
   538      * @return Error code
       
   539      */
       
   540     TInt ReadVideoFrame();
       
   541 
       
   542     /** 
       
   543      * CTNEProcessorImpl::ReadAndUpdateFrame
       
   544      * Reads a frame from input queue to internal buffer
       
   545      * (other items were commented in a header).
       
   546      */			
       
   547      TInt ReadAndUpdateFrame(); 
       
   548 
       
   549 private:  // Data
       
   550 
       
   551     // current processor state
       
   552 	TProcessorState iState; 
       
   553 
       
   554      // current stream data format	
       
   555 	TFileFormat iFileFormat;
       
   556 
       
   557 	// stream start reading buffer
       
   558 	TUint8 *iReadBuf; 
       
   559     // buffer length
       
   560 	TUint iBufLength; 
       
   561 
       
   562 	// wait scheduler
       
   563     CActiveSchedulerWait *iWaitScheduler;
       
   564     TBool iWaitSchedulerStarted;
       
   565 
       
   566     // Filename of the current clip
       
   567     TFileName iClipFileName;
       
   568 
       
   569     // Thumbnail resolution
       
   570 	TSize iOutputThumbResolution;    
       
   571 	// Thumbnail index
       
   572 	TInt iThumbIndex; 
       
   573 	// Thumbnail display mode
       
   574 	TDisplayMode iThumbDisplayMode; 
       
   575 	// Thumbnail enhance
       
   576 	TBool iThumbEnhance; 
       
   577 
       
   578 	// Flag for indicating decoder wrapper state
       
   579 	TBool iDecoderInitPending;	
       
   580 
       
   581 //******************************************
       
   582 	
       
   583 	// data buffer for the current compressed frame
       
   584     TUint8 *iDataBuffer;  
       
   585     // buffer total length
       
   586     TUint iBufferLength; 
       
   587     // amount of data in buffer
       
   588     TUint iDataLength; 
       
   589     // current stream data format	
       
   590 	TDataFormat iDataFormat;
       
   591 	// length of the current frame in the buffer
       
   592     TUint iCurrentFrameLength;
       
   593     
       
   594     // for searching a good thumbnail 
       
   595     TInt iFramesToSkip;
       
   596     
       
   597     // number of frame skip cycles done to get a good thumbnail  
       
   598     TInt iNumThumbFrameSkips;  
       
   599     
       
   600     // is decode in progress ?                              
       
   601 	TBool iDecodePending;  
       
   602 
       
   603 	// timestamp of previous frame
       
   604     TTimeIntervalMicroSeconds iPreviousTimeStamp; 
       
   605 
       
   606      // the video decoder
       
   607     CTNEDecoderWrap *iDecoder;
       
   608 
       
   609 	// CCMR media buffer sent to decoder
       
   610 	TVideoBuffer* iMediaBuffer;	
       
   611 
       
   612 	// Concatenated YUV data for decoded frame
       
   613     TUint8 *iFrameBuffer;  
       
   614     
       
   615 	// are we decoding?
       
   616     TBool iDecoding; 
       
   617 
       
   618     // Input mimetype
       
   619     TBufC8<256> iMimeType;
       
   620     // Short mimetype
       
   621     TBufC8<256> iShortMimeType;
       
   622 
       
   623 	// Codec level
       
   624 	TInt iCodecLevel;
       
   625 	// Input codec
       
   626 	TInt iCodec;
       
   627 	// Input Max Bit Rate
       
   628 	TUint iMaxBitRate;
       
   629 	
       
   630 	// AVC Stuff
       
   631 	// number of bytes representing the NalUnitLength
       
   632 	TInt iNalUnitBytes;
       
   633 	
       
   634 //***********************************************	
       
   635 
       
   636 
       
   637 	// True if processing has been cancelled
       
   638 	TBool iProcessingCancelled;
       
   639 
       
   640 	// timestamp for encoding ending black frames
       
   641 	TTimeIntervalMicroSeconds iTimeStamp;
       
   642 
       
   643     // stream duration: max. of audio,video
       
   644 	TInt64 iVideoClipDuration;
       
   645 
       
   646     // output video buffer for one frame
       
   647     HBufC8 *iOutVideoBuffer;
       
   648 
       
   649     // Is there a frame in buffer ?
       
   650     TBool iFrameBuffered;
       
   651 
       
   652     // Timestamp of buffered frame
       
   653     TInt64 iBufferedTimeStamp;
       
   654 
       
   655     // key frame info of buffered frame
       
   656     TBool iBufferedKeyFrame;
       
   657 
       
   658     TBool iFirstFrameBuffered;
       
   659 
       
   660     // Are we processing a thumbnail ?
       
   661 	// TBool iThumbnailInProgress; 
       
   662 		
       
   663     // index of the first frame in clip
       
   664     TInt iStartThumbIndex;	
       
   665 
       
   666 	// @@ YHK HARI 
       
   667 	TInt iAVCDecodedFrameNumber;
       
   668 	TBool iThumbFrameDecoded;
       
   669 
       
   670     // buffer pointers for thumbnail generation
       
   671     TUint8* iYuvBuf;
       
   672     TUint8* iRgbBuf;
       
   673 
       
   674 	// for storing the converted YUV image in generation case
       
   675 	TUint8 *iYuvImageBuf; 
       
   676 
       
   677 	// flag for reseting the encoder to encode an intra frame
       
   678 	TBool iIntraResetRequest;
       
   679 	
       
   680 	TInt iMP4SpecificSize; 
       
   681 
       
   682 	// Is it the first frame of a clip
       
   683     TBool iFirstFrameOfClip;
       
   684 
       
   685     // for setting the first frame flag
       
   686     // when doing wipe/crossfade transitions
       
   687     TBool iFirstFrameFlagSet;
       
   688 
       
   689     TInt iVideoFrameNumber;
       
   690     TInt iVideoIntraFrameNumber;
       
   691 
       
   692 
       
   693     // MPEG-4 VOS size 
       
   694     TInt iOutputMpeg4VosSize;
       
   695     
       
   696 // @@ YHK demux
       
   697     // the demultiplexer    
       
   698 //    CDemultiplexer *iDemux; 
       
   699 
       
   700     // the video decoder input queue
       
   701 //    CActiveQueue *iVideoQueue; 
       
   702     
       
   703      // file format parser
       
   704     CMP4Parser *iParser;   
       
   705     
       
   706     // frame enhancement
       
   707     CDisplayChain *iEnhancer;  
       
   708 
       
   709     // does the stream have video?
       
   710     TBool iHaveVideo; 
       
   711     // video stream type
       
   712 	TVideoType iVideoType; 
       
   713 	
       
   714     // is the stream multiplexed?
       
   715 	TBool iIsMuxed; 
       
   716     // multiplex type					
       
   717 	TMuxType iMuxType; 
       
   718 		
       
   719 
       
   720     // amount of data in buffer
       
   721 	TUint iBufData; 
       
   722     // reading descriptor	
       
   723 	TPtr8 iReadDes; 
       
   724 			   
       
   725     // demux parameters read
       
   726 //	CMP4Demux::TStreamParameters iMP4Parameters; 
       
   727 //	CMP4Demux::TOutputChannel iMP4Channels[2];
       
   728 		
       
   729     // video stream parameters
       
   730 	CTNEProcessorImpl::TStreamParameters iVideoParameters; 
       
   731 
       
   732     // stream length in milliseconds
       
   733 	TUint iStreamLength; 
       
   734     // stream size in bytes
       
   735 	TUint iStreamSize; 
       
   736     // stream average bitrate
       
   737 	TUint iStreamBitrate; 
       
   738     // is it possible to seek in the file	
       
   739 	TBool iCanSeek; 
       
   740 
       
   741 
       
   742 	RFile iCurClip;
       
   743     RFs   iFs;
       
   744     TBool iFsConnected;	
       
   745 
       
   746     TInt           iCurClipIndex;
       
   747 
       
   748 
       
   749 	TInt iCurrentVideoSize;
       
   750     
       
   751     TRequestStatus *iThumbnailRequestStatus;
       
   752     CFbsBitmap* iOutBitmap;
       
   753     
       
   754     friend class CMP4Parser;
       
   755 };
       
   756 
       
   757 
       
   758 #endif      //  __TNEPROCESSORIMPL_H__
       
   759 
       
   760 // End of File