First public contribution.
1 // Copyright (c) 2007-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.
16 #ifdef SYMBIAN_BUILD_GCE
17 #include <mmf/common/mmfvideosurfacecustomcommands.h>
18 #include <mmf/devvideo/devvideoclientbuffersupport.h>
19 #include "videoframebuffer.h"
20 #endif // SYMBIAN_BUILD_GCE
22 #include "testdevvideociuplay.h"
23 #include "testdevvideociuplugins/ciudecoder.h"
24 #include "testdevvideociuplugins/ciupostproc.h"
25 #include "testdevvideociuplugins/ciudevvideotestinterface.h"
27 // DevVideoCiu base class
29 CTestDevVideoCiuPlayStep::CTestDevVideoCiuPlayStep(const TDesC& aTestName)
31 // store the name of this test case
32 // this is the name that is used by the script file
33 // Each test step initialises it's own name
34 iTestStepName = aTestName;
37 CTestDevVideoCiuPlayStep::~CTestDevVideoCiuPlayStep()
41 TVerdict CTestDevVideoCiuPlayStep::DoTestStepPreambleL()
43 TVerdict ret = CTestDevVideoCiuStep::DoTestStepPreambleL();
46 TRAPD(err, iDevVideoPlay = CMMFDevVideoPlay::NewL( *this ));
49 ERR_PRINTF1(_L("Could not create a CMMFDevVideoPlay!"));
55 TVerdict CTestDevVideoCiuPlayStep::DoTestStepPostambleL()
63 TVerdict CTestDevVideoCiuPlayStep::DoTestStepL()
67 iDevVideoPlay->Initialize();
69 if (iError == KErrNone)
71 INFO_PRINTF1(_L("DevVideo Play initialisation was successful."));
79 ERR_PRINTF1(_L("Failed to initialise the DevVideo Play"));
85 // MMMFDevVideoCiuObserver
86 void CTestDevVideoCiuPlayStep::MdvpoNewBuffers()
88 INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoNewBuffers()"));
91 void CTestDevVideoCiuPlayStep::MdvpoReturnPicture(TVideoPicture* /*aPicture*/)
93 INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoReturnPicture()"));
96 void CTestDevVideoCiuPlayStep::MdvpoSupplementalInformation(const TDesC8& /*aData*/,
97 const TTimeIntervalMicroSeconds& /*aTimestamp*/,
98 const TPictureId& /*aPictureId*/)
100 INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoSupplementalInformation()"));
103 void CTestDevVideoCiuPlayStep::MdvpoPictureLoss()
105 INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoPictureLoss()"));
108 void CTestDevVideoCiuPlayStep::MdvpoPictureLoss(const TArray<TPictureId>& /*aPictures*/)
110 INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoPictureLoss(TArray)"));
113 void CTestDevVideoCiuPlayStep::MdvpoSliceLoss(TUint /*aFirstMacroblock*/, TUint /*aNumMacroblocks*/, const TPictureId& /*aPicture*/)
115 INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoSliceLoss()"));
118 void CTestDevVideoCiuPlayStep::MdvpoReferencePictureSelection(const TDesC8& /*aSelectionData*/)
120 INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoReferencePictureSelection()"));
123 void CTestDevVideoCiuPlayStep::MdvpoTimedSnapshotComplete(TInt /*aError*/,
124 TPictureData* /*aPictureData*/,
125 const TTimeIntervalMicroSeconds& /*aPresentationTimestamp*/,
126 const TPictureId& /*aPictureId*/)
128 INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoTimedSnapshotComplete()"));
131 void CTestDevVideoCiuPlayStep::MdvpoNewPictures()
133 INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoNewPictures()"));
136 void CTestDevVideoCiuPlayStep::MdvpoFatalError(TInt aError)
139 INFO_PRINTF2(_L("CTestDevVideoCiuPlayStep::MdvpoFatalError(): Error = %d"), aError);
142 void CTestDevVideoCiuPlayStep::MdvpoInitComplete(TInt aError)
145 INFO_PRINTF2(_L("CTestDevVideoCiuPlayStep::MdvpoInitComplete(): Error = %d"), aError);
148 void CTestDevVideoCiuPlayStep::MdvpoStreamEnd()
150 INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoStreamEnd()"));
154 // Video Window Control Tests
156 CTestDevVideoCiuPlayGetAndSetLogicalWindow::CTestDevVideoCiuPlayGetAndSetLogicalWindow(const TDesC& aTestName)
157 :CTestDevVideoCiuPlayStep(aTestName)
161 CTestDevVideoCiuPlayGetAndSetLogicalWindow* CTestDevVideoCiuPlayGetAndSetLogicalWindow::NewL(const TDesC& aTestName)
163 CTestDevVideoCiuPlayGetAndSetLogicalWindow* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetLogicalWindow(aTestName);
167 TVerdict CTestDevVideoCiuPlayGetAndSetLogicalWindow::DoTestStepPreambleL()
169 // Call the base class first
170 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
174 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
179 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
185 TVerdict CTestDevVideoCiuPlayGetAndSetLogicalWindow::DoTestL()
187 TVerdict ret = EFail;
189 INFO_PRINTF1(_L("DevVideo CIU Window Control Interface Initialisation"));
192 MMmfVideoWindowControl* interface = NULL;
194 interface = static_cast<MMmfVideoWindowControl*>
195 (iDevVideoPlay->CustomInterface(iHwDeviceId,
196 KUidMmfVideoWindowControl));
199 ERR_PRINTF1(_L("Error - no interface retrieved"));
204 INFO_PRINTF1(_L("DevVideo CIU Window Control Interface Instantiated"));
206 TRect logicalWindow(TPoint(0,0), TPoint(300,300));
208 interface->MmvwcSetLogicalVideoWindow(logicalWindow);
210 MDevVideoCiuTestInterfaceVideoWindowControl* testInterface = NULL;
212 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoWindowControl*>
213 (iDevVideoPlay->CustomInterface(iHwDeviceId, KUidDevVideoCiuTestInterfaceVideoWindowControl));
216 TRect logicalWindowResult = testInterface->MmvwcLogicalVideoWindow();
217 if (logicalWindow == logicalWindowResult)
220 INFO_PRINTF1(_L("Set Logical Window method call performed as expected"));
225 ERR_PRINTF1(_L("Set Logical Window method call failed to set the value correctly"));
230 ERR_PRINTF1(_L("Error - no test interface retrieved"));
237 //------------------------------------------------------------------
239 CTestDevVideoCiuPlayGetAndSetContentOffset::CTestDevVideoCiuPlayGetAndSetContentOffset(const TDesC& aTestName)
240 :CTestDevVideoCiuPlayStep(aTestName)
244 CTestDevVideoCiuPlayGetAndSetContentOffset* CTestDevVideoCiuPlayGetAndSetContentOffset::NewL(const TDesC& aTestName)
246 CTestDevVideoCiuPlayGetAndSetContentOffset* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetContentOffset(aTestName);
250 TVerdict CTestDevVideoCiuPlayGetAndSetContentOffset::DoTestStepPreambleL()
252 // Call the base class first
253 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
257 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
262 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
268 TVerdict CTestDevVideoCiuPlayGetAndSetContentOffset::DoTestL()
270 TVerdict ret = EFail;
272 INFO_PRINTF1(_L("DevVideo CIU Window Control Interface Initialisation"));
275 MMmfVideoWindowControl* interface = NULL;
277 interface = static_cast<MMmfVideoWindowControl*>
278 (iDevVideoPlay->CustomInterface(iHwDeviceId,
279 KUidMmfVideoWindowControl));
282 ERR_PRINTF1(_L("Error - no interface retrieved"));
287 INFO_PRINTF1(_L("DevVideo CIU Window Control Interface Instantiated"));
289 TPoint contentOffsetInput(100, 100);
291 interface->MmvwcSetContentOffsetL(contentOffsetInput);
293 MDevVideoCiuTestInterfaceVideoWindowControl* testInterface = NULL;
295 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoWindowControl*>
296 (iDevVideoPlay->CustomInterface(iHwDeviceId, KUidDevVideoCiuTestInterfaceVideoWindowControl));
299 TPoint contentOffsetOutput = testInterface->MmvwcContentOffset();
300 if (contentOffsetInput == contentOffsetOutput)
303 INFO_PRINTF1(_L("Set Content Offset method call performed as expected"));
308 ERR_PRINTF1(_L("Set Content Offset method call failed to set the value correctly"));
313 ERR_PRINTF1(_L("Error - no test interface retrieved"));
320 //------------------------------------------------------------------
322 CTestDevVideoCiuPlayGetAndSetContentAlignment::CTestDevVideoCiuPlayGetAndSetContentAlignment(const TDesC& aTestName)
323 :CTestDevVideoCiuPlayStep(aTestName)
327 CTestDevVideoCiuPlayGetAndSetContentAlignment* CTestDevVideoCiuPlayGetAndSetContentAlignment::NewL(const TDesC& aTestName)
329 CTestDevVideoCiuPlayGetAndSetContentAlignment* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetContentAlignment(aTestName);
333 TVerdict CTestDevVideoCiuPlayGetAndSetContentAlignment::DoTestStepPreambleL()
335 // Call the base class first
336 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
340 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
345 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
351 TVerdict CTestDevVideoCiuPlayGetAndSetContentAlignment::DoTestL()
353 TVerdict ret = EFail;
355 INFO_PRINTF1(_L("DevVideo CIU Window Control Interface Initialisation"));
358 MMmfVideoWindowControl* interface = NULL;
360 interface = static_cast<MMmfVideoWindowControl*>
361 (iDevVideoPlay->CustomInterface(iHwDeviceId,
362 KUidMmfVideoWindowControl));
365 ERR_PRINTF1(_L("Error - no interface retrieved"));
370 INFO_PRINTF1(_L("DevVideo CIU Window Control Interface Instantiated"));
372 MDevVideoCiuTestInterfaceVideoWindowControl::TAlignment alignmentInput = {MMmfVideoWindowControl::EHorizAlignCenter, MMmfVideoWindowControl::EVertAlignTop};
374 interface->MmvwcSetContentAlignment(alignmentInput.iHorizAlign,alignmentInput.iVertAlign);
376 MDevVideoCiuTestInterfaceVideoWindowControl* testInterface = NULL;
378 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoWindowControl*>
379 (iDevVideoPlay->CustomInterface(iHwDeviceId, KUidDevVideoCiuTestInterfaceVideoWindowControl));
382 MDevVideoCiuTestInterfaceVideoWindowControl::TAlignment alignmentOutput = testInterface->MmvwcContentAlignment();
383 if ((alignmentInput.iHorizAlign == alignmentOutput.iHorizAlign) && (alignmentInput.iVertAlign == alignmentOutput.iVertAlign) )
386 INFO_PRINTF1(_L("Set Content Alignment method call performed as expected"));
391 ERR_PRINTF1(_L("Set Content Alignment method call failed to set the value correctly"));
396 ERR_PRINTF1(_L("Error - no test interface retrieved"));
403 //------------------------------------------------------------------
406 // Video Resource Management Tests
409 CTestDevVideoCiuPlayGetAndSetResourceObserver::CTestDevVideoCiuPlayGetAndSetResourceObserver(const TDesC& aTestName)
410 :CTestDevVideoCiuPlayStep(aTestName)
414 CTestDevVideoCiuPlayGetAndSetResourceObserver* CTestDevVideoCiuPlayGetAndSetResourceObserver::NewL(const TDesC& aTestName)
416 CTestDevVideoCiuPlayGetAndSetResourceObserver* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetResourceObserver(aTestName);
420 TVerdict CTestDevVideoCiuPlayGetAndSetResourceObserver::DoTestStepPreambleL()
422 // Call the base class first
423 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
427 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
432 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
438 TVerdict CTestDevVideoCiuPlayGetAndSetResourceObserver::DoTestL()
440 TVerdict ret = EFail;
442 INFO_PRINTF1(_L("DevVideo CIU Resource Management Interface Initialisation"));
445 MMmfVideoResourceHandler* interface = NULL;
447 interface = static_cast<MMmfVideoResourceHandler*>
448 (iDevVideoPlay->CustomInterface(iHwDeviceId,
449 KUidMmfVideoResourceManagement));
452 ERR_PRINTF1(_L("Error - no interface retrieved"));
457 INFO_PRINTF1(_L("DevVideo CIU Resource Management Interface Instantiated"));
459 MMmfVideoResourceObserver* obs = this;
460 interface->MmvrhSetObserver(obs);
461 INFO_PRINTF1(_L("SetObserver called"));
463 // Verify that the observer was set
464 MDevVideoCiuTestInterfaceResourceManagement* testInterface = NULL;
465 testInterface = static_cast<MDevVideoCiuTestInterfaceResourceManagement*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
466 KUidDevVideoCiuTestInterfaceResourceManagement));
469 ERR_PRINTF1(_L("Failed to create the test interface."));
474 if (obs != testInterface->MdvrmObserver())
476 ERR_PRINTF1(_L("Failed to set the observer."));
481 INFO_PRINTF1(_L("SetObserver successfully called"));
489 //from MMmfVideoResourceObserver
490 void CTestDevVideoCiuPlayGetAndSetResourceObserver::MmvroResourcesLost(TUid /*aMediaDevice*/)
493 void CTestDevVideoCiuPlayGetAndSetResourceObserver::MmvroResourcesRestored(TUid /*aMediaDevice*/)
496 //------------------------------------------------------------------
498 CTestDevVideoCiuPlayResourceLost::CTestDevVideoCiuPlayResourceLost(const TDesC& aTestName)
499 :CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
503 CTestDevVideoCiuPlayResourceLost* CTestDevVideoCiuPlayResourceLost::NewL(const TDesC& aTestName)
505 CTestDevVideoCiuPlayResourceLost* self = new(ELeave) CTestDevVideoCiuPlayResourceLost(aTestName);
509 TVerdict CTestDevVideoCiuPlayResourceLost::DoTestStepPreambleL()
511 // Call the base class first
512 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
516 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
521 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
527 TVerdict CTestDevVideoCiuPlayResourceLost::DoTestL()
529 TVerdict ret = EFail;
531 INFO_PRINTF1(_L("DevVideo CIU Resource Management Interface Initialisation"));
534 MMmfVideoResourceHandler* interface = NULL;
536 interface = static_cast<MMmfVideoResourceHandler*>
537 (iDevVideoPlay->CustomInterface(iHwDeviceId,
538 KUidMmfVideoResourceManagement));
541 ERR_PRINTF1(_L("Error - no interface retrieved"));
546 INFO_PRINTF1(_L("DevVideo CIU Resource Management Interface Instantiated"));
548 MDevVideoCiuTestInterfaceResourceManagement* testInterface = NULL;
549 testInterface = static_cast<MDevVideoCiuTestInterfaceResourceManagement*>(iDevVideoPlay->
550 CustomInterface(iHwDeviceId,
551 KUidDevVideoCiuTestInterfaceResourceManagement));
554 ERR_PRINTF1(_L("Failed to create the test interface."));
559 // Set the observer to callback!
560 MMmfVideoResourceObserver* obs = this;
561 interface->MmvrhSetObserver(obs);
563 INFO_PRINTF1(_L("Requesting the Resource Lost Callback..."));
564 testInterface->MdvrmRequestResourceLostCallback();
566 if ((iError != KErrNone) || (!iCallbackReceived))
568 ERR_PRINTF1(_L("Error receiving the Resource Lost Callback."));
573 INFO_PRINTF1(_L("Successfully retrieved the Resource Lost Callback"));
581 //from MMmfVideoResourceObserver
582 void CTestDevVideoCiuPlayResourceLost::MmvroResourcesLost(TUid /*aMediaDevice*/)
584 INFO_PRINTF1(_L("Resource Lost callback received."));
585 iCallbackReceived = ETrue;
589 void CTestDevVideoCiuPlayResourceLost::MmvroResourcesRestored(TUid /*aMediaDevice*/)
591 iError = KErrNotSupported;
594 //------------------------------------------------------------------
596 CTestDevVideoCiuPlayResourceRestored::CTestDevVideoCiuPlayResourceRestored(const TDesC& aTestName)
597 :CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
601 CTestDevVideoCiuPlayResourceRestored* CTestDevVideoCiuPlayResourceRestored::NewL(const TDesC& aTestName)
603 CTestDevVideoCiuPlayResourceRestored* self = new(ELeave) CTestDevVideoCiuPlayResourceRestored(aTestName);
607 TVerdict CTestDevVideoCiuPlayResourceRestored::DoTestStepPreambleL()
609 // Call the base class first
610 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
614 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
619 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
625 TVerdict CTestDevVideoCiuPlayResourceRestored::DoTestL()
627 TVerdict ret = EFail;
629 INFO_PRINTF1(_L("DevVideo CIU Resource Management Interface Initialisation"));
632 MMmfVideoResourceHandler* interface = NULL;
634 interface = static_cast<MMmfVideoResourceHandler*>
635 (iDevVideoPlay->CustomInterface(iHwDeviceId,
636 KUidMmfVideoResourceManagement));
639 ERR_PRINTF1(_L("Error - no interface retrieved"));
644 INFO_PRINTF1(_L("DevVideo CIU Resource Management Interface Instantiated"));
646 MDevVideoCiuTestInterfaceResourceManagement* testInterface = NULL;
647 testInterface = static_cast<MDevVideoCiuTestInterfaceResourceManagement*>(iDevVideoPlay->
648 CustomInterface(iHwDeviceId,
649 KUidDevVideoCiuTestInterfaceResourceManagement));
652 ERR_PRINTF1(_L("Failed to create the test interface."));
657 // Set the observer to callback!
658 MMmfVideoResourceObserver* obs = this;
659 interface->MmvrhSetObserver(obs);
661 INFO_PRINTF1(_L("Requesting the Resource Restored Callback..."));
662 testInterface->MdvrmRequestResourceRestoredCallback();
664 if ((iError != KErrNone) || (!iCallbackReceived))
666 ERR_PRINTF1(_L("Error receiving the Resource Restored Callback."));
671 INFO_PRINTF1(_L("Successfully retrieved the Resource Restored Callback"));
679 //from MMmfVideoResourceObserver
680 void CTestDevVideoCiuPlayResourceRestored::MmvroResourcesLost(TUid /*aMediaDevice*/)
682 iError = KErrNotSupported;
685 void CTestDevVideoCiuPlayResourceRestored::MmvroResourcesRestored(TUid /*aMediaDevice*/)
687 INFO_PRINTF1(_L("Resource Restored callback received."));
688 iCallbackReceived = ETrue;
692 //------------------------------------------------------------------
694 CTestDevVideoCiuPlayGetAndSetResourcePriority::CTestDevVideoCiuPlayGetAndSetResourcePriority(const TDesC& aTestName)
695 :CTestDevVideoCiuPlayStep(aTestName)
699 CTestDevVideoCiuPlayGetAndSetResourcePriority* CTestDevVideoCiuPlayGetAndSetResourcePriority::NewL(const TDesC& aTestName)
701 CTestDevVideoCiuPlayGetAndSetResourcePriority* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetResourcePriority(aTestName);
705 TVerdict CTestDevVideoCiuPlayGetAndSetResourcePriority::DoTestStepPreambleL()
707 // Call the base class first
708 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
712 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
717 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
723 TVerdict CTestDevVideoCiuPlayGetAndSetResourcePriority::DoTestL()
725 TVerdict ret = EFail;
727 INFO_PRINTF1(_L("DevVideo CIU Resource Priority Interface Initialisation"));
730 MMmfVideoResourcePriority* interface = NULL;
732 interface = static_cast<MMmfVideoResourcePriority*>
733 (iDevVideoPlay->CustomInterface(iHwDeviceId,
734 KUidMmfVideoResourcePriority));
737 ERR_PRINTF1(_L("Error - no interface retrieved"));
742 INFO_PRINTF1(_L("DevVideo CIU Resource Priority Interface Instantiated"));
744 TInt inputPriority = 100;
746 interface->MmvpSetResourcePriority(inputPriority);
748 MDevVideoCiuTestInterfaceResourcePriority* testInterface = NULL;
750 testInterface = static_cast<MDevVideoCiuTestInterfaceResourcePriority*>
751 (iDevVideoPlay->CustomInterface(iHwDeviceId, KUidDevVideoCiuTestInterfaceResourcePriority));
754 TInt outputPriority = testInterface->MdvrpResourcePriority();
755 if (inputPriority == outputPriority)
758 INFO_PRINTF1(_L("Set Resource Priority method call performed as expected"));
763 ERR_PRINTF1(_L("Set Resource Priority method call failed to set the value correctly"));
768 ERR_PRINTF1(_L("Error - no test interface retrieved"));
777 // Video Properties Management Tests
780 CTestDevVideoCiuPlaySetAndGetPropertiesObserver::CTestDevVideoCiuPlaySetAndGetPropertiesObserver(const TDesC& aTestName)
781 :CTestDevVideoCiuPlayStep(aTestName)
785 CTestDevVideoCiuPlaySetAndGetPropertiesObserver* CTestDevVideoCiuPlaySetAndGetPropertiesObserver::NewL(const TDesC& aTestName)
787 CTestDevVideoCiuPlaySetAndGetPropertiesObserver* self = new(ELeave) CTestDevVideoCiuPlaySetAndGetPropertiesObserver(aTestName);
791 TVerdict CTestDevVideoCiuPlaySetAndGetPropertiesObserver::DoTestStepPreambleL()
793 // Call the base class first
794 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
798 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
803 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
809 TVerdict CTestDevVideoCiuPlaySetAndGetPropertiesObserver::DoTestL()
811 TVerdict ret = EFail;
813 INFO_PRINTF1(_L("DevVideo CIU Properties Management Interface Initialisation"));
816 MMmfVideoPropertiesNotifier* interface = NULL;
818 interface = static_cast<MMmfVideoPropertiesNotifier*>
819 (iDevVideoPlay->CustomInterface(iHwDeviceId,
820 KUidMmfVideoPropertiesManagement));
823 ERR_PRINTF1(_L("Error - no interface retrieved"));
828 INFO_PRINTF1(_L("DevVideo CIU Properties Management Interface Instantiated"));
830 MMmfVideoPropertiesObserver* obs = this;
831 interface->MmvpnSetObserver(obs);
832 INFO_PRINTF1(_L("SetObserver called"));
834 // Verify that the observer was set
835 MDevVideoCiuTestInterfacePropertiesManagement* testInterface = NULL;
836 testInterface = static_cast<MDevVideoCiuTestInterfacePropertiesManagement*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
837 KUidDevVideoCiuTestInterfacePropertiesManagement));
840 ERR_PRINTF1(_L("Failed to create the test interface."));
845 if (obs != testInterface->MmvpoObserver())
847 ERR_PRINTF1(_L("Failed to set the observer."));
852 INFO_PRINTF1(_L("SetObserver successfully called."));
860 //from MMmfVideoPropertiesObserver
861 void CTestDevVideoCiuPlaySetAndGetPropertiesObserver::MmvpoUpdateVideoProperties(const TYuvFormat& /*aYuvFormat*/, const TSize& /*aPictureSize*/)
864 //------------------------------------------------------------------
865 CTestDevVideoCiuPlayUpdateProperties::CTestDevVideoCiuPlayUpdateProperties(const TDesC& aTestName)
866 :CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
870 CTestDevVideoCiuPlayUpdateProperties* CTestDevVideoCiuPlayUpdateProperties::NewL(const TDesC& aTestName)
872 CTestDevVideoCiuPlayUpdateProperties* self = new(ELeave) CTestDevVideoCiuPlayUpdateProperties(aTestName);
876 TVerdict CTestDevVideoCiuPlayUpdateProperties::DoTestStepPreambleL()
878 // Call the base class first
879 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
883 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
888 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
894 TVerdict CTestDevVideoCiuPlayUpdateProperties::DoTestL()
896 TVerdict ret = EFail;
898 INFO_PRINTF1(_L("DevVideo CIU Properties Management Interface Initialisation"));
901 MMmfVideoPropertiesNotifier* interface = NULL;
903 interface = static_cast<MMmfVideoPropertiesNotifier*>
904 (iDevVideoPlay->CustomInterface(iHwDeviceId,
905 KUidMmfVideoPropertiesManagement));
908 ERR_PRINTF1(_L("Error - no interface retrieved"));
913 INFO_PRINTF1(_L("DevVideo CIU Properties Management Interface Instantiated"));
915 MDevVideoCiuTestInterfacePropertiesManagement* testInterface = NULL;
916 testInterface = static_cast<MDevVideoCiuTestInterfacePropertiesManagement*>(iDevVideoPlay->
917 CustomInterface(iHwDeviceId,
918 KUidDevVideoCiuTestInterfacePropertiesManagement));
921 ERR_PRINTF1(_L("Failed to create the test interface."));
926 // Set the observer to callback!
927 MMmfVideoPropertiesObserver* obs = this;
928 interface->MmvpnSetObserver(obs);
930 INFO_PRINTF1(_L("Notifying the Properties Update Callback..."));
931 testInterface->MmvpoUpdateVideoPropertiesCallback();
933 if ((iError != KErrNone) || (!iCallbackReceived))
935 ERR_PRINTF1(_L("Error receiving the RProperties Update Callback."));
940 INFO_PRINTF1(_L("Successfully retrieved the Properties Update Callback"));
948 //from MMmfVideoPropertiesObserver
949 void CTestDevVideoCiuPlayUpdateProperties::MmvpoUpdateVideoProperties(const TYuvFormat& /*aYuvFormat*/, const TSize& /*aPictureSize*/)
951 INFO_PRINTF1(_L("Properties Update Callback received."));
952 iCallbackReceived = ETrue;
956 //------------------------------------------------------------------
958 CTestDevVideoCiuPlayCreateVideoMediaProtected::CTestDevVideoCiuPlayCreateVideoMediaProtected(const TDesC& aTestName)
959 :CTestDevVideoCiuPlayStep(aTestName)
963 CTestDevVideoCiuPlayCreateVideoMediaProtected* CTestDevVideoCiuPlayCreateVideoMediaProtected::NewL(const TDesC& aTestName)
965 CTestDevVideoCiuPlayCreateVideoMediaProtected* self = new(ELeave) CTestDevVideoCiuPlayCreateVideoMediaProtected(aTestName);
969 TVerdict CTestDevVideoCiuPlayCreateVideoMediaProtected::DoTestStepPreambleL()
971 // Call the base class first
972 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
976 // select post-processor
977 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectPostProcessorL(KUidDevVideoCiuTestPostProcHwDevice));
982 ERR_PRINTF1(_L("DevVideo Play Failed to select the post processor."));
989 TVerdict CTestDevVideoCiuPlayCreateVideoMediaProtected::DoTestL()
991 TVerdict ret = EPass;
993 INFO_PRINTF1(_L("DevVideo CIU Video Media Protected Initialisation"));
995 // Try to fetch the CI...
996 MMmfVideoMediaProtected* interface = NULL;
998 interface = static_cast<MMmfVideoMediaProtected*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
999 KUidMmfVideoMediaProtected));
1002 ERR_PRINTF1(_L("Error - no interface retrieved"));
1007 INFO_PRINTF1(_L("DevVideo CIU Video Media Protected instantiated"));
1012 //------------------------------------------------------------------
1014 //------------------------------------------------------------------
1016 CTestDevVideoCiuPlaySetVideoMediaProtected::CTestDevVideoCiuPlaySetVideoMediaProtected(const TDesC& aTestName)
1017 :CTestDevVideoCiuPlayStep(aTestName)
1021 CTestDevVideoCiuPlaySetVideoMediaProtected* CTestDevVideoCiuPlaySetVideoMediaProtected::NewL(const TDesC& aTestName)
1023 CTestDevVideoCiuPlaySetVideoMediaProtected* self = new(ELeave) CTestDevVideoCiuPlaySetVideoMediaProtected(aTestName);
1027 TVerdict CTestDevVideoCiuPlaySetVideoMediaProtected::DoTestStepPreambleL()
1029 // Call the base class first
1030 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
1034 // select post-processor
1035 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectPostProcessorL(KUidDevVideoCiuTestPostProcHwDevice));
1037 if (err != KErrNone)
1039 ret = EInconclusive;
1040 ERR_PRINTF1(_L("DevVideo Play Failed to select the post processor."));
1047 // alternate implementation that uses the test interface to check
1048 // that the value has been set
1049 TVerdict CTestDevVideoCiuPlaySetVideoMediaProtected::DoTestL()
1051 TVerdict ret = EFail;
1053 // Got this far so must have successfully initialised DevVideoPlay
1054 // Try to fetch the CI...
1055 MMmfVideoMediaProtected* interface = NULL;
1057 interface = static_cast<MMmfVideoMediaProtected*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
1058 KUidMmfVideoMediaProtected));
1061 ERR_PRINTF1(_L("Error - no interface retrieved"));
1062 ret = EInconclusive;
1066 // Try to call a method on the interface
1067 TRAPD(err, interface->MmvsoMediaIsProtectedL(ETrue));
1068 // Method should have left as not supported
1069 if (err != KErrNotSupported)
1071 ERR_PRINTF2(_L("Error - wrong leave code from method call"), err);
1075 // Now set up the test interface...
1076 MDevVideoCiuTestInterfaceMediaProtected* testInterface = NULL;
1077 testInterface = static_cast<MDevVideoCiuTestInterfaceMediaProtected*>
1078 (iDevVideoPlay->CustomInterface(iHwDeviceId, KUidDevVideoCiuTestInterfaceMediaProtected));
1081 if (testInterface->MmvsoMediaIsProtected())
1084 INFO_PRINTF1(_L("Media protected method call performed as expected"));
1088 ERR_PRINTF1(_L("Media protected method call failed to set the value correctly"));
1093 ERR_PRINTF1(_L("Error - no test interface retrieved"));
1094 ret = EInconclusive;
1101 //------------------------------------------------------------------
1104 //------------------------------------------------------------------
1106 CTestDevVideoCiuPlayCreateColourSpace::CTestDevVideoCiuPlayCreateColourSpace(const TDesC& aTestName)
1107 :CTestDevVideoCiuPlayStep(aTestName)
1111 CTestDevVideoCiuPlayCreateColourSpace* CTestDevVideoCiuPlayCreateColourSpace::NewL(const TDesC& aTestName)
1113 CTestDevVideoCiuPlayCreateColourSpace* self = new(ELeave) CTestDevVideoCiuPlayCreateColourSpace(aTestName);
1117 TVerdict CTestDevVideoCiuPlayCreateColourSpace::DoTestStepPreambleL()
1119 // Call the base class first
1120 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
1124 // select post-processor
1125 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectPostProcessorL(KUidDevVideoCiuTestPostProcHwDevice));
1127 if (err != KErrNone)
1129 ret = EInconclusive;
1130 ERR_PRINTF1(_L("DevVideo Play Failed to select the post processor."));
1137 TVerdict CTestDevVideoCiuPlayCreateColourSpace::DoTestL()
1139 TVerdict ret = EPass;
1141 INFO_PRINTF1(_L("DevVideo CIU Colour Space Header Interface Initialisation"));
1143 // Try to fetch the CI...
1144 MMmfVideoPlayHWDeviceColourInfoCustomHeader* interface = NULL;
1146 interface = static_cast<MMmfVideoPlayHWDeviceColourInfoCustomHeader*>
1147 (iDevVideoPlay->CustomInterface(iHwDeviceId,
1148 KUidMmfVideoPlayHWDeviceColourInfoCustomHeader));
1151 ERR_PRINTF1(_L("Error - no interface retrieved"));
1156 INFO_PRINTF1(_L("DevVideo CIU Colour Space Header Interface Instantiated"));
1161 //------------------------------------------------------------------
1163 //------------------------------------------------------------------
1164 CTestDevVideoCiuPlayGetColourSpace::CTestDevVideoCiuPlayGetColourSpace(const TDesC& aTestName)
1165 : CTestDevVideoCiuPlayStep(aTestName)
1169 CTestDevVideoCiuPlayGetColourSpace* CTestDevVideoCiuPlayGetColourSpace::NewL(const TDesC& aTestName)
1171 CTestDevVideoCiuPlayGetColourSpace* self = new(ELeave) CTestDevVideoCiuPlayGetColourSpace(aTestName);
1175 TVerdict CTestDevVideoCiuPlayGetColourSpace::DoTestStepPreambleL()
1177 // Call the base class first
1178 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
1182 // select post-processor
1183 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectPostProcessorL(KUidDevVideoCiuTestPostProcHwDevice));
1185 if (err != KErrNone)
1187 ret = EInconclusive;
1188 ERR_PRINTF1(_L("DevVideo Play Failed to select the post processor."));
1195 // Implementation that uses the test interface to set data that can be checked
1196 // in the call to the interface's "get" method.
1197 TVerdict CTestDevVideoCiuPlayGetColourSpace::DoTestL()
1199 TVerdict ret = EFail;
1201 // Got this far so must have successfully initialised DevVideoPlay
1202 // Try to fetch the CI...
1203 MMmfVideoPlayHWDeviceColourInfoCustomHeader* interface = NULL;
1205 interface = static_cast<MMmfVideoPlayHWDeviceColourInfoCustomHeader*>
1206 (iDevVideoPlay->CustomInterface(iHwDeviceId,
1207 KUidMmfVideoPlayHWDeviceColourInfoCustomHeader));
1210 ERR_PRINTF1(_L("Error - no interface retrieved"));
1211 ret = EInconclusive;
1215 // Setup some test values...
1216 TVideoDataUnitType dataUnitType = EDuArbitraryStreamSection;
1217 TVideoDataUnitEncapsulation dataUnitEncapsulation = EDuRtpPayload;
1218 TYuvFormat yuvFormat;
1219 yuvFormat.iCoefficients = ECustomYuvMatrix;
1220 yuvFormat.iPattern = EYuv422Chroma2;
1221 yuvFormat.iDataLayout = EYuvDataSemiPlanar;
1222 yuvFormat.iYuv2RgbMatrix = NULL;
1223 yuvFormat.iRgb2YuvMatrix = NULL;
1224 yuvFormat.iAspectRatioNum = 666;
1225 yuvFormat.iAspectRatioDenom = 999;
1226 TVideoInputBuffer* dataUnit = new TVideoInputBuffer();
1230 ERR_PRINTF2(_L("Failed to allocate test data."), KErrNoMemory);
1234 // just set one member
1235 dataUnit->iOptions = 444;
1236 // Now set up the test interface...
1237 MDevVideoCiuTestInterfaceColourSpace* testInterface = NULL;
1238 testInterface = static_cast<MDevVideoCiuTestInterfaceColourSpace*>
1239 (iDevVideoPlay->CustomInterface(iHwDeviceId, KUidDevVideoCiuTestInterfaceColourSpace));
1242 testInterface->MmvpciSetColourSpaceHeaderInfoL(dataUnitType,
1243 dataUnitEncapsulation,
1246 INFO_PRINTF1(_L("Set the colour space header info."));
1248 TVideoDataUnitType testDataUnitType = TVideoDataUnitType(0);
1249 TVideoDataUnitEncapsulation testDataUnitEncapsulation = TVideoDataUnitEncapsulation(0);
1250 TVideoInputBuffer* testDataUnit = new TVideoInputBuffer();
1251 TYuvFormat testYuvFormat;
1254 ERR_PRINTF2(_L("Failed to allocate test data."), KErrNoMemory);
1258 // Call the interface's method
1259 TRAPD(err, interface->MmvpciGetColourSpaceHeaderInfoL( testDataUnitType,
1260 testDataUnitEncapsulation,
1263 if ((err == KErrNone) &&
1264 (dataUnitType == testDataUnitType) &&
1265 (dataUnitEncapsulation == testDataUnitEncapsulation) &&
1266 (dataUnit->iOptions == testDataUnit->iOptions) &&
1267 (yuvFormat == testYuvFormat))
1269 INFO_PRINTF1(_L("Succesfully retrieved the colour space header info."));
1274 ERR_PRINTF1(_L("Failed to retrieve the colour space header info."));
1277 delete testDataUnit;
1281 ERR_PRINTF1(_L("Error - no test interface retrieved"));
1282 ret = EInconclusive;
1291 //------------------------------------------------------------------
1292 // Resource control tests implementation
1293 CTestDevVideoCiuPlayCreatePolicyExtension::CTestDevVideoCiuPlayCreatePolicyExtension(const TDesC& aTestName)
1294 : CTestDevVideoCiuPlayStep(aTestName)
1298 CTestDevVideoCiuPlayCreatePolicyExtension* CTestDevVideoCiuPlayCreatePolicyExtension::NewL(const TDesC& aTestName)
1300 CTestDevVideoCiuPlayCreatePolicyExtension* self = new(ELeave) CTestDevVideoCiuPlayCreatePolicyExtension(aTestName);
1304 TVerdict CTestDevVideoCiuPlayCreatePolicyExtension::DoTestStepPreambleL()
1306 // Call the base class first
1307 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
1311 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
1313 if (err != KErrNone)
1315 ret = EInconclusive;
1316 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
1322 TVerdict CTestDevVideoCiuPlayCreatePolicyExtension::DoTestL()
1324 TVerdict ret = EPass;
1326 INFO_PRINTF1(_L("DevVideo CIU Policy Extension Interface Initialisation"));
1328 // Try to fetch the CI...
1329 MMmfVideoHwDeviceVideoPolicyExtension* interface = NULL;
1331 interface = static_cast<MMmfVideoHwDeviceVideoPolicyExtension*>
1332 (iDevVideoPlay->CustomInterface(iHwDeviceId,
1333 KUidMmfVideoHwDevVideoPolicyExtension));
1336 ERR_PRINTF1(_L("Error - no interface retrieved"));
1341 INFO_PRINTF1(_L("DevVideo CIU Policy Extension Interface Instantiated"));
1347 //-------------------------------------------------------------------------
1348 CTestDevVideoCiuPlaySetClientPolicyExtension::CTestDevVideoCiuPlaySetClientPolicyExtension(const TDesC& aTestName)
1349 : CTestDevVideoCiuPlayStep(aTestName)
1353 CTestDevVideoCiuPlaySetClientPolicyExtension* CTestDevVideoCiuPlaySetClientPolicyExtension::NewL(const TDesC& aTestName)
1355 CTestDevVideoCiuPlaySetClientPolicyExtension* self = new(ELeave) CTestDevVideoCiuPlaySetClientPolicyExtension(aTestName);
1359 TVerdict CTestDevVideoCiuPlaySetClientPolicyExtension::DoTestStepPreambleL()
1361 // Call the base class first
1362 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
1367 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
1369 if (err != KErrNone)
1371 ret = EInconclusive;
1372 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
1379 // Implementation that uses the test interface to set data that can be checked
1380 // in the call to the interface's "get" method.
1381 TVerdict CTestDevVideoCiuPlaySetClientPolicyExtension::DoTestL()
1383 TVerdict ret = EFail;
1385 // Got this far so must have successfully initialised DevVideoPlay
1386 // Try to fetch the CI...
1387 MMmfVideoHwDeviceVideoPolicyExtension* interface = NULL;
1389 interface = static_cast<MMmfVideoHwDeviceVideoPolicyExtension*>(iDevVideoPlay->CustomInterface(
1391 KUidMmfVideoHwDevVideoPolicyExtension));
1394 ERR_PRINTF1(_L("Error - no interface retrieved"));
1395 ret = EInconclusive;
1399 MMmfVideoHwDevClientNotifier* clientNotifier = this;
1400 // call the interface's method
1401 interface->MmvhvpeSetVideoClient(clientNotifier);
1403 // Now set up the test interface...
1404 MDevVideoCiuTestInterfaceClientResourceNotifier* testInterface = NULL;
1405 testInterface = static_cast<MDevVideoCiuTestInterfaceClientResourceNotifier*>
1406 (iDevVideoPlay->CustomInterface( iHwDeviceId,
1407 KUidDevVideoCiuTestInterfaceClientResourceNotifier));
1410 if (testInterface->McrnVideoClient() == clientNotifier)
1412 INFO_PRINTF1(_L("Succesfully set the client notifier."));
1417 ERR_PRINTF1(_L("Failed to set the client notifier."));
1422 ERR_PRINTF1(_L("Error - no test interface retrieved"));
1423 ret = EInconclusive;
1430 // from MMmfVideoHwDevClientNotifier
1431 void CTestDevVideoCiuPlaySetClientPolicyExtension::MmvhcnVideoAccessRevoked()
1434 // from MMmfVideoHwDevClientNotifier
1435 void CTestDevVideoCiuPlaySetClientPolicyExtension::MmvhcnReleaseVideoResource()
1438 //----------------------------------------------------------------------------
1439 CTestDevVideoCiuPlaySetPriorityPolicyExtension::CTestDevVideoCiuPlaySetPriorityPolicyExtension(const TDesC& aTestName)
1440 : CTestDevVideoCiuPlayStep(aTestName)
1444 CTestDevVideoCiuPlaySetPriorityPolicyExtension* CTestDevVideoCiuPlaySetPriorityPolicyExtension::NewL(const TDesC& aTestName)
1446 CTestDevVideoCiuPlaySetPriorityPolicyExtension* self = new(ELeave) CTestDevVideoCiuPlaySetPriorityPolicyExtension(aTestName);
1450 TVerdict CTestDevVideoCiuPlaySetPriorityPolicyExtension::DoTestStepPreambleL()
1452 // Call the base class first
1453 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
1458 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
1460 if (err != KErrNone)
1462 ret = EInconclusive;
1463 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
1470 TVerdict CTestDevVideoCiuPlaySetPriorityPolicyExtension::DoTestL()
1472 TVerdict ret = EFail;
1474 INFO_PRINTF1(_L("DevVideo CIU Policy Extension Set Priority"));
1476 // Try to fetch the CI...
1477 MMmfVideoHwDeviceVideoPolicyExtension* interface = NULL;
1479 interface = static_cast<MMmfVideoHwDeviceVideoPolicyExtension*>
1480 (iDevVideoPlay->CustomInterface(iHwDeviceId,
1481 KUidMmfVideoHwDevVideoPolicyExtension));
1484 ERR_PRINTF1(_L("Error - no interface retrieved"));
1488 TInt priority = 666;
1489 interface->MmvhvpeSetVideoPriority(priority);
1491 // Now set up the test interface...
1492 MDevVideoCiuTestInterfaceClientResourceNotifier* testInterface = NULL;
1493 testInterface = static_cast<MDevVideoCiuTestInterfaceClientResourceNotifier*>
1494 (iDevVideoPlay->CustomInterface( iHwDeviceId,
1495 KUidDevVideoCiuTestInterfaceClientResourceNotifier));
1498 if (testInterface->McrnVideoPriority() == priority)
1500 INFO_PRINTF1(_L("Succesfully retrieved the video priority."));
1505 ERR_PRINTF1(_L("Failed to retrieve the video priority."));
1510 ERR_PRINTF1(_L("Error - no test interface retrieved"));
1511 ret = EInconclusive;
1517 //-------------------------------------------------------------------------
1518 CTestDevVideoCiuPlayClientNotifierRevoked::CTestDevVideoCiuPlayClientNotifierRevoked(const TDesC& aTestName)
1519 : CTestDevVideoCiuPlayStep(aTestName)
1523 CTestDevVideoCiuPlayClientNotifierRevoked* CTestDevVideoCiuPlayClientNotifierRevoked::NewL(const TDesC& aTestName)
1525 CTestDevVideoCiuPlayClientNotifierRevoked* self = new(ELeave) CTestDevVideoCiuPlayClientNotifierRevoked(aTestName);
1529 TVerdict CTestDevVideoCiuPlayClientNotifierRevoked::DoTestStepPreambleL()
1531 // Call the base class first
1532 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
1537 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
1539 if (err != KErrNone)
1541 ret = EInconclusive;
1542 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
1548 // Implementation that uses the test interface to set data that can be checked
1549 // in the call to the interface's "get" method.
1550 TVerdict CTestDevVideoCiuPlayClientNotifierRevoked::DoTestL()
1552 TVerdict ret = EFail;
1554 // Got this far so must have successfully initialised DevVideoPlay
1555 // Try to fetch the CI...
1556 MMmfVideoHwDeviceVideoPolicyExtension* interface = NULL;
1558 interface = static_cast<MMmfVideoHwDeviceVideoPolicyExtension*>(iDevVideoPlay->CustomInterface(
1560 KUidMmfVideoHwDevVideoPolicyExtension));
1563 ERR_PRINTF1(_L("Error - no interface retrieved"));
1564 ret = EInconclusive;
1568 MMmfVideoHwDevClientNotifier* clientNotifier = this;
1569 // call the interface's method
1570 interface->MmvhvpeSetVideoClient(clientNotifier);
1572 // Now set up the test interface...
1573 MDevVideoCiuTestInterfaceClientResourceNotifier* testInterface = NULL;
1574 testInterface = static_cast<MDevVideoCiuTestInterfaceClientResourceNotifier*>
1575 (iDevVideoPlay->CustomInterface( iHwDeviceId,
1576 KUidDevVideoCiuTestInterfaceClientResourceNotifier));
1579 INFO_PRINTF1(_L("Requesting the revoke callback."));
1580 testInterface->McrnRequestRevokeCallback();
1588 ERR_PRINTF1(_L("Didn't receive the revoke callback."));
1593 ERR_PRINTF1(_L("Error - no test interface retrieved"));
1594 ret = EInconclusive;
1601 // from MMmfVideoHwDevClientNotifier
1602 void CTestDevVideoCiuPlayClientNotifierRevoked::MmvhcnVideoAccessRevoked()
1604 INFO_PRINTF1(_L("Access revoked callback received."));
1608 // from MMmfVideoHwDevClientNotifier
1609 void CTestDevVideoCiuPlayClientNotifierRevoked::MmvhcnReleaseVideoResource()
1613 //----------------------------------------------------------------------------------------
1615 CTestDevVideoCiuPlayClientNotifierResource::CTestDevVideoCiuPlayClientNotifierResource(const TDesC& aTestName)
1616 : CTestDevVideoCiuPlayStep(aTestName)
1620 CTestDevVideoCiuPlayClientNotifierResource* CTestDevVideoCiuPlayClientNotifierResource::NewL(const TDesC& aTestName)
1622 CTestDevVideoCiuPlayClientNotifierResource* self = new(ELeave) CTestDevVideoCiuPlayClientNotifierResource(aTestName);
1626 TVerdict CTestDevVideoCiuPlayClientNotifierResource::DoTestStepPreambleL()
1628 // Call the base class first
1629 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
1634 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
1636 if (err != KErrNone)
1638 ret = EInconclusive;
1639 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
1646 // Implementation that uses the test interface to set data that can be checked
1647 // in the call to the interface's "get" method.
1648 TVerdict CTestDevVideoCiuPlayClientNotifierResource::DoTestL()
1650 TVerdict ret = EFail;
1652 // Got this far so must have successfully initialised DevVideoPlay
1653 // Try to fetch the CI...
1654 MMmfVideoHwDeviceVideoPolicyExtension* interface = NULL;
1656 interface = static_cast<MMmfVideoHwDeviceVideoPolicyExtension*>(iDevVideoPlay->CustomInterface(
1658 KUidMmfVideoHwDevVideoPolicyExtension));
1661 ERR_PRINTF1(_L("Error - no interface retrieved"));
1662 ret = EInconclusive;
1666 MMmfVideoHwDevClientNotifier* clientNotifier = this;
1667 // call the interface's method
1668 interface->MmvhvpeSetVideoClient(clientNotifier);
1670 // Now set up the test interface...
1671 MDevVideoCiuTestInterfaceClientResourceNotifier* testInterface = NULL;
1672 testInterface = static_cast<MDevVideoCiuTestInterfaceClientResourceNotifier*>
1673 (iDevVideoPlay->CustomInterface( iHwDeviceId,
1674 KUidDevVideoCiuTestInterfaceClientResourceNotifier));
1677 INFO_PRINTF1(_L("Requesting the resource callback."));
1678 testInterface->McrnRequestResourceCallback();
1686 ERR_PRINTF1(_L("Didn't receive the resource callback."));
1691 ERR_PRINTF1(_L("Error - no test interface retrieved"));
1692 ret = EInconclusive;
1699 // from MMmfVideoHwDevClientNotifier
1700 void CTestDevVideoCiuPlayClientNotifierResource::MmvhcnVideoAccessRevoked()
1704 // from MMmfVideoHwDevClientNotifier
1705 void CTestDevVideoCiuPlayClientNotifierResource::MmvhcnReleaseVideoResource()
1707 INFO_PRINTF1(_L("Release video resource callback received."));
1710 //----------------------------------------------------------------------------------------
1712 //------------------------------------------------------------------
1714 //------------------------------------------------------------------
1716 CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder
1717 ::CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder(const TDesC& aTestName)
1718 :CTestDevVideoCiuPlayStep(aTestName)
1722 CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder*
1723 CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder::NewL(const TDesC& aTestName)
1725 CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder* self =
1726 new(ELeave) CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder(aTestName);
1730 TVerdict CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder::DoTestStepPreambleL()
1732 // Call the base class first
1733 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
1737 // select the decoder
1738 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
1740 if (err != KErrNone)
1742 ret = EInconclusive;
1743 ERR_PRINTF1(_L("DevVideo Play Failed to select the Decoder."));
1749 TVerdict CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder::DoTestL()
1751 TVerdict ret = EPass;
1753 INFO_PRINTF1(_L("DevVideo CIU Video Media Protected Creation Failure from Decoder"));
1755 // Got this far so must have successfully initialised DevVideoPlay
1756 // Try to fetch the CI...
1757 MMmfVideoMediaProtected* interface = NULL;
1758 interface = static_cast<MMmfVideoMediaProtected*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
1759 KUidMmfVideoMediaProtected));
1762 INFO_PRINTF1(_L("No interface retrieved"));
1766 ERR_PRINTF1(_L("Error! An interface was retrieved"));
1772 //------------------------------------------------------------------
1775 #ifdef SYMBIAN_BUILD_GCE
1778 // Video Surface Support Management Tests
1780 CTestDevVideoCiuPlayGetAndSetUseSurface::CTestDevVideoCiuPlayGetAndSetUseSurface(const TDesC& aTestName)
1781 :CTestDevVideoCiuPlayStep(aTestName)
1785 CTestDevVideoCiuPlayGetAndSetUseSurface* CTestDevVideoCiuPlayGetAndSetUseSurface::NewL(const TDesC& aTestName)
1787 CTestDevVideoCiuPlayGetAndSetUseSurface* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetUseSurface(aTestName);
1791 TVerdict CTestDevVideoCiuPlayGetAndSetUseSurface::DoTestStepPreambleL()
1793 // Call the base class first
1794 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
1798 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
1800 if (err != KErrNone)
1802 ret = EInconclusive;
1803 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
1809 TVerdict CTestDevVideoCiuPlayGetAndSetUseSurface::DoTestL()
1811 TVerdict ret = EFail;
1813 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
1816 MMMFVideoSurfaceSupport* interface = NULL;
1818 interface = static_cast<MMMFVideoSurfaceSupport*>
1819 (iDevVideoPlay->CustomInterface(iHwDeviceId,
1820 KUidMMFVideoSurfaceSupport));
1823 ERR_PRINTF1(_L("Error - no interface retrieved"));
1828 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
1830 TBool useSurface = ETrue;
1831 interface->MmvssUseSurfaces();
1833 MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
1835 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>
1836 (iDevVideoPlay->CustomInterface(iHwDeviceId,
1837 KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
1840 TBool useSurfaceResult = testInterface->MdvssUseSurface();
1841 if (useSurface == useSurfaceResult)
1844 INFO_PRINTF1(_L("Use Surface call performed as expected"));
1849 ERR_PRINTF2(_L("Use Surface call failed. Expected: %d"),useSurface);
1850 ERR_PRINTF2(_L("Result: %d"),useSurfaceResult);
1855 ERR_PRINTF1(_L("Error - no test interface retrieved"));
1856 ret = EInconclusive;
1862 //-----------------------------------------------------------//
1863 CTestDevVideoCiuPlayGetAndSetSurfaceParameters::CTestDevVideoCiuPlayGetAndSetSurfaceParameters(const TDesC& aTestName)
1864 :CTestDevVideoCiuPlayStep(aTestName)
1868 CTestDevVideoCiuPlayGetAndSetSurfaceParameters* CTestDevVideoCiuPlayGetAndSetSurfaceParameters::NewL(const TDesC& aTestName)
1870 CTestDevVideoCiuPlayGetAndSetSurfaceParameters* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetSurfaceParameters(aTestName);
1874 TVerdict CTestDevVideoCiuPlayGetAndSetSurfaceParameters::DoTestStepPreambleL()
1876 // Call the base class first
1877 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
1881 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
1883 if (err != KErrNone)
1885 ret = EInconclusive;
1886 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
1892 TVerdict CTestDevVideoCiuPlayGetAndSetSurfaceParameters::DoTestL()
1894 TVerdict ret = EFail;
1896 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
1899 MMMFVideoSurfaceSupport* interface = NULL;
1901 interface = static_cast<MMMFVideoSurfaceSupport*>
1902 (iDevVideoPlay->CustomInterface(iHwDeviceId,
1903 KUidMMFVideoSurfaceSupport));
1906 ERR_PRINTF1(_L("Error - no interface retrieved"));
1911 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
1913 TSurfaceId surfaceId;
1915 TVideoAspectRatio par;
1916 interface->MmvssGetSurfaceParametersL(surfaceId, getRect, par);
1918 MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
1920 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>
1921 (iDevVideoPlay->CustomInterface(iHwDeviceId,
1922 KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
1925 TMMFVideoSurfaceConfig vsconfResult = testInterface->MdvssSurfaceParameters();
1927 if (vsconfResult.iSurfaceId == surfaceId && vsconfResult.iCropRectangle.iTl.iX == getRect.iTl.iX &&
1928 vsconfResult.iCropRectangle.iTl.iY == getRect.iTl.iY && vsconfResult.iCropRectangle.iBr.iX == getRect.iBr.iX &&
1929 vsconfResult.iCropRectangle.iBr.iY == getRect.iBr.iY &&
1930 vsconfResult.iPixelAspectRatio.iNumerator == par.iNumerator &&
1931 vsconfResult.iPixelAspectRatio.iDenominator == par.iDenominator)
1934 INFO_PRINTF1(_L("Get Surface Parameters method call performed as expected"));
1939 ERR_PRINTF1(_L("Get Surface Parameters method call failed"));
1940 INFO_PRINTF5(_L("Expected surfaceId %d %d %d %d"),
1941 vsconfResult.iSurfaceId.iInternal[0], vsconfResult.iSurfaceId.iInternal[1],
1942 vsconfResult.iSurfaceId.iInternal[2], vsconfResult.iSurfaceId.iInternal[3]);
1943 INFO_PRINTF5(_L("surfaceId Available %d %d %d %d"),
1944 surfaceId.iInternal[0], surfaceId.iInternal[1],
1945 surfaceId.iInternal[2], surfaceId.iInternal[3]);
1946 INFO_PRINTF2(_L("Expected Rect first %d"),vsconfResult.iCropRectangle.iTl.iX);
1947 INFO_PRINTF2(_L("Rect first Available %d"),getRect.iTl.iX);
1948 INFO_PRINTF2(_L("Expected Rect second %d"),vsconfResult.iCropRectangle.iTl.iY);
1949 INFO_PRINTF2(_L("Rect second Available %d"),getRect.iTl.iY);
1950 INFO_PRINTF2(_L("Expected Rect third %d"),vsconfResult.iCropRectangle.iBr.iX);
1952 INFO_PRINTF2(_L("Rect third Available %d"),getRect.iBr.iX);
1953 INFO_PRINTF2(_L("Expected Rect fourth %d"),vsconfResult.iCropRectangle.iBr.iY);
1954 INFO_PRINTF2(_L("Rect fourth Available %d"),getRect.iBr.iY);
1955 INFO_PRINTF2(_L("Expected TVideoAspectRatio iNumerator %d"),vsconfResult.iPixelAspectRatio.iNumerator);
1956 INFO_PRINTF2(_L("TVideoAspectRatio iNumerator Available %d"),par.iNumerator);
1957 INFO_PRINTF2(_L("Expected TVideoAspectRatio iDenominator %d"),vsconfResult.iPixelAspectRatio.iDenominator);
1958 INFO_PRINTF2(_L("TVideoAspectRatio iDenominator Available %d"),par.iDenominator);
1964 ERR_PRINTF1(_L("Error - no test interface retrieved"));
1965 ret = EInconclusive;
1971 //-----------------------------------------------------------//
1972 CTestDevVideoCiuPlayGetAndSetSurfaceRemoved::CTestDevVideoCiuPlayGetAndSetSurfaceRemoved(const TDesC& aTestName)
1973 :CTestDevVideoCiuPlayStep(aTestName)
1977 CTestDevVideoCiuPlayGetAndSetSurfaceRemoved* CTestDevVideoCiuPlayGetAndSetSurfaceRemoved::NewL(const TDesC& aTestName)
1979 CTestDevVideoCiuPlayGetAndSetSurfaceRemoved* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetSurfaceRemoved(aTestName);
1983 TVerdict CTestDevVideoCiuPlayGetAndSetSurfaceRemoved::DoTestStepPreambleL()
1985 // Call the base class first
1986 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
1990 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
1992 if (err != KErrNone)
1994 ret = EInconclusive;
1995 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
2001 TVerdict CTestDevVideoCiuPlayGetAndSetSurfaceRemoved::DoTestL()
2003 TVerdict ret = EFail;
2005 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
2008 MMMFVideoSurfaceSupport* interface = NULL;
2010 interface = static_cast<MMMFVideoSurfaceSupport*>
2011 (iDevVideoPlay->CustomInterface(iHwDeviceId,
2012 KUidMMFVideoSurfaceSupport));
2015 ERR_PRINTF1(_L("Error - no interface retrieved"));
2020 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
2022 // these values can be anything
2023 TSurfaceId surfaceId;
2024 surfaceId.iInternal[0] = 37;
2025 surfaceId.iInternal[1] = 104;
2026 surfaceId.iInternal[2] = 118;
2027 surfaceId.iInternal[3] = 1045;
2029 interface->MmvssSurfaceRemovedL(surfaceId);
2031 MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
2033 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>
2034 (iDevVideoPlay->CustomInterface(iHwDeviceId,
2035 KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
2038 TSurfaceId surfaceIdResult = testInterface->MdvssSurfaceRemoved();
2039 if (surfaceId == surfaceIdResult)
2042 INFO_PRINTF1(_L("Surface Removed method call performed as expected"));
2047 ERR_PRINTF1(_L("Surface Removed method call failed."));
2048 INFO_PRINTF5(_L("Expected surfaceId %d %d %d %d"),
2049 surfaceId.iInternal[0], surfaceId.iInternal[1],
2050 surfaceId.iInternal[2], surfaceId.iInternal[3]);
2051 INFO_PRINTF5(_L("surfaceId Available %d %d %d %d"),
2052 surfaceIdResult.iInternal[0], surfaceIdResult.iInternal[1],
2053 surfaceIdResult.iInternal[2], surfaceIdResult.iInternal[3]);
2058 ERR_PRINTF1(_L("Error - no test interface retrieved"));
2059 ret = EInconclusive;
2065 //-----------------------------------------------------------//
2066 CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver(const TDesC& aTestName)
2067 :CTestDevVideoCiuPlayStep(aTestName)
2071 CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver* CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::NewL(const TDesC& aTestName)
2073 CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver* self = new(ELeave) CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver(aTestName);
2077 TVerdict CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::DoTestStepPreambleL()
2079 // Call the base class first
2080 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
2084 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
2086 if (err != KErrNone)
2088 ret = EInconclusive;
2089 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
2095 TVerdict CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::DoTestL()
2097 TVerdict ret = EFail;
2099 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
2102 MMMFVideoSurfaceSupport* interface = NULL;
2104 interface = static_cast<MMMFVideoSurfaceSupport*>
2105 (iDevVideoPlay->CustomInterface(iHwDeviceId,
2106 KUidMMFVideoSurfaceSupport));
2109 ERR_PRINTF1(_L("Error - no interface retrieved"));
2114 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
2116 MMMFVideoSurfaceObserver* obs = this;
2117 interface->MmvssSetObserver(*obs);
2118 INFO_PRINTF1(_L("MmvssSetObserver called"));
2120 // Verify that the observer was set
2121 MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
2122 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
2123 KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
2126 ERR_PRINTF1(_L("Failed to create the test interface."));
2131 if (obs != testInterface->MvsoObserver())
2133 ERR_PRINTF1(_L("Failed to set the observer."));
2138 INFO_PRINTF1(_L("SetObserver successfully called"));
2146 //from MMMFVideoSurfaceObserver
2147 void CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::MmvsoSurfaceCreated()
2150 void CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::MmvsoSurfaceParametersChanged()
2153 void CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::MmvsoRemoveSurface()
2156 //------------------------------------------------------------------
2158 CTestDevVideoCiuPlaySurfaceCreated::CTestDevVideoCiuPlaySurfaceCreated(const TDesC& aTestName)
2159 :CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
2163 CTestDevVideoCiuPlaySurfaceCreated* CTestDevVideoCiuPlaySurfaceCreated::NewL(const TDesC& aTestName)
2165 CTestDevVideoCiuPlaySurfaceCreated* self = new(ELeave) CTestDevVideoCiuPlaySurfaceCreated(aTestName);
2169 TVerdict CTestDevVideoCiuPlaySurfaceCreated::DoTestStepPreambleL()
2171 // Call the base class first
2172 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
2176 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
2178 if (err != KErrNone)
2180 ret = EInconclusive;
2181 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
2187 TVerdict CTestDevVideoCiuPlaySurfaceCreated::DoTestL()
2189 TVerdict ret = EFail;
2191 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
2194 MMMFVideoSurfaceSupport* interface = NULL;
2196 interface = static_cast<MMMFVideoSurfaceSupport*>
2197 (iDevVideoPlay->CustomInterface(iHwDeviceId,
2198 KUidMMFVideoSurfaceSupport));
2201 ERR_PRINTF1(_L("Error - no interface retrieved"));
2206 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
2208 MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
2209 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
2210 KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
2213 ERR_PRINTF1(_L("Failed to create the test interface."));
2218 // Set the observer to callback!
2219 MMMFVideoSurfaceObserver* obs = this;
2220 interface->MmvssSetObserver(*obs);
2222 INFO_PRINTF1(_L("Requesting the surface created Callback..."));
2223 testInterface->MmvsoSurfaceCreatedCallback();
2225 if ((iError != KErrNone) || (!iCallbackReceived))
2227 ERR_PRINTF1(_L("Error receiving the Surface Created Callback."));
2232 INFO_PRINTF1(_L("Successfully retrieved the Surface Support Callback"));
2240 //from MMMFVideoSurfaceObserver
2241 void CTestDevVideoCiuPlaySurfaceCreated::MmvsoSurfaceCreated()
2243 INFO_PRINTF1(_L("Surface Support callback received."));
2244 iCallbackReceived = ETrue;
2248 void CTestDevVideoCiuPlaySurfaceCreated::MmvsoSurfaceParametersChanged()
2250 iError = KErrNotSupported;
2252 void CTestDevVideoCiuPlaySurfaceCreated::MmvsoRemoveSurface()
2254 iError = KErrNotSupported;
2257 //------------------------------------------------------------------
2259 CTestDevVideoCiuPlaySurfaceParametersChanged::CTestDevVideoCiuPlaySurfaceParametersChanged(const TDesC& aTestName)
2260 :CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
2264 CTestDevVideoCiuPlaySurfaceParametersChanged* CTestDevVideoCiuPlaySurfaceParametersChanged::NewL(const TDesC& aTestName)
2266 CTestDevVideoCiuPlaySurfaceParametersChanged* self = new(ELeave) CTestDevVideoCiuPlaySurfaceParametersChanged(aTestName);
2270 TVerdict CTestDevVideoCiuPlaySurfaceParametersChanged::DoTestStepPreambleL()
2272 // Call the base class first
2273 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
2277 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
2279 if (err != KErrNone)
2281 ret = EInconclusive;
2282 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
2288 TVerdict CTestDevVideoCiuPlaySurfaceParametersChanged::DoTestL()
2290 TVerdict ret = EFail;
2292 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
2295 MMMFVideoSurfaceSupport* interface = NULL;
2297 interface = static_cast<MMMFVideoSurfaceSupport*>
2298 (iDevVideoPlay->CustomInterface(iHwDeviceId,
2299 KUidMMFVideoSurfaceSupport));
2302 ERR_PRINTF1(_L("Error - no interface retrieved"));
2307 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
2309 MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
2310 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
2311 KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
2314 ERR_PRINTF1(_L("Failed to create the test interface."));
2319 // Set the observer to callback!
2320 MMMFVideoSurfaceObserver* obs = this;
2321 interface->MmvssSetObserver(*obs);
2323 INFO_PRINTF1(_L("Requesting the Surface Parameters Changed Callback..."));
2324 testInterface->MmvsoSurfaceParametersChangedCallback();
2326 if ((iError != KErrNone) || (!iCallbackReceived))
2328 ERR_PRINTF1(_L("Error receiving Surface Parameters Changed Callback."));
2333 INFO_PRINTF1(_L("Successfully retrieved Surface Parameters Changed Callback"));
2341 //from MMMFVideoSurfaceObserver
2342 void CTestDevVideoCiuPlaySurfaceParametersChanged::MmvsoSurfaceCreated()
2344 iError = KErrNotSupported;
2347 void CTestDevVideoCiuPlaySurfaceParametersChanged::MmvsoSurfaceParametersChanged()
2349 INFO_PRINTF1(_L("Surface Parameters Changed callback received."));
2350 iCallbackReceived = ETrue;
2354 void CTestDevVideoCiuPlaySurfaceParametersChanged::MmvsoRemoveSurface()
2356 iError = KErrNotSupported;
2359 //------------------------------------------------------------------
2361 CTestDevVideoCiuRemoveSurface::CTestDevVideoCiuRemoveSurface(const TDesC& aTestName)
2362 :CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
2366 CTestDevVideoCiuRemoveSurface* CTestDevVideoCiuRemoveSurface::NewL(const TDesC& aTestName)
2368 CTestDevVideoCiuRemoveSurface* self = new(ELeave) CTestDevVideoCiuRemoveSurface(aTestName);
2372 TVerdict CTestDevVideoCiuRemoveSurface::DoTestStepPreambleL()
2374 // Call the base class first
2375 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
2379 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
2381 if (err != KErrNone)
2383 ret = EInconclusive;
2384 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
2390 TVerdict CTestDevVideoCiuRemoveSurface::DoTestL()
2392 TVerdict ret = EFail;
2394 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
2397 MMMFVideoSurfaceSupport* interface = NULL;
2399 interface = static_cast<MMMFVideoSurfaceSupport*>
2400 (iDevVideoPlay->CustomInterface(iHwDeviceId,
2401 KUidMMFVideoSurfaceSupport));
2404 ERR_PRINTF1(_L("Error - no interface retrieved"));
2409 INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
2411 MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
2412 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
2413 KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
2416 ERR_PRINTF1(_L("Failed to create the test interface."));
2421 // Set the observer to callback!
2422 MMMFVideoSurfaceObserver* obs = this;
2423 interface->MmvssSetObserver(*obs);
2425 INFO_PRINTF1(_L("Requesting Remove Surface Callback..."));
2426 testInterface->MmvsoRemoveSurfaceCallback();
2428 if ((iError != KErrNone) || (!iCallbackReceived))
2430 ERR_PRINTF1(_L("Error receiving Remove Surface Callback."));
2435 INFO_PRINTF1(_L("Successfully retrieved Remove Surface Callback"));
2443 //from MMMFVideoSurfaceObserver
2444 void CTestDevVideoCiuRemoveSurface::MmvsoSurfaceCreated()
2446 iError = KErrNotSupported;
2449 void CTestDevVideoCiuRemoveSurface::MmvsoSurfaceParametersChanged()
2451 iError = KErrNotSupported;
2454 void CTestDevVideoCiuRemoveSurface::MmvsoRemoveSurface()
2456 INFO_PRINTF1(_L("Remove Surface callback received."));
2457 iCallbackReceived = ETrue;
2461 //----------------------------------------------------------------------------
2462 CTestDevVideoCiuPlayUseClientBuffers::CTestDevVideoCiuPlayUseClientBuffers(const TDesC& aTestName)
2463 : CTestDevVideoCiuPlayStep(aTestName)
2467 CTestDevVideoCiuPlayUseClientBuffers* CTestDevVideoCiuPlayUseClientBuffers::NewL(const TDesC& aTestName)
2469 CTestDevVideoCiuPlayUseClientBuffers* self = new(ELeave) CTestDevVideoCiuPlayUseClientBuffers(aTestName);
2473 TVerdict CTestDevVideoCiuPlayUseClientBuffers::DoTestStepPreambleL()
2475 // Call the base class first
2476 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
2481 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
2483 if (err != KErrNone)
2485 ret = EInconclusive;
2486 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
2493 TVerdict CTestDevVideoCiuPlayUseClientBuffers::DoTestL()
2495 TVerdict ret = EFail;
2497 INFO_PRINTF1(_L("DevVideo CIU use client buffer mode test"));
2499 // Try to fetch the CI...
2500 MMMFVideoClientBufferSupport* interface = NULL;
2502 interface = static_cast<MMMFVideoClientBufferSupport*>
2503 (iDevVideoPlay->CustomInterface(iHwDeviceId,
2504 KUidMMFVideoClientBufferSupport));
2507 ERR_PRINTF1(_L("Error - no interface retrieved"));
2511 TBool clientBuffers = ETrue;
2512 interface->MvcbsUseClientBuffers(clientBuffers);
2514 // Now set up the test interface...
2515 MDevVideoCiuTestInterfaceVideoClientBufferSupport* testInterface = NULL;
2516 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoClientBufferSupport*>
2517 (iDevVideoPlay->CustomInterface( iHwDeviceId,
2518 KUidDevVideoCiuTestInterfaceVideoClientBufferSupport));
2521 if (testInterface->MdvcbsClientBuffers())
2523 INFO_PRINTF1(_L("Succesfully retrieved the video client buffer mode"));
2528 ERR_PRINTF1(_L("Failed to retrieve the video client buffer mode."));
2533 ERR_PRINTF1(_L("Error - no test interface retrieved"));
2534 ret = EInconclusive;
2540 //----------------------------------------------------------------------------
2541 CTestDevVideoCiuPlaySupplyBuffer::CTestDevVideoCiuPlaySupplyBuffer(const TDesC& aTestName)
2542 : CTestDevVideoCiuPlayStep(aTestName)
2546 CTestDevVideoCiuPlaySupplyBuffer* CTestDevVideoCiuPlaySupplyBuffer::NewL(const TDesC& aTestName)
2548 CTestDevVideoCiuPlaySupplyBuffer* self = new(ELeave) CTestDevVideoCiuPlaySupplyBuffer(aTestName);
2552 TVerdict CTestDevVideoCiuPlaySupplyBuffer::DoTestStepPreambleL()
2554 // Call the base class first
2555 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
2560 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
2562 if (err != KErrNone)
2564 ret = EInconclusive;
2565 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
2572 TVerdict CTestDevVideoCiuPlaySupplyBuffer::DoTestL()
2574 TVerdict ret = EFail;
2576 INFO_PRINTF1(_L("DevVideo CIU supply buffer test"));
2578 // Try to fetch the CI...
2579 MMMFVideoClientBufferSupport* interface = NULL;
2581 interface = static_cast<MMMFVideoClientBufferSupport*>
2582 (iDevVideoPlay->CustomInterface(iHwDeviceId,
2583 KUidMMFVideoClientBufferSupport));
2586 ERR_PRINTF1(_L("Error - no interface retrieved"));
2590 TUncompressedVideoFormat format;
2591 format.iDataFormat = ERgbRawData;
2592 format.iRgbFormat = ERgb32bit888;
2595 // Create a dummy object for testing only
2596 TVideoFrameBuffer buffer(format, 1, 1, aChunk, 0);
2597 interface->MvcbsSupplyBuffer(buffer);
2599 // Now set up the test interface...
2600 MDevVideoCiuTestInterfaceVideoClientBufferSupport* testInterface = NULL;
2601 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoClientBufferSupport*>
2602 (iDevVideoPlay->CustomInterface( iHwDeviceId,
2603 KUidDevVideoCiuTestInterfaceVideoClientBufferSupport));
2606 if (testInterface->MdvcbsSupplyBuffer() == &buffer)
2608 INFO_PRINTF1(_L("Succesfully retrieved the video supplied buffer"));
2613 ERR_PRINTF1(_L("Failed to retrieve the video supplied buffer."));
2618 ERR_PRINTF1(_L("Error - no test interface retrieved"));
2619 ret = EInconclusive;
2625 //----------------------------------------------------------------------------
2626 CTestDevVideoCiuPlayReleaseBuffers::CTestDevVideoCiuPlayReleaseBuffers(const TDesC& aTestName)
2627 : CTestDevVideoCiuPlayStep(aTestName)
2631 CTestDevVideoCiuPlayReleaseBuffers* CTestDevVideoCiuPlayReleaseBuffers::NewL(const TDesC& aTestName)
2633 CTestDevVideoCiuPlayReleaseBuffers* self = new(ELeave) CTestDevVideoCiuPlayReleaseBuffers(aTestName);
2637 TVerdict CTestDevVideoCiuPlayReleaseBuffers::DoTestStepPreambleL()
2639 // Call the base class first
2640 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
2645 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
2647 if (err != KErrNone)
2649 ret = EInconclusive;
2650 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
2657 TVerdict CTestDevVideoCiuPlayReleaseBuffers::DoTestL()
2659 TVerdict ret = EFail;
2661 INFO_PRINTF1(_L("DevVideo CIU release buffer test"));
2663 // Try to fetch the CI...
2664 MMMFVideoClientBufferSupport* interface = NULL;
2666 interface = static_cast<MMMFVideoClientBufferSupport*>
2667 (iDevVideoPlay->CustomInterface(iHwDeviceId,
2668 KUidMMFVideoClientBufferSupport));
2671 ERR_PRINTF1(_L("Error - no interface retrieved"));
2675 interface->MvcbsReleaseBuffers();
2677 // Now set up the test interface...
2678 MDevVideoCiuTestInterfaceVideoClientBufferSupport* testInterface = NULL;
2679 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoClientBufferSupport*>
2680 (iDevVideoPlay->CustomInterface( iHwDeviceId,
2681 KUidDevVideoCiuTestInterfaceVideoClientBufferSupport));
2684 // In the test decoder, we set true when we call release buffer. Here just check it will return true.
2685 if (testInterface->MdvcbsReleaseBuffers())
2687 INFO_PRINTF1(_L("Succesfully release buffer."));
2692 ERR_PRINTF1(_L("Failed to release buffer."));
2697 ERR_PRINTF1(_L("Error - no test interface retrieved"));
2698 ret = EInconclusive;
2704 //------------------------------------------------------------------
2706 CTestDevVideoCiuPlaySurfaceHandleControl::CTestDevVideoCiuPlaySurfaceHandleControl(const TDesC& aTestName)
2707 :CTestDevVideoCiuPlayStep(aTestName)
2711 CTestDevVideoCiuPlaySurfaceHandleControl* CTestDevVideoCiuPlaySurfaceHandleControl::NewL(const TDesC& aTestName)
2713 CTestDevVideoCiuPlaySurfaceHandleControl* self = new(ELeave) CTestDevVideoCiuPlaySurfaceHandleControl(aTestName);
2717 TVerdict CTestDevVideoCiuPlaySurfaceHandleControl::DoTestStepPreambleL()
2719 // Call the base class first
2720 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
2724 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
2726 if (err != KErrNone)
2728 ret = EInconclusive;
2729 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
2735 TVerdict CTestDevVideoCiuPlaySurfaceHandleControl::DoTestL()
2737 TVerdict ret = EFail;
2739 INFO_PRINTF1(_L("DevVideo CIU Surface Handle Interface Initialisation"));
2742 MMmfVideoSurfaceHandleControl* interface = NULL;
2744 interface = static_cast<MMmfVideoSurfaceHandleControl*>
2745 (iDevVideoPlay->CustomInterface(iHwDeviceId,
2746 KUidMMFVideoSurfaceHandleControl));
2749 ERR_PRINTF1(_L("Error - no interface retrieved for SurfaceHandleControl"));
2754 INFO_PRINTF1(_L("DevVideo CIU SurfaceHandle Control Interface Instantiated"));
2755 TSurfaceId nullId = TSurfaceId::CreateNullId();
2756 INFO_PRINTF1(_L("DevVideo CIU SurfaceHandle Control testing both surfacehandle functions"));
2757 interface->MmvshcSetSurfaceHandle(nullId);
2759 // Fetch test interface
2760 MDevVideoCiuTestInterfaceVideoPlaySurfaceHandleControl* testInterface = NULL;
2761 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlaySurfaceHandleControl*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
2762 KUidDevVideoCiuTestInterfaceVideoPlaySurfaceHandleControl));
2765 ERR_PRINTF1(_L("Failed to create the test interface for Play rate control."));
2770 TSurfaceId surfaceId = testInterface->MdvshcGetPlaySurfaceHandle();
2772 if (surfaceId == nullId)
2775 INFO_PRINTF1(_L("Get play surface handle method call performed as expected"));
2780 ERR_PRINTF1(_L("Get Play surface handle method call failed"));
2787 //------------------------------------------------------------------
2789 CTestDevVideoCiuPlaySurfaceRedrawBuffer::CTestDevVideoCiuPlaySurfaceRedrawBuffer(const TDesC& aTestName)
2790 :CTestDevVideoCiuPlayStep(aTestName)
2794 CTestDevVideoCiuPlaySurfaceRedrawBuffer* CTestDevVideoCiuPlaySurfaceRedrawBuffer::NewL(const TDesC& aTestName)
2796 CTestDevVideoCiuPlaySurfaceRedrawBuffer* self = new(ELeave) CTestDevVideoCiuPlaySurfaceRedrawBuffer(aTestName);
2800 TVerdict CTestDevVideoCiuPlaySurfaceRedrawBuffer::DoTestStepPreambleL()
2802 // Call the base class first
2803 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
2807 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
2809 if (err != KErrNone)
2811 ret = EInconclusive;
2812 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
2818 TVerdict CTestDevVideoCiuPlaySurfaceRedrawBuffer::DoTestL()
2820 TVerdict ret = EFail;
2822 INFO_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - Start"));
2825 MMmfVideoSurfaceHandleControl* interface = NULL;
2827 interface = static_cast<MMmfVideoSurfaceHandleControl*>
2828 (iDevVideoPlay->CustomInterface(iHwDeviceId,
2829 KUidMMFVideoSurfaceHandleControl));
2832 ERR_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - No interface"));
2837 INFO_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - Interface Instantiated"));
2838 HBufC8* redrawBuffer = HBufC8::NewLC(10);
2839 _LIT8(KTestString, "TestString");
2840 *redrawBuffer = KTestString();
2841 TPtrC8 bufPtr(*redrawBuffer);
2843 INFO_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - Setting redraw buffer"));
2844 interface->MmvshcRedrawBufferToSurface(bufPtr);
2845 CleanupStack::PopAndDestroy(redrawBuffer);
2846 redrawBuffer = NULL;
2848 // Fetch test interface
2849 MDevVideoCiuTestInterfaceVideoPlaySurfaceHandleControl* testInterface = NULL;
2850 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlaySurfaceHandleControl*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
2851 KUidDevVideoCiuTestInterfaceVideoPlaySurfaceHandleControl));
2854 ERR_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - Failed to create test interface"));
2859 TDesC8& retrievedBuffer = testInterface->MdvshcGetRedrawBuffer();
2861 if (retrievedBuffer.Compare(KTestString()) == 0)
2863 INFO_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - Retrieved correct string"));
2868 INFO_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - Retrieved incorrect string"));
2876 #endif // SYMBIAN_BUILD_GCE
2879 // Video Play Rate Control Tests
2882 CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities::CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities(const TDesC& aTestName)
2883 :CTestDevVideoCiuPlayStep(aTestName)
2887 CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities* CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities::NewL(const TDesC& aTestName)
2889 CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities(aTestName);
2893 TVerdict CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities::DoTestStepPreambleL()
2895 // Call the base class first
2896 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
2900 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
2902 if (err != KErrNone)
2904 ret = EInconclusive;
2905 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
2911 TVerdict CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities::DoTestL()
2913 TVerdict ret = EFail;
2915 INFO_PRINTF1(_L("DevVideo CIU Play Rate Control Interface Initialisation"));
2918 MMmfVideoPlayRateControl* interface = NULL;
2920 interface = static_cast<MMmfVideoPlayRateControl*>
2921 (iDevVideoPlay->CustomInterface(iHwDeviceId,
2922 KUidMmfVideoPlayRateControl));
2925 ERR_PRINTF1(_L("Error - no interface retrieved for Play Rate"));
2930 INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Instantiated"));
2932 TVideoPlayRateCapabilities videoPlayRateCapabilities;
2933 TRAPD(err, interface->MmvprcGetPlayRateCapabilitiesL(videoPlayRateCapabilities));
2935 if (err == KErrNone)
2937 // Fetch test interface
2938 MDevVideoCiuTestInterfaceVideoPlayRateControl* testInterface = NULL;
2939 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlayRateControl*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
2940 KUidDevVideoCiuTestInterfaceVideoPlayRateControl));
2943 ERR_PRINTF1(_L("Failed to create the test interface for Play rate control."));
2948 TVideoPlayRateCapabilities playRateCapResult = testInterface->MdvproGetPlayRateCapabilities();
2950 if (playRateCapResult.iPlayBackward == videoPlayRateCapabilities.iPlayBackward &&
2951 playRateCapResult.iPlayForward == videoPlayRateCapabilities.iPlayForward &&
2952 playRateCapResult.iStepBackward == videoPlayRateCapabilities.iStepBackward &&
2953 playRateCapResult.iStepForward == videoPlayRateCapabilities.iStepForward)
2956 INFO_PRINTF1(_L("Get Play Rate Capabilities method call performed as expected"));
2961 ERR_PRINTF1(_L("Get Play Rate Capabilities method call failed"));
2962 INFO_PRINTF5(_L("Expected PlayBackward: %d, PlayForward: %d, StepBackward: %d, StepForward: %d"),
2963 playRateCapResult.iPlayBackward, playRateCapResult.iPlayForward,
2964 playRateCapResult.iStepBackward, playRateCapResult.iStepForward);
2970 ERR_PRINTF2(_L("Failed to get the play rate capabilities: %d."),err);
2977 //-----------------------------------------------------------//
2978 CTestDevVideoCiuPlaySetAndGetPlayRate::CTestDevVideoCiuPlaySetAndGetPlayRate(const TDesC& aTestName)
2979 :CTestDevVideoCiuPlayStep(aTestName)
2983 CTestDevVideoCiuPlaySetAndGetPlayRate* CTestDevVideoCiuPlaySetAndGetPlayRate::NewL(const TDesC& aTestName)
2985 CTestDevVideoCiuPlaySetAndGetPlayRate* self = new(ELeave) CTestDevVideoCiuPlaySetAndGetPlayRate(aTestName);
2989 TVerdict CTestDevVideoCiuPlaySetAndGetPlayRate::DoTestStepPreambleL()
2991 // Call the base class first
2992 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
2996 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
2998 if (err != KErrNone)
3000 ret = EInconclusive;
3001 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
3007 TVerdict CTestDevVideoCiuPlaySetAndGetPlayRate::DoTestL()
3009 TVerdict ret = EFail;
3011 INFO_PRINTF1(_L("DevVideo CIU Play Rate Control Interface Initialisation"));
3014 MMmfVideoPlayRateControl* interface = NULL;
3016 interface = static_cast<MMmfVideoPlayRateControl*>
3017 (iDevVideoPlay->CustomInterface(iHwDeviceId,
3018 KUidMmfVideoPlayRateControl));
3021 ERR_PRINTF1(_L("Error - no interface retrieved for Play Rate"));
3026 INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Instantiated"));
3028 TInt playRate = 99; // The hardcoded value is for test purpose only
3029 TRAPD(err, interface->MmvprcSetPlayRateL(playRate));
3031 if (err == KErrNone)
3033 TInt playRateResult = 0;
3034 TRAP(err, playRateResult = interface->MmvprcPlayRateL());
3036 if (err == KErrNone)
3038 if (playRate == playRateResult)
3041 INFO_PRINTF1(_L("Set and get Play Rate method calls performed as expected"));
3046 ERR_PRINTF3(_L("Set and get Play Rate methods call failed. Expected playRate: %d, return is: %d"), playRate, playRateResult);
3051 ERR_PRINTF2(_L("Failed to get the play rate: %d."), err);
3056 ERR_PRINTF2(_L("Failed to set the play rate: %d."), err);
3062 //-----------------------------------------------------------//
3063 CTestDevVideoCiuPlayGetAndSetStepFrame::CTestDevVideoCiuPlayGetAndSetStepFrame(const TDesC& aTestName)
3064 :CTestDevVideoCiuPlayStep(aTestName)
3068 CTestDevVideoCiuPlayGetAndSetStepFrame* CTestDevVideoCiuPlayGetAndSetStepFrame::NewL(const TDesC& aTestName)
3070 CTestDevVideoCiuPlayGetAndSetStepFrame* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetStepFrame(aTestName);
3074 TVerdict CTestDevVideoCiuPlayGetAndSetStepFrame::DoTestStepPreambleL()
3076 // Call the base class first
3077 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
3081 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
3083 if (err != KErrNone)
3085 ret = EInconclusive;
3086 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
3092 TVerdict CTestDevVideoCiuPlayGetAndSetStepFrame::DoTestL()
3094 TVerdict ret = EFail;
3096 INFO_PRINTF1(_L("DevVideo CIU Play Rate Control Interface Initialisation"));
3099 MMmfVideoPlayRateControl* interface = NULL;
3101 interface = static_cast<MMmfVideoPlayRateControl*>
3102 (iDevVideoPlay->CustomInterface(iHwDeviceId,
3103 KUidMmfVideoPlayRateControl));
3106 ERR_PRINTF1(_L("Error - no interface retrieved for Play Rate"));
3111 INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Instantiated"));
3113 TInt stepFrame = 99; // The hardcoded value is for test purpose only
3114 TRAPD(err, interface->MmvprcStepFrameL(stepFrame));
3116 if (err == KErrNone)
3118 // Fetch test interface
3119 MDevVideoCiuTestInterfaceVideoPlayRateControl* testInterface = NULL;
3120 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlayRateControl*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
3121 KUidDevVideoCiuTestInterfaceVideoPlayRateControl));
3124 ERR_PRINTF1(_L("Failed to create the test interface for Play rate control."));
3129 if (stepFrame == testInterface->MdvproStepFrame())
3132 INFO_PRINTF1(_L("Step frame method call performed as expected"));
3137 ERR_PRINTF2(_L("Step frame method call failed. Expected stepFrame: %d."), stepFrame);
3143 ERR_PRINTF2(_L("Failed to set the step frame: %d."), err);
3149 //------------------------------------------------------------------
3151 CTestDevVideoCiuPlaySetAndGetPlayRateObserver::CTestDevVideoCiuPlaySetAndGetPlayRateObserver(const TDesC& aTestName)
3152 :CTestDevVideoCiuPlayStep(aTestName)
3156 CTestDevVideoCiuPlaySetAndGetPlayRateObserver* CTestDevVideoCiuPlaySetAndGetPlayRateObserver::NewL(const TDesC& aTestName)
3158 CTestDevVideoCiuPlaySetAndGetPlayRateObserver* self = new(ELeave) CTestDevVideoCiuPlaySetAndGetPlayRateObserver(aTestName);
3162 TVerdict CTestDevVideoCiuPlaySetAndGetPlayRateObserver::DoTestStepPreambleL()
3164 // Call the base class first
3165 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
3169 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
3171 if (err != KErrNone)
3173 ret = EInconclusive;
3174 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
3180 TVerdict CTestDevVideoCiuPlaySetAndGetPlayRateObserver::DoTestL()
3182 TVerdict ret = EFail;
3184 INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Initialisation"));
3187 MMmfVideoPlayRateControl* interface = NULL;
3189 interface = static_cast<MMmfVideoPlayRateControl*>
3190 (iDevVideoPlay->CustomInterface(iHwDeviceId,
3191 KUidMmfVideoPlayRateControl));
3194 ERR_PRINTF1(_L("Error - no interface retrieved for Play Rate"));
3199 INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Instantiated"));
3202 MMmfVideoPlayRateObserver* obs = this;
3203 interface->MmvprcSetObserver(*obs);
3204 INFO_PRINTF1(_L("MmvprcSetObserver called"));
3206 // Verify that the observer was set
3207 MDevVideoCiuTestInterfaceVideoPlayRateControl* testInterface = NULL;
3208 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlayRateControl*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
3209 KUidDevVideoCiuTestInterfaceVideoPlayRateControl));
3212 ERR_PRINTF1(_L("Failed to create the test interface for Play rate control."));
3217 if (obs != testInterface->MdvproObserver())
3219 ERR_PRINTF1(_L("Failed to set the observer."));
3224 INFO_PRINTF1(_L("SetObserver successfully called"));
3232 //from MMmfVideoPlayRateObserver
3233 void CTestDevVideoCiuPlaySetAndGetPlayRateObserver::MmvproStepFrameComplete(TTimeIntervalMicroSeconds /*aTimestamp*/)
3236 void CTestDevVideoCiuPlaySetAndGetPlayRateObserver::MmvproKeyFrameModeRequest()
3239 //------------------------------------------------------------------
3241 CTestDevVideoCiuPlayStepFrameComplete::CTestDevVideoCiuPlayStepFrameComplete(const TDesC& aTestName)
3242 :CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
3246 CTestDevVideoCiuPlayStepFrameComplete* CTestDevVideoCiuPlayStepFrameComplete::NewL(const TDesC& aTestName)
3248 CTestDevVideoCiuPlayStepFrameComplete* self = new(ELeave) CTestDevVideoCiuPlayStepFrameComplete(aTestName);
3252 TVerdict CTestDevVideoCiuPlayStepFrameComplete::DoTestStepPreambleL()
3254 // Call the base class first
3255 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
3259 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
3261 if (err != KErrNone)
3263 ret = EInconclusive;
3264 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
3270 TVerdict CTestDevVideoCiuPlayStepFrameComplete::DoTestL()
3272 TVerdict ret = EFail;
3274 INFO_PRINTF1(_L("DevVideo CIU Play Rate Control Interface Initialisation"));
3277 MMmfVideoPlayRateControl* interface = NULL;
3279 interface = static_cast<MMmfVideoPlayRateControl*>
3280 (iDevVideoPlay->CustomInterface(iHwDeviceId,
3281 KUidMmfVideoPlayRateControl));
3284 ERR_PRINTF1(_L("Error - no interface retrieved for Play Rate"));
3289 INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Instantiated"));
3291 // Fetch test interface
3292 MDevVideoCiuTestInterfaceVideoPlayRateControl* testInterface = NULL;
3293 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlayRateControl*>
3294 (iDevVideoPlay->CustomInterface(iHwDeviceId,
3295 KUidDevVideoCiuTestInterfaceVideoPlayRateControl));
3298 ERR_PRINTF1(_L("Failed to create the test interface for Play rate control."));
3303 // Set the observer to callback!
3304 MMmfVideoPlayRateObserver* obs = this;
3305 interface->MmvprcSetObserver(*obs);
3307 INFO_PRINTF1(_L("Requesting the step frame complete Callback..."));
3308 testInterface->MdvproStepFrameCompleteCallback();
3310 if ((iError != KErrNone) && (!iCallbackReceived))
3312 ERR_PRINTF1(_L("Error receiving the step frame complete Callback."));
3317 INFO_PRINTF1(_L("Successfully retrieved the step frame complete Callback"));
3325 //from MMmfVideoPlayRateObserver
3326 void CTestDevVideoCiuPlayStepFrameComplete::MmvproStepFrameComplete(TTimeIntervalMicroSeconds aTimestamp)
3328 INFO_PRINTF1(_L("Step frame complete callback received. "));
3329 // Test h/w sets the time stamp to 10000
3330 if (aTimestamp == 10000)
3332 iCallbackReceived = ETrue;
3337 iCallbackReceived = ETrue;
3338 iError = KErrGeneral;
3342 void CTestDevVideoCiuPlayStepFrameComplete::MmvproKeyFrameModeRequest()
3344 iError = KErrNotSupported;
3347 //------------------------------------------------------------------
3349 CTestDevVideoCiuPlayKeyFrameModeRequest::CTestDevVideoCiuPlayKeyFrameModeRequest(const TDesC& aTestName)
3350 :CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
3354 CTestDevVideoCiuPlayKeyFrameModeRequest* CTestDevVideoCiuPlayKeyFrameModeRequest::NewL(const TDesC& aTestName)
3356 CTestDevVideoCiuPlayKeyFrameModeRequest* self = new(ELeave) CTestDevVideoCiuPlayKeyFrameModeRequest(aTestName);
3360 TVerdict CTestDevVideoCiuPlayKeyFrameModeRequest::DoTestStepPreambleL()
3362 // Call the base class first
3363 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
3367 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
3369 if (err != KErrNone)
3371 ret = EInconclusive;
3372 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
3378 TVerdict CTestDevVideoCiuPlayKeyFrameModeRequest::DoTestL()
3380 TVerdict ret = EFail;
3382 INFO_PRINTF1(_L("DevVideo CIU Play Rate Control Interface Initialisation"));
3385 MMmfVideoPlayRateControl* interface = NULL;
3387 interface = static_cast<MMmfVideoPlayRateControl*>
3388 (iDevVideoPlay->CustomInterface(iHwDeviceId,
3389 KUidMmfVideoPlayRateControl));
3392 ERR_PRINTF1(_L("Error - no interface retrieved for Play Rate"));
3397 INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Instantiated"));
3399 // Fetch test interface
3400 MDevVideoCiuTestInterfaceVideoPlayRateControl* testInterface = NULL;
3401 testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlayRateControl*>
3402 (iDevVideoPlay->CustomInterface(iHwDeviceId,
3403 KUidDevVideoCiuTestInterfaceVideoPlayRateControl));
3406 ERR_PRINTF1(_L("Failed to create the test interface for Play rate control."));
3411 // Set the observer to callback!
3412 MMmfVideoPlayRateObserver* obs = this;
3413 interface->MmvprcSetObserver(*obs);
3415 INFO_PRINTF1(_L("Requesting the key frame mode request Callback..."));
3416 testInterface->MdvproKeyFrameModeRequestCallback();
3418 if ((iError != KErrNone) && (!iCallbackReceived))
3420 ERR_PRINTF1(_L("Error receiving the key frame mode request Callback."));
3425 INFO_PRINTF1(_L("Successfully retrieved the key frame mode request Callback"));
3433 //from MMmfVideoPlayRateObserver
3434 void CTestDevVideoCiuPlayKeyFrameModeRequest::MmvproStepFrameComplete(TTimeIntervalMicroSeconds /*aTimestamp*/)
3436 iError = KErrNotSupported;
3439 void CTestDevVideoCiuPlayKeyFrameModeRequest::MmvproKeyFrameModeRequest()
3441 INFO_PRINTF1(_L("Key frame mode request callback received."));
3442 iCallbackReceived = ETrue;
3447 //------------------------------------------------------------------
3449 CTestDevVideoCiuHwDeviceTunnel* CTestDevVideoCiuHwDeviceTunnel::NewL(const TDesC& aTestName)
3451 CTestDevVideoCiuHwDeviceTunnel* self = new(ELeave) CTestDevVideoCiuHwDeviceTunnel(aTestName);
3455 CTestDevVideoCiuHwDeviceTunnel::CTestDevVideoCiuHwDeviceTunnel(const TDesC& aTestName)
3456 :CTestDevVideoCiuPlayStep(aTestName)
3460 TVerdict CTestDevVideoCiuHwDeviceTunnel::DoTestStepPreambleL()
3462 // Call the base class first
3463 TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
3467 TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
3469 if (err != KErrNone)
3471 ret = EInconclusive;
3472 ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
3478 TVerdict CTestDevVideoCiuHwDeviceTunnel::DoTestL()
3480 INFO_PRINTF1(_L("DevVideo CIU HwDeviceTunnel Initialisation"));
3483 MMmfVideoHwDeviceTunnel* interface = static_cast<MMmfVideoHwDeviceTunnel*>
3484 (iDevVideoPlay->CustomInterface(iHwDeviceId, KUidMmfVideoHwDeviceTunnel));
3488 ERR_PRINTF1(_L("Failed to create interface for HwDevice Tunnel"));
3492 INFO_PRINTF1(_L("Created interface for HwDevice Tunnel"));
3494 // Fetch test interface
3495 MDevVideoCiuTestInterfaceHwDeviceTunnel* testInterface =
3496 static_cast<MDevVideoCiuTestInterfaceHwDeviceTunnel*>
3497 (iDevVideoPlay->CustomInterface(iHwDeviceId,
3498 KUidDevVideoCiuTestInterfaceHwDeviceTunnel));
3501 ERR_PRINTF1(_L("Failed to create test interface for HwDevice Tunnel"));
3505 INFO_PRINTF1(_L("Created test interface for HwDevice Tunnel"));
3507 CMMFVideoHwDevice* hwDevice = interface->MmvhdtHwDevice();
3508 if (hwDevice != reinterpret_cast<CMMFVideoHwDevice*>(0x11111111))
3510 INFO_PRINTF1(_L("MmvhdtHwDevice() failed"));
3514 INFO_PRINTF1(_L("MmvhdtHwDevice() succeeded"));
3516 interface->MmvhdtSetupTunnelL(reinterpret_cast<CMMFVideoHwDevice*>(0x22222222));
3518 hwDevice = testInterface->MhdtHwDevice();
3519 if (hwDevice != reinterpret_cast<CMMFVideoHwDevice*>(0x22222222))
3521 INFO_PRINTF1(_L("MmvhdtSetupTunnelL() failed"));
3525 INFO_PRINTF1(_L("MmvhdtSetupTunnelL() succeeded"));