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", |
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 { |
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 |
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 |
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 { |
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 } |
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 { |
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 } |