Update contrib.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 // Specific includes for this test code
20 #include <mmf/common/mmfstandardcustomcommands.h>
21 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
22 #include <mmf/common/mmfstandardcustomcommandsenums.h>
23 #include <mmf/common/mmfstandardcustomcommandsimpl.h>
25 #include "tsu_mmf_avictrl_teststep.h"
26 #include "tsu_mmf_avictrl_testsuite.h"
27 #include "tsu_mmf_avictrlplay.h"
28 #include "tsu_mmf_avictrltestids.h"
29 #define KExtraIterations 5
31 const TUint RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap::KMaxFreeRamForTest;
34 Test step constructor. It initialises its own name and the input filename
36 RTestStepAviPlayCtrlPlay::RTestStepAviPlayCtrlPlay(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
37 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
42 Do the test step. This test Primes the AviPlayController and Plays an avi file to its completion
43 and checks for the proper play completion
45 TVerdict RTestStepAviPlayCtrlPlay::DoTestStepL()
47 INFO_PRINTF1(_L("this step plays an avi file "));
48 TInt errorCode = iController.Prime();
51 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
54 errorCode = iController.Play();
57 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
60 CActiveScheduler::Start();
61 return iTestStepResult;
65 Test step constructor. It initialises its own name and the input filename
67 RTestStepAviPlayCtrlVolume::RTestStepAviPlayCtrlVolume(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
68 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
73 Do the test step.This tests setting the volume on AviPlayController in Stopped, Primed and Playing
74 states and checks if the volume set is same as the volume got.
76 TVerdict RTestStepAviPlayCtrlVolume::DoTestStepL( void )
79 RMMFVideoPlayControllerCustomCommands thePlayCommander(iController);
80 TBool enabled = EFalse;
81 thePlayCommander.GetAudioEnabled(enabled);
84 INFO_PRINTF2(_L("GetAudioEnabled() is failed with %d "), errorCode);
87 INFO_PRINTF1(_L("this step tests SetVolume/GetVolume() APIs of AviPlayController"));
88 RMMFAudioPlayDeviceCustomCommands theAudioDevice(iController);
90 errorCode =theAudioDevice.GetMaxVolume(maxVolume);
93 INFO_PRINTF2(_L("GetMaxVolume() is failed with %d "), errorCode);
96 TInt theVolume = maxVolume /2;
97 TTimeIntervalMicroSeconds ramp(100);
98 //try setting volume in Stopped State
99 errorCode =theAudioDevice.SetVolume(theVolume);
102 INFO_PRINTF2(_L("SetVolume() during Stopped State is failed with %d "), errorCode);
105 TInt theNewVolume (0);
106 errorCode =theAudioDevice.GetVolume(theNewVolume);
109 INFO_PRINTF2(_L("GetVolume() during Stopped State is failed with %d "), errorCode);
112 if( theNewVolume != theVolume )
114 INFO_PRINTF1(_L("Set and Get Volumes are different during Stopped State"));
117 errorCode =theAudioDevice.SetVolumeRamp(ramp);
120 INFO_PRINTF2(_L("SetVolumeRamp() during Stopped State is failed with %d "), errorCode);
123 errorCode = iController.Prime();
126 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
127 return EInconclusive;
129 //try setting volume in Primed State
130 errorCode =theAudioDevice.SetVolume(theVolume);
133 INFO_PRINTF2(_L("SetVolume() during Primed State is failed with %d "), errorCode);
136 errorCode =theAudioDevice.GetVolume(theNewVolume);
139 INFO_PRINTF2(_L("GetVolume() during Primed State is failed with %d "), errorCode);
142 if( theNewVolume != theVolume )
144 INFO_PRINTF1(_L("Set and Get Volumes are different during Primed State"));
147 errorCode =theAudioDevice.SetVolumeRamp(ramp);
150 INFO_PRINTF2(_L("SetVolumeRamp() during primed State is failed with %d "), errorCode);
153 errorCode = iController.Play();
156 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
157 return EInconclusive;
159 //try setting volume in Playing State
160 errorCode =theAudioDevice.SetVolume(theVolume);
163 INFO_PRINTF2(_L("SetVolume() during Playing State is failed with %d "), errorCode);
167 errorCode =theAudioDevice.GetVolume(theNewVolume);
170 INFO_PRINTF2(_L("GetVolume() during Playing State is failed with %d "), errorCode);
174 if(theNewVolume != theVolume)
176 //stop the controller
177 INFO_PRINTF1(_L("Set and Get Volumes are different during Playing State"));
181 errorCode =theAudioDevice.SetVolumeRamp(ramp);
184 INFO_PRINTF2(_L("SetVolumeRamp() during play State is failed with %d "), errorCode);
187 //get the play completion event
188 CActiveScheduler::Start();
189 return iTestStepResult;
194 Test step constructor. It initialises its own name and the input filename
196 RTestStepAviPlayCtrlPlayBalance::RTestStepAviPlayCtrlPlayBalance(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
197 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
202 Do the test step.This tests setting the PlayBalance on AviPlayController in Stopped, Primed and Playing
203 states and checks if the PlayBalance set is same as the PlayBalance got.
205 TVerdict RTestStepAviPlayCtrlPlayBalance::DoTestStepL( void )
208 INFO_PRINTF1(_L("this checks if audio is enabled on the sample.avi file"));
209 RMMFVideoPlayControllerCustomCommands thePlayCommander(iController);
210 TBool enabled = EFalse;
211 thePlayCommander.GetAudioEnabled(enabled);
214 INFO_PRINTF2(_L("GetAudioEnabled() is failed with %d "), errorCode);
215 return EInconclusive;
217 INFO_PRINTF1(_L("this step tests SetBalance/GetBalance() APIs of AviPlayController "));
218 RMMFAudioPlayDeviceCustomCommands theAudioDevice( iController );
219 TInt theBalance = (30 * (KMMFBalanceMaxRight-KMMFBalanceMaxLeft))/100 + KMMFBalanceMaxLeft;
220 errorCode = theAudioDevice.SetBalance(theBalance);
223 INFO_PRINTF2(_L("SetBalance() during Stopped State is failed with %d "), errorCode);
226 TInt theNewBalance (0);
227 errorCode =theAudioDevice.GetBalance(theNewBalance);
230 INFO_PRINTF2(_L("GetBalance() during Stopped State is failed with %d "), errorCode);
233 if( theNewBalance != theBalance )
235 INFO_PRINTF1(_L("Set and Get Balances are different during Stopped State"));
238 errorCode = iController.Prime();
241 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
242 return EInconclusive;
244 errorCode = theAudioDevice.SetBalance( theBalance );
247 INFO_PRINTF2(_L("SetBalance() during Primed State is failed with %d "), errorCode);
250 errorCode =theAudioDevice.GetBalance( theNewBalance );
253 INFO_PRINTF2(_L("GetBalance() during Primed State is failed with %d "), errorCode);
256 if( theNewBalance != theBalance )
258 INFO_PRINTF1(_L("Set and Get Balances are different during Primed State"));
261 errorCode = iController.Play();
264 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
265 return EInconclusive;
267 errorCode =theAudioDevice.SetBalance(theBalance);
270 INFO_PRINTF2(_L("SetBalance() during Playing State is failed with %d "), errorCode);
274 errorCode =theAudioDevice.GetBalance(theNewBalance);
277 INFO_PRINTF2(_L("GetBalance() during Playing State is failed with %d "), errorCode);
281 if(theNewBalance != theBalance)
283 //stop the controller
284 INFO_PRINTF1(_L("Set and Get Balances are different during Playing State"));
288 //get the play completion event
289 CActiveScheduler::Start();
290 return iTestStepResult;
294 Test step constructor. It initialises its own name and the input filename
296 RTestStepAviPlayCtrlDuration::RTestStepAviPlayCtrlDuration(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
297 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
303 Do the test step.This tests checks for the duration of the file in Stopped, Primed and Playing states.
305 TVerdict RTestStepAviPlayCtrlDuration::DoTestStepL(void)
307 const TTimeIntervalMicroSeconds KExpectedDuration = 6300000;
308 INFO_PRINTF1(_L("this step checks for duration of the file"));
309 TTimeIntervalMicroSeconds expectedDuration(KExpectedDuration);
310 TTimeIntervalMicroSeconds currentDuration;
311 TInt errorCode = iController.GetDuration(currentDuration);
314 INFO_PRINTF2(_L("DurationL() is failed with %d "), errorCode);
317 else if(currentDuration != expectedDuration)
319 INFO_PRINTF2(_L("GetDuration() returned the wrong duration %d "), currentDuration. Int64());
322 errorCode = iController.Prime();
325 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
326 return EInconclusive;
328 errorCode = iController.GetDuration(currentDuration);
331 INFO_PRINTF2(_L("DurationL() is failed with %d "), errorCode);
334 else if(currentDuration != expectedDuration)
336 INFO_PRINTF2(_L("GetDuration() returned the wrong duration %d "), currentDuration. Int64());
339 errorCode = iController.Play();
342 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
343 return EInconclusive;
345 errorCode = iController.GetDuration(currentDuration);
348 INFO_PRINTF2(_L("DurationL() is failed with %d "), errorCode);
352 else if(currentDuration != expectedDuration)
354 INFO_PRINTF2(_L("GetDuration() returned the wrong duration %d "), currentDuration. Int64());
362 Test step constructor. It initialises its own name and the input filename
364 RTestStepAviPlayCtrlPause::RTestStepAviPlayCtrlPause(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
365 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
371 Do the test step. This tests the Pause functionality of the AviPlayController in Stopped, Primed and Playing
372 states and checks if it returns KErrNot Supported.
374 TVerdict RTestStepAviPlayCtrlPause::DoTestStepL(void)
376 INFO_PRINTF1(_L("this step tests Pause() API of AviPlayController "));
377 TInt errorCode = iController.Pause();
378 if(errorCode != KErrNotSupported)
380 INFO_PRINTF2(_L("Pause() during Stopped State is failed to return KErrNotSupported but returned %d "), errorCode);
383 errorCode = iController.Prime();
386 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
387 return EInconclusive;
389 errorCode = iController.Pause();
390 if(errorCode != KErrNotSupported)
392 INFO_PRINTF2(_L("Pause() during Primed State is failed to return KErrNotSupported but returned %d "), errorCode);
395 errorCode = iController.Play();
398 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
399 return EInconclusive;
401 errorCode = iController.Pause();
402 if(errorCode != KErrNotSupported)
404 INFO_PRINTF2(_L("Pause() during Playing State is failed with %d "), errorCode);
407 errorCode = iController.Play();
408 if(errorCode != KErrNotReady)
410 INFO_PRINTF2(_L("Play() after Pause() is failed with %d "), errorCode);
413 //get the play completion event
414 CActiveScheduler::Start();
415 return iTestStepResult;
419 Test step constructor. It initialises its own name and the input filename
421 RTestStepAviPlayCtrlStop::RTestStepAviPlayCtrlStop(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
422 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
428 Do the test step. This tests the Stop functionality of the AviPlayController in Stopped, Primed and Playing
429 states It expects KErrNotReady error if Stop is called during Stopped state.
431 TVerdict RTestStepAviPlayCtrlStop::DoTestStepL(void)
433 INFO_PRINTF1(_L("this step tests Stop() API of AviPlayController "));
434 TInt errorCode = iController.Stop();
437 INFO_PRINTF2(_L("Stop() during Stopped State is failed with %d "), errorCode);
440 errorCode = iController.Prime();
443 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
444 return EInconclusive;
446 errorCode = iController.Stop();
449 INFO_PRINTF2(_L("Stop() during Primed State is failed with %d "), errorCode);
452 errorCode = iController.Prime();
455 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
456 return EInconclusive;
458 errorCode = iController.Play();
461 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
462 return EInconclusive;
464 User::After(2000000);
465 errorCode = iController.Stop();
468 INFO_PRINTF2(_L("Stop() during Playing State is failed with %d "), errorCode);
471 errorCode = iController.Prime();
474 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
475 return EInconclusive;
477 errorCode = iController.Play();
480 INFO_PRINTF2(_L("Play() after Stop() is failed with %d "), errorCode);
482 return EInconclusive;
484 //get the play completion event
485 CActiveScheduler::Start();
486 return iTestStepResult;
491 Test step constructor. It initialises its own name and the input filename
493 RTestStepAviPlayCtrlSetGetCropRegion::RTestStepAviPlayCtrlSetGetCropRegion(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
494 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
500 Do the test step.This test tries to set and get the crop region for the file.
502 TVerdict RTestStepAviPlayCtrlSetGetCropRegion::DoTestStepL(void)
504 INFO_PRINTF1(_L("this step tests GetCropRegion() APIs of AviPlayController"));
505 TRect cropRegion(1,3,5,7);
506 TRect newCropRegion(1,3,5,7);
507 RMMFVideoPlayControllerCustomCommands thePlayCommander(iController);
508 TInt errorCode =thePlayCommander.SetCropRegion(cropRegion);
509 if(errorCode != KErrNotSupported)
511 INFO_PRINTF2(_L("SetCropRegion() during Stopped State is failed with %d "), errorCode);
514 errorCode =thePlayCommander.GetCropRegion(newCropRegion);
515 if(errorCode != KErrNotSupported)
517 INFO_PRINTF2(_L("GetCropRegion() during Stopped State is failed with %d "), errorCode);
520 errorCode = iController.Prime();
523 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
524 return EInconclusive;
526 errorCode =thePlayCommander.SetCropRegion(cropRegion);
527 if(errorCode != KErrNotSupported)
529 INFO_PRINTF2(_L("SetCropRegion() during primed State is failed with %d "), errorCode);
532 errorCode =thePlayCommander.GetCropRegion(newCropRegion);
533 if(errorCode != KErrNotSupported)
535 INFO_PRINTF2(_L("GetCropRegion() during primed State is failed with %d "), errorCode);
538 errorCode = iController.Play();
541 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
542 return EInconclusive;
544 errorCode =thePlayCommander.SetCropRegion(cropRegion);
545 if(errorCode != KErrNotSupported)
547 INFO_PRINTF2(_L("SetCropRegion() during play State is failed with %d "), errorCode);
551 errorCode =thePlayCommander.GetCropRegion(newCropRegion);
552 if(errorCode != KErrNotSupported)
554 INFO_PRINTF2(_L("GetCropRegion() during play State is failed with %d "), errorCode);
558 CActiveScheduler::Start();
563 Test step constructor. It initialises its own name and the input filename
565 RTestStepAviPlayCtrlSetGetFrameRate::RTestStepAviPlayCtrlSetGetFrameRate(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
566 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
572 Do the test step.This test tries to set and get the framerate for the file
574 TVerdict RTestStepAviPlayCtrlSetGetFrameRate::DoTestStepL(void)
576 INFO_PRINTF1(_L("this step tests SetFrameRate/GetFrameRate() APIs of AviPlayController"));
577 TInt KFrameRate = 10;
578 TReal32 frameRate(KFrameRate);
579 TReal32 expectedFrameRate(KFrameRate) ;
580 RMMFVideoControllerCustomCommands theVideoCommander(iController);
581 TInt errorCode =theVideoCommander.SetFrameRate(frameRate);
582 if(errorCode != KErrNotSupported)
584 INFO_PRINTF2(_L("SetFrameRate() during Stopped State is failed with %d "), errorCode);
587 errorCode =theVideoCommander.GetFrameRate(expectedFrameRate);
590 INFO_PRINTF2(_L("GetFrameRate() during Stopped State is failed with %d "), errorCode);
593 if(expectedFrameRate != KFrameRate)
595 INFO_PRINTF1(_L("Set and Get Framerates are different during Stopped State"));
598 errorCode = iController.Prime();
601 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
602 return EInconclusive;
604 errorCode =theVideoCommander.SetFrameRate(frameRate);
605 if(errorCode != KErrNotSupported)
607 INFO_PRINTF2(_L("SetFrameRate() during Primed State is failed with %d "), errorCode);
610 errorCode =theVideoCommander.GetFrameRate(expectedFrameRate);
613 INFO_PRINTF2(_L("GetFrameRate() during Primed State is failed with %d "), errorCode);
616 if(expectedFrameRate != KFrameRate)
618 INFO_PRINTF1(_L("Set and Get Framerates are different during Primed State"));
621 errorCode = iController.Play();
624 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
626 return EInconclusive;
628 //try getting framerate inPlaying State
629 errorCode =theVideoCommander.SetFrameRate(frameRate);
630 if(errorCode != KErrNotSupported)
632 INFO_PRINTF2(_L("SetFrameRate() during Playing State is failed with %d "), errorCode);
636 errorCode =theVideoCommander.GetFrameRate(expectedFrameRate);
639 INFO_PRINTF2(_L("GetFrameRate() during Playing State is failed with %d "), errorCode);
643 if(expectedFrameRate != KFrameRate)
645 INFO_PRINTF1(_L("Set and Get Framerates are different during Playing State"));
648 CActiveScheduler::Start();
654 Test step constructor. It initialises its own name and the input filename
656 RTestStepAviPlayCtrlGetFrameSize::RTestStepAviPlayCtrlGetFrameSize(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
657 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
663 Do the test step.This test tries to get the framesize from the file.
665 TVerdict RTestStepAviPlayCtrlGetFrameSize::DoTestStepL(void)
667 INFO_PRINTF1(_L("this step tests GetFrameSize() APIs of AviPlayController"));
668 TSize frameSize(0,0);
669 TSize expectedFrameSize(176,144);
670 RMMFVideoControllerCustomCommands theVideoCommander(iController);
671 TInt errorCode =theVideoCommander.GetVideoFrameSize(frameSize);
674 INFO_PRINTF2(_L("GetFrameSize() during Stopped State is failed with %d "), errorCode);
677 if(frameSize != expectedFrameSize)
679 INFO_PRINTF1(_L("Frame sizes are different during Stopped states"));
682 errorCode = iController.Prime();
685 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
686 return EInconclusive;
688 errorCode =theVideoCommander.GetVideoFrameSize(frameSize);
691 INFO_PRINTF2(_L("GetFrameSize() during primed State is failed with %d "), errorCode);
694 if( frameSize != expectedFrameSize )
696 INFO_PRINTF1(_L("Frame sizes are different during Primed state"));
699 errorCode = iController.Play();
702 INFO_PRINTF2(_L("Play is failed with %d "), errorCode);
704 return EInconclusive;
706 errorCode =theVideoCommander.GetVideoFrameSize(frameSize);
709 INFO_PRINTF2(_L("GetFrameSize() during play State is failed with %d "), errorCode);
713 if( frameSize != expectedFrameSize )
715 INFO_PRINTF1(_L("Frame sizes are different during play state"));
719 //get the play completion event
720 CActiveScheduler::Start();
726 Test step constructor. It initialises its own name and the input filename
728 RTestStepAviPlayCtrlGetAudioDataType::RTestStepAviPlayCtrlGetAudioDataType(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
729 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
735 Do the test step.This test tries to get the audio data type from the avi file.
737 TVerdict RTestStepAviPlayCtrlGetAudioDataType::DoTestStepL()
739 INFO_PRINTF1(_L("this step tests GetAudioType() and GetAudioBitRate() APIs of AviPlayController"));
741 TFourCC expectedAudioCodec(KMMFFourCCCodePCM16);
743 TInt bitRate = 705600;
745 RMMFVideoPlayControllerCustomCommands thePlayCommander(iController);
746 TBool enabled(EFalse);
747 thePlayCommander.GetAudioEnabled(enabled);
750 INFO_PRINTF2(_L("GetAudioEnabled() is failed with %d "), errorCode);
751 return EInconclusive;
753 RMMFVideoControllerCustomCommands theCommander(iController);
754 errorCode =theCommander.GetAudioCodec(audioCodec);
757 INFO_PRINTF2(_L("GetAudioCodec() during Stopped State is failed with %d "), errorCode);
760 if( audioCodec != expectedAudioCodec )
762 INFO_PRINTF1(_L("Wrong audio codec was returned"));
765 errorCode = theCommander.GetAudioBitRate(newBitRate);
768 INFO_PRINTF2(_L("GetAudioBitRate() during Stopped State is failed with %d "), errorCode);
771 if(newBitRate != bitRate )
773 INFO_PRINTF1(_L("Wrong audio bitrate was returned"));
776 errorCode = iController.Prime();
779 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
780 return EInconclusive;
782 //Check for audio codec
783 errorCode =theCommander.GetAudioCodec(audioCodec);
786 INFO_PRINTF2(_L("GetAudioCodec() during primed State is failed with %d "), errorCode);
789 if( audioCodec != expectedAudioCodec )
791 INFO_PRINTF1(_L("Wrong audio codec was returned"));
794 errorCode = theCommander.GetAudioBitRate(newBitRate);
797 INFO_PRINTF2(_L("GetAudioBitRate() during primed State is failed with %d "), errorCode);
800 if(newBitRate != bitRate )
802 INFO_PRINTF1(_L("Wrong audio bitrate was returned"));
805 errorCode = iController.Play();
806 //Check for audio codec
807 errorCode =theCommander.GetAudioCodec(audioCodec);
810 INFO_PRINTF2(_L("GetAudioCodec() during play State is failed with %d "), errorCode);
814 if( audioCodec != expectedAudioCodec )
816 INFO_PRINTF1(_L("Wrong audio codec was returned"));
820 errorCode = theCommander.GetAudioBitRate(newBitRate);
823 INFO_PRINTF2(_L("GetAudioBitRate() during play State is failed with %d "), errorCode);
827 if(newBitRate != bitRate )
829 INFO_PRINTF1(_L("Wrong audio bitrate was returned"));
833 CActiveScheduler::Start();
839 Test step constructor. It initialises its own name and the input filename
841 RTestStepAviPlayCtrlGetVideoDataType::RTestStepAviPlayCtrlGetVideoDataType(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
842 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
847 Do the test step.This test tries to get the video mime type
849 TVerdict RTestStepAviPlayCtrlGetVideoDataType::DoTestStepL(void)
851 const TInt KBufferSize = 256;
852 INFO_PRINTF1(_L("this step tests GetVideoMimeType() APIs of AviPlayController"));
853 HBufC8* iMimeType = HBufC8::NewL(KBufferSize);
854 TPtr8 des = iMimeType->Des();
857 TUint8* p = (TUint8*)xv;
859 RMMFVideoControllerCustomCommands theCommander(iController);
860 errorCode =theCommander.GetVideoMimeType(des);
863 INFO_PRINTF2(_L("GetVideoMimeType() during Stopped State is failed with %d "), errorCode);
866 if (des.Compare(temp))
868 INFO_PRINTF1(_L("Wrong video mime type returned"));
873 INFO_PRINTF1(_L("Correct video mime type returned"));
875 errorCode = iController.Prime();
878 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
879 return EInconclusive;
881 errorCode =theCommander.GetVideoMimeType(des);
884 INFO_PRINTF2(_L("GetVideoMimeType() during primed State is failed with %d "), errorCode);
887 if (des.Compare(temp))
889 INFO_PRINTF1(_L("Wrong video mime type returned"));
894 INFO_PRINTF1(_L("Correct video mime type returned"));
897 errorCode = iController.Play();
900 INFO_PRINTF2(_L("Play is failed with %d "), errorCode);
901 return EInconclusive;
903 errorCode =theCommander.GetVideoMimeType(des);
906 INFO_PRINTF2(_L("GetVideoMimeType() during play State is failed with %d "), errorCode);
909 if (des.Compare(temp))
911 INFO_PRINTF1(_L("Wrong video mime type returned"));
916 INFO_PRINTF1(_L("Correct video mime type returned"));
918 CActiveScheduler::Start();
924 Test step constructor. It initialises its own name and the input filename
926 RTestStepAviPlayCtrlMetaData::RTestStepAviPlayCtrlMetaData(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
927 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
933 Do the test step.This test tries to fetch the metadata from the avi file.
935 TVerdict RTestStepAviPlayCtrlMetaData::DoTestStepL(void)
937 INFO_PRINTF1(_L("this step tests GetNumberOfMetaDataEntries/GetMetaDataEntryL() APIs of AviPlayController "));
939 TInt errorCode = iController.GetNumberOfMetaDataEntries( numEntries );
940 CMMFMetaDataEntry* metaEntry = NULL;
941 if(errorCode != KErrNotSupported)
943 INFO_PRINTF2(_L("GetNumberOfMetaDataEntries() is failed with %d "), errorCode);
948 INFO_PRINTF1(_L("File does not have meta entries "));
952 for(TInt counter = 0; counter < numEntries; ++counter)
954 TRAP(errorCode, metaEntry = iController.GetMetaDataEntryL(counter));
957 INFO_PRINTF2(_L("GetMetaDataEntryL is failed with %d "), errorCode);
960 INFO_PRINTF3(_L("%S %S"), &metaEntry->Name(), &metaEntry->Value());
967 Test step constructor. It initialises its own name and the input filename
969 RTestStepAviPlayCtrlSetGetRotation::RTestStepAviPlayCtrlSetGetRotation(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
970 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
976 Do the test step.This test tries to set and get the rotation
978 TVerdict RTestStepAviPlayCtrlSetGetRotation::DoTestStepL(void)
980 INFO_PRINTF1(_L("this step tests SetRotation/GetRotation() APIs of AviPlayController"));
981 TVideoRotation aRotation;
982 RMMFVideoPlayControllerCustomCommands theVideoPlayCommander(iController);
983 TInt errorCode = theVideoPlayCommander.SetRotation(EVideoRotationClockwise90);
984 if(errorCode != KErrNotSupported)
986 INFO_PRINTF2(_L("SetRotation() during Stopped State is failed with %d "), errorCode);
989 errorCode =theVideoPlayCommander.GetRotation(aRotation);
990 if(errorCode != KErrNotSupported)
992 INFO_PRINTF2(_L("GetRotation() during Stopped State is failed with %d "), errorCode);
995 errorCode = iController.Prime();
998 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
999 return EInconclusive;
1001 errorCode =theVideoPlayCommander.SetRotation(EVideoRotationClockwise90);
1002 if(errorCode != KErrNotSupported)
1004 INFO_PRINTF2(_L("SetRotation() during Primed State is failed with %d "), errorCode);
1007 errorCode =theVideoPlayCommander.GetRotation(aRotation);
1008 if(errorCode != KErrNotSupported)
1010 INFO_PRINTF2(_L("GetRotation() during Primed State is failed with %d "), errorCode);
1013 errorCode = iController.Play();
1016 INFO_PRINTF2(_L("Play is failed with %d "), errorCode);
1017 return EInconclusive;
1019 errorCode =theVideoPlayCommander.SetRotation(EVideoRotationClockwise90);
1020 if(errorCode != KErrNotSupported)
1022 INFO_PRINTF2(_L("SetRotation() during Play State is failed with %d "), errorCode);
1025 errorCode =theVideoPlayCommander.GetRotation(aRotation);
1026 if(errorCode != KErrNotSupported)
1028 INFO_PRINTF2(_L("GetRotation() during Play State is failed with %d "), errorCode);
1032 CActiveScheduler::Start();
1037 Test step constructor. It initialises its own name and the input filename
1039 RTestStepAviPlayCtrlSetGetScaling::RTestStepAviPlayCtrlSetGetScaling(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
1040 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
1046 * Do the test step.This test tries to do the scaling and expect KErrNotsupported
1048 TVerdict RTestStepAviPlayCtrlSetGetScaling::DoTestStepL(void)
1050 INFO_PRINTF1(_L("this step tests SetScaling/GetScaling() APIs of AviPlayController"));
1051 TReal32 aWidthPercentage = .75;
1052 TReal32 aHeightPercentage = .3;
1053 TBool aAntiAliasFiltering = EFalse;
1055 RMMFVideoPlayControllerCustomCommands theVideoPlayCommander(iController);
1056 TInt errorCode = theVideoPlayCommander.SetScaleFactor(aWidthPercentage,aHeightPercentage,aAntiAliasFiltering);
1057 if(errorCode != KErrNotSupported)
1059 INFO_PRINTF2(_L("SetScaleFactor() during Stopped State is failed with %d "), errorCode);
1062 errorCode =theVideoPlayCommander.GetScaleFactor(aWidthPercentage,aHeightPercentage,aAntiAliasFiltering);
1063 if(errorCode != KErrNotSupported)
1065 INFO_PRINTF2(_L("GetScaleFactor() during Stopped State is failed with %d "), errorCode);
1068 errorCode = iController.Prime();
1071 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
1072 return EInconclusive;
1074 errorCode = theVideoPlayCommander.SetScaleFactor(aWidthPercentage,aHeightPercentage,aAntiAliasFiltering);
1075 if(errorCode != KErrNotSupported)
1077 INFO_PRINTF2(_L("SetScaleFactor() during primed State is failed with %d "), errorCode);
1080 errorCode =theVideoPlayCommander.GetScaleFactor(aWidthPercentage,aHeightPercentage,aAntiAliasFiltering);
1081 if(errorCode != KErrNotSupported)
1083 INFO_PRINTF2(_L("GetScaleFactor() during primed State is failed with %d "), errorCode);
1086 errorCode = iController.Play();
1089 INFO_PRINTF2(_L("Play is failed with %d "), errorCode);
1090 return EInconclusive;
1092 errorCode = theVideoPlayCommander.SetScaleFactor(aWidthPercentage,aHeightPercentage,aAntiAliasFiltering);
1093 if(errorCode != KErrNotSupported)
1095 INFO_PRINTF2(_L("SetScaleFactor() during play State is failed with %d "), errorCode);
1098 errorCode =theVideoPlayCommander.GetScaleFactor(aWidthPercentage,aHeightPercentage,aAntiAliasFiltering);
1099 if(errorCode != KErrNotSupported)
1101 INFO_PRINTF2(_L("GetScaleFactor() during play State is failed with %d "), errorCode);
1105 CActiveScheduler::Start();
1110 Test step constructor. It initialises its own name and the input filename
1112 RTestStepAviPlayCtrlSetPosition::RTestStepAviPlayCtrlSetPosition(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
1113 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
1119 Do the test step.This test tries to set the position in the file and expect KErrNotSupported
1121 TVerdict RTestStepAviPlayCtrlSetPosition::DoTestStepL(void)
1123 INFO_PRINTF1(_L("this step tests SetPosition() APIs of AviPlayController"));
1124 TTimeIntervalMicroSeconds aPosition;
1125 TInt errorCode = KErrNone;
1126 errorCode = iController.SetPosition(aPosition);
1127 if(errorCode != KErrNotSupported)
1129 INFO_PRINTF2(_L("SetPosition() during Stopped State is failed with %d "), errorCode);
1132 errorCode = iController.Prime();
1135 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
1136 return EInconclusive;
1138 errorCode = iController.SetPosition(aPosition);
1139 if(errorCode != KErrNotSupported)
1141 INFO_PRINTF2(_L("SetPosition() during Primed State is failed with %d "), errorCode);
1144 errorCode = iController.Play();
1147 INFO_PRINTF2(_L("Play is failed with %d "), errorCode);
1148 return EInconclusive;
1150 errorCode = iController.SetPosition(aPosition);
1151 if(errorCode != KErrNotSupported)
1153 INFO_PRINTF2(_L("SetPosition() during Playing State is failed with %d "), errorCode);
1157 CActiveScheduler::Start();
1163 Test step constructor. It initialises its own name and the input filename
1165 RTestStepAviPlayCtrlGetVideoBitrate::RTestStepAviPlayCtrlGetVideoBitrate(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
1166 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
1172 Do the test step.This test tries to get the bitrate from the file
1174 TVerdict RTestStepAviPlayCtrlGetVideoBitrate::DoTestStepL(void)
1176 INFO_PRINTF1(_L("this step tests GetVideoBitrate() APIs of AviPlayController"));
1178 RMMFVideoControllerCustomCommands theVideoCommander(iController);
1179 TInt errorCode =theVideoCommander.GetVideoBitRate(aBitRate);
1180 if(errorCode != KErrNotSupported)
1182 INFO_PRINTF2(_L("GetVideoBitRate() during Stopped State is failed with %d "), errorCode);
1187 INFO_PRINTF2(_L("GetVideoBitRate() during Stopped State returned KErrNotSupported %d "), errorCode);
1189 errorCode = iController.Prime();
1192 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
1193 return EInconclusive;
1195 errorCode =theVideoCommander.GetVideoBitRate(aBitRate);
1196 if(errorCode != KErrNotSupported)
1198 INFO_PRINTF2(_L("GetVideoBitRate() during Primed State is failed with %d "), errorCode);
1203 INFO_PRINTF2(_L("GetVideoBitRate() during Primed State returned KErrNotSupported %d "), errorCode);
1205 errorCode = iController.Play();
1208 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
1210 return EInconclusive;
1212 errorCode =theVideoCommander.GetVideoBitRate(aBitRate);
1213 if(errorCode != KErrNotSupported)
1215 INFO_PRINTF2(_L("GetVideoBitRate() during Playing State is failed with %d "), errorCode);
1221 INFO_PRINTF2(_L("GetVideoBitRate() during Play State returned KErrNotSupported %d "), errorCode);
1223 CActiveScheduler::Start();
1228 Test step constructor. It initialises its own name and the input filename
1230 RTestStepAviPlayCtrlGetAudioBitrate::RTestStepAviPlayCtrlGetAudioBitrate(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
1231 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
1237 Do the test step.This test tries to fetch the audio bit rate.
1239 TVerdict RTestStepAviPlayCtrlGetAudioBitrate::DoTestStepL(void)
1241 INFO_PRINTF1(_L("this step tests GetAudioBitrate() APIs of AviPlayController"));
1243 RMMFVideoControllerCustomCommands theVideoCommander(iController);
1244 TInt errorCode =theVideoCommander.GetAudioBitRate(audioBitRate);
1245 if(errorCode != KErrNotSupported)
1247 INFO_PRINTF2(_L("GetAudioBitRate() during Stopped State is failed with %d "), errorCode);
1252 INFO_PRINTF2(_L("GetAudioBitRate() during Stopped State returned KErrNotSupported %d "), errorCode);
1254 errorCode = iController.Prime();
1257 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
1258 return EInconclusive;
1262 INFO_PRINTF2(_L("GetAudioBitRate() during Primed State returned KErrNotSupported %d "), errorCode);
1264 errorCode =theVideoCommander.GetAudioBitRate(audioBitRate);
1265 if(errorCode != KErrNotSupported)
1267 INFO_PRINTF2(_L("GetAudioBitRate() during Primed State is failed with %d "), errorCode);
1270 errorCode = iController.Play();
1273 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
1275 return EInconclusive;
1277 //try getting framerate inPlaying State
1278 errorCode =theVideoCommander.GetAudioBitRate(audioBitRate);
1279 if(errorCode != KErrNotSupported)
1281 INFO_PRINTF2(_L("GetAudioBitRate() during Playing State is failed with %d "), errorCode);
1287 INFO_PRINTF2(_L("GetAudioBitRate() during Playing State returned KErrNotSupported %d "), errorCode);
1289 CActiveScheduler::Start();
1294 Test step constructor. It initialises its own name and the input filename
1296 RTestStepAviCtrlDirectScreenAccess::RTestStepAviCtrlDirectScreenAccess(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
1297 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
1303 This test code tries to check the direct screen access property.
1305 TVerdict RTestStepAviCtrlDirectScreenAccess::DoTestStepL(void)
1307 INFO_PRINTF1(_L("this step tests DirectScreenAccessL of AviPlayController when audio not enabled"));
1308 RMMFVideoPlayControllerCustomCommands theVideoCommander(iController);
1309 TMMFDSAEvent dsaEvent1 = EAbortDSA;
1310 TMMFDSAEvent dsaEvent2 = EResumeDSA;
1311 TInt errorCode = iController.Prime();
1314 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
1315 return EInconclusive;
1317 errorCode = theVideoCommander.DirectScreenAccessEvent(dsaEvent2);
1320 INFO_PRINTF2(_L("DirectScreenAccessEvent() is failed during primed state %d "), errorCode);
1321 return EInconclusive;
1323 errorCode = iController.Play();
1326 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
1327 return EInconclusive;
1329 errorCode = theVideoCommander.DirectScreenAccessEvent(dsaEvent1);
1332 INFO_PRINTF2(_L("DirectScreenAccessEvent() is failed during primed state %d "), errorCode);
1333 return EInconclusive;
1335 CActiveScheduler::Start();
1336 return iTestStepResult;
1340 Test step constructor. It initialises its own name and the input filename
1342 RTestStepAviCtrlSetPlayWindow::RTestStepAviCtrlSetPlayWindow(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
1343 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
1348 This test code tries to set the set playwindow and expects KErrNotSupported
1350 TVerdict RTestStepAviCtrlSetPlayWindow::DoTestStepL(void)
1352 INFO_PRINTF1(_L("this step plays an avi file "));
1353 TInt errorCode = iController.Prime();
1356 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
1359 RMMFVideoPlayControllerCustomCommands theVideoCommander(iController);
1360 TTimeIntervalMicroSeconds theDuration;
1361 errorCode = iController.GetDuration(theDuration);
1364 INFO_PRINTF2(_L("DurationL() is failed with %d "), errorCode);
1365 return EInconclusive;
1367 TInt64 duration = theDuration. Int64();
1368 TTimeIntervalMicroSeconds thePlayStart(duration/2);
1369 TTimeIntervalMicroSeconds thePlayEnd(duration);
1370 errorCode = theVideoCommander.Play(thePlayStart, thePlayEnd);
1371 if(errorCode != KErrNotSupported)
1373 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
1376 errorCode = iController.Play();
1379 INFO_PRINTF2(_L("Play() after SetPlayWindow() is failed with %d "), errorCode);
1380 return EInconclusive;
1382 CActiveScheduler::Start();
1383 return iTestStepResult;
1388 Test step constructor. It initialises its own name and the input filename
1390 RTestStepAviCtrlPlayInvalid::RTestStepAviCtrlPlayInvalid(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
1391 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
1396 TVerdict RTestStepAviCtrlPlayInvalid::DoTestStepPreambleL(void)
1402 Do the test step(Negative Test).This test tries to open an invalid file. Expects KErrCurrupt from AviPlayController
1404 TVerdict RTestStepAviCtrlPlayInvalid::DoTestStepL(void)
1406 const TUid KAviPlayControllerUid = {0x102737A5};
1407 INFO_PRINTF1(_L("This test tries to open an invalid file using AviPlayController"));
1408 iScheduler = new(ELeave)CActiveScheduler;
1409 CleanupStack::PushL(iScheduler );
1410 CActiveScheduler::Install(iScheduler );
1411 CleanupStack::Pop();
1412 iPriority.iPriority = 11; // set the priority to some default value
1413 iPriority.iPref = EMdaPriorityPreferenceQuality;
1414 iControllerEventMonitor = CMMFControllerEventMonitor::NewL(*this, iController);
1415 TInt errorCode = iController.Open(KAviPlayControllerUid, iPriority);
1418 INFO_PRINTF2(_L("Failed to load the controller %d "), errorCode);
1419 return EInconclusive;
1421 iControllerEventMonitor->Start();
1422 SetupReadFileConfigL();
1423 errorCode = iController.AddDataSource(KUidMmfFileSource, ReadFileConfig());
1424 if(errorCode != KErrCorrupt)
1426 INFO_PRINTF2(_L("AddDataSource failed with %d "), errorCode);
1431 INFO_PRINTF2(_L("AddDataSource() returned KErrCorrupt with invalid .avi file %d "), errorCode);
1437 Test step constructor. It initialises its own name and the input filename
1439 RTestStepAviCtrlNotAudioEnabled::RTestStepAviCtrlNotAudioEnabled(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
1440 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
1446 This test step tries to get the volume and balance from a file where audio is not enabled and expect KErrNotsupported
1448 TVerdict RTestStepAviCtrlNotAudioEnabled::DoTestStepL(void)
1450 TInt theNewBalance (0);
1451 TTimeIntervalMicroSeconds ramp(100);
1452 INFO_PRINTF1(_L("this step tests SetVolume/GetVolume() APIs of AviPlayController when audio not enabled"));
1453 RMMFAudioPlayDeviceCustomCommands theAudioDevice(iController);
1455 TInt errorCode = theAudioDevice.GetMaxVolume(maxVolume);
1456 if(errorCode != KErrNotSupported)
1458 INFO_PRINTF2(_L("GetMaxVolume() is failed with %d "), errorCode);
1459 return EInconclusive;
1461 TInt theVolume = maxVolume /2;
1462 //try setting volume in Stopped State
1463 errorCode =theAudioDevice.SetVolume(theVolume);
1464 if(errorCode != KErrNotSupported)
1466 INFO_PRINTF2(_L("SetVolume() during Stopped State is failed with %d "), errorCode);
1469 TInt theNewVolume (0);
1470 errorCode =theAudioDevice.GetVolume(theNewVolume);
1471 if(errorCode != KErrNotSupported)
1473 INFO_PRINTF2(_L("GetVolume() during Stopped State is failed with %d "), errorCode);
1476 TInt theBalance = (30 * (KMMFBalanceMaxRight-KMMFBalanceMaxLeft))/100 + KMMFBalanceMaxLeft;
1477 errorCode = theAudioDevice.SetBalance(theBalance);
1478 if(errorCode != KErrNotSupported)
1480 INFO_PRINTF2(_L("SetBalance() during Stopped State is failed with %d "), errorCode);
1483 errorCode =theAudioDevice.GetBalance(theNewBalance);
1484 if(errorCode != KErrNotSupported)
1486 INFO_PRINTF2(_L("GetBalance() during Stopped State is failed with %d "), errorCode);
1489 errorCode =theAudioDevice.SetVolumeRamp(ramp);
1490 if(errorCode != KErrNotSupported)
1492 INFO_PRINTF2(_L("SetVolumeRamp() during Stopped State is failed with %d "), errorCode);
1495 errorCode = iController.Prime();
1498 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
1499 return EInconclusive;
1501 //try setting volume in Primed State
1502 errorCode =theAudioDevice.SetVolume(theVolume);
1503 if(errorCode != KErrNotSupported)
1505 INFO_PRINTF2(_L("SetVolume() during Primed State is failed with %d "), errorCode);
1508 errorCode =theAudioDevice.GetVolume(theNewVolume);
1509 if(errorCode != KErrNotSupported)
1511 INFO_PRINTF2(_L("GetVolume() during Primed State is failed with %d "), errorCode);
1514 errorCode =theAudioDevice.SetVolumeRamp(ramp);
1515 if(errorCode != KErrNotSupported)
1517 INFO_PRINTF2(_L("SetVolumeRamp() during primed State is failed with %d "), errorCode);
1520 theBalance = (30 * (KMMFBalanceMaxRight-KMMFBalanceMaxLeft))/100 + KMMFBalanceMaxLeft;
1521 errorCode = theAudioDevice.SetBalance(theBalance);
1522 if(errorCode != KErrNotSupported)
1524 INFO_PRINTF2(_L("SetBalance() during primed State is failed with %d "), errorCode);
1527 errorCode =theAudioDevice.GetBalance(theNewBalance);
1528 if(errorCode != KErrNotSupported)
1530 INFO_PRINTF2(_L("GetBalance() during primed State is failed with %d "), errorCode);
1533 errorCode = iController.Play();
1536 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
1537 return EInconclusive;
1539 //try setting volume in Playing State
1540 errorCode =theAudioDevice.SetVolume(theVolume);
1541 if(errorCode!= KErrNotSupported)
1543 INFO_PRINTF2(_L("SetVolume() during Playing State is failed with %d "), errorCode);
1547 errorCode =theAudioDevice.GetVolume(theNewVolume);
1548 if(errorCode!= KErrNotSupported)
1550 INFO_PRINTF2(_L("GetVolume() during Playing State is failed with %d "), errorCode);
1554 errorCode =theAudioDevice.SetVolumeRamp(ramp);
1555 if(errorCode != KErrNotSupported)
1557 INFO_PRINTF2(_L("SetVolumeRamp() during play State is failed with %d "), errorCode);
1560 theBalance = (30 * (KMMFBalanceMaxRight-KMMFBalanceMaxLeft))/100 + KMMFBalanceMaxLeft;
1561 errorCode = theAudioDevice.SetBalance(theBalance);
1562 if(errorCode != KErrNotSupported)
1564 INFO_PRINTF2(_L("SetBalance() during playing State is failed with %d "), errorCode);
1567 errorCode =theAudioDevice.GetBalance(theNewBalance);
1568 if(errorCode != KErrNotSupported)
1570 INFO_PRINTF2(_L("GetBalance() during playing State is failed with %d "), errorCode);
1573 //get the play completion event
1574 CActiveScheduler::Start();
1575 return iTestStepResult;
1579 Test step constructor. It initialises its own name, input filename and the screen number.
1581 RTestStepAviPlayCtrlSetScrnPlay::RTestStepAviPlayCtrlSetScrnPlay(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid, TInt aScreenNumber)
1582 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
1584 iScreenNumber = aScreenNumber;
1587 //Override base class Preamble
1588 TVerdict RTestStepAviPlayCtrlSetScrnPlay::DoTestStepPreambleL(void)
1590 RTestStepAviCtrlBase::DoTestStepPreambleL();
1595 This is from MMMFControllerEventMonitorObserver.which handles all the events from AviPlayController.
1596 Base class version is overridden to avoid starting the active schedular twice.
1598 void RTestStepAviPlayCtrlSetScrnPlay::HandleEvent(const TMMFEvent& aEvent)
1601 if (aEvent.iEventType==KMMFEventCategoryPlaybackComplete)
1603 if(aEvent.iErrorCode == KErrNone)
1605 INFO_PRINTF2(_L("PlayCompletion is passed with %d "), aEvent.iErrorCode);
1606 iTestStepResult = EPass;
1610 iTestStepResult = EFail;
1611 INFO_PRINTF2(_L("PlayCompletion is failed with %d "), aEvent.iErrorCode);
1613 CActiveScheduler::Stop();
1615 else if (aEvent.iEventType == KMMFEventCategoryVideoOpenComplete)
1617 if((aEvent.iErrorCode == KErrNone) || (aEvent.iErrorCode == KErrEof))
1619 //add code here to set display window and to update display region.
1620 RMMFVideoPlayControllerCustomCommands thePlayCommander(iController);
1621 errorCode = thePlayCommander.SetDisplayWindow(iScreenRect,iClipRect);
1624 INFO_PRINTF2(_L("SetDisplayWindow failed with %d "), errorCode);
1625 iTestStepResult = EFail;
1626 CActiveScheduler::Stop();
1629 errorCode = thePlayCommander.UpdateDisplayRegion(iRegion);
1632 INFO_PRINTF2(_L("UpdateDisplayRegion failed with %d "), errorCode);
1633 iTestStepResult = EFail;
1634 CActiveScheduler::Stop();
1637 INFO_PRINTF2(_L("Open completion is passed with %d "), aEvent.iErrorCode);
1638 errorCode = thePlayCommander.Prepare();
1641 INFO_PRINTF2(_L("Prepare failed with %d "), errorCode);
1642 iTestStepResult = EFail;
1643 CActiveScheduler::Stop();
1648 iTestStepResult = EFail;
1649 INFO_PRINTF2(_L("Video open complete is failed with %d "), aEvent.iErrorCode);
1650 CActiveScheduler::Stop();
1653 else if (aEvent.iEventType == KMMFEventCategoryVideoPrepareComplete)
1655 if((aEvent.iErrorCode == KErrNone) || (aEvent.iErrorCode == KErrEof))
1657 INFO_PRINTF2(_L("Prepare completion is passed with %d "), aEvent.iErrorCode);
1658 errorCode = iController.Prime();
1661 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
1662 iTestStepResult = EFail;
1663 CActiveScheduler::Stop();
1666 errorCode = iController.Play();
1669 INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
1670 iTestStepResult = EFail;
1671 CActiveScheduler::Stop();
1676 iTestStepResult = EFail;
1677 INFO_PRINTF2(_L("PrepareComplete is failed with %d "),aEvent.iErrorCode);
1678 CActiveScheduler::Stop();
1683 INFO_PRINTF1(_L("Unexpected Event from the Controller"));
1684 iTestStepResult = EFail;
1685 CActiveScheduler::Stop();
1691 This test step plays the video on the primary or secondary screen depending the value of screen number passed during its construction.
1693 TVerdict RTestStepAviPlayCtrlSetScrnPlay::DoTestStepL(void)
1695 INFO_PRINTF2(_L("this step plays an avi file on screen %d using RMMFVideoSetInitScreenCustomCommands"), iScreenNumber);
1696 iTestStepResult = EFail;
1697 TInt errorCode = iController.Open(KAviPlayControllerUid, iPriority);
1700 INFO_PRINTF2(_L("Failed to load the controller %d "), errorCode);
1701 User::LeaveIfError( errorCode );
1703 iControllerEventMonitor->Start();
1704 if(!SetupReadFileConfigL())
1706 return EInconclusive;
1708 RMMFVideoSetInitScreenCustomCommands setInitScrn(iController);
1709 errorCode = setInitScrn.SetInitScreenNumber(iScreenNumber);
1712 INFO_PRINTF2(_L("SetInitScreenNumber failed with %d "), errorCode);
1713 User::LeaveIfError( errorCode );
1715 errorCode = iController.AddDataSink(KUidMmfAudioOutput,KNullDesC8);
1716 #ifdef __EABI__ //we dont have secondary screen support on hardware. So fail gracefully.
1717 if(errorCode == KErrNotSupported && iScreenNumber == KSecondaryScreenNo)
1719 INFO_PRINTF1(_L("No support for secondary display"));
1720 return EKnownFailure;
1725 INFO_PRINTF2(_L("AddDataSink failed with %d "), errorCode);
1726 User::LeaveIfError( errorCode );
1728 errorCode = iController.AddDataSource(KUidMmfFileSource, ReadFileConfig());
1731 INFO_PRINTF2(_L("AddDataSource failed with %d "), errorCode);
1732 User::LeaveIfError( errorCode );
1734 CActiveScheduler::Start();
1735 return iTestStepResult;
1739 Test step constructor. It initialises its own name, input filename and the screen number.
1741 RTestStepAviPlayCtrlSetInvalidScrn::RTestStepAviPlayCtrlSetInvalidScrn(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid, TInt aScreenNumber)
1742 :RTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
1744 iScreenNumber = aScreenNumber;
1747 //Override base class Preamble
1748 TVerdict RTestStepAviPlayCtrlSetInvalidScrn::DoTestStepPreambleL(void)
1750 RTestStepAviCtrlBase::DoTestStepPreambleL();
1755 This test step tries to set an invalid screen on AviPlayController and expects AddDataSink to fail with KErrNotSupported..
1757 TVerdict RTestStepAviPlayCtrlSetInvalidScrn::DoTestStepL(void)
1759 INFO_PRINTF1(_L("this step tries to set an invalid screen number on the AviPlayController"));
1760 TInt errorCode = iController.Open(KAviPlayControllerUid, iPriority);
1763 INFO_PRINTF2(_L("Failed to load the controller %d "), errorCode);
1764 User::LeaveIfError( errorCode );
1766 iControllerEventMonitor->Start();
1767 if(!SetupReadFileConfigL())
1769 return EInconclusive;
1771 RMMFVideoSetInitScreenCustomCommands setInitScrn(iController);
1772 errorCode = setInitScrn.SetInitScreenNumber(iScreenNumber);
1775 INFO_PRINTF2(_L("SetInitScreenNumber failed with %d "), errorCode);
1776 User::LeaveIfError( errorCode );
1778 errorCode = iController.AddDataSink(KUidMmfAudioOutput,KNullDesC8);
1779 if(errorCode != KErrNotSupported)
1781 INFO_PRINTF2(_L("AddDataSink failed to return KErrNotSupported but returned %d with an invalid screen"), errorCode);
1788 Test step constructor. It initialises its own name, input filename and the screen number.
1790 RTestStepAviPlayCtrlAddDataSinkTwice::RTestStepAviPlayCtrlAddDataSinkTwice(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid, TInt aScreenNumber)
1791 :RTestStepAviPlayCtrlSetScrnPlay(aTestName, aSectName, aKeyName, aControllerUid, aScreenNumber)
1795 This test step tries to set an invalid screen after calling AddDataSink on AviController and tries playing.
1796 It resets the controller after the play is successful and tries to call AddDataSink again and expects
1797 it to fail with KErrNotSupported.
1799 TVerdict RTestStepAviPlayCtrlAddDataSinkTwice::DoTestStepPreambleL(void)
1801 RTestStepAviCtrlBase::DoTestStepPreambleL();
1805 TVerdict RTestStepAviPlayCtrlAddDataSinkTwice::DoTestStepL(void)
1807 INFO_PRINTF1(_L("this step tries to add data sink twice.Second time invalid screen"));
1808 iTestStepResult = EFail;
1809 TInt errorCode = iController.Open(KAviPlayControllerUid, iPriority);
1812 INFO_PRINTF2(_L("Failed to load the controller %d "), errorCode);
1813 User::LeaveIfError( errorCode );
1815 iControllerEventMonitor->Start();
1816 if(!SetupReadFileConfigL())
1818 return EInconclusive;
1820 errorCode = iController.AddDataSink(KUidMmfAudioOutput,KNullDesC8);
1823 INFO_PRINTF2(_L("AddDataSink failed with %d "), errorCode);
1824 User::LeaveIfError( errorCode );
1826 RMMFVideoSetInitScreenCustomCommands setInitScrn(iController);
1827 errorCode = setInitScrn.SetInitScreenNumber(iScreenNumber);
1830 INFO_PRINTF2(_L("SetInitScreenNumber failed with %d "), errorCode);
1831 User::LeaveIfError( errorCode );
1833 errorCode = iController.AddDataSource(KUidMmfFileSource, ReadFileConfig());
1836 INFO_PRINTF2(_L("AddDataSource failed with %d "), errorCode);
1837 User::LeaveIfError( errorCode );
1839 CActiveScheduler::Start();
1840 if(iTestStepResult == EFail)
1842 return iTestStepResult;
1844 errorCode = iController.Reset();
1847 INFO_PRINTF2(_L("Reset is failed with %d "), errorCode);
1850 errorCode = iController.AddDataSink(KUidMmfAudioOutput,KNullDesC8);
1851 if(errorCode != KErrNotSupported)
1853 INFO_PRINTF2(_L("AddDataSink failed to return KErrNotSupported but returned %d with an invalid screen"), errorCode);
1856 return iTestStepResult;
1861 Test step constructor. It initialises its own name and the input filename
1863 RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap::
1864 RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap(const TDesC& aTestName,
1865 const TDesC& aSectName,
1866 const TDesC& aKeyName,
1867 TUid aControllerUid)
1869 RAsyncTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid),
1870 iTestState(EStateDefault),
1883 Do the test step. This test check that under low memory conditions the xvid
1884 codec may leave and DevVideo will be notified by the codec and and in turn
1885 AviPlayController will be notified too by DevVideo using the FatalError
1886 callbacks. Once the low memory conditions return to normal, the test case
1887 Primes the AviPlayController and Plays an avi file to its completion and checks
1888 for the proper play completion. This will prove that DevVideo is destroyed and
1889 then recreated after a FatalError occurs.
1893 1.- To allocate enough memory with the aim of leaving around KMaxFreeRamForTest
1894 bytes available for the rest of the test case.
1896 2.- After that, the testcase Primes the AviPlayController and Plays an avi
1897 file. Play is expected to fail with KErrTooBig (in the play completion event).
1899 3.- Then returns memory back to the system.
1901 4.- Then try to play the video file again, this time everything will work
1902 fine...With this we test that DevVideo's been recreated...
1905 void RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap::KickoffTestL()
1907 iTestState = EStateLoadKickoffTestLComplete;
1909 INFO_PRINTF1(_L("this step plays an avi file under low memory conditions for the xvid decoder "));
1911 // This will install two callbacks
1912 RAsyncTestStepAviCtrlPlayBase::KickoffTestL();
1914 // STEP 1: The idea here is to allocate enough memory with the aim of
1915 // leaving around KMaxFreeRamForTest bytes available for the rest of the
1916 // step. That will make the xvid decoder to fail the frame decoding as the
1917 // decoder heap will not be large enough.
1918 TCallBack callback01 (AllocChunkCallBack, this);
1921 iKickoff01 = new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
1924 // STEP 2: Prime the controller...
1925 TCallBack callback02 (PrimeControllerCallBack, this);
1928 iKickoff02 = new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow);
1930 // STEP 3: play is expected to fail with KErrTooBig (in the play completion event ) ...
1931 TCallBack callback03 (PlayControllerCallBack, this);
1934 iKickoff03 = new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow);
1936 // STEP 4: Return memory back to system here...
1937 TCallBack callback04 (ReturnChunckAndStopControllerCallBack, this);
1940 iKickoff04 = new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow);
1943 TCallBack callback05 (PrimeControllerCallBack, this);
1946 iKickoff05 = new (ELeave) CAsyncCallBack (callback05, CActive::EPriorityLow);
1948 // ...and repeat play
1949 TCallBack callback06 (PlayControllerCallBack, this);
1952 iKickoff06 = new (ELeave) CAsyncCallBack (callback06, CActive::EPriorityLow);
1954 // Start allocate chunck callback.
1958 void RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap::CloseTest()
1960 delete iKickoff01; // no need to Cancel
1962 delete iKickoff02; // no need to Cancel
1964 delete iKickoff03; // no need to Cancel
1966 delete iKickoff04; // no need to Cancel
1968 delete iKickoff05; // no need to Cancel
1970 delete iKickoff06; // no need to Cancel
1973 RAsyncTestStepAviCtrlPlayBase::CloseTest();
1977 TInt RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap::AllocChunkCallBack(TAny* aPtr)
1979 RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap* self =
1980 static_cast<RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap*> (aPtr);
1981 self->DoAllocChunkCallBack();
1985 void RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap::DoAllocChunkCallBack()
1988 if (iTestState != EStateLoadKickoffTestLComplete)
1990 INFO_PRINTF1(_L("FSM error in DoAllocChunkCallBack"));
1991 StopTest(KErrGeneral, EFail);
1995 iTestState = EStateAllocChunkCallBackComplete;
1999 TInt halError = KErrNone;
2000 if ((halError = HAL::Get(HALData::EMemoryRAMFree, freeRam)) != KErrNone)
2002 INFO_PRINTF1(_L("Unable to obtain the amount of free ram available "));
2003 StopTest(halError, EInconclusive);
2007 if (freeRam > KMaxFreeRamForTest)
2009 TInt memToAllocate = freeRam - KMaxFreeRamForTest;
2010 INFO_PRINTF3(_L("freeRam = %d bytes, before allocating %d bytes"),
2011 freeRam, memToAllocate);
2012 TInt chunkError = KErrNone;
2013 //We have calculated the amount of memory to allocate
2014 //start by allocating half of that amount
2016 if((chunkError=iRChunk[0].CreateLocal(memToAllocate/2, memToAllocate/2 + 1))!=KErrNone)
2018 INFO_PRINTF3(_L("At least %d mem bytes are needed for this test (err=%d)"),
2019 KMaxFreeRamForTest, chunkError);
2020 StopTest(chunkError, EInconclusive);
2023 //WDP: we are allocating on paged memory. So keep allocating chunks till you are Out of Memory
2024 //Now allocate smaller chunks. Only half of memToAllocate has been allocated yet
2025 //In every iteration we try to allocate KMaxFreeRamForTest/2
2026 //Calculate the max loop value till which we should run, add some extra iterations so that this loop goes on till OOM for sure
2027 //Number of iterations is (0.5*memToAllocate)/(0.5*KMaxFreeRamForTest)
2028 TInt loopValue=(memToAllocate/KMaxFreeRamForTest)+KExtraIterations;
2029 if(loopValue>KMaxChunks)
2031 //We should not get here.
2032 INFO_PRINTF1(_L("Cannot Create so many chunks"));
2033 StopTest(chunkError, EInconclusive);
2036 for(iNumAllocatedChunks=1;iNumAllocatedChunks<KMaxChunks;iNumAllocatedChunks++)
2038 chunkError = KErrNone;
2039 if ((chunkError = iRChunk[iNumAllocatedChunks].CreateLocal(KMaxFreeRamForTest/2, KMaxFreeRamForTest/2 + 1)) != KErrNone)
2041 if(chunkError==KErrNoMemory)
2043 //We have run out of memory
2044 //Close the last two chunks so now you have approximately KMaxFreeRamForTest free
2045 iRChunk[--iNumAllocatedChunks].Close();
2046 if(iNumAllocatedChunks>0)
2048 iRChunk[--iNumAllocatedChunks].Close();
2055 INFO_PRINTF1(_L("Received Unexpected error"));
2056 StopTest(chunkError, EInconclusive);
2061 if(chunkError!=KErrNoMemory)
2063 //We are out of the loop and still not out of memory. This is not expected
2064 INFO_PRINTF2(_L("Expecting -4 by now but still not out of memory. Allocated chunks %d"),iNumAllocatedChunks);
2065 StopTest(chunkError, EInconclusive);
2069 iKickoff02->Call(); // Start prime
2073 INFO_PRINTF2(_L("At least %d mem bytes are needed for this test "), KMaxFreeRamForTest);
2074 StopTest(KErrGeneral, EInconclusive);
2079 TInt RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap::PrimeControllerCallBack(TAny* aPtr)
2081 RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap* self =
2082 static_cast<RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap*> (aPtr);
2083 self->DoPrimeControllerCallBack();
2087 void RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap::DoPrimeControllerCallBack()
2093 case EStateAllocChunkCallBackComplete:
2095 iTestState = EStatePrimeControllerCallBackComplete1;
2096 iKickoff03->Call(); // Start 1st playback
2099 case EStateReturnChunckAndStopControllerCallBackComplete:
2101 iTestState = EStatePrimeControllerCallBackComplete2;
2102 iKickoff06->Call(); // Start 2nd playback
2107 INFO_PRINTF1(_L("FSM error in DoPrimeControllerCallBack"));
2108 StopTest(KErrGeneral, EFail);
2113 INFO_PRINTF1(_L("iController.Prime()"));
2115 TInt errorCode = iController.Prime();
2118 INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
2119 StopTest(errorCode, EFail);
2124 TInt RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap::PlayControllerCallBack(TAny* aPtr)
2126 RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap* self =
2127 static_cast<RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap*> (aPtr);
2128 self->DoPlayControllerCallBack();
2132 void RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap::DoPlayControllerCallBack()
2138 case EStatePrimeControllerCallBackComplete1:
2140 iTestState = EStatePlayControllerCallBackComplete1;
2143 case EStatePrimeControllerCallBackComplete2:
2145 iTestState = EStatePlayControllerCallBackComplete2;
2150 INFO_PRINTF1(_L("FSM error in DoPlayControllerCallBack"));
2151 StopTest(KErrGeneral, EFail);
2156 INFO_PRINTF1(_L("iController.Play()"));
2158 TInt errorCode = iController.Play();
2161 INFO_PRINTF2(_L("Play() failed with error %d"), errorCode);
2162 StopTest(errorCode, EFail);
2166 TInt RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap::ReturnChunckAndStopControllerCallBack(TAny* aPtr)
2168 RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap* self =
2169 static_cast<RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap*> (aPtr);
2170 self->DoReturnChunckAndStopControllerCallBack();
2174 void RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap::DoReturnChunckAndStopControllerCallBack()
2177 if (iTestState != EStatePlayControllerCallBackComplete1)
2179 INFO_PRINTF1(_L("FSM error in DoReturnChunckAndStopControllerCallBack"));
2180 StopTest(KErrGeneral, EFail);
2183 iTestState = EStateReturnChunckAndStopControllerCallBackComplete;
2185 INFO_PRINTF1(_L("Returning memory back to the system"));
2187 for(TInt i=0;i<iNumAllocatedChunks;i++)
2191 // Get controller back to an initial state
2194 iKickoff05->Call(); // call prime again
2199 This is from MMMFControllerEventMonitorObserver.which handles all the events
2200 from AviPlayController. Base class version is overridden to avoid starting the
2201 active schedular twice.
2203 void RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap::HandleEvent(const TMMFEvent& aEvent)
2205 INFO_PRINTF2(_L("HandleEvent aEvent.iEventType %d "),
2207 INFO_PRINTF2(_L("::HandleEvent aEvent.iErrorCode %d "),
2210 if (aEvent.iEventType == KMMFEventCategoryPlaybackComplete)
2212 if(aEvent.iErrorCode == KErrNone)
2214 iTestStepResult = EPass;
2215 INFO_PRINTF2(_L("PlayCompletion is passed with %d "),
2220 iTestStepResult = EFail;
2221 INFO_PRINTF2(_L("PlayCompletion is failed with %d "),
2226 // Match fsm state with play completion event just processed
2230 case EStatePlayControllerCallBackComplete1:
2232 if (iTestStepResult == EPass)
2234 INFO_PRINTF1(_L("Error: completion event was expected to be failed at this point"));
2235 StopTest(KErrGeneral, EFail);
2239 iKickoff04->Call(); // Return memory
2242 case EStatePlayControllerCallBackComplete2:
2244 if (iTestStepResult == EFail)
2246 INFO_PRINTF1(_L("Error: PlayCompletion event was expected to pass at this point"));
2247 StopTest(KErrGeneral, EFail);
2252 // Test has finished succesfully at this point
2253 INFO_PRINTF1(_L("Test successfully completed"));
2260 INFO_PRINTF1(_L("FSM error in HandleEvent"));
2261 StopTest(KErrGeneral, EFail);
2266 else if (aEvent.iEventType == KMMFEventCategoryVideoOpenComplete)
2268 if(aEvent.iErrorCode != KErrNone)
2270 INFO_PRINTF2(_L("Video open complete is failed with %d "), aEvent.iErrorCode);
2271 StopTest(KErrGeneral, EFail);
2277 INFO_PRINTF1(_L("Unexpected Event from the Controller"));
2278 StopTest(KErrGeneral, EFail);
2283 Test step constructor. It initialises its own name and the input filename
2285 RTestStepAviPlayCtrlMemAlloc1::RTestStepAviPlayCtrlMemAlloc1(const TDesC& aTestName,
2286 const TDesC& aSectName,
2287 const TDesC& aKeyName,
2288 TUid aControllerUid)
2289 : RTestStepAviCtrlBase(aTestName, aSectName, aKeyName, aControllerUid)
2294 Do the test step. This test issue a custom command to the custom AviPlay controller
2295 and runs the OOM test within the controller.
2297 TVerdict RTestStepAviPlayCtrlMemAlloc1::DoTestStepL()
2299 TVerdict result = EPass;
2301 Log( _L("Memory Allocation Test 1") );
2303 Log( _L("This test checks memory allocation of the plugin") );
2305 TInt errorCode = iController.Open(KUidCustomTestAviPlayPlugin, iPriority);
2306 User::LeaveIfError( errorCode );
2308 //[ send the custom command to the custom audio controller ]
2309 TMMFMessageDestinationPckg destinationPckg(KMemoryAllocationTestId);
2311 //[ send memory alloc test to the custom plugin ]
2312 //[ we have only ensured that the controller is loaded into memory
2313 // and that all add sources etc will be don
2314 errorCode = iController.CustomCommandSync(destinationPckg,
2319 //[ ensure the controller is unloaded so that it does
2320 // not interfere with the following test ]
2321 // There is a bug in this code and the stop followed by reset
2322 // ensure the controller resources are released.
2324 iController.Reset();
2325 iController.Close();
2327 User::LeaveIfError( errorCode );
2332 This is from MMMFControllerEventMonitorObserver.which handles all the events
2333 from AviPlayController. Base class version is overridden to avoid starting the
2334 active schedular twice.
2336 void RTestStepAviPlayCtrlMemAlloc1::HandleEvent(const TMMFEvent& aEvent)
2342 Test step constructor. It initialises its own name and the input filename
2344 RTestStepAviPlayCtrlMemAlloc2::RTestStepAviPlayCtrlMemAlloc2(const TDesC& aTestName,
2345 const TDesC& aSectName,
2346 const TDesC& aKeyName,
2347 TUid aControllerUid)
2348 : RTestStepAviCtrlBase(aTestName, aSectName, aKeyName, aControllerUid)
2353 Do the test step. This test issue a custom command to the custom AviPlay controller
2354 and runs the OOM test within the controller.
2356 TVerdict RTestStepAviPlayCtrlMemAlloc2::DoTestStepL()
2358 TVerdict result = EPass;
2360 Log( _L("Memory Allocation Test 2") );
2362 Log( _L("This test checks memory allocation of the plugin") );
2364 TInt errorCode = iController.Open(KUidCustomTestAviPlayPlugin, iPriority);
2365 User::LeaveIfError( errorCode );
2367 //[ send the custom command to the custom audio controller ]
2368 TMMFMessageDestinationPckg destinationPckg(KMemoryAllocationTestId);
2370 //[ set the prime OOM test mode ]
2371 //[ we have only ensured that the controller is loaded into memory
2372 // and that all add sources etc will be don
2373 TPckgBuf<TBool> primeTestEnable(ETrue);
2374 errorCode = iController.CustomCommandSync(destinationPckg,
2375 KOOMPrimeTestEnable,
2378 if (errorCode == KErrNone)
2383 TPckgBuf<TInt> primeTestFailCount(failCount);
2384 errorCode = iController.CustomCommandSync(destinationPckg,
2385 KOOMPrimeTestFailCount,
2388 if (errorCode != KErrNone)
2390 result = EInconclusive;
2394 errorCode = iController.CustomCommandSync(destinationPckg,
2398 if (errorCode != KErrNone)
2400 result = EInconclusive;
2404 errorCode = iController.Prime();
2405 if (errorCode == KErrNone)
2410 else if (errorCode != KErrNoMemory)
2416 iController.Reset();
2422 result = EInconclusive;
2425 primeTestEnable() = EFalse;
2426 iController.CustomCommandSync(destinationPckg,
2427 KOOMPrimeTestEnable,
2431 //[ ensure the controller is unloaded so that it does
2432 // not interfere with the following test ]
2433 // There is a bug in this code and the stop followed by reset
2434 // ensure the controller resources are released.
2436 iController.Reset();
2437 iController.Close();
2443 This is from MMMFControllerEventMonitorObserver.which handles all the events
2444 from AviPlayController. Base class version is overridden to avoid starting the
2445 active schedular twice.
2447 void RTestStepAviPlayCtrlMemAlloc2::HandleEvent(const TMMFEvent& aEvent)
2453 Test step constructor. It initialises its own name and the input filename
2455 RTestStepAviPlayCtrlMemAlloc3::RTestStepAviPlayCtrlMemAlloc3(const TDesC& aTestName,
2456 const TDesC& aSectName,
2457 const TDesC& aKeyName,
2458 TUid aControllerUid)
2459 : RTestStepAviCtrlBase(aTestName, aSectName, aKeyName, aControllerUid)
2464 Do the test step. This test issue a custom command to the custom AviPlay controller
2465 and runs the OOM test within the controller.
2467 TVerdict RTestStepAviPlayCtrlMemAlloc3::DoTestStepL()
2469 TVerdict result = EPass;
2471 Log( _L("Memory Allocation Test 3") );
2473 Log( _L("This test checks memory allocation of the plugin") );
2475 TInt errorCode = iController.Open(KUidCustomTestAviPlayPlugin, iPriority);
2476 User::LeaveIfError( errorCode );
2478 //[ send the custom command to the custom audio controller ]
2479 TMMFMessageDestinationPckg destinationPckg(KMemoryAllocationTestId);
2484 TPckgBuf<TInt> primeTestFailCount(failCount);
2485 errorCode = iController.CustomCommandSync(destinationPckg,
2486 KOOMPrimeTestFailCount,
2489 if (errorCode != KErrNone)
2491 result = EInconclusive;
2495 errorCode = iController.CustomCommandSync(destinationPckg,
2499 if (errorCode != KErrNone)
2501 result = EInconclusive;
2505 errorCode = iController.Prime();
2506 if (errorCode != KErrNone)
2508 result = EInconclusive;
2512 errorCode = iController.CustomCommandSync(destinationPckg,
2517 if (errorCode == KErrNone)
2522 else if (errorCode != KErrNoMemory)
2528 iController.Reset();
2532 //[ ensure the controller is unloaded so that it does
2533 // not interfere with the following test ]
2534 // There is a bug in this code and the stop followed by reset
2535 // ensure the controller resources are released.
2537 iController.Reset();
2538 iController.Close();
2544 This is from MMMFControllerEventMonitorObserver.which handles all the events
2545 from AviPlayController. Base class version is overridden to avoid starting the
2546 active schedular twice.
2548 void RTestStepAviPlayCtrlMemAlloc3::HandleEvent(const TMMFEvent& aEvent)
2553 #ifdef SYMBIAN_BUILD_GCE
2556 Test step constructor. It initialises its own name and the input filename.
2558 RTestStepAviPlayCtrlSurfaceSupport::RTestStepAviPlayCtrlSurfaceSupport(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
2559 :RAsyncTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid), iVpsCommands(iController)
2563 void RTestStepAviPlayCtrlSurfaceSupport::KickoffTestL()
2565 // Allow parent to create some call backs for its initialization.
2566 // Should open the video controller, set the filename, add the source and add the sink.
2567 RAsyncTestStepAviCtrlPlayBase::KickoffTestL();
2569 iSurfaceCreated = EFalse;
2572 TCallBack callbackUseSurfaces(UseSurfacesCallBack, this);
2573 delete iKickoffUseSurfaces;
2574 iKickoffUseSurfaces = NULL;
2575 iKickoffUseSurfaces = new (ELeave) CAsyncCallBack(callbackUseSurfaces, CActive::EPriorityLow);
2576 iKickoffUseSurfaces->Call();
2578 // Call UseSurfaces again. This should not fail or cause any other subsequent step to fail.
2579 delete iKickoffUseSurfaces2;
2580 iKickoffUseSurfaces2 = NULL;
2581 iKickoffUseSurfaces2 = new (ELeave) CAsyncCallBack(callbackUseSurfaces, CActive::EPriorityLow);
2582 iKickoffUseSurfaces2->Call();
2584 // Prime the controller
2585 TCallBack callbackPrimeController(PrimeControllerCallBack, this);
2586 delete iKickoffPrimeController;
2587 iKickoffPrimeController = NULL;
2588 iKickoffPrimeController = new (ELeave) CAsyncCallBack(callbackPrimeController, CActive::EPriorityLow);
2589 iKickoffPrimeController->Call();
2591 TCallBack callbackPlayController(PlayControllerCallBack, this);
2592 delete iKickoffPlayController;
2593 iKickoffPlayController = NULL;
2594 iKickoffPlayController = new (ELeave) CAsyncCallBack(callbackPlayController, CActive::EPriorityLow);
2595 iKickoffPlayController->Call();
2598 void RTestStepAviPlayCtrlSurfaceSupport::CloseTest()
2600 // no need to Cancel before deleting.
2601 delete iKickoffUseSurfaces;
2602 iKickoffUseSurfaces = NULL;
2603 delete iKickoffUseSurfaces2;
2604 iKickoffUseSurfaces2 = NULL;
2605 delete iKickoffPrimeController;
2606 iKickoffPrimeController = NULL;
2608 RAsyncTestStepAviCtrlPlayBase::CloseTest();
2612 Check if we have passed the test. We need to make sure that we have received all the event
2613 messages that we expect.
2615 TVerdict RTestStepAviPlayCtrlSurfaceSupport::CheckTestResult()
2617 // Only report that we have not received all expected events if everything else passes.
2618 // We don't expect the event generators to work properly if something else failed (and those
2619 // other error codes and reasons should be more useful). We won't see these events if GCE is
2620 // not enabled. So, if GCE is disabled, do not fail because we didn't see these events.
2621 if (Result() == EPass && !iSurfaceCreated && iGceEnabled)
2623 if (!iSurfaceCreated)
2625 ERR_PRINTF1(_L("Failed to receive surface created event"));
2631 return RAsyncTestStepAviCtrlPlayBase::CheckTestResult();
2635 This is from MMMFControllerEventMonitorObserver.which handles all the events
2636 from AviPlayController. Base class version is overridden to avoid starting the
2637 active schedular twice.
2639 void RTestStepAviPlayCtrlSurfaceSupport::HandleEvent(const TMMFEvent& aEvent)
2641 if (aEvent.iEventType == KMMFEventCategoryVideoOpenComplete)
2643 if(aEvent.iErrorCode != KErrNone)
2645 ERR_PRINTF2(_L("Video open complete has failed with %d "), aEvent.iErrorCode);
2646 StopTest(KErrGeneral, EInconclusive);
2650 else if (aEvent.iEventType == KMMFEventCategoryVideoSurfaceCreated)
2654 ERR_PRINTF1(_L("Surface events should not be generated when GCE is not enabled"));
2655 StopTest(KErrGeneral, EFail);
2659 // The error code is actually the display for which a surface has been created.
2660 if (aEvent.iErrorCode != KErrNone)
2662 ERR_PRINTF2(_L("Video surface created event has error %d."), aEvent.iErrorCode);
2663 StopTest(KErrGeneral, EFail);
2666 // Now that the surface has been created we can check if can retrieve the surface parameters
2668 TVideoAspectRatio pixelAspectRatio;
2670 TInt error = iVpsCommands.GetSurfaceParameters(iSurfaceId, cropRect, pixelAspectRatio);
2673 ERR_PRINTF2(_L("GetSurfaceParameters failed with code %d."), error);
2674 StopTest(error, EFail);
2677 iSurfaceCreated = ETrue;
2679 else if (aEvent.iEventType == KMMFEventCategoryPlaybackComplete)
2681 if(aEvent.iErrorCode == KErrNone)
2685 TInt error = iVpsCommands.SurfaceRemoved(iSurfaceId);
2688 ERR_PRINTF2(_L("SurfaceRemoved failed with code %d."), error);
2689 StopTest(error, EFail);
2696 ERR_PRINTF2(_L("Video playback complete has failed with %d "), aEvent.iErrorCode);
2697 StopTest(KErrGeneral, EInconclusive);
2702 ERR_PRINTF3(_L("Unexpected Event from the Controller: type %d error: %d"), aEvent.iEventType, aEvent.iErrorCode);
2703 StopTest(KErrGeneral, EFail);
2707 TInt RTestStepAviPlayCtrlSurfaceSupport::UseSurfacesCallBack(TAny* aPtr)
2709 RTestStepAviPlayCtrlSurfaceSupport* self =
2710 static_cast<RTestStepAviPlayCtrlSurfaceSupport*> (aPtr);
2711 self->DoUseSurfacesCallBack();
2715 void RTestStepAviPlayCtrlSurfaceSupport::DoUseSurfacesCallBack()
2717 TInt error = iVpsCommands.UseSurfaces();
2719 if (iGceEnabled && error != KErrNone)
2721 ERR_PRINTF2(_L("UseSurfaces failed with code %d."), error);
2722 StopTest(error, EFail);
2724 else if (!iGceEnabled && error != KErrNotSupported)
2726 ERR_PRINTF2(_L("UseSurfaces failed to return KErrNotSupported. Actual result: %d."), error);
2727 StopTest(error, EFail);
2731 TInt RTestStepAviPlayCtrlSurfaceSupport::PrimeControllerCallBack(TAny* aPtr)
2733 RTestStepAviPlayCtrlSurfaceSupport* self =
2734 static_cast<RTestStepAviPlayCtrlSurfaceSupport*> (aPtr);
2735 self->DoPrimeControllerCallBack();
2739 void RTestStepAviPlayCtrlSurfaceSupport::DoPrimeControllerCallBack()
2741 TInt error = iController.Prime();
2742 if (error != KErrNone)
2744 ERR_PRINTF2(_L("Prime failed with %d "), error);
2745 StopTest(error, EFail);
2749 TInt RTestStepAviPlayCtrlSurfaceSupport::PlayControllerCallBack(TAny* aPtr)
2751 RTestStepAviPlayCtrlSurfaceSupport* self =
2752 static_cast<RTestStepAviPlayCtrlSurfaceSupport*> (aPtr);
2753 self->DoPlayControllerCallBack();
2757 void RTestStepAviPlayCtrlSurfaceSupport::DoPlayControllerCallBack()
2759 TInt error = iController.Play();
2760 if (error != KErrNone)
2762 ERR_PRINTF2(_L("Play failed with %d "), error);
2763 StopTest(error, EFail);
2767 RTestStepAviPlayCtrlSurfaceRemovedNoUS::RTestStepAviPlayCtrlSurfaceRemovedNoUS(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
2768 :RAsyncTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid), iVpsCommands(iController)
2772 void RTestStepAviPlayCtrlSurfaceRemovedNoUS::KickoffTestL()
2774 // Allow parent to create some call backs for its initialization.
2775 // Should open the video controller, set the filename, add the source and add the sink.
2776 RAsyncTestStepAviCtrlPlayBase::KickoffTestL();
2778 // Call SurfaceRemoved
2779 iSurfaceId = TSurfaceId::CreateNullId();
2781 TCallBack callbackSurfaceRemoved(SurfaceRemovedCallBack, this);
2782 delete iKickoffSurfaceRemoved;
2783 iKickoffSurfaceRemoved = NULL;
2784 iKickoffSurfaceRemoved = new (ELeave) CAsyncCallBack(callbackSurfaceRemoved, CActive::EPriorityLow);
2785 iKickoffSurfaceRemoved->Call();
2788 void RTestStepAviPlayCtrlSurfaceRemovedNoUS::CloseTest()
2790 // no need to Cancel before deleting.
2791 delete iKickoffSurfaceRemoved;
2792 iKickoffSurfaceRemoved = NULL;
2794 RAsyncTestStepAviCtrlPlayBase::CloseTest();
2797 TInt RTestStepAviPlayCtrlSurfaceRemovedNoUS::SurfaceRemovedCallBack(TAny* aPtr)
2799 RTestStepAviPlayCtrlSurfaceRemovedNoUS* self =
2800 static_cast<RTestStepAviPlayCtrlSurfaceRemovedNoUS*> (aPtr);
2801 self->DoSurfaceRemovedCallBack();
2805 void RTestStepAviPlayCtrlSurfaceRemovedNoUS::DoSurfaceRemovedCallBack()
2807 TInt error = iVpsCommands.SurfaceRemoved(iSurfaceId);
2809 if (iGceEnabled && error != KErrNotSupported)
2811 ERR_PRINTF2(_L("SurfaceRemoved failed to return error KErrNotSupported. Actual error was %d "), error);
2812 StopTest(KErrGeneral, EFail);
2814 else if (!iGceEnabled && error != KErrNotSupported)
2816 ERR_PRINTF2(_L("SurfaceRemoved failed to return KErrNotSupported. Actual result: %d."), error);
2817 StopTest(error, EFail);
2825 RTestStepAviPlayCtrlGetSurfaceParametersNoUS::RTestStepAviPlayCtrlGetSurfaceParametersNoUS(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
2826 :RAsyncTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid), iVpsCommands(iController)
2830 void RTestStepAviPlayCtrlGetSurfaceParametersNoUS::KickoffTestL()
2832 // Allow parent to create some call backs for its initialization.
2833 // Should open the video controller, set the filename, add the source and add the sink.
2834 RAsyncTestStepAviCtrlPlayBase::KickoffTestL();
2836 // Get the surface parameters.
2837 TCallBack callbackGetSurfaceParameters(GetSurfaceParametersCallBack, this);
2838 delete iKickoffGetSurfaceParameters;
2839 iKickoffGetSurfaceParameters = NULL;
2840 iKickoffGetSurfaceParameters = new (ELeave) CAsyncCallBack(callbackGetSurfaceParameters, CActive::EPriorityLow);
2841 iKickoffGetSurfaceParameters->Call();
2844 void RTestStepAviPlayCtrlGetSurfaceParametersNoUS::CloseTest()
2846 // no need to Cancel before deleting.
2847 delete iKickoffGetSurfaceParameters;
2848 iKickoffGetSurfaceParameters = NULL;
2850 RAsyncTestStepAviCtrlPlayBase::CloseTest();
2853 TInt RTestStepAviPlayCtrlGetSurfaceParametersNoUS::GetSurfaceParametersCallBack(TAny* aPtr)
2855 RTestStepAviPlayCtrlGetSurfaceParametersNoUS* self =
2856 static_cast<RTestStepAviPlayCtrlGetSurfaceParametersNoUS*> (aPtr);
2857 self->DoGetSurfaceParametersCallBack();
2861 void RTestStepAviPlayCtrlGetSurfaceParametersNoUS::DoGetSurfaceParametersCallBack()
2863 TSurfaceId surfaceID;
2865 TVideoAspectRatio pixelAspectRatio;
2867 TInt error = iVpsCommands.GetSurfaceParameters(surfaceID, cropRect, pixelAspectRatio);
2869 if (iGceEnabled && error != KErrNotSupported)
2871 ERR_PRINTF2(_L("GetSurfaceParameters failed to return error KErrNotSupported. Actual error was %d "), error);
2872 StopTest(KErrGeneral, EFail);
2874 else if (!iGceEnabled && error != KErrNotSupported)
2876 ERR_PRINTF2(_L("GetSurfaceParameters failed to return KErrNotSupported. Actual result: %d."), error);
2877 StopTest(error, EFail);
2885 RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId::RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
2886 :RAsyncTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid), iVpsCommands(iController)
2890 void RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId::KickoffTestL()
2892 // Allow parent to create some call backs for its initialization.
2893 // Should open the video controller, set the filename, add the source and add the sink.
2894 RAsyncTestStepAviCtrlPlayBase::KickoffTestL();
2897 TCallBack callbackUseSurfaces(UseSurfacesCallBack, this);
2898 delete iKickoffUseSurfaces;
2899 iKickoffUseSurfaces = NULL;
2900 iKickoffUseSurfaces = new (ELeave) CAsyncCallBack(callbackUseSurfaces, CActive::EPriorityLow);
2901 iKickoffUseSurfaces->Call();
2903 // Call SurfaceRemoved
2904 iSurfaceId = TSurfaceId::CreateNullId();
2906 TCallBack callbackSurfaceRemoved(SurfaceRemovedCallBack, this);
2907 delete iKickoffSurfaceRemoved;
2908 iKickoffSurfaceRemoved = NULL;
2909 iKickoffSurfaceRemoved = new (ELeave) CAsyncCallBack(callbackSurfaceRemoved, CActive::EPriorityLow);
2910 iKickoffSurfaceRemoved->Call();
2913 void RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId::CloseTest()
2915 // no need to Cancel before deleting.
2916 delete iKickoffSurfaceRemoved;
2917 iKickoffSurfaceRemoved = NULL;
2919 RAsyncTestStepAviCtrlPlayBase::CloseTest();
2922 TInt RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId::SurfaceRemovedCallBack(TAny* aPtr)
2924 RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId* self =
2925 static_cast<RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId*> (aPtr);
2926 self->DoSurfaceRemovedCallBack();
2930 void RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId::DoSurfaceRemovedCallBack()
2932 TInt error = iVpsCommands.SurfaceRemoved(iSurfaceId);
2934 if (iGceEnabled && error != KErrArgument)
2936 ERR_PRINTF2(_L("SurfaceRemoved failed to return error KErrArgument. Actual error was %d "), error);
2937 StopTest(KErrGeneral, EFail);
2939 else if (!iGceEnabled && error != KErrNotSupported)
2941 ERR_PRINTF2(_L("SurfaceRemoved failed to return KErrNotSupported. Actual result: %d."), error);
2942 StopTest(error, EFail);
2950 TInt RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId::UseSurfacesCallBack(TAny* aPtr)
2952 RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId* self =
2953 static_cast<RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId*> (aPtr);
2954 self->DoUseSurfacesCallBack();
2958 void RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId::DoUseSurfacesCallBack()
2960 TInt error = iVpsCommands.UseSurfaces();
2962 if (iGceEnabled && error != KErrNone)
2964 ERR_PRINTF2(_L("UseSurfaces failed with code %d."), error);
2965 StopTest(error, EFail);
2967 else if (!iGceEnabled && error != KErrNotSupported)
2969 ERR_PRINTF2(_L("UseSurfaces failed to return KErrNotSupported. Actual result: %d."), error);
2970 StopTest(error, EFail);
2974 RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId::RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
2975 :RAsyncTestStepAviCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid), iVpsCommands(iController)
2979 void RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId::KickoffTestL()
2981 // Allow parent to create some call backs for its initialization.
2982 // Should open the video controller, set the filename, add the source and add the sink.
2983 RAsyncTestStepAviCtrlPlayBase::KickoffTestL();
2986 TCallBack callbackUseSurfaces(UseSurfacesCallBack, this);
2987 delete iKickoffUseSurfaces;
2988 iKickoffUseSurfaces = NULL;
2989 iKickoffUseSurfaces = new (ELeave) CAsyncCallBack(callbackUseSurfaces, CActive::EPriorityLow);
2990 iKickoffUseSurfaces->Call();
2992 // Call SurfaceRemoved
2993 iSurfaceId.iInternal[0] = 1111;
2994 iSurfaceId.iInternal[1] = 1111;
2995 iSurfaceId.iInternal[2] = 1111;
2996 iSurfaceId.iInternal[3] = 1111;
2998 TCallBack callbackSurfaceRemoved(SurfaceRemovedCallBack, this);
2999 delete iKickoffSurfaceRemoved;
3000 iKickoffSurfaceRemoved = NULL;
3001 iKickoffSurfaceRemoved = new (ELeave) CAsyncCallBack(callbackSurfaceRemoved, CActive::EPriorityLow);
3002 iKickoffSurfaceRemoved->Call();
3005 void RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId::CloseTest()
3007 // no need to Cancel before deleting.
3008 delete iKickoffSurfaceRemoved;
3009 iKickoffSurfaceRemoved = NULL;
3011 RAsyncTestStepAviCtrlPlayBase::CloseTest();
3014 TInt RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId::SurfaceRemovedCallBack(TAny* aPtr)
3016 RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId* self =
3017 static_cast<RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId*> (aPtr);
3018 self->DoSurfaceRemovedCallBack();
3022 void RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId::DoSurfaceRemovedCallBack()
3024 TInt error = iVpsCommands.SurfaceRemoved(iSurfaceId);
3026 if (iGceEnabled && error != KErrNotReady)
3028 ERR_PRINTF2(_L("SurfaceRemoved failed to return error KErrNotReady. Actual error was %d "), error);
3029 StopTest(KErrGeneral, EFail);
3031 else if (!iGceEnabled && error != KErrNotSupported)
3033 ERR_PRINTF2(_L("SurfaceRemoved failed to return KErrNotSupported. Actual result: %d."), error);
3034 StopTest(error, EFail);
3042 TInt RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId::UseSurfacesCallBack(TAny* aPtr)
3044 RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId* self =
3045 static_cast<RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId*> (aPtr);
3046 self->DoUseSurfacesCallBack();
3050 void RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId::DoUseSurfacesCallBack()
3052 TInt error = iVpsCommands.UseSurfaces();
3054 if (iGceEnabled && error != KErrNone)
3056 ERR_PRINTF2(_L("UseSurfaces failed with code %d."), error);
3057 StopTest(error, EFail);
3059 else if (!iGceEnabled && error != KErrNotSupported)
3061 ERR_PRINTF2(_L("UseSurfaces failed to return KErrNotSupported. Actual result: %d."), error);
3062 StopTest(error, EFail);
3066 #endif // SYMBIAN_BUILD_GCE
3068 #ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
3071 // RAsyncTestSubtitlePlay
3073 RAsyncTestSubtitlePlay::RAsyncTestSubtitlePlay(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
3074 :RAsyncTestStepSubtitleBase(aTestName, aSectName, aKeyName, aControllerUid)
3076 SetExpectedCrpReadyCount(1);
3079 void RAsyncTestSubtitlePlay::OnOpenCompleteL()
3081 CheckAndEnableSubtitlesL();
3082 AddDefaultSubtitleConfL();
3084 RArray<TLanguage> languages;
3085 CleanupClosePushL(languages);
3086 TRAPD(err, iSubtitleCommands.GetSupportedSubtitleLanguagesL(languages));
3088 if (err != KErrNotSupported)
3090 ERR_PRINTF3(_L("GetSupportedSubtitleLanguagesL left with %d; expected %d"), err, KErrNotSupported);
3091 User::Leave(err == KErrNone ? KErrGeneral : err);
3094 if (languages.Count() != 0)
3096 ERR_PRINTF2(_L("GetSupportedSubtitleLanguagesL returned %d languages"), languages.Count());
3097 User::Leave(KErrGeneral);
3100 CleanupStack::PopAndDestroy(); // languages
3102 TLanguage language = ELangNone;
3103 err = iSubtitleCommands.GetSubtitleLanguage(language);
3105 if (err != KErrNotSupported)
3107 ERR_PRINTF3(_L("GetSubtitleLanguage failed with %d; expected %d"), err, KErrNotSupported);
3108 User::Leave(err == KErrNone ? KErrGeneral : err);
3111 if (language != ELangNone)
3113 ERR_PRINTF3(_L("GetSubtitleLanguage returned %d, expected %d"), language, ELangNone);
3114 User::Leave(KErrGeneral);
3117 err = iSubtitleCommands.SetSubtitleLanguage(ELangCanadianEnglish);
3119 if (err != KErrNotSupported)
3121 ERR_PRINTF3(_L("SetSubtitleLanguage failed with %d, expected %d"), err, KErrNotSupported);
3122 User::Leave(err == KErrNone ? KErrGeneral : err);
3128 void RAsyncTestSubtitlePlay::OnPlayCompleteL()
3130 RemoveConfigDisableL();
3134 // RAsyncTestSubtitleUpdateConfig
3136 RAsyncTestSubtitleUpdateConfig::RAsyncTestSubtitleUpdateConfig(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
3137 :RAsyncTestStepSubtitleBase(aTestName, aSectName, aKeyName, aControllerUid)
3139 SetExpectedCrpReadyCount(2);
3142 void RAsyncTestSubtitleUpdateConfig::OnOpenCompleteL()
3144 CheckAndEnableSubtitlesL();
3145 AddDefaultSubtitleConfL();
3147 TMMFSubtitleWindowConfig config;
3148 config.iWindowId = KWindowIdValid;
3149 config.iDisplayMode = EColor16MA;
3150 config.iRotation = EVideoRotationClockwise90;
3151 config.iWindowClipRect = KWindowClipRectAlt1;
3152 TInt err = iSubtitleCommands.UpdateSubtitleConfig(config);
3154 if (err != KErrNone)
3156 ERR_PRINTF2(_L("UpdateSubtitleConfig failed with %d"), err);
3163 void RAsyncTestSubtitleUpdateConfig::OnPlayCompleteL()
3165 RemoveConfigDisableL();
3169 // RAsyncTestSubtitleUpdateDuring
3172 CCallBackTimer* CCallBackTimer::NewL(const TCallBack& aCallBack, TInt aPriority)
3174 CCallBackTimer* self = new (ELeave) CCallBackTimer(aCallBack, aPriority);
3175 CleanupStack::PushL(self);
3177 CleanupStack::Pop();
3181 CCallBackTimer::CCallBackTimer(const TCallBack& aCallBack, TInt aPriority)
3182 : CTimer(aPriority), iCallBack(aCallBack)
3184 CActiveScheduler::Add(this);
3187 void CCallBackTimer::RunL()
3189 User::LeaveIfError(iCallBack.CallBack());
3192 RAsyncTestSubtitleUpdateDuring::RAsyncTestSubtitleUpdateDuring(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
3193 :RAsyncTestStepSubtitleBase(aTestName, aSectName, aKeyName, aControllerUid)
3195 SetExpectedCrpReadyCount(2);
3198 void RAsyncTestSubtitleUpdateDuring::KickoffTestL()
3200 TCallBack callBack(DuringPlaybackCallBack, this);
3201 iCallBackTimer = CCallBackTimer::NewL(callBack, CTimer::EPriorityStandard);
3202 iHasUpdated = EFalse;
3203 RAsyncTestStepSubtitleBase::KickoffTestL();
3206 void RAsyncTestSubtitleUpdateDuring::CloseTest()
3208 delete iCallBackTimer;
3209 iCallBackTimer = NULL;
3210 RAsyncTestStepSubtitleBase::CloseTest();
3213 TInt RAsyncTestSubtitleUpdateDuring::DuringPlaybackCallBack(TAny* aPtr)
3215 RAsyncTestSubtitleUpdateDuring* self = static_cast<RAsyncTestSubtitleUpdateDuring*>(aPtr);
3216 self->OnDuringPlayback();
3220 void RAsyncTestSubtitleUpdateDuring::OnOpenCompleteL()
3222 CheckAndEnableSubtitlesL();
3223 AddDefaultSubtitleConfL();
3225 // Start the call back timer. Will trigger the during playback handler.
3226 iCallBackTimer->After(2500000);
3231 void RAsyncTestSubtitleUpdateDuring::OnDuringPlayback()
3233 TMMFSubtitleWindowConfig config;
3234 config.iWindowId = KWindowIdValid;
3235 config.iDisplayMode = EColor16MA;
3236 config.iRotation = EVideoRotationClockwise90;
3237 config.iWindowClipRect = KWindowClipRectAlt1;
3238 TInt err = iSubtitleCommands.UpdateSubtitleConfig(config);
3240 if (err != KErrNone)
3242 ERR_PRINTF2(_L("UpdateSubtitleConfig during playback failed with %d"), err);
3243 StopTest(err, EFail);
3247 iHasUpdated = ETrue;
3251 void RAsyncTestSubtitleUpdateDuring::OnPlayCompleteL()
3253 RemoveConfigDisableL();
3257 ERR_PRINTF1(_L("Subtitle configuration was not updated during playback."));
3258 User::Leave(KErrGeneral);
3263 // RAsyncTestSubtitleRemoveAdd
3265 RAsyncTestSubtitleRemoveAdd::RAsyncTestSubtitleRemoveAdd(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
3266 :RAsyncTestStepSubtitleBase(aTestName, aSectName, aKeyName, aControllerUid)
3268 SetExpectedCrpReadyCount(2);
3271 void RAsyncTestSubtitleRemoveAdd::OnOpenCompleteL()
3273 CheckAndEnableSubtitlesL();
3274 AddDefaultSubtitleConfL();
3276 TInt err = iSubtitleCommands.RemoveSubtitleConfig(KWindowIdValid);
3278 if (err != KErrNone)
3280 ERR_PRINTF2(_L("RemoveSubtitleConfig failed with %d"), err);
3284 TMMFSubtitleWindowConfig config;
3285 config.iWindowId = KWindowIdValid;
3286 config.iDisplayMode = EColor16MA;
3287 config.iRotation = EVideoRotationClockwise270;
3288 config.iWindowClipRect = KWindowClipRectAlt2;
3289 err = iSubtitleCommands.AddSubtitleConfig(config);
3291 if (err != KErrNone)
3293 ERR_PRINTF2(_L("AddSubtitleConfig failed with %d"), err);
3300 void RAsyncTestSubtitleRemoveAdd::OnPlayCompleteL()
3302 RemoveConfigDisableL();
3306 // RAsyncTestSubtitleNotEnabled
3308 RAsyncTestSubtitleNotEnabled::RAsyncTestSubtitleNotEnabled(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
3309 :RAsyncTestStepSubtitleBase(aTestName, aSectName, aKeyName, aControllerUid)
3311 SetExpectedCrpReadyCount(0);
3314 void RAsyncTestSubtitleNotEnabled::OnOpenCompleteL()
3316 // Make sure that subtitles are available:
3317 TBool available = EFalse;
3318 TInt err = iSubtitleCommands.GetSubtitlesAvailable(available);
3320 if (err != KErrNone)
3322 ERR_PRINTF2(_L("GetSubtitlesAvailable failed with %d"), err);
3328 ERR_PRINTF1(_L("Subtitles unavailable"));
3329 User::Leave(KErrGeneral);
3332 // Perform severy subtitle related functions without enabling subtitles.
3333 TMMFSubtitleWindowConfig config;
3334 config.iWindowId = KWindowIdValid;
3335 config.iDisplayMode = EColor16MA;
3336 config.iRotation = EVideoRotationNone;
3337 config.iWindowClipRect = KWindowClipRectFull;
3339 err = iSubtitleCommands.AddSubtitleConfig(config);
3340 if (err != KErrNotReady)
3342 ERR_PRINTF3(_L("AddSubtitleConfig returned %d; expected %d"), err, KErrNotReady);
3343 User::Leave(err == KErrNone ? KErrGeneral : err);
3346 err = iSubtitleCommands.UpdateSubtitleConfig(config);
3347 if (err != KErrNotReady)
3349 ERR_PRINTF3(_L("UpdateSubtitleConfig returned %d; expected %d"), err, KErrNotReady);
3350 User::Leave(err == KErrNone ? KErrGeneral : err);
3353 RArray<TLanguage> languages;
3354 TRAP(err, iSubtitleCommands.GetSupportedSubtitleLanguagesL(languages));
3357 if (err != KErrNotReady)
3359 ERR_PRINTF3(_L("GetSupportedSubtitleLanguagesL left with %d; expected %d"), err, KErrNotReady);
3360 User::Leave(err == KErrNone ? KErrGeneral : err);
3363 TLanguage language = ELangNone;
3364 err = iSubtitleCommands.GetSubtitleLanguage(language);
3366 if (err != KErrNotReady)
3368 ERR_PRINTF3(_L("GetSubtitleLanguage returned %d; expected %d"), err, KErrNotReady);
3369 User::Leave(err == KErrNone ? KErrGeneral : err);
3372 err = iSubtitleCommands.SetSubtitleLanguage(ELangCanadianEnglish);
3374 if (err != KErrNotReady)
3376 ERR_PRINTF3(_L("SetSubtitleLanguage returned %d; expected %d"), err, KErrNotReady);
3377 User::Leave(err == KErrNone ? KErrGeneral : err);
3383 void RAsyncTestSubtitleNotEnabled::OnPlayCompleteL()
3385 TInt err = iSubtitleCommands.RemoveSubtitleConfig(KWindowIdValid);
3387 if (err != KErrNotReady)
3389 ERR_PRINTF3(_L("RemoveSubtitleConfig returned %d; expected %d"), err, KErrNotReady);
3390 User::Leave(err == KErrNone ? KErrGeneral : err);
3393 err = iSubtitleCommands.DisableSubtitles();
3395 if (err != KErrNone)
3397 ERR_PRINTF3(_L("DisableSubtitles returned %d; expected %d"), err, KErrNone);
3403 // RAsyncTestSubtitleNotAvailable
3405 RAsyncTestSubtitleNotAvailable::RAsyncTestSubtitleNotAvailable(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
3406 :RAsyncTestStepSubtitleBase(aTestName, aSectName, aKeyName, aControllerUid)
3408 SetExpectedCrpReadyCount(0);
3411 void RAsyncTestSubtitleNotAvailable::OnOpenCompleteL()
3413 // Make sure that subtitles are available:
3414 TBool available = EFalse;
3415 TInt err = iSubtitleCommands.GetSubtitlesAvailable(available);
3417 if (err != KErrNone)
3419 ERR_PRINTF2(_L("GetSubtitlesAvailable failed with %d"), err);
3425 ERR_PRINTF1(_L("Subtitles available, but should not be"));
3426 User::Leave(KErrGeneral);
3429 err = iSubtitleCommands.EnableSubtitles();
3431 if (err != KErrNotFound)
3433 ERR_PRINTF3(_L("EnableSubtitles returned %d; expected %d"), err, KErrNotFound);
3434 User::Leave(err == KErrNone ? KErrGeneral : err);
3437 // Perform severy subtitle related functions without enabling subtitles.
3438 TMMFSubtitleWindowConfig config;
3439 config.iWindowId = KWindowIdValid;
3440 config.iDisplayMode = EColor16MA;
3441 config.iRotation = EVideoRotationNone;
3442 config.iWindowClipRect = KWindowClipRectFull;
3444 err = iSubtitleCommands.AddSubtitleConfig(config);
3445 if (err != KErrNotReady)
3447 ERR_PRINTF3(_L("AddSubtitleConfig returned %d; expected %d"), err, KErrNotReady);
3448 User::Leave(err == KErrNone ? KErrGeneral : err);
3451 err = iSubtitleCommands.UpdateSubtitleConfig(config);
3452 if (err != KErrNotReady)
3454 ERR_PRINTF3(_L("UpdateSubtitleConfig returned %d; expected %d"), err, KErrNotReady);
3455 User::Leave(err == KErrNone ? KErrGeneral : err);
3458 RArray<TLanguage> languages;
3459 TRAP(err, iSubtitleCommands.GetSupportedSubtitleLanguagesL(languages));
3462 if (err != KErrNotReady)
3464 ERR_PRINTF3(_L("GetSupportedSubtitleLanguagesL left with %d; expected %d"), err, KErrNotReady);
3465 User::Leave(err == KErrNone ? KErrGeneral : err);
3468 TLanguage language = ELangNone;
3469 err = iSubtitleCommands.GetSubtitleLanguage(language);
3471 if (err != KErrNotReady)
3473 ERR_PRINTF3(_L("GetSubtitleLanguage returned %d; expected %d"), err, KErrNotReady);
3474 User::Leave(err == KErrNone ? KErrGeneral : err);
3477 err = iSubtitleCommands.SetSubtitleLanguage(ELangCanadianEnglish);
3479 if (err != KErrNotReady)
3481 ERR_PRINTF3(_L("SetSubtitleLanguage returned %d; expected %d"), err, KErrNotReady);
3482 User::Leave(err == KErrNone ? KErrGeneral : err);
3488 void RAsyncTestSubtitleNotAvailable::OnPlayCompleteL()
3490 TInt err = iSubtitleCommands.RemoveSubtitleConfig(KWindowIdValid);
3492 if (err != KErrNotReady)
3494 ERR_PRINTF3(_L("RemoveSubtitleConfig returned %d; expected %d"), err, KErrNotReady);
3495 User::Leave(err == KErrNone ? KErrGeneral : err);
3498 err = iSubtitleCommands.DisableSubtitles();
3500 if (err != KErrNone)
3502 ERR_PRINTF3(_L("DisableSubtitles returned %d; expected %d"), err, KErrNone);
3508 // RAsyncTestSubtitleMismatchedId
3510 RAsyncTestSubtitleMismatchedId::RAsyncTestSubtitleMismatchedId(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
3511 :RAsyncTestStepSubtitleBase(aTestName, aSectName, aKeyName, aControllerUid)
3513 SetExpectedCrpReadyCount(1);
3516 void RAsyncTestSubtitleMismatchedId::OnOpenCompleteL()
3518 CheckAndEnableSubtitlesL();
3519 AddDefaultSubtitleConfL();
3521 TMMFSubtitleWindowConfig config;
3522 config.iWindowId = KWindowIdMismatched;
3523 config.iDisplayMode = EColor16MA;
3524 config.iRotation = EVideoRotationClockwise90;
3525 config.iWindowClipRect = KWindowClipRectAlt1;
3527 TInt err = iSubtitleCommands.UpdateSubtitleConfig(config);
3528 if (err != KErrNotFound)
3530 ERR_PRINTF3(_L("UpdateSubtitleConfig returned %d; expected %d"), err, KErrNotFound);
3531 User::Leave(err == KErrNone ? KErrGeneral : err);
3534 err = iSubtitleCommands.RemoveSubtitleConfig(KWindowIdMismatched);
3535 if (err != KErrNotFound)
3537 ERR_PRINTF3(_L("RemoveSubtitleConfig returned %d; expected %d"), err, KErrNotFound);
3538 User::Leave(err == KErrNone ? KErrGeneral : err);
3541 TWsGraphicId id(TWsGraphicId::EUninitialized);
3543 err = iSubtitleCommands.GetCrpParameters(KWindowIdMismatched, id, rect);
3544 if (err != KErrNotFound)
3546 ERR_PRINTF3(_L("GetCrpParameters returned %d; expected %d"), err, KErrNotFound);
3547 User::Leave(err == KErrNone ? KErrGeneral : err);
3550 // If we haven't left yet then the test passes.
3555 // RAsyncTestSubtitleDoubleCall
3557 RAsyncTestSubtitleDoubleCall::RAsyncTestSubtitleDoubleCall(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
3558 :RAsyncTestStepSubtitleBase(aTestName, aSectName, aKeyName, aControllerUid)
3560 SetExpectedCrpReadyCount(1);
3563 void RAsyncTestSubtitleDoubleCall::OnOpenCompleteL()
3565 TBool available = EFalse;
3567 TInt err = iSubtitleCommands.GetSubtitlesAvailable(available);
3569 if (err != KErrNone)
3571 ERR_PRINTF2(_L("GetSubtitlesAvailable failed with %d"), err);
3577 ERR_PRINTF1(_L("Subtitles unavailable"));
3578 User::Leave(KErrGeneral);
3581 // Disable subtitles when they are not enabled.
3582 err = iSubtitleCommands.DisableSubtitles();
3583 if (err != KErrNone)
3585 ERR_PRINTF2(_L("DisableSubtitles failed with %d"), err);
3589 err = iSubtitleCommands.EnableSubtitles();
3590 if (err != KErrNone)
3592 ERR_PRINTF2(_L("EnableSubtitles failed with %d"), err);
3596 // Enable subtitles when they are already enabled.
3597 err = iSubtitleCommands.EnableSubtitles();
3598 if (err != KErrInUse)
3600 ERR_PRINTF3(_L("EnableSubtitles failed with %d; expecting %d when already enabled."), err, KErrInUse);
3601 User::Leave(err == KErrNone ? KErrGeneral : err);
3604 AddDefaultSubtitleConfL();
3608 void RAsyncTestSubtitleDoubleCall::OnPlayCompleteL()
3610 RemoveConfigDisableL();
3612 // Disable subtitles when they are not enabled.
3613 TInt err = iSubtitleCommands.DisableSubtitles();
3614 if (err != KErrNone)
3616 ERR_PRINTF2(_L("DisableSubtitles failed with %d"), err);
3622 // RAsyncTestSubtitleMultipleConfigs
3624 RAsyncTestSubtitleMultipleConfigs::RAsyncTestSubtitleMultipleConfigs(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
3625 :RAsyncTestStepSubtitleBase(aTestName, aSectName, aKeyName, aControllerUid)
3627 SetExpectedCrpReadyCount(1);
3630 void RAsyncTestSubtitleMultipleConfigs::OnOpenCompleteL()
3632 CheckAndEnableSubtitlesL();
3633 AddDefaultSubtitleConfL();
3635 TMMFSubtitleWindowConfig config;
3636 config.iWindowId = KWindowIdValid;
3637 config.iDisplayMode = EColor16MA;
3638 config.iRotation = EVideoRotationClockwise90;
3639 config.iWindowClipRect = KWindowClipRectAlt1;
3641 // Add a config with the same window ID.
3642 TInt err = iSubtitleCommands.AddSubtitleConfig(config);
3643 if (err != KErrArgument)
3645 ERR_PRINTF3(_L("AddSubtitleConfig returned %d; expected %d"), err, KErrArgument);
3646 User::Leave(err == KErrNone ? KErrGeneral : err);
3649 // Add a config with a different ID.
3650 config.iWindowId = KWindowIdValidAlt;
3651 err = iSubtitleCommands.AddSubtitleConfig(config);
3652 if (err != KErrInUse)
3654 ERR_PRINTF3(_L("AddSubtitleConfig returned %d; expected %d"), err, KErrInUse);
3655 User::Leave(err == KErrNone ? KErrGeneral : err);
3658 // If we haven't left yet then the test passes.
3662 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT