videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp
branchRCL_3
changeset 21 315810614048
parent 16 67eb01668b0e
equal deleted inserted replaced
20:2d690156cf8f 21:315810614048
    13 *
    13 *
    14 * Description:  Test Harness for VideoHelixPlaybackPlugin
    14 * Description:  Test Harness for VideoHelixPlaybackPlugin
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: e003sa33#24.1.1 %
    18 // Version : %version: 26 %
    19 
    19 
    20 
    20 
    21 // [INCLUDE FILES] - do not remove
    21 // [INCLUDE FILES] - do not remove
    22 #include <e32svr.h>
    22 #include <e32svr.h>
    23 #include <stifparser.h>
    23 #include <stifparser.h>
   118         ENTRY( "HandleVolume", CVHPPTestClass::HandleVolumeL ),
   118         ENTRY( "HandleVolume", CVHPPTestClass::HandleVolumeL ),
   119 
   119 
   120         ENTRY ("InitializeWithPositionL", CVHPPTestClass::InitializeWithPositionL),
   120         ENTRY ("InitializeWithPositionL", CVHPPTestClass::InitializeWithPositionL),
   121         ENTRY ("InitializeLinkWithPositionL", CVHPPTestClass::InitializeLinkWithPositionL),
   121         ENTRY ("InitializeLinkWithPositionL", CVHPPTestClass::InitializeLinkWithPositionL),
   122         ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL),
   122         ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL),
   123         ENTRY ( "InitializeStreamingWithSdpFileHandleL", 
   123         ENTRY ( "InitializeStreamingWithSdpFileHandleL", CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ),
   124         		CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ),
   124         ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL )
   125         ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL )        
       
   126 
   125 
   127         //
   126         //
   128         //  ADD NEW ENTRIES HERE
   127         //  ADD NEW ENTRIES HERE
   129         //
   128         //
   130         // ENTRY( "SendPlayCommandToServer",
   129         // ENTRY( "SendPlayCommandToServer",
   288     MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeL()"));
   287     MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeL()"));
   289     iLog->Log(_L("CVHPPTestClass::InitializeL()"));
   288     iLog->Log(_L("CVHPPTestClass::InitializeL()"));
   290 
   289 
   291     TInt duration;
   290     TInt duration;
   292     TInt volumeSteps;
   291     TInt volumeSteps;
   293     
   292 
   294     TInt err = aItem.GetNextInt( duration );
   293     TInt err = aItem.GetNextInt( duration );
   295 
   294 
   296     if ( err == KErrNone )
   295     if ( err == KErrNone )
   297     {
   296     {
   298         //
   297         //
   304         event->iData  = duration;
   303         event->iData  = duration;
   305         event->iError = KErrNone;
   304         event->iError = KErrNone;
   306 
   305 
   307         AddExpectedEvent( event );
   306         AddExpectedEvent( event );
   308 
   307 
   309         // 
   308         //
   310         // read number of volume steps
   309         // read number of volume steps
   311         //
   310         //
   312         err = aItem.GetNextInt( volumeSteps );
   311         err = aItem.GetNextInt( volumeSteps );
   313         
   312 
   314         if ( err == KErrNone )
   313         if ( err == KErrNone )
   315         {        
   314         {
   316             //
   315             //
   317             // set volume steps
   316             // set volume steps
   318             //
   317             //
   319             SetVolumeSteps( volumeSteps );
   318             SetVolumeSteps( volumeSteps );
   320             
   319 
   321             TBuf<120> fullPath;    
   320             TBuf<120> fullPath;
   322 
   321 
   323             err = ReadFileInitializationParameters( aItem, fullPath );
   322             err = ReadFileInitializationParameters( aItem, fullPath );
   324     
   323 
   325             if ( err == KErrNone )
   324             if ( err == KErrNone )
   326             {
   325             {
   327                 PreparePluginL();
   326                 PreparePluginL();
   328     
   327 
   329                 //
   328                 //
   330                 //  Initalize the Plugin with a file name
   329                 //  Initalize the Plugin with a file name
   331                 //
   330                 //
   332                 MPX_DEBUG(_L("Initialize the Plugin:  filename = %S"), &fullPath);
   331                 MPX_DEBUG(_L("Initialize the Plugin:  filename = %S"), &fullPath);
   333                 iLog->Log(_L("Initialize the Plugin:  filename = %S"), &fullPath);
   332                 iLog->Log(_L("Initialize the Plugin:  filename = %S"), &fullPath);
   334     
   333 
   335                 iPlaybackPlugin->InitialiseL( fullPath );
   334                 iPlaybackPlugin->InitialiseL( fullPath );
   336             }
   335             }
   337         }
   336         }
   338     }
   337     }
   339 
   338 
   366         event->iData  = duration;
   365         event->iData  = duration;
   367         event->iError = KErrNone;
   366         event->iError = KErrNone;
   368 
   367 
   369         AddExpectedEvent( event );
   368         AddExpectedEvent( event );
   370 
   369 
   371         // 
   370         //
   372         // read number of volume steps
   371         // read number of volume steps
   373         //
   372         //
   374         err = aItem.GetNextInt( volumeSteps );
   373         err = aItem.GetNextInt( volumeSteps );
   375         
   374 
   376         if ( err == KErrNone )
   375         if ( err == KErrNone )
   377         {        
   376         {
   378             //
   377             //
   379             // set volume steps
   378             // set volume steps
   380             //
   379             //
   381             SetVolumeSteps( volumeSteps );
   380             SetVolumeSteps( volumeSteps );
   382         
   381 
   383             TPtrC  link;
   382             TPtrC  link;
   384     
   383 
   385             //
   384             //
   386             //  Read in the link from the config file
   385             //  Read in the link from the config file
   387             //
   386             //
   388             TInt err = aItem.GetNextString( link );
   387             TInt err = aItem.GetNextString( link );
   389     
   388 
   390             if ( err == KErrNone )
   389             if ( err == KErrNone )
   391             {
   390             {
   392                 TInt err = ReadInitializationErrors( aItem );
   391                 TInt err = ReadInitializationErrors( aItem );
   393     
   392 
   394                 if ( err == KErrNone )
   393                 if ( err == KErrNone )
   395                 {
   394                 {
   396                     PreparePluginL();
   395                     PreparePluginL();
   397     
   396 
   398                     //
   397                     //
   399                     //  Extract the streaming link from the ram file and
   398                     //  Extract the streaming link from the ram file and
   400                     //  Initalize the Plugin with the link and an access point
   399                     //  Initalize the Plugin with the link and an access point
   401                     //
   400                     //
   402                     MPX_DEBUG(_L("Initialize the Plugin:  link = %S"), &link);
   401                     MPX_DEBUG(_L("Initialize the Plugin:  link = %S"), &link);
   403                     iLog->Log(_L("Initialize the Plugin:  link = %S"), &link);
   402                     iLog->Log(_L("Initialize the Plugin:  link = %S"), &link);
   404     
   403 
   405                     iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11 );
   404                     iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11 );
   406                 }
   405                 }
   407             }
   406             }
   408         }
   407         }
   409     }
   408     }
   461     iLog->Log(_L("CVHPPTestClass::InitializeHandleL()"));
   460     iLog->Log(_L("CVHPPTestClass::InitializeHandleL()"));
   462 
   461 
   463     TInt duration;
   462     TInt duration;
   464     TInt volumeSteps;
   463     TInt volumeSteps;
   465     TInt fileHandle32;
   464     TInt fileHandle32;
   466     
   465 
   467     TInt err = aItem.GetNextInt( fileHandle32 );
   466     TInt err = aItem.GetNextInt( fileHandle32 );
   468     
   467 
   469     if ( err == KErrNone )
   468     if ( err == KErrNone )
   470     {        
   469     {
   471     
   470 
   472 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   471 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   473         //
   472         //
   474         // set RFile as default if the 64-bit flag is not defined
   473         // set RFile as default if the 64-bit flag is not defined
   475         //
   474         //
   476         fileHandle32 = ETrue;
   475         fileHandle32 = ETrue;
   477 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   476 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   478         
   477 
   479         err = aItem.GetNextInt( duration );
   478         err = aItem.GetNextInt( duration );
   480     
   479 
   481         if ( err == KErrNone )
   480         if ( err == KErrNone )
   482         {
   481         {
   483             //
   482             //
   484             //  We will always get an Init Complete message out
   483             //  We will always get an Init Complete message out
   485             //
   484             //
   486             TCallbackEvent* event = new TCallbackEvent;
   485             TCallbackEvent* event = new TCallbackEvent;
   487     
   486 
   488             event->iEvent = EPInitialised;
   487             event->iEvent = EPInitialised;
   489             event->iData  = duration;
   488             event->iData  = duration;
   490             event->iError = KErrNone;
   489             event->iError = KErrNone;
   491     
   490 
   492             AddExpectedEvent( event );
   491             AddExpectedEvent( event );
   493     
   492 
   494             // 
   493             //
   495             // read number of volume steps
   494             // read number of volume steps
   496             //
   495             //
   497             err = aItem.GetNextInt( volumeSteps );
   496             err = aItem.GetNextInt( volumeSteps );
   498             
   497 
   499             if ( err == KErrNone )
   498             if ( err == KErrNone )
   500             {        
   499             {
   501                 //
   500                 //
   502                 // set volume steps
   501                 // set volume steps
   503                 //
   502                 //
   504                 SetVolumeSteps( volumeSteps );
   503                 SetVolumeSteps( volumeSteps );
   505             
   504 
   506                 TBuf<120> fullPath;
   505                 TBuf<120> fullPath;
   507         
   506 
   508                 err = ReadFileInitializationParameters( aItem, fullPath );
   507                 err = ReadFileInitializationParameters( aItem, fullPath );
   509         
   508 
   510                 if ( err == KErrNone )
   509                 if ( err == KErrNone )
   511                 {
   510                 {
   512                     PreparePluginL();
   511                     PreparePluginL();
   513         
   512 
   514                     RFs fs;
   513                     RFs fs;
   515                     TInt error = fs.Connect();
   514                     TInt error = fs.Connect();
   516                     
   515 
   517                     //
   516                     //
   518                     //  Open a file handle to the clip
   517                     //  Open a file handle to the clip
   519                     //
   518                     //
   520                     if ( fileHandle32 )
   519                     if ( fileHandle32 )
   521                     {
   520                     {
   531                         User::LeaveIfError( file64.Open( fs, fullPath, EFileRead ) );
   530                         User::LeaveIfError( file64.Open( fs, fullPath, EFileRead ) );
   532                         iPlaybackPlugin->Initialise64L( file64 );
   531                         iPlaybackPlugin->Initialise64L( file64 );
   533                         file64.Close();
   532                         file64.Close();
   534                     }
   533                     }
   535 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   534 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   536                             
   535 
   537                     //
   536                     //
   538                     //  Initalize the Plugin with a file name
   537                     //  Initalize the Plugin with a file name
   539                     //
   538                     //
   540                     MPX_DEBUG(_L("Initialize the Plugin with File Handle:  filename = %S"), &fullPath);
   539                     MPX_DEBUG(_L("Initialize the Plugin with File Handle:  filename = %S"), &fullPath);
   541                     iLog->Log(_L("Initialize the Plugin with File Handle:  filename = %S"), &fullPath);
   540                     iLog->Log(_L("Initialize the Plugin with File Handle:  filename = %S"), &fullPath);
   542             
   541 
   543                     fs.Close();
   542                     fs.Close();
   544                 }
   543                 }
   545             } 
   544             }
   546         } 
   545         }
   547     } 
   546     }
   548 
   547 
   549     return err;
   548     return err;
   550 }
   549 }
   551 
   550 
   552 TRect
   551 TRect
   889                     event->iEvent = EPMuteChanged;
   888                     event->iEvent = EPMuteChanged;
   890                     event->iData  = value;
   889                     event->iData  = value;
   891                     event->iError = KErrNone;
   890                     event->iError = KErrNone;
   892                     AddExpectedEvent( event );
   891                     AddExpectedEvent( event );
   893                 }
   892                 }
   894 				else
   893                 else
   895 				{
   894                 {
   896 					event->iEvent = EPSetComplete;
   895                     event->iEvent = EPSetComplete;
   897 					event->iData  = property;
   896                     event->iData  = property;
   898 					event->iError = KErrNone;
   897                     event->iError = KErrNone;
   899 					AddExpectedEvent( event );
   898                     AddExpectedEvent( event );
   900 				}
   899                 }
   901 				
   900 
   902             }
   901             }
   903 
   902 
   904             TRAP( err, iPlaybackPlugin->SetL( (TMPXPlaybackProperty)property, value ) );
   903             TRAP( err, iPlaybackPlugin->SetL( (TMPXPlaybackProperty)property, value ) );
   905         }
   904         }
   906     }
   905     }
  1145 {
  1144 {
  1146     MPX_ENTER_EXIT(_L("CVHPPTestClass::ConnectToDownloadL()"));
  1145     MPX_ENTER_EXIT(_L("CVHPPTestClass::ConnectToDownloadL()"));
  1147     iLog->Log(_L("CVHPPTestClass::ConnectToDownloadL()"));
  1146     iLog->Log(_L("CVHPPTestClass::ConnectToDownloadL()"));
  1148 
  1147 
  1149     TInt err = KErrNone;
  1148     TInt err = KErrNone;
  1150     
  1149 
  1151 #ifdef USE_S60_DOWNLOAD_MANAGER       
  1150 #ifdef USE_S60_DOWNLOAD_MANAGER
  1152     
  1151 
  1153     iDlMgrTester = CDlMgrTestClass::NewL();
  1152     iDlMgrTester = CDlMgrTestClass::NewL();
  1154     iDlMgrTester->AddStifObserver( this );
  1153     iDlMgrTester->AddStifObserver( this );
  1155 
  1154 
  1156     TInt dlId;
  1155     TInt dlId;
  1157     TPtrC filename;
  1156     TPtrC filename;
  1194             iPlaybackPlugin->CommandL( *cmd );
  1193             iPlaybackPlugin->CommandL( *cmd );
  1195 
  1194 
  1196             CleanupStack::PopAndDestroy( cmd );
  1195             CleanupStack::PopAndDestroy( cmd );
  1197         }
  1196         }
  1198     }
  1197     }
  1199     
  1198 
  1200 #else // USE_S60_DOWNLOAD_MANAGER    
  1199 #else // USE_S60_DOWNLOAD_MANAGER
  1201      
  1200 
  1202 	// suppress build warning
  1201     // suppress build warning
  1203     MPX_DEBUG(_L("CVHPPTestClass::ConnectToDownloadL() : parsing type = %d"), aItem.ParsingType()); 
  1202     MPX_DEBUG(_L("CVHPPTestClass::ConnectToDownloadL() : parsing type = %d"), aItem.ParsingType());
  1204 	
  1203 
  1205 	// Signal TestScripter to continue from waittestclass
  1204     // Signal TestScripter to continue from waittestclass
  1206     Signal();
  1205     Signal();
  1207 	
  1206 
  1208 #endif // USE_S60_DOWNLOAD_MANAGER
  1207 #endif // USE_S60_DOWNLOAD_MANAGER
  1209     
  1208 
  1210     return err;
  1209     return err;
  1211 }
  1210 }
  1212 
  1211 
  1213 // -------------------------------------------------------------------------------------------------
  1212 // -------------------------------------------------------------------------------------------------
  1214 //   CVHPPTestClass::SendPdlCustomCommandL()
  1213 //   CVHPPTestClass::SendPdlCustomCommandL()
  1218 CVHPPTestClass::SendPdlCustomCommandL( TMPXPlaybackPdCommand aCustomCmd )
  1217 CVHPPTestClass::SendPdlCustomCommandL( TMPXPlaybackPdCommand aCustomCmd )
  1219 {
  1218 {
  1220     MPX_ENTER_EXIT(_L("CVHPPTestClass::SendPdlCustomCommandL"),
  1219     MPX_ENTER_EXIT(_L("CVHPPTestClass::SendPdlCustomCommandL"),
  1221                    _L("aCustomCmd = %d"), aCustomCmd );
  1220                    _L("aCustomCmd = %d"), aCustomCmd );
  1222 
  1221 
  1223 #ifdef USE_S60_DOWNLOAD_MANAGER     
  1222 #ifdef USE_S60_DOWNLOAD_MANAGER
  1224 
  1223 
  1225     CMPXCommand* cmd = CMPXCommand::NewL();
  1224     CMPXCommand* cmd = CMPXCommand::NewL();
  1226     CleanupStack::PushL( cmd );
  1225     CleanupStack::PushL( cmd );
  1227 
  1226 
  1228     cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
  1227     cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
  1230     cmd->SetTObjectValueL<TMPXPlaybackPdCommand>( KMPXCommandPlaybackGeneralType, aCustomCmd );
  1229     cmd->SetTObjectValueL<TMPXPlaybackPdCommand>( KMPXCommandPlaybackGeneralType, aCustomCmd );
  1231 
  1230 
  1232     iPlaybackPlugin->CommandL( *cmd );
  1231     iPlaybackPlugin->CommandL( *cmd );
  1233 
  1232 
  1234     CleanupStack::PopAndDestroy( cmd );
  1233     CleanupStack::PopAndDestroy( cmd );
  1235 	
  1234 
  1236 #else // USE_S60_DOWNLOAD_MANAGER     
  1235 #else // USE_S60_DOWNLOAD_MANAGER
  1237 	
  1236 
  1238 	// Signal TestScripter to continue from waittestclass
  1237     // Signal TestScripter to continue from waittestclass
  1239     Signal();
  1238     Signal();
  1240 	
  1239 
  1241 #endif // USE_S60_DOWNLOAD_MANAGER
  1240 #endif // USE_S60_DOWNLOAD_MANAGER
  1242 
  1241 
  1243 }
  1242 }
  1244 
  1243 
  1245 // -----------------------------------------------------------------------------
  1244 // -----------------------------------------------------------------------------
  1250 CVHPPTestClass::PauseDownloadL( CStifItemParser& /*aItem*/ )
  1249 CVHPPTestClass::PauseDownloadL( CStifItemParser& /*aItem*/ )
  1251 {
  1250 {
  1252     MPX_ENTER_EXIT(_L("CVHPPTestClass::PauseDownloadL()"));
  1251     MPX_ENTER_EXIT(_L("CVHPPTestClass::PauseDownloadL()"));
  1253     iLog->Log(_L("CVHPPTestClass::PauseDownloadL()"));
  1252     iLog->Log(_L("CVHPPTestClass::PauseDownloadL()"));
  1254 
  1253 
  1255 #ifdef USE_S60_DOWNLOAD_MANAGER   
  1254 #ifdef USE_S60_DOWNLOAD_MANAGER
  1256     
  1255 
  1257     TCallbackEvent* event = new TCallbackEvent;
  1256     TCallbackEvent* event = new TCallbackEvent;
  1258 
  1257 
  1259     event->iEvent = EPDownloadStateChanged;
  1258     event->iEvent = EPDownloadStateChanged;
  1260     event->iData  = EPbDlStateDownloadPaused;
  1259     event->iData  = EPbDlStateDownloadPaused;
  1261     event->iError = KErrNone;
  1260     event->iError = KErrNone;
  1262 
  1261 
  1263     AddExpectedEvent( event );
  1262     AddExpectedEvent( event );
  1264 
  1263 
  1265     iDlMgrTester->PauseDownload();
  1264     iDlMgrTester->PauseDownload();
  1266     
  1265 
  1267 #else // USE_S60_DOWNLOAD_MANAGER    
  1266 #else // USE_S60_DOWNLOAD_MANAGER
  1268 	
  1267 
  1269 	// Signal TestScripter to continue from waittestclass
  1268     // Signal TestScripter to continue from waittestclass
  1270     Signal();
  1269     Signal();
  1271 	
  1270 
  1272 #endif // USE_S60_DOWNLOAD_MANAGER 
  1271 #endif // USE_S60_DOWNLOAD_MANAGER
  1273     
  1272 
  1274     return KErrNone;
  1273     return KErrNone;
  1275 }
  1274 }
  1276 
  1275 
  1277 // -----------------------------------------------------------------------------
  1276 // -----------------------------------------------------------------------------
  1278 //  CVHPPTestClass::ResumeDownloadL
  1277 //  CVHPPTestClass::ResumeDownloadL
  1283 {
  1282 {
  1284     MPX_ENTER_EXIT(_L("CVHPPTestClass::ResumeDownloadL()"));
  1283     MPX_ENTER_EXIT(_L("CVHPPTestClass::ResumeDownloadL()"));
  1285     iLog->Log(_L("CVHPPTestClass::ResumeDownloadL()"));
  1284     iLog->Log(_L("CVHPPTestClass::ResumeDownloadL()"));
  1286 
  1285 
  1287     TInt err = KErrNone;
  1286     TInt err = KErrNone;
  1288     
  1287 
  1289 #ifdef USE_S60_DOWNLOAD_MANAGER 
  1288 #ifdef USE_S60_DOWNLOAD_MANAGER
  1290     
  1289 
  1291     TInt dlSize;
  1290     TInt dlSize;
  1292 
  1291 
  1293     err = aItem.GetNextInt( dlSize );
  1292     err = aItem.GetNextInt( dlSize );
  1294 
  1293 
  1295     if ( err == KErrNone )
  1294     if ( err == KErrNone )
  1312 
  1311 
  1313         AddExpectedEvent( event );
  1312         AddExpectedEvent( event );
  1314 
  1313 
  1315         iDlMgrTester->ResumeDownload();
  1314         iDlMgrTester->ResumeDownload();
  1316     }
  1315     }
  1317     
  1316 
  1318 #else // USE_S60_DOWNLOAD_MANAGER    
  1317 #else // USE_S60_DOWNLOAD_MANAGER
  1319      
  1318 
  1320 	// suppress build warning
  1319     // suppress build warning
  1321     MPX_DEBUG(_L("CVHPPTestClass::ResumeDownloadL() : parsing type = %d"), aItem.ParsingType()); 
  1320     MPX_DEBUG(_L("CVHPPTestClass::ResumeDownloadL() : parsing type = %d"), aItem.ParsingType());
  1322 	
  1321 
  1323 	// Signal TestScripter to continue from waittestclass
  1322     // Signal TestScripter to continue from waittestclass
  1324     Signal();
  1323     Signal();
  1325 	
  1324 
  1326 #endif // USE_S60_DOWNLOAD_MANAGER 
  1325 #endif // USE_S60_DOWNLOAD_MANAGER
  1327     
  1326 
  1328     return err;
  1327     return err;
  1329 }
  1328 }
  1330 
  1329 
  1331 // -----------------------------------------------------------------------------
  1330 // -----------------------------------------------------------------------------
  1332 //  CVHPPTestClass::CancelDownloadL
  1331 //  CVHPPTestClass::CancelDownloadL
  1336 CVHPPTestClass::CancelDownloadL( CStifItemParser& /*aItem*/ )
  1335 CVHPPTestClass::CancelDownloadL( CStifItemParser& /*aItem*/ )
  1337 {
  1336 {
  1338     MPX_ENTER_EXIT(_L("CVHPPTestClass::CancelDownloadL()"));
  1337     MPX_ENTER_EXIT(_L("CVHPPTestClass::CancelDownloadL()"));
  1339     iLog->Log(_L("CVHPPTestClass::CancelDownloadL()"));
  1338     iLog->Log(_L("CVHPPTestClass::CancelDownloadL()"));
  1340 
  1339 
  1341 #ifdef USE_S60_DOWNLOAD_MANAGER 
  1340 #ifdef USE_S60_DOWNLOAD_MANAGER
  1342     
  1341 
  1343     TCallbackEvent* event = new TCallbackEvent;
  1342     TCallbackEvent* event = new TCallbackEvent;
  1344 
  1343 
  1345     event->iEvent = EPDownloadStateChanged;
  1344     event->iEvent = EPDownloadStateChanged;
  1346     event->iData  = EPbDlStateDownloadCanceled;
  1345     event->iData  = EPbDlStateDownloadCanceled;
  1347     event->iError = KErrNone;
  1346     event->iError = KErrNone;
  1348 
  1347 
  1349     AddExpectedEvent( event );
  1348     AddExpectedEvent( event );
  1350 
  1349 
  1351     iDlMgrTester->CancelDownload();
  1350     iDlMgrTester->CancelDownload();
  1352 
  1351 
  1353 #else // USE_S60_DOWNLOAD_MANAGER    
  1352 #else // USE_S60_DOWNLOAD_MANAGER
  1354 	
  1353 
  1355 	// Signal TestScripter to continue from waittestclass
  1354     // Signal TestScripter to continue from waittestclass
  1356     Signal();
  1355     Signal();
  1357 	
  1356 
  1358 #endif // USE_S60_DOWNLOAD_MANAGER 
  1357 #endif // USE_S60_DOWNLOAD_MANAGER
  1359     
  1358 
  1360     return KErrNone;
  1359     return KErrNone;
  1361 }
  1360 }
  1362 
  1361 
  1363 // -----------------------------------------------------------------------------
  1362 // -----------------------------------------------------------------------------
  1364 //  CVHPPTestClass::RetrievePdlStatusL
  1363 //  CVHPPTestClass::RetrievePdlStatusL
  1369 {
  1368 {
  1370     MPX_ENTER_EXIT(_L("CVHPPTestClass::RetrievePdlStatusL()"));
  1369     MPX_ENTER_EXIT(_L("CVHPPTestClass::RetrievePdlStatusL()"));
  1371     iLog->Log(_L("CVHPPTestClass::RetrievePdlStatusL()"));
  1370     iLog->Log(_L("CVHPPTestClass::RetrievePdlStatusL()"));
  1372 
  1371 
  1373     TInt err = KErrNone;
  1372     TInt err = KErrNone;
  1374     
  1373 
  1375 #ifdef USE_S60_DOWNLOAD_MANAGER 
  1374 #ifdef USE_S60_DOWNLOAD_MANAGER
  1376     
  1375 
  1377     TInt pdlState;
  1376     TInt pdlState;
  1378     TInt expectedPdlState;
  1377     TInt expectedPdlState;
  1379     TInt downloadedBytes;
  1378     TInt downloadedBytes;
  1380     TInt expectedDownloadedBytes;
  1379     TInt expectedDownloadedBytes;
  1381     TInt downloadSize;
  1380     TInt downloadSize;
  1430         }
  1429         }
  1431 
  1430 
  1432         CleanupStack::PopAndDestroy( cmd );
  1431         CleanupStack::PopAndDestroy( cmd );
  1433     }
  1432     }
  1434 
  1433 
  1435 #else // USE_S60_DOWNLOAD_MANAGER 
  1434 #else // USE_S60_DOWNLOAD_MANAGER
  1436      
  1435 
  1437 	// suppress build warning
  1436     // suppress build warning
  1438     MPX_DEBUG(_L("CVHPPTestClass::RetrievePdlStatusL() : parsing type = %d"), aItem.ParsingType()); 
  1437     MPX_DEBUG(_L("CVHPPTestClass::RetrievePdlStatusL() : parsing type = %d"), aItem.ParsingType());
  1439 	
  1438 
  1440 	// Signal TestScripter to continue from waittestclass
  1439     // Signal TestScripter to continue from waittestclass
  1441     Signal();
  1440     Signal();
  1442 	
  1441 
  1443 #endif // USE_S60_DOWNLOAD_MANAGER 
  1442 #endif // USE_S60_DOWNLOAD_MANAGER
  1444     
  1443 
  1445     return err;
  1444     return err;
  1446 }
  1445 }
  1447 
  1446 
  1448 void
  1447 void
  1449 CVHPPTestClass::HandlePluginEvent( TEvent aEvent, TInt aData, TInt aError )
  1448 CVHPPTestClass::HandlePluginEvent( TEvent aEvent, TInt aData, TInt aError )
  1621 
  1620 
  1622 void
  1621 void
  1623 CVHPPTestClass::ProcessEvent( TCallbackEvent* aCallback )
  1622 CVHPPTestClass::ProcessEvent( TCallbackEvent* aCallback )
  1624 {
  1623 {
  1625     MPX_ENTER_EXIT(_L("CVHPPTestClass::ProcessEvent"));
  1624     MPX_ENTER_EXIT(_L("CVHPPTestClass::ProcessEvent"));
  1626     
  1625 
  1627     if ( iExpectedCallbackArray->Count() > 0 )
  1626     if ( iExpectedCallbackArray->Count() > 0 )
  1628     {
  1627     {
  1629         TCallbackEvent* expectedCallback = (*iExpectedCallbackArray)[0];
  1628         TCallbackEvent* expectedCallback = (*iExpectedCallbackArray)[0];
  1630 
  1629 
  1631         MPX_DEBUG(_L("CVHPPTestClass::ProcessEvent(%d,%d,%d) Expected(%d,%d,%d)"),
  1630         MPX_DEBUG(_L("CVHPPTestClass::ProcessEvent(%d,%d,%d) Expected(%d,%d,%d)"),
  2025     event->iEvent = EPbCmdTvOutEvent;
  2024     event->iEvent = EPbCmdTvOutEvent;
  2026     event->iData  = EFalse;
  2025     event->iData  = EFalse;
  2027     event->iError = KErrNone;
  2026     event->iError = KErrNone;
  2028 
  2027 
  2029     AddExpectedEvent( event );
  2028     AddExpectedEvent( event );
  2030     
  2029 
       
  2030     event = new TCallbackEvent;
       
  2031     event->iEvent = EPPaused;
       
  2032     event->iData  = 0;
       
  2033     event->iError = KErrNone;
       
  2034 
       
  2035     AddExpectedEvent( event );
       
  2036 
  2031     iAccObserver->UpdateTvOutStatusL( EFalse );
  2037     iAccObserver->UpdateTvOutStatusL( EFalse );
  2032 
  2038 
  2033     return KErrNone;
  2039     return KErrNone;
  2034 }
  2040 }
  2035 
  2041 
  2119     }
  2125     }
  2120 
  2126 
  2121     return err;
  2127     return err;
  2122 }
  2128 }
  2123 
  2129 
  2124 // ----------------------------------------------------------------------------- 
  2130 // -----------------------------------------------------------------------------
  2125 //  CVHPPTestClass::SetVolumeSteps 
  2131 //  CVHPPTestClass::SetVolumeSteps
  2126 // ----------------------------------------------------------------------------- 
  2132 // -----------------------------------------------------------------------------
  2127 // 
  2133 //
  2128 TInt 
  2134 TInt
  2129 CVHPPTestClass::SetVolumeSteps( TInt aVolumeSteps ) 
  2135 CVHPPTestClass::SetVolumeSteps( TInt aVolumeSteps )
  2130 { 
  2136 {
  2131     MPX_ENTER_EXIT(_L("CVHPPTestClass::SetVolumeSteps()")); 
  2137     MPX_ENTER_EXIT(_L("CVHPPTestClass::SetVolumeSteps()"));
  2132     iLog->Log(_L("CVHPPTestClass::SetVolumeSteps()")); 
  2138     iLog->Log(_L("CVHPPTestClass::SetVolumeSteps()"));
  2133     
  2139 
  2134     iPlayerUtility->SetVolumeSteps( aVolumeSteps );
  2140     iPlayerUtility->SetVolumeSteps( aVolumeSteps );
  2135     
  2141 
  2136     return KErrNone; 
  2142     return KErrNone;
  2137 } 
  2143 }
  2138 
  2144 
  2139 // ----------------------------------------------------------------------------- 
  2145 // -----------------------------------------------------------------------------
  2140 //  CVHPPTestClass::HandleVolumeL 
  2146 //  CVHPPTestClass::HandleVolumeL
  2141 // ----------------------------------------------------------------------------- 
  2147 // -----------------------------------------------------------------------------
  2142 // 
  2148 //
  2143 TInt 
  2149 TInt
  2144 CVHPPTestClass::HandleVolumeL( CStifItemParser& aItem ) 
  2150 CVHPPTestClass::HandleVolumeL( CStifItemParser& aItem )
  2145 { 
  2151 {
  2146     MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleVolumeL()")); 
  2152     MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleVolumeL()"));
  2147     iLog->Log(_L("CVHPPTestClass::HandleVolumeL()")); 
  2153     iLog->Log(_L("CVHPPTestClass::HandleVolumeL()"));
  2148       
  2154 
  2149     TInt command; 
  2155     TInt command;
  2150     TInt value; 
  2156     TInt value;
  2151     
  2157 
  2152     TInt err = aItem.GetNextInt( command );
  2158     TInt err = aItem.GetNextInt( command );
  2153 
  2159 
  2154     if ( err == KErrNone )
  2160     if ( err == KErrNone )
  2155     {
  2161     {
  2156         err = aItem.GetNextInt( value );
  2162         err = aItem.GetNextInt( value );
  2157 
  2163 
  2158         if ( err == KErrNone ) 
  2164         if ( err == KErrNone )
  2159         {         
  2165         {
  2160             // 
  2166             //
  2161             // assign callback event values 
  2167             // assign callback event values
  2162             // 
  2168             //
  2163             TCallbackEvent* event = new TCallbackEvent; 
  2169             TCallbackEvent* event = new TCallbackEvent;
  2164             event->iEvent = EPVolumeChanged; 
  2170             event->iEvent = EPVolumeChanged;
  2165             event->iData  = value; 
  2171             event->iData  = value;
  2166             event->iError = KErrNone; 
  2172             event->iError = KErrNone;
  2167                   
  2173 
  2168             // 
  2174             //
  2169             // save expected result to be compared later 
  2175             // save expected result to be compared later
  2170             // 
  2176             //
  2171             AddExpectedEvent( event ); 
  2177             AddExpectedEvent( event );
  2172     
  2178 
  2173             //
  2179             //
  2174             // send command to playback plugin
  2180             // send command to playback plugin
  2175             //
  2181             //
  2176             CreateVideoPlaybackCommandL( aItem, (TMPXVideoPlaybackCommand)command ); 
  2182             CreateVideoPlaybackCommandL( aItem, (TMPXVideoPlaybackCommand)command );
  2177         } 
  2183         }
  2178     }
  2184     }
  2179     
  2185 
  2180     if ( err == KErrNone )
  2186     if ( err == KErrNone )
  2181     {
  2187     {
  2182         MPX_DEBUG(_L("CVHPPTestClass::HandleVolumeL() leaves with proper error"));
  2188         MPX_DEBUG(_L("CVHPPTestClass::HandleVolumeL() leaves with proper error"));
  2183     }
  2189     }
  2184     
  2190 
  2185     return err; 
  2191     return err;
  2186 } 
  2192 }
  2187 
  2193 
  2188 
  2194 
  2189 TInt
  2195 TInt
  2190 CVHPPTestClass::InitializeWithPositionL( CStifItemParser& aItem )
  2196 CVHPPTestClass::InitializeWithPositionL( CStifItemParser& aItem )
  2191 {
  2197 {
  2193     iLog->Log(_L("CVHPPTestClass::InitializeL()"));
  2199     iLog->Log(_L("CVHPPTestClass::InitializeL()"));
  2194 
  2200 
  2195     TInt duration;
  2201     TInt duration;
  2196     TInt volumeSteps;
  2202     TInt volumeSteps;
  2197     TInt position;
  2203     TInt position;
  2198     
  2204 
  2199     TInt err = aItem.GetNextInt( duration );
  2205     TInt err = aItem.GetNextInt( duration );
  2200 
  2206 
  2201     if ( err == KErrNone )
  2207     if ( err == KErrNone )
  2202     {
  2208     {
  2203         //
  2209         //
  2209         event->iData  = duration;
  2215         event->iData  = duration;
  2210         event->iError = KErrNone;
  2216         event->iError = KErrNone;
  2211 
  2217 
  2212         AddExpectedEvent( event );
  2218         AddExpectedEvent( event );
  2213 
  2219 
  2214         // 
  2220         //
  2215         // read number of volume steps
  2221         // read number of volume steps
  2216         //
  2222         //
  2217         err = aItem.GetNextInt( volumeSteps );
  2223         err = aItem.GetNextInt( volumeSteps );
  2218         
  2224 
  2219         if ( err == KErrNone )
  2225         if ( err == KErrNone )
  2220         {        
  2226         {
  2221             //
  2227             //
  2222             // set volume steps
  2228             // set volume steps
  2223             //
  2229             //
  2224             SetVolumeSteps( volumeSteps );
  2230             SetVolumeSteps( volumeSteps );
  2225             
  2231 
  2226             err = aItem.GetNextInt( position );
  2232             err = aItem.GetNextInt( position );
  2227             
  2233 
  2228             if (err == KErrNone )
  2234             if (err == KErrNone )
  2229             {
  2235             {
  2230                 TBuf<120> fullPath;    
  2236                 TBuf<120> fullPath;
  2231 
  2237 
  2232                 err = ReadFileInitializationParameters( aItem, fullPath );
  2238                 err = ReadFileInitializationParameters( aItem, fullPath );
  2233                 
  2239 
  2234                 if ( err == KErrNone )
  2240                 if ( err == KErrNone )
  2235                 {
  2241                 {
  2236                     PreparePluginL();
  2242                     PreparePluginL();
  2237         
  2243 
  2238                     //
  2244                     //
  2239                     //  Initalize the Plugin with a file name
  2245                     //  Initalize the Plugin with a file name
  2240                     //
  2246                     //
  2241                     MPX_DEBUG(_L("Initialize the Plugin:  filename = %S, position = %d"), &fullPath, position);
  2247                     MPX_DEBUG(_L("Initialize the Plugin:  filename = %S, position = %d"), &fullPath, position);
  2242                     iLog->Log(_L("Initialize the Plugin:  filename = %S, position = %d"), &fullPath, position);
  2248                     iLog->Log(_L("Initialize the Plugin:  filename = %S, position = %d"), &fullPath, position);
  2243         
  2249 
  2244                     iPlaybackPlugin->InitialiseWithPositionL( fullPath, position );
  2250                     iPlaybackPlugin->InitialiseWithPositionL( fullPath, position );
  2245                 }
  2251                 }
  2246 
  2252 
  2247             }
  2253             }
  2248         }
  2254         }
  2259     iLog->Log(_L("CVHPPTestClass::InitializeLinkL()"));
  2265     iLog->Log(_L("CVHPPTestClass::InitializeLinkL()"));
  2260 
  2266 
  2261     TInt duration;
  2267     TInt duration;
  2262     TInt volumeSteps;
  2268     TInt volumeSteps;
  2263     TInt position;
  2269     TInt position;
  2264     
  2270 
  2265     TInt err = aItem.GetNextInt( duration );
  2271     TInt err = aItem.GetNextInt( duration );
  2266 
  2272 
  2267     if ( err == KErrNone )
  2273     if ( err == KErrNone )
  2268     {
  2274     {
  2269         //
  2275         //
  2275         event->iData  = duration;
  2281         event->iData  = duration;
  2276         event->iError = KErrNone;
  2282         event->iError = KErrNone;
  2277 
  2283 
  2278         AddExpectedEvent( event );
  2284         AddExpectedEvent( event );
  2279 
  2285 
  2280         // 
  2286         //
  2281         // read number of volume steps
  2287         // read number of volume steps
  2282         //
  2288         //
  2283         err = aItem.GetNextInt( volumeSteps );
  2289         err = aItem.GetNextInt( volumeSteps );
  2284         
  2290 
  2285         if ( err == KErrNone )
  2291         if ( err == KErrNone )
  2286         {        
  2292         {
  2287             //
  2293             //
  2288             // set volume steps
  2294             // set volume steps
  2289             //
  2295             //
  2290             SetVolumeSteps( volumeSteps );
  2296             SetVolumeSteps( volumeSteps );
  2291             
  2297 
  2292             err = aItem.GetNextInt( position );
  2298             err = aItem.GetNextInt( position );
  2293             
  2299 
  2294             if ( err == KErrNone )
  2300             if ( err == KErrNone )
  2295             {
  2301             {
  2296                 TPtrC  link;
  2302                 TPtrC  link;
  2297     
  2303 
  2298                 //
  2304                 //
  2299                 //  Read in the link from the config file
  2305                 //  Read in the link from the config file
  2300                 //
  2306                 //
  2301                 TInt err = aItem.GetNextString( link );
  2307                 TInt err = aItem.GetNextString( link );
  2302     
  2308 
  2303                 if ( err == KErrNone )
  2309                 if ( err == KErrNone )
  2304                 {
  2310                 {
  2305                     TInt err = ReadInitializationErrors( aItem );
  2311                     TInt err = ReadInitializationErrors( aItem );
  2306     
  2312 
  2307                     if ( err == KErrNone )
  2313                     if ( err == KErrNone )
  2308                     {
  2314                     {
  2309                         PreparePluginL();
  2315                         PreparePluginL();
  2310     
  2316 
  2311                         //
  2317                         //
  2312                         //  Extract the streaming link from the ram file and
  2318                         //  Extract the streaming link from the ram file and
  2313                         //  Initalize the Plugin with the link and an access point
  2319                         //  Initalize the Plugin with the link and an access point
  2314                         //
  2320                         //
  2315                         MPX_DEBUG(_L("Initialize the Plugin:  link = %S, position = %d"), &link, position);
  2321                         MPX_DEBUG(_L("Initialize the Plugin:  link = %S, position = %d"), &link, position);
  2316                         iLog->Log(_L("Initialize the Plugin:  link = %S, position = %d"), &link, position);
  2322                         iLog->Log(_L("Initialize the Plugin:  link = %S, position = %d"), &link, position);
  2317     
  2323 
  2318                         iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11, position );
  2324                         iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11, position );
  2319                     }
  2325                     }
  2320                 }
  2326                 }
  2321             }
  2327             }
  2322         }
  2328         }
  2334 
  2340 
  2335     TInt duration;
  2341     TInt duration;
  2336     TInt volumeSteps;
  2342     TInt volumeSteps;
  2337     TInt position;
  2343     TInt position;
  2338     TInt fileHandle32;
  2344     TInt fileHandle32;
  2339     
  2345 
  2340     TInt err = aItem.GetNextInt( fileHandle32 );
  2346     TInt err = aItem.GetNextInt( fileHandle32 );
  2341     
  2347 
  2342     if ( err == KErrNone )
  2348     if ( err == KErrNone )
  2343     {        
  2349     {
  2344     
  2350 
  2345 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2351 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2346         //
  2352         //
  2347         // set RFile as default if the 64-bit flag is not defined
  2353         // set RFile as default if the 64-bit flag is not defined
  2348         //
  2354         //
  2349         fileHandle32 = ETrue;
  2355         fileHandle32 = ETrue;
  2350 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2356 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2351         
  2357 
  2352         err = aItem.GetNextInt( duration );
  2358         err = aItem.GetNextInt( duration );
  2353     
  2359 
  2354         if ( err == KErrNone )
  2360         if ( err == KErrNone )
  2355         {
  2361         {
  2356             //
  2362             //
  2357             //  We will always get an Init Complete message out
  2363             //  We will always get an Init Complete message out
  2358             //
  2364             //
  2359             TCallbackEvent* event = new TCallbackEvent;
  2365             TCallbackEvent* event = new TCallbackEvent;
  2360     
  2366 
  2361             event->iEvent = EPInitialised;
  2367             event->iEvent = EPInitialised;
  2362             event->iData  = duration;
  2368             event->iData  = duration;
  2363             event->iError = KErrNone;
  2369             event->iError = KErrNone;
  2364     
  2370 
  2365             AddExpectedEvent( event );
  2371             AddExpectedEvent( event );
  2366     
  2372 
  2367             // 
  2373             //
  2368             // read number of volume steps
  2374             // read number of volume steps
  2369             //
  2375             //
  2370             err = aItem.GetNextInt( volumeSteps );
  2376             err = aItem.GetNextInt( volumeSteps );
  2371             
  2377 
  2372             if ( err == KErrNone )
  2378             if ( err == KErrNone )
  2373             {        
  2379             {
  2374                 //
  2380                 //
  2375                 // set volume steps
  2381                 // set volume steps
  2376                 //
  2382                 //
  2377                 SetVolumeSteps( volumeSteps );
  2383                 SetVolumeSteps( volumeSteps );
  2378 
  2384 
  2379                 err = aItem.GetNextInt( position );
  2385                 err = aItem.GetNextInt( position );
  2380 
  2386 
  2381                 if (err == KErrNone )
  2387                 if (err == KErrNone )
  2382                 {
  2388                 {
  2383                     TBuf<120> fullPath;
  2389                     TBuf<120> fullPath;
  2384                     
  2390 
  2385                     err = ReadFileInitializationParameters( aItem, fullPath );
  2391                     err = ReadFileInitializationParameters( aItem, fullPath );
  2386         
  2392 
  2387                     if ( err == KErrNone )
  2393                     if ( err == KErrNone )
  2388                     {
  2394                     {
  2389                         PreparePluginL();
  2395                         PreparePluginL();
  2390         
  2396 
  2391                         RFs fs;
  2397                         RFs fs;
  2392                         TInt error = fs.Connect();
  2398                         TInt error = fs.Connect();
  2393                     
  2399 
  2394                         //
  2400                         //
  2395                         //  Open a file handle to the clip
  2401                         //  Open a file handle to the clip
  2396                         //
  2402                         //
  2397                         if ( fileHandle32 )
  2403                         if ( fileHandle32 )
  2398                         {
  2404                         {
  2408                             file64.Open( fs, fullPath, EFileRead );
  2414                             file64.Open( fs, fullPath, EFileRead );
  2409                             iPlaybackPlugin->Initialise64L( file64, position );
  2415                             iPlaybackPlugin->Initialise64L( file64, position );
  2410                             file64.Close();
  2416                             file64.Close();
  2411                         }
  2417                         }
  2412 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2418 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2413                             
  2419 
  2414                         //
  2420                         //
  2415                         //  Initalize the Plugin with a file name
  2421                         //  Initalize the Plugin with a file name
  2416                         //
  2422                         //
  2417                         MPX_DEBUG(_L("Initialize the Plugin with File Handle:  filename = %S, position = %d"), &fullPath, position);
  2423                         MPX_DEBUG(_L("Initialize the Plugin with File Handle:  filename = %S, position = %d"), &fullPath, position);
  2418                         iLog->Log(_L("Initialize the Plugin with File Handle:  filename = %S, position = %d"), &fullPath, position);
  2424                         iLog->Log(_L("Initialize the Plugin with File Handle:  filename = %S, position = %d"), &fullPath, position);
  2419             
  2425 
  2420                         fs.Close();
  2426                         fs.Close();
  2421                     }
  2427                     }
  2422                 }            
  2428                 }
  2423 
  2429 
  2424             } 
  2430             }
  2425         } 
  2431         }
  2426     } 
  2432     }
  2427 
  2433 
  2428     return err;
  2434     return err;
  2429 }
  2435 }
  2430 
  2436 
  2431 TInt
  2437 TInt
  2435     iLog->Log(_L("CVHPPTestClass::InitializeStreamingWithSdpFileHandleL()"));
  2441     iLog->Log(_L("CVHPPTestClass::InitializeStreamingWithSdpFileHandleL()"));
  2436 
  2442 
  2437     TInt duration;
  2443     TInt duration;
  2438     TInt volumeSteps;
  2444     TInt volumeSteps;
  2439     TInt fileHandle32;
  2445     TInt fileHandle32;
  2440     
  2446 
  2441     TInt err = aItem.GetNextInt( fileHandle32 );
  2447     TInt err = aItem.GetNextInt( fileHandle32 );
  2442     
  2448 
  2443     if ( err == KErrNone )
  2449     if ( err == KErrNone )
  2444     {        
  2450     {
  2445     
  2451 
  2446 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2452 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2447         //
  2453         //
  2448         // set RFile as default if the 64-bit flag is not defined
  2454         // set RFile as default if the 64-bit flag is not defined
  2449         //
  2455         //
  2450         fileHandle32 = ETrue;
  2456         fileHandle32 = ETrue;
  2451 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2457 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2452         
  2458 
  2453         err = aItem.GetNextInt( duration );
  2459         err = aItem.GetNextInt( duration );
  2454     
  2460 
  2455         if ( err == KErrNone )
  2461         if ( err == KErrNone )
  2456         {
  2462         {
  2457             //
  2463             //
  2458             //  We will always get an Init Complete message out
  2464             //  We will always get an Init Complete message out
  2459             //
  2465             //
  2460             TCallbackEvent* event = new TCallbackEvent;
  2466             TCallbackEvent* event = new TCallbackEvent;
  2461     
  2467 
  2462             event->iEvent = EPInitialised;
  2468             event->iEvent = EPInitialised;
  2463             event->iData  = duration;
  2469             event->iData  = duration;
  2464             event->iError = KErrNone;
  2470             event->iError = KErrNone;
  2465     
  2471 
  2466             AddExpectedEvent( event );
  2472             AddExpectedEvent( event );
  2467     
  2473 
  2468             // 
  2474             //
  2469             // read number of volume steps
  2475             // read number of volume steps
  2470             //
  2476             //
  2471             err = aItem.GetNextInt( volumeSteps );
  2477             err = aItem.GetNextInt( volumeSteps );
  2472             
  2478 
  2473             if ( err == KErrNone )
  2479             if ( err == KErrNone )
  2474             {        
  2480             {
  2475                 //
  2481                 //
  2476                 // set volume steps
  2482                 // set volume steps
  2477                 //
  2483                 //
  2478                 SetVolumeSteps( volumeSteps );
  2484                 SetVolumeSteps( volumeSteps );
  2479                
  2485 
  2480                 TBuf<120> fullPath;
  2486                 TBuf<120> fullPath;
  2481                 err = ReadFileInitializationParameters( aItem, fullPath );
  2487                 err = ReadFileInitializationParameters( aItem, fullPath );
  2482 
  2488 
  2483                 if ( err == KErrNone )
  2489                 if ( err == KErrNone )
  2484                 {
  2490                 {
  2485 					PreparePluginL();
  2491                     PreparePluginL();
  2486 					
  2492 
  2487 					MPX_DEBUG( _L("Initialize the Plugin:  link = %S"), &fullPath );
  2493                     MPX_DEBUG( _L("Initialize the Plugin:  link = %S"), &fullPath );
  2488 					iLog->Log( _L("Initialize the Plugin:  link = %S"), &fullPath );
  2494                     iLog->Log( _L("Initialize the Plugin:  link = %S"), &fullPath );
  2489 					
  2495 
  2490 					//
  2496                     //
  2491 					//  Extract the streaming link from the ram file and
  2497                     //  Extract the streaming link from the ram file and
  2492 					//  Initalize the Plugin with the file handle and an access point
  2498                     //  Initalize the Plugin with the file handle and an access point
  2493 					//
  2499                     //
  2494 					RFs fs;
  2500                     RFs fs;
  2495 					TInt error = fs.Connect();
  2501                     TInt error = fs.Connect();
  2496 					
  2502 
  2497 					if ( fileHandle32 )
  2503                     if ( fileHandle32 )
  2498 					{
  2504                     {
  2499 						RFile file;
  2505                         RFile file;
  2500 						error = file.Open( fs, fullPath, EFileRead | EFileShareAny );
  2506                         error = file.Open( fs, fullPath, EFileRead | EFileShareAny );
  2501 						
  2507 
  2502 						MPX_DEBUG( _L("Initialize the Plugin:  file open error = %d"),
  2508                         MPX_DEBUG( _L("Initialize the Plugin:  file open error = %d"),
  2503 								error );   
  2509                                 error );
  2504 						
  2510 
  2505 						User::LeaveIfError( error );
  2511                         User::LeaveIfError( error );
  2506 				  
  2512 
  2507 						iPlaybackPlugin->InitStreamingL( file, 11 );
  2513                         iPlaybackPlugin->InitStreamingL( file, 11 );
  2508 						file.Close();
  2514                         file.Close();
  2509 					}
  2515                     }
  2510     #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2516     #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2511 					else
  2517                     else
  2512 					{
  2518                     {
  2513 						RFile64 file64;
  2519                         RFile64 file64;
  2514 						error = file64.Open( fs, fullPath, EFileRead | EFileShareAny  );
  2520                         error = file64.Open( fs, fullPath, EFileRead | EFileShareAny  );
  2515 						
  2521 
  2516 						MPX_DEBUG( _L("Initialize the Plugin:  file open error = %d"),
  2522                         MPX_DEBUG( _L("Initialize the Plugin:  file open error = %d"),
  2517 								error );
  2523                                 error );
  2518 						
  2524 
  2519 						User::LeaveIfError( error );
  2525                         User::LeaveIfError( error );
  2520 						
  2526 
  2521 						iPlaybackPlugin->InitStreaming64L( file64, 11 );
  2527                         iPlaybackPlugin->InitStreaming64L( file64, 11 );
  2522 						file64.Close();
  2528                         file64.Close();
  2523 					}
  2529                     }
  2524 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2530 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2525 					
  2531 
  2526 					fs.Close();
  2532                     fs.Close();
  2527                 }
  2533                 }
  2528             } 
  2534             }
  2529         } 
  2535         }
  2530     } 
  2536     }
  2531     return err;
  2537     return err;
  2532 }
  2538 }
  2533 
  2539 
  2534 TInt
  2540 TInt
  2535 CVHPPTestClass::RetrieveFileNameAndModeL( CStifItemParser& aItem )
  2541 CVHPPTestClass::RetrieveFileNameAndModeL( CStifItemParser& aItem )
  2536 {
  2542 {
  2537     MPX_ENTER_EXIT( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") );
  2543     MPX_ENTER_EXIT( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") );
  2538     iLog->Log( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") );
  2544     iLog->Log( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") );
  2539 
  2545 
  2540     TBuf<120>	fullPath;
  2546     TBuf<120>    fullPath;
  2541     TPtrC		fileName;
  2547     TPtrC        fileName;
  2542     TInt		err;
  2548     TInt        err;
  2543     
  2549 
  2544     err = aItem.GetNextString( fileName );
  2550     err = aItem.GetNextString( fileName );
  2545 
  2551 
  2546     if ( err == KErrNone )
  2552     if ( err == KErrNone )
  2547     {
  2553     {
  2548         //
  2554         //
  2549         //  Build the full path to the file
  2555         //  Build the full path to the file
  2550         //
  2556         //
  2551         fullPath.Append( KVideoTestPath );
  2557         fullPath.Append( KVideoTestPath );
  2552         fullPath.Append( fileName );
  2558         fullPath.Append( fileName );
  2553         
  2559 
  2554         TInt mode;
  2560         TInt mode;
  2555         err = aItem.GetNextInt( mode);
  2561         err = aItem.GetNextInt( mode);
  2556         
  2562 
  2557         if ( err == KErrNone )
  2563         if ( err == KErrNone )
  2558         {
  2564         {
  2559  			CMPXCommand* cmd = CMPXCommand::NewL();
  2565              CMPXCommand* cmd = CMPXCommand::NewL();
  2560 			CleanupStack::PushL( cmd );
  2566             CleanupStack::PushL( cmd );
  2561 	
  2567 
  2562 			cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
  2568             cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
  2563 			cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId,
  2569             cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId,
  2564 										 KMPXMediaIdVideoPlayback );
  2570                                          KMPXMediaIdVideoPlayback );
  2565 			cmd->SetTObjectValueL<TInt>( KMPXMediaVideoPlaybackCommand, EPbCmdInitView );
  2571             cmd->SetTObjectValueL<TInt>( KMPXMediaVideoPlaybackCommand, EPbCmdInitView );
  2566 			
  2572 
  2567 			iPlaybackPlugin->CommandL( *cmd );
  2573             iPlaybackPlugin->CommandL( *cmd );
  2568 			
  2574 
  2569 			TPtrC clipName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) );
  2575             TPtrC clipName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) );
  2570 			TMPXVideoMode  playbackMode = (TMPXVideoMode) cmd->ValueTObjectL<TInt>( KMPXMediaVideoMode );
  2576             TMPXVideoMode  playbackMode = (TMPXVideoMode) cmd->ValueTObjectL<TInt>( KMPXMediaVideoMode );
  2571 	
  2577 
  2572 			MPX_DEBUG( _L("    Expected Data:  filename = %S, playbackmode= %d" ),
  2578             MPX_DEBUG( _L("    Expected Data:  filename = %S, playbackmode= %d" ),
  2573 				 &fullPath, mode );
  2579                  &fullPath, mode );
  2574 			
  2580 
  2575 			MPX_DEBUG( _L("    Retrieved Data: filename = %S, playbackmode= %d"),
  2581             MPX_DEBUG( _L("    Retrieved Data: filename = %S, playbackmode= %d"),
  2576 				 &clipName, playbackMode );
  2582                  &clipName, playbackMode );
  2577 			
  2583 
  2578 			if ( fullPath.Compare( clipName) != 0 || mode != playbackMode )
  2584             if ( fullPath.Compare( clipName) != 0 || mode != playbackMode )
  2579 			{
  2585             {
  2580 			    err = KErrGeneral;
  2586                 err = KErrGeneral;
  2581 				MPX_DEBUG( _L("    err = %d"), err );
  2587                 MPX_DEBUG( _L("    err = %d"), err );
  2582 			}
  2588             }
  2583 			
  2589 
  2584 			CleanupStack::PopAndDestroy( cmd );
  2590             CleanupStack::PopAndDestroy( cmd );
  2585         }
  2591         }
  2586     }
  2592     }
  2587 
  2593 
  2588     return err;
  2594     return err;
  2589 }
  2595 }