mm_plat/audio_routing_api/tsrc/AudioRoutingTestClass/src/AudioRoutingTestClassBlocks.cpp
changeset 58 b6dbf97aba93
parent 0 40261b775718
equal deleted inserted replaced
57:1cbb0d5bf7f2 58:b6dbf97aba93
   564 	    	}
   564 	    	}
   565 		}
   565 		}
   566 	else if (object == KTagVideoPlayer)
   566 	else if (object == KTagVideoPlayer)
   567 		{
   567 		{
   568 		aItem.GetNextString ( object );
   568 		aItem.GetNextString ( object );
   569 		if(object==_L("Input"))
       
   570 			{
       
   571 			isInput = ETrue;
       
   572 			}
       
   573 		else if(object==_L("Output"))
       
   574 			{
       
   575 			isInput = EFalse;
       
   576 			}
       
   577 		error = KErrNone;
   569 		error = KErrNone;
   578 		TRAP(error, CreateSessionAndScreen());
   570 		TRAP(error, CreateSessionAndScreen());
   579 		TRAP(error, CreateWindowGroup());
   571 		TRAP(error, CreateWindowGroup());
   580 		TRAP(error, CreateVideoWindow());
   572 		TRAP(error, CreateVideoWindow());
   581 		TRAP(error, CreateVideoObject(aItem));
   573 		TRAP(error, CreateVideoObject());	    
   582 
   574 		}
   583 		}
   575 	else if(object == KTagVideoRecord)
       
   576 	    {
       
   577         TRAP(error, CreateVideoRecorderObject());        
       
   578 	    }
   584 	if (error == KErrNone)
   579 	if (error == KErrNone)
   585 		{
   580 		{
   586 	    AddExpectedEvent(EInitializeComplete, KMediumTimeout);
   581 	    AddExpectedEvent(EInitializeComplete, KMediumTimeout);
   587 		}
   582 		}
   588 	else
   583 	else
   604 	iLog->Log(_L("The AudioInput to create is with [%S]"),&object);
   599 	iLog->Log(_L("The AudioInput to create is with [%S]"),&object);
   605 
   600 
   606 	if ( object == KTagVideoRecord )
   601 	if ( object == KTagVideoRecord )
   607 		{
   602 		{
   608 		FTRACE(FPrint(_L("CAudioRoutingTest::CAudioInput")));
   603 		FTRACE(FPrint(_L("CAudioRoutingTest::CAudioInput")));
   609 		iLog->Log(_L("CAudioRoutingTest::CAudioInput"));
   604 		iLog->Log(_L("CAudioRoutingTest::CAudioInput"));		
   610 		iVideoRecord = NULL;
       
   611 		TRAP(error, iAudioInput = CAudioInput::NewL(*iVideoRecord));
   605 		TRAP(error, iAudioInput = CAudioInput::NewL(*iVideoRecord));
   612 		if (error == KErrNone)
   606 		if (error == KErrNone)
   613 			{
   607 			{
   614 			iLog->Log(_L("CAudioInput::NewL(*iVideoRecord) OK"));
   608 			iLog->Log(_L("CAudioInput::NewL(*iVideoRecord) OK"));
   615 			}
   609 			}
   766 		{
   760 		{
   767 		iLog->Log(_L(" No Intut Data"));
   761 		iLog->Log(_L(" No Intut Data"));
   768 		}
   762 		}
   769 	if (error != KErrNone)
   763 	if (error != KErrNone)
   770 	    {
   764 	    {
   771 	     iLog->Log(_L("CAudioRoutingTestClass::CreateAudioInput ERROR [%d]"),error);
   765 	     iLog->Log(_L("CAudioRoutingTestClass::CreateAudioInput ERROR [%d] for [%s]"),error,&object);
   772 	    }
   766 	    }
   773 	return error;
   767 	return error;
   774 }
   768 }
   775 
   769 
   776 void CAudioRoutingTestClass::CreateInput()
   770 void CAudioRoutingTestClass::CreateInput()
   864 		}
   858 		}
   865 
   859 
   866     return error;
   860     return error;
   867 	}
   861 	}
   868 
   862 
   869 TInt CAudioRoutingTestClass::CreateVideoObject( CStifItemParser& aItem )
   863 TInt CAudioRoutingTestClass::CreateVideoObject( )
   870 	{
   864 	{
   871 	TInt error = KErrNone;
   865     TInt error = KErrNone;
   872 	TPtrC object;
   866 
   873 	aItem.GetNextString ( object );
   867 
   874 	TRAP(error, iVideoPlayerUtility = CVideoPlayerUtility::NewL ( *this,
   868     TRAP(error, iVideoPlayerUtility = CVideoPlayerUtility::NewL ( *this,
   875             EMdaPriorityNormal,
   869                     EMdaPriorityNormal,
   876             EMdaPriorityPreferenceNone,
   870                     EMdaPriorityPreferenceNone,
   877             iWindowSession,
   871                     iWindowSession,
   878 			*iScreenDevice,
   872                     *iScreenDevice,
   879 			iWindow,
   873                     iWindow,
   880 			iRect,
   874                     iRect,
   881 			iRect));
   875                     iRect));
   882 	if (error == KErrNone)
       
   883 		{
       
   884 		TRAP(error, iVideoPlayerUtility->OpenFileL(K3gpTestFile));
       
   885 		if (error == KErrNone)
       
   886 			{
       
   887 			if (!(isInput))
       
   888 				{
       
   889 				TRAP(error, iVideoRecord = CVideoRecorderUtility::NewL(*this));
       
   890 				}
       
   891 			}
       
   892 		}
       
   893     if (error == KErrNone)
   876     if (error == KErrNone)
   894     	{
   877         {
   895     	EndDrawing();
   878         TRAP(error, iVideoPlayerUtility->OpenFileL(K3gpTestFile));
   896     	iWindow.Close();
   879         //		AddExpectedEvent(EInitializeComplete, 6000);	
   897     	iWindowGroup.Close();
   880         CActiveScheduler::Start();
   898     	}
   881         }
       
   882     if (error == KErrNone)
       
   883         {
       
   884         EndDrawing();
       
   885         iWindow.Close();
       
   886         iWindowGroup.Close();
       
   887         }
       
   888     return error;
       
   889 
       
   890     }
       
   891 TInt CAudioRoutingTestClass::CreateVideoRecorderObject()
       
   892     {
       
   893     TInt error = KErrNone;
       
   894     TRAP(error, iVideoRecord = CVideoRecorderUtility::NewL(*this));
       
   895 
       
   896             if (error == KErrNone)
       
   897                 {
       
   898 //                const TUid KVidTstControllerUid = {0x101F8503};
       
   899                 TUid NULLUid ={0};
       
   900                 
       
   901                 TRAP(error,iVideoRecord->OpenFileL(K3gpTestFile, NULL, NULLUid, NULLUid));                
       
   902                 }
   899 
   903 
   900     return error;
   904     return error;
   901 	}
   905 	}
   902 
   906 
   903 TInt CAudioRoutingTestClass::CreateWindowGroup()
   907 TInt CAudioRoutingTestClass::CreateWindowGroup()
  1008 	return KErrNone;
  1012 	return KErrNone;
  1009    }
  1013    }
  1010 
  1014 
  1011 TInt CAudioRoutingTestClass::SetSecureOutputL()
  1015 TInt CAudioRoutingTestClass::SetSecureOutputL()
  1012    {
  1016    {
       
  1017         TInt err;
  1013 	if(iAudioOutput)
  1018 	if(iAudioOutput)
  1014 		{
  1019 	   {
  1015 		iAudioOutput->SetSecureOutputL(EFalse);
  1020 	    TRAP(err,iAudioOutput->SetSecureOutputL(EFalse));
  1016 		}
  1021 	   }
  1017 	iLog->Log(_L("iAudioOutput - SetSecureOutputL "));
  1022 	if(err == KErrNotSupported)
  1018 	return KErrNone;
  1023 	   {
       
  1024 	   iLog->Log(_L("SetsecureoutputL is deprecated,so not supported"));
       
  1025 	   return KErrNone;
       
  1026 	   }
       
  1027 	else
       
  1028 	   {
       
  1029 	   return KErrGeneral;
       
  1030 	   }
       
  1031 	
  1019    }
  1032    }
  1020 
  1033 
  1021 TInt CAudioRoutingTestClass::UnregisterObserver()
  1034 TInt CAudioRoutingTestClass::UnregisterObserver()
  1022    {
  1035    {
  1023 	iLog->Log(_L("iAudioOutput - UnregisterObserver INIT"));
  1036 	iLog->Log(_L("iAudioOutput - UnregisterObserver INIT"));