camappengine/Engine/Inc/CaeStillStatesActive.h
changeset 15 50d5061ee01e
parent 14 34024902876b
child 17 880d946921e4
equal deleted inserted replaced
14:34024902876b 15:50d5061ee01e
     1 /*
       
     2 * Copyright (c) 2005 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:  Still capture state machine implementation class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CAESTILLSTATESACTIVE_H
       
    21 #define CAESTILLSTATESACTIVE_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <e32std.h>
       
    26 #include <s32file.h>
       
    27 #include <fbs.h>
       
    28 #include <ecam.h>
       
    29 #include "CaeEngineExtInterface.h"
       
    30 #include "CaeCommon.h"
       
    31 #include "CaeEngine.h"
       
    32 #include "CaeStillEncoder.h"
       
    33 #include "CaeStillDecoder.h"
       
    34 #include "CaeDbgUtilities.h"                // For debugging.
       
    35 
       
    36 
       
    37 // CONSTANTS
       
    38 
       
    39 #ifdef _DEBUG
       
    40 const TInt KOneSecond = 1000000; // This many microseconds in a second
       
    41 #endif
       
    42 
       
    43 // Optimal snap bitmap size concerning memory usage and snap image quality
       
    44 const TInt KCaeDefaultSnapWidth = 640;
       
    45 const TInt KCaeDefaultSnapHeight = 480;
       
    46 
       
    47 _LIT(KCaePanicText, "CamAppEngine");
       
    48 enum TCaePanic
       
    49     {
       
    50     ECaePanicInvalidState = 1   
       
    51     };
       
    52 
       
    53 const TInt KCaeDefaultCompressionQuality = 90;
       
    54 const CCamera::TFormat KBaseStillInputFormat1 = CCamera::EFormatFbsBitmapColor16M;
       
    55 const CCamera::TFormat KBaseStillInputFormat2 = CCamera::EFormatFbsBitmapColor64K;
       
    56 const TDisplayMode KCaeDefaultDisplayMode = EColor64K; // The default display mode for the snap image
       
    57 
       
    58 
       
    59 // FORWARD DECLARATIONS
       
    60 class CCaeEngineImp;
       
    61 class CCaeStillBurst;
       
    62 class CCaeImageQueueExtPro;
       
    63 
       
    64 // CLASS DECLARATION
       
    65 
       
    66 /**
       
    67 * Still capure state machine implementation class
       
    68 */
       
    69 
       
    70 NONSHARABLE_CLASS( CCaeStillStatesActive ) : public CActive,
       
    71                                              public MCaeStillEncoderObserver, 
       
    72                                              public MCaeStillDecoderObserver
       
    73     {
       
    74     public: // Enums
       
    75 
       
    76         /**
       
    77         * Events for the state machine
       
    78         */
       
    79         enum TCaeEvent
       
    80             {
       
    81             // External event
       
    82             ECaeEventNone							= 0,
       
    83 
       
    84             // Start 
       
    85             ECaeEventStartStillCapture				= 1,
       
    86 
       
    87             // Capturing 
       
    88             ECaeEventImageCaptureReady				= 100,
       
    89             ECaeEventBurstImageCaptureReady			= 101,
       
    90             ECaeEventBurstCaptureReady				= 102,
       
    91             ECaeEventAppendCapturedBurstImageReady	= 103,        
       
    92             ECaeEventViewFinderForBurstReady		= 104, 
       
    93            
       
    94             // Processing
       
    95             ECaeEventBurstImageFetchReady			= 200,
       
    96             ECaeEventDecodeToBitmapReady			= 201,
       
    97             ECaeEventExtractExifMetaDataReady		= 202,
       
    98             ECaeEventProcessCapturedImageStepReady	= 203,
       
    99             ECaeEventProcessCapturedImageAllReady	= 204,
       
   100             ECaeEventProcessSnapImageStepReady		= 205,
       
   101             ECaeEventProcessSnapImageAllReady		= 206,
       
   102             ECaeEventDeliverSnapImageReady			= 207,  
       
   103             ECaeEventProcessStillImageStepReady		= 208,
       
   104             ECaeEventProcessStillImageAllReady		= 209,
       
   105             ECaeEventEncodeToJpegReady				= 210,
       
   106             ECaeEventDeliverStillBurstImageReady	= 211,  
       
   107             ECaeEventDeliverStillImageReady			= 212,  
       
   108            
       
   109             // Processing
       
   110             ECaeEventImageQueueExtPro               = 300,
       
   111 
       
   112             // End of process    
       
   113             ECaeEventEnd							= 900
       
   114             };
       
   115    
       
   116     public: // Constructors and destructor
       
   117         
       
   118         /**
       
   119         * Symbian OS two-phased constructor.
       
   120         * @since 2.8
       
   121         * @param aCamera Reference to Camera API.
       
   122         * @param aInfo Reference to the engine info struct
       
   123         * @param aProcessImageImplList Reference to list of the extensions implementing MCaeExtProcessImageInterface.
       
   124         * @return instance of the object
       
   125         */
       
   126         static CCaeStillStatesActive* NewL( 
       
   127             CCamera& aCamera,
       
   128             const TCamAppEngineInfo& aInfo,
       
   129             RArray<TCaeExtensionInterfaceImplItem>& aProcessImageImplList );
       
   130 
       
   131         /**
       
   132         * Destructor.
       
   133         * @since 2.8
       
   134         */
       
   135         virtual ~CCaeStillStatesActive();
       
   136 
       
   137     public: // Delegated from CCaeEngine class method calls
       
   138 
       
   139         void SetCamAppEngineObserver( 
       
   140             MCamAppEngineObserver& aObserver );
       
   141 
       
   142         void SetSnapImageCreation( 
       
   143             TBool aCreateSnapImage = ETrue );
       
   144 
       
   145         void SetSnapImageSourceL(
       
   146             CCaeEngine::TSnapImageSource aSnapImageSource );
       
   147 
       
   148         void SetSnapImageSizeL(
       
   149             TSize& aSize );
       
   150 
       
   151         void SetSnapImageColorMode(
       
   152             TDisplayMode aMode );
       
   153 
       
   154      	void SetJpegQuality(
       
   155     	    TInt aQuality );
       
   156 
       
   157     	TInt JpegQuality() const;
       
   158 
       
   159         void SetImageCodecsL( 
       
   160         	TUid aDecoderUid, TUid aEncoderUid );
       
   161 
       
   162         void SetCaeStillBurstObserver( 
       
   163             MCaeStillBurstObserver& aObserver );
       
   164 
       
   165         TInt SetStillCaptureImageCountL( 
       
   166             TInt aImageCount );
       
   167 
       
   168         TInt StillCaptureImageCount() const;
       
   169 
       
   170         void SetStillBurstCaptureIntervalL( 
       
   171             TTimeIntervalMicroSeconds aInterval );
       
   172 
       
   173         TTimeIntervalMicroSeconds StillBurstCaptureInterval() const;
       
   174 
       
   175         void StopStillBurstCapture();
       
   176 
       
   177         void CancelCaptureStill();
       
   178 
       
   179     public: // New methods
       
   180 
       
   181         /**
       
   182         * Called asynchronously when the captured image is ready. 
       
   183         * @since 2.8
       
   184         * @param aBitmap A pointer to an image held in CFbsBitmap form
       
   185         * @param aData A pointer to an image held in HBufC8 in previously specified format.
       
   186         * @param aError SymbianOS standard error code.
       
   187         * @return void.
       
   188         */
       
   189         void ImageReady( 
       
   190             CFbsBitmap* aBitmap, 
       
   191             HBufC8*     aData, 
       
   192             TInt        aError );
       
   193 
       
   194         /**
       
   195         * Called asynchronously when the view finder frame is ready. 
       
   196         * @since 2.8
       
   197         * @return void
       
   198         */
       
   199         void ViewFinderFrameReady();
       
   200 
       
   201         /**
       
   202         * Get current still image size. 
       
   203         * @since 2.8
       
   204         * @return Still image size in pixels.
       
   205         */
       
   206         TSize StillImageSize() const;
       
   207 
       
   208         /**
       
   209         * Get current snap image size. 
       
   210         * @since 2.8
       
   211         * @return Snap image size in pixels.
       
   212         */
       
   213         TSize SnapImageSize() const;
       
   214 
       
   215         /**
       
   216         * Set view finder mode enabled or disabled.
       
   217         * @since 2.8
       
   218         * @param aIsEnabled Tell if the view finder is enabled.
       
   219         * @return void.
       
   220         */
       
   221      	void SetViewFinderMode(
       
   222     	    TBool aIsEnabled );
       
   223 
       
   224         /**
       
   225         * Check if the state machine has been started. 
       
   226         * @since 2.8
       
   227         * @return State of the state machine.
       
   228         */
       
   229         TBool IsRunning() const;
       
   230 
       
   231         /** 
       
   232         * Register flags which affect general extension handling in the engine. 
       
   233         * @since 2.8
       
   234         * @param aFlags Flags to register.
       
   235         * @return void.
       
   236         */
       
   237         void RegisterFlags( TUint32 aFlags );
       
   238 
       
   239         /** 
       
   240         * Deregister flags which have been registered before.
       
   241         * @since 2.8
       
   242         * @param aFlags Flags to deregister.
       
   243         * @return void.
       
   244         */
       
   245         void DeregisterFlags( TUint32 aFlags );
       
   246 
       
   247         /**
       
   248         * Prepare the state machine for still image capture . 
       
   249         * The returned snap image size is always equal or bigger in both 
       
   250         * dimensions than the given size. The returned size is stepwise 
       
   251         * downscaled  from the captured image size. The parameter aSnapSize 
       
   252         * is ignored if that is not supported for the image format used.
       
   253         * @since 2.8
       
   254         * @param aSize Still image size.
       
   255         * @param aFormat Still image format.
       
   256         * @param aCropRect Desired cropping/clipping rectangle. The size (0,0) means that this parameter is ignored.
       
   257         * @param aSnapSize Desired snap image size. Returns the real snap image size.
       
   258         * @return void
       
   259         */
       
   260         void PrepareStillCaptureL( 
       
   261             const TSize&     aSize, 
       
   262             CCamera::TFormat aFormat,  
       
   263             const TRect&     aCropRect,
       
   264             TSize&           aSnapSize );
       
   265 
       
   266         /**
       
   267         * Send event to the state machine. Usually only ECaeEventStartStillCapture
       
   268         * event is send outside the class. 
       
   269         * @since 2.8
       
   270         * @param aEvent Event to the state machine.
       
   271         * @param aDelay The delay that the event will occur after.
       
   272         * @return void.
       
   273         */
       
   274 		void Event( TCaeEvent aEvent, TTimeIntervalMicroSeconds32 aDelay = 0 );
       
   275     
       
   276         /**
       
   277         * Recover and handle error cases. This could mean also ending of 
       
   278         * the state machine, but not always (e.g. in burst mode ). 
       
   279         * @since 2.8
       
   280         * @param aError Error code.
       
   281         * @return void.
       
   282         */
       
   283         void ErrorRecovery( TInt aError );
       
   284         
       
   285         /**
       
   286         * Start capturing without active object delay.
       
   287         * @since 3.2
       
   288         * @return void.
       
   289         */
       
   290         void StartQuickCapture();
       
   291 
       
   292         /**
       
   293         * Gets the extension mode status.
       
   294         * @since 3.2
       
   295         * @return ETrue if extension mode is avtive.
       
   296         */
       
   297         TBool ExtModeActive();
       
   298 
       
   299         /**
       
   300         * Sets the extension mode on/off.
       
   301         * @since 3.2
       
   302         * @return void.
       
   303         */
       
   304         void SetExtModeActiveL( TBool aExtModeActive );
       
   305 
       
   306         /**
       
   307         * Do the extension processing for snap image.
       
   308         * @since 3.2
       
   309         * @return error code.
       
   310         */
       
   311         TInt ProcessExtSnapImage( CFbsBitmap* aSnapImage );
       
   312 
       
   313 
       
   314         /**
       
   315         * Do the extension processing for captured image.
       
   316         * @since 3.2
       
   317         * @return error code.
       
   318         */
       
   319         TInt ProcessExtCapturedImage( HBufC8* aImageData, TBool aLastImage  );
       
   320 
       
   321         /**
       
   322         * Do the extension processing for captured bitmap image.
       
   323         * @since 3.2
       
   324         * @return error code.
       
   325         */
       
   326         TInt ProcessExtCapturedImage( CFbsBitmap* aImageBitmapData, TBool aLastImage  );
       
   327 
       
   328         /**
       
   329         * Set the burst mode optimization mode  
       
   330         * @since 3.2
       
   331         * @return void.
       
   332         */
       
   333         void SetBurstModeVFOptimization( TBool aBurstModeVFOptimization );
       
   334 
       
   335     private: // Enums
       
   336 
       
   337         /**
       
   338         * States of the state machine
       
   339         */
       
   340 		enum TCaeState
       
   341 			{
       
   342 			ECaeStateNone                               = 0,
       
   343 
       
   344             // Capturing 
       
   345             ECaeStateCapturing                          = 100,
       
   346             ECaeStateCapturingBurst                     = 101,
       
   347             ECaeStateAppendingBurstImage                = 102,
       
   348             ECaeStateBurstWaitingForViewFinder          = 103,
       
   349 
       
   350             // Processing
       
   351             ECaeStateFetchingNextBurstImage				= 200,
       
   352             ECaeStateDecodingCapturedImageToBitmap      = 201,
       
   353             ECaeStateExtractingExifMetaData             = 202,
       
   354             ECaeStateExtensionsProcessingCapturedImage  = 203,
       
   355             ECaeStateDecodingToSnapImage                = 204,
       
   356             ECaeStateExtensionsProcessingSnapImage      = 205,
       
   357             ECaeStateDeliveringSnapImage                = 206,
       
   358             ECaeStateExtensionsProcessingStillImage     = 207,
       
   359             ECaeStateEncodingToJpeg                     = 208,
       
   360             ECaeStateDeliveringStillImage               = 209,
       
   361             ECaeStateDeliveringStillBurstImage          = 210,
       
   362             ECaeStateCompletingStillBurst               = 211
       
   363 			};
       
   364         
       
   365     private: // Constructors
       
   366         
       
   367         /**
       
   368         * C++ constructor.
       
   369         * @since 2.8
       
   370         * @param aCamAppEngine Reference to CCaeEngineImp instance
       
   371         */
       
   372         CCaeStillStatesActive( 
       
   373             CCamera& aCamera,
       
   374             const TCamAppEngineInfo& aInfo,
       
   375             RArray<TCaeExtensionInterfaceImplItem>& aProcessImageImplList );
       
   376 
       
   377         /**
       
   378         * Symbian OS 2nd phase constructor that can leave.
       
   379         * @since 2.8
       
   380         * @return void
       
   381         */
       
   382         void ConstructL();
       
   383 
       
   384     private: // Methods from CActive 
       
   385         
       
   386         void RunL();
       
   387 
       
   388         void DoCancel();
       
   389 
       
   390         void Cancel();
       
   391 
       
   392     private: // From Still Encoder Observer / CaeStillConverter.h
       
   393 
       
   394         void McaeseoHBufC8ImageReady( 
       
   395             CFbsBitmap* aBitmap, 
       
   396             HBufC8*     aImageData, 
       
   397             TInt        aError,
       
   398             TInt        aImageSize );
       
   399         
       
   400     private: // From Still Decoder Observer / CaeStillConverter.h
       
   401 
       
   402        void McaesdoCFbsBitmapImageReady( 
       
   403             HBufC8*     aImageData, 
       
   404             CFbsBitmap* aBitmap, 
       
   405             TInt        aError,
       
   406             TInt        aImageSize );
       
   407         
       
   408     private: // Event handlers for state transitions
       
   409 
       
   410         /**
       
   411         * Handle errors from extenal processing, e.g. from the extensions. 
       
   412         * @since 2.8
       
   413         * @return void. 
       
   414         */
       
   415         void HandleExternalError();
       
   416 
       
   417         /**
       
   418         * Handle events from extenal processing, e.g. from the extensions. 
       
   419         * @since 2.8
       
   420         * @return void. 
       
   421         */
       
   422         void HandleExternalEvent(); 
       
   423 
       
   424         /**
       
   425         * Handle start event. 
       
   426         * @since 2.8
       
   427         * @return void. 
       
   428         */
       
   429         void HandleStart();
       
   430 
       
   431         /**
       
   432         * Handle event when an image has been captured. 
       
   433         * @since 2.8
       
   434         * @return void. 
       
   435         */
       
   436         void HandleImageCaptureReady();
       
   437 
       
   438         /**
       
   439         * Handle event when a burst image has been appended to the array. 
       
   440         * @since 2.8
       
   441         * @return void. 
       
   442         */
       
   443         void HandleAppendCapturedBurstImageReady();
       
   444 
       
   445         /**
       
   446         * Handle event when a burst image has been fetched from the array. 
       
   447         * @since 2.8
       
   448         * @return void. 
       
   449         */
       
   450         void HandleBurstImageFetchReady();
       
   451 
       
   452         /**
       
   453         * Handle event when a bitmap has been decoded. 
       
   454         * @since 2.8
       
   455         * @return void. 
       
   456         */
       
   457         void HandleDecodeToBitmapReady();
       
   458 
       
   459         /**
       
   460         * Handle event when all the extensions have been processed the captured image. 
       
   461         * @since 2.8
       
   462         * @return void. 
       
   463         */
       
   464         void HandleProcessCapturedImageAllReady();
       
   465 
       
   466         /**
       
   467         * Handle event all extensions have been processed the still image.
       
   468         * @since 2.8
       
   469         * @return void. 
       
   470         */
       
   471         void HandleProcessStillImageAllReady();
       
   472 
       
   473         /**
       
   474         * Handle event when a still bitmap has been encoded to Jpeg.
       
   475         * @since 2.8
       
   476         * @return void. 
       
   477         */
       
   478        void HandleEncodeToJpegReady();
       
   479 
       
   480         /**
       
   481         * Handle event when the still burst image has been delivered to the client. 
       
   482         * @since 2.8
       
   483         * @return void. 
       
   484         */
       
   485         void HandleDeliverStillBurstImageReady();
       
   486         
       
   487         /**
       
   488         * Handle event when there are images in extension processing queue
       
   489         * @since 3.2
       
   490         * @return void. 
       
   491         */
       
   492         void HandleImageQueueExtPro();
       
   493 
       
   494     private: // Action functions for states
       
   495 
       
   496         /**
       
   497         * Start still (single) image capturing. 
       
   498         * @since 2.8
       
   499         * @return void. 
       
   500         */
       
   501         void DoCaptureStill();
       
   502 
       
   503         /**
       
   504         * Start still burst image capturing. 
       
   505         * @since 2.8
       
   506         * @return void. 
       
   507         */
       
   508         void DoCaptureStillBurst();
       
   509 
       
   510         /**
       
   511         * Start still burst capturing for one image. 
       
   512         * @since 2.8
       
   513         * @return void. 
       
   514         */
       
   515         void DoCaptureStillBurstImage();
       
   516 
       
   517         /**
       
   518         * Start appending captured burst image to the array. 
       
   519         * @since 2.8
       
   520         * @return void. 
       
   521         */
       
   522         void DoAppendCapturedBurstImageToArray();
       
   523 
       
   524         /**
       
   525         * Start fetching the next burst image from the array. 
       
   526         * @since 2.8
       
   527         * @return void. 
       
   528         */
       
   529         void DoFetchNextBurstImage();
       
   530 
       
   531         /**
       
   532         * Start decoding the captured image to the bitmap. 
       
   533         * @since 2.8
       
   534         * @return void. 
       
   535         */
       
   536         void DoDecodeCapturedImageToBitmap();
       
   537 
       
   538         /**
       
   539         * Start processing the captured image in the extensions.
       
   540         * @since 2.8
       
   541         * @return void. 
       
   542         */
       
   543         void DoExtensionsProcessCapturedImage();
       
   544 
       
   545         /**
       
   546         * Start processing the snap image in the extensions.
       
   547         * @since 2.8
       
   548         * @return void. 
       
   549         */
       
   550         void DoExtensionsProcessSnapImage();
       
   551 
       
   552         /**
       
   553         * Start delivering the snap image to the client.
       
   554         * @since 2.8
       
   555         * @return void. 
       
   556         */
       
   557         void DoDeliverSnapImage();
       
   558 
       
   559         /**
       
   560         * Start processing the still image in the extensions.
       
   561         * @since 2.8
       
   562         * @return void. 
       
   563         */
       
   564         void DoExtensionsProcessStillImage();
       
   565 
       
   566         /**
       
   567         * Start encoding to Jpeg image.
       
   568         * @since 2.8
       
   569         * @return void. 
       
   570         */
       
   571         void DoEncodeStillImageToJpeg();
       
   572 
       
   573         /**
       
   574         * Start delivering the still burst image to the client.
       
   575         * @since 2.8
       
   576         * @return void. 
       
   577         */
       
   578         void DoDeliverStillBurstImage();
       
   579 
       
   580         /**
       
   581         * Start delivering the still image to the client.
       
   582         * @since 2.8
       
   583         * @return void. 
       
   584         */
       
   585         void DoDeliverStillImage();
       
   586 
       
   587         /**
       
   588         * Start completing the still burst.
       
   589         * @since 2.8
       
   590         * @return void. 
       
   591         */
       
   592         void DoCompleteStillBurst();
       
   593 
       
   594     private: // Helper methods
       
   595 
       
   596         /**
       
   597         * Get the current display mode from the system.
       
   598         * @since 2.8
       
   599         * @param aDisplayMode Returned display mode.
       
   600         * @return TBool Whether the display mode was found.
       
   601         */
       
   602         TBool GetSystemDisplayMode( TDisplayMode& aDisplayMode );
       
   603 
       
   604         /**
       
   605         * If needed, calculates the stepwise downscaled size for the snap bitmap.
       
   606         * @since 2.8
       
   607         * @param aSnapSize Desired snap image size. Returns the real snap image size.
       
   608         * @return void
       
   609         */
       
   610         void CalcDownscaledSnapSize(
       
   611             TSize& aSnapSize ) const;
       
   612 
       
   613         /**
       
   614         * Gets the thumbnal from an Exif image.
       
   615         * @since 2.8
       
   616         * @return  
       
   617         */
       
   618         void GetThumbnailL( 
       
   619             HBufC8*& aReadThumbnail, 
       
   620             TSize&   aThumbnailSize );
       
   621             
       
   622         /**
       
   623         * The output image type for the client.
       
   624         * @since 2.8
       
   625         * @return Tell if the output format is bitmap. 
       
   626         */
       
   627         TBool IsBitmapOutput();
       
   628 
       
   629         /**
       
   630         * Retrieves/fetches still image size index from Camera API.
       
   631         * @since 2.8
       
   632         * @param aSize Still image frame size
       
   633         * @param aStillDataFormat Still image data format
       
   634         * @return Still image size index
       
   635         */
       
   636         TInt RetrieveStillSizeIndex( 
       
   637             const TSize&     aSize, 
       
   638             CCamera::TFormat aStillDataFormat ) const;
       
   639 
       
   640         /**
       
   641         * Cancel the state machine actions and release and cancel internal objects.  
       
   642         * @since 2.8
       
   643         * @return void. 
       
   644         */
       
   645         void CancelAndCleanup();
       
   646 
       
   647         /**
       
   648         * Check for still burst completion.
       
   649         * @since 2.8
       
   650         * @return Return whether the still burst should be completed.
       
   651         */
       
   652         TBool CheckForStillBurstCompletion();
       
   653 
       
   654         /**
       
   655         * Delete images and continue burst. Ignore error for an individual image.
       
   656         * @since 2.8
       
   657         * @param aError Error code.
       
   658         * @return void.
       
   659         */
       
   660         void BurstErrorRecovery( TInt aError );
       
   661 
       
   662         /**
       
   663         * Complete still image burst capture but do not delete still burst object. 
       
   664         * @since 2.8
       
   665         * @return void. 
       
   666         */
       
   667         void CompleteStillBurst();
       
   668 
       
   669         /**
       
   670         * Delete still burst object.
       
   671         * @since 2.8
       
   672         * @return void. 
       
   673         */
       
   674         void DeleteStillBurst();
       
   675 
       
   676     private:
       
   677 
       
   678     //// Objects ////
       
   679 
       
   680         // Timer used for delayed calls.
       
   681         RTimer iDelayedCallTimer; 
       
   682 
       
   683         // File server handle for file operations.
       
   684         RFs iFs;
       
   685         
       
   686         // Camera API reference.
       
   687         CCamera& iCamera; 
       
   688 
       
   689         // Engine info reference.
       
   690         const TCamAppEngineInfo& iInfo;
       
   691 
       
   692         // Camera Application Engine observer.
       
   693         MCamAppEngineObserver* iCaeObserver;
       
   694 
       
   695         // Still image encoder object.
       
   696         CCaeStillEncoder* iStillEncoder; 
       
   697 
       
   698         // Still image decoder object.
       
   699         CCaeStillDecoder* iStillDecoder;
       
   700 
       
   701         // Still burst observer.
       
   702         MCaeStillBurstObserver* iCaeStillBurstObserver;
       
   703 
       
   704         // Still image burst object, contains all the images captured in a burst.
       
   705         CCaeStillBurst* iStillBurst; 
       
   706 
       
   707         // Still image queue object for extension handling (used only when extension mode is active),
       
   708         // contains all the images that are waiting for extension handling and delivery to UI.
       
   709         CCaeImageQueueExtPro* iImageQueueExtPro; 
       
   710 
       
   711 
       
   712     //// Data ////
       
   713 
       
   714 		// All extension interface implementations for image processing.
       
   715 		RArray<TCaeExtensionInterfaceImplItem>& iProcessImageImplList; 
       
   716 
       
   717 		// Image data in image format structure.
       
   718 		HBufC8* iImageData; 
       
   719 
       
   720 		// Image data in bitmap.
       
   721 		CFbsBitmap* iBitmap;
       
   722 		
       
   723 		// Snap image.
       
   724 		CFbsBitmap* iSnapBitmap; 
       
   725 
       
   726 		// Exif header.
       
   727 		HBufC8* iImageHeaderData; 
       
   728 
       
   729         // Empty Snap image.
       
   730         CFbsBitmap* iEmptySnapImage;
       
   731 
       
   732         // Snap image source (input for decoding).
       
   733         CCaeEngine::TSnapImageSource iSnapImageSource;
       
   734 
       
   735          // Snap image size.
       
   736         TSize iSnapImageSize; 
       
   737 
       
   738          // Optimal snap image size.
       
   739         TSize iOptimalSnapImageSize; 
       
   740 
       
   741          // Snap image color mode.
       
   742         TDisplayMode iSnapImageColorMode; 
       
   743 
       
   744         // Still image capturing frame size.
       
   745         TSize iStillFrameSize;
       
   746 
       
   747         // Still image capture input format from Camera API.
       
   748         CCamera::TFormat iStillInputFormat;
       
   749         
       
   750         // Still image capture output format for client.
       
   751         CCamera::TFormat iStillOutputFormat;
       
   752 
       
   753         // Still image compression quality value.
       
   754         TInt iStillCompressionQuality;
       
   755 
       
   756         // Time delay to be inserted between captures in a burst.
       
   757         TTimeIntervalMicroSeconds32 iStillBurstCaptureInterval;
       
   758 
       
   759         // Count of processed (encoded/decoded) burst images.
       
   760         TInt iCountOfProcessedBurstImages;
       
   761 
       
   762         // Count of delivered burst images (delivered to the client).
       
   763         TInt iCountOfDeliveredBurstImages;
       
   764 
       
   765 
       
   766     //// State information ////
       
   767 
       
   768 		// Current state
       
   769 		TCaeState iCurrentState;
       
   770 
       
   771         // The first error detected during the burst.
       
   772         TInt iFirstStillBurstError;
       
   773 
       
   774 		// Current Extension array index 
       
   775 		TInt iCurrentExtensionIndex;
       
   776 
       
   777         // Delayed event id
       
   778         TCaeEvent iDelayedEvent;
       
   779 
       
   780 
       
   781     //// Flags ////
       
   782 
       
   783         // Boolean indicating if the engine should create the snap image (for client's display purposes).
       
   784         TBool iCreateSnapImage;
       
   785 
       
   786         // Boolean indicating if still image capturing is currently cancelled.
       
   787         TBool iStillCancelled;
       
   788 
       
   789         // Boolean indicating if delivering burst images has started.
       
   790         TBool iStillBurstDeliveryStarted;
       
   791 
       
   792         // Boolean indicating if still burst is stopped.
       
   793         TBool iStillBurstStopped;
       
   794 
       
   795         // Boolean indicating if a view finder frame has been received.
       
   796         TBool iViewFinderFrameReceived;
       
   797 
       
   798         // Boolean indicating if the view finder has been enabled.
       
   799         TBool iIsViewFinderEnabled;
       
   800 
       
   801         // Boolean indicating if the extension mode is selected
       
   802         TBool iExtModeActive;
       
   803       
       
   804         // Boolean indicating if this is the last burst image for extension processing
       
   805         TBool iLastImageExtPro;
       
   806       
       
   807         // Boolean indicating if still image capture is prepared.
       
   808         TBool iStillPrepared;
       
   809 
       
   810     //// Flags using reference count ////
       
   811 
       
   812         // Boolean indicating if full color snap image is required for extensions.
       
   813         TInt32 iRequireFullColorSnapInputImageRefCount;
       
   814 
       
   815         // Boolean indicating if the VF burst optimization is used
       
   816         TBool iBurstModeVFOptimization;
       
   817 
       
   818 #ifdef _DEBUG
       
   819         // Performance debugging variables
       
   820         TTime iCaptureStartTime;
       
   821         TTime iImageReadyTime;
       
   822         TTime iFinalImageReadyTime;
       
   823 #endif
       
   824     };
       
   825 
       
   826 #endif // CAESTILLSTATESACTIVE_H
       
   827 
       
   828 // End of File