camerasrv_plat/camera_application_engine_api/tsrc/inc/CaeTestClient.h
branchRCL_3
changeset 20 e3cdd00b5ae3
parent 19 18fa9327a158
child 21 27fe719c32e6
equal deleted inserted replaced
19:18fa9327a158 20:e3cdd00b5ae3
     1 /*
       
     2 * Copyright (c) 2009 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: CaeTestClient.h
       
    15 *
       
    16 */
       
    17 #ifndef CAE_TEST_CLIENT_H
       
    18 #define CAE_TEST_CLIENT_H
       
    19 
       
    20 #include <e32base.h>
       
    21 #include <f32file.h>
       
    22 #include <gdi.h>
       
    23 
       
    24 
       
    25 #include "CaeEngine.h"
       
    26 
       
    27 #include "CaeTestVariation.h"
       
    28 
       
    29 #include "ECamColorToneCustomInterface.h"
       
    30 
       
    31 #ifdef CAE_TEST_VERSION
       
    32 #include "CaeEngineImpTestErrors.h"
       
    33 #include "CaeStillConverterTestErrors.h"
       
    34 #endif
       
    35 
       
    36 const TInt KNormalTimingDelay = 1000;
       
    37 const TInt KLongTimingDelay = 5*1000;
       
    38 
       
    39 const TInt KImgWidthSubQCIF  = 128; 
       
    40 const TInt KImgHeightSubQCIF = 96; 
       
    41 
       
    42 const TInt KImgWidthQCIF     = 176; 
       
    43 const TInt KImgHeightQCIF    = 144; 
       
    44 
       
    45 const TInt KImgWidthCIF      = 352; 
       
    46 const TInt KImgHeightCIF     = 288; 
       
    47 
       
    48 const TInt KImgWidthQQVGA    = 160; 
       
    49 const TInt KImgHeightQQVGA   = 120; 
       
    50 
       
    51 const TInt KImgWidthQVGA     = 320; 
       
    52 const TInt KImgHeightQVGA    = 240; 
       
    53 
       
    54 const TInt KImgWidthVGA      = 640; 
       
    55 const TInt KImgHeightVGA     = 480; 
       
    56 
       
    57 const TInt KImgWidthSVGA      = 800; 
       
    58 const TInt KImgHeightSVGA     = 600; 
       
    59 
       
    60 const TInt KImgWidthTooBig   = 4096; 
       
    61 const TInt KImgHeightTooBig  = 4096; 
       
    62 
       
    63 const TInt KImgWidthMP1      = 1152; 
       
    64 const TInt KImgHeightMP1     = 864; 
       
    65 
       
    66 const TInt KImgWidthMP1M3      = 1280; 
       
    67 const TInt KImgHeightMP1M3     = 960; 
       
    68 
       
    69 const TInt KImgWidthMP2        = 1600; 
       
    70 const TInt KImgHeightMP2       = 1200; 
       
    71 
       
    72 const TInt KImgWidthMP3        = 2048; 
       
    73 const TInt KImgHeightMP3       = 1536; 
       
    74 
       
    75 const TInt KMaxVideoCodecSet     = 10; 
       
    76 
       
    77 enum TestClientLeavingCodes
       
    78     {
       
    79     KErrGetNotEqualToValuePreviouslySet = 98
       
    80     };
       
    81 
       
    82 #if ( defined (__WINS__) || defined (__WINSCW) )
       
    83 #define KFileNameBase _L("c:\\")
       
    84 _LIT(KProcessFileName, "c:\\CaeTestClient.dat");
       
    85 _LIT(KiSnapFileName, "C:\\cae_test_out_snapimage.mbm");
       
    86 _LIT(KiStillFileName, "C:\\cae_test_out_stillimage.jpg");
       
    87 _LIT(KiVideoFileName, "C:\\cae_test_out_videoclip.3gp");
       
    88 _LIT(KiVideoFileName2, "C:\\cae_test_out_videoclip2.3gp");
       
    89 _LIT(KiVideoFileName3, "C:\\cae_test_out_videoclip3.3gp");
       
    90 _LIT(KiVideoFileName4, "C:\\cae_test_out_videoclip4.3gp");
       
    91 #else
       
    92 #define KFileNameBase _L("e:\\temp\\")
       
    93 _LIT(KProcessFileName, "e:\\temp\\CaeTestClient.dat");
       
    94 _LIT(KiSnapFileName, "e:\\temp\\cae_test_out_snapimage.mbm");
       
    95 _LIT(KiStillFileName, "e:\\temp\\cae_test_out_stillimage.jpg");
       
    96 _LIT(KiVideoFileName, "e:\\temp\\cae_test_out_videoclip.3gp");
       
    97 _LIT(KiVideoFileName2, "e:\\temp\\cae_test_out_videoclip2.3gp");
       
    98 _LIT(KiVideoFileName3, "e:\\temp\\cae_test_out_videoclip3.3gp");
       
    99 _LIT(KiVideoFileName4, "e:\\temp\\cae_test_out_videoclip4.3gp");
       
   100 #endif
       
   101 
       
   102 #ifdef _DEBUG
       
   103 #include <e32svr.h>
       
   104 #define PRINT(x) RDebug::Print x
       
   105 #else
       
   106 #define PRINT(x)
       
   107 #endif
       
   108 
       
   109 
       
   110 #if MIRAGE_X_PROD1
       
   111 const TInt KDefaultStillImageWidth = KImgWidthMP1;
       
   112 const TInt KDefaultStillImageHeight = KImgHeightMP1;
       
   113 const CCamera::TFormat KDefaultStillDataFormat = CCamera::EFormatExif;
       
   114 #elif (MIRAGE_X_PROD2) || (MIRAGE_X_PROD4)
       
   115 const TInt KDefaultStillImageWidth = KImgWidthMP1M3;
       
   116 const TInt KDefaultStillImageHeight = KImgHeightMP1M3;
       
   117 const CCamera::TFormat KDefaultStillDataFormat = CCamera::EFormatExif;
       
   118 #elif MIRAGE_X_PROD7
       
   119 const TInt KDefaultStillImageWidth = KImgWidthMP2;
       
   120 const TInt KDefaultStillImageHeight = KImgHeightMP2;
       
   121 const CCamera::TFormat KDefaultStillDataFormat = CCamera::EFormatExif;
       
   122 #else
       
   123 const TInt KDefaultStillImageWidth = KImgWidthVGA;
       
   124 const TInt KDefaultStillImageHeight = KImgHeightVGA;
       
   125 const CCamera::TFormat KDefaultStillDataFormat = CCamera::EFormatFbsBitmapColor16M;
       
   126 #endif
       
   127 
       
   128 const TInt KSymbianJpegDecoderValue = 0x101F45D7;
       
   129 const TInt KSymbianJpegEncoderValue = 0x101F45D9;
       
   130 
       
   131 const TInt KOptimizedJpegDecoderValue = 0x101FF555;
       
   132 const TInt KOptimizedJpegEncoderValue = 0x101FF554;
       
   133 
       
   134 
       
   135 class CCaeTestClient : public CTimer /* also CActive */, 
       
   136                        public MCamAppEngineObserver, 
       
   137                        public MCameraObserver,
       
   138                        public MCameraObserver2,
       
   139                        public MCaeStillBurstObserver
       
   140     {
       
   141     public:
       
   142         
       
   143         enum TestClientActions
       
   144             {
       
   145 	        ENone,
       
   146             EDefault, 
       
   147 
       
   148             EEncodingError,
       
   149             EDecodingError,
       
   150             EPowerError,
       
   151             EReserveError,
       
   152             EStillCaptureError,
       
   153             EVideoRecorderOpenError,
       
   154             EVideoRecorderPrepareError,
       
   155             EVideoRecordingCompleteError,
       
   156             EPrepareVideoSettingsError,
       
   157             ESnapImageError, 
       
   158             EStillImageError,
       
   159             EStillConvertError1, 
       
   160             EStillConvertError2, 
       
   161             EStillConvertError3, 
       
   162 
       
   163             EInit, 
       
   164             EInitVideoRecorder, 
       
   165             EInitVideoRecorderWithUid, 
       
   166             EGetInfo,
       
   167             ESwitchPowerOnWhenInitialized, 
       
   168             ESwitchPowerOnWhenStillPrepared, 
       
   169             ESwitchPowerOffWhenStillPrepared, 
       
   170             ESwitchPowerOffWhenVfRunning, 
       
   171             ESwitchPowerOnWhenVideoPrepared, 
       
   172             ESwitchPowerOnWhenRecordingVideo, 
       
   173             ESwitchPowerOffWhenVideoPrepared, 
       
   174             ESwitchPowerOffWhenRecordingVideo, 
       
   175             EGetStillQualityIndexWhenEngineInitialized, 
       
   176             EGetStillQualityIndexWhenPrepared, 
       
   177             EGetVideoQualityIndexWhenEngineInitialized, 
       
   178             EGetVideoQualityIndexWhenPrepared, 
       
   179             EStartVideoRecordingWhenInitialized, 
       
   180             EStartVideoRecordingWhenRecording, 
       
   181             EStopVideoRecordingWhenInitialized, 
       
   182             EStopVideoRecordingWhenPrepared, 
       
   183             EIsVideoRecordingWhenPrepared, 
       
   184             EIsVideoRecordingWhenRecording, 
       
   185             ECaptureStillWhenEngineInitialized, 
       
   186 
       
   187             EStartVfWhenInitNotReady,
       
   188             EStartStillOpModeWhenInitNotReady,
       
   189             EStartVideoOpModeWhenInitNotReady,
       
   190             
       
   191             ECancelCaptureStillWhenInitialized, 
       
   192 
       
   193             ESwitchPowerOffAndOn,
       
   194             EPowerOffPowerOff,
       
   195             ERelease,
       
   196             EReleaseRelease,
       
   197             EReserveReserve,
       
   198             EReleaseReserve,
       
   199             EReleaseReserveCapture,
       
   200             EReleaseReserveRecord,
       
   201             
       
   202             EDestroyEngineWhenStillPrepareReady,
       
   203             EDestroyEngineWhenSnapImageReady,
       
   204             EDestroyEngineWhenStillCaptureReady,
       
   205             EDestroyEngineWhenSnapImageReadyInStillBurst,
       
   206             EDestroyEngineWhenStillImageReadyInStillBurst,
       
   207             EDestroyEngineWhenStillBurstReady, 
       
   208             EDestroyEngineWhenVideoPrepareReady,
       
   209             EDestroyEngineWhenVideoRecordingOn,
       
   210             EDestroyEngineWhenVideoRecordingPaused,
       
   211             EDestroyEngineWhenVideoRecordingReady,
       
   212             
       
   213             EEnumerateCaptureSizes, 
       
   214             
       
   215             ESpecifiedPrepareStill, 
       
   216             ESpecifiedPrepareStillWhenPrepared, 
       
   217             ESpecifiedPrepareAndCaptureStill, 
       
   218             ESpecifiedPrepareAndCaptureStill2nd, 
       
   219             EPrepareStillCapturing,
       
   220             EPrepareStillCapturingWhenPrepared, 
       
   221             EPrepareAndCaptureStill,
       
   222             EPrepareAndCaptureAndCancelStill, 
       
   223             EPrepareAndCaptureAndCancelStillAtSnap,  
       
   224 
       
   225             EStartAndStopVfWhenStillPreparedAndCaptured, 
       
   226             EPrepareStillCaptureWhenPowerOff, 
       
   227             EPrepareStillCaptureWhenRecording,
       
   228 
       
   229             EPrepareCroppedStillCapturing, 
       
   230 
       
   231             EPrepareAndCaptureStillBurst,
       
   232             ESpecPrepAndCaptureStillBurst, 
       
   233             EPrepareAndSetStillBurstCaptureInterval,
       
   234             EPrepareAndCaptureAndCancelStillBurst, 
       
   235             EPrepareAndCaptureAndCancelStillBurstAtMoment, 
       
   236             EPrepareAndCaptureAndCancelStillBurstAtSnap, 
       
   237             EPrepareAndCaptureAndStopStillBurst,
       
   238             EPrepareAndCaptureCaptureStillBurst,
       
   239             ESpecPrepAndCaptureCaptureStillBurst,  
       
   240             EPrepareAndCaptureStillBurstCaptureStill,
       
   241             ESpecPrepAndCaptureStillBurstCaptureStill, 
       
   242 
       
   243             EPrepareAndCaptureStillBurstExif,
       
   244             EPrepareAndCaptureAndCancelStillBurstExif,
       
   245 			EStartVfPrepareCaptureStillStartAndStopVfExif,
       
   246 			EStartVfPrepareCaptureStillStartAndStopVfSnapExif,
       
   247 			ECaptureStillSetSnapSizeExif,
       
   248 			ECaptureStillSetSnapColorModeExif,
       
   249             ECaptureStillAfterPowerOff,
       
   250             ECaptureStillAfterPowerOffOn,
       
   251             
       
   252             ESetVideoFileNameWhenInitialized, 
       
   253             ESetVideoFileNameWhenNotInitialized, 
       
   254             ESetEmptyVideoFileNameWhenInitialized, 
       
   255             ESetVideoFileNameWhenPrepared,
       
   256             ESetVideoFileNameWhenRecording,
       
   257 
       
   258             ESpecifiedPrepareVideo, 
       
   259             ESpecifiedPrepareVideoWhenPrepared, 
       
   260             ESpecifiedPrepareAndRecordVideo, 
       
   261             ESpecifiedPrepareAndRecordVideoNoInit, 
       
   262             EPrepareVideoRecording,
       
   263             EPrepareVideoRecordingWhenPrepared,
       
   264             EPrepareAndRecordVideo,
       
   265             EPrepareRecordPauseStopVideo, 
       
   266             EPrepareRecordPauseResumeStopVideo,
       
   267             EPrepareRecordPausePauseStopVideo, 
       
   268             EPauseVideoWhenPrepared, 
       
   269             EResumeVideoWhenPrepared,
       
   270             EResumeVideoWhenNotPaused, 
       
   271             EStartAndStopVfWhenVideoPreparedAndRecorded,
       
   272             ESpecifiedPrepareAudioBrAndRecordVideo,
       
   273             ESpecifiedPrepareAudioBrAndRecordVideoAT0,
       
   274             ESpecifiedPrepareAudioBrAndRecordVideoATInv,
       
   275    
       
   276             EStartStillOpModeStopVf, 
       
   277             EStartStillOpModeCaptureStartAndStopVf, 
       
   278 
       
   279             EStartVideoOpModeStopVf, 
       
   280             EStartVideoOpModeRecordStartAndStopVf, 
       
   281 
       
   282             EStartAndStopVf,
       
   283             EStartAndStopCroppedVf,
       
   284             EStartAndStopDirectVf, 
       
   285             EStartAndStopCroppedDirectVf,
       
   286             ESetViewFinderMirror,
       
   287             EStartVfPrepareCaptureStillStartAndStopVf,
       
   288             EStartVfPrepareRecordVideoStartAndStopVf, 
       
   289             EStartVfStartVf,
       
   290             EStartVfWhenPowerOff,
       
   291 
       
   292             ESetExposureModeWhenInitialized,
       
   293 			ESetEvCompensationWhenInitialized,
       
   294             ESetWhiteBalanceModeWhenInitialized,
       
   295             ESetFlashModeWhenInitialized,
       
   296             ESetDigiZoomWhenInitialized, 
       
   297             ESetBrightnessWhenInitialized, 
       
   298             ESetContrastWhenInitialized,
       
   299             ESetClipMaxSizeWhenVideoNotPrepared,
       
   300 
       
   301             ESetExposureModeWhenStillPrepared,
       
   302 			ESetEvCompensationWhenStillPrepared,
       
   303             ESetWhiteBalanceModeWhenStillPrepared,
       
   304             ESetFlashModeWhenStillPrepared,
       
   305             ESetDigiZoomWhenStillPrepared, 
       
   306             ESetBrightnessWhenStillPrepared, 
       
   307             ESetContrastWhenStillPrepared,
       
   308             ESetJpegQualityWhenStillPrepared, 
       
   309             ESetJpegCodecWhenStillPrepared, 
       
   310 
       
   311             ESetExposureModeWhenVideoPrepared,
       
   312             ESetEvCompensationWhenVideoPrepared,
       
   313             ESetWhiteBalanceModeWhenVideoPrepared,
       
   314             ESetFlashModeWhenVideoPrepared,            
       
   315             ESetDigiZoomWhenVideoPrepared, 
       
   316             ESetBrightnessWhenVideoPrepared, 
       
   317             ESetContrastWhenVideoPrepared, 
       
   318             ESetClipMaxSizeWhenVideoPrepared, 
       
   319             ESetAudioWhenVideoPrepared,
       
   320             EGetAudioWhenVideoNotInitialized,
       
   321             ESetVideoTimesIntervalWhenVideoPrepared,
       
   322 
       
   323             ESetExposureModeWhenVideoRecording,
       
   324 			ESetEvCompensationWhenVideoRecording,
       
   325             ESetWhiteBalanceModeWhenVideoRecording,
       
   326             ESetFlashModeWhenVideoRecording,            
       
   327             ESetDigiZoomWhenVideoRecording, 
       
   328             ESetBrightnessWhenVideoRecording, 
       
   329             ESetContrastWhenVideoRecording,
       
   330             ESetClipMaxSizeWhenVideoRecording,
       
   331             ESetClipMaxSizeWhenVideoNotInitialized,
       
   332             ESetAudioWhenVideoRecording,
       
   333             ESetAudioWhenVideoNotInitialized,
       
   334             ESetVideoTimesIntervalWhenVideoRecording,
       
   335 
       
   336             EResetToDefaults,
       
   337 
       
   338             EGetStillFrameSizeWhenInitialized,
       
   339             EEstimatedStillSizeInBytesWhenInitialized,
       
   340             EGetStillFrameSizeWhenPrepared,
       
   341             EEstimatedStillSizeInBytesWhenPrepared,
       
   342 
       
   343 			ESetSnapImageSizeBeforePrepare,
       
   344 			ESetSnapImageSizeDuringAndAfterPrepare,
       
   345 
       
   346             EGetVideoFrameSizeWhenInitialized,
       
   347             EVideoFrameRateWhenInitialized,
       
   348             EEstimatedVideoRecordingBitRateWhenInitialized,
       
   349             EGetVideoFrameSizeWhenPrepared,
       
   350             EVideoFrameRateWhenPrepared,
       
   351             EEstimatedVideoRecordingBitRateWhenPrepared,
       
   352 
       
   353             ECaptureCapture,
       
   354             ESpecPrepCaptureCapture, 
       
   355             ECaptureRecord,
       
   356             ERecordCapture,
       
   357             ERecordRecord,
       
   358 
       
   359             ERecordCaptureComplexSequence1,
       
   360             ERecordCaptureComplexSequence2, 
       
   361 
       
   362             ERemainingTimeWhenVideoPrepared,
       
   363             ERemainingTimeWhenVideoNotInitialized,
       
   364 
       
   365             EGetCustomInterface,
       
   366             ESetColorTone,
       
   367             ESetColorToneWrongParams,
       
   368             ESetColorToneVideoRecording,
       
   369             ESetColorToneRelease,
       
   370 
       
   371             EInitUid,
       
   372 
       
   373             ESetDisplayIndex,
       
   374             ESetCameraIndexLow,
       
   375             ESetCameraIndexHigh,
       
   376             
       
   377             EEnumerateVideoFrameSize,
       
   378 			ECCameraHandle,
       
   379 			
       
   380 			EProcessExtViewFinderFrameReady,
       
   381 			EProcessExtSnapImage,
       
   382 			EProcessExtCapturedImage,
       
   383 			EProcessExtCapturedImageTDesC8,
       
   384 			EProcessExtCapturedImageCFbsBitmap,
       
   385 			EProcessExtCapturedImageBurst,
       
   386 			EProcessExtCapturedImageBurstTDesC8,
       
   387 			EProcessExtCancel,
       
   388 			EProcessExtCancel2,
       
   389 			EInstalledExtensionList,
       
   390 			ESkippedExtensionList,
       
   391 			ESetSkippedExtensionList,
       
   392 			EProcessExtCapturedImageNoInit
       
   393             };
       
   394 
       
   395         enum TestClientOpMode
       
   396             {
       
   397 	        EClientOpModeStill,
       
   398             EClientOpModeVideo
       
   399             };
       
   400 
       
   401     public:
       
   402         
       
   403         static CCaeTestClient* NewL();
       
   404         
       
   405         virtual ~CCaeTestClient();
       
   406 
       
   407         void SetSnapImageCreation( TBool aCreateSnapImage );
       
   408 
       
   409         void SetRunningWithViewFinder( TBool aRunWithViewFinder );
       
   410 
       
   411         void SetViewFinderSize( const TSize& aSize );
       
   412         
       
   413         void SetStillQualityLevelIndex( TInt aQualityLevelIndex );
       
   414         
       
   415         void SetVideoQualityLevelIndex( TInt aQualityLevelIndex );
       
   416         
       
   417         void SetStillFormat( CCamera::TFormat aFormat );
       
   418         
       
   419         void SetStillCompressionQuality( TInt aCompressionQuality );
       
   420 
       
   421         void SetStillFrameSize( const TSize& aSize );
       
   422 
       
   423 		void SetSnapImageSize( const TSize& aSize );
       
   424 
       
   425         void SetSnapImageSource( CCaeEngine::TSnapImageSource aSnapImageSource );
       
   426 
       
   427 		void SetSnapImageColorMode( TDisplayMode aMode );
       
   428 
       
   429 		void SetImageCodecs( TUid aDecoderUid, TUid aEncoderUid );
       
   430 
       
   431 		void SetCropRect( const TRect& aRect );
       
   432 
       
   433         void SetStillBurstLength( TInt aLength );
       
   434         
       
   435         void SetVideoFrameSize( const TSize& aSize );
       
   436         
       
   437         void SetVideoFrameRate( TReal32 aFrameRate );
       
   438         
       
   439         void SetVideoBitRate( TInt aBitRate );
       
   440 
       
   441         void SetVideoAudio( TBool aAudioEnabled );
       
   442         
       
   443         void SetAudioBitRate( TInt aAudioBitRate );
       
   444 
       
   445         void SetFileNameBase( const TFileName& aFileNameBase );
       
   446 
       
   447         void SetVfFileName( const TFileName& aFileName ); 
       
   448 
       
   449         void SetVideoStopMode( TBool aAsyncVideoStopEnabled );
       
   450 
       
   451         void SetVfFileCountToSave( TInt aCountOfVfFilesToSave );
       
   452 
       
   453         void SetSnapFileName( const TFileName& aFileName );
       
   454 
       
   455         void SetStillFileName( const TFileName& aFileName );
       
   456         
       
   457         void SetVideoFileName( const TFileName& aFileName );
       
   458 
       
   459         void SetTimeout( TTimeIntervalMicroSeconds32 aTimeout );
       
   460 
       
   461         void SetStillBurstCaptureInterval( TTimeIntervalMicroSeconds aInterval );
       
   462         
       
   463         void SetExposureMode( TInt aExposureMode );
       
   464 
       
   465         void SetEvCompensation( TInt aEvCompensation );
       
   466 
       
   467         void SetWhiteBalanceMode( TInt aWhiteBalanceMode );
       
   468 
       
   469         void SetFlashMode( TInt aFlashMode );
       
   470 
       
   471         void SetBrightness( TInt aBrightness );
       
   472 
       
   473         void SetContrast( TInt aContrast );
       
   474 
       
   475         void SetZoomMode( TInt aZoomMode );
       
   476 
       
   477         void SetDigiZoomValue( TInt aDigiZoomValue );
       
   478 
       
   479         void SetVideoClipMaxSize( TInt aMaxClipSizeInBytes );
       
   480 
       
   481         void SetVideoTimesInterval( TTimeIntervalMicroSeconds aInterval );
       
   482 
       
   483         void SetOpMode( TestClientOpMode aOpMode );
       
   484         
       
   485         void SetDisplayIndex( TInt aDisplayIndex );
       
   486 
       
   487         void SetStopOnErrorInMcaeoSnapImageReady( TBool aStopOnError );
       
   488         
       
   489         void SetStopOnErrorInMcaeoStillImageReady( TBool aStopOnError );
       
   490         
       
   491         void GetInfo( TCamAppEngineInfo& aInfo ) const;
       
   492         
       
   493         void GetStillFrameSize( TSize& aSize ) const;
       
   494 
       
   495         TInt EstimatedStillSizeInBytes() const;
       
   496 
       
   497         void GetVideoFrameSize( TSize& aSize ) const;
       
   498 
       
   499         TReal32 VideoFrameRate() const;
       
   500         
       
   501         TInt EstimatedVideoRecordingBitRate() const;
       
   502 
       
   503 
       
   504         TReal32 ViewFinderFrameFrequency();
       
   505     
       
   506         TInt CountInitComplete();
       
   507 
       
   508         TInt CountStillPrepareComplete();
       
   509 
       
   510         TInt CountStillBurstOn();
       
   511 
       
   512         TInt CountStillBurstCaptureMoment();
       
   513 
       
   514         TInt CountStillBurstComplete();
       
   515 
       
   516         TInt CountImageDeliveredStillBurstComplete();
       
   517 
       
   518         TInt CountVideoPrepareComplete();
       
   519 
       
   520         TInt CountViewFinderFrameReady();
       
   521 
       
   522         TInt CountSnapImageReady();
       
   523 
       
   524         TInt CountStillImageReady();
       
   525 
       
   526         TInt CountVideoRecordingOn();
       
   527 
       
   528         TInt CountVideoRecordingComplete();
       
   529 
       
   530         TInt CountVideoRecordingStopped();
       
   531 
       
   532         TInt CountVideoRecordingPaused();
       
   533 
       
   534         TInt CountVideoRecordingTimes();
       
   535 
       
   536         void SetCustomInterfaceUid( TUid aCustomInterface );
       
   537 
       
   538         TAny* CustomInterfacePointer();
       
   539 
       
   540         void SetColorToneValue( MCameraColorToneSettings::TColorTone );
       
   541 
       
   542         void SetVideoCodecSet( TInt aValue );
       
   543 
       
   544     public:
       
   545 
       
   546         virtual void RunTestActionL( TestClientActions aAction ) = 0;
       
   547 
       
   548 
       
   549     public:
       
   550         // from observer
       
   551 
       
   552         void McaeoInitComplete( TInt aError );
       
   553 
       
   554         void McaeoStillPrepareComplete( TInt aError );
       
   555 
       
   556         void McaesboStillBurstCaptureMoment( TInt aError );
       
   557 
       
   558         void McaesboStillBurstComplete( TInt aImageCountDelivered, 
       
   559                                         TInt aError );
       
   560 
       
   561         void McaeoVideoPrepareComplete( TInt aError );
       
   562 
       
   563         void McaeoViewFinderFrameReady( CFbsBitmap& aFrame, TInt aError );
       
   564 
       
   565         void McaeoSnapImageReady( const CFbsBitmap& aBitmap, TInt aError );
       
   566 
       
   567         void McaeoStillImageReady( CFbsBitmap* aBitmap, HBufC8* aData, TInt aError );
       
   568 
       
   569         void McaeoVideoRecordingOn( TInt aError );
       
   570 
       
   571         void McaeoVideoRecordingComplete( TInt aError );
       
   572 
       
   573         void McaeoVideoRecordingStopped();
       
   574 
       
   575         void McaeoVideoRecordingPaused( TInt aError );
       
   576 
       
   577 	    void McaeoVideoRecordingTimes( TTimeIntervalMicroSeconds aTimeElapsed, 
       
   578                                        TTimeIntervalMicroSeconds aTimeRemaining, 
       
   579                                        TInt aError );
       
   580 
       
   581 
       
   582     protected:
       
   583 
       
   584 	    CCaeTestClient();
       
   585 
       
   586         void ConstructL();
       
   587 
       
   588     protected:
       
   589         
       
   590         void InitStateVariables();
       
   591 
       
   592         void StopOnError( TInt aError );
       
   593 
       
   594 
       
   595     private:
       
   596         
       
   597         // from CActive
       
   598         void RunL();
       
   599         
       
   600         // from CActive
       
   601         void DoCancel();
       
   602 
       
   603     private:
       
   604         
       
   605         virtual void RunTrappedL() = 0;
       
   606         
       
   607     private: // From MCameraObserver / ECam.h
       
   608 
       
   609         void ReserveComplete( 
       
   610             TInt aError );
       
   611 
       
   612         void PowerOnComplete( 
       
   613             TInt aError );
       
   614 
       
   615         void ViewFinderFrameReady( 
       
   616             CFbsBitmap& aFrame );
       
   617 
       
   618         void ImageReady( 
       
   619             CFbsBitmap* aBitmap, 
       
   620             HBufC8*     aData, 
       
   621             TInt        aError );
       
   622 
       
   623         void FrameBufferReady( 
       
   624             MFrameBuffer* /*aFrameBuffer*/, 
       
   625             TInt          /*aError*/ ) {}; // Empty default because not in use.
       
   626 
       
   627 
       
   628         /**
       
   629         * From MCameraObserver2 Informs that client should handle a event
       
   630         */
       
   631         void HandleEvent(const TECAMEvent& aEvent);
       
   632 
       
   633         /**
       
   634         * From MCameraObserver2 Informs that viewfinder frame is ready
       
   635         */
       
   636         void ViewFinderReady(MCameraBuffer& aCameraBuffer,TInt aError);
       
   637 
       
   638         /**
       
   639         * From MCameraObserver2 Informs that a new captured image is ready
       
   640         */
       
   641         void ImageBufferReady(MCameraBuffer& aCameraBuffer,TInt aError);
       
   642     
       
   643         /**
       
   644         * From MCameraObserver2 Informs that a new captured video is ready
       
   645         */
       
   646         void VideoBufferReady(MCameraBuffer& aCameraBuffer,TInt aError);
       
   647 
       
   648 
       
   649     protected:
       
   650 
       
   651         // Camera Application Engine.
       
   652         CCaeEngine* iCamAppEngine;
       
   653         CCamera*    iCameraDup;
       
   654 
       
   655         // Output data file.
       
   656         RFile iFile; 
       
   657         RFs   iFsSession;
       
   658 
       
   659         // Camera Application Engine info object.
       
   660         TCamAppEngineInfo iInfo;
       
   661 
       
   662         // File name base (e.g. "e:\\")
       
   663         TFileName               iFileNameBase;
       
   664 
       
   665         // View finder image file name.
       
   666         TFileName               iVfFileName;
       
   667         
       
   668         // Still image filename.
       
   669         TFileName               iSnapFileName;
       
   670         TFileName               iStillFileName;
       
   671         TFileName               iVideoFileName;
       
   672         TFileName               iVideoFileName2;
       
   673         TFileName               iVideoFileName3;
       
   674         TFileName               iVideoFileName4;
       
   675 
       
   676         // For counting View Finder frames.
       
   677         TInt                    iVfFrameCount;
       
   678         TInt                    iVfFrameCountToSave;
       
   679 
       
   680         // For counting Snap images.
       
   681         TInt                    iSnapImageCount;
       
   682 
       
   683         TInt                    iImageCountToCapture;
       
   684         
       
   685         TRect                   iCropRect;
       
   686 
       
   687         TSize                   iSizeEmpty;
       
   688 
       
   689         TInt  iError;
       
   690 
       
   691         TBool iStop;
       
   692 
       
   693         TBool iCreateSnapImage;
       
   694 
       
   695         TBool iRunWithViewFinder;
       
   696         TBool iStopViewFinder;
       
   697 
       
   698         TBool iRunlForSnapImage;
       
   699         TBool iRunlForStillImage;
       
   700         
       
   701         TBool iStopWhenCompleted;
       
   702         TBool iContinueWhenCompleted;
       
   703 
       
   704         TBool iInitReady;
       
   705         TBool iPowerOn;
       
   706         
       
   707         TBool iViewFinderStarted;
       
   708         TBool iViewFindingUsed;
       
   709         
       
   710         TBool iStillPrepareReady;
       
   711         TBool iSnapImageReady;
       
   712         TBool iStillCaptureReady;
       
   713         TBool iStillCapturingOn;
       
   714         TBool iStillCaptured;
       
   715 
       
   716         TBool iStillBurstCaptureMoment;
       
   717         TBool iStillBurstReady;
       
   718         TBool iStopStillBurst;
       
   719         TBool iCancelStillBurst;
       
   720         TBool iCancelStillBurstAfterVfFrame;
       
   721 
       
   722         TBool iVideoPrepareReady;
       
   723         TBool iVideoRecordingReady;
       
   724         TBool iVideoRecordingPaused;
       
   725         TBool iVideoRecordingResumed;
       
   726         TBool iVideoRecordingOn;
       
   727         TBool iVideoRecorded;
       
   728 
       
   729         TBool iStoppedOnError;
       
   730 
       
   731         TInt  iCancelCount;
       
   732 
       
   733         TInt  iCountInitComplete;
       
   734         TInt  iCountStillPrepareComplete;
       
   735         TInt  iCountStillBurstCaptureMoment;
       
   736         TInt  iCountStillBurstComplete;
       
   737         TInt  iCountVideoPrepareComplete;
       
   738         TInt  iCountViewFinderFrameReady;
       
   739         TInt  iCountSnapImageReady;
       
   740         TInt  iCountStillImageReady;
       
   741         TInt  iCountVideoRecordingOn;
       
   742         TInt  iCountVideoRecordingComplete;
       
   743         TInt  iCountVideoRecordingStopped;
       
   744         TInt  iCountVideoRecordingPaused;
       
   745         TInt  iCountVideoRecordingTimes;
       
   746 
       
   747         TInt  iImageCountPreparedForStillBurst;
       
   748         TInt  iImageCountDeliveredForStillBurst;
       
   749 
       
   750         TTimeIntervalMicroSeconds32     iTimeout;
       
   751         TTimeIntervalMicroSeconds     iStillBurstCaptureInterval;
       
   752 
       
   753         TTime iNextRunLTime;
       
   754 
       
   755         TestClientOpMode iOpMode;
       
   756 
       
   757 	    TestClientActions    iAction;
       
   758 	    TestClientActions    iSavedAction;
       
   759 
       
   760         TBool   iSaveSnapImage; 
       
   761         TBool   iSaveStillImage; 
       
   762         TBool   iSaveVideoClip; 
       
   763         TBool   iAcceptVideoCompletionError;
       
   764         TBool   iStopOnErrorInMcaeoSnapImageReady;
       
   765         TBool   iStopOnErrorInMcaeoStillImageReady;
       
   766 
       
   767         // TBool   iDestroyTheEngineInSnapImageReady;
       
   768         // TBool   iDestroyTheEngineInStillImageReady;
       
   769         
       
   770         TInt    iActionCycle;
       
   771 
       
   772         TInt    iStillQualityLevelIndex;
       
   773         TInt    iVideoQualityLevelIndex;
       
   774 
       
   775         TSize   iViewFinderSize;
       
   776 
       
   777         TSize   iStillFrameSize;
       
   778 
       
   779         TSize   iSnapImageSize;
       
   780         
       
   781         CCaeEngine::TSnapImageSource iSnapImageSource;
       
   782 
       
   783         CCamera::TFormat    iStillDataFormat;
       
   784         TDisplayMode		iSnapImageColorMode;
       
   785 
       
   786         TInt    iStillCompressionQuality;
       
   787         
       
   788         TUid 	iImageDecoderUid;
       
   789         TUid 	iImageEncoderUid;
       
   790 
       
   791         TInt    iStillBurstLength;
       
   792 
       
   793         TSize   iVideoFrameSize;
       
   794         TReal32 iVideoFrameRate;
       
   795         TInt    iVideoBitRate;
       
   796         TBool   iVideoAudioEnabled;
       
   797         TInt    iAudioBitRate;
       
   798         TInt    iVideoMaxClipSizeInBytes;
       
   799 
       
   800         TTimeIntervalMicroSeconds iVideoTimesInterval;
       
   801 
       
   802         TInt    iExposureMode;
       
   803         TInt    iEvCompensation;
       
   804         TInt    iWhiteBalanceMode;
       
   805         TInt    iFlashMode;
       
   806         TInt    iZoomMode;
       
   807         TInt    iDigiZoomValue;
       
   808         TInt    iBrightness;
       
   809         TInt    iContrast;
       
   810 
       
   811         TInt    iDisplayIndex;
       
   812 
       
   813         TSize   iStillFrameSizeSet;
       
   814         TInt    iEstimatedStillSizeInBytesSet;
       
   815         TSize   iVideoFrameSizeSet;
       
   816         TReal32 iVideoFrameRateSet;
       
   817         TInt    iEstimatedVideoBitRateSet;
       
   818 
       
   819         TUid    iCustomInterfaceUid;
       
   820         TAny*   iCustomInterfacePointer;
       
   821         MCameraColorToneSettings::TColorTone iColorToneValue;
       
   822         TUint32 iTestedColorTones;
       
   823         TBool   iReleaseDone;
       
   824         TBool   iReserveDone;
       
   825 
       
   826         TInt    iVideoCodecSet;
       
   827         const TDesC8* iMimeTypeSet[KMaxVideoCodecSet];
       
   828         const TDesC*  iPreferredSupplierSet[KMaxVideoCodecSet];
       
   829         const TDesC8* iVideoTypeSet[KMaxVideoCodecSet];
       
   830         const TDesC8* iAudioTypeSet[KMaxVideoCodecSet];
       
   831 
       
   832         TInt iCameraHandle;
       
   833         
       
   834         CFbsBitmap* iBitmapSave;
       
   835         HBufC8* iDataSave;
       
   836         TBool iBitmapSendDone;
       
   837         TBool iExtensionMode;
       
   838         
       
   839         TBool iVideoStopModeCommand;
       
   840         TBool iAsyncVideoStopEnabled;
       
   841 
       
   842 
       
   843     };
       
   844 
       
   845 #endif // CAE_TEST_CLIENT_H