camerasrv_plat/media_recorder_api/tsrc/src/camcTest_6.cpp
changeset 0 9b3e960ffc8a
child 42 605672cc2a86
equal deleted inserted replaced
-1:000000000000 0:9b3e960ffc8a
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Camcorder MMF API Test DLL
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "camcTest_6.h"
       
    22 #include "camcTest.h"
       
    23 #include <bldvariant.hrh>
       
    24 
       
    25 
       
    26 
       
    27 // EXTERNAL DATA STRUCTURES
       
    28 
       
    29 // EXTERNAL FUNCTION PROTOTYPES 
       
    30  
       
    31 // CONSTANTS
       
    32 
       
    33 // MACROS
       
    34 
       
    35 // LOCAL CONSTANTS AND MACROS
       
    36 
       
    37 // MODULE DATA STRUCTURES
       
    38 
       
    39 // LOCAL FUNCTION PROTOTYPES
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 
       
    43 CCamcTest_6::CCamcTest_6 ()
       
    44     {
       
    45     }
       
    46 
       
    47 
       
    48 
       
    49 CCamcTest_6::~CCamcTest_6 ()
       
    50     {
       
    51     delete iCamcTestClient;
       
    52     iCamcTestClient = NULL;
       
    53     }
       
    54 
       
    55 
       
    56 void CCamcTest_6::setUpL ()
       
    57     {
       
    58     iCamcTestClient = CCamcTestClient_6::NewL( );
       
    59     
       
    60     iWaitScheduler = new (ELeave) CActiveSchedulerWait;	
       
    61 
       
    62     // Create a new Camera API implementation object, if supported
       
    63     TRAPD( err, iUiLevelCamera = CCamera::New2L( static_cast<MCameraObserver2&>(*this), 0 /*index*/, 0 /*Priority*/ ) );
       
    64     if ( err )
       
    65         {
       
    66         PRINT( ( _L( "CCamcTest_6::setUpL CCamera::New2L return code=%d" ), err ) ); 
       
    67         // Create old Camera API implementation object.
       
    68         iUiLevelCamera = CCamera::NewL( static_cast<MCameraObserver&>(*this), 0 /*Index*/ );
       
    69         }
       
    70     else 
       
    71        {
       
    72        PRINT( ( _L( "CCamcTest_6::setUp() using new MCameraObserver2" )) ); 
       
    73        }
       
    74 
       
    75 	iUiLevelCameraHandle = iUiLevelCamera->Handle();
       
    76 	iUiLevelCamera->Reserve();
       
    77 	iWaitScheduler->Start();    
       
    78     }
       
    79 
       
    80 
       
    81 void CCamcTest_6::tearDown ()
       
    82     {
       
    83     delete iCamcTestClient;
       
    84     iCamcTestClient = NULL;
       
    85     delete iWaitScheduler;
       
    86     delete iUiLevelCamera;      
       
    87 	REComSession::FinalClose();
       
    88     }
       
    89 
       
    90 
       
    91 //
       
    92 // Own test functions.
       
    93 //
       
    94 
       
    95 /***************************/
       
    96 /*           PAUSE         */
       
    97 /***************************/
       
    98 
       
    99 void CCamcTest_6::PauseL_003_L()
       
   100     {
       
   101     ///////////////////////////////////////
       
   102     //   ID: CAMC_API.PAUSEL_003
       
   103     //   Action :
       
   104     //        Call pause when stopped
       
   105     //   Output : 
       
   106     //        Leave?
       
   107     ///////////////////////////////////////   
       
   108     
       
   109     iCamcTestClient->Start_Active_ObjectL(K_Tc6_PauseWhenStopped, iUiLevelCameraHandle);
       
   110     }
       
   111 
       
   112 /**************************/
       
   113 /*  SET VIDEO FRAME SIZE  */
       
   114 /**************************/
       
   115 
       
   116 void CCamcTest_6::SetVideoFrameSizeL_005_L()
       
   117     {
       
   118     ///////////////////////////////////////
       
   119     //   ID: CAMC_API.SETVIDEOFRAMESIZEL_005
       
   120     //   Action :
       
   121     //        SetVideoFrameSizeL when paused
       
   122     //		
       
   123     //   Output : 
       
   124     //        Leaves with KErrNotReady
       
   125     ///////////////////////////////////////    
       
   126     
       
   127     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc6_SetVideoFrameSizeLWhenPaused, iUiLevelCameraHandle));
       
   128     assertTIntsEqualL( KErrNotReady, err );
       
   129     }
       
   130 
       
   131 /**************************/
       
   132 /*    SET AUDIO ENABLED   */
       
   133 /**************************/
       
   134 
       
   135 void CCamcTest_6::SetAudioEnabledL_005_L()
       
   136     {
       
   137     ///////////////////////////////////////
       
   138     //   ID: CAMC_API.SETAUDIOENABLEDL_005
       
   139     //   Action :
       
   140     //        SetAudioEnabledL when controller is open, but not prepared.
       
   141     //   Output : 
       
   142     //        OK
       
   143     //////////////////////////////////////   
       
   144     
       
   145     iCamcTestClient->Start_Active_ObjectL(K_Tc6_SetAudioEnabledLWhenControllerReady, iUiLevelCameraHandle);
       
   146     }
       
   147 
       
   148 /**************************/
       
   149 /*   SET MAX CLIP SIZE    */
       
   150 /**************************/ 
       
   151 
       
   152 void CCamcTest_6::SetMaxClipSizeL_006_L()
       
   153     {
       
   154     ///////////////////////////////////////
       
   155     //   ID: CAMC_API.SETMAXCLIPSIZEL_006
       
   156     //   Action :
       
   157     //        Set invalid size for SetMaxClipSizeL when controller open
       
   158     //   Output : 
       
   159     //        Leave with KErrNotReady??
       
   160     //////////////////////////////////////    
       
   161     
       
   162     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc6_SetMaxClipSizeLWhenControllerReady, iUiLevelCameraHandle));
       
   163     assertTIntsEqualL( KErrArgument, err );
       
   164     }
       
   165 
       
   166 // Allows a 10% margin for the filesize
       
   167 #define TC6_ALLOWED_MARGIN 0.1 
       
   168 
       
   169 void CCamcTest_6::SetMaxClipSizeL_007_L()
       
   170     {
       
   171     ///////////////////////////////////////
       
   172     //   ID: CAMC_API.SETMAXCLIPSIZEL_007
       
   173     //   Action :
       
   174     //        SetMaxClipSizeL when prepare is ready
       
   175     //   Output : 
       
   176     //        Check file size 
       
   177     ///////////////////////////////////////    
       
   178     
       
   179 
       
   180     iCamcTestClient->Start_Active_ObjectL(K_Tc6_SetMaxClipSizeLWhenPrepareReady, iUiLevelCameraHandle);
       
   181     
       
   182 /* Check if size is according to previously set Size limit */
       
   183     RFile file; 
       
   184     TInt filesize;
       
   185     RFs fsSession;
       
   186     fsSession.Connect();
       
   187     TFileName fileName;
       
   188     AddDriveLetterToPath(_L("recordQCIF.3gp"),fileName);
       
   189     TInt err = file.Open(fsSession,fileName,EFileShareAny);
       
   190     assertTIntsEqualL( KErrNone, err );
       
   191 
       
   192     err = file.Size(filesize);
       
   193     file.Close();
       
   194     fsSession.Close();
       
   195     if ( ( filesize > TC6_FILE_SIZE_LIMIT * (1 + TC6_ALLOWED_MARGIN ) ) ||
       
   196         ( filesize < TC6_FILE_SIZE_LIMIT * (1 - TC6_ALLOWED_MARGIN ) ) )
       
   197         {
       
   198         assertL(0);
       
   199         }
       
   200     }
       
   201 
       
   202 /**************************/
       
   203 /*       RECORD           */
       
   204 /**************************/ 
       
   205 
       
   206 void CCamcTest_6::Record_006_L()
       
   207     {
       
   208     ///////////////////////////////////////
       
   209     //   ID: CAMC_API.RECORD_006
       
   210     //   Action :
       
   211     //        Record when PrepareComplete, no size limit
       
   212     //   Output : 
       
   213     //        OK
       
   214     ///////////////////////////////////////    
       
   215     
       
   216     iCamcTestClient->Start_Active_ObjectL(K_Tc6_RecordWhenPrepareComplete, iUiLevelCameraHandle);
       
   217     }
       
   218 
       
   219 void CCamcTest_6::Record_007_L()
       
   220     {
       
   221     ///////////////////////////////////////
       
   222     //   ID: CAMC_API.RECORD_007
       
   223     //   Action :
       
   224     //        Record when paused
       
   225     //   Output : 
       
   226     //        OK, No error in callback ???
       
   227     ///////////////////////////////////////    
       
   228     
       
   229     iCamcTestClient->Start_Active_ObjectL(K_Tc6_RecordWhenPaused, iUiLevelCameraHandle);
       
   230     }
       
   231 
       
   232 /**************************/
       
   233 /*       VIDEO TYPE       */
       
   234 /**************************/ 
       
   235 
       
   236 void CCamcTest_6::VideoTypeL_001_L()
       
   237     {
       
   238     ///////////////////////////////////////
       
   239     //   ID: CAMC_API.VIDEOTYPEL_001
       
   240     //   Action :
       
   241     //        Call VideoType when opened with specified type, not recording
       
   242     //   Output : 
       
   243     //        compare
       
   244     ///////////////////////////////////////    
       
   245     
       
   246     iCamcTestClient->Start_Active_ObjectL(K_Tc6_VideoTypeLWhenOpenWithMimeAndNotRecording, iUiLevelCameraHandle);
       
   247     }
       
   248 
       
   249 void CCamcTest_6::VideoTypeL_002_L()
       
   250     {
       
   251     ///////////////////////////////////////
       
   252     //   ID: CAMC_API.VIDEOTYPEL_002
       
   253     //   Action :
       
   254     //        Call VideoType when opened Without Specifying VideoType, not recording
       
   255     //   Output : 
       
   256     //        must be sensible ??
       
   257     ///////////////////////////////////////    
       
   258     
       
   259     iCamcTestClient->Start_Active_ObjectL(K_Tc6_VideoTypeLWhenOpenWithoutSpecifyingVideoTypeAndNotRecording, iUiLevelCameraHandle);
       
   260     }
       
   261 
       
   262 void CCamcTest_6::VideoTypeL_003_L()
       
   263     {
       
   264     ///////////////////////////////////////
       
   265     //   ID: CAMC_API.VIDEOTYPEL_003
       
   266     //   Action :
       
   267     //        Call VideoType when opened with specified type, recording
       
   268     //   Output : 
       
   269     //        compare
       
   270     ///////////////////////////////////////    
       
   271     
       
   272     iCamcTestClient->Start_Active_ObjectL(K_Tc6_VideoTypeLWhenOpenWithMimeAndRecording, iUiLevelCameraHandle);
       
   273     }
       
   274 
       
   275 void CCamcTest_6::VideoTypeL_004_L()
       
   276     {
       
   277     ///////////////////////////////////////
       
   278     //   ID: CAMC_API.VIDEOTYPEL_004
       
   279     //   Action :
       
   280     //        Call VideoType when open with NULL, not recording. 
       
   281     //   Output : 
       
   282     //        compare (seted acceptable)
       
   283     ///////////////////////////////////////    
       
   284     
       
   285     iCamcTestClient->Start_Active_ObjectL(K_Tc6_VideoTypeLWhenOpenWithNULLAndNotRecording, iUiLevelCameraHandle);
       
   286     }
       
   287 
       
   288 void CCamcTest_6::VideoTypeL_005_L()
       
   289     {
       
   290     ///////////////////////////////////////
       
   291     //   ID: CAMC_API.VIDEOTYPEL_005
       
   292     //   Action :
       
   293     //        Call VideoType 
       
   294     //   Output : 
       
   295     //        compare
       
   296     ///////////////////////////////////////    
       
   297     
       
   298     iCamcTestClient->Start_Active_ObjectL(K_Tc6_VideoTypeLWhenOpenWithMimeAndNotRecordingNewFormat, iUiLevelCameraHandle);
       
   299     }
       
   300 
       
   301 /**************************/
       
   302 /*       AUDIO TYPE       */
       
   303 /**************************/ 
       
   304 
       
   305 void CCamcTest_6::AudioTypeL_001_L()
       
   306     {
       
   307     ///////////////////////////////////////
       
   308     //   ID: CAMC_API.AUDIOTYPEL_001
       
   309     //   Action :
       
   310     //        Call AudioType when open with fourCC, not recording
       
   311     //   Output : 
       
   312     //        compare
       
   313     ///////////////////////////////////////    
       
   314     
       
   315     iCamcTestClient->Start_Active_ObjectL(K_Tc6_AudioTypeLWhenOpenWithfourCCAndNotRecording, iUiLevelCameraHandle);
       
   316     }
       
   317 
       
   318 void CCamcTest_6::AudioTypeL_002_L()
       
   319     {
       
   320     ///////////////////////////////////////
       
   321     //   ID: CAMC_API.AUDIOTYPEL_002
       
   322     //   Action :
       
   323     //        Call AudioType when open without specifying the audio type, not recording
       
   324     //   Output : 
       
   325     //        must be sensible ??
       
   326     ///////////////////////////////////////    
       
   327     
       
   328     iCamcTestClient->Start_Active_ObjectL(K_Tc6_AudioTypeLWhenOpenWithoutSpecifyingAudioTypeAndNotRecording, iUiLevelCameraHandle);
       
   329     }
       
   330 
       
   331 void CCamcTest_6::AudioTypeL_003_L()
       
   332     {
       
   333     ///////////////////////////////////////
       
   334     //   ID: CAMC_API.AUDIOTYPEL_003
       
   335     //   Action :
       
   336     //        Call AudioType when open with fourCC, recording
       
   337     //   Output : 
       
   338     //        compare
       
   339     ///////////////////////////////////////    
       
   340     
       
   341     iCamcTestClient->Start_Active_ObjectL(K_Tc6_AudioTypeLWhenOpenWithfourCCAndRecording, iUiLevelCameraHandle);
       
   342     }
       
   343 
       
   344 /**************************/
       
   345 /*     SET VIDEO TYPE     */
       
   346 /**************************/ 
       
   347 
       
   348 void CCamcTest_6::SetVideoTypeL_005_L()
       
   349     {
       
   350     ///////////////////////////////////////
       
   351     //   ID: CAMC_API.SETVIDEOTYPEL_005
       
   352     //   Action :
       
   353     //        Call SetVideoType when open without specifying the videoType. 
       
   354     //   Output : 
       
   355     //        compare (seted acceptable)
       
   356     ///////////////////////////////////////    
       
   357     
       
   358     iCamcTestClient->Start_Active_ObjectL(K_Tc6_SetVideoTypeLWhenOpenWithoutSpecifyingVideoTypeAndNotRecording, iUiLevelCameraHandle);
       
   359     }
       
   360 
       
   361 void CCamcTest_6::SetVideoTypeL_006_L()
       
   362     {
       
   363     ///////////////////////////////////////
       
   364     //   ID: CAMC_API.SETVIDEOTYPEL_006
       
   365     //   Action : 
       
   366     //        SetVideoTypeL called with "video/mp4v-es; profile=8" 
       
   367     //   Output : 
       
   368     //        compare (seted acceptable)
       
   369     ///////////////////////////////////////    
       
   370     
       
   371     iCamcTestClient->Start_Active_ObjectL(K_Tc6_SetVideoTypeLWithProfile8, iUiLevelCameraHandle);
       
   372     }
       
   373 
       
   374 void CCamcTest_6::SetVideoTypeL_007_L()
       
   375     {
       
   376     ///////////////////////////////////////
       
   377     //   ID: CAMC_API.SETVIDEOTYPEL_007
       
   378     //   Action :
       
   379     //        SetVideoType when not recording, set wrong 
       
   380     //   Output : 
       
   381     //        Leave with KErrArgument
       
   382     ///////////////////////////////////////    
       
   383     
       
   384     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc6_SetVideoTypeLWhenNotRecording, iUiLevelCameraHandle));
       
   385     assertTIntsEqualL( KErrNotSupported, err );
       
   386     }
       
   387 
       
   388 void CCamcTest_6::SetVideoTypeL_008_L()
       
   389     {
       
   390     ///////////////////////////////////////
       
   391     //   ID: CAMC_API.SETVIDEOTYPEL_008
       
   392     //   Action :
       
   393     //        SetVideoTypeL called with "video/H263-2000; profile=0" 
       
   394     //   Output : 
       
   395     //        compare (seted acceptable)
       
   396     ///////////////////////////////////////    
       
   397     
       
   398     iCamcTestClient->Start_Active_ObjectL(K_Tc6_SetVideoTypeLWithProfile, iUiLevelCameraHandle);
       
   399     }
       
   400 
       
   401 void CCamcTest_6::SetVideoTypeL_009_L()
       
   402     {
       
   403     ///////////////////////////////////////
       
   404     //   ID: CAMC_API.SETVIDEOTYPEL_009
       
   405     //   Action :
       
   406     //        SetVideoTypeL called with "video/mp4v-es; profile-level-id=3" 
       
   407     //   Output : 
       
   408     //        compare (seted acceptable)
       
   409     ///////////////////////////////////////    
       
   410     
       
   411     iCamcTestClient->Start_Active_ObjectL(K_Tc6_SetVideoTypeLWithProfile3, iUiLevelCameraHandle);
       
   412     }
       
   413 
       
   414 /**************************/
       
   415 /*     SET AUDIO TYPE     */
       
   416 /**************************/ 
       
   417 
       
   418 void CCamcTest_6::SetAudioTypeL_005_L()
       
   419     {
       
   420     ///////////////////////////////////////
       
   421     //   ID: CAMC_API.SETAUDIOTYPEL_005
       
   422     //   Action :
       
   423     //        Call SetAudioType when open Without Specifying Audio Type, not recording. 
       
   424     //   Output : 
       
   425     //        compare (seted acceptable)
       
   426     ///////////////////////////////////////    
       
   427     
       
   428     iCamcTestClient->Start_Active_ObjectL(K_Tc6_SetAudioTypeLWhenOpenWithoutSpecifyingAudioTypeAndNotRecording, iUiLevelCameraHandle);
       
   429     }
       
   430 
       
   431 void CCamcTest_6::SetAudioTypeL_007_L()
       
   432     {
       
   433     ///////////////////////////////////////
       
   434     //   ID: CAMC_API.SETAUDIOTYPEL_007
       
   435     //   Action :
       
   436     //        SetAudioType when not recording, set wrong 
       
   437     //   Output : 
       
   438     //        Leave with KErrArgument
       
   439     ///////////////////////////////////////    
       
   440     
       
   441     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc6_SetAudioTypeLWhenNotRecording, iUiLevelCameraHandle));
       
   442     assertTIntsEqualL( KErrNotSupported, err );
       
   443     }
       
   444 
       
   445 void CCamcTest_6::SetAudioTypeL_008_L()
       
   446     {
       
   447     ///////////////////////////////////////
       
   448     //   ID: CAMC_API.SETAUDIOTYPEL_008
       
   449     //   Action :
       
   450     //        Call SetAudioType when open with fourCC, not recording. 
       
   451     //   Output : 
       
   452     //        compare (seted different acceptable)
       
   453     ///////////////////////////////////////    
       
   454     
       
   455     iCamcTestClient->Start_Active_ObjectL(K_Tc6_SetAudioTypeLWhenOpenWithfourCCAndNotRecording_AAC, iUiLevelCameraHandle);
       
   456     }
       
   457 
       
   458 
       
   459 /***************************************/
       
   460 /*CONTROLLER IMPLEMENTATION INFORMATION*/
       
   461 /***************************************/
       
   462 
       
   463 void CCamcTest_6::ControllerImplementationInformationL_001_L()
       
   464     {
       
   465     ///////////////////////////////////////
       
   466     //   ID: CAMC_API.CONTROLLERIMPLEMENTATIONINFORMATIONL_001
       
   467     //   Action :
       
   468     //        ControllerImplementationInformationL when not open
       
   469     //   Output : 
       
   470     //        Leave with KErrArgument
       
   471     ///////////////////////////////////////   
       
   472     
       
   473     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc6_ControllerImplementationInformationWhenNotOpen, iUiLevelCameraHandle));
       
   474     assertTIntsEqualL( KErrNotReady, err );
       
   475     }
       
   476 
       
   477 void CCamcTest_6::ControllerImplementationInformationL_002_L()
       
   478     {
       
   479     ///////////////////////////////////////
       
   480     //   ID: CAMC_API.CONTROLLERIMPLEMENTATIONINFORMATIONL_002
       
   481     //   Action :
       
   482     //        ControllerImplementationInformationL when open
       
   483     //   Output : 
       
   484     //        must be sensible
       
   485     ///////////////////////////////////////   
       
   486     
       
   487     iCamcTestClient->Start_Active_ObjectL(K_Tc6_ControllerImplementationInformationWhenOpen, iUiLevelCameraHandle);
       
   488     }
       
   489 
       
   490 void CCamcTest_6::ControllerImplementationInformationL_003_L()
       
   491     {
       
   492     ///////////////////////////////////////
       
   493     //   ID: CAMC_API.CONTROLLERIMPLEMENTATIONINFORMATIONL_003
       
   494     //   Action :
       
   495     //        ControllerImplementationInformationL when open
       
   496     //   Output : 
       
   497     //        must be sensible
       
   498     ///////////////////////////////////////   
       
   499     
       
   500     iCamcTestClient->Start_Active_ObjectL(K_Tc6_ControllerImplementationInformationWhenOpenNew, iUiLevelCameraHandle);
       
   501     }
       
   502 
       
   503 void CCamcTest_6::ControllerImplementationInformationL_004_L()
       
   504     {
       
   505     ///////////////////////////////////////
       
   506     //   ID: CAMC_API.CONTROLLERIMPLEMENTATIONINFORMATIONL_004
       
   507     //   Action :
       
   508     //        ControllerImplementationInformationL when open
       
   509     //   Output : 
       
   510     //        must be sensible
       
   511     ///////////////////////////////////////   
       
   512     
       
   513     iCamcTestClient->Start_Active_ObjectL(K_Tc6_ControllerImplementationInformationWhenOpenNew_MPEG4, iUiLevelCameraHandle);
       
   514     }
       
   515 
       
   516 
       
   517 
       
   518 /**************************/
       
   519 /*         DURATION       */
       
   520 /**************************/ 
       
   521 
       
   522 void CCamcTest_6::DurationL_001_L()
       
   523     {
       
   524     ///////////////////////////////////////
       
   525     //   ID: CAMC_API.DURATIONL_001
       
   526     //   Action :
       
   527     //        DurationL when recording
       
   528     //   Output : 
       
   529     //        Must be close to timeout*n time
       
   530     ///////////////////////////////////////   
       
   531     
       
   532     iCamcTestClient->Start_Active_ObjectL(K_Tc6_DurationWhenRecording, iUiLevelCameraHandle);
       
   533     }
       
   534 
       
   535 void CCamcTest_6::DurationL_002_L()
       
   536     {
       
   537     ///////////////////////////////////////
       
   538     //   ID: CAMC_API.DURATIONL_002
       
   539     //   Action :
       
   540     //        DurationL when not recording
       
   541     //   Output : 
       
   542     //        Value must be 0
       
   543     ///////////////////////////////////////   
       
   544     
       
   545     iCamcTestClient->Start_Active_ObjectL(K_Tc6_DurationWhenNotRecording, iUiLevelCameraHandle);
       
   546     }
       
   547 
       
   548 void CCamcTest_6::DurationL_003_L()
       
   549     {
       
   550     ///////////////////////////////////////
       
   551     //   ID: CAMC_API.DURATIONL_003
       
   552     //   Action :
       
   553     //        Recording paused then resumed 
       
   554     //   Output : 
       
   555     //        Pause, Resume and Ask Duration frequently using timer
       
   556     ///////////////////////////////////////   
       
   557     
       
   558     iCamcTestClient->Start_Active_ObjectL(K_Tc6_DurationWhenPaused, iUiLevelCameraHandle);
       
   559     }
       
   560 
       
   561 
       
   562 /**************************/
       
   563 /*     Registration       */
       
   564 /**************************/ 
       
   565 
       
   566 
       
   567 void CCamcTest_6::MMFRegistration_001_L()
       
   568     {
       
   569     ///////////////////////////////////////
       
   570     //   ID: CAMC_API.MMFREGISTRATION_001
       
   571     //   Action :
       
   572     //        Check that camcorder registration was sucessfull.
       
   573     //        Ask for Controller UID, Version, Supplier, Supported media UID
       
   574     //        and Formats.
       
   575     //   Output : 
       
   576     //        must be sensible
       
   577     ///////////////////////////////////////   
       
   578     
       
   579     /////////////////////////////////////////////////////
       
   580     // Retrieve a list of possible controllers from ECOM
       
   581     CMMFControllerPluginSelectionParameters * cSelect = CMMFControllerPluginSelectionParameters::NewLC();
       
   582     CMMFFormatSelectionParameters * fSelect = CMMFFormatSelectionParameters::NewLC();
       
   583 
       
   584     fSelect->SetMatchToMimeTypeL(_L8("video/3gpp"));
       
   585     cSelect->SetRequiredRecordFormatSupportL(*fSelect);
       
   586     
       
   587     RMMFControllerImplInfoArray controllers;
       
   588     CleanupResetAndDestroyPushL(controllers);
       
   589     cSelect->ListImplementationsL(controllers);
       
   590     
       
   591     // Only one Controller is expected to be found
       
   592     // This might change in the future.
       
   593     if (controllers.Count() !=1 )
       
   594         {
       
   595         User::Leave(K_Tc6_ErrExpectingADifferentValue);
       
   596         }
       
   597     iCamcTestClient->CheckControllerImplementationInformationL ( *controllers[0] );
       
   598 
       
   599     CleanupStack::PopAndDestroy(3);
       
   600 
       
   601     }
       
   602 
       
   603 void CCamcTest_6::MMFRegistration_002_L()
       
   604     {
       
   605     ///////////////////////////////////////
       
   606     //   ID: CAMC_API.MMFREGISTRATION_002
       
   607     //   Action :
       
   608     //        Check that camcorder registration was sucessfull.
       
   609     //        Ask for :Controller UID, Version, Supplier, 
       
   610     //        Supported Media UIDs and Formats
       
   611     //   Output : 
       
   612     //        must be sensible
       
   613     ///////////////////////////////////////   
       
   614     
       
   615     /////////////////////////////////////////////////////
       
   616     // Retrieve a list of possible controllers from ECOM
       
   617     CMMFControllerPluginSelectionParameters * cSelect = CMMFControllerPluginSelectionParameters::NewLC();
       
   618     CMMFFormatSelectionParameters * fSelect = CMMFFormatSelectionParameters::NewLC();
       
   619 
       
   620     fSelect->SetMatchToMimeTypeL(_L8("video/3gpp2"));
       
   621     cSelect->SetRequiredRecordFormatSupportL(*fSelect);
       
   622     
       
   623     RMMFControllerImplInfoArray controllers;
       
   624     CleanupResetAndDestroyPushL(controllers);
       
   625     cSelect->ListImplementationsL(controllers);
       
   626     
       
   627     // Only one Controller is expected to be found
       
   628     // This might change in the future.
       
   629     if (controllers.Count() !=1 )
       
   630         {
       
   631         User::Leave(K_Tc6_ErrExpectingADifferentValue);
       
   632         }
       
   633     iCamcTestClient->CheckControllerImplementationInformationNewL ( *controllers[0] );
       
   634 
       
   635     CleanupStack::PopAndDestroy(3);
       
   636 
       
   637     }
       
   638 
       
   639 void CCamcTest_6::MMFRegistration_003_L()
       
   640     {
       
   641     ///////////////////////////////////////
       
   642     //   ID: CAMC_API.MMFREGISTRATION_003
       
   643     //   Action :
       
   644     //        Check that camcorder registration was sucessfull.
       
   645     //        Ask for Controller UID, Version, Supplier, Supported media UID
       
   646     //        and Formats.
       
   647     //   Output : 
       
   648     //        must be sensible
       
   649     ///////////////////////////////////////   
       
   650     
       
   651     /////////////////////////////////////////////////////
       
   652     // Retrieve a list of possible controllers from ECOM
       
   653     CMMFControllerPluginSelectionParameters * cSelect = CMMFControllerPluginSelectionParameters::NewLC();
       
   654     CMMFFormatSelectionParameters * fSelect = CMMFFormatSelectionParameters::NewLC();
       
   655 
       
   656     fSelect->SetMatchToMimeTypeL(_L8("video/3gpp"));
       
   657     cSelect->SetRequiredRecordFormatSupportL(*fSelect);
       
   658     
       
   659     RMMFControllerImplInfoArray controllers;
       
   660     CleanupResetAndDestroyPushL(controllers);
       
   661     cSelect->ListImplementationsL(controllers);
       
   662     
       
   663     // Only one Controller is expected to be found
       
   664     // This might change in the future.
       
   665     if (controllers.Count() !=1 )
       
   666         {
       
   667         User::Leave(K_Tc6_ErrExpectingADifferentValue);
       
   668         }
       
   669     iCamcTestClient->CheckControllerImplementationInformationNewL ( *controllers[0] );
       
   670 
       
   671     CleanupStack::PopAndDestroy(3);
       
   672 
       
   673     }
       
   674 
       
   675 void CCamcTest_6::MMFRegistration_004_L()
       
   676     {
       
   677     ///////////////////////////////////////
       
   678     //   ID: CAMC_API.MMFREGISTRATION_004
       
   679     //   Action :
       
   680     //        Check that camcorder registration was sucessfull.
       
   681     //        Ask for Controller UID, Version, Supplier, Supported media UID
       
   682     //        and Formats.
       
   683     //   Output : 
       
   684     //        must be sensible
       
   685     ///////////////////////////////////////   
       
   686     
       
   687     /////////////////////////////////////////////////////
       
   688     // Retrieve a list of possible controllers from ECOM
       
   689     CMMFControllerPluginSelectionParameters * cSelect = CMMFControllerPluginSelectionParameters::NewLC();
       
   690     CMMFFormatSelectionParameters * fSelect = CMMFFormatSelectionParameters::NewLC();
       
   691 
       
   692     fSelect->SetMatchToMimeTypeL(_L8("video/mp4"));
       
   693     cSelect->SetRequiredRecordFormatSupportL(*fSelect);
       
   694     
       
   695     RMMFControllerImplInfoArray controllers;
       
   696     CleanupResetAndDestroyPushL(controllers);
       
   697     cSelect->ListImplementationsL(controllers);
       
   698     
       
   699     // Only one Controller is expected to be found
       
   700     // This might change in the future.
       
   701     if (controllers.Count() !=1 )
       
   702         {
       
   703         User::Leave(K_Tc6_ErrExpectingADifferentValue);
       
   704         }
       
   705     iCamcTestClient->CheckControllerImplementationInformationNewMPEG4L ( *controllers[0] );
       
   706 
       
   707     CleanupStack::PopAndDestroy(3);
       
   708 
       
   709     }
       
   710 
       
   711 
       
   712 void CCamcTest_6::MMFRegistration_005_L()
       
   713     {
       
   714     ///////////////////////////////////////
       
   715     //   ID: CAMC_API.MMFREGISTRATION_005
       
   716     //   Action :
       
   717     //        Check that camcorder registration was sucessfull.
       
   718     //        Ask for Controller UID, Version, Supplier, Supported media UID
       
   719     //        and Formats.
       
   720     //   Output : 
       
   721     //        must be sensible
       
   722     ///////////////////////////////////////   
       
   723     
       
   724     /////////////////////////////////////////////////////
       
   725     // Retrieve a list of possible controllers from ECOM
       
   726     CMMFControllerPluginSelectionParameters * cSelect = CMMFControllerPluginSelectionParameters::NewLC();
       
   727     CMMFFormatSelectionParameters * fSelect = CMMFFormatSelectionParameters::NewLC();
       
   728 
       
   729     fSelect->SetMatchToMimeTypeL(_L8("video/3gpp2"));
       
   730     cSelect->SetRequiredRecordFormatSupportL(*fSelect);
       
   731     
       
   732     RMMFControllerImplInfoArray controllers;
       
   733     CleanupResetAndDestroyPushL(controllers);
       
   734     cSelect->ListImplementationsL(controllers);
       
   735     
       
   736     // Only one Controller is expected to be found
       
   737     // This might change in the future.
       
   738     if (controllers.Count() !=1 )
       
   739         {
       
   740         User::Leave(K_Tc6_ErrExpectingADifferentValue);
       
   741         }
       
   742     iCamcTestClient->CheckControllerImplementationInformationNewMPEG4L ( *controllers[0] );
       
   743 
       
   744     CleanupStack::PopAndDestroy(3);
       
   745 
       
   746     }
       
   747 
       
   748 
       
   749 void CCamcTest_6::MMFRegistration_006_L()
       
   750     {
       
   751     ///////////////////////////////////////
       
   752     //   ID: CAMC_API.MMFREGISTRATION_006
       
   753     //   Action :
       
   754     //        Check that camcorder registration was sucessfull.
       
   755     //        Ask for Controller UID, Version, Supplier, Supported media UID
       
   756     //        and Formats.
       
   757     //   Output : 
       
   758     //        must be sensible
       
   759     ///////////////////////////////////////   
       
   760     
       
   761     /////////////////////////////////////////////////////
       
   762     // Retrieve a list of possible controllers from ECOM
       
   763     CMMFControllerPluginSelectionParameters * cSelect = CMMFControllerPluginSelectionParameters::NewLC();
       
   764     CMMFFormatSelectionParameters * fSelect = CMMFFormatSelectionParameters::NewLC();
       
   765 
       
   766     fSelect->SetMatchToMimeTypeL(_L8("video/3gpp"));
       
   767     cSelect->SetRequiredRecordFormatSupportL(*fSelect);
       
   768     
       
   769     RMMFControllerImplInfoArray controllers;
       
   770     CleanupResetAndDestroyPushL(controllers);
       
   771     cSelect->ListImplementationsL(controllers);
       
   772     
       
   773     // Only one Controller is expected to be found
       
   774     // This might change in the future.
       
   775     if (controllers.Count() !=1 )
       
   776         {
       
   777         User::Leave(K_Tc6_ErrExpectingADifferentValue);
       
   778         }
       
   779     iCamcTestClient->CheckControllerImplementationInformationNewMPEG4L ( *controllers[0] );
       
   780 
       
   781     CleanupStack::PopAndDestroy(3);
       
   782 
       
   783     }
       
   784 
       
   785 
       
   786 
       
   787 // //////////////////////////////////////////////////////////////////
       
   788 //   Dummy Camera API callback functions
       
   789 // //////////////////////////////////////////////////////////////////
       
   790 void CCamcTest_6::ReserveComplete(TInt /*aError*/)
       
   791     {
       
   792     RDebug::Print(_L("CCamcTest_6::ReserveComplete"));
       
   793         
       
   794     // UI level camera is being initialized        
       
   795     if (iWaitScheduler->IsStarted())
       
   796 	    {
       
   797     	 iUiLevelCamera->PowerOn();
       
   798     	 return;
       
   799 	    }
       
   800     }
       
   801 
       
   802 void CCamcTest_6::PowerOnComplete(TInt /*aError*/)
       
   803     {   
       
   804     RDebug::Print(_L("CCamcTest_6::PowerOnComplete"));
       
   805 
       
   806     // UI level camera is being initialized
       
   807     if (iWaitScheduler->IsStarted())
       
   808 	    {
       
   809     	 iWaitScheduler->AsyncStop();
       
   810     	 return;
       
   811     	}        
       
   812     }
       
   813 
       
   814 void CCamcTest_6::ViewFinderFrameReady(CFbsBitmap& /*aFrame*/)
       
   815     {
       
   816     }
       
   817 void CCamcTest_6::ImageReady(CFbsBitmap* /*aBitmap */,HBufC8* /*aData*/,TInt /*aError*/)
       
   818     {    
       
   819     }
       
   820 void CCamcTest_6::FrameBufferReady(MFrameBuffer* /*aFrameBuffer*/,TInt /*aError*/ )
       
   821     {
       
   822     }
       
   823 
       
   824   
       
   825 // -----------------------------------------------------------------------------
       
   826 // CCamcTest_6::HandleEvent
       
   827 // MCameraObserver2 call-back handler
       
   828 // -----------------------------------------------------------------------------
       
   829 //
       
   830 void CCamcTest_6::HandleEvent( const TECAMEvent& aEvent)
       
   831     {
       
   832     PRINT(( _L( "CCamcTest_6::HandleEvent() entering, type=%x, err=%d" ), aEvent.iEventType.iUid, aEvent.iErrorCode ));
       
   833 
       
   834     if ( aEvent.iEventType == KUidECamEventCameraNoLongerReserved )
       
   835         {
       
   836         PRINT(( _L( "CCamcTest_6::HandleEvent() KUidECamEventCameraNoLongerReserved" ) ));
       
   837         }
       
   838     else if ( aEvent.iEventType == KUidECamEventPowerOnComplete )
       
   839         {
       
   840         PRINT(( _L( "CCamcTest_6::HandleEvent() KUidECamEventPowerOnComplete" ) ));
       
   841         PowerOnComplete( aEvent.iErrorCode );
       
   842         }
       
   843     else if ( aEvent.iEventType == KUidECamEventReserveComplete )
       
   844        {
       
   845        PRINT(( _L( "CCamcTest_6::HandleEvent() KUidECamEventReserveComplete" ) ));
       
   846        ReserveComplete( aEvent.iErrorCode );
       
   847        }
       
   848 
       
   849     PRINT(( _L( "CCamcTestClient_7::HandleEvent() returning" ) ));
       
   850     }
       
   851 
       
   852 // -----------------------------------------------------------------------------
       
   853 // CCamcTest_6::ViewFinderReady
       
   854 // MCameraObserver2 call-back handler
       
   855 // -----------------------------------------------------------------------------
       
   856 //
       
   857 void CCamcTest_6::ViewFinderReady( MCameraBuffer& aCameraBuffer, TInt aError)
       
   858     {
       
   859     PRINT(( _L( "CCamcTest_6::ViewFinderReady() NOT HANDLED err=%d, NumFrames=%d" ), aError, aCameraBuffer.NumFrames() ));
       
   860     CFbsBitmap *buffer = NULL;
       
   861     if ( !aError )
       
   862         {
       
   863 	    aCameraBuffer.Release();
       
   864         }
       
   865     ViewFinderFrameReady( *buffer );
       
   866     }
       
   867 
       
   868 // -----------------------------------------------------------------------------
       
   869 // CCamcTest_6::ImageBufferReady
       
   870 // MCameraObserver2 call-back handler
       
   871 // -----------------------------------------------------------------------------
       
   872 //
       
   873 void CCamcTest_6::ImageBufferReady( MCameraBuffer& aCameraBuffer, TInt aError)
       
   874     {
       
   875     PRINT(( _L( "CCamcTest_6::ImageBufferReady() BUFFER NOT HANDLED, err=%d, NumFrames=%d" ), aError, aCameraBuffer.NumFrames() ));
       
   876 	
       
   877     if ( !aError )
       
   878         {
       
   879 	    aCameraBuffer.Release();
       
   880         }
       
   881     ImageReady( NULL, NULL, aError );
       
   882     }
       
   883     
       
   884 // -----------------------------------------------------------------------------
       
   885 // CCamcTest_6::VideoBufferReady
       
   886 // MCameraObserver2 call-back handler
       
   887 // -----------------------------------------------------------------------------
       
   888 //
       
   889 void CCamcTest_6::VideoBufferReady( MCameraBuffer& aCameraBuffer, TInt aError)
       
   890     {
       
   891     PRINT(( _L( "CCamcTest_6::VideoBufferReady() entering, err=%d, NumFrames=%d" ), aError, aCameraBuffer.NumFrames() ));
       
   892     MFrameBuffer* buffer = NULL;
       
   893 	
       
   894     if ( !aError )
       
   895         {
       
   896         aCameraBuffer.Release();
       
   897         }
       
   898     // Call old Camera-API observer handler
       
   899     FrameBufferReady( buffer, aError );
       
   900     
       
   901     PRINT(( _L( "CCamcTest_6::VideoBufferReady() returning" )));
       
   902     }
       
   903 
       
   904 
       
   905 
       
   906 /*********************************************************************************************/
       
   907 
       
   908 
       
   909 MTest* CCamcTest_6::suiteL ()
       
   910     {
       
   911     // Always use NewL (Do not use NewLC) !!!
       
   912     CTestSuite *suite = CTestSuite::NewL(_L8("CCamcTest_6")); 
       
   913 
       
   914     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.PAUSEL_003"), &PauseL_003_L));
       
   915 
       
   916     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.SETVIDEOFRAMESIZEL_005"), &SetVideoFrameSizeL_005_L));
       
   917 
       
   918     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.SETAUDIOENABLEDL_005"), &SetAudioEnabledL_005_L));
       
   919 
       
   920     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.SETMAXCLIPSIZEL_006"), &SetMaxClipSizeL_006_L));
       
   921     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.SETMAXCLIPSIZEL_007"), &SetMaxClipSizeL_007_L));
       
   922 
       
   923     // Record_006, only to be tested on HW
       
   924     // Removed from MuDo tests
       
   925 #if !( defined (__WINS__) || defined (__WINSCW__) )
       
   926 //    suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.RECORD_006"), &Record_006_L));
       
   927 #endif
       
   928     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.RECORD_007"), &Record_007_L));
       
   929 
       
   930     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.VIDEOTYPEL_001"), &VideoTypeL_001_L));
       
   931     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.VIDEOTYPEL_002"), &VideoTypeL_002_L));
       
   932     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.VIDEOTYPEL_003"), &VideoTypeL_003_L));
       
   933     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.VIDEOTYPEL_004"), &VideoTypeL_004_L));
       
   934    
       
   935 #ifdef __MPEG4_VIDEO_ENCODING
       
   936     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.VIDEOTYPEL_005"), &VideoTypeL_005_L));
       
   937 #endif
       
   938 
       
   939     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.AUDIOTYPEL_001"), &AudioTypeL_001_L));
       
   940     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.AUDIOTYPEL_002"), &AudioTypeL_002_L));
       
   941     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.AUDIOTYPEL_003"), &AudioTypeL_003_L));
       
   942  
       
   943     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.SETVIDEOTYPEL_005"), &SetVideoTypeL_005_L));
       
   944    
       
   945 #ifdef __MPEG4_VIDEO_ENCODING
       
   946     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.SETVIDEOTYPEL_006"), &SetVideoTypeL_006_L));
       
   947 #endif
       
   948     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.SETVIDEOTYPEL_007"), &SetVideoTypeL_007_L));
       
   949     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.SETVIDEOTYPEL_008"), &SetVideoTypeL_008_L));
       
   950 
       
   951 #ifdef MP4_FILE_FORMAT_SUPPORTED
       
   952 #if ((!defined __WINS__) || (!defined __WINSCW__)) // AAC supported only in HW
       
   953     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.SETVIDEOTYPEL_009"), &SetVideoTypeL_009_L));
       
   954 #endif
       
   955 #endif
       
   956     
       
   957     
       
   958     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.SETAUDIOTYPEL_005"), &SetAudioTypeL_005_L));
       
   959     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.SETAUDIOTYPEL_007"), &SetAudioTypeL_007_L));   
       
   960 
       
   961 #ifdef MP4_FILE_FORMAT_SUPPORTED
       
   962 #if ((!defined __WINS__) || (!defined __WINSCW__)) // AAC supported only in HW
       
   963     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.SETAUDIOTYPEL_008"), &SetAudioTypeL_008_L));
       
   964 #endif
       
   965 #endif
       
   966 
       
   967     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.CONTROLLERIMPLEMENTATIONINFORMATIONL_001"), &ControllerImplementationInformationL_001_L));   
       
   968 #ifndef MP4_FILE_FORMAT_SUPPORTED
       
   969     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.CONTROLLERIMPLEMENTATIONINFORMATIONL_003"), &ControllerImplementationInformationL_003_L));   
       
   970 #else
       
   971     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.CONTROLLERIMPLEMENTATIONINFORMATIONL_004"), &ControllerImplementationInformationL_004_L));   
       
   972 #endif
       
   973 
       
   974 #ifndef MP4_FILE_FORMAT_SUPPORTED
       
   975     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.MMFREGISTRATION_002"), &MMFRegistration_002_L));   
       
   976     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.MMFREGISTRATION_003"), &MMFRegistration_003_L));   
       
   977 #else
       
   978     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.MMFREGISTRATION_004"), &MMFRegistration_004_L));   
       
   979     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.MMFREGISTRATION_005"), &MMFRegistration_005_L));   
       
   980     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.MMFREGISTRATION_006"), &MMFRegistration_006_L));   
       
   981 #endif
       
   982 
       
   983     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.DURATIONL_001"), &DurationL_001_L));   
       
   984     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.DURATIONL_002"), &DurationL_002_L));   
       
   985     suite->addTestL(CTestCaller<CCamcTest_6>::NewL(_L8("CAMC_API.DURATIONL_003"), &DurationL_003_L));   
       
   986 
       
   987     return suite;
       
   988     }
       
   989