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