videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp
branchRCL_3
changeset 11 5294c000a26d
parent 10 ce5ada96ab30
child 16 7f2b2a65da29
equal deleted inserted replaced
10:ce5ada96ab30 11:5294c000a26d
    13 *
    13 *
    14 * Description:  Test Harness for VideoHelixPlaybackPlugin
    14 * Description:  Test Harness for VideoHelixPlaybackPlugin
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 17 %
    18 // Version : %version: 18 %
    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>
   116         ENTRY( "SetDrmProtected", CVHPPTestClass::SetDrmProtectedL ),
   116         ENTRY( "SetDrmProtected", CVHPPTestClass::SetDrmProtectedL ),
   117         ENTRY( "IssueSeekedToEndCommand", CVHPPTestClass::IssueSeekedToEndCommandL),
   117         ENTRY( "IssueSeekedToEndCommand", CVHPPTestClass::IssueSeekedToEndCommandL),
   118         ENTRY( "HandleVolume", CVHPPTestClass::HandleVolumeL ),
   118         ENTRY( "HandleVolume", CVHPPTestClass::HandleVolumeL ),
   119         ENTRY( "ConnectHDMITvOut", CVHPPTestClass::ConnectHDMITvOutL ),
   119         ENTRY( "ConnectHDMITvOut", CVHPPTestClass::ConnectHDMITvOutL ),
   120         ENTRY( "DisconnectHDMITvOut", CVHPPTestClass::DisconnectHDMITvOutL ),
   120         ENTRY( "DisconnectHDMITvOut", CVHPPTestClass::DisconnectHDMITvOutL ),
   121         ENTRY( "SetHDMITvOutConnected", CVHPPTestClass::SetHDMITvOutConnectedL )
   121         ENTRY( "SetHDMITvOutConnected", CVHPPTestClass::SetHDMITvOutConnectedL ),
   122 
   122 
       
   123         ENTRY ("InitializeWithPositionL", CVHPPTestClass::InitializeWithPositionL),
       
   124         ENTRY ("InitializeLinkWithPositionL", CVHPPTestClass::InitializeLinkWithPositionL),
       
   125         ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL)
   123 
   126 
   124         //
   127         //
   125         //  ADD NEW ENTRIES HERE
   128         //  ADD NEW ENTRIES HERE
   126         //
   129         //
   127         // ENTRY( "SendPlayCommandToServer",
   130         // ENTRY( "SendPlayCommandToServer",
  2227     iAccObserver->SetTvOutHDMI( ETrue );
  2230     iAccObserver->SetTvOutHDMI( ETrue );
  2228 
  2231 
  2229     return KErrNone;
  2232     return KErrNone;
  2230 }
  2233 }
  2231 
  2234 
       
  2235 TInt
       
  2236 CVHPPTestClass::InitializeWithPositionL( CStifItemParser& aItem )
       
  2237 {
       
  2238     MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeL()"));
       
  2239     iLog->Log(_L("CVHPPTestClass::InitializeL()"));
       
  2240 
       
  2241     TInt duration;
       
  2242     TInt volumeSteps;
       
  2243     TInt position;
       
  2244     
       
  2245     TInt err = aItem.GetNextInt( duration );
       
  2246 
       
  2247     if ( err == KErrNone )
       
  2248     {
       
  2249         //
       
  2250         //  We will always get an Init Complete message out
       
  2251         //
       
  2252         TCallbackEvent* event = new TCallbackEvent;
       
  2253 
       
  2254         event->iEvent = EPInitialised;
       
  2255         event->iData  = duration;
       
  2256         event->iError = KErrNone;
       
  2257 
       
  2258         AddExpectedEvent( event );
       
  2259 
       
  2260         // 
       
  2261         // read number of volume steps
       
  2262         //
       
  2263         err = aItem.GetNextInt( volumeSteps );
       
  2264         
       
  2265         if ( err == KErrNone )
       
  2266         {        
       
  2267             //
       
  2268             // set volume steps
       
  2269             //
       
  2270             SetVolumeSteps( volumeSteps );
       
  2271             
       
  2272             err = aItem.GetNextInt( position );
       
  2273             
       
  2274             if (err == KErrNone )
       
  2275             {
       
  2276                 TBuf<120> fullPath;    
       
  2277 
       
  2278                 err = ReadFileInitializationParameters( aItem, fullPath );
       
  2279                 
       
  2280                 if ( err == KErrNone )
       
  2281                 {
       
  2282                     PreparePluginL();
       
  2283         
       
  2284                     //
       
  2285                     //  Initalize the Plugin with a file name
       
  2286                     //
       
  2287                     MPX_DEBUG(_L("Initialize the Plugin:  filename = %S, position = %d"), &fullPath, position);
       
  2288                     iLog->Log(_L("Initialize the Plugin:  filename = %S, position = %d"), &fullPath, position);
       
  2289         
       
  2290                     iPlaybackPlugin->InitialiseWithPositionL( fullPath, position );
       
  2291                 }
       
  2292 
       
  2293             }
       
  2294         }
       
  2295     }
       
  2296 
       
  2297     return err;
       
  2298 }
       
  2299 
       
  2300 
       
  2301 TInt
       
  2302 CVHPPTestClass::InitializeLinkWithPositionL( CStifItemParser& aItem )
       
  2303 {
       
  2304     MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeLinkL()"));
       
  2305     iLog->Log(_L("CVHPPTestClass::InitializeLinkL()"));
       
  2306 
       
  2307     TInt duration;
       
  2308     TInt volumeSteps;
       
  2309     TInt position;
       
  2310     
       
  2311     TInt err = aItem.GetNextInt( duration );
       
  2312 
       
  2313     if ( err == KErrNone )
       
  2314     {
       
  2315         //
       
  2316         //  We will always get an Init Complete message out
       
  2317         //
       
  2318         TCallbackEvent* event = new TCallbackEvent;
       
  2319 
       
  2320         event->iEvent = EPInitialised;
       
  2321         event->iData  = duration;
       
  2322         event->iError = KErrNone;
       
  2323 
       
  2324         AddExpectedEvent( event );
       
  2325 
       
  2326         // 
       
  2327         // read number of volume steps
       
  2328         //
       
  2329         err = aItem.GetNextInt( volumeSteps );
       
  2330         
       
  2331         if ( err == KErrNone )
       
  2332         {        
       
  2333             //
       
  2334             // set volume steps
       
  2335             //
       
  2336             SetVolumeSteps( volumeSteps );
       
  2337             
       
  2338             err = aItem.GetNextInt( position );
       
  2339             
       
  2340             if ( err == KErrNone )
       
  2341             {
       
  2342                 TPtrC  link;
       
  2343     
       
  2344                 //
       
  2345                 //  Read in the link from the config file
       
  2346                 //
       
  2347                 TInt err = aItem.GetNextString( link );
       
  2348     
       
  2349                 if ( err == KErrNone )
       
  2350                 {
       
  2351                     TInt err = ReadInitializationErrors( aItem );
       
  2352     
       
  2353                     if ( err == KErrNone )
       
  2354                     {
       
  2355                         PreparePluginL();
       
  2356     
       
  2357                         //
       
  2358                         //  Extract the streaming link from the ram file and
       
  2359                         //  Initalize the Plugin with the link and an access point
       
  2360                         //
       
  2361                         MPX_DEBUG(_L("Initialize the Plugin:  link = %S, position = %d"), &link, position);
       
  2362                         iLog->Log(_L("Initialize the Plugin:  link = %S, position = %d"), &link, position);
       
  2363     
       
  2364                         iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11, position );
       
  2365                     }
       
  2366                 }
       
  2367             }
       
  2368         }
       
  2369     }
       
  2370 
       
  2371     return err;
       
  2372 }
       
  2373 
       
  2374 
       
  2375 TInt
       
  2376 CVHPPTestClass::InitializeHandleWithPositionL( CStifItemParser& aItem  )
       
  2377 {
       
  2378     MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeHandleL()"));
       
  2379     iLog->Log(_L("CVHPPTestClass::InitializeHandleL()"));
       
  2380 
       
  2381     TInt duration;
       
  2382     TInt volumeSteps;
       
  2383     TInt position;
       
  2384     TInt fileHandle32;
       
  2385     
       
  2386     TInt err = aItem.GetNextInt( fileHandle32 );
       
  2387     
       
  2388     if ( err == KErrNone )
       
  2389     {        
       
  2390     
       
  2391 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
  2392         //
       
  2393         // set RFile as default if the 64-bit flag is not defined
       
  2394         //
       
  2395         fileHandle32 = ETrue;
       
  2396 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
  2397         
       
  2398         err = aItem.GetNextInt( duration );
       
  2399     
       
  2400         if ( err == KErrNone )
       
  2401         {
       
  2402             //
       
  2403             //  We will always get an Init Complete message out
       
  2404             //
       
  2405             TCallbackEvent* event = new TCallbackEvent;
       
  2406     
       
  2407             event->iEvent = EPInitialised;
       
  2408             event->iData  = duration;
       
  2409             event->iError = KErrNone;
       
  2410     
       
  2411             AddExpectedEvent( event );
       
  2412     
       
  2413             // 
       
  2414             // read number of volume steps
       
  2415             //
       
  2416             err = aItem.GetNextInt( volumeSteps );
       
  2417             
       
  2418             if ( err == KErrNone )
       
  2419             {        
       
  2420                 //
       
  2421                 // set volume steps
       
  2422                 //
       
  2423                 SetVolumeSteps( volumeSteps );
       
  2424 
       
  2425                 err = aItem.GetNextInt( position );
       
  2426 
       
  2427                 if (err == KErrNone )
       
  2428                 {
       
  2429                     TBuf<120> fullPath;
       
  2430                     
       
  2431                     err = ReadFileInitializationParameters( aItem, fullPath );
       
  2432         
       
  2433                     if ( err == KErrNone )
       
  2434                     {
       
  2435                         PreparePluginL();
       
  2436         
       
  2437                         RFs fs;
       
  2438                         TInt error = fs.Connect();
       
  2439                         TInt fileError = KErrNone;
       
  2440                     
       
  2441                         //
       
  2442                         //  Open a file handle to the clip
       
  2443                         //
       
  2444                         if ( fileHandle32 )
       
  2445                         {
       
  2446                             RFile file;
       
  2447                             fileError = file.Open( fs, fullPath, EFileRead );
       
  2448                             iPlaybackPlugin->InitialiseWithPositionL( file, position );
       
  2449                             file.Close();
       
  2450                         }
       
  2451 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
  2452                         else
       
  2453                         {
       
  2454                             RFile64 file64;
       
  2455                             fileError = file64.Open( fs, fullPath, EFileRead );
       
  2456                             iPlaybackPlugin->Initialise64L( file64, position );
       
  2457                             file64.Close();
       
  2458                         }
       
  2459 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
  2460                             
       
  2461                         //
       
  2462                         //  Initalize the Plugin with a file name
       
  2463                         //
       
  2464                         MPX_DEBUG(_L("Initialize the Plugin with File Handle:  filename = %S, position = %d"), &fullPath, position);
       
  2465                         iLog->Log(_L("Initialize the Plugin with File Handle:  filename = %S, position = %d"), &fullPath, position);
       
  2466             
       
  2467                         fs.Close();
       
  2468                     }
       
  2469                 }            
       
  2470 
       
  2471             } 
       
  2472         } 
       
  2473     } 
       
  2474 
       
  2475     return err;
       
  2476 }
       
  2477 
  2232 //  EOF
  2478 //  EOF