118 ENTRY( "HandleVolume", CVHPPTestClass::HandleVolumeL ), |
118 ENTRY( "HandleVolume", CVHPPTestClass::HandleVolumeL ), |
119 |
119 |
120 ENTRY ("InitializeWithPositionL", CVHPPTestClass::InitializeWithPositionL), |
120 ENTRY ("InitializeWithPositionL", CVHPPTestClass::InitializeWithPositionL), |
121 ENTRY ("InitializeLinkWithPositionL", CVHPPTestClass::InitializeLinkWithPositionL), |
121 ENTRY ("InitializeLinkWithPositionL", CVHPPTestClass::InitializeLinkWithPositionL), |
122 ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL), |
122 ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL), |
123 ENTRY ( "InitializeStreamingWithSdpFileHandleL", |
123 ENTRY ( "InitializeStreamingWithSdpFileHandleL", CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ), |
124 CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ), |
124 ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL ) |
125 ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL ) |
|
126 |
125 |
127 // |
126 // |
128 // ADD NEW ENTRIES HERE |
127 // ADD NEW ENTRIES HERE |
129 // |
128 // |
130 // ENTRY( "SendPlayCommandToServer", |
129 // ENTRY( "SendPlayCommandToServer", |
304 event->iData = duration; |
303 event->iData = duration; |
305 event->iError = KErrNone; |
304 event->iError = KErrNone; |
306 |
305 |
307 AddExpectedEvent( event ); |
306 AddExpectedEvent( event ); |
308 |
307 |
309 // |
308 // |
310 // read number of volume steps |
309 // read number of volume steps |
311 // |
310 // |
312 err = aItem.GetNextInt( volumeSteps ); |
311 err = aItem.GetNextInt( volumeSteps ); |
313 |
312 |
314 if ( err == KErrNone ) |
313 if ( err == KErrNone ) |
315 { |
314 { |
316 // |
315 // |
317 // set volume steps |
316 // set volume steps |
318 // |
317 // |
319 SetVolumeSteps( volumeSteps ); |
318 SetVolumeSteps( volumeSteps ); |
320 |
319 |
321 TBuf<120> fullPath; |
320 TBuf<120> fullPath; |
322 |
321 |
323 err = ReadFileInitializationParameters( aItem, fullPath ); |
322 err = ReadFileInitializationParameters( aItem, fullPath ); |
324 |
323 |
325 if ( err == KErrNone ) |
324 if ( err == KErrNone ) |
326 { |
325 { |
327 PreparePluginL(); |
326 PreparePluginL(); |
328 |
327 |
329 // |
328 // |
330 // Initalize the Plugin with a file name |
329 // Initalize the Plugin with a file name |
331 // |
330 // |
332 MPX_DEBUG(_L("Initialize the Plugin: filename = %S"), &fullPath); |
331 MPX_DEBUG(_L("Initialize the Plugin: filename = %S"), &fullPath); |
333 iLog->Log(_L("Initialize the Plugin: filename = %S"), &fullPath); |
332 iLog->Log(_L("Initialize the Plugin: filename = %S"), &fullPath); |
334 |
333 |
335 iPlaybackPlugin->InitialiseL( fullPath ); |
334 iPlaybackPlugin->InitialiseL( fullPath ); |
336 } |
335 } |
337 } |
336 } |
338 } |
337 } |
339 |
338 |
366 event->iData = duration; |
365 event->iData = duration; |
367 event->iError = KErrNone; |
366 event->iError = KErrNone; |
368 |
367 |
369 AddExpectedEvent( event ); |
368 AddExpectedEvent( event ); |
370 |
369 |
371 // |
370 // |
372 // read number of volume steps |
371 // read number of volume steps |
373 // |
372 // |
374 err = aItem.GetNextInt( volumeSteps ); |
373 err = aItem.GetNextInt( volumeSteps ); |
375 |
374 |
376 if ( err == KErrNone ) |
375 if ( err == KErrNone ) |
377 { |
376 { |
378 // |
377 // |
379 // set volume steps |
378 // set volume steps |
380 // |
379 // |
381 SetVolumeSteps( volumeSteps ); |
380 SetVolumeSteps( volumeSteps ); |
382 |
381 |
383 TPtrC link; |
382 TPtrC link; |
384 |
383 |
385 // |
384 // |
386 // Read in the link from the config file |
385 // Read in the link from the config file |
387 // |
386 // |
388 TInt err = aItem.GetNextString( link ); |
387 TInt err = aItem.GetNextString( link ); |
389 |
388 |
390 if ( err == KErrNone ) |
389 if ( err == KErrNone ) |
391 { |
390 { |
392 TInt err = ReadInitializationErrors( aItem ); |
391 TInt err = ReadInitializationErrors( aItem ); |
393 |
392 |
394 if ( err == KErrNone ) |
393 if ( err == KErrNone ) |
395 { |
394 { |
396 PreparePluginL(); |
395 PreparePluginL(); |
397 |
396 |
398 // |
397 // |
399 // Extract the streaming link from the ram file and |
398 // Extract the streaming link from the ram file and |
400 // Initalize the Plugin with the link and an access point |
399 // Initalize the Plugin with the link and an access point |
401 // |
400 // |
402 MPX_DEBUG(_L("Initialize the Plugin: link = %S"), &link); |
401 MPX_DEBUG(_L("Initialize the Plugin: link = %S"), &link); |
403 iLog->Log(_L("Initialize the Plugin: link = %S"), &link); |
402 iLog->Log(_L("Initialize the Plugin: link = %S"), &link); |
404 |
403 |
405 iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11 ); |
404 iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11 ); |
406 } |
405 } |
407 } |
406 } |
408 } |
407 } |
409 } |
408 } |
461 iLog->Log(_L("CVHPPTestClass::InitializeHandleL()")); |
460 iLog->Log(_L("CVHPPTestClass::InitializeHandleL()")); |
462 |
461 |
463 TInt duration; |
462 TInt duration; |
464 TInt volumeSteps; |
463 TInt volumeSteps; |
465 TInt fileHandle32; |
464 TInt fileHandle32; |
466 |
465 |
467 TInt err = aItem.GetNextInt( fileHandle32 ); |
466 TInt err = aItem.GetNextInt( fileHandle32 ); |
468 |
467 |
469 if ( err == KErrNone ) |
468 if ( err == KErrNone ) |
470 { |
469 { |
471 |
470 |
472 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
471 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
473 // |
472 // |
474 // set RFile as default if the 64-bit flag is not defined |
473 // set RFile as default if the 64-bit flag is not defined |
475 // |
474 // |
476 fileHandle32 = ETrue; |
475 fileHandle32 = ETrue; |
477 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
476 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
478 |
477 |
479 err = aItem.GetNextInt( duration ); |
478 err = aItem.GetNextInt( duration ); |
480 |
479 |
481 if ( err == KErrNone ) |
480 if ( err == KErrNone ) |
482 { |
481 { |
483 // |
482 // |
484 // We will always get an Init Complete message out |
483 // We will always get an Init Complete message out |
485 // |
484 // |
486 TCallbackEvent* event = new TCallbackEvent; |
485 TCallbackEvent* event = new TCallbackEvent; |
487 |
486 |
488 event->iEvent = EPInitialised; |
487 event->iEvent = EPInitialised; |
489 event->iData = duration; |
488 event->iData = duration; |
490 event->iError = KErrNone; |
489 event->iError = KErrNone; |
491 |
490 |
492 AddExpectedEvent( event ); |
491 AddExpectedEvent( event ); |
493 |
492 |
494 // |
493 // |
495 // read number of volume steps |
494 // read number of volume steps |
496 // |
495 // |
497 err = aItem.GetNextInt( volumeSteps ); |
496 err = aItem.GetNextInt( volumeSteps ); |
498 |
497 |
499 if ( err == KErrNone ) |
498 if ( err == KErrNone ) |
500 { |
499 { |
501 // |
500 // |
502 // set volume steps |
501 // set volume steps |
503 // |
502 // |
504 SetVolumeSteps( volumeSteps ); |
503 SetVolumeSteps( volumeSteps ); |
505 |
504 |
506 TBuf<120> fullPath; |
505 TBuf<120> fullPath; |
507 |
506 |
508 err = ReadFileInitializationParameters( aItem, fullPath ); |
507 err = ReadFileInitializationParameters( aItem, fullPath ); |
509 |
508 |
510 if ( err == KErrNone ) |
509 if ( err == KErrNone ) |
511 { |
510 { |
512 PreparePluginL(); |
511 PreparePluginL(); |
513 |
512 |
514 RFs fs; |
513 RFs fs; |
515 TInt error = fs.Connect(); |
514 TInt error = fs.Connect(); |
516 |
515 |
517 // |
516 // |
518 // Open a file handle to the clip |
517 // Open a file handle to the clip |
519 // |
518 // |
520 if ( fileHandle32 ) |
519 if ( fileHandle32 ) |
521 { |
520 { |
1250 CVHPPTestClass::PauseDownloadL( CStifItemParser& /*aItem*/ ) |
1249 CVHPPTestClass::PauseDownloadL( CStifItemParser& /*aItem*/ ) |
1251 { |
1250 { |
1252 MPX_ENTER_EXIT(_L("CVHPPTestClass::PauseDownloadL()")); |
1251 MPX_ENTER_EXIT(_L("CVHPPTestClass::PauseDownloadL()")); |
1253 iLog->Log(_L("CVHPPTestClass::PauseDownloadL()")); |
1252 iLog->Log(_L("CVHPPTestClass::PauseDownloadL()")); |
1254 |
1253 |
1255 #ifdef USE_S60_DOWNLOAD_MANAGER |
1254 #ifdef USE_S60_DOWNLOAD_MANAGER |
1256 |
1255 |
1257 TCallbackEvent* event = new TCallbackEvent; |
1256 TCallbackEvent* event = new TCallbackEvent; |
1258 |
1257 |
1259 event->iEvent = EPDownloadStateChanged; |
1258 event->iEvent = EPDownloadStateChanged; |
1260 event->iData = EPbDlStateDownloadPaused; |
1259 event->iData = EPbDlStateDownloadPaused; |
1261 event->iError = KErrNone; |
1260 event->iError = KErrNone; |
1262 |
1261 |
1263 AddExpectedEvent( event ); |
1262 AddExpectedEvent( event ); |
1264 |
1263 |
1265 iDlMgrTester->PauseDownload(); |
1264 iDlMgrTester->PauseDownload(); |
1266 |
1265 |
1267 #else // USE_S60_DOWNLOAD_MANAGER |
1266 #else // USE_S60_DOWNLOAD_MANAGER |
1268 |
1267 |
1269 // Signal TestScripter to continue from waittestclass |
1268 // Signal TestScripter to continue from waittestclass |
1270 Signal(); |
1269 Signal(); |
1271 |
1270 |
1272 #endif // USE_S60_DOWNLOAD_MANAGER |
1271 #endif // USE_S60_DOWNLOAD_MANAGER |
1273 |
1272 |
1274 return KErrNone; |
1273 return KErrNone; |
1275 } |
1274 } |
1276 |
1275 |
1277 // ----------------------------------------------------------------------------- |
1276 // ----------------------------------------------------------------------------- |
1278 // CVHPPTestClass::ResumeDownloadL |
1277 // CVHPPTestClass::ResumeDownloadL |
1336 CVHPPTestClass::CancelDownloadL( CStifItemParser& /*aItem*/ ) |
1335 CVHPPTestClass::CancelDownloadL( CStifItemParser& /*aItem*/ ) |
1337 { |
1336 { |
1338 MPX_ENTER_EXIT(_L("CVHPPTestClass::CancelDownloadL()")); |
1337 MPX_ENTER_EXIT(_L("CVHPPTestClass::CancelDownloadL()")); |
1339 iLog->Log(_L("CVHPPTestClass::CancelDownloadL()")); |
1338 iLog->Log(_L("CVHPPTestClass::CancelDownloadL()")); |
1340 |
1339 |
1341 #ifdef USE_S60_DOWNLOAD_MANAGER |
1340 #ifdef USE_S60_DOWNLOAD_MANAGER |
1342 |
1341 |
1343 TCallbackEvent* event = new TCallbackEvent; |
1342 TCallbackEvent* event = new TCallbackEvent; |
1344 |
1343 |
1345 event->iEvent = EPDownloadStateChanged; |
1344 event->iEvent = EPDownloadStateChanged; |
1346 event->iData = EPbDlStateDownloadCanceled; |
1345 event->iData = EPbDlStateDownloadCanceled; |
1347 event->iError = KErrNone; |
1346 event->iError = KErrNone; |
1348 |
1347 |
1349 AddExpectedEvent( event ); |
1348 AddExpectedEvent( event ); |
1350 |
1349 |
1351 iDlMgrTester->CancelDownload(); |
1350 iDlMgrTester->CancelDownload(); |
1352 |
1351 |
1353 #else // USE_S60_DOWNLOAD_MANAGER |
1352 #else // USE_S60_DOWNLOAD_MANAGER |
1354 |
1353 |
1355 // Signal TestScripter to continue from waittestclass |
1354 // Signal TestScripter to continue from waittestclass |
1356 Signal(); |
1355 Signal(); |
1357 |
1356 |
1358 #endif // USE_S60_DOWNLOAD_MANAGER |
1357 #endif // USE_S60_DOWNLOAD_MANAGER |
1359 |
1358 |
1360 return KErrNone; |
1359 return KErrNone; |
1361 } |
1360 } |
1362 |
1361 |
1363 // ----------------------------------------------------------------------------- |
1362 // ----------------------------------------------------------------------------- |
1364 // CVHPPTestClass::RetrievePdlStatusL |
1363 // CVHPPTestClass::RetrievePdlStatusL |
2119 } |
2125 } |
2120 |
2126 |
2121 return err; |
2127 return err; |
2122 } |
2128 } |
2123 |
2129 |
2124 // ----------------------------------------------------------------------------- |
2130 // ----------------------------------------------------------------------------- |
2125 // CVHPPTestClass::SetVolumeSteps |
2131 // CVHPPTestClass::SetVolumeSteps |
2126 // ----------------------------------------------------------------------------- |
2132 // ----------------------------------------------------------------------------- |
2127 // |
2133 // |
2128 TInt |
2134 TInt |
2129 CVHPPTestClass::SetVolumeSteps( TInt aVolumeSteps ) |
2135 CVHPPTestClass::SetVolumeSteps( TInt aVolumeSteps ) |
2130 { |
2136 { |
2131 MPX_ENTER_EXIT(_L("CVHPPTestClass::SetVolumeSteps()")); |
2137 MPX_ENTER_EXIT(_L("CVHPPTestClass::SetVolumeSteps()")); |
2132 iLog->Log(_L("CVHPPTestClass::SetVolumeSteps()")); |
2138 iLog->Log(_L("CVHPPTestClass::SetVolumeSteps()")); |
2133 |
2139 |
2134 iPlayerUtility->SetVolumeSteps( aVolumeSteps ); |
2140 iPlayerUtility->SetVolumeSteps( aVolumeSteps ); |
2135 |
2141 |
2136 return KErrNone; |
2142 return KErrNone; |
2137 } |
2143 } |
2138 |
2144 |
2139 // ----------------------------------------------------------------------------- |
2145 // ----------------------------------------------------------------------------- |
2140 // CVHPPTestClass::HandleVolumeL |
2146 // CVHPPTestClass::HandleVolumeL |
2141 // ----------------------------------------------------------------------------- |
2147 // ----------------------------------------------------------------------------- |
2142 // |
2148 // |
2143 TInt |
2149 TInt |
2144 CVHPPTestClass::HandleVolumeL( CStifItemParser& aItem ) |
2150 CVHPPTestClass::HandleVolumeL( CStifItemParser& aItem ) |
2145 { |
2151 { |
2146 MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleVolumeL()")); |
2152 MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleVolumeL()")); |
2147 iLog->Log(_L("CVHPPTestClass::HandleVolumeL()")); |
2153 iLog->Log(_L("CVHPPTestClass::HandleVolumeL()")); |
2148 |
2154 |
2149 TInt command; |
2155 TInt command; |
2150 TInt value; |
2156 TInt value; |
2151 |
2157 |
2152 TInt err = aItem.GetNextInt( command ); |
2158 TInt err = aItem.GetNextInt( command ); |
2153 |
2159 |
2154 if ( err == KErrNone ) |
2160 if ( err == KErrNone ) |
2155 { |
2161 { |
2156 err = aItem.GetNextInt( value ); |
2162 err = aItem.GetNextInt( value ); |
2157 |
2163 |
2158 if ( err == KErrNone ) |
2164 if ( err == KErrNone ) |
2159 { |
2165 { |
2160 // |
2166 // |
2161 // assign callback event values |
2167 // assign callback event values |
2162 // |
2168 // |
2163 TCallbackEvent* event = new TCallbackEvent; |
2169 TCallbackEvent* event = new TCallbackEvent; |
2164 event->iEvent = EPVolumeChanged; |
2170 event->iEvent = EPVolumeChanged; |
2165 event->iData = value; |
2171 event->iData = value; |
2166 event->iError = KErrNone; |
2172 event->iError = KErrNone; |
2167 |
2173 |
2168 // |
2174 // |
2169 // save expected result to be compared later |
2175 // save expected result to be compared later |
2170 // |
2176 // |
2171 AddExpectedEvent( event ); |
2177 AddExpectedEvent( event ); |
2172 |
2178 |
2173 // |
2179 // |
2174 // send command to playback plugin |
2180 // send command to playback plugin |
2175 // |
2181 // |
2176 CreateVideoPlaybackCommandL( aItem, (TMPXVideoPlaybackCommand)command ); |
2182 CreateVideoPlaybackCommandL( aItem, (TMPXVideoPlaybackCommand)command ); |
2177 } |
2183 } |
2178 } |
2184 } |
2179 |
2185 |
2180 if ( err == KErrNone ) |
2186 if ( err == KErrNone ) |
2181 { |
2187 { |
2182 MPX_DEBUG(_L("CVHPPTestClass::HandleVolumeL() leaves with proper error")); |
2188 MPX_DEBUG(_L("CVHPPTestClass::HandleVolumeL() leaves with proper error")); |
2183 } |
2189 } |
2184 |
2190 |
2185 return err; |
2191 return err; |
2186 } |
2192 } |
2187 |
2193 |
2188 |
2194 |
2189 TInt |
2195 TInt |
2190 CVHPPTestClass::InitializeWithPositionL( CStifItemParser& aItem ) |
2196 CVHPPTestClass::InitializeWithPositionL( CStifItemParser& aItem ) |
2191 { |
2197 { |
2209 event->iData = duration; |
2215 event->iData = duration; |
2210 event->iError = KErrNone; |
2216 event->iError = KErrNone; |
2211 |
2217 |
2212 AddExpectedEvent( event ); |
2218 AddExpectedEvent( event ); |
2213 |
2219 |
2214 // |
2220 // |
2215 // read number of volume steps |
2221 // read number of volume steps |
2216 // |
2222 // |
2217 err = aItem.GetNextInt( volumeSteps ); |
2223 err = aItem.GetNextInt( volumeSteps ); |
2218 |
2224 |
2219 if ( err == KErrNone ) |
2225 if ( err == KErrNone ) |
2220 { |
2226 { |
2221 // |
2227 // |
2222 // set volume steps |
2228 // set volume steps |
2223 // |
2229 // |
2224 SetVolumeSteps( volumeSteps ); |
2230 SetVolumeSteps( volumeSteps ); |
2225 |
2231 |
2226 err = aItem.GetNextInt( position ); |
2232 err = aItem.GetNextInt( position ); |
2227 |
2233 |
2228 if (err == KErrNone ) |
2234 if (err == KErrNone ) |
2229 { |
2235 { |
2230 TBuf<120> fullPath; |
2236 TBuf<120> fullPath; |
2231 |
2237 |
2232 err = ReadFileInitializationParameters( aItem, fullPath ); |
2238 err = ReadFileInitializationParameters( aItem, fullPath ); |
2233 |
2239 |
2234 if ( err == KErrNone ) |
2240 if ( err == KErrNone ) |
2235 { |
2241 { |
2236 PreparePluginL(); |
2242 PreparePluginL(); |
2237 |
2243 |
2238 // |
2244 // |
2239 // Initalize the Plugin with a file name |
2245 // Initalize the Plugin with a file name |
2240 // |
2246 // |
2241 MPX_DEBUG(_L("Initialize the Plugin: filename = %S, position = %d"), &fullPath, position); |
2247 MPX_DEBUG(_L("Initialize the Plugin: filename = %S, position = %d"), &fullPath, position); |
2242 iLog->Log(_L("Initialize the Plugin: filename = %S, position = %d"), &fullPath, position); |
2248 iLog->Log(_L("Initialize the Plugin: filename = %S, position = %d"), &fullPath, position); |
2243 |
2249 |
2244 iPlaybackPlugin->InitialiseWithPositionL( fullPath, position ); |
2250 iPlaybackPlugin->InitialiseWithPositionL( fullPath, position ); |
2245 } |
2251 } |
2246 |
2252 |
2247 } |
2253 } |
2248 } |
2254 } |
2275 event->iData = duration; |
2281 event->iData = duration; |
2276 event->iError = KErrNone; |
2282 event->iError = KErrNone; |
2277 |
2283 |
2278 AddExpectedEvent( event ); |
2284 AddExpectedEvent( event ); |
2279 |
2285 |
2280 // |
2286 // |
2281 // read number of volume steps |
2287 // read number of volume steps |
2282 // |
2288 // |
2283 err = aItem.GetNextInt( volumeSteps ); |
2289 err = aItem.GetNextInt( volumeSteps ); |
2284 |
2290 |
2285 if ( err == KErrNone ) |
2291 if ( err == KErrNone ) |
2286 { |
2292 { |
2287 // |
2293 // |
2288 // set volume steps |
2294 // set volume steps |
2289 // |
2295 // |
2290 SetVolumeSteps( volumeSteps ); |
2296 SetVolumeSteps( volumeSteps ); |
2291 |
2297 |
2292 err = aItem.GetNextInt( position ); |
2298 err = aItem.GetNextInt( position ); |
2293 |
2299 |
2294 if ( err == KErrNone ) |
2300 if ( err == KErrNone ) |
2295 { |
2301 { |
2296 TPtrC link; |
2302 TPtrC link; |
2297 |
2303 |
2298 // |
2304 // |
2299 // Read in the link from the config file |
2305 // Read in the link from the config file |
2300 // |
2306 // |
2301 TInt err = aItem.GetNextString( link ); |
2307 TInt err = aItem.GetNextString( link ); |
2302 |
2308 |
2303 if ( err == KErrNone ) |
2309 if ( err == KErrNone ) |
2304 { |
2310 { |
2305 TInt err = ReadInitializationErrors( aItem ); |
2311 TInt err = ReadInitializationErrors( aItem ); |
2306 |
2312 |
2307 if ( err == KErrNone ) |
2313 if ( err == KErrNone ) |
2308 { |
2314 { |
2309 PreparePluginL(); |
2315 PreparePluginL(); |
2310 |
2316 |
2311 // |
2317 // |
2312 // Extract the streaming link from the ram file and |
2318 // Extract the streaming link from the ram file and |
2313 // Initalize the Plugin with the link and an access point |
2319 // Initalize the Plugin with the link and an access point |
2314 // |
2320 // |
2315 MPX_DEBUG(_L("Initialize the Plugin: link = %S, position = %d"), &link, position); |
2321 MPX_DEBUG(_L("Initialize the Plugin: link = %S, position = %d"), &link, position); |
2316 iLog->Log(_L("Initialize the Plugin: link = %S, position = %d"), &link, position); |
2322 iLog->Log(_L("Initialize the Plugin: link = %S, position = %d"), &link, position); |
2317 |
2323 |
2318 iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11, position ); |
2324 iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11, position ); |
2319 } |
2325 } |
2320 } |
2326 } |
2321 } |
2327 } |
2322 } |
2328 } |
2334 |
2340 |
2335 TInt duration; |
2341 TInt duration; |
2336 TInt volumeSteps; |
2342 TInt volumeSteps; |
2337 TInt position; |
2343 TInt position; |
2338 TInt fileHandle32; |
2344 TInt fileHandle32; |
2339 |
2345 |
2340 TInt err = aItem.GetNextInt( fileHandle32 ); |
2346 TInt err = aItem.GetNextInt( fileHandle32 ); |
2341 |
2347 |
2342 if ( err == KErrNone ) |
2348 if ( err == KErrNone ) |
2343 { |
2349 { |
2344 |
2350 |
2345 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
2351 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
2346 // |
2352 // |
2347 // set RFile as default if the 64-bit flag is not defined |
2353 // set RFile as default if the 64-bit flag is not defined |
2348 // |
2354 // |
2349 fileHandle32 = ETrue; |
2355 fileHandle32 = ETrue; |
2350 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
2356 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
2351 |
2357 |
2352 err = aItem.GetNextInt( duration ); |
2358 err = aItem.GetNextInt( duration ); |
2353 |
2359 |
2354 if ( err == KErrNone ) |
2360 if ( err == KErrNone ) |
2355 { |
2361 { |
2356 // |
2362 // |
2357 // We will always get an Init Complete message out |
2363 // We will always get an Init Complete message out |
2358 // |
2364 // |
2359 TCallbackEvent* event = new TCallbackEvent; |
2365 TCallbackEvent* event = new TCallbackEvent; |
2360 |
2366 |
2361 event->iEvent = EPInitialised; |
2367 event->iEvent = EPInitialised; |
2362 event->iData = duration; |
2368 event->iData = duration; |
2363 event->iError = KErrNone; |
2369 event->iError = KErrNone; |
2364 |
2370 |
2365 AddExpectedEvent( event ); |
2371 AddExpectedEvent( event ); |
2366 |
2372 |
2367 // |
2373 // |
2368 // read number of volume steps |
2374 // read number of volume steps |
2369 // |
2375 // |
2370 err = aItem.GetNextInt( volumeSteps ); |
2376 err = aItem.GetNextInt( volumeSteps ); |
2371 |
2377 |
2372 if ( err == KErrNone ) |
2378 if ( err == KErrNone ) |
2373 { |
2379 { |
2374 // |
2380 // |
2375 // set volume steps |
2381 // set volume steps |
2376 // |
2382 // |
2377 SetVolumeSteps( volumeSteps ); |
2383 SetVolumeSteps( volumeSteps ); |
2378 |
2384 |
2379 err = aItem.GetNextInt( position ); |
2385 err = aItem.GetNextInt( position ); |
2380 |
2386 |
2381 if (err == KErrNone ) |
2387 if (err == KErrNone ) |
2382 { |
2388 { |
2383 TBuf<120> fullPath; |
2389 TBuf<120> fullPath; |
2384 |
2390 |
2385 err = ReadFileInitializationParameters( aItem, fullPath ); |
2391 err = ReadFileInitializationParameters( aItem, fullPath ); |
2386 |
2392 |
2387 if ( err == KErrNone ) |
2393 if ( err == KErrNone ) |
2388 { |
2394 { |
2389 PreparePluginL(); |
2395 PreparePluginL(); |
2390 |
2396 |
2391 RFs fs; |
2397 RFs fs; |
2392 TInt error = fs.Connect(); |
2398 TInt error = fs.Connect(); |
2393 |
2399 |
2394 // |
2400 // |
2395 // Open a file handle to the clip |
2401 // Open a file handle to the clip |
2396 // |
2402 // |
2397 if ( fileHandle32 ) |
2403 if ( fileHandle32 ) |
2398 { |
2404 { |
2435 iLog->Log(_L("CVHPPTestClass::InitializeStreamingWithSdpFileHandleL()")); |
2441 iLog->Log(_L("CVHPPTestClass::InitializeStreamingWithSdpFileHandleL()")); |
2436 |
2442 |
2437 TInt duration; |
2443 TInt duration; |
2438 TInt volumeSteps; |
2444 TInt volumeSteps; |
2439 TInt fileHandle32; |
2445 TInt fileHandle32; |
2440 |
2446 |
2441 TInt err = aItem.GetNextInt( fileHandle32 ); |
2447 TInt err = aItem.GetNextInt( fileHandle32 ); |
2442 |
2448 |
2443 if ( err == KErrNone ) |
2449 if ( err == KErrNone ) |
2444 { |
2450 { |
2445 |
2451 |
2446 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
2452 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
2447 // |
2453 // |
2448 // set RFile as default if the 64-bit flag is not defined |
2454 // set RFile as default if the 64-bit flag is not defined |
2449 // |
2455 // |
2450 fileHandle32 = ETrue; |
2456 fileHandle32 = ETrue; |
2451 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
2457 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
2452 |
2458 |
2453 err = aItem.GetNextInt( duration ); |
2459 err = aItem.GetNextInt( duration ); |
2454 |
2460 |
2455 if ( err == KErrNone ) |
2461 if ( err == KErrNone ) |
2456 { |
2462 { |
2457 // |
2463 // |
2458 // We will always get an Init Complete message out |
2464 // We will always get an Init Complete message out |
2459 // |
2465 // |
2460 TCallbackEvent* event = new TCallbackEvent; |
2466 TCallbackEvent* event = new TCallbackEvent; |
2461 |
2467 |
2462 event->iEvent = EPInitialised; |
2468 event->iEvent = EPInitialised; |
2463 event->iData = duration; |
2469 event->iData = duration; |
2464 event->iError = KErrNone; |
2470 event->iError = KErrNone; |
2465 |
2471 |
2466 AddExpectedEvent( event ); |
2472 AddExpectedEvent( event ); |
2467 |
2473 |
2468 // |
2474 // |
2469 // read number of volume steps |
2475 // read number of volume steps |
2470 // |
2476 // |
2471 err = aItem.GetNextInt( volumeSteps ); |
2477 err = aItem.GetNextInt( volumeSteps ); |
2472 |
2478 |
2473 if ( err == KErrNone ) |
2479 if ( err == KErrNone ) |
2474 { |
2480 { |
2475 // |
2481 // |
2476 // set volume steps |
2482 // set volume steps |
2477 // |
2483 // |
2478 SetVolumeSteps( volumeSteps ); |
2484 SetVolumeSteps( volumeSteps ); |
2479 |
2485 |
2480 TBuf<120> fullPath; |
2486 TBuf<120> fullPath; |
2481 err = ReadFileInitializationParameters( aItem, fullPath ); |
2487 err = ReadFileInitializationParameters( aItem, fullPath ); |
2482 |
2488 |
2483 if ( err == KErrNone ) |
2489 if ( err == KErrNone ) |
2484 { |
2490 { |
2485 PreparePluginL(); |
2491 PreparePluginL(); |
2486 |
2492 |
2487 MPX_DEBUG( _L("Initialize the Plugin: link = %S"), &fullPath ); |
2493 MPX_DEBUG( _L("Initialize the Plugin: link = %S"), &fullPath ); |
2488 iLog->Log( _L("Initialize the Plugin: link = %S"), &fullPath ); |
2494 iLog->Log( _L("Initialize the Plugin: link = %S"), &fullPath ); |
2489 |
2495 |
2490 // |
2496 // |
2491 // Extract the streaming link from the ram file and |
2497 // Extract the streaming link from the ram file and |
2492 // Initalize the Plugin with the file handle and an access point |
2498 // Initalize the Plugin with the file handle and an access point |
2493 // |
2499 // |
2494 RFs fs; |
2500 RFs fs; |
2495 TInt error = fs.Connect(); |
2501 TInt error = fs.Connect(); |
2496 |
2502 |
2497 if ( fileHandle32 ) |
2503 if ( fileHandle32 ) |
2498 { |
2504 { |
2499 RFile file; |
2505 RFile file; |
2500 error = file.Open( fs, fullPath, EFileRead | EFileShareAny ); |
2506 error = file.Open( fs, fullPath, EFileRead | EFileShareAny ); |
2501 |
2507 |
2502 MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), |
2508 MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), |
2503 error ); |
2509 error ); |
2504 |
2510 |
2505 User::LeaveIfError( error ); |
2511 User::LeaveIfError( error ); |
2506 |
2512 |
2507 iPlaybackPlugin->InitStreamingL( file, 11 ); |
2513 iPlaybackPlugin->InitStreamingL( file, 11 ); |
2508 file.Close(); |
2514 file.Close(); |
2509 } |
2515 } |
2510 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
2516 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
2511 else |
2517 else |
2512 { |
2518 { |
2513 RFile64 file64; |
2519 RFile64 file64; |
2514 error = file64.Open( fs, fullPath, EFileRead | EFileShareAny ); |
2520 error = file64.Open( fs, fullPath, EFileRead | EFileShareAny ); |
2515 |
2521 |
2516 MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), |
2522 MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), |
2517 error ); |
2523 error ); |
2518 |
2524 |
2519 User::LeaveIfError( error ); |
2525 User::LeaveIfError( error ); |
2520 |
2526 |
2521 iPlaybackPlugin->InitStreaming64L( file64, 11 ); |
2527 iPlaybackPlugin->InitStreaming64L( file64, 11 ); |
2522 file64.Close(); |
2528 file64.Close(); |
2523 } |
2529 } |
2524 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
2530 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
2525 |
2531 |
2526 fs.Close(); |
2532 fs.Close(); |
2527 } |
2533 } |
2528 } |
2534 } |
2529 } |
2535 } |
2530 } |
2536 } |
2531 return err; |
2537 return err; |
2532 } |
2538 } |
2533 |
2539 |
2534 TInt |
2540 TInt |
2535 CVHPPTestClass::RetrieveFileNameAndModeL( CStifItemParser& aItem ) |
2541 CVHPPTestClass::RetrieveFileNameAndModeL( CStifItemParser& aItem ) |
2536 { |
2542 { |
2537 MPX_ENTER_EXIT( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") ); |
2543 MPX_ENTER_EXIT( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") ); |
2538 iLog->Log( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") ); |
2544 iLog->Log( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") ); |
2539 |
2545 |
2540 TBuf<120> fullPath; |
2546 TBuf<120> fullPath; |
2541 TPtrC fileName; |
2547 TPtrC fileName; |
2542 TInt err; |
2548 TInt err; |
2543 |
2549 |
2544 err = aItem.GetNextString( fileName ); |
2550 err = aItem.GetNextString( fileName ); |
2545 |
2551 |
2546 if ( err == KErrNone ) |
2552 if ( err == KErrNone ) |
2547 { |
2553 { |
2548 // |
2554 // |
2549 // Build the full path to the file |
2555 // Build the full path to the file |
2550 // |
2556 // |
2551 fullPath.Append( KVideoTestPath ); |
2557 fullPath.Append( KVideoTestPath ); |
2552 fullPath.Append( fileName ); |
2558 fullPath.Append( fileName ); |
2553 |
2559 |
2554 TInt mode; |
2560 TInt mode; |
2555 err = aItem.GetNextInt( mode); |
2561 err = aItem.GetNextInt( mode); |
2556 |
2562 |
2557 if ( err == KErrNone ) |
2563 if ( err == KErrNone ) |
2558 { |
2564 { |
2559 CMPXCommand* cmd = CMPXCommand::NewL(); |
2565 CMPXCommand* cmd = CMPXCommand::NewL(); |
2560 CleanupStack::PushL( cmd ); |
2566 CleanupStack::PushL( cmd ); |
2561 |
2567 |
2562 cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue ); |
2568 cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue ); |
2563 cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, |
2569 cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, |
2564 KMPXMediaIdVideoPlayback ); |
2570 KMPXMediaIdVideoPlayback ); |
2565 cmd->SetTObjectValueL<TInt>( KMPXMediaVideoPlaybackCommand, EPbCmdInitView ); |
2571 cmd->SetTObjectValueL<TInt>( KMPXMediaVideoPlaybackCommand, EPbCmdInitView ); |
2566 |
2572 |
2567 iPlaybackPlugin->CommandL( *cmd ); |
2573 iPlaybackPlugin->CommandL( *cmd ); |
2568 |
2574 |
2569 TPtrC clipName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) ); |
2575 TPtrC clipName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) ); |
2570 TMPXVideoMode playbackMode = (TMPXVideoMode) cmd->ValueTObjectL<TInt>( KMPXMediaVideoMode ); |
2576 TMPXVideoMode playbackMode = (TMPXVideoMode) cmd->ValueTObjectL<TInt>( KMPXMediaVideoMode ); |
2571 |
2577 |
2572 MPX_DEBUG( _L(" Expected Data: filename = %S, playbackmode= %d" ), |
2578 MPX_DEBUG( _L(" Expected Data: filename = %S, playbackmode= %d" ), |
2573 &fullPath, mode ); |
2579 &fullPath, mode ); |
2574 |
2580 |
2575 MPX_DEBUG( _L(" Retrieved Data: filename = %S, playbackmode= %d"), |
2581 MPX_DEBUG( _L(" Retrieved Data: filename = %S, playbackmode= %d"), |
2576 &clipName, playbackMode ); |
2582 &clipName, playbackMode ); |
2577 |
2583 |
2578 if ( fullPath.Compare( clipName) != 0 || mode != playbackMode ) |
2584 if ( fullPath.Compare( clipName) != 0 || mode != playbackMode ) |
2579 { |
2585 { |
2580 err = KErrGeneral; |
2586 err = KErrGeneral; |
2581 MPX_DEBUG( _L(" err = %d"), err ); |
2587 MPX_DEBUG( _L(" err = %d"), err ); |
2582 } |
2588 } |
2583 |
2589 |
2584 CleanupStack::PopAndDestroy( cmd ); |
2590 CleanupStack::PopAndDestroy( cmd ); |
2585 } |
2591 } |
2586 } |
2592 } |
2587 |
2593 |
2588 return err; |
2594 return err; |
2589 } |
2595 } |