# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1272880792 -10800 # Node ID 80975da524206df79220ca96ddeb293df49159f4 # Parent 5a06f39ad45b06a2c96c8f217e4e7b59249292f1 Revision: 201015 Kit: 201018 diff -r 5a06f39ad45b -r 80975da52420 mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudioplaycontroller/Src/3GPAudioPlayControllerPlugin.cpp --- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudioplaycontroller/Src/3GPAudioPlayControllerPlugin.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudioplaycontroller/Src/3GPAudioPlayControllerPlugin.cpp Mon May 03 12:59:52 2010 +0300 @@ -109,6 +109,7 @@ delete iAudioUtility; // see 3gp delete iAacUtil; iAudioUtility = NULL; + iAacUtil = NULL; iDataSourceAdapter = C3gpDataSourceAdapter::NewL(); iSharedBufferMaxNum = 1; iSharedBufferMaxSize = KFirstBufferSize; diff -r 5a06f39ad45b -r 80975da52420 mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioPlayController.cpp --- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioPlayController.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioPlayController.cpp Mon May 03 12:59:52 2010 +0300 @@ -801,6 +801,7 @@ User::Leave(KErrAlreadyExists); } + // set iReadHeader here in case prime is not called before set position is used. // reset before adding data source DP0(_L("CAdvancedAudioPlayController::AddDataSourceL reseting iSharedBufferCnt iReadHeader iInitPosition position vars")); @@ -1654,7 +1655,7 @@ TTimeIntervalMicroSeconds positionMicroSeconds(0); - if (iState == EPlaying) + if (iState == EPlaying || iState == EAutoPaused) { DP1 (_L("CAdvancedAudioPlayController::PositionL iTimePositionInMicroSecs [%d] msec"), iTimePositionInMicroSecs); // adjust the position here since devsound returns the incremented postion value during loopplay @@ -2218,8 +2219,12 @@ DP0(_L("CAdvancedAudioPlayController::DoInitializeSinkL")); iSinkInitDataReady = EFalse; + if (!iAudioOutput) + { + User::Leave(KErrNotReady); + } //both source and sink have been added - if(iAudioOutput && iDataSourceAdapter) + if(iDataSourceAdapter) { iAudioOutput->SetDataSourceAdapter(iDataSourceAdapter); } @@ -2247,20 +2252,15 @@ // Read the default codec configuration parameters from resource file RArray& codecConfigData = const_cast&>(iAudioResource->CodecConfigParametersL()); // Override default values with values found from header, if available - GetCodecConfigData(codecConfigData); - if (!iAudioOutput) - { - User::Leave(KErrNotReady); - } - else - { - iAudioOutput->ConfigureL(iSampleRate, iSinkNumChannels, iDataType, codecConfigData); - DP0(_L("CAdvancedAudioPlayController::DoInitializeSinkL, output configured")); - iAudioOutput->PrimeL(); - DP0(_L("CAdvancedAudioPlayController::DoInitializeSinkL, output primed")); - } - // we would use this code when we have a NULL sink -/* if (iDuration > 0) + GetCodecConfigData(codecConfigData); + iAudioOutput->ConfigureL(iSampleRate, iSinkNumChannels, iDataType, codecConfigData); + DP0(_L("CAdvancedAudioPlayController::DoInitializeSinkL, output configured")); + iAudioOutput->PrimeL(); + DP0(_L("CAdvancedAudioPlayController::DoInitializeSinkL, output primed")); + + // we would use this code when we have a NULL sink + + /* if (iDuration > 0) { DP0(_L("CAdvancedAudioPlayController::BufferFilledL, unblocking duration")); iBlockDuration = EFalse; diff -r 5a06f39ad45b -r 80975da52420 mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Data/101FAFB3.rss --- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Data/101FAFB3.rss Fri Apr 16 15:29:42 2010 +0300 +++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Data/101FAFB3.rss Mon May 03 12:59:52 2010 +0300 @@ -46,7 +46,7 @@ version_no = 1; display_name = "AAC Audio Controller Plugin"; default_data = "?"; - opaque_data = "Nokia0x101F5D07

0x101FAFB5"; + opaque_data = "Nokia0x101F5D07

0x101FAFB50x200000"; rom_only = 0; } }; diff -r 5a06f39ad45b -r 80975da52420 mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Data/101FAFB9.rss --- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Data/101FAFB9.rss Fri Apr 16 15:29:42 2010 +0300 +++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Data/101FAFB9.rss Mon May 03 12:59:52 2010 +0300 @@ -46,7 +46,7 @@ version_no = 1; display_name = "AMR Audio Play Controller Plugin"; default_data = "?"; - opaque_data = "Nokia0x101F5D07

0x101FAFBB"; + opaque_data = "Nokia0x101F5D07

0x101FAFBB0x200000"; rom_only = 0; } }; diff -r 5a06f39ad45b -r 80975da52420 mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Data/101FAFBC.rss --- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Data/101FAFBC.rss Fri Apr 16 15:29:42 2010 +0300 +++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Data/101FAFBC.rss Mon May 03 12:59:52 2010 +0300 @@ -46,7 +46,7 @@ version_no = 1; display_name = "AWB Audio Play Controller Plugin"; default_data = "?"; - opaque_data = "Nokia0x101F5D07

0x101FAFBE"; + opaque_data = "Nokia0x101F5D07

0x101FAFBE0x200000"; rom_only = 0; } }; diff -r 5a06f39ad45b -r 80975da52420 mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Data/101FAFB6.rss --- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Data/101FAFB6.rss Fri Apr 16 15:29:42 2010 +0300 +++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Data/101FAFB6.rss Mon May 03 12:59:52 2010 +0300 @@ -46,7 +46,7 @@ version_no = 1; display_name = "MP3 Audio Controller Plugin"; default_data = "?"; - opaque_data = "Nokia0x101F5D07

0x101FAFB8"; + opaque_data = "Nokia0x101F5D07

0x101FAFB80x200000"; rom_only = 0; } }; diff -r 5a06f39ad45b -r 80975da52420 mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/ClientProgDLSource.h --- a/mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/ClientProgDLSource.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/ClientProgDLSource.h Mon May 03 12:59:52 2010 +0300 @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include diff -r 5a06f39ad45b -r 80975da52420 mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/DownloadGateway.h --- a/mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/DownloadGateway.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/DownloadGateway.h Mon May 03 12:59:52 2010 +0300 @@ -20,7 +20,7 @@ #define DOWNLOADGATEWAY_H #include -#include +#include #include namespace multimedia diff -r 5a06f39ad45b -r 80975da52420 mmfenh/profilesettingsmonitor/inc/ProfileSettingsMonitorServerImpl.h --- a/mmfenh/profilesettingsmonitor/inc/ProfileSettingsMonitorServerImpl.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmfenh/profilesettingsmonitor/inc/ProfileSettingsMonitorServerImpl.h Mon May 03 12:59:52 2010 +0300 @@ -42,7 +42,7 @@ public MProEngActiveProfileObserver { public: - IMPORT_C static CProfileSettingsMonitorServerImpl* NewL(); + static CProfileSettingsMonitorServerImpl* NewL(); ~CProfileSettingsMonitorServerImpl(); //MProEngProfileActivationObserver diff -r 5a06f39ad45b -r 80975da52420 mmfenh/progressivedownload/ProgressiveDownloadUtility/group/PDProperties.mmp --- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/group/PDProperties.mmp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmfenh/progressivedownload/ProgressiveDownloadUtility/group/PDProperties.mmp Mon May 03 12:59:52 2010 +0300 @@ -37,7 +37,6 @@ SYSTEMINCLUDE /epoc32/include/mmf/server SYSTEMINCLUDE /epoc32/include/kernel SYSTEMINCLUDE /epoc32/include/mmf/common -SYSTEMINCLUDE /epoc32/include/mm SYSTEMINCLUDE /epoc32/include/caf SOURCEPATH ../src diff -r 5a06f39ad45b -r 80975da52420 mmfenh/progressivedownload/ProgressiveDownloadUtility/group/ProgressiveDownloadUtility.mmp --- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/group/ProgressiveDownloadUtility.mmp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmfenh/progressivedownload/ProgressiveDownloadUtility/group/ProgressiveDownloadUtility.mmp Mon May 03 12:59:52 2010 +0300 @@ -37,7 +37,7 @@ SYSTEMINCLUDE /epoc32/include/mmf/server SYSTEMINCLUDE /epoc32/include/kernel SYSTEMINCLUDE /epoc32/include/mmf/common -SYSTEMINCLUDE /epoc32/include/mm + SOURCEPATH ../src diff -r 5a06f39ad45b -r 80975da52420 mmfenh/progressivedownload/ProgressiveDownloadUtility/src/EMCPdPlayUtility.h --- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/EMCPdPlayUtility.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/EMCPdPlayUtility.h Mon May 03 12:59:52 2010 +0300 @@ -32,7 +32,7 @@ #include -#include +#include #include "MAudioPdPlayUtility.h" #include "MProgressiveDownloadUtility.h" diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/configuration_components_factory_api/inc/ConfigurationComponentsFactory.h --- a/mmmw_plat/configuration_components_factory_api/inc/ConfigurationComponentsFactory.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/configuration_components_factory_api/inc/ConfigurationComponentsFactory.h Mon May 03 12:59:52 2010 +0300 @@ -76,15 +76,19 @@ * Constructor * */ + #ifdef __WINSCW__ IMPORT_C CConfigurationComponentsFactory(); + IMPORT_C void ConstructL(); + #else + CConfigurationComponentsFactory(); + void ConstructL(); + #endif /** * Second phase constructor. The derived class should call this during * construction. * */ - IMPORT_C void ConstructL(); - protected: // Data // Actual implementation class. class CBody; diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/enhanced_media_client_api/tsrc/Conf/EnhanMediaTestClass.cfg --- a/mmmw_plat/enhanced_media_client_api/tsrc/Conf/EnhanMediaTestClass.cfg Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/enhanced_media_client_api/tsrc/Conf/EnhanMediaTestClass.cfg Mon May 03 12:59:52 2010 +0300 @@ -55,8 +55,8 @@ AudioEnhs CreateSink AudioEnhs AddObserver 4 AudioEnhs StreamAddSink 4 -AudioEnhs ControlTypeL 4 -AudioEnhs ControlControlTypeL 4 +AudioEnhs Control_Type 4 +AudioEnhs Control_ControlType 4 //waittestclass AudioEnhs AudioEnhs StreamRemoveSink 4 AudioEnhs RemoveObserver 4 @@ -72,11 +72,22 @@ AudioEnhs CreateStream AudioEnhs CreateEffect 7 AudioEnhs AddObserver 7 +AudioEnhs CreateEffect 20 +AudioEnhs AddObserver 20 AudioEnhs StreamAddEffect 7 waittestclass AudioEnhs +AudioEnhs StreamAddEffect 20 +waittestclass AudioEnhs +AudioEnhs Control_Type 20 +AudioEnhs Control_ControlType 20 + +AudioEnhs BalGetBalance AudioEnhs RemoveObserver 7 AudioEnhs RemoveEffect 7 AudioEnhs DeleteEffect 7 +AudioEnhs RemoveObserver 20 +AudioEnhs RemoveEffect 20 +AudioEnhs DeleteEffect 20 AudioEnhs DeleteFactory delete AudioEnhs [Endtest] @@ -90,13 +101,6 @@ AudioEnhs AddObserver 9 AudioEnhs StreamAddEffect 9 waittestclass AudioEnhs -allownextresult -18 -AudioEnhs AudioEffect_Enable 9 -allownextresult -18 -AudioEnhs EffectApply 7 -allownextresult -18 -AudioEnhs AudioEffect_Disable 9 -allownextresult -18 AudioEnhs RemoveObserver 9 AudioEnhs RemoveEffect 9 AudioEnhs DeleteEffect 9 @@ -111,8 +115,8 @@ AudioEnhs CreateStream AudioEnhs AddObserver 3 //waittestclass AudioEnhs -AudioEnhs ControlTypeL 3 -AudioEnhs ControlControlTypeL 3 +AudioEnhs Control_Type 3 +AudioEnhs Control_ControlType 3 AudioEnhs RemoveObserver 3 AudioEnhs DeleteStream AudioEnhs DeleteFactory @@ -132,9 +136,11 @@ AudioEnhs AddObserver 4 AudioEnhs CreateEffect 7 AudioEnhs AddObserver 7 + AudioEnhs StreamAddSource 0 AudioEnhs StreamAddSink 4 AudioEnhs StreamAddEffect 7 + waittestclass AudioEnhs AudioEnhs FileSOpen AudioEnhs StreamOpen @@ -195,6 +201,11 @@ AudioEnhs EffectApply 7 pause 5000 AudioEnhs StreamStart + +AudioEnhs AudioEffect_Disable 7 + + + AudioEnhs CloseSource AudioEnhs StreamClose waittestclass AudioEnhs @@ -279,8 +290,8 @@ AudioEnhs DRMRemoveAllowedOutputDevice 2 //AudioEnhs DRMGetAllowedOutputDevice 4 //AudioEnhs DRMRemoveAllowedOutputDevice 4 -AudioEnhs ControlTypeL 1 -AudioEnhs ControlControlTypeL 1 +AudioEnhs Control_Type 1 +AudioEnhs Control_ControlType 1 pause 3000 AudioEnhs StreamStart pause 5000 @@ -316,10 +327,10 @@ AudioEnhs StreamStart pause 4000 AudioEnhs StreamPause -AudioEnhs ControlTypeL 2 -AudioEnhs ControlControlTypeL 2 -AudioEnhs ControlTypeL 3 -AudioEnhs ControlControlTypeL 3 +AudioEnhs Control_Type 2 +AudioEnhs Control_ControlType 2 +AudioEnhs Control_Type 3 +AudioEnhs Control_ControlType 3 AudioEnhs DescSGetBitRate AudioEnhs DSGetSize pause 2000 @@ -358,8 +369,8 @@ AudioEnhs StreamStart pause 4000 AudioEnhs StreamPause -AudioEnhs ControlTypeL 2 -AudioEnhs ControlControlTypeL 2 +AudioEnhs Control_Type 2 +AudioEnhs Control_ControlType 2 AudioEnhs DescSGetBitRate AudioEnhs DSGetSize pause 2000 @@ -401,10 +412,10 @@ AudioEnhs AudioEffect_Enforce 1 AudioEnhs AudioEffect_IsEnabled AudioEnhs AudioEffect_HaveUpdateRights -AudioEnhs ControlTypeL 0 -AudioEnhs ControlControlTypeL 0 -AudioEnhs ControlTypeL 5 -AudioEnhs ControlControlTypeL 5 +AudioEnhs Control_Type 0 +AudioEnhs Control_ControlType 0 +AudioEnhs Control_Type 5 +AudioEnhs Control_ControlType 5 AudioEnhs FileSGetSize AudioEnhs FileSGetBitRate AudioEnhs StreamStart @@ -470,10 +481,10 @@ AudioEnhs StreamGetPositionL AudioEnhs StreamSetPositionL 0 AudioEnhs StreamGetPositionL -AudioEnhs ControlTypeL 0 -AudioEnhs ControlControlTypeL 0 -AudioEnhs ControlTypeL 5 -AudioEnhs ControlControlTypeL 5 +AudioEnhs Control_Type 0 +AudioEnhs Control_ControlType 0 +AudioEnhs Control_Type 5 +AudioEnhs Control_ControlType 5 pause 3000 AudioEnhs StreamStart pause 4000 @@ -563,8 +574,8 @@ AudioEnhs ER_SetRoomHFLevel 0 AudioEnhs ER_SetRoomLevel -1000 AudioEnhs AudioEffect_IsEnabled -//AudioEnhs AudioEffect_IsEnforced -//AudioEnhs AudioEffect_Uid +AudioEnhs AudioEffect_IsEnforced +AudioEnhs AudioEffect_Uid AudioEnhs AudioEffect_HaveUpdateRights AudioEnhs AudioEffect_Enforce 1 pause 2000 @@ -574,8 +585,8 @@ AudioEnhs EffectApply 8 AudioEnhs StreamPause pause 2000 -AudioEnhs ControlTypeL 8 -AudioEnhs ControlControlTypeL 8 +AudioEnhs Control_Type 8 +AudioEnhs Control_ControlType 8 AudioEnhs StreamStart AudioEnhs CloseSource AudioEnhs StreamClose @@ -629,10 +640,20 @@ waittestclass AudioEnhs AudioEnhs StreamPrime waittestclass AudioEnhs -AudioEnhs ControlTypeL 9 -AudioEnhs ControlControlTypeL 9 +AudioEnhs Control_Type 9 +AudioEnhs Control_ControlType 9 AudioEnhs StreamStart pause 5000 + +AudioEnhs AudioEffect_IsEnabled +AudioEnhs AudioEffect_IsEnforced +AudioEnhs AudioEffect_Enable 9 +AudioEnhs AudioEffect_Uid +AudioEnhs AudioEffect_HaveUpdateRights +AudioEnhs AudioEffect_Enforce 1 +AudioEnhs EffectApply 9 +AudioEnhs AudioEffect_Disable 9 + AudioEnhs CloseSource AudioEnhs StreamClose waittestclass AudioEnhs @@ -675,16 +696,16 @@ AudioEnhs SW_SetStereoWideningLevelL 100 waittestclass AudioEnhs AudioEnhs AudioEffect_IsEnabled -//AudioEnhs AudioEffect_IsEnforced -//AudioEnhs AudioEffect_Uid +AudioEnhs AudioEffect_IsEnforced +AudioEnhs AudioEffect_Uid AudioEnhs AudioEffect_HaveUpdateRights AudioEnhs AudioEffect_Enforce 1 pause 2000 AudioEnhs StreamStart AudioEnhs EffectApply 10 pause 5000 -AudioEnhs ControlTypeL 10 -AudioEnhs ControlControlTypeL 10 +AudioEnhs Control_Type 10 +AudioEnhs Control_ControlType 10 AudioEnhs AudioEffect_Disable 10 AudioEnhs CloseSource AudioEnhs StreamClose @@ -725,12 +746,12 @@ waittestclass AudioEnhs AudioEnhs AudioEffect_Enable 11 AudioEnhs AudioEffect_IsEnabled -//AudioEnhs AudioEffect_IsEnforced -//AudioEnhs AudioEffect_Uid +AudioEnhs AudioEffect_IsEnforced +AudioEnhs AudioEffect_Uid AudioEnhs AudioEffect_HaveUpdateRights AudioEnhs AudioEffect_Enforce 1 -AudioEnhs ControlTypeL 11 -AudioEnhs ControlControlTypeL 11 +AudioEnhs Control_Type 11 +AudioEnhs Control_ControlType 11 pause 2000 AudioEnhs StreamStart AudioEnhs EffectApply 11 @@ -769,6 +790,7 @@ AudioEnhs AddObserver 12 AudioEnhs StreamAddSource 0 AudioEnhs StreamAddSink 4 +AudioEnhs AttachReverb AudioEnhs StreamAddEffect 8 AudioEnhs StreamAddEffect 12 waittestclass AudioEnhs @@ -776,23 +798,26 @@ AudioEnhs StreamOpen waittestclass AudioEnhs AudioEnhs StreamPrime +waittestclass AudioEnhs AudioEnhs EffectApply 8 AudioEnhs EffectApply 12 -waittestclass AudioEnhs +AudioEnhs AudioEffect_Enable 12 AudioEnhs RL_LevelRangeL AudioEnhs RL_SetRoomLevelL -200 AudioEnhs RL_LevelL -AudioEnhs ControlTypeL 12 -AudioEnhs ControlControlTypeL 12 -pause 2000 +AudioEnhs Control_Type 12 +AudioEnhs Control_ControlType 12 +pause 1000 AudioEnhs AudioEffect_IsEnabled -//AudioEnhs AudioEffect_IsEnforced -//AudioEnhs AudioEffect_Uid +AudioEnhs AudioEffect_IsEnforced +AudioEnhs AudioEffect_Uid AudioEnhs AudioEffect_HaveUpdateRights AudioEnhs AudioEffect_Enforce 1 pause 2000 AudioEnhs StreamStart pause 5000 +AudioEnhs AudioEffect_Enable 8 + AudioEnhs AudioEffect_Disable 12 AudioEnhs AudioEffect_Disable 8 pause 2000 @@ -800,9 +825,11 @@ AudioEnhs StreamClose waittestclass AudioEnhs AudioEnhs RemoveObserver 12 +AudioEnhs RemoveObserver 8 AudioEnhs RemoveObserver 4 AudioEnhs RemoveObserver 0 AudioEnhs RemoveObserver 3 +AudioEnhs DetachReverb AudioEnhs RemoveEffect 12 AudioEnhs RemoveEffect 8 AudioEnhs DeleteStream @@ -838,12 +865,19 @@ AudioEnhs DA_DistanceAttenuationL AudioEnhs DA_RollOffFactorMaxL AudioEnhs DA_RoomRollOffFactorMaxL -AudioEnhs ControlTypeL 13 -AudioEnhs ControlControlTypeL 13 +AudioEnhs Control_Type 13 +AudioEnhs Control_ControlType 13 waittestclass AudioEnhs AudioEnhs StreamStart AudioEnhs EffectApply 13 pause 5000 + +AudioEnhs AudioEffect_IsEnabled +AudioEnhs AudioEffect_Enforce 1 +AudioEnhs AudioEffect_IsEnforced +AudioEnhs AudioEffect_Uid +AudioEnhs AudioEffect_HaveUpdateRights + AudioEnhs AudioEffect_Disable 13 AudioEnhs CloseSource AudioEnhs StreamClose @@ -884,14 +918,22 @@ AudioEnhs AudioEffect_Enable 17 AudioEnhs SL_LocationCartesianL 17 AudioEnhs SL_LocationSphericalL 17 -AudioEnhs ControlTypeL 17 -AudioEnhs ControlControlTypeL 17 +AudioEnhs Control_Type 17 +AudioEnhs Control_ControlType 17 waittestclass AudioEnhs AudioEnhs StreamStart AudioEnhs EffectApply 17 pause 5000 AudioEnhs SL_SetLocationCartesianL 17 0 0 0 AudioEnhs SL_SetLocationSphericalL 17 0 0 0 + +AudioEnhs AudioEffect_IsEnabled +AudioEnhs AudioEffect_Enforce 1 +AudioEnhs AudioEffect_IsEnforced +AudioEnhs AudioEffect_Uid +AudioEnhs AudioEffect_HaveUpdateRights + + AudioEnhs AudioEffect_Disable 17 AudioEnhs CloseSource AudioEnhs StreamClose @@ -932,14 +974,22 @@ AudioEnhs AudioEffect_Enable 16 AudioEnhs SL_LocationCartesianL 16 AudioEnhs SL_LocationSphericalL 16 -AudioEnhs ControlTypeL 16 -AudioEnhs ControlControlTypeL 16 +AudioEnhs Control_Type 16 +AudioEnhs Control_ControlType 16 waittestclass AudioEnhs AudioEnhs StreamStart AudioEnhs EffectApply 16 pause 5000 AudioEnhs SL_SetLocationCartesianL 16 0 0 0 AudioEnhs SL_SetLocationSphericalL 16 0 0 0 + +AudioEnhs AudioEffect_IsEnabled +AudioEnhs AudioEffect_Enforce 1 +AudioEnhs AudioEffect_IsEnforced +AudioEnhs AudioEffect_Uid +AudioEnhs AudioEffect_HaveUpdateRights + + AudioEnhs AudioEffect_Disable 16 pause 2000 AudioEnhs CloseSource @@ -982,10 +1032,18 @@ AudioEnhs AudioEffect_Enable 18 AudioEnhs LO_OrientationL 18 AudioEnhs LO_OrientationVectorsL 18 -AudioEnhs ControlTypeL 18 -AudioEnhs ControlControlTypeL 18 +AudioEnhs Control_Type 18 +AudioEnhs Control_ControlType 18 AudioEnhs StreamStart +AudioEnhs EffectApply 18 pause 5000 + +AudioEnhs AudioEffect_IsEnabled +AudioEnhs AudioEffect_Enforce 1 +AudioEnhs AudioEffect_IsEnforced +AudioEnhs AudioEffect_Uid +AudioEnhs AudioEffect_HaveUpdateRights + AudioEnhs AudioEffect_Disable 18 AudioEnhs CloseSource AudioEnhs StreamClose @@ -1023,17 +1081,22 @@ AudioEnhs StreamOpen waittestclass AudioEnhs AudioEnhs StreamPrime -//AudioEnhs AudioEffect_Enable 19 -pause 1000 -//AudioEnhs EffectApply 19 -//AudioEnhs LO_OrientationL 19 -//AudioEnhs LO_OrientationVectorsL 19 +waittestclass AudioEnhs +AudioEnhs AudioEffect_Enable 19 +AudioEnhs LO_OrientationL 19 +AudioEnhs LO_OrientationVectorsL 19 waittestclass AudioEnhs AudioEnhs StreamStart +AudioEnhs EffectApply 19 pause 5000 -//AudioEnhs AudioEffect_Disable 19 -AudioEnhs ControlTypeL 19 -AudioEnhs ControlControlTypeL 19 +AudioEnhs AudioEffect_IsEnabled +AudioEnhs AudioEffect_Enforce 1 +AudioEnhs AudioEffect_IsEnforced +AudioEnhs AudioEffect_Uid +AudioEnhs AudioEffect_HaveUpdateRights +AudioEnhs AudioEffect_Disable 19 +AudioEnhs Control_Type 19 +AudioEnhs Control_ControlType 19 AudioEnhs CloseSource AudioEnhs StreamClose waittestclass AudioEnhs @@ -1073,6 +1136,14 @@ AudioEnhs StreamPrime waittestclass AudioEnhs AudioEnhs AudioEffect_Enable 15 + +AudioEnhs AudioEffect_IsEnabled +AudioEnhs AudioEffect_IsEnforced +AudioEnhs AudioEffect_Uid +AudioEnhs AudioEffect_HaveUpdateRights +AudioEnhs AudioEffect_Enforce 1 +AudioEnhs EffectApply 15 + AudioEnhs SD_CartesianVelocityL 15 AudioEnhs SD_SphericalVelocityL 15 AudioEnhs SD_FactorL 15 @@ -1082,8 +1153,8 @@ AudioEnhs SD_SetCartesianVelocityL 15 0 0 0 AudioEnhs StreamStart pause 5000 -AudioEnhs ControlTypeL 15 -AudioEnhs ControlControlTypeL 15 +AudioEnhs Control_Type 15 +AudioEnhs Control_ControlType 15 AudioEnhs AudioEffect_Disable 15 AudioEnhs CloseSource AudioEnhs StreamClose @@ -1124,6 +1195,13 @@ AudioEnhs StreamPrime waittestclass AudioEnhs AudioEnhs AudioEffect_Enable 14 +AudioEnhs AudioEffect_IsEnabled +AudioEnhs AudioEffect_IsEnforced +AudioEnhs AudioEffect_Uid +AudioEnhs AudioEffect_HaveUpdateRights +AudioEnhs AudioEffect_Enforce 1 +AudioEnhs EffectApply 14 + AudioEnhs SD_CartesianVelocityL 14 AudioEnhs SD_SphericalVelocityL 14 AudioEnhs SD_FactorL 15 @@ -1131,8 +1209,8 @@ AudioEnhs SD_FactorMaxL 15 AudioEnhs SD_SetSphericalVelocityL 14 0 0 0 AudioEnhs SD_SetCartesianVelocityL 14 0 0 0 -AudioEnhs ControlTypeL 14 -AudioEnhs ControlControlTypeL 14 +AudioEnhs Control_Type 14 +AudioEnhs Control_ControlType 14 AudioEnhs StreamStart pause 5000 AudioEnhs AudioEffect_Disable 14 @@ -1182,8 +1260,8 @@ #AudioEnhs PDLSGetDLRateL #AudioEnhs PDLSGetBitRateL #AudioEnhs PDLSResumeDownloadL -#AudioEnhs ControlTypeL 6 -#AudioEnhs ControlControlTypeL 6 +#AudioEnhs Control_Type 6 +#AudioEnhs Control_ControlType 6 #AudioEnhs PDLSGetSize #pause 10000 #AudioEnhs StreamStart @@ -1288,6 +1366,7 @@ AudioEnhs ER_ReflectionLevelRange AudioEnhs ER_ReverbDelay AudioEnhs ER_ReverbDelayMax +AudioEnhs ER_DelayMaxMax AudioEnhs ER_ReverbLevel AudioEnhs ER_ReverbLevelRange AudioEnhs ER_RoomHFLevel @@ -1309,8 +1388,8 @@ AudioEnhs RL_SetRoomLevelL -200 AudioEnhs RL_LevelL AudioEnhs AudioEffect_IsEnabled -//AudioEnhs AudioEffect_IsEnforced -//AudioEnhs AudioEffect_Uid +AudioEnhs AudioEffect_IsEnforced +AudioEnhs AudioEffect_Uid AudioEnhs AudioEffect_HaveUpdateRights AudioEnhs AudioEffect_Enforce 1 AudioEnhs StreamStart diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/inc/CEMCConstants.h --- a/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/inc/CEMCConstants.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/inc/CEMCConstants.h Mon May 03 12:59:52 2010 +0300 @@ -273,7 +273,7 @@ EMC_LLLocationSphericalL, EMC_LLSetLocationCartesianL, EMC_LLSetLocationSphericalL, - + EMC_ER_DelayMaxMax, EMC_NoCommand }; diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/inc/EnhanMediaTestClass.h --- a/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/inc/EnhanMediaTestClass.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/inc/EnhanMediaTestClass.h Mon May 03 12:59:52 2010 +0300 @@ -437,7 +437,9 @@ TInt HandleAudioEffectEnableL(CStifItemParser& aItem); TInt HandleAudioEffectDisableL(CStifItemParser& aItem); TInt AudioEffectIsEnforced (CStifItemParser& aItem); - +//added + TInt AudioCreateEffect (CStifItemParser& aItem); + TInt AudioEffectUid (CStifItemParser& aItem); TInt AudioEffectHaveUpdateRights (CStifItemParser& aItem); TInt AudioEffectEnforce (CStifItemParser& aItem); @@ -472,6 +474,7 @@ TInt HandleReverbSetRoomLevelL(CStifItemParser& aItem); TInt HandleReverbDelayMaxL(CStifItemParser& aItem); + TInt HandleDelayMaxL(CStifItemParser& aItem); TInt HandleSWIsContinuousLevelSupportedL(CStifItemParser& aItem); TInt HandleSWSetStereoWideningLevelL(CStifItemParser& aItem); diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/src/EnhanMediaTestClassBlocks.cpp --- a/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/src/EnhanMediaTestClassBlocks.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/src/EnhanMediaTestClassBlocks.cpp Mon May 03 12:59:52 2010 +0300 @@ -296,7 +296,8 @@ ENTRY( "AttachReverb",CEnhanMediaTestClass::AttachReverb ), ENTRY( "DetachReverb",CEnhanMediaTestClass::DetachReverb ), - + //added + ENTRY( "ER_DelayMaxMax",CEnhanMediaTestClass::HandleDelayMaxL ), }; @@ -3171,12 +3172,16 @@ iLog->Log(_L("CEnhanMediaTestClass::BalGetBalance ")); TInt status(KErrNone); + TInt status1(KErrNone); + TInt status2(KErrNone); TInt balance=0; if(!iMBalanceControl) { return status = KErrNotReady; } - status = iMBalanceControl->GetBalance(balance); + status1 = iMBalanceControl->GetBalance(balance); + status2=iMBalanceControl->SetBalance(balance); + status = status1 || status2; iLog->Log(_L("CEnhanMediaTestClass::BalGetBalance [%d]"),balance); return status; } @@ -4399,6 +4404,30 @@ return status; } +///*TInt CEnhanMediaTestClass::AudioCreateEffect (CStifItemParser& /*aItem*/) + /* { + TInt status(KErrNone); + TBool enabled; + + if(!iEffectControl) + { + status = KErrNotReady; + } + // CEqualizerEffect *ptr=iEffectControl; + //status = static_cast(iEffectControl); + // status = ptr->CreateEffectProxy(); + if (status == KErrNone) + { + iLog->Log(_L("AudioEffectIsEnabled status = %d"), status); + } + else + { + iLog->Log(_L("AudioEffectIsEnabled ERROR = [%d]"), status); + } + + return status; + } +*/ TInt CEnhanMediaTestClass::AudioEffectIsEnforced (CStifItemParser& /*aItem*/) { TInt status(KErrNone); @@ -4863,6 +4892,7 @@ return status; } + TInt CEnhanMediaTestClass::HandleReverbReflectionsDelayMaxL(CStifItemParser& /*aItem*/) { @@ -5202,6 +5232,21 @@ return status; } +TInt CEnhanMediaTestClass::HandleDelayMaxL(CStifItemParser& /*aItem*/) + { + iLog->Log(_L("CEnhanMediaTestClass::HandleReverbDelayMaxL")); + TInt status(KErrNone); + //status = aItem.GetNextInt(controltype); + TUint value; + if(!iEffectControl) + { + return status = KErrNotReady; + } + status = static_cast(iEffectControl)->DelayMax(value); + iLog->Log(_L("CEnhanMediaTestClass::HandleDelayMaxL value = [%d]"),value); + return status; + } + TInt CEnhanMediaTestClass::HandleSWIsContinuousLevelSupportedL(CStifItemParser& /*aItem*/) { iLog->Log(_L("CEnhanMediaTestClass::HandleReverbDelayMaxL")); @@ -5248,7 +5293,9 @@ TInt CEnhanMediaTestClass::LO_OrientationL (CStifItemParser& aItem) { - TInt status(KErrNone); + TInt status(KErrNone); + TInt status1(KErrNone); + TInt status2(KErrNone); if(!iEffectControl) { @@ -5264,13 +5311,15 @@ if (TControl(control) == ELISTORIENTCONTROL) { - status = static_cast(iEffectControl)->Orientation(a,b,c); + status1 = static_cast(iEffectControl)->Orientation(a,b,c); + status2=static_cast(iEffectControl)->SetOrientation(a,b,c); } else if (TControl(control) == ESOURORIENTCONTROL) { - status = static_cast(iEffectControl)->Orientation(a,b,c); + status1 = static_cast(iEffectControl)->Orientation(a,b,c); + status2= static_cast(iEffectControl)->SetOrientation(a,b,c); } - + status=status1 || status2; if (status == KErrNone) { iLog->Log(_L("LO_OrientationL status = %d"), status); @@ -5286,6 +5335,8 @@ TInt CEnhanMediaTestClass::LO_OrientationVectorsL (CStifItemParser& aItem) { TInt status(KErrNone); + TInt status1(KErrNone); + TInt status2(KErrNone); if(!iEffectControl) { @@ -5298,13 +5349,15 @@ status = aItem.GetNextInt(control); if (TControl(control) == ELISTORIENTCONTROL) { - status = static_cast(iEffectControl)->OrientationVectors(a,b,c,d,e,f); + status1 = static_cast(iEffectControl)->OrientationVectors(a,b,c,d,e,f); + status2= static_cast(iEffectControl)->SetOrientationVectors(a,b,c,d,e,f); } else if (TControl(control) == ESOURORIENTCONTROL) { - status = static_cast(iEffectControl)->OrientationVectors(a,b,c,d,e,f); + status1 = static_cast(iEffectControl)->OrientationVectors(a,b,c,d,e,f); + status2= static_cast(iEffectControl)->SetOrientationVectors(a,b,c,d,e,f); } - + status = status1 || status2; if (status == KErrNone) { @@ -5377,6 +5430,8 @@ TUint d,e; status = static_cast(iEffectControl)->DistanceAttenuation(a,b,c,d,e); iLog->Log(_L("CEnhanMediaTestClass::HandleDADistanceAttenuationL a = [%d] - b = [%d] - c = [%d] - d = [%d]- e = [%d]"),a,b,c,d,e); + //added + status=static_cast(iEffectControl)->SetDistanceAttenuation(a,b,c,d,e); return status; } TInt CEnhanMediaTestClass::HandleDARollOffFactorMaxL(CStifItemParser& /*aItem*/) @@ -6118,11 +6173,13 @@ if (TControl(control) == ELISTDOPPCONTROL) { - status = static_cast(iEffectControl)->SetCartesianVelocity(a,b,c); + + status = static_cast(iEffectControl)->SetSphericalVelocity(a,b,c); } if (TControl(control) == ESOURDOPPCONTROL) { - status = static_cast(iEffectControl)->SetCartesianVelocity(a,b,c); + + status = static_cast(iEffectControl)->SetSphericalVelocity(a,b,c); } iLog->Log(_L("CEnhanMediaTestClass::HandleSDSetSphericalVelocityL END")); return status; diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/group/bld.inf --- a/mmmw_plat/group/bld.inf Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/group/bld.inf Mon May 03 12:59:52 2010 +0300 @@ -43,3 +43,4 @@ #include "../thumbnail_engine_api/group/bld.inf" #include "../telephony_multimedia_service_api/group/bld.inf" #include "../openmax_al_api/group/bld.inf" +#include "../system_tone_service_api/group/bld.inf" diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/bmarm/openmaxaltestmoduleu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/bmarm/openmaxaltestmoduleu.def Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/bwins/openmaxaltestmoduleu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/bwins/openmaxaltestmoduleu.def Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_common.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_common.cfg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,155 @@ +// +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// +// + +[Define] +KErrNotFound -1 +KErrGeneral -2 +KErrNotSupported -5 +KErrAlreadyExists -11 +KErrNotReady -18 +KErrAccessDenied -21 + +KErrEventPending -2000 +KErrCallbackErrorCode -2001 +KErrUnexpectedValue -2002 +KErrNotificationPending -2005 +KErrUnexpectedNotification -2006 +KErrTimeoutController -2007 + + +XA_RESULT_SUCCESS 0 +XA_RESULT_PRECONDITIONS_VIOLATED 1 +XA_RESULT_PARAMETER_INVALID 2 +XA_RESULT_MEMORY_FAILURE 3 +XA_RESULT_RESOURCE_ERROR 4 +XA_RESULT_RESOURCE_LOST 5 +XA_RESULT_IO_ERROR 6 +XA_RESULT_BUFFER_INSUFFICIENT 7 +XA_RESULT_CONTENT_CORRUPTED 8 +XA_RESULT_CONTENT_UNSUPPORTED 9 +XA_RESULT_CONTENT_NOT_FOUND 10 +XA_RESULT_PERMISSION_DENIED 11 +XA_RESULT_FEATURE_UNSUPPORTED 12 +XA_RESULT_INTERNAL_ERROR 13 +XA_RESULT_UNKNOWN_ERROR 14 +XA_RESULT_OPERATION_ABORTED 15 +XA_RESULT_CONTROL_LOST 16 + +[Enddefine] + +//Constants for Data Source +//------------------------------------------------ +// DataSourceType: +// Audio [0] +// Video [1] +// Image [2] +// DataLocatorType: +// URI [0] +// Address [1] +// DataFormatType: +// MIME [0] +// PCM [1] +// RAMIMAGE [2] +// ContainerType: +// CONTAINERTYPE_UNSPECIFIED [0] +// CONTAINERTYPE_RAW [1] +// CONTAINERTYPE_ASF [2] +// CONTAINERTYPE_AVI [3] +// CONTAINERTYPE_BMP [4] +// CONTAINERTYPE_JPG [5] +// CONTAINERTYPE_JPG2000 [6] +// CONTAINERTYPE_M4A [7] +// CONTAINERTYPE_MP3 [8] +// CONTAINERTYPE_MP4 [9] +// CONTAINERTYPE_MPEG_ES [10] +// CONTAINERTYPE_MPEG_PS [11] +// CONTAINERTYPE_MPEG_TS [12] +// CONTAINERTYPE_QT [13] +// CONTAINERTYPE_WAV [14] +// CONTAINERTYPE_XMF_0 [15] +// CONTAINERTYPE_XMF_1 [16] +// CONTAINERTYPE_XMF_2 [17] +// CONTAINERTYPE_XMF_3 [18] +// CONTAINERTYPE_XMF_GENERIC [19] +// CONTAINERTYPE_AMR [20] +// CONTAINERTYPE_AAC [21] +// CONTAINERTYPE_3GPP [22] +// CONTAINERTYPE_3GA [23] +// CONTAINERTYPE_RM [24] +// CONTAINERTYPE_DMF [25] +// CONTAINERTYPE_SMF [26] +// CONTAINERTYPE_MOBILE_DLS [27] +// +// MimeTypes: +// Audio: +// wav [0] +// ogg [1] +// sp-midi [2] +// mobile-xmf [3] +// Amr-Wb [4] +// 3gpp2 [5] +// mp4 [6] +// Video: +// Avi [7] +// ogg [8]? +// Image: +// jpg [9] +// raw-image [10] +//------------------------------------------------- + +// IID numbers for interfaces to mention during object creation +// XA_IID_NULL 1 +// XA_IID_OBJECT 2 +// XA_IID_CONFIGEXTENSION 3 +// XA_IID_DYNAMICINTERFACEMANAGEMENT 4 +// XA_IID_ENGINE 5 +// XA_IID_THREADSYNC 6 +// XA_IID_PLAY 7 +// XA_IID_PLAYBACKRATE 8 +// XA_IID_PREFETCHSTATUS 9 +// XA_IID_SEEK 10 +// XA_IID_VOLUME 11 +// XA_IID_IMAGECONTROLS 12 +// XA_IID_IMAGEEFFECTS 13 +// XA_IID_VIDEOPOSTPROCESSING 14 +// XA_IID_RECORD 15 +// XA_IID_SNAPSHOT 16 +// XA_IID_METADATAEXTRACTION 17 +// XA_IID_METADATAINSERTION 18 +// XA_IID_METADATATRAVERSAL 19 +// XA_IID_DYNAMICSOURCE 20 +// XA_IID_CAMERACAPABILITIES 21 +// XA_IID_CAMERA 22 +// XA_IID_AUDIOIODEVICECAPABILITIES 23 +// XA_IID_DEVICEVOLUME 24 +// XA_IID_EQUALIZER 25 +// XA_IID_OUTPUTMIX 26 +// XA_IID_RADIO 27 +// XA_IID_RDS 28 +// XA_IID_VIBRA 29 +// XA_IID_LED 30 +// XA_IID_AUDIODECODERCAPABILITIES 31 +// XA_IID_AUDIOENCODER 32 +// XA_IID_AUDIOENCODERCAPABILITIES 33 +// XA_IID_IMAGEENCODERCAPABILITIES 34 +// XA_IID_IMAGEDECODERCAPABILITIES 35 +// XA_IID_IMAGEENCODER 36 +// XA_IID_VIDEODECODERCAPABILITIES 37 +// XA_IID_VIDEOENCODER 38 +// XA_IID_VIDEOENCODERCAPABILITIES 39 +// XA_IID_STREAMINFORMATION 40 + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_aiodcitf.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_aiodcitf.cfg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,180 @@ +// +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// +// + +// IID numbers for interfaces to mention during object creation +// XA_IID_NULL 1 +// XA_IID_OBJECT 2 +// XA_IID_CONFIGEXTENSION 3 +// XA_IID_DYNAMICINTERFACEMANAGEMENT 4 +// XA_IID_ENGINE 5 +// XA_IID_THREADSYNC 6 +// XA_IID_PLAY 7 +// XA_IID_PLAYBACKRATE 8 +// XA_IID_PREFETCHSTATUS 9 +// XA_IID_SEEK 10 +// XA_IID_VOLUME 11 +// XA_IID_IMAGECONTROLS 12 +// XA_IID_IMAGEEFFECTS 13 +// XA_IID_VIDEOPOSTPROCESSING 14 +// XA_IID_RECORD 15 +// XA_IID_SNAPSHOT 16 +// XA_IID_METADATAEXTRACTION 17 +// XA_IID_METADATAINSERTION 18 +// XA_IID_METADATATRAVERSAL 19 +// XA_IID_DYNAMICSOURCE 20 +// XA_IID_CAMERACAPABILITIES 21 +// XA_IID_CAMERA 22 +// XA_IID_AUDIOIODEVICECAPABILITIES 23 +// XA_IID_DEVICEVOLUME 24 +// XA_IID_EQUALIZER 25 +// XA_IID_OUTPUTMIX 26 +// XA_IID_RADIO 27 +// XA_IID_RDS 28 +// XA_IID_VIBRA 29 +// XA_IID_LED 30 +// XA_IID_AUDIODECODERCAPABILITIES 31 +// XA_IID_AUDIOENCODER 32 +// XA_IID_AUDIOENCODERCAPABILITIES 33 +// XA_IID_IMAGEENCODERCAPABILITIES 34 +// XA_IID_IMAGEDECODERCAPABILITIES 35 +// XA_IID_IMAGEENCODER 36 +// XA_IID_VIDEODECODERCAPABILITIES 37 +// XA_IID_VIDEOENCODER 38 +// XA_IID_VIDEOENCODERCAPABILITIES 39 +// XA_IID_STREAMINFORMATION 40 + +[Test] +title 3.1 AudioIODevCapItf GetAvailableAudioInputs +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 23 +ALImpl al_audioiodevcapitf_GetAvailableAudioInputs +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 3.2 AudioIODevCapItf QueryAudioInputCapabilities +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 23 +ALImpl al_audioiodevcapitf_QueryAudioInputCapabilities 2910736385 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 3.3 AudioIODevCapItf RegisterAvailableAudioInputsChangedCallback +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 23 +ALImpl al_audioiodevcapitf_RegisterAvailableAudioInputsChangedCallback +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 3.4 AudioIODevCapItf GetAvailableAudioOutputs +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 23 +ALImpl al_audioiodevcapitf_GetAvailableAudioOutputs +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 3.5 AudioIODevCapItf QueryAudioOutputCapabilities +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 23 +ALImpl al_audioiodevcapitf_QueryAudioOutputCapabilities 2910736386 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 3.6 AudioIODevCapItf RegisterAvailableAudioOutputsChangedCallback +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 23 +ALImpl al_audioiodevcapitf_RegisterAvailableAudioOutputsChangedCallback +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 3.7 AudioIODevCapItf RegisterDefaultDeviceIDMapChangedCallback +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 23 +ALImpl al_audioiodevcapitf_RegisterDefaultDeviceIDMapChangedCallback +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + + +[Test] +title 3.8 AudioIODevCapItf GetAssociatedAudioInputs +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 23 +ALImpl al_audioiodevcapitf_GetAssociatedAudioInputs 2910736386 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 3.9 AudioIODevCapItf GetAssociatedAudioOutputs +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 23 +ALImpl al_audioiodevcapitf_GetAssociatedAudioOutputs 2910736385 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 3.10 AudioIODevCapItf GetDefaultAudioDevices +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 23 +ALImpl al_audioiodevcapitf_GetDefaultAudioDevices FFFFFFFF +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 3.11 AudioIODevCapItf QuerySampleFormatsSupported +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 23 +ALImpl al_audioiodevcapitf_QuerySampleFormatsSupported 2910736385 44100 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] \ No newline at end of file diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_audenccapitf.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_audenccapitf.cfg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,80 @@ +// +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// +// + +// IID numbers for interfaces to mention during object creation +// XA_IID_NULL 1 +// XA_IID_OBJECT 2 +// XA_IID_CONFIGEXTENSION 3 +// XA_IID_DYNAMICINTERFACEMANAGEMENT 4 +// XA_IID_ENGINE 5 +// XA_IID_THREADSYNC 6 +// XA_IID_PLAY 7 +// XA_IID_PLAYBACKRATE 8 +// XA_IID_PREFETCHSTATUS 9 +// XA_IID_SEEK 10 +// XA_IID_VOLUME 11 +// XA_IID_IMAGECONTROLS 12 +// XA_IID_IMAGEEFFECTS 13 +// XA_IID_VIDEOPOSTPROCESSING 14 +// XA_IID_RECORD 15 +// XA_IID_SNAPSHOT 16 +// XA_IID_METADATAEXTRACTION 17 +// XA_IID_METADATAINSERTION 18 +// XA_IID_METADATATRAVERSAL 19 +// XA_IID_DYNAMICSOURCE 20 +// XA_IID_CAMERACAPABILITIES 21 +// XA_IID_CAMERA 22 +// XA_IID_AUDIOIODEVICECAPABILITIES 23 +// XA_IID_DEVICEVOLUME 24 +// XA_IID_EQUALIZER 25 +// XA_IID_OUTPUTMIX 26 +// XA_IID_RADIO 27 +// XA_IID_RDS 28 +// XA_IID_VIBRA 29 +// XA_IID_LED 30 +// XA_IID_AUDIODECODERCAPABILITIES 31 +// XA_IID_AUDIOENCODER 32 +// XA_IID_AUDIOENCODERCAPABILITIES 33 +// XA_IID_IMAGEENCODERCAPABILITIES 34 +// XA_IID_IMAGEDECODERCAPABILITIES 35 +// XA_IID_IMAGEENCODER 36 +// XA_IID_VIDEODECODERCAPABILITIES 37 +// XA_IID_VIDEOENCODER 38 +// XA_IID_VIDEOENCODERCAPABILITIES 39 +// XA_IID_STREAMINFORMATION 40 + +[Test] +title 4.1 AudioEncCapItf GetAudioEncoders +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 33 +ALImpl al_audioencodercapitf_GetAudioEncoders +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 4.2 AudioEncCapItf GetAudioEncoderCapabilities +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 33 +ALImpl al_audioencodercapitf_GetAudioEncoderCapabilities 1 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_engineitf.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_engineitf.cfg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,289 @@ +// +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// +// + +// IID numbers for interfaces to mention during object creation +// XA_IID_NULL 1 +// XA_IID_OBJECT 2 +// XA_IID_CONFIGEXTENSION 3 +// XA_IID_DYNAMICINTERFACEMANAGEMENT 4 +// XA_IID_ENGINE 5 +// XA_IID_THREADSYNC 6 +// XA_IID_PLAY 7 +// XA_IID_PLAYBACKRATE 8 +// XA_IID_PREFETCHSTATUS 9 +// XA_IID_SEEK 10 +// XA_IID_VOLUME 11 +// XA_IID_IMAGECONTROLS 12 +// XA_IID_IMAGEEFFECTS 13 +// XA_IID_VIDEOPOSTPROCESSING 14 +// XA_IID_RECORD 15 +// XA_IID_SNAPSHOT 16 +// XA_IID_METADATAEXTRACTION 17 +// XA_IID_METADATAINSERTION 18 +// XA_IID_METADATATRAVERSAL 19 +// XA_IID_DYNAMICSOURCE 20 +// XA_IID_CAMERACAPABILITIES 21 +// XA_IID_CAMERA 22 +// XA_IID_AUDIOIODEVICECAPABILITIES 23 +// XA_IID_DEVICEVOLUME 24 +// XA_IID_EQUALIZER 25 +// XA_IID_OUTPUTMIX 26 +// XA_IID_RADIO 27 +// XA_IID_RDS 28 +// XA_IID_VIBRA 29 +// XA_IID_LED 30 +// XA_IID_AUDIODECODERCAPABILITIES 31 +// XA_IID_AUDIOENCODER 32 +// XA_IID_AUDIOENCODERCAPABILITIES 33 +// XA_IID_IMAGEENCODERCAPABILITIES 34 +// XA_IID_IMAGEDECODERCAPABILITIES 35 +// XA_IID_IMAGEENCODER 36 +// XA_IID_VIDEODECODERCAPABILITIES 37 +// XA_IID_VIDEOENCODER 38 +// XA_IID_VIDEOENCODERCAPABILITIES 39 +// XA_IID_STREAMINFORMATION 40 + + +[Test] +title 2.1 EngItf CreateCameraDevice +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +allownextresult 12 +ALImpl al_engitf_CreateCameraDevice 0 1 +//ALImpl al_objitf_Destroy 9 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.2 EngItf CreateRadioDvice +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +allownextresult 12 +ALImpl al_engitf_CreateRadioDevice +//ALImpl al_objitf_Destroy 6 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.3 EngItf CreateLEDDevice +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +allownextresult 12 +ALImpl al_engitf_CreateLEDDevice 0 1 +//ALImpl al_objitf_Destroy 2 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.4 EngItf CreateVibraDevice +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +allownextresult 12 +ALImpl al_engitf_CreateVibraDevice 0 1 +//ALImpl al_objitf_Destroy 3 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.5 EngItf CreateMediaPlayer +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSource 1 1 1 +ALImpl al_SetDataLocator 3 1 2910736386 +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 3 1 1 +allownextresult 0 +ALImpl al_engitf_CreateMediaPlayer 0 +ALImpl al_objitf_Destroy 4 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.6 EngItf CreateMediaRecorder +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.7 EngItf CreateOutputMix +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +allownextresult 12 +ALImpl al_engitf_CreateOutputMix +//ALImpl al_objitf_Destroy 7 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.8 EngItf CreateMetaDataExtractor +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSource 1 1 3 +allownextresult 12 +ALImpl al_engitf_CreateMetadataExtractor +//ALImpl al_objitf_Destroy 8 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.9 EngItf CreateExtensionObject +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +allownextresult 12 +ALImpl al_engitf_CreateExtensionObject 0 1 +//ALImpl al_objitf_Destroy 8 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.10 EngItf GetImplInfo +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_engitf_GetImplementationInfo +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.11 EngItf QuerySupportedProfiles +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_engitf_QuerySupportedProfiles +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.12 EngItf QueryNumSupportedInterfaces +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_engitf_QueryNumSupportedInterfaces 1 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.13 EngItf QuerySupportedInterfaces +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_engitf_QuerySupportedInterfaces 1 0 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.14 EngItf QueryNumSupportedExtension +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_engitf_QueryNumSupportedExtension +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.15 EngItf QuerySupportedExtension +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +allownextresult 2 +ALImpl al_engitf_QuerySupportedExtension 0 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.16 EngItf IsExtensionSupported +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_engitf_IsExtensionSupported TestExtn +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.17 EngItf QueryLEDCapabilities +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_engitf_QueryLEDCapabilities +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 2.18 EngItf QueryVibraCapabilities +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_engitf_QueryVibraCapabilities +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] \ No newline at end of file diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_global.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_global.cfg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,89 @@ +// +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// +// + +// IID numbers for interfaces to mention during object creation +// XA_IID_NULL 1 +// XA_IID_OBJECT 2 +// XA_IID_CONFIGEXTENSION 3 +// XA_IID_DYNAMICINTERFACEMANAGEMENT 4 +// XA_IID_ENGINE 5 +// XA_IID_THREADSYNC 6 +// XA_IID_PLAY 7 +// XA_IID_PLAYBACKRATE 8 +// XA_IID_PREFETCHSTATUS 9 +// XA_IID_SEEK 10 +// XA_IID_VOLUME 11 +// XA_IID_IMAGECONTROLS 12 +// XA_IID_IMAGEEFFECTS 13 +// XA_IID_VIDEOPOSTPROCESSING 14 +// XA_IID_RECORD 15 +// XA_IID_SNAPSHOT 16 +// XA_IID_METADATAEXTRACTION 17 +// XA_IID_METADATAINSERTION 18 +// XA_IID_METADATATRAVERSAL 19 +// XA_IID_DYNAMICSOURCE 20 +// XA_IID_CAMERACAPABILITIES 21 +// XA_IID_CAMERA 22 +// XA_IID_AUDIOIODEVICECAPABILITIES 23 +// XA_IID_DEVICEVOLUME 24 +// XA_IID_EQUALIZER 25 +// XA_IID_OUTPUTMIX 26 +// XA_IID_RADIO 27 +// XA_IID_RDS 28 +// XA_IID_VIBRA 29 +// XA_IID_LED 30 +// XA_IID_AUDIODECODERCAPABILITIES 31 +// XA_IID_AUDIOENCODER 32 +// XA_IID_AUDIOENCODERCAPABILITIES 33 +// XA_IID_IMAGEENCODERCAPABILITIES 34 +// XA_IID_IMAGEDECODERCAPABILITIES 35 +// XA_IID_IMAGEENCODER 36 +// XA_IID_VIDEODECODERCAPABILITIES 37 +// XA_IID_VIDEOENCODER 38 +// XA_IID_VIDEOENCODERCAPABILITIES 39 +// XA_IID_STREAMINFORMATION 40 + +[Test] +title 1.1 xaCreateEngine +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 1.2 xaQueryNumSupportedInterfaces +create openmaxaltestmodule ALImpl +ALImpl al_queryNumSupportedEngineInterfaces +delete ALImpl +[Endtest] + +[Test] +title 1.3 xaQuerySupportedInterfaces +create openmaxaltestmodule ALImpl +ALImpl al_querySupportedEngineInterfaces 5 +delete ALImpl +[Endtest] + +[Test] +title 1.4 Create Delete +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] \ No newline at end of file diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_objectitf.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_objectitf.cfg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,173 @@ +// +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// +// + +[Test] +title 5.1 ObjectItf SetPriority +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_objitf_SetPriority 1 100 100 +ALImpl al_objitf_GetPriority 1 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetPositionUpdatePeriod 1000 +ALImpl al_recorditf_GetPositionUpdatePeriod +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 5.2 ObjectItf GetPriority +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_objitf_SetPriority 1 100 100 +ALImpl al_objitf_GetPriority 1 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetPositionUpdatePeriod 1000 +ALImpl al_recorditf_GetPositionUpdatePeriod +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 5.3 ObjectItf SetLossOfControlInterfaces +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_objitf_SetLossOfControlInterfaces 1 0 1 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetPositionUpdatePeriod 1000 +ALImpl al_recorditf_GetPositionUpdatePeriod +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 5.4 ObjectItf RegisterCallback +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_objitf_RegisterCallback 1 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetPositionUpdatePeriod 1000 +ALImpl al_recorditf_GetPositionUpdatePeriod +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 5.5 ObjectItf GetState +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_objitf_GetState 1 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetPositionUpdatePeriod 1000 +ALImpl al_recorditf_GetPositionUpdatePeriod +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 5.6 ObjectItf Resume +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +allownextresult XA_RESULT_PRECONDITIONS_VIOLATED +ALImpl al_objitf_Resume 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetPositionUpdatePeriod 1000 +ALImpl al_recorditf_GetPositionUpdatePeriod +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 5.7 ObjectItf AbortAsyncOperation +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_AbortAsyncOperation 5 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetPositionUpdatePeriod 1000 +ALImpl al_recorditf_GetPositionUpdatePeriod +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] \ No newline at end of file diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_ro_audioencoderitf.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_ro_audioencoderitf.cfg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,98 @@ +// +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// +// + +// IID numbers for interfaces to mention during object creation +// XA_IID_NULL 1 +// XA_IID_OBJECT 2 +// XA_IID_CONFIGEXTENSION 3 +// XA_IID_DYNAMICINTERFACEMANAGEMENT 4 +// XA_IID_ENGINE 5 +// XA_IID_THREADSYNC 6 +// XA_IID_PLAY 7 +// XA_IID_PLAYBACKRATE 8 +// XA_IID_PREFETCHSTATUS 9 +// XA_IID_SEEK 10 +// XA_IID_VOLUME 11 +// XA_IID_IMAGECONTROLS 12 +// XA_IID_IMAGEEFFECTS 13 +// XA_IID_VIDEOPOSTPROCESSING 14 +// XA_IID_RECORD 15 +// XA_IID_SNAPSHOT 16 +// XA_IID_METADATAEXTRACTION 17 +// XA_IID_METADATAINSERTION 18 +// XA_IID_METADATATRAVERSAL 19 +// XA_IID_DYNAMICSOURCE 20 +// XA_IID_CAMERACAPABILITIES 21 +// XA_IID_CAMERA 22 +// XA_IID_AUDIOIODEVICECAPABILITIES 23 +// XA_IID_DEVICEVOLUME 24 +// XA_IID_EQUALIZER 25 +// XA_IID_OUTPUTMIX 26 +// XA_IID_RADIO 27 +// XA_IID_RDS 28 +// XA_IID_VIBRA 29 +// XA_IID_LED 30 +// XA_IID_AUDIODECODERCAPABILITIES 31 +// XA_IID_AUDIOENCODER 32 +// XA_IID_AUDIOENCODERCAPABILITIES 33 +// XA_IID_IMAGEENCODERCAPABILITIES 34 +// XA_IID_IMAGEDECODERCAPABILITIES 35 +// XA_IID_IMAGEENCODER 36 +// XA_IID_VIDEODECODERCAPABILITIES 37 +// XA_IID_VIDEOENCODER 38 +// XA_IID_VIDEOENCODERCAPABILITIES 39 +// XA_IID_STREAMINFORMATION 40 + +[Test] +title 7.1 AudioEncoderItf GetEncoderSettings +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 32 +ALImpl al_audioencoderitf_GetEncoderSettings +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 7.2 AudioEncoderItf SetEncoderSettings +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 32 +ALImpl al_audioencoderitf_SetEncoderSettings 1 1 1 8000 128000 16 1 1 0 0 0 0 0 +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] \ No newline at end of file diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_ro_mdinsertionitf.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_ro_mdinsertionitf.cfg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,218 @@ +// +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// +// + +// IID numbers for interfaces to mention during object creation +// XA_IID_NULL 1 +// XA_IID_OBJECT 2 +// XA_IID_CONFIGEXTENSION 3 +// XA_IID_DYNAMICINTERFACEMANAGEMENT 4 +// XA_IID_ENGINE 5 +// XA_IID_THREADSYNC 6 +// XA_IID_PLAY 7 +// XA_IID_PLAYBACKRATE 8 +// XA_IID_PREFETCHSTATUS 9 +// XA_IID_SEEK 10 +// XA_IID_VOLUME 11 +// XA_IID_IMAGECONTROLS 12 +// XA_IID_IMAGEEFFECTS 13 +// XA_IID_VIDEOPOSTPROCESSING 14 +// XA_IID_RECORD 15 +// XA_IID_SNAPSHOT 16 +// XA_IID_METADATAEXTRACTION 17 +// XA_IID_METADATAINSERTION 18 +// XA_IID_METADATATRAVERSAL 19 +// XA_IID_DYNAMICSOURCE 20 +// XA_IID_CAMERACAPABILITIES 21 +// XA_IID_CAMERA 22 +// XA_IID_AUDIOIODEVICECAPABILITIES 23 +// XA_IID_DEVICEVOLUME 24 +// XA_IID_EQUALIZER 25 +// XA_IID_OUTPUTMIX 26 +// XA_IID_RADIO 27 +// XA_IID_RDS 28 +// XA_IID_VIBRA 29 +// XA_IID_LED 30 +// XA_IID_AUDIODECODERCAPABILITIES 31 +// XA_IID_AUDIOENCODER 32 +// XA_IID_AUDIOENCODERCAPABILITIES 33 +// XA_IID_IMAGEENCODERCAPABILITIES 34 +// XA_IID_IMAGEDECODERCAPABILITIES 35 +// XA_IID_IMAGEENCODER 36 +// XA_IID_VIDEODECODERCAPABILITIES 37 +// XA_IID_VIDEOENCODER 38 +// XA_IID_VIDEOENCODERCAPABILITIES 39 +// XA_IID_STREAMINFORMATION 40 + +[Test] +title 6.1 MetadataInsertionItf CreateChildNode +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr +ALImpl al_SetDataFormat 1 audio/amr 21 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 4 +ALImpl al_dimitf_AddInterface 18 0 +ALImpl al_objitf_GetInterface 5 18 +allownextresult 12 0 +ALImpl al_metadatainsertionitf_CreateChildNode 2147483647 2 audio/amr +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 6.2 MetadataInsertionItf GetSupportedKeysCount +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr +ALImpl al_SetDataFormat 1 audio/amr 21 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 4 +ALImpl al_dimitf_AddInterface 18 0 +ALImpl al_objitf_GetInterface 5 18 +allownextresult 2 0 +ALImpl al_metadatainsertionitf_GetSupportedKeysCount 1 +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 6.3 MetadataInsertionItf GetKeySize +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr +ALImpl al_SetDataFormat 1 audio/amr 21 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 4 +ALImpl al_dimitf_AddInterface 18 0 +ALImpl al_objitf_GetInterface 5 18 +allownextresult 2 0 +ALImpl al_metadatainsertionitf_GetKeySize 1 1 +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 6.4 MetadataInsertionItf GetKey +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr +ALImpl al_SetDataFormat 1 audio/amr 21 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 4 +ALImpl al_dimitf_AddInterface 18 0 +ALImpl al_objitf_GetInterface 5 18 +allownextresult 2 0 +ALImpl al_metadatainsertionitf_GetKey 1 1 1 +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 6.5 MetadataInsertionItf GetFreeKeysEncoding +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr +ALImpl al_SetDataFormat 1 audio/amr 21 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 4 +ALImpl al_dimitf_AddInterface 18 0 +ALImpl al_objitf_GetInterface 5 18 +allownextresult 2 1 +ALImpl al_metadatainsertionitf_GetFreeKeysEncoding 1 1 +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 6.6 MetadataInsertionItf InsertMetadataItem +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr +ALImpl al_SetDataFormat 1 audio/amr 21 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 4 +ALImpl al_dimitf_AddInterface 18 0 +ALImpl al_objitf_GetInterface 5 18 +allownextresult 12 2 +ALImpl al_metadatainsertionitf_InsertMetadataItem 1 2 3 english 4 5 chinese 1 +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 6.7 MetadataInsertionItf RegisterCallback +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr +ALImpl al_SetDataFormat 1 audio/amr 21 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 4 +ALImpl al_dimitf_AddInterface 18 0 +ALImpl al_objitf_GetInterface 5 18 +ALImpl al_metadatainsertionitf_RegisterCallback +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_ro_recorditf.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_ro_recorditf.cfg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,350 @@ +// +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// +// + +// IID numbers for interfaces to mention during object creation +// XA_IID_NULL 1 +// XA_IID_OBJECT 2 +// XA_IID_CONFIGEXTENSION 3 +// XA_IID_DYNAMICINTERFACEMANAGEMENT 4 +// XA_IID_ENGINE 5 +// XA_IID_THREADSYNC 6 +// XA_IID_PLAY 7 +// XA_IID_PLAYBACKRATE 8 +// XA_IID_PREFETCHSTATUS 9 +// XA_IID_SEEK 10 +// XA_IID_VOLUME 11 +// XA_IID_IMAGECONTROLS 12 +// XA_IID_IMAGEEFFECTS 13 +// XA_IID_VIDEOPOSTPROCESSING 14 +// XA_IID_RECORD 15 +// XA_IID_SNAPSHOT 16 +// XA_IID_METADATAEXTRACTION 17 +// XA_IID_METADATAINSERTION 18 +// XA_IID_METADATATRAVERSAL 19 +// XA_IID_DYNAMICSOURCE 20 +// XA_IID_CAMERACAPABILITIES 21 +// XA_IID_CAMERA 22 +// XA_IID_AUDIOIODEVICECAPABILITIES 23 +// XA_IID_DEVICEVOLUME 24 +// XA_IID_EQUALIZER 25 +// XA_IID_OUTPUTMIX 26 +// XA_IID_RADIO 27 +// XA_IID_RDS 28 +// XA_IID_VIBRA 29 +// XA_IID_LED 30 +// XA_IID_AUDIODECODERCAPABILITIES 31 +// XA_IID_AUDIOENCODER 32 +// XA_IID_AUDIOENCODERCAPABILITIES 33 +// XA_IID_IMAGEENCODERCAPABILITIES 34 +// XA_IID_IMAGEDECODERCAPABILITIES 35 +// XA_IID_IMAGEENCODER 36 +// XA_IID_VIDEODECODERCAPABILITIES 37 +// XA_IID_VIDEOENCODER 38 +// XA_IID_VIDEOENCODERCAPABILITIES 39 +// XA_IID_STREAMINFORMATION 40 + +[Test] +title 8.1 RecordItf SetRecordState +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder 1 15 +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetRecordState 3 +pause 5000 +ALImpl al_recorditf_SetRecordState 1 +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 8.2 RecordItf GetRecordState +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_GetRecordState +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 8.3 RecordItf SetDurationLimit +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetDurationLimit 100000 +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 8.4 RecordItf GetPosition +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_GetPosition +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 8.5 RecordItf RegisterCallback +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_RegisterCallback +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 8.6 RecordItf SetCallbackEventsMask +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetCallbackEventsMask 1 +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 8.7 RecordItf GetCallbackEventsMask +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_GetCallbackEventsMask +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + + +[Test] +title 8.8 RecordItf SetMarkerPosition +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetMarkerPosition 1000 +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + + +[Test] +title 8.9 RecordItf ClearMarkerPosition +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetMarkerPosition 1000 +ALImpl al_recorditf_ClearMarkerPosition +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 8.10 RecordItf SetMarkerPosition +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetMarkerPosition 1000 +ALImpl al_recorditf_GetMarkerPosition +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 8.11 RecordItf SetPositionUpdatePeriod +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetPositionUpdatePeriod 1000 +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 8.12 RecordItf GetPositionUpdatePeriod +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav +ALImpl al_SetDataFormat 1 audio/wav 15 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetPositionUpdatePeriod 1000 +ALImpl al_recorditf_GetPositionUpdatePeriod +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 8.13 RecordItf SetRecordState AMR +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.amr +ALImpl al_SetDataFormat 1 audio/amr 21 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder 1 15 +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetRecordState 3 +pause 5000 +ALImpl al_recorditf_SetRecordState 1 +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + +[Test] +title 8.14 RecordItf SetRecordState MP4 +create openmaxaltestmodule ALImpl +ALImpl al_createEngine 1 1 0 0 +ALImpl al_objitf_Realize 1 0 +ALImpl al_objitf_GetInterface 1 5 +ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.mp4 +ALImpl al_SetDataFormat 1 audio/mpeg 10 +ALImpl al_SetDataSink 1 1 5 +ALImpl al_SetDataLocator 3 1 2910736385 +ALImpl al_SetDataSource 3 1 1 +ALImpl al_engitf_CreateMediaRecorder 1 15 +ALImpl al_objitf_Realize 5 0 +ALImpl al_objitf_GetInterface 5 15 +ALImpl al_recorditf_SetRecordState 3 +pause 10000 +ALImpl al_recorditf_SetRecordState 1 +ALImpl al_objitf_Destroy 5 +ALImpl al_objitf_Destroy 1 +delete ALImpl +[Endtest] + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/data/c/omxaltestdata/test.wav Binary file mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/data/c/omxaltestdata/test.wav has changed diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/eabi/openmaxaltestmoduleu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/eabi/openmaxaltestmoduleu.def Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/bld.inf Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTEXPORTS +../conf/openmaxaltestmodule_common.cfg /epoc32/winscw/c/testframework/openmaxaltestmodule_common.cfg +../conf/openmaxaltestmodule_objectitf.cfg /epoc32/winscw/c/testframework/openmaxaltestmodule_objectitf.cfg +../conf/openmaxaltestmodule_ro_mdinsertionitf.cfg /epoc32/winscw/c/testframework/openmaxaltestmodule_ro_mdinsertionitf.cfg +../conf/openmaxaltestmodule_ro_recorditf.cfg /epoc32/winscw/c/testframework/openmaxaltestmodule_ro_recorditf.cfg +../conf/openmaxaltestmodule_ro_audioencoderitf.cfg /epoc32/winscw/c/testframework/openmaxaltestmodule_ro_audioencoderitf.cfg +../conf/openmaxaltestmodule_engine_audenccapitf.cfg /epoc32/winscw/c/testframework/openmaxaltestmodule_engine_audenccapitf.cfg +../conf/openmaxaltestmodule_global.cfg /epoc32/winscw/c/testframework/openmaxaltestmodule_global.cfg +../conf/openmaxaltestmodule_engine_engineitf.cfg /epoc32/winscw/c/testframework/openmaxaltestmodule_engine_engineitf.cfg +../conf/openmaxaltestmodule_engine_aiodcitf.cfg /epoc32/winscw/c/testframework/openmaxaltestmodule_engine_aiodcitf.cfg +../data/c/omxaltestdata/test.wav /epoc32/winscw/c/testing/data/omxaltestdata/test.wav +../init/testframework.ini /epoc32/winscw/c/testframework/testframework.ini + +PRJ_EXPORTS + +PRJ_TESTMMPFILES +openmaxaltestmodule.mmp + +PRJ_MMPFILES + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/openmaxaltestmodule.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/openmaxaltestmodule.mmp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MMP file for STIF Test Framework's TestScripter +* testclass openmaxal module. +* +*/ + +#include + +SMPSAFE + +TARGET openmaxaltestmodule.dll +TARGETTYPE dll +UID 0x1000008D 0x10207CA4 + +CAPABILITY ALL -TCB +VENDORID VID_DEFAULT +/* Remove comments and replace 0x00000000 with correct secure id */ +// SECUREID 0x00000000 + +//TARGETPATH ?target_path +DEFFILE openmaxaltestmodule.def + +USERINCLUDE ../inc +OS_LAYER_LIBC_SYSTEMINCLUDE +OS_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/platform/mw/khronos/ + +SOURCEPATH ../src/common +SOURCE openmaxaltestmodule.cpp +SOURCE openmaxaltestmoduleblocks.cpp +SOURCE openmaxalcommontests.cpp +SOURCE openmaxalobjectitftests.cpp +SOURCE openmaxalobjectcallbacks.cpp +SOURCE openmaxaldynitfmgmtitftests.cpp +SOURCE openmaxaldynitfmgmtitfcallbacks.cpp + +SOURCEPATH ../src/engine +SOURCE openmaxalenginetests.cpp +SOURCE openmaxalengineitftests.cpp +SOURCE openmaxalaudioiodevicecapabilitiesitftests.cpp +SOURCE openmaxalaudioencodercapabiltiesitftests.cpp +SOURCE openmaxalaudioiodevicecapabilitiesitfcallbacks.cpp + +SOURCEPATH ../src/recorder +SOURCE openmaxalrecorditftests.cpp +SOURCE openmaxalaudioencoderitftests.cpp +SOURCE openmaxalmetadatainsertionitftests.cpp +SOURCE openmaxalrecorditfcallbacks.cpp +SOURCE openmaxalmetadatainsertionitfcallbacks.cpp + + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib +LIBRARY ecom.lib +LIBRARY openmaxal.lib +LIBRARY libc.lib +LANG SC + + + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/openmaxaltestmodule.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/openmaxaltestmodule.pkg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,72 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; Installation file for STIF +; + +; Languages +&EN + +; Provide value for uid +#{"STIF"},(0x10207CA4),1,1,0,TYPE=SA + +; Series60 product id for S60 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Logo +; None + +; Package signature - Optional +; None + +; Start of Package body + +; Condition blocks +; None + +; Options list +; None + +; Install files +"\epoc32\release\armv5\udeb\openmaxaltestmodule.dll" - "!:\sys\bin\openmaxaltestmodule.dll" +"..\conf\openmaxaltestmodule_global.cfg" - "!:\testframework\openmaxaltestmodule_global.cfg" +"..\conf\openmaxaltestmodule_common.cfg" - "!:\testframework\openmaxaltestmodule_common.cfg" +"..\conf\openmaxaltestmodule_objectitf.cfg" - "!:\testframework\openmaxaltestmodule_objectitf.cfg" +"..\conf\openmaxaltestmodule_engine_engineitf.cfg" - "!:\testframework\openmaxaltestmodule_engine_engineitf.cfg" +"..\conf\openmaxaltestmodule_engine_audenccapitf.cfg" - "!:\testframework\openmaxaltestmodule_engine_audenccapitf.cfg" +"..\conf\openmaxaltestmodule_engine_aiodcitf.cfg" - "!:\testframework\openmaxaltestmodule_engine_aiodcitf.cfg" +"..\conf\openmaxaltestmodule_ro_recorditf.cfg" - "!:\testframework\openmaxaltestmodule_ro_recorditf.cfg" +"..\conf\openmaxaltestmodule_ro_mdinsertionitf.cfg" - "!:\testframework\openmaxaltestmodule_ro_mdinsertionitf.cfg" +"..\conf\openmaxaltestmodule_ro_audioencoderitf.cfg" - "!:\testframework\openmaxaltestmodule_ro_audioencoderitf.cfg" + +;data files +"..\data\c\omxaltestdata\test.wav" - "!:\testing\data\omxaltestdata\test.wav" + +; Embedded SIS +; None + +; End of Package body + +; PKG dependencies +; None + +; PKG capabilities +; None diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/openmaxaltestmodule_doxyfile.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/openmaxaltestmodule_doxyfile.txt Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,239 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +# + +# Doxyfile 1.4.1 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = OpenMAXALTestModule +PROJECT_NUMBER = +OUTPUT_DIRECTORY = W:\sf\mw\mmmw\mmmw_plat\openmax_al_api\tsrc\\OpenMAXALTestModule\ +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = YES +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = NO +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = YES +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = NO +GENERATE_BUGLIST = NO +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = W:\sf\mw\mmmw\mmmw_plat\openmax_al_api\tsrc\\OpenMAXALTestModule\ +FILE_PATTERNS = *.h \ + *.rh \ + *.hrh +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = NO +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = YES +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = YES +TOC_EXPAND = YES +DISABLE_INDEX = YES +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = YES +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = YES +RTF_OUTPUT = Doc +COMPACT_RTF = YES +RTF_HYPERLINKS = YES +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = NONSHARABLE_CLASS +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/inc/openmaxaltestmodule.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/inc/openmaxaltestmodule.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,326 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: STIF testclass declaration +* +*/ + +#ifndef OPENMAXALTESTMODULE_H +#define OPENMAXALTESTMODULE_H + +// INCLUDES +#include +#include +#include +#include +#include +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +#define RET_ERR_IF_ERR(err) if (err!=KErrNone) return err; +//#define ?macro ?macro_def +#define TEST_CLASS_VERSION_MAJOR 0 +#define TEST_CLASS_VERSION_MINOR 0 +#define TEST_CLASS_VERSION_BUILD 0 + +// Logging path +_LIT( KOpenMAXALTestModuleLogPath, "\\logs\\testframework\\OpenMAXALTestModule\\" ); +// Log file +_LIT( KOpenMAXALTestModuleLogFile, "OpenMAXALTestModule.txt" ); +_LIT( KOpenMAXALTestModuleLogFileWithTitle, "OpenMAXALTestModule_[%S].txt" ); + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +class COpenMAXALTestModule; + +// DATA TYPES +#define MAX_NUMBER_OPTIONS 2 +#define MAX_NUMBER_INTERFACES 20 +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// CLASS DECLARATION + +/** +* COpenMAXALTestModule test class for STIF Test Framework TestScripter. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(COpenMAXALTestModule) : public CScriptBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static COpenMAXALTestModule* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~COpenMAXALTestModule(); + + public: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + COpenMAXALTestModule( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + /** + * Frees all resources allocated from test methods. + * @since ?Series60_version + */ + void Delete(); + + /** + * Test methods are listed below. + */ + + /** + * Example test method. + * @since ?Series60_version + * @param aItem Script line containing parameters. + * @return Symbian OS error code. + */ + virtual TInt ExampleL( CStifItemParser& aItem ); + + virtual TInt al_SetDataSource( CStifItemParser& aItem ); + virtual TInt al_SetDataSink( CStifItemParser& aItem ); + virtual TInt al_SetDataLocator( CStifItemParser& aItem ); + virtual TInt al_SetDataFormat( CStifItemParser& aItem ); + + virtual TInt al_createEngine( CStifItemParser& aItem ); + virtual TInt al_queryNumSupportedEngineInterfaces( CStifItemParser& aItem ); + virtual TInt al_querySupportedEngineInterfaces( CStifItemParser& aItem ); + virtual TInt al_objitf_Realize( CStifItemParser& aItem ); + virtual TInt al_objitf_Resume( CStifItemParser& aItem ); + virtual TInt al_objitf_GetState( CStifItemParser& aItem ); + virtual TInt al_objitf_GetInterface( CStifItemParser& aItem ); + virtual TInt al_objitf_RegisterCallback( CStifItemParser& aItem ); + virtual TInt al_objitf_AbortAsyncOperation( CStifItemParser& aItem ); + virtual TInt al_objitf_Destroy( CStifItemParser& aItem ); + virtual TInt al_objitf_SetPriority( CStifItemParser& aItem ); + virtual TInt al_objitf_GetPriority( CStifItemParser& aItem ); + virtual TInt al_objitf_SetLossOfControlInterfaces( CStifItemParser& aItem ); + + virtual TInt al_dimitf_AddInterface( CStifItemParser& aItem ); + virtual TInt al_dimitf_RemoveInterface( CStifItemParser& aItem ); + virtual TInt al_dimitf_ResumeInterface( CStifItemParser& aItem ); + virtual TInt al_dimitf_RegisterCallback( CStifItemParser& aItem ); + + + virtual TInt al_engitf_CreateCameraDevice( CStifItemParser& aItem ); + virtual TInt al_engitf_CreateRadioDevice( CStifItemParser& aItem ); + virtual TInt al_engitf_CreateLEDDevice( CStifItemParser& aItem ); + virtual TInt al_engitf_CreateVibraDevice( CStifItemParser& aItem ); + virtual TInt al_engitf_CreateMediaPlayer( CStifItemParser& aItem ); + virtual TInt al_engitf_CreateMediaRecorder( CStifItemParser& aItem ); + virtual TInt al_engitf_CreateOutputMix( CStifItemParser& aItem ); + virtual TInt al_engitf_CreateMetadataExtractor( CStifItemParser& aItem ); + virtual TInt al_engitf_CreateExtensionObject( CStifItemParser& aItem ); + virtual TInt al_engitf_GetImplementationInfo( CStifItemParser& aItem ); + virtual TInt al_engitf_QuerySupportedProfiles( CStifItemParser& aItem ); + virtual TInt al_engitf_QueryNumSupportedInterfaces( CStifItemParser& aItem ); + virtual TInt al_engitf_QuerySupportedInterfaces( CStifItemParser& aItem ); + virtual TInt al_engitf_QueryNumSupportedExtension( CStifItemParser& aItem ); + virtual TInt al_engitf_QuerySupportedExtension( CStifItemParser& aItem ); + virtual TInt al_engitf_IsExtensionSupported( CStifItemParser& aItem ); + virtual TInt al_engitf_QueryLEDCapabilities( CStifItemParser& aItem ); + virtual TInt al_engitf_QueryVibraCapabilities( CStifItemParser& aItem ); + virtual TInt al_audioiodevcapitf_GetAvailableAudioInputs( CStifItemParser& aItem ); + virtual TInt al_audioiodevcapitf_QueryAudioInputCapabilities( CStifItemParser& aItem ); + virtual TInt al_audioiodevcapitf_RegisterAvailableAudioInputsChangedCallback( CStifItemParser& aItem ); + virtual TInt al_audioiodevcapitf_GetAvailableAudioOutputs( CStifItemParser& aItem ); + virtual TInt al_audioiodevcapitf_QueryAudioOutputCapabilities( CStifItemParser& aItem ); + virtual TInt al_audioiodevcapitf_RegisterAvailableAudioOutputsChangedCallback( CStifItemParser& aItem ); + virtual TInt al_audioiodevcapitf_RegisterDefaultDeviceIDMapChangedCallback( CStifItemParser& aItem ); + virtual TInt al_audioiodevcapitf_GetAssociatedAudioInputs( CStifItemParser& aItem ); + virtual TInt al_audioiodevcapitf_GetAssociatedAudioOutputs( CStifItemParser& aItem ); + virtual TInt al_audioiodevcapitf_GetDefaultAudioDevices( CStifItemParser& aItem ); + virtual TInt al_audioiodevcapitf_QuerySampleFormatsSupported( CStifItemParser& aItem ); + virtual TInt al_audioencodercapitf_GetAudioEncoders( CStifItemParser& aItem ); + virtual TInt al_audioencodercapitf_GetAudioEncoderCapabilities( CStifItemParser& aItem ); + virtual TInt al_recorditf_SetRecordState( CStifItemParser& aItem ); + virtual TInt al_recorditf_GetRecordState( CStifItemParser& aItem ); + virtual TInt al_recorditf_SetDurationLimit( CStifItemParser& aItem ); + virtual TInt al_recorditf_GetPosition( CStifItemParser& aItem ); + virtual TInt al_recorditf_RegisterCallback( CStifItemParser& aItem ); + virtual TInt al_recorditf_SetCallbackEventsMask( CStifItemParser& aItem ); + virtual TInt al_recorditf_GetCallbackEventsMask( CStifItemParser& aItem ); + virtual TInt al_recorditf_SetMarkerPosition( CStifItemParser& aItem ); + virtual TInt al_recorditf_ClearMarkerPosition( CStifItemParser& aItem ); + virtual TInt al_recorditf_GetMarkerPosition( CStifItemParser& aItem ); + virtual TInt al_recorditf_SetPositionUpdatePeriod( CStifItemParser& aItem ); + virtual TInt al_recorditf_GetPositionUpdatePeriod( CStifItemParser& aItem ); + virtual TInt al_audioencoderitf_SetEncoderSettings( CStifItemParser& aItem ); + virtual TInt al_audioencoderitf_GetEncoderSettings( CStifItemParser& aItem ); + virtual TInt al_metadatainsertionitf_CreateChildNode( CStifItemParser& aItem ); + virtual TInt al_metadatainsertionitf_GetSupportedKeysCount( CStifItemParser& aItem ); + virtual TInt al_metadatainsertionitf_GetKeySize( CStifItemParser& aItem ); + virtual TInt al_metadatainsertionitf_GetKey( CStifItemParser& aItem ); + virtual TInt al_metadatainsertionitf_GetFreeKeysEncoding( CStifItemParser& aItem ); + virtual TInt al_metadatainsertionitf_InsertMetadataItem( CStifItemParser& aItem ); + virtual TInt al_metadatainsertionitf_RegisterCallback( CStifItemParser& aItem ); + + /** + * Method used to log version of test class + */ + void SendTestClassVersion(); + + //ADD NEW METHOD DEC HERE + //[TestMethods] - Do not remove + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + enum TObjectType + { + EEngine = 1, + EMediaRecorder, + ERecordItf, + EEngineItf + }; + + protected: // Data + TInt MapErr(XAresult xa_res); + XAInterfaceID MapInterface(TInt interface); + XAObjectItf COpenMAXALTestModule::GetObject(TInt object); + TInt StoreInterface(TInt interface, void* id); + xaObjectCallback GetCallbackFunc(TInt object); + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + XAboolean required[MAX_NUMBER_INTERFACES]; + XAInterfaceID iidArray[MAX_NUMBER_INTERFACES]; + XAEngineOption EngineOption[MAX_NUMBER_OPTIONS]; + + XAObjectItf m_EOEngine; + XAObjectItf m_MORecorder; + XAObjectItf m_MOPlayer; + XARecordItf m_RecordItf; + XAObjectItf m_MOOutputMix; + XAObjectItf m_MOMetadataExtractor; + XAObjectItf m_MOExtnObject; + XAObjectItf m_MOVibraObject; + XAObjectItf m_MOLEDObject; + XAObjectItf m_MORadioObject; + XAObjectItf m_MOCameraObject; + + + XADynamicInterfaceManagementItf m_DIMItf; + + + XAEngineItf m_EngineItf; + XAAudioIODeviceCapabilitiesItf m_AIODevCapItf; + XAAudioEncoderCapabilitiesItf m_AEncCapItf; + XAAudioEncoderItf m_AudEncItf; + XAMetadataInsertionItf m_MetadataInsertionItf; + + /*Audio Source*/ + XADataSource m_AudioSource; + XADataLocator_IODevice m_IODevice; + + /*Image/Video Source*/ + XADataSource m_VideoSource; + + /*MetadataExtractor Source*/ + XADataSource m_MOMetadataExtractorSource; + + /*Data Sink*/ + XADataSink m_DataSink; + XADataSink m_AudioSink; + XADataSink m_VideoSink; + XADataSink m_LEDSink; + XADataSink m_VibraSink; + + + XADataLocator_URI m_Uri; + HBufC8* m_URIName; + + XADataFormat_MIME m_Mime; + HBufC8* m_MimeType; + + // ?one_line_short_description_of_data + //?data_declaration; + + // Reserved pointer for future extension + //TAny* iReserved; + + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +#endif // OPENMAXALTESTMODULE_H + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/init/testframework.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/init/testframework.ini Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,223 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +# This is STIFTestFramework initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. +# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation +# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 +# + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= c:\LOGS\TestFramework\ +TestReportFileName= TestReport_OmxALTestClass + +TestReportFormat= TXT # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +DisableMeasurement= stifmeasurementdisablenone # Possible values are: + # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' + # 'stifmeasurementplugin01', 'stifmeasurementplugin02', + # 'stifmeasurementplugin03', 'stifmeasurementplugin04', + # 'stifmeasurementplugin05' or 'stifbappeaprofiler' + +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + +#[New_Module] +#ModuleName= demomodule +#[End_Module] + +[New_Module] +ModuleName= TestScripter +IniFile = c:\testframework\openmaxaltestmodule_common.cfg +TestCaseFile= c:\testframework\openmaxaltestmodule_objectitf.cfg +TestCaseFile= c:\testframework\openmaxaltestmodule_ro_mdinsertionitf.cfg +TestCaseFile= c:\testframework\openmaxaltestmodule_ro_recorditf.cfg +TestCaseFile= c:\testframework\openmaxaltestmodule_ro_audioencoderitf.cfg +TestCaseFile= c:\testframework\openmaxaltestmodule_engine_audenccapitf.cfg +TestCaseFile= c:\testframework\openmaxaltestmodule_global.cfg +TestCaseFile= c:\testframework\openmaxaltestmodule_engine_engineitf.cfg +TestCaseFile= c:\testframework\openmaxaltestmodule_engine_aiodcitf.cfg +[End_Module] + + + +# Load testmoduleXXX, optionally with initialization file and/or test case files +#[New_Module] +#ModuleName= testmodulexxx + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) +#TestCaseFile= c:\testframework\testcases1.cfg +#TestCaseFile= c:\testframework\testcases2.cfg +#TestCaseFile= c:\testframework\manualtestcases.cfg + +#[End_Module] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIFTestFramework logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# +# - Will write log file in unicode format. +# + YES, Log file will be written in unicode format +# + NO, Log will be written as normal, not unicode, file. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' +#NOTE: TestEngine and TestServer logging settings cannot change here + +CreateLogDirectories= YES # Possible values: YES or NO + +#EmulatorBasePath= C:\LOGS\TestFramework\ +#EmulatorFormat= HTML # Possible values: TXT or HTML +#EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +#FileUnicode= YES # Possible values: YES or NO + +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file \ No newline at end of file diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalcommontests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalcommontests.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,359 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +TInt COpenMAXALTestModule::al_SetDataSink( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt type; + TInt formattype(0); + + TInt sinktype(0); + XADataSink commonSink = {NULL,NULL}; + + status = aItem.GetNextInt(type); + if(!status) + { + switch(type) + { + case XA_DATALOCATOR_URI: + { + commonSink.pLocator = &m_Uri; + } + break; + case XA_DATALOCATOR_ADDRESS: + case XA_DATALOCATOR_IODEVICE: + { + commonSink.pLocator = &m_IODevice; + } + case XA_DATALOCATOR_OUTPUTMIX: + case XA_DATALOCATOR_NATIVEDISPLAY: + break; + default: + status = KErrGeneral; + break; + } + } + + if(!status) + { + status = aItem.GetNextInt(formattype); + + switch(formattype) + { + case XA_DATAFORMAT_MIME: + { + commonSink.pFormat = &m_Mime; + } + break; + case XA_DATAFORMAT_PCM: + case XA_DATAFORMAT_RAWIMAGE: + break; + default: + status = KErrGeneral; + break; + } + + } + + if(!status) + { + status = aItem.GetNextInt(sinktype); + if(!status) + { + switch(sinktype) + { + case 1: + m_AudioSink = commonSink; + break; + case 2: + m_VideoSink = commonSink; + break; + case 3: + m_LEDSink = commonSink; + break; + case 4: + m_VibraSink = commonSink; + break; + case 5: + m_DataSink = commonSink; + break; + default: + status = KErrGeneral; + break; + } + } + } + return status; + } + +TInt COpenMAXALTestModule::al_SetDataSource( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt type; + TInt sourcetype(0); + TInt formattype(0); + + XADataSource commonSource = {NULL,NULL}; + status = aItem.GetNextInt(type); + if(!status) + { + switch(type) + { + case XA_DATALOCATOR_URI: + { + commonSource.pLocator = &m_Uri; + } + break; + case XA_DATALOCATOR_ADDRESS: + case XA_DATALOCATOR_IODEVICE: + { + commonSource.pLocator = &m_IODevice; + } + case XA_DATALOCATOR_OUTPUTMIX: + case XA_DATALOCATOR_NATIVEDISPLAY: + break; + default: + status = KErrGeneral; + break; + } + } + + if(!status) + { + status = aItem.GetNextInt(formattype); + if(!status) + { + switch(formattype) + { + case XA_DATAFORMAT_MIME: + { + commonSource.pFormat = (void*) &m_Mime; + } + break; + case XA_DATAFORMAT_PCM: + case XA_DATAFORMAT_RAWIMAGE: + break; + default: + status = KErrGeneral; + break; + } + } + } + + + if(!status) + { + status = aItem.GetNextInt(sourcetype); + if(!status) + { + switch(sourcetype) + { + case 1: + m_AudioSource = commonSource; + break; + case 2: + m_VideoSource = commonSource; + break; + case 3: + m_MOMetadataExtractorSource = commonSource; + break; + default: + status = KErrGeneral; + break; + } + } + } + + return status; + } + +TInt COpenMAXALTestModule::al_SetDataLocator( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt type; + + status = aItem.GetNextInt(type); + + switch(type) + { + case XA_DATALOCATOR_URI: + { + TPtrC uri; + if(m_URIName) + { + delete m_URIName; + m_URIName = NULL; + } + //status = aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing); + status = aItem.GetNextString(uri); + if(!status) + { + m_URIName = HBufC8::NewL(uri.Length()+1); + TPtr8 desc = m_URIName->Des(); + desc.Copy(uri); + m_Uri.locatorType = XA_DATALOCATOR_URI; + m_Uri.URI = (XAchar*) desc.PtrZ(); + } + else + { + status = KErrGeneral; + } + } + break; + case XA_DATALOCATOR_IODEVICE: + { + TInt devicetype; + TUint deviceId; + + status = aItem.GetNextInt(devicetype); + if(!status) + { + status = aItem.GetNextInt(deviceId); + if(!status) + { + m_IODevice.deviceID = deviceId; + m_IODevice.deviceType = devicetype; + m_IODevice.locatorType = XA_DATALOCATOR_IODEVICE; + } + else + { + status = KErrGeneral; + } + } + else + { + status = KErrGeneral; + } + } + break; + case XA_DATALOCATOR_OUTPUTMIX: + case XA_DATALOCATOR_NATIVEDISPLAY: + case XA_DATALOCATOR_ADDRESS: + break; + default: + status = KErrGeneral; + break; + } + return status; + } + +TInt COpenMAXALTestModule::al_SetDataFormat( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt type; + TInt contType(0); + TPtrC mimetype; + status = aItem.GetNextInt(type); + + switch(type) + { + case XA_DATAFORMAT_MIME: + { + status = aItem.GetNextString(mimetype); + if(!status) + { + status = aItem.GetNextInt(contType); + if(!status) + { + if(m_MimeType) + { + delete m_MimeType; + m_MimeType = NULL; + } + m_MimeType = HBufC8::NewL(mimetype.Length()+1); + TPtr8 desc = m_MimeType->Des(); + desc.Copy(mimetype); + m_Mime.formatType = XA_DATAFORMAT_MIME; + m_Mime.mimeType = (XAchar*) desc.PtrZ(); + m_Mime.containerType = contType; + } + else + { + status = KErrGeneral; + } + } + else + { + status = KErrGeneral; + } + } + break; + case XA_DATAFORMAT_PCM: + case XA_DATAFORMAT_RAWIMAGE: + break; + default: + status = KErrGeneral; + break; + } + return status; + } + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaldynitfmgmtitfcallbacks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaldynitfmgmtitfcallbacks.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + + +void DynamicInterfaceManagementCallback ( + XADynamicInterfaceManagementItf caller, + void * pContext, + XAuint32 event, + XAresult result, + const XAInterfaceID iid +) + { + + } + + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaldynitfmgmtitftests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaldynitfmgmtitftests.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,211 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +void DynamicInterfaceManagementCallback ( + XADynamicInterfaceManagementItf caller, + void * pContext, + XAuint32 event, + XAresult result, + const XAInterfaceID iid +); + + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +TInt COpenMAXALTestModule::al_dimitf_AddInterface( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt async(0); + TInt interface(0); + XAInterfaceID id(NULL); + + + status = aItem.GetNextInt(interface); + if(!status) + { + id = MapInterface(interface); + } + else + { + status = KErrGeneral; + } + + status = aItem.GetNextInt(async); + if(!status) + { + if(m_DIMItf) + { + res = (*m_DIMItf)->AddInterface(m_DIMItf,id,async); + status = res; + } + } + else + { + status = KErrGeneral; + } + return status; + } + +TInt COpenMAXALTestModule::al_dimitf_RemoveInterface( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt async(0); + TInt interface(0); + XAInterfaceID id(NULL); + + status = aItem.GetNextInt(interface); + if(!status) + { + id = MapInterface(interface); + status = StoreInterface(interface, NULL); + } + else + { + status = KErrGeneral; + } + + status = aItem.GetNextInt(async); + if(!status) + { + if(m_DIMItf) + { + res = (*m_DIMItf)->RemoveInterface(m_DIMItf,id); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + status = KErrGeneral; + } + return status; + } + +TInt COpenMAXALTestModule::al_dimitf_ResumeInterface( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt async(0); + TInt interface(0); + XAInterfaceID id(NULL); + + + status = aItem.GetNextInt(interface); + if(!status) + { + id = MapInterface(interface); + } + else + { + status = KErrGeneral; + } + + status = aItem.GetNextInt(async); + if(!status) + { + if(m_DIMItf) + { + res = (*m_DIMItf)->ResumeInterface(m_DIMItf,id,async); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + status = KErrGeneral; + } + return status; + } + +TInt COpenMAXALTestModule::al_dimitf_RegisterCallback( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + if(m_DIMItf) + { + res = (*m_DIMItf)->RegisterCallback(m_DIMItf,DynamicInterfaceManagementCallback,(void*)this); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + + + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalobjectcallbacks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalobjectcallbacks.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); +void ObjectCallback(XAObjectItf caller, + const void * pContext, + XAuint32 event, + XAresult result, + XAuint32 param, + void * pInterface); + +void MediaRecorderCallback(XAObjectItf caller, + const void * pContext, + XAuint32 event, + XAresult result, + XAuint32 param, + void * pInterface); +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +xaObjectCallback COpenMAXALTestModule::GetCallbackFunc(TInt object) + { + xaObjectCallback func(NULL); + switch(object) + { + case EEngine: + func = ObjectCallback; + break; + case EMediaRecorder: + func = MediaRecorderCallback; + break; + default: + func = NULL; + break; + } + return func; + + } + + +void ObjectCallback(XAObjectItf caller, + const void * pContext, + XAuint32 event, + XAresult result, + XAuint32 param, + void * pInterface) + { + + } + +void MediaRecorderCallback(XAObjectItf caller, + const void * pContext, + XAuint32 event, + XAresult result, + XAuint32 param, + void * pInterface) + { + + } + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalobjectitftests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalobjectitftests.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,374 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +TInt COpenMAXALTestModule::al_objitf_Realize( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt object(0); + TInt async; + status = aItem.GetNextInt(object); + if(!status) + { + XAObjectItf itf = GetObject(object); + if(itf != NULL) + { + status = aItem.GetNextInt(async); + if(!status) + { + res = (*itf)->Realize(itf, async); + status = res; + } + else + { + status = KErrGeneral; + } + } + } + return status; + } + +TInt COpenMAXALTestModule::al_objitf_Resume( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt object(0); + TInt async; + status = aItem.GetNextInt(object); + if(!status) + { + XAObjectItf itf = GetObject(object); + if(itf != NULL) + { + status = aItem.GetNextInt(async); + if(!status) + { + res = (*itf)->Resume(itf, async); + status = res; + } + else + { + status = KErrGeneral; + } + } + } + return status; } + +TInt COpenMAXALTestModule::al_objitf_GetState( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt object(0); + XAuint32 state; + status = aItem.GetNextInt(object); + if(!status) + { + XAObjectItf itf = GetObject(object); + if(itf != NULL) + { + res = (*itf)->GetState(itf, &state); + status = res; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_objitf_GetInterface( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt object(0); + TInt interface(0); + XAInterfaceID id; + void* retid(NULL); + status = aItem.GetNextInt(object); + if(!status) + { + XAObjectItf itf = GetObject(object); + if(itf != NULL) + { + status = aItem.GetNextInt(interface); + if(!status) + { + id = MapInterface(interface); + res = (*itf)->GetInterface(itf, id, &retid); + status = res; + if(!status) + { + status = StoreInterface(interface, retid); + } + } + else + { + status = KErrGeneral; + } + } + else + { + status = KErrGeneral; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_objitf_RegisterCallback( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt object(0); + XAresult res; + xaObjectCallback func; + status = aItem.GetNextInt(object); + if(!status) + { + XAObjectItf itf = GetObject(object); + if(itf != NULL) + { + func = GetCallbackFunc(object); + if(func) + { + res = (*itf)->RegisterCallback(itf, func, NULL); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_objitf_AbortAsyncOperation( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt object(0); + status = aItem.GetNextInt(object); + if(!status) + { + XAObjectItf itf = GetObject(object); + if(itf != NULL) + { + (*itf)->AbortAsyncOperation(itf); + } + } + return status; + } + +TInt COpenMAXALTestModule::al_objitf_Destroy( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt object(0); + status = aItem.GetNextInt(object); + if(!status) + { + XAObjectItf itf = GetObject(object); + if(itf != NULL) + { + (*itf)->Destroy(itf); + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_objitf_SetPriority( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt object(0); + TInt priority(0); + TInt preemptable(0); + + status = aItem.GetNextInt(object); + if(!status) + { + XAObjectItf itf = GetObject(object); + if(itf != NULL) + { + status = aItem.GetNextInt(priority); + if(status) + { + priority = 0; + preemptable = 0; + } + else + { + status = aItem.GetNextInt(preemptable); + if(status) + { + preemptable = 0; + } + } + (*itf)->SetPriority(itf,priority,preemptable); + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_objitf_GetPriority( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt object(0); + XAint32 priority(0); + XAboolean preemptable(0); + status = aItem.GetNextInt(object); + if(!status) + { + XAObjectItf itf = GetObject(object); + if(itf != NULL) + { + res = (*itf)->GetPriority(itf, &priority, &preemptable); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_objitf_SetLossOfControlInterfaces( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt object(0); + TInt enabled(0); + TInt numInterfaces(0); + XAresult res; + + status = aItem.GetNextInt(object); + + if(!status) + { + /* Initialize arrays required[] and iidArray[] */ + for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) + { + iidArray[i] = XA_IID_NULL; + } + + status = aItem.GetNextInt(numInterfaces); + + for(TInt j = 0; j < numInterfaces; j++) + { + TInt interface(0); + status = aItem.GetNextInt(interface); + if(!status) + { + iidArray[j] = MapInterface(interface); + numInterfaces = j++; + } + else + { + status = KErrGeneral; + break; + } + } + + if(!status) + { + status = aItem.GetNextInt(enabled); + if(!status) + { + XAObjectItf itf = GetObject(object); + if(itf != NULL) + { + res = (*itf)->SetLossOfControlInterfaces(itf, numInterfaces, iidArray, enabled); + status = res; + } + else + { + status = KErrNotFound; + } + } + } + + } + + return status; + + } + + + + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaltestmodule.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaltestmodule.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// INCLUDE FILES +#include +#include "openmaxaltestmodule.h" +#include + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// COpenMAXALTestModule::COpenMAXALTestModule +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +COpenMAXALTestModule::COpenMAXALTestModule( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + } + +// ----------------------------------------------------------------------------- +// COpenMAXALTestModule::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void COpenMAXALTestModule::ConstructL() + { + //Read logger settings to check whether test case name is to be + //appended to log file name. + RSettingServer settingServer; + TInt ret = settingServer.Connect(); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Struct to StifLogger settigs. + TLoggerSettings loggerSettings; + // Parse StifLogger defaults from STIF initialization file. + ret = settingServer.GetLoggerSettings(loggerSettings); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Close Setting server session + settingServer.Close(); + + TFileName logFileName; + + if(loggerSettings.iAddTestCaseTitle) + { + TName title; + TestModuleIf().GetTestCaseTitleL(title); + logFileName.Format(KOpenMAXALTestModuleLogFileWithTitle, &title); + } + else + { + logFileName.Copy(KOpenMAXALTestModuleLogFile); + } + + iLog = CStifLogger::NewL( KOpenMAXALTestModuleLogPath, + logFileName, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + SendTestClassVersion(); + } + +// ----------------------------------------------------------------------------- +// COpenMAXALTestModule::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +COpenMAXALTestModule* COpenMAXALTestModule::NewL( + CTestModuleIf& aTestModuleIf ) + { + COpenMAXALTestModule* self = new (ELeave) COpenMAXALTestModule( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + + } + +// Destructor +COpenMAXALTestModule::~COpenMAXALTestModule() + { + + // Delete resources allocated from test methods + Delete(); + + // Delete logger + delete iLog; + + } + +//----------------------------------------------------------------------------- +// COpenMAXALTestModule::SendTestClassVersion +// Method used to send version of test class +//----------------------------------------------------------------------------- +// +void COpenMAXALTestModule::SendTestClassVersion() + { + TVersion moduleVersion; + moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; + moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; + moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L("OpenMAXALTestModule.dll"); + + TBool newVersionOfMethod = ETrue; + TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) COpenMAXALTestModule::NewL( aTestModuleIf ); + + } + + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaltestmoduleblocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaltestmoduleblocks.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,653 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// COpenMAXALTestModule::Delete +// Delete here all resources allocated and opened from test methods. +// Called from destructor. +// ----------------------------------------------------------------------------- +// +void COpenMAXALTestModule::Delete() + { + if(m_URIName) + { + delete m_URIName; + m_URIName = NULL; + } + if(m_MimeType) + { + delete m_MimeType; + m_MimeType = NULL; + } + } + +// ----------------------------------------------------------------------------- +// COpenMAXALTestModule::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt COpenMAXALTestModule::RunMethodL( + CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + // Copy this line for every implemented function. + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + ENTRY( "Example", COpenMAXALTestModule::ExampleL ), + + /* Common Utility Functions begins*/ + ENTRY( "al_SetDataSource", COpenMAXALTestModule::al_SetDataSource ), + ENTRY( "al_SetDataSink", COpenMAXALTestModule::al_SetDataSink ), + ENTRY( "al_SetDataLocator", COpenMAXALTestModule::al_SetDataLocator ), + ENTRY( "al_SetDataFormat", COpenMAXALTestModule::al_SetDataFormat ), + /* Common Utility Functions ends*/ + + ENTRY( "al_createEngine", COpenMAXALTestModule::al_createEngine ), + ENTRY( "al_queryNumSupportedEngineInterfaces", COpenMAXALTestModule::al_queryNumSupportedEngineInterfaces ), + ENTRY( "al_querySupportedEngineInterfaces", COpenMAXALTestModule::al_querySupportedEngineInterfaces ), + + /*ObjectItf begins*/ + ENTRY( "al_objitf_Realize", COpenMAXALTestModule::al_objitf_Realize ), + ENTRY( "al_objitf_Resume", COpenMAXALTestModule::al_objitf_Resume ), + ENTRY( "al_objitf_GetState", COpenMAXALTestModule::al_objitf_GetState ), + ENTRY( "al_objitf_GetInterface", COpenMAXALTestModule::al_objitf_GetInterface ), + ENTRY( "al_objitf_RegisterCallback", COpenMAXALTestModule::al_objitf_RegisterCallback ), + ENTRY( "al_objitf_AbortAsyncOperation", COpenMAXALTestModule::al_objitf_AbortAsyncOperation ), + ENTRY( "al_objitf_Destroy", COpenMAXALTestModule::al_objitf_Destroy ), + ENTRY( "al_objitf_SetPriority", COpenMAXALTestModule::al_objitf_SetPriority ), + ENTRY( "al_objitf_GetPriority", COpenMAXALTestModule::al_objitf_GetPriority ), + ENTRY( "al_objitf_SetLossOfControlInterfaces", COpenMAXALTestModule::al_objitf_SetLossOfControlInterfaces ), + /*ObjectItf ends*/ + + /*DynItfMgmtItf begins*/ + ENTRY( "al_dimitf_AddInterface", COpenMAXALTestModule::al_dimitf_AddInterface ), + ENTRY( "al_dimitf_RemoveInterface", COpenMAXALTestModule::al_dimitf_RemoveInterface ), + ENTRY( "al_dimitf_ResumeInterface", COpenMAXALTestModule::al_dimitf_ResumeInterface ), + ENTRY( "al_dimitf_RegisterCallback", COpenMAXALTestModule::al_dimitf_RegisterCallback ), + /*DynItfMgmtItf ends*/ + + + /*EngineItf begins*/ + ENTRY( "al_engitf_CreateCameraDevice", COpenMAXALTestModule::al_engitf_CreateCameraDevice ), + ENTRY( "al_engitf_CreateRadioDevice", COpenMAXALTestModule::al_engitf_CreateRadioDevice ), + ENTRY( "al_engitf_CreateLEDDevice", COpenMAXALTestModule::al_engitf_CreateLEDDevice ), + ENTRY( "al_engitf_CreateVibraDevice", COpenMAXALTestModule::al_engitf_CreateVibraDevice ), + ENTRY( "al_engitf_CreateMediaPlayer", COpenMAXALTestModule::al_engitf_CreateMediaPlayer ), + ENTRY( "al_engitf_CreateMediaRecorder", COpenMAXALTestModule::al_engitf_CreateMediaRecorder ), + ENTRY( "al_engitf_CreateOutputMix", COpenMAXALTestModule::al_engitf_CreateOutputMix ), + ENTRY( "al_engitf_CreateMetadataExtractor", COpenMAXALTestModule::al_engitf_CreateMetadataExtractor ), + ENTRY( "al_engitf_CreateExtensionObject", COpenMAXALTestModule::al_engitf_CreateExtensionObject ), + ENTRY( "al_engitf_GetImplementationInfo", COpenMAXALTestModule::al_engitf_GetImplementationInfo ), + ENTRY( "al_engitf_QuerySupportedProfiles", COpenMAXALTestModule::al_engitf_QuerySupportedProfiles ), + ENTRY( "al_engitf_QueryNumSupportedInterfaces", COpenMAXALTestModule::al_engitf_QueryNumSupportedInterfaces ), + ENTRY( "al_engitf_QuerySupportedInterfaces", COpenMAXALTestModule::al_engitf_QuerySupportedInterfaces ), + ENTRY( "al_engitf_QueryNumSupportedExtension", COpenMAXALTestModule::al_engitf_QueryNumSupportedExtension ), + ENTRY( "al_engitf_QuerySupportedExtension", COpenMAXALTestModule::al_engitf_QuerySupportedExtension ), + ENTRY( "al_engitf_IsExtensionSupported", COpenMAXALTestModule::al_engitf_IsExtensionSupported ), + ENTRY( "al_engitf_QueryLEDCapabilities", COpenMAXALTestModule::al_engitf_QueryLEDCapabilities ), + ENTRY( "al_engitf_QueryVibraCapabilities", COpenMAXALTestModule::al_engitf_QueryVibraCapabilities ), + /*EngineItf ends*/ + + /*AudioIODeviceCapabilitiesItf ends*/ + ENTRY( "al_audioiodevcapitf_GetAvailableAudioInputs", COpenMAXALTestModule::al_audioiodevcapitf_GetAvailableAudioInputs ), + ENTRY( "al_audioiodevcapitf_QueryAudioInputCapabilities", COpenMAXALTestModule::al_audioiodevcapitf_QueryAudioInputCapabilities ), + ENTRY( "al_audioiodevcapitf_RegisterAvailableAudioInputsChangedCallback", COpenMAXALTestModule::al_audioiodevcapitf_RegisterAvailableAudioInputsChangedCallback ), + ENTRY( "al_audioiodevcapitf_GetAvailableAudioOutputs", COpenMAXALTestModule::al_audioiodevcapitf_GetAvailableAudioOutputs ), + ENTRY( "al_audioiodevcapitf_QueryAudioOutputCapabilities", COpenMAXALTestModule::al_audioiodevcapitf_QueryAudioOutputCapabilities ), + ENTRY( "al_audioiodevcapitf_RegisterAvailableAudioOutputsChangedCallback", COpenMAXALTestModule::al_audioiodevcapitf_RegisterAvailableAudioOutputsChangedCallback ), + ENTRY( "al_audioiodevcapitf_RegisterDefaultDeviceIDMapChangedCallback", COpenMAXALTestModule::al_audioiodevcapitf_RegisterDefaultDeviceIDMapChangedCallback ), + ENTRY( "al_audioiodevcapitf_GetAssociatedAudioInputs", COpenMAXALTestModule::al_audioiodevcapitf_GetAssociatedAudioInputs ), + ENTRY( "al_audioiodevcapitf_GetAssociatedAudioOutputs", COpenMAXALTestModule::al_audioiodevcapitf_GetAssociatedAudioOutputs ), + ENTRY( "al_audioiodevcapitf_GetDefaultAudioDevices", COpenMAXALTestModule::al_audioiodevcapitf_GetDefaultAudioDevices ), + ENTRY( "al_audioiodevcapitf_QuerySampleFormatsSupported", COpenMAXALTestModule::al_audioiodevcapitf_QuerySampleFormatsSupported ), + /*AudioIODeviceCapabilitiesItf ends*/ + + /*AudioEncoderCapabilitiesItf ends*/ + ENTRY( "al_audioencodercapitf_GetAudioEncoders", COpenMAXALTestModule::al_audioencodercapitf_GetAudioEncoders ), + ENTRY( "al_audioencodercapitf_GetAudioEncoderCapabilities", COpenMAXALTestModule::al_audioencodercapitf_GetAudioEncoderCapabilities ), + /*AudioIODeviceCapabilitiesItf ends*/ + + + /*RecordItf ends*/ + ENTRY( "al_recorditf_SetRecordState", COpenMAXALTestModule::al_recorditf_SetRecordState ), + ENTRY( "al_recorditf_GetRecordState", COpenMAXALTestModule::al_recorditf_GetRecordState ), + ENTRY( "al_recorditf_SetDurationLimit", COpenMAXALTestModule::al_recorditf_SetDurationLimit ), + ENTRY( "al_recorditf_GetPosition", COpenMAXALTestModule::al_recorditf_GetPosition ), + ENTRY( "al_recorditf_RegisterCallback", COpenMAXALTestModule::al_recorditf_RegisterCallback ), + ENTRY( "al_recorditf_SetCallbackEventsMask", COpenMAXALTestModule::al_recorditf_SetCallbackEventsMask ), + ENTRY( "al_recorditf_GetCallbackEventsMask", COpenMAXALTestModule::al_recorditf_GetCallbackEventsMask ), + ENTRY( "al_recorditf_SetMarkerPosition", COpenMAXALTestModule::al_recorditf_SetMarkerPosition ), + ENTRY( "al_recorditf_ClearMarkerPosition", COpenMAXALTestModule::al_recorditf_ClearMarkerPosition ), + ENTRY( "al_recorditf_GetMarkerPosition", COpenMAXALTestModule::al_recorditf_GetMarkerPosition ), + ENTRY( "al_recorditf_SetPositionUpdatePeriod", COpenMAXALTestModule::al_recorditf_SetPositionUpdatePeriod ), + ENTRY( "al_recorditf_GetPositionUpdatePeriod", COpenMAXALTestModule::al_recorditf_GetPositionUpdatePeriod ), + /*RecordItf ends*/ + + + /*AudioEncoderItf ends*/ + ENTRY( "al_audioencoderitf_SetEncoderSettings", COpenMAXALTestModule::al_audioencoderitf_SetEncoderSettings ), + ENTRY( "al_audioencoderitf_GetEncoderSettings", COpenMAXALTestModule::al_audioencoderitf_GetEncoderSettings ), + /*AudioEncoderItf ends*/ + + + /*MetadataInsertionItf ends*/ + ENTRY( "al_metadatainsertionitf_CreateChildNode", COpenMAXALTestModule::al_metadatainsertionitf_CreateChildNode ), + ENTRY( "al_metadatainsertionitf_GetSupportedKeysCount", COpenMAXALTestModule::al_metadatainsertionitf_GetSupportedKeysCount ), + ENTRY( "al_metadatainsertionitf_GetKeySize", COpenMAXALTestModule::al_metadatainsertionitf_GetKeySize ), + ENTRY( "al_metadatainsertionitf_GetKey", COpenMAXALTestModule::al_metadatainsertionitf_GetKey ), + ENTRY( "al_metadatainsertionitf_GetFreeKeysEncoding", COpenMAXALTestModule::al_metadatainsertionitf_GetFreeKeysEncoding ), + ENTRY( "al_metadatainsertionitf_InsertMetadataItem", COpenMAXALTestModule::al_metadatainsertionitf_InsertMetadataItem ), + ENTRY( "al_metadatainsertionitf_RegisterCallback", COpenMAXALTestModule::al_metadatainsertionitf_RegisterCallback ), + /*MetadataInsertionItf ends*/ + + //ADD NEW ENTRY HERE + // [test cases entries] - Do not remove + + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +// ----------------------------------------------------------------------------- +// COpenMAXALTestModule::ExampleL +// Example test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt COpenMAXALTestModule::ExampleL( CStifItemParser& aItem ) + { + + // Print to UI + _LIT( KOpenMAXALTestModule, "OpenMAXALTestModule" ); + _LIT( KExample, "In Example" ); + TestModuleIf().Printf( 0, KOpenMAXALTestModule, KExample ); + // Print to log file + iLog->Log( KExample ); + + TInt i = 0; + TPtrC string; + _LIT( KParam, "Param[%i]: %S" ); + while ( aItem.GetNextString ( string ) == KErrNone ) + { + TestModuleIf().Printf( i, KOpenMAXALTestModule, + KParam, i, &string ); + i++; + } + + return KErrNone; + + } + +TInt COpenMAXALTestModule::MapErr(XAresult xa_res) + { + TInt status(KErrGeneral); + switch(xa_res) + { + case XA_RESULT_SUCCESS: + //iLog->Log(_L("XA_RESULT_SUCCESS")); + status = KErrNone; + break; + case XA_RESULT_PRECONDITIONS_VIOLATED: + iLog->Log(_L("XA_RESULT_PRECONDITIONS_VIOLATED")); + break; + case XA_RESULT_PARAMETER_INVALID: + iLog->Log(_L("XA_RESULT_PARAMETER_INVALID")); + break; + case XA_RESULT_MEMORY_FAILURE: + iLog->Log(_L("XA_RESULT_MEMORY_FAILURE")); + break; + case XA_RESULT_RESOURCE_ERROR: + iLog->Log(_L("XA_RESULT_RESOURCE_ERROR")); + break; + case XA_RESULT_RESOURCE_LOST: + iLog->Log(_L("XA_RESULT_RESOURCE_LOST")); + break; + case XA_RESULT_IO_ERROR: + iLog->Log(_L("XA_RESULT_IO_ERROR")); + break; + case XA_RESULT_BUFFER_INSUFFICIENT: + iLog->Log(_L("XA_RESULT_BUFFER_INSUFFICIENT")); + break; + case XA_RESULT_CONTENT_CORRUPTED: + iLog->Log(_L("XA_RESULT_CONTENT_CORRUPTED")); + break; + case XA_RESULT_CONTENT_UNSUPPORTED: + iLog->Log(_L("XA_RESULT_CONTENT_UNSUPPORTED")); + break; + case XA_RESULT_CONTENT_NOT_FOUND: + iLog->Log(_L("XA_RESULT_CONTENT_NOT_FOUND")); + break; + case XA_RESULT_PERMISSION_DENIED: + iLog->Log(_L("XA_RESULT_PERMISSION_DENIED")); + break; + case XA_RESULT_FEATURE_UNSUPPORTED: + iLog->Log(_L("XA_RESULT_FEATURE_UNSUPPORTED")); + break; + case XA_RESULT_INTERNAL_ERROR: + iLog->Log(_L("XA_RESULT_INTERNAL_ERROR")); + break; + case XA_RESULT_UNKNOWN_ERROR: + iLog->Log(_L("XA_RESULT_UNKNOWN_ERROR")); + break; + case XA_RESULT_OPERATION_ABORTED: + iLog->Log(_L("XA_RESULT_OPERATION_ABORTED")); + break; + case XA_RESULT_CONTROL_LOST: + iLog->Log(_L("XA_RESULT_CONTROL_LOST")); + break; + default: + iLog->Log(_L("Unknown Error!!!")); + } + return status; + } + + +XAInterfaceID COpenMAXALTestModule::MapInterface(TInt interface) + { + XAInterfaceID id(XA_IID_NULL); + switch(interface) + { + case 1: + id = XA_IID_NULL; + break; + case 2: + id = XA_IID_OBJECT; + break; + case 3: + id = XA_IID_CONFIGEXTENSION; + break; + case 4: + id = XA_IID_DYNAMICINTERFACEMANAGEMENT; + break; + case 5: + id = XA_IID_ENGINE; + break; + case 6: + id = XA_IID_THREADSYNC; + break; + case 7: + id = XA_IID_PLAY; + break; + case 8: + id = XA_IID_PLAYBACKRATE; + break; + case 9: + id = XA_IID_PREFETCHSTATUS; + break; + case 10: + id = XA_IID_SEEK; + break; + case 11: + id = XA_IID_VOLUME; + break; + case 12: + id = XA_IID_IMAGECONTROLS; + break; + case 13: + id = XA_IID_IMAGEEFFECTS; + break; + case 14: + id = XA_IID_VIDEOPOSTPROCESSING; + break; + case 15: + id = XA_IID_RECORD; + break; + case 16: + id = XA_IID_SNAPSHOT; + break; + case 17: + id = XA_IID_METADATAEXTRACTION; + break; + case 18: + id = XA_IID_METADATAINSERTION; + break; + case 19: + id = XA_IID_METADATATRAVERSAL; + break; + case 20: + id = XA_IID_DYNAMICSOURCE; + break; + case 21: + id = XA_IID_CAMERACAPABILITIES; + break; + case 22: + id = XA_IID_CAMERA; + break; + case 23: + id = XA_IID_AUDIOIODEVICECAPABILITIES; + break; + case 24: + id = XA_IID_DEVICEVOLUME; + break; + case 25: + id = XA_IID_EQUALIZER; + break; + case 26: + id = XA_IID_OUTPUTMIX; + break; + case 27: + id = XA_IID_RADIO; + break; + case 28: + id = XA_IID_RDS; + break; + case 29: + id = XA_IID_VIBRA; + break; + case 30: + id = XA_IID_LED; + break; + case 31: + id = XA_IID_AUDIODECODERCAPABILITIES; + break; + case 32: + id = XA_IID_AUDIOENCODER; + break; + case 33: + id = XA_IID_AUDIOENCODERCAPABILITIES; + break; + case 34: + id = XA_IID_IMAGEENCODERCAPABILITIES; + break; + case 35: + id = XA_IID_IMAGEDECODERCAPABILITIES; + break; + case 36: + id = XA_IID_IMAGEENCODER; + break; + case 37: + id = XA_IID_VIDEODECODERCAPABILITIES; + break; + case 38: + id = XA_IID_VIDEOENCODER; + break; + case 39: + id = XA_IID_VIDEOENCODERCAPABILITIES; + break; + case 40: + id = XA_IID_STREAMINFORMATION; + break; + default: + break; + } + return id; + } + +XAObjectItf COpenMAXALTestModule::GetObject(TInt object) + { + XAObjectItf itf; + switch(object) + { + case XA_OBJECTID_ENGINE: + itf = m_EOEngine; + break; + case XA_OBJECTID_LEDDEVICE: + itf = m_MOLEDObject; + break; + case XA_OBJECTID_VIBRADEVICE: + itf = m_MOVibraObject; + break; + case XA_OBJECTID_MEDIAPLAYER: + itf = m_MOPlayer; + break; + case XA_OBJECTID_MEDIARECORDER: + itf = m_MORecorder; + break; + case XA_OBJECTID_RADIODEVICE: + itf = m_MORadioObject; + break; + case XA_OBJECTID_OUTPUTMIX: + itf = m_MOOutputMix; + break; + case XA_OBJECTID_METADATAEXTRACTOR: + itf = m_MOMetadataExtractor; + break; + case XA_OBJECTID_CAMERADEVICE: + itf = m_MOCameraObject; + break; + case 10: + /*Extension Object Defined own id as 10*/ + itf = m_MOExtnObject; + break; + default: + itf = NULL; + break; + } + return itf; + } + +TInt COpenMAXALTestModule::StoreInterface(TInt interface, void* id) + { + TInt status(KErrNone); + switch(interface) + { + case 1: +/* XA_IID_NULL;*/ + break; + case 2: +/* XA_IID_OBJECT;*/ + break; + case 3: +/* XA_IID_CONFIGEXTENSION;*/ + break; + case 4: + m_DIMItf = XADynamicInterfaceManagementItf(id); +/* XA_IID_DYNAMICINTERFACEMANAGEMENT;*/ + break; + case 5: + m_EngineItf = XAEngineItf(id); + break; + case 6: +/* XA_IID_THREADSYNC;*/ + break; + case 7: +/* XA_IID_PLAY;*/ + break; + case 8: +/* XA_IID_PLAYBACKRATE;*/ + break; + case 9: +/* XA_IID_PREFETCHSTATUS;*/ + break; + case 10: +/* XA_IID_SEEK;*/ + break; + case 11: +/* XA_IID_VOLUME;*/ + break; + case 12: +/* XA_IID_IMAGECONTROLS;*/ + break; + case 13: +/* XA_IID_IMAGEEFFECTS;*/ + break; + case 14: +/* XA_IID_VIDEOPOSTPROCESSING;*/ + break; + case 15: + m_RecordItf = XARecordItf(id); + break; + case 16: +/* XA_IID_SNAPSHOT;*/ + break; + case 17: +/* XA_IID_METADATAEXTRACTION;*/ + break; + case 18: + m_MetadataInsertionItf = XAMetadataInsertionItf(id); +/* XA_IID_METADATAINSERTION;*/ + break; + case 19: +/* XA_IID_METADATATRAVERSAL;*/ + break; + case 20: +/* XA_IID_DYNAMICSOURCE;*/ + break; + case 21: +/* XA_IID_CAMERACAPABILITIES;*/ + break; + case 22: +/* XA_IID_CAMERA;*/ + break; + case 23: + m_AIODevCapItf = XAAudioIODeviceCapabilitiesItf(id); +/* XA_IID_AUDIOIODEVICECAPABILITIES;*/ + break; + case 24: +/* XA_IID_DEVICEVOLUME;*/ + break; + case 25: +/* XA_IID_EQUALIZER;*/ + break; + case 26: +/* XA_IID_OUTPUTMIX;*/ + break; + case 27: +/* XA_IID_RADIO;*/ + break; + case 28: +/* XA_IID_RDS;*/ + break; + case 29: +/* XA_IID_VIBRA;*/ + break; + case 30: +/* XA_IID_LED;*/ + break; + case 31: +/* XA_IID_AUDIODECODERCAPABILITIES;*/ + break; + case 32: + m_AudEncItf = XAAudioEncoderItf(id); +/* XA_IID_AUDIOENCODER;*/ + break; + case 33: + m_AEncCapItf = XAAudioEncoderCapabilitiesItf(id); +/* XA_IID_AUDIOENCODERCAPABILITIES;*/ + break; + case 34: +/* XA_IID_IMAGEENCODERCAPABILITIES;*/ + break; + case 35: +/* XA_IID_IMAGEDECODERCAPABILITIES;*/ + break; + case 36: +/* XA_IID_IMAGEENCODER;*/ + break; + case 37: +/* XA_IID_VIDEODECODERCAPABILITIES;*/ + break; + case 38: +/* XA_IID_VIDEOENCODER;*/ + break; + case 39: +/* XA_IID_VIDEOENCODERCAPABILITIES;*/ + break; + case 40: +/* XA_IID_STREAMINFORMATION;*/ + break; + default: + break; + + } + return status; + } + + +// ----------------------------------------------------------------------------- +// COpenMAXALTestModule::?member_function +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +/* +TInt COpenMAXALTestModule::?member_function( + CItemParser& aItem ) + { + + ?code + + } +*/ + +// ========================== OTHER EXPORTED FUNCTIONS ========================= +// None + +// [End of File] - Do not remove diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalaudioencodercapabiltiesitftests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalaudioencodercapabiltiesitftests.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +TInt COpenMAXALTestModule::al_audioencodercapitf_GetAudioEncoders( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt numEncoders(0); + XAuint32 deviceIdArr[4]; + XAresult res; + XAuint32 numEnc(0); + + status = aItem.GetNextInt(numEncoders); + if(!status) + { + numEnc = numEncoders; + if(m_AEncCapItf) + { + res = (*m_AEncCapItf)->GetAudioEncoders( + m_AEncCapItf, &numEnc, deviceIdArr); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + if(m_AEncCapItf) + { + res = (*m_AEncCapItf)->GetAudioEncoders( + m_AEncCapItf, &numEnc, NULL); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_audioencodercapitf_GetAudioEncoderCapabilities( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt encId(0); + XAuint32 encoderid(0); + XAuint32 index(0); + XAAudioCodecDescriptor desc; + XAresult res; + + status = aItem.GetNextInt(encId); + if(!status) + { + encoderid = encId; + if(m_AEncCapItf) + { + res = (*m_AEncCapItf)->GetAudioEncoderCapabilities( + m_AEncCapItf, encoderid, &index, &desc); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalaudioiodevicecapabilitiesitfcallbacks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalaudioiodevicecapabilitiesitfcallbacks.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ +void AvailAudioOutputsChangedCallback( + XAAudioIODeviceCapabilitiesItf caller, + void * pContext, + XAuint32 deviceID, + XAint32 numInputs, + XAboolean isNew) + { + + } + +void AvailAudioInputsChangedCallback( + XAAudioIODeviceCapabilitiesItf caller, + void * pContext, + XAuint32 deviceID, + XAint32 numInputs, + XAboolean isNew) + { + + } + +void DefaultDeviceIDMapChangedCallback ( + XAAudioIODeviceCapabilitiesItf caller, + void * pContext, + XAboolean isOutput, + XAint32 numDevices) + { + + } diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalaudioiodevicecapabilitiesitftests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalaudioiodevicecapabilitiesitftests.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,493 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +void AvailAudioInputsChangedCallback( + XAAudioIODeviceCapabilitiesItf caller, + void * pContext, + XAuint32 deviceID, + XAint32 numInputs, + XAboolean isNew + ); + +void AvailAudioOutputsChangedCallback( + XAAudioIODeviceCapabilitiesItf caller, + void * pContext, + XAuint32 deviceID, + XAint32 numInputs, + XAboolean isNew + ); + +void DefaultDeviceIDMapChangedCallback ( + XAAudioIODeviceCapabilitiesItf caller, + void * pContext, + XAboolean isOutput, + XAint32 numDevices); + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +TInt COpenMAXALTestModule::al_audioiodevcapitf_GetAvailableAudioInputs( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + + TInt deviceId(0); + XAint32 devId; + XAuint32* deviceIdArr(NULL); + + status = aItem.GetNextInt(deviceId); + if(!status) + { + devId = deviceId; + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->GetAvailableAudioInputs( + m_AIODevCapItf, &devId, deviceIdArr); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->GetAvailableAudioInputs( + m_AIODevCapItf, &devId, NULL); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_audioiodevcapitf_QueryAudioInputCapabilities( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAAudioInputDescriptor inputDesc; + XAresult res; + TUint deviceId(0); + XAuint32 devId(0); + + status = aItem.GetNextInt(deviceId); + if(!status) + { + devId = deviceId; + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->QueryAudioInputCapabilities( + m_AIODevCapItf, devId, &inputDesc); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_audioiodevcapitf_RegisterAvailableAudioInputsChangedCallback( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->RegisterAvailableAudioInputsChangedCallback( + m_AIODevCapItf, AvailAudioInputsChangedCallback, (void*)this); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_audioiodevcapitf_GetAvailableAudioOutputs( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + + TInt deviceId(0); + XAint32 devId; + XAuint32* deviceIdArr(NULL); + + status = aItem.GetNextInt(deviceId); + if(!status) + { + devId = deviceId; + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->GetAvailableAudioOutputs( + m_AIODevCapItf, &devId, deviceIdArr); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->GetAvailableAudioOutputs( + m_AIODevCapItf, &devId, NULL); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_audioiodevcapitf_QueryAudioOutputCapabilities( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAAudioOutputDescriptor outputDesc; + XAresult res; + TUint deviceId(0); + XAuint32 devId(0); + + status = aItem.GetNextInt(deviceId); + if(!status) + { + devId = deviceId; + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->QueryAudioOutputCapabilities( + m_AIODevCapItf, devId, &outputDesc); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_audioiodevcapitf_RegisterAvailableAudioOutputsChangedCallback( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->RegisterAvailableAudioOutputsChangedCallback( + m_AIODevCapItf, AvailAudioOutputsChangedCallback, (void*)this); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_audioiodevcapitf_RegisterDefaultDeviceIDMapChangedCallback( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->RegisterDefaultDeviceIDMapChangedCallback( + m_AIODevCapItf, DefaultDeviceIDMapChangedCallback, (void*)this); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_audioiodevcapitf_GetAssociatedAudioInputs( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + + TUint deviceId(0); + TInt sizeArr(0); + XAuint32 devId(0); + XAint32 numInputs(0); + XAuint32 deviceIdArr[2]; + + status = aItem.GetNextInt(deviceId); + if(!status) + { + devId = deviceId; + status = aItem.GetNextInt(sizeArr); + if(!status) + { + numInputs = sizeArr; + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->GetAssociatedAudioInputs( + m_AIODevCapItf, devId, &numInputs, deviceIdArr); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->GetAssociatedAudioInputs( + m_AIODevCapItf, devId,&numInputs, NULL); + status = res; + } + else + { + status = KErrNotFound; + } + } + } + else + { + status = KErrGeneral; + } + return status; + } + +TInt COpenMAXALTestModule::al_audioiodevcapitf_GetAssociatedAudioOutputs( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + + TUint deviceId(0); + TInt sizeArr(0); + XAuint32 devId(0); + XAint32 numOutputs(0); + XAuint32 deviceIdArr[2]; + + status = aItem.GetNextInt(deviceId); + if(!status) + { + devId = deviceId; + status = aItem.GetNextInt(sizeArr); + if(!status) + { + numOutputs = sizeArr; + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->GetAssociatedAudioOutputs( + m_AIODevCapItf, devId, &numOutputs, deviceIdArr); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->GetAssociatedAudioOutputs( + m_AIODevCapItf, devId,&numOutputs, NULL); + status = res; + } + else + { + status = KErrNotFound; + } + } + } + else + { + status = KErrGeneral; + } + return status; + } + +TInt COpenMAXALTestModule::al_audioiodevcapitf_GetDefaultAudioDevices( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + + TUint deviceId(0); + TInt sizeArr(0); + XAuint32 devId(0); + XAint32 numOutputs(0); + XAuint32 deviceIdArr[2]; + + status = aItem.GetNextInt(deviceId, EHex); + if(!status) + { + devId = deviceId; + status = aItem.GetNextInt(sizeArr); + if(!status) + { + numOutputs = sizeArr; + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->GetDefaultAudioDevices( + m_AIODevCapItf, devId, &numOutputs, deviceIdArr); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->GetDefaultAudioDevices( + m_AIODevCapItf, devId,&numOutputs, NULL); + status = res; + } + else + { + status = KErrNotFound; + } + } + } + else + { + status = KErrGeneral; + } + return status; + } + +TInt COpenMAXALTestModule::al_audioiodevcapitf_QuerySampleFormatsSupported( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt sizeArr(0); + TUint deviceId(0); + TInt samplerate(0); + XAuint32 devId(0); + XAmilliHertz samplingrate; + XAint32 deviceIdArr[20]; + XAint32 numSampleRates(0); + + status = aItem.GetNextInt(deviceId); + if(!status) + { + devId = deviceId; + status = aItem.GetNextInt(samplerate); + if(!status) + { + samplingrate = samplerate; + status = aItem.GetNextInt(sizeArr); + if(!status) + { + numSampleRates = sizeArr; + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->QuerySampleFormatsSupported( + m_AIODevCapItf, devId, samplingrate, deviceIdArr, &numSampleRates); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + if(m_AIODevCapItf) + { + res = (*m_AIODevCapItf)->QuerySampleFormatsSupported( + m_AIODevCapItf, devId, samplingrate, NULL, &numSampleRates); + status = res; + } + else + { + status = KErrNotFound; + } + } + } + else + { + status = KErrGeneral; + } + } + else + { + status = KErrGeneral; + } + return status; + } + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalengineitftests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalengineitftests.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,868 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ +TInt COpenMAXALTestModule::al_engitf_CreateCameraDevice( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt objectId; + TInt numInterfaces(0); + XAresult res; + + + /* Initialize arrays required[] and iidArray[] */ + for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) + { + required[i] = XA_BOOLEAN_FALSE; + iidArray[i] = XA_IID_NULL; + } + + status = aItem.GetNextInt(numInterfaces); + if(!status) + { + for(TInt j = 0; j < numInterfaces; j++) + { + TInt interface(0); + status = aItem.GetNextInt(interface); + if(!status) + { + required[j] = XA_BOOLEAN_TRUE; + iidArray[j] = MapInterface(interface); + numInterfaces++; + } + else + { + break; + } + } + } + + + status = aItem.GetNextInt(objectId); + if(!status) + { + if(m_EngineItf) + { + res = (*m_EngineItf)->CreateCameraDevice( + m_EngineItf, &m_MOCameraObject, objectId, + numInterfaces, iidArray, required); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } + + +TInt COpenMAXALTestModule::al_engitf_CreateRadioDevice( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt numInterfaces(0); + XAresult res; + + + /* Initialize arrays required[] and iidArray[] */ + for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) + { + required[i] = XA_BOOLEAN_FALSE; + iidArray[i] = XA_IID_NULL; + } + + status = aItem.GetNextInt(numInterfaces); + if(!status) + { + for(TInt j = 0; j < numInterfaces; j++) + { + TInt interface(0); + status = aItem.GetNextInt(interface); + if(!status) + { + required[j] = XA_BOOLEAN_TRUE; + iidArray[j] = MapInterface(interface); + numInterfaces++; + } + else + { + break; + } + } + } + + + if(m_EngineItf) + { + res = (*m_EngineItf)->CreateRadioDevice( + m_EngineItf, &m_MORadioObject, + numInterfaces, iidArray, required); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_CreateLEDDevice( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt objectId; + TInt numInterfaces(0); + XAresult res; + + + /* Initialize arrays required[] and iidArray[] */ + for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) + { + required[i] = XA_BOOLEAN_FALSE; + iidArray[i] = XA_IID_NULL; + } + + status = aItem.GetNextInt(numInterfaces); + if(!status) + { + for(TInt j = 0; j < numInterfaces; j++) + { + TInt interface(0); + status = aItem.GetNextInt(interface); + if(!status) + { + required[j] = XA_BOOLEAN_TRUE; + iidArray[j] = MapInterface(interface); + numInterfaces++; + } + else + { + break; + } + } + } + + + status = aItem.GetNextInt(objectId); + if(!status) + { + if(m_EngineItf) + { + res = (*m_EngineItf)->CreateLEDDevice( + m_EngineItf, &m_MOVibraObject, objectId, + numInterfaces, iidArray, required); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_CreateVibraDevice( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt objectId; + TInt numInterfaces(0); + XAresult res; + + + /* Initialize arrays required[] and iidArray[] */ + for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) + { + required[i] = XA_BOOLEAN_FALSE; + iidArray[i] = XA_IID_NULL; + } + + status = aItem.GetNextInt(numInterfaces); + if(!status) + { + for(TInt j = 0; j < numInterfaces; j++) + { + TInt interface(0); + status = aItem.GetNextInt(interface); + if(!status) + { + required[j] = XA_BOOLEAN_TRUE; + iidArray[j] = MapInterface(interface); + numInterfaces++; + } + else + { + break; + } + } + } + + + status = aItem.GetNextInt(objectId); + if(!status) + { + if(m_EngineItf) + { + res = (*m_EngineItf)->CreateVibraDevice( + m_EngineItf, &m_MOVibraObject, objectId, + numInterfaces, iidArray, required); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_CreateMediaPlayer( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XADataSource* audioSource(NULL); + XADataSource* videoSource(NULL); + XADataSink* audioSink(NULL); + XADataSink* videoSink(NULL); + XADataSink* ledSink(NULL); + XADataSink* vibraSink(NULL); + TInt numInterfaces(0); + XAresult res; + + + /* Initialize arrays required[] and iidArray[] */ + for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) + { + required[i] = XA_BOOLEAN_FALSE; + iidArray[i] = XA_IID_NULL; + } + + status = aItem.GetNextInt(numInterfaces); + if(!status) + { + for(TInt j = 0; j < numInterfaces; j++) + { + TInt interface(0); + status = aItem.GetNextInt(interface); + if(!status) + { + required[j] = XA_BOOLEAN_TRUE; + iidArray[j] = MapInterface(interface); + numInterfaces++; + } + else + { + break; + } + } + } + + if(m_AudioSource.pFormat && m_AudioSource.pLocator) + { + audioSource = &m_AudioSource; + } + + if(m_VideoSource.pFormat && m_VideoSource.pLocator) + { + videoSource = &m_VideoSource; + } + + if(m_VibraSink.pFormat && m_VibraSink.pLocator) + { + vibraSink = &m_VibraSink; + } + + if(m_LEDSink.pFormat && m_LEDSink.pLocator) + { + ledSink = &m_LEDSink; + } + + if(m_AudioSink.pFormat && m_AudioSink.pLocator) + { + audioSink = &m_AudioSink; + } + + if(m_VideoSink.pFormat && m_VideoSink.pLocator) + { + videoSink = &m_VideoSink; + } + + if(m_EngineItf) + { + res = (*m_EngineItf)->CreateMediaPlayer( + m_EngineItf, &m_MOPlayer, audioSource, videoSource, + audioSink,videoSink, ledSink, vibraSink, + numInterfaces, iidArray, required); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_CreateMediaRecorder( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt numInterfaces(0); + XADataSource* audioSource(NULL); + XADataSource* videoSource(NULL); + XADataSink* dataSink(NULL); + /* Initialize arrays required[] and iidArray[] */ + for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) + { + required[i] = XA_BOOLEAN_FALSE; + iidArray[i] = XA_IID_NULL; + } + + status = aItem.GetNextInt(numInterfaces); + if(!status) + { + for(TInt j = 0; j < numInterfaces; j++) + { + TInt interface(0); + status = aItem.GetNextInt(interface); + if(!status) + { + required[j] = XA_BOOLEAN_TRUE; + iidArray[j] = MapInterface(interface); + numInterfaces++; + } + else + { + break; + } + } + } + + + if(m_AudioSource.pFormat && m_AudioSource.pLocator) + { + audioSource = &m_AudioSource; + } + + if(m_VideoSource.pFormat && m_VideoSource.pLocator) + { + videoSource = &m_VideoSource; + } + + if(m_DataSink.pFormat && m_DataSink.pLocator) + { + dataSink = &m_DataSink; + } + + if(m_EngineItf) + { + res = (*m_EngineItf)->CreateMediaRecorder( + m_EngineItf, &m_MORecorder, audioSource, videoSource, dataSink, + numInterfaces, iidArray, required); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_CreateOutputMix( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt numInterfaces(0); + + /* Initialize arrays required[] and iidArray[] */ + for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) + { + required[i] = XA_BOOLEAN_FALSE; + iidArray[i] = XA_IID_NULL; + } + + status = aItem.GetNextInt(numInterfaces); + if(!status) + { + for(TInt j = 0; j < numInterfaces; j++) + { + TInt interface(0); + status = aItem.GetNextInt(interface); + if(!status) + { + required[j] = XA_BOOLEAN_TRUE; + iidArray[j] = MapInterface(interface); + numInterfaces++; + } + else + { + break; + } + } + } + + if(m_EngineItf) + { + res = (*m_EngineItf)->CreateOutputMix( + m_EngineItf, &m_MOOutputMix, + numInterfaces, iidArray, required); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_CreateMetadataExtractor( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt numInterfaces(0); + XADataSource* metadataSource(NULL); + /* Initialize arrays required[] and iidArray[] */ + for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) + { + required[i] = XA_BOOLEAN_FALSE; + iidArray[i] = XA_IID_NULL; + } + + status = aItem.GetNextInt(numInterfaces); + if(!status) + { + for(TInt j = 0; j < numInterfaces; j++) + { + TInt interface(0); + status = aItem.GetNextInt(interface); + if(!status) + { + required[j] = XA_BOOLEAN_TRUE; + iidArray[j] = MapInterface(interface); + numInterfaces++; + } + else + { + break; + } + } + } + + if(m_MOMetadataExtractorSource.pFormat && m_MOMetadataExtractorSource.pLocator) + { + metadataSource = &m_MOMetadataExtractorSource; + } + + if(m_EngineItf) + { + res = (*m_EngineItf)->CreateMetadataExtractor( + m_EngineItf, &m_MOMetadataExtractor, metadataSource, + numInterfaces, iidArray, required); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_CreateExtensionObject( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt numInterfaces(0); + TInt objectId(0); + + /* Initialize arrays required[] and iidArray[] */ + for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) + { + required[i] = XA_BOOLEAN_FALSE; + iidArray[i] = XA_IID_NULL; + } + + status = aItem.GetNextInt(numInterfaces); + if(!status) + { + for(TInt j = 0; j < numInterfaces; j++) + { + TInt interface(0); + status = aItem.GetNextInt(interface); + if(!status) + { + required[j] = XA_BOOLEAN_TRUE; + iidArray[j] = MapInterface(interface); + numInterfaces++; + } + else + { + break; + } + } + } + + + status = aItem.GetNextInt(objectId); + if(!status) + { + if(m_EngineItf) + { + res = (*m_EngineItf)->CreateExtensionObject( + m_EngineItf, &m_MOExtnObject, NULL, objectId, + numInterfaces, iidArray, required); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_GetImplementationInfo( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + XAuint32 major; + XAuint32 minor; + XAuint32 step; + const XAchar* implText(NULL); + + if(m_EngineItf) + { + res = (*m_EngineItf)->GetImplementationInfo( + m_EngineItf, &major, &minor, &step, implText); + status = res; + iLog->Log(_L("GetImplementationInfo Major[%d] Minor[%d] Step[%d]"),major,minor,step); + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_QuerySupportedProfiles( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + XAint16 profiles; + + if(m_EngineItf) + { + res = (*m_EngineItf)->QuerySupportedProfiles( + m_EngineItf, &profiles); + status = res; + iLog->Log(_L("QuerySupportedProfiles Profiles[%d] "),profiles); + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_QueryNumSupportedInterfaces( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TUint object(0); + XAuint32 numInterfaces(0); + XAresult res; + XAuint32 objectId; + status = aItem.GetNextInt(object); + if(!status) + { + objectId = object; + if(m_EngineItf) + { + res = (*m_EngineItf)->QueryNumSupportedInterfaces( + m_EngineItf, objectId,&numInterfaces); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_QuerySupportedInterfaces( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TUint object(0); + TInt index(0); + XAresult res; + XAInterfaceID interface; + XAuint32 objectId; + status = aItem.GetNextInt(object); + if(!status) + { + objectId = object; + status = aItem.GetNextInt(index); + if(!status) + { + if(m_EngineItf) + { + res = (*m_EngineItf)->QuerySupportedInterfaces( + m_EngineItf, objectId, index,&interface); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + status = KErrGeneral; + } + } + else + { + status = KErrGeneral; + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_QueryNumSupportedExtension( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + XAuint32 extensions; + + if(m_EngineItf) + { + res = (*m_EngineItf)->QueryNumSupportedExtensions( + m_EngineItf, &extensions); + status = res; + iLog->Log(_L("QueryNumSupportedExtensions Extensions[%d] "),extensions); + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_QuerySupportedExtension( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt length(0); + TInt index(0); + XAresult res; + XAint16 namelen; + status = aItem.GetNextInt(index); + XAchar extensionName[20]; + if(!status) + { + status = aItem.GetNextInt(length); + if(!status) + { + if(m_EngineItf) + { + res = (*m_EngineItf)->QuerySupportedExtension( + m_EngineItf, index, extensionName, &namelen); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + if(m_EngineItf) + { + res = (*m_EngineItf)->QuerySupportedExtension( + m_EngineItf, index, NULL, &namelen); + status = res; + } + else + { + status = KErrNotFound; + } + } + } + else + { + status = KErrGeneral; + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_IsExtensionSupported( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAboolean supported(0); + TPtrC extensionName; + XAresult res; + HBufC8* extnName; + + status = aItem.GetNextString(extensionName); + if(!status) + { + extnName = HBufC8::NewL(extensionName.Length()+1); + CleanupStack::PushL(extnName); + TPtr8 des = extnName->Des(); + des.Copy(extensionName); + if(m_EngineItf) + { + res = (*m_EngineItf)->IsExtensionSupported( + m_EngineItf,des.PtrZ(), &supported ); + status = res; + } + else + { + status = KErrNotFound; + } + CleanupStack::PopAndDestroy(extnName); + } + + return status; + } + +TInt COpenMAXALTestModule::al_engitf_QueryLEDCapabilities( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAuint32 deviceId(0); + TInt index(0); + XAuint32 ledindex(0); + XAresult res; + XALEDDescriptor desc; + + status = aItem.GetNextInt(index); + if(!status) + { + ledindex = index; + if(m_EngineItf) + { + res = (*m_EngineItf)->QueryLEDCapabilities( + m_EngineItf, &ledindex, &deviceId, &desc); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + if(m_EngineItf) + { + res = (*m_EngineItf)->QueryLEDCapabilities( + m_EngineItf, &ledindex, NULL, NULL); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } + +TInt COpenMAXALTestModule::al_engitf_QueryVibraCapabilities( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAuint32 deviceId(0); + TInt index(0); + XAuint32 ledindex(0); + XAresult res; + XAVibraDescriptor desc; + + status = aItem.GetNextInt(index); + if(!status) + { + ledindex = index; + if(m_EngineItf) + { + res = (*m_EngineItf)->QueryVibraCapabilities( + m_EngineItf, &ledindex, &deviceId, &desc); + status = res; + } + else + { + status = KErrNotFound; + } + } + else + { + if(m_EngineItf) + { + res = (*m_EngineItf)->QueryVibraCapabilities( + m_EngineItf, &ledindex, NULL, NULL); + status = res; + } + else + { + status = KErrNotFound; + } + } + return status; + } + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalenginetests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalenginetests.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +TInt COpenMAXALTestModule::al_createEngine( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt numEngineOption(0); + TInt numInterfaces(0); + + /* Initialize arrays required[] and iidArray[] */ + for (TInt i = 0; i < MAX_NUMBER_OPTIONS; i++) + { + EngineOption[i].feature = 0; + EngineOption[i].data = 0; + } + + status = aItem.GetNextInt(numEngineOption); + + if(!status) + { + for(TInt i = 0; i < numEngineOption; i++) + { + TInt feature(0); + TInt data(0); + status = aItem.GetNextInt(feature); + if(!status) + { + status = aItem.GetNextInt(data); + if(!status) + { + EngineOption[i].data = data; + } + else + { + numEngineOption = 0; + break; + } + EngineOption[i].feature = feature; + } + else + { + break; + } + + } + } + + /* Initialize arrays required[] and iidArray[] */ + for (TInt i = 0; i < MAX_NUMBER_INTERFACES; i++) + { + required[i] = XA_BOOLEAN_FALSE; + iidArray[i] = XA_IID_NULL; + } + + if(!status) + { + status = aItem.GetNextInt(numInterfaces); + + for(TInt j = 0; j < numInterfaces; j++) + { + TInt interface(0); + status = aItem.GetNextInt(interface); + if(!status) + { + required[j] = XA_BOOLEAN_TRUE; + iidArray[j] = MapInterface(interface); + numInterfaces++; + } + else + { + break; + } + } + } + + + XAresult xa_res = xaCreateEngine(&m_EOEngine, numEngineOption, EngineOption, numInterfaces, iidArray, required); + status = MapErr(xa_res); + return status; + } + +TInt COpenMAXALTestModule::al_queryNumSupportedEngineInterfaces( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAuint32 numInterfaces(0); + XAresult xa_res = xaQueryNumSupportedEngineInterfaces(&numInterfaces); + status = MapErr(xa_res); + iLog->Log(_L("COpenMAXALTestModule::al_queryNumSupportedEngineInterfaces NumInterfaces[%d] status[%d]"),numInterfaces,status); + return status; + } + +TInt COpenMAXALTestModule::al_querySupportedEngineInterfaces( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt index(0); + status = aItem.GetNextInt(index); + if(!status) + { + XAresult xa_res = xaQuerySupportedEngineInterfaces(index, iidArray); + status = MapErr(xa_res); + } + return status; + } + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/recorder/openmaxalaudioencoderitftests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/recorder/openmaxalaudioencoderitftests.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +TInt COpenMAXALTestModule::al_audioencoderitf_SetEncoderSettings( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + XAAudioEncoderSettings setting; + TUint value(0); + TInt i(0); + + while(aItem.GetNextInt(value) == KErrNone) + { + switch(i) + { + case 0: + setting.encoderId = value; + break; + case 1: + setting.channelsIn = value; + break; + case 2: + setting.channelsOut = value; + break; + case 3: + setting.sampleRate = value; + break; + case 4: + setting.bitRate = value; + break; + case 5: + setting.bitsPerSample = value; + break; + case 6: + setting.rateControl = value; + break; + case 7: + setting.profileSetting = value; + break; + case 8: + setting.levelSetting = value; + break; + case 9: + setting.channelMode = value; + break; + case 10: + setting.streamFormat = value; + break; + case 11: + setting.encodeOptions = value; + break; + case 12: + setting.blockAlignment = value; + break; + default: + break; + } + i++; + } + + if(m_AudEncItf) + { + res = (*m_AudEncItf)->SetEncoderSettings( + m_AudEncItf, &setting); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_audioencoderitf_GetEncoderSettings( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + XAAudioEncoderSettings setting; + if(m_AudEncItf) + { + res = (*m_AudEncItf)->GetEncoderSettings( + m_AudEncItf, &setting); + iLog->Log(_L("GetEncoderSettings")); + iLog->Log(_L("GetEncoderSettings value[%d]"),setting.encoderId); + iLog->Log(_L("GetEncoderSettings value[%d]"),setting.channelsIn); + iLog->Log(_L("GetEncoderSettings value[%d]"),setting.channelsOut); + iLog->Log(_L("GetEncoderSettings value[%d]"),setting.sampleRate); + iLog->Log(_L("GetEncoderSettings value[%d]"),setting.bitRate); + iLog->Log(_L("GetEncoderSettings value[%d]"),setting.bitsPerSample); + iLog->Log(_L("GetEncoderSettings value[%d]"),setting.rateControl); + iLog->Log(_L("GetEncoderSettings value[%d]"),setting.profileSetting); + iLog->Log(_L("GetEncoderSettings value[%d]"),setting.levelSetting); + iLog->Log(_L("GetEncoderSettings value[%d]"),setting.channelMode); + iLog->Log(_L("GetEncoderSettings value[%d]"),setting.streamFormat); + iLog->Log(_L("GetEncoderSettings value[%d]"),setting.encodeOptions); + iLog->Log(_L("GetEncoderSettings value[%d]"),setting.blockAlignment); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/recorder/openmaxalmetadatainsertionitfcallbacks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/recorder/openmaxalmetadatainsertionitfcallbacks.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS + +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +void MetadataInsertionCallback ( + XAMetadataInsertionItf caller, + void * pContext, + XAMetadataInfo * pKey, + XAMetadataInfo * pValue, + XAint32 nodeID, + XAboolean result +) + { + + } diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/recorder/openmaxalmetadatainsertionitftests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/recorder/openmaxalmetadatainsertionitftests.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,310 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" +#include +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +void MetadataInsertionCallback ( + XAMetadataInsertionItf caller, + void * pContext, + XAMetadataInfo * pKey, + XAMetadataInfo * pValue, + XAint32 nodeID, + XAboolean result +); +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +TInt COpenMAXALTestModule::al_metadatainsertionitf_CreateChildNode( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt parentId(0); + TInt type(0); + TPtrC mimetype; + XAint32 childnode; + + status = aItem.GetNextInt(parentId); + RET_ERR_IF_ERR(status); + + status = aItem.GetNextInt(type); + RET_ERR_IF_ERR(status); + + status = aItem.GetNextString(mimetype); + RET_ERR_IF_ERR(status); + + HBufC8* buf = HBufC8::NewL(mimetype.Length()+1); + CleanupStack::PushL(buf); + TPtr8 des = buf->Des(); + + if(m_MetadataInsertionItf) + { + res = (*m_MetadataInsertionItf)->CreateChildNode( + m_MetadataInsertionItf, parentId , type, const_cast(des.PtrZ()), &childnode); + status = res; + } + else + { + status = KErrNotFound; + } + CleanupStack::PopAndDestroy(buf); + return status; + } + +TInt COpenMAXALTestModule::al_metadatainsertionitf_GetSupportedKeysCount( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt parentId(0); + XAboolean freeKeys; + XAuint32 keycount(0); + XAuint32 encodingcount(0); + + status = aItem.GetNextInt(parentId); + RET_ERR_IF_ERR(status); + + if(m_MetadataInsertionItf) + { + res = (*m_MetadataInsertionItf)->GetSupportedKeysCount( + m_MetadataInsertionItf, parentId , &freeKeys, &keycount, &encodingcount); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_metadatainsertionitf_GetKeySize( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt nodeId(0); + TUint index(0); + XAuint32 keysize(0); + + status = aItem.GetNextInt(nodeId); + RET_ERR_IF_ERR(status); + + status = aItem.GetNextInt(index); + RET_ERR_IF_ERR(status); + + if(m_MetadataInsertionItf) + { + res = (*m_MetadataInsertionItf)->GetKeySize( + m_MetadataInsertionItf, nodeId , index, &keysize); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_metadatainsertionitf_GetKey( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt nodeId(0); + TUint index(0); + TUint keysize(0); + XAMetadataInfo info = {1,1,"en-us",'a'}; + + status = aItem.GetNextInt(nodeId); + RET_ERR_IF_ERR(status); + + status = aItem.GetNextInt(index); + RET_ERR_IF_ERR(status); + + status = aItem.GetNextInt(keysize); + RET_ERR_IF_ERR(status); + + if(m_MetadataInsertionItf) + { + res = (*m_MetadataInsertionItf)->GetKey( + m_MetadataInsertionItf, nodeId , index, keysize, &info); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_metadatainsertionitf_GetFreeKeysEncoding( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt nodeId(0); + TUint index(0); + XAuint32 encoding(0); + + status = aItem.GetNextInt(nodeId); + RET_ERR_IF_ERR(status); + + status = aItem.GetNextInt(index); + RET_ERR_IF_ERR(status); + + if(m_MetadataInsertionItf) + { + res = (*m_MetadataInsertionItf)->GetFreeKeysEncoding( + m_MetadataInsertionItf, nodeId , index, &encoding); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_metadatainsertionitf_InsertMetadataItem( CStifItemParser& aItem ) + { + TInt status(KErrNone); + XAresult res; + TInt nodeId(0); + + TUint encoding(0); + XAchar keylangCountry[16]; + XAchar valuelangCountry[16]; + XAMetadataInfo keyinput = {1,1,"abc",'a'}; + XAMetadataInfo valueinput = {1,1,"efg",'a'}; + + + TUint keyinputsize; + TPtrC language; + TPtr8 keylangC(keylangCountry,16,16); + TPtr8 valuelangC(valuelangCountry,16,16); + TInt overwrite; + //langC.Set(&keyangCountry,16,16); + + status = aItem.GetNextInt(nodeId); + RET_ERR_IF_ERR(status); + + status = aItem.GetNextInt(keyinputsize); + RET_ERR_IF_ERR(status); + keyinput.size = keyinputsize; + status = aItem.GetNextInt(encoding); + RET_ERR_IF_ERR(status); + keyinput.encoding = encoding; + + status = aItem.GetNextString(language); + RET_ERR_IF_ERR(status); + keylangC.Copy(language); + XAchar* destkey = const_cast(keyinput.langCountry); + strcpy((char*)destkey, (char*)keylangC.Ptr()); + //keyinput.langCountry = keylangCountry; + + status = aItem.GetNextInt(keyinputsize); + RET_ERR_IF_ERR(status); + valueinput.size = keyinputsize; + status = aItem.GetNextInt(encoding); + RET_ERR_IF_ERR(status); + valueinput.encoding = encoding; + + status = aItem.GetNextString(language); + RET_ERR_IF_ERR(status); + valuelangC.Copy(language); + XAchar* destvalue = const_cast(valueinput.langCountry); + strcpy((char*)destvalue, (char*)valuelangC.Ptr()); + + status = aItem.GetNextInt(overwrite); + RET_ERR_IF_ERR(status); + + if(m_MetadataInsertionItf) + { + res = (*m_MetadataInsertionItf)->InsertMetadataItem( + m_MetadataInsertionItf, nodeId , &keyinput, &valueinput, overwrite); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + +TInt COpenMAXALTestModule::al_metadatainsertionitf_RegisterCallback( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + if(m_MetadataInsertionItf) + { + res = (*m_MetadataInsertionItf)->RegisterCallback( + m_MetadataInsertionItf, MetadataInsertionCallback , (void*)this); + status = res; + } + else + { + status = KErrNotFound; + } + return status; + } + + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/recorder/openmaxalrecorditfcallbacks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/recorder/openmaxalrecorditfcallbacks.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ +void RecordItfCallback ( + XARecordItf caller, + void * pContext, + XAuint32 event ) + { + + } diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/recorder/openmaxalrecorditftests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/recorder/openmaxalrecorditftests.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,323 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "openmaxaltestmodule.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); +void RecordItfCallback ( + XARecordItf caller, + void * pContext, + XAuint32 event +); +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +TInt COpenMAXALTestModule::al_recorditf_SetRecordState( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TInt state(0); + XAresult res; + status = aItem.GetNextInt(state); + if(!status) + { + if(m_RecordItf) + { + res = (*m_RecordItf)->SetRecordState( + m_RecordItf, state); + status = res; + } + else + { + status = KErrNotFound; + } + } + + return status; + } + +TInt COpenMAXALTestModule::al_recorditf_GetRecordState( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + XAuint32 state; + if(m_RecordItf) + { + res = (*m_RecordItf)->GetRecordState( + m_RecordItf, &state); + status = res; + } + else + { + status = KErrNotFound; + } + + return status; + } + +TInt COpenMAXALTestModule::al_recorditf_SetDurationLimit( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TUint duration(0); + XAresult res; + status = aItem.GetNextInt(duration); + if(!status) + { + if(m_RecordItf) + { + res = (*m_RecordItf)->SetDurationLimit( + m_RecordItf, duration); + status = res; + } + else + { + status = KErrNotFound; + } + } + + return status; + } + +TInt COpenMAXALTestModule::al_recorditf_GetPosition( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + XAmillisecond pos; + if(m_RecordItf) + { + res = (*m_RecordItf)->GetPosition( + m_RecordItf, &pos); + status = res; + } + else + { + status = KErrNotFound; + } + + return status; + } + +TInt COpenMAXALTestModule::al_recorditf_RegisterCallback( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + + if(m_RecordItf) + { + res = (*m_RecordItf)->RegisterCallback( + m_RecordItf, &RecordItfCallback, (void*)this); + status = res; + } + else + { + status = KErrNotFound; + } + + return status; + } + +TInt COpenMAXALTestModule::al_recorditf_SetCallbackEventsMask( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TUint flags(0); + XAresult res; + status = aItem.GetNextInt(flags); + if(!status) + { + if(m_RecordItf) + { + res = (*m_RecordItf)->SetCallbackEventsMask( + m_RecordItf, flags); + status = res; + } + else + { + status = KErrNotFound; + } + } + + return status; + } + +TInt COpenMAXALTestModule::al_recorditf_GetCallbackEventsMask( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + XAuint32 flags; + if(m_RecordItf) + { + res = (*m_RecordItf)->GetCallbackEventsMask( + m_RecordItf, &flags); + status = res; + } + else + { + status = KErrNotFound; + } + + return status; + } + +TInt COpenMAXALTestModule::al_recorditf_SetMarkerPosition( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TUint pos(0); + XAresult res; + status = aItem.GetNextInt(pos); + if(!status) + { + if(m_RecordItf) + { + res = (*m_RecordItf)->SetMarkerPosition( + m_RecordItf, pos); + status = res; + } + else + { + status = KErrNotFound; + } + } + + return status; + } + +TInt COpenMAXALTestModule::al_recorditf_ClearMarkerPosition( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + + if(m_RecordItf) + { + res = (*m_RecordItf)->ClearMarkerPosition(m_RecordItf); + status = res; + } + else + { + status = KErrNotFound; + } + + return status; + } + +TInt COpenMAXALTestModule::al_recorditf_GetMarkerPosition( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + XAmillisecond pos; + if(m_RecordItf) + { + res = (*m_RecordItf)->GetMarkerPosition( + m_RecordItf, &pos); + status = res; + } + else + { + status = KErrNotFound; + } + + return status; + } + +TInt COpenMAXALTestModule::al_recorditf_SetPositionUpdatePeriod( CStifItemParser& aItem ) + { + TInt status(KErrNone); + TUint updatePeriod(0); + XAresult res; + status = aItem.GetNextInt(updatePeriod); + if(!status) + { + if(m_RecordItf) + { + res = (*m_RecordItf)->SetPositionUpdatePeriod( + m_RecordItf, updatePeriod); + status = res; + } + else + { + status = KErrNotFound; + } + } + + return status; + } + +TInt COpenMAXALTestModule::al_recorditf_GetPositionUpdatePeriod( CStifItemParser& /*aItem*/ ) + { + TInt status(KErrNone); + XAresult res; + XAmillisecond pos; + if(m_RecordItf) + { + res = (*m_RecordItf)->GetPositionUpdatePeriod( + m_RecordItf, &pos); + status = res; + } + else + { + status = KErrNotFound; + } + + return status; + } + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/group/bld.inf Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file provides the information for exporting the System Tone + * Service API. + */ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/systemtoneservice.h MW_LAYER_PLATFORM_EXPORT_PATH(systemtoneservice.h) + +PRJ_MMPFILES diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/inc/systemtoneservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/inc/systemtoneservice.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file defines the API for System Tone Service which is + * implemented in the systemtoneservice.dll. This API uses + * the private implementation pattern to help improve the BC + * of the API by decoupling the implementation from the + * interface. + * + */ + +#ifndef __SYSTEMTONESERVICE_H__ +#define __SYSTEMTONESERVICE_H__ + +// System includes +#include + +// Forward declarations +NONSHARABLE_CLASS( CStsImplementation); + +// Class declaration +/** + * System Tone Service API definition. + * This is the native C++ API for applications and middleware components + * to play standard system tones. + * + * @code + * CSystemToneService* sts = CSystemToneService::Create(); + * TInt calendarAlarmContext; + * ... + * if (sts) + * { + * ... + * sts->PlayTone(CSystemToneService::EWarningTone); + * ... + * sts->Playtone(CSystemToneService::ECalendarAlarm, &calendarAlarmContext); + * ... + * } + * ... + * sts->StopTone(calendarAlarmContext); + * ... + * CSystemToneService::Delete(sts); + * @endcode + * + */ +NONSHARABLE_CLASS(CSystemToneService) : public CBase + { +public: + //** Constructor - returns NULL if construction fails */ + IMPORT_C static CSystemToneService* Create(); + + //** Destructor */ + IMPORT_C static void Delete(CSystemToneService* aSystemToneService); + +public: + // Data types + /** The type of System Tones that are supported by this API. */ + enum TToneType + { + // Calendar Tones + ECalendarAlarm = 0x0001, + EClockAlarm = 0x0002, + EToDoAlarm = 0x0003, + + // Capture Tones + EBurstMode = 0x1001, + ECapture = 0x1002, + ECallRecording = 0x1003, + ERecordingStart = 0x1004, + ERecordingStop = 0x1005, + ESelfTimer = 0x1006, + + // General Tones + EConfirmationBeep = 0x2001, + EDefaultBeep = 0x2002, + EErrorBeep = 0x2003, + EInformationBeep = 0x2004, + EWarningBeep = 0x2005, + EIntegratedHandsFreeActivated = 0x2006, + + // Key Tones + ETouchScreen = 0x3001, + + // Location Tones + ELocationRequest = 0x4001, + + // Messaging Tones + EChatAlert = 0x5001, + EEmailAlert = 0x5002, + EMmsAlert = 0x5003, + ESmsAlert = 0x5004, + EDeliveryReport = 0x5005, + EMessageSendFailure = 0x5006, + + // Power Tones + EBatteryLow = 0x6001, + EBatteryRecharged = 0x6002, + EPowerOn = 0x6003, + EPowerOff = 0x6004, + EWakeUp = 0x6005, + EWrongCharger = 0x6006, + + // Telephony Tones + EIncomingCall = 0x7001, + EIncomingCallLine2 = 0x7002, + EIncomingDataCall = 0x7003, + EAutomaticRedialComplete = 0x7004, + + // Voice Recognition Tones + EVoiceStart = 0x8001, + EVoiceError = 0x8002, + EVoiceAbort = 0x8003 + }; + + /** + * Plays the specified tone. If the tone type is not recognized a default tone will + * be played. This method is for fixed duration tones that are expected + * to play to completion and do not need to be stopped by the client. + * + * @param aTone An input parameter that indicates the type of tone to play. + * @return description + */ + IMPORT_C void PlayTone(TToneType aTone); + + /** + * Plays the specified tone. If the tone type is not recognized a default tone will + * be played. This method is used for tones that may not be fixed duration such as + * infinitely looping tones, or for tones that can be manually stopped by the client. + * + * @param aTone An input parameter that indicates the type of tone to play. + * @param aPlayToneContext An output parameter that provides back a unique context to + * the client for this tone play that can be used for stopping the playback. + * @return description + */ + IMPORT_C void PlayTone(TToneType aTone, unsigned int& aPlayToneContext); + + /** + * Stops the specified tone playback. If the playback has already completed or the + * context is not recognized, this method does nothing. + * + * @param aPlayToneContext The context to the Tone Playing that is to be stopped. + * @return description + */ + IMPORT_C void StopTone(unsigned int aPlayToneContext); + +protected: + // Protected constructors and destructors + CSystemToneService(CStsImplementation& aImplementation); + ~CSystemToneService(); + +protected: + // Protected data + /** + * A reference to the implementation class for this API. + */ + CStsImplementation& iImplementation; + }; + +#endif // __SYSTEMTONESERVICE_H__ diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/bmarm/systemtoneservicestifu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/bmarm/systemtoneservicestifu.def Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/bwins/systemtoneservicestifu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/bwins/systemtoneservicestifu.def Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif.cfg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,133 @@ +[Define] +CalendarAlarm 1 +ClockAlarm 2 +ToDoAlarm 3 +BurstMode 4097 +Capture 4098 +CallRecording 4099 +RecordingStart 4100 +RecordingStop 4101 +SelfTimer 4102 +ConfirmationBeep 8193 +DefaultBeep 8194 +ErrorBeep 8195 +InformationBeep 8196 +WarningBeep 8197 +IntegratedHandsFreeActivated 8198 +TouchScreen 12289 +LocationRequest 16395 +ChatAlert 20481 +EmailAlert 20482 +MmsAlert 20483 +SmsAlert 20484 +DeliveryReport 20485 +MessageSendFailure 20486 +BatteryLow 24577 +BatteryRecharged 24578 +PowerOn 24579 +PowerOff 24580 +WakeUp 24581 +WrongCharger 24582 +IncomingCall 28673 +IncomingCallLine2 28674 +IncomingDataCall 28675 +AutomaticRedialComplete 28676 +VoiceStart 32769 +VoiceError 32770 +VoiceAbort 32771 +[Enddefine] + +[Test] +title NFT +create systemtoneservicestif STSSTIF +STSSTIF Create +STSSTIF PlayToneWithContext ClockAlarm +pause 10000 +STSSTIF StopTone True +STSSTIF Delete +delete STSSTIF +[Endtest] + + + +[Test] +title 01 Create systemtoneservicestif +create systemtoneservicestif STSSTIF +STSSTIF Create +delete STSSTIF +[Endtest] + + + +[Test] +title 02 Play ClockAlarm Ringtone +create systemtoneservicestif STSSTIF +STSSTIF Create +STSSTIF PlayTone ClockAlarm +pause 5000 +STSSTIF Delete +delete STSSTIF +[Endtest] + + +[Test] +title 03 Play ClockAlarmContext Ringtone +create systemtoneservicestif STSSTIF +STSSTIF Create +STSSTIF PlayToneWithContext ClockAlarm +pause 10000 +STSSTIF Delete +delete STSSTIF +[Endtest] + +[Test] +title 04 Stop ClockAlarm with recognized Context +create systemtoneservicestif STSSTIF +STSSTIF Create +STSSTIF PlayToneWithContext ClockAlarm +pause 10000 +STSSTIF StopTone True +pause 5000 +STSSTIF Delete +delete STSSTIF +[Endtest] + + +[Test] +title 05 Stop ClockAlarm with non-recognized Context +create systemtoneservicestif STSSTIF +STSSTIF Create +STSSTIF PlayToneWithContext ClockAlarm +pause 10000 +STSSTIF StopTone False +pause 5000 +STSSTIF Delete +delete STSSTIF +[Endtest] + + +[Test] +title 06 Play two tones +create systemtoneservicestif STSSTIF +STSSTIF Create +STSSTIF PlayToneWithContext ClockAlarm +pause 10000 +STSSTIF PlayTone CalendarAlarm +pause 10000 +STSSTIF StopTone True +STSSTIF Delete +delete STSSTIF +[Endtest] + + +[Test] +title 07 Stop tone after tone complete +create systemtoneservicestif STSSTIF +STSSTIF Create +STSSTIF PlayToneWithContext ClockAlarm +pause 10000 +STSSTIF StopTone True +STSSTIF StopTone True +STSSTIF Delete +delete STSSTIF +[Endtest] \ No newline at end of file diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif_calendaralarm.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif_calendaralarm.cfg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,39 @@ +// +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// Description: Example test case for calendar alarm +// +// + + + +[Test] +title 1.1 Test CalendarAlarm Ringtone +create systemtoneservicestif STSSTIF +STSSTIF Create +STSSTIF PlayTone CalendarAlarm +pause 5000 +STSSTIF Delete +delete STSSTIF +[Endtest] + + + [Test] +title 1.2 Test CalendarAlarmContext Ringtone +create systemtoneservicestif STSSTIF +STSSTIF Create +STSSTIF PlayToneWithContext CalendarAlarm +pause 2000 +STSSTIF StopTone True +STSSTIF Delete +delete STSSTIF +[Endtest] + + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif_common.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif_common.cfg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,56 @@ +// +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// Description: Mapping of TToneType Enum for creating test cases +// +// + +[Define] +CalendarAlarm 1 +ClockAlarm 2 +ToDoAlarm 3 +BurstMode 4097 +Capture 4098 +CallRecording 4099 +RecordingStart 4100 +RecordingStop 4101 +SelfTimer 4102 +ConfirmationBeep 8193 +DefaultBeep 8194 +ErrorBeep 8195 +InformationBeep 8196 +WarningBeep 8197 +IntegratedHandsFreeActivated 8198 +TouchScreen 12289 +LocationRequest 16395 +ChatAlert 20481 +EmailAlert 20482 +MmsAlert 20483 +SmsAlert 20484 +DeliveryReport 20485 +MessageSendFailure 20486 +BatteryLow 24577 +BatteryRecharged 24578 +PowerOn 24579 +PowerOff 24580 +WakeUp 24581 +WrongCharger 24582 +IncomingCall 28673 +IncomingCallLine2 28674 +IncomingDataCall 28675 +AutomaticRedialComplete 28676 +VoiceStart 32769 +VoiceError 32770 +VoiceAbort 32771 +[Enddefine] + + + + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/eabi/systemtoneservicestifu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/eabi/systemtoneservicestifu.def Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/group/bld.inf Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTEXPORTS + + +PRJ_EXPORTS + + +PRJ_TESTMMPFILES +systemtoneservicestif.mmp + +PRJ_MMPFILES + + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/group/systemtoneservicestif.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/group/systemtoneservicestif.mmp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,61 @@ +/*TYPE TESTCLASS*/ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MMP file for STIF Test Framework's TestScripter +* testclass test module. +* +*/ + +#include + +SMPSAFE + +TARGET systemtoneservicestif.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB +VENDORID VID_DEFAULT + + +//EPOCALLOWDLLDATA +#if !defined(__WINSCW__) && !defined(__WINS__) +EpocAllowDllData +#endif + + +//TARGETPATH +DEFFILE systemtoneservicestif.def + +MW_LAYER_SYSTEMINCLUDE +USERINCLUDE ../inc + +OS_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE systemtoneservicestif.cpp +SOURCE systemtoneservicestifBlocks.cpp + + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib +LIBRARY systemtoneservice.lib + +LANG SC + + + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/group/systemtoneservicestif.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/group/systemtoneservicestif.pkg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,60 @@ +; +; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; Installation file for STIF +; + +; Languages +&EN + +; Provide value for uid +#{"STIF"},(0x00000000),1,1,0,TYPE=SA + +; Series60 product id for S60 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Logo +; None + +; Package signature - Optional +; None + +; Start of Package body + +; Condition blocks +; None + +; Options list +; None + +; Install files +"\epoc32\release\armv5\udeb\systemtoneservicestif.dll" - "!:\Sys\Bin\systemtoneservicestif.dll" + +; Embedded SIS +; None + +; End of Package body + +; PKG dependencies +; None + +; PKG capabilities +; None diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/group/systemtoneservicestif_DoxyFile.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/group/systemtoneservicestif_DoxyFile.txt Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,236 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# + + +# Doxyfile 1.4.1 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = systemtoneservicestif +PROJECT_NUMBER = +OUTPUT_DIRECTORY = Z:\\systemtoneservicestif\ +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = YES +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = NO +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = YES +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = NO +GENERATE_BUGLIST = NO +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = Z:\\systemtoneservicestif\ +FILE_PATTERNS = *.h \ + *.rh \ + *.hrh +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = NO +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = YES +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = YES +TOC_EXPAND = YES +DISABLE_INDEX = YES +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = YES +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = YES +RTF_OUTPUT = Doc +COMPACT_RTF = YES +RTF_HYPERLINKS = YES +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = NONSHARABLE_CLASS +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/inc/systemtoneservicestif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/inc/systemtoneservicestif.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: STIF testclass declaration +* +*/ + +#ifndef SYSTEMTONESERVICESTIF_H +#define SYSTEMTONESERVICESTIF_H + +// INCLUDES +#include +#include +#include +#include + + +// CONSTANTS + + +// MACROS + +#define TEST_CLASS_VERSION_MAJOR 0 +#define TEST_CLASS_VERSION_MINOR 0 +#define TEST_CLASS_VERSION_BUILD 0 + +// Logging path +_LIT( KsystemtoneservicestifLogPath, "f:\\testing\\Log\\" ); +// Log file +_LIT( KsystemtoneservicestifLogFile, "systemtoneservicestif.txt" ); +_LIT( KsystemtoneservicestifLogFileWithTitle, "systemtoneservicestif_[%S].txt" ); + + + + +// FORWARD DECLARATIONS + +class CSystemToneServiceStif; +class CSystemToneService; + +enum TPlayState + { + EStopped, + EPlaying + }; + +_LIT( KTrue, "True"); +_LIT( KFalse, "False"); + +// CLASS DECLARATION + +/** +* CSystemToneServiceStif test class for STIF Test Framework TestScripter. + +*/ +NONSHARABLE_CLASS(CSystemToneServiceStif) : public CScriptBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CSystemToneServiceStif* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CSystemToneServiceStif(); + + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + + + private: + + /** + * C++ default constructor. + */ + CSystemToneServiceStif( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + + /** + * Frees all resources allocated from test methods. + */ + void Delete(); + + /** + * Test methods are listed below. + */ + + /** + * Example test method. + * @return Symbian OS error code. + */ + virtual TInt ExampleL( CStifItemParser& aItem ); + + /** + * Method used to log version of test class + */ + void SendTestClassVersion(); + + //ADD NEW METHOD + + virtual TInt CreateSystemToneService( ); + + virtual TInt DeleteSystemToneService( ); + + virtual TInt PlaySystemToneService( CStifItemParser& aItem); + + virtual TInt PlaySystemToneServiceWithContext( CStifItemParser& aItem ); + + virtual TInt StopSystemToneService( CStifItemParser& aItem ); + + + + private: // Data + TPlayState iPlayState; + CSystemToneService* iSts; + TUint iCurrentContext; + + + + }; + +#endif // SYSTEMTONESERVICESTIF_H + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/init/testframework.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/init/testframework.ini Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,201 @@ +# +# This is STIFTestFramework initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. +# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation +# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 +# + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= c:\LOGS\TestFramework\ +TestReportFileName= TestReport_systemtoneservicestif + +TestReportFormat= TXT # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +DisableMeasurement= stifmeasurementdisablenone # Possible values are: + # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' + # 'stifmeasurementplugin01', 'stifmeasurementplugin02', + # 'stifmeasurementplugin03', 'stifmeasurementplugin04', + # 'stifmeasurementplugin05' or 'stifbappeaprofiler' + +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + +#[New_Module] +#ModuleName= demomodule +#[End_Module] + +[New_Module] +ModuleName= TestScripter +IniFile = c:\testframework\systemtoneservicestif_common.cfg +TestCaseFile= c:\testframework\systemtoneservicestif_calendaralarm.cfg +[End_Module] + + + +# Load testmoduleXXX, optionally with initialization file and/or test case files +#[New_Module] +#ModuleName= testmodulexxx + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) +#TestCaseFile= c:\testframework\testcases1.cfg +#TestCaseFile= c:\testframework\testcases2.cfg +#TestCaseFile= c:\testframework\manualtestcases.cfg + +#[End_Module] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIFTestFramework logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# +# - Will write log file in unicode format. +# + YES, Log file will be written in unicode format +# + NO, Log will be written as normal, not unicode, file. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' +#NOTE: TestEngine and TestServer logging settings cannot change here + +CreateLogDirectories= YES # Possible values: YES or NO + +#EmulatorBasePath= C:\LOGS\TestFramework\ +#EmulatorFormat= HTML # Possible values: TXT or HTML +#EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +#FileUnicode= YES # Possible values: YES or NO + +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file \ No newline at end of file diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/src/systemtoneservicestif.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/src/systemtoneservicestif.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// INCLUDE FILES +#include +#include +#include "systemtoneservicestif.h" + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CSystemToneServiceStif::CSystemToneServiceStif +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CSystemToneServiceStif::CSystemToneServiceStif( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + } + +// ----------------------------------------------------------------------------- +// CSystemToneServiceStif::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CSystemToneServiceStif::ConstructL() + { + //Read logger settings to check whether test case name is to be + //appended to log file name. + RSettingServer settingServer; + TInt ret = settingServer.Connect(); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Struct to StifLogger settigs. + TLoggerSettings loggerSettings; + // Parse StifLogger defaults from STIF initialization file. + ret = settingServer.GetLoggerSettings(loggerSettings); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Close Setting server session + settingServer.Close(); + + TFileName logFileName; + + if(loggerSettings.iAddTestCaseTitle) + { + TName title; + TestModuleIf().GetTestCaseTitleL(title); + logFileName.Format(KsystemtoneservicestifLogFileWithTitle, &title); + } + else + { + logFileName.Copy(KsystemtoneservicestifLogFile); + } + + iLog = CStifLogger::NewL( KsystemtoneservicestifLogPath, + logFileName, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + SendTestClassVersion(); + } + +// ----------------------------------------------------------------------------- +// CSystemToneServiceStif::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSystemToneServiceStif* CSystemToneServiceStif::NewL( + CTestModuleIf& aTestModuleIf ) + { + CSystemToneServiceStif* self = new (ELeave) CSystemToneServiceStif( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + + } + +// Destructor +CSystemToneServiceStif::~CSystemToneServiceStif() + { + + // Delete resources allocated from test methods + Delete(); + + // Delete logger + delete iLog; + + } + +//----------------------------------------------------------------------------- +// CSystemToneServiceStif::SendTestClassVersion +// Method used to send version of test class +//----------------------------------------------------------------------------- +// +void CSystemToneServiceStif::SendTestClassVersion() + { + TVersion moduleVersion; + moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; + moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; + moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L("systemtoneservicestif.dll"); + + TBool newVersionOfMethod = ETrue; + TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CSystemToneServiceStif::NewL( aTestModuleIf ); + + } + + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/system_tone_service_api/tsrc/src/systemtoneservicestifblocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/system_tone_service_api/tsrc/src/systemtoneservicestifblocks.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,209 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include +#include "systemtoneservicestif.h" + + + +TInt CSystemToneServiceStif::RunMethodL(CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + // Copy this line for every implemented function. + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + ENTRY( "Create", CSystemToneServiceStif::CreateSystemToneService ), + ENTRY( "Delete", CSystemToneServiceStif::DeleteSystemToneService ), + ENTRY( "PlayTone", CSystemToneServiceStif::PlaySystemToneService ), + ENTRY( "PlayToneWithContext", CSystemToneServiceStif::PlaySystemToneServiceWithContext ), + ENTRY( "StopTone", CSystemToneServiceStif::StopSystemToneService ), + + + + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + + + + + +void CSystemToneServiceStif::Delete() + { + + } + + + +// ----------------------------------------------------------------------------- +// CSystemToneServiceStif::ExampleL +// Example test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CSystemToneServiceStif::ExampleL( CStifItemParser& aItem ) + { + + // Print to UI + _LIT( Ksystemtoneservicestif, "systemtoneservicestif" ); + _LIT( KExample, "In Example" ); + TestModuleIf().Printf( 0, Ksystemtoneservicestif, KExample ); + // Print to log file + iLog->Log( KExample ); + + TInt i = 0; + TPtrC string; + _LIT( KParam, "Param[%i]: %S" ); + while ( aItem.GetNextString ( string ) == KErrNone ) + { + TestModuleIf().Printf( i, Ksystemtoneservicestif, + KParam, i, &string ); + i++; + } + + return KErrNone; + + } + +TInt CSystemToneServiceStif::CreateSystemToneService( ) + { + // Print to UI + _LIT( Ksystemtoneservicestif, "systemtoneservicestif" ); + _LIT( KPrint, "In CreateSystemToneService" ); + TestModuleIf().Printf( 0, Ksystemtoneservicestif, KPrint ); + // Print to log file + iLog->Log( KPrint ); + + iSts = CSystemToneService::Create(); + + iLog->Log(_L("CreateSystemToneService complete")); + return KErrNone; + } + +TInt CSystemToneServiceStif::DeleteSystemToneService( ) + { + // Print to UI + _LIT( Ksystemtoneservicestif, "systemtoneservicestif" ); + _LIT( KPrint, "In DeleteSystemToneService" ); + TestModuleIf().Printf( 0, Ksystemtoneservicestif, KPrint ); + // Print to log file + iLog->Log( KPrint ); + + CSystemToneService::Delete(iSts); + return KErrNone; + } + + +TInt CSystemToneServiceStif::PlaySystemToneService( CStifItemParser& aItem ) + { + // Print to UI + _LIT( Ksystemtoneservicestif, "systemtoneservicestif" ); + _LIT( KPrint, "In PlaySystemToneService" ); + TestModuleIf().Printf( 0, Ksystemtoneservicestif, KPrint ); + // Print to log file + iLog->Log( KPrint ); + + TInt lRetVal = KErrNone; + TInt toneType = 0; + + lRetVal = aItem.GetNextInt(toneType); + + if ( lRetVal != KErrNone ) + { + iLog->Log(_L("Csystemtoneservicestif::PlaySystemToneService tone type missing in config file ")); + iLog->Log(_L("Playing Default Tone")); + iSts->PlayTone(CSystemToneService::EDefaultBeep); + lRetVal = KErrNone; + } + else + { + iSts->PlayTone(CSystemToneService::TToneType(toneType)); + iLog->Log(_L("CSystemToneService::TToneType(toneType) %d"),CSystemToneService::TToneType(toneType) ); + } + + return lRetVal; +} + + +TInt CSystemToneServiceStif::PlaySystemToneServiceWithContext( CStifItemParser& aItem ) + { + // Print to UI + _LIT( Ksystemtoneservicestif, "systemtoneservicestif" ); + _LIT( KPrint, "In PlaySystemToneServiceWithContext" ); + TestModuleIf().Printf( 0, Ksystemtoneservicestif, KPrint ); + // Print to log file + iLog->Log( KPrint ); + + TInt lRetVal = KErrNone; + TInt toneType = 0; + + lRetVal = aItem.GetNextInt(toneType); + + if ( lRetVal != KErrNone ) + { + iLog->Log(_L("CSystemToneServiceStif::PlaySystemToneService tone type missing in config file ")); + iLog->Log(_L("Playing Default Tone")); + + iSts->PlayTone(CSystemToneService::EDefaultBeep, iCurrentContext); + } + else + { + //iSts->PlayTone(CSystemToneService::EClockAlarm, iCurrentContext); + iSts->PlayTone(CSystemToneService::TToneType(toneType), iCurrentContext); + iLog->Log(_L("CSystemToneService::TToneType(toneType) %d"),CSystemToneService::TToneType(toneType) ); + } + + return lRetVal; + + } + + +TInt CSystemToneServiceStif::StopSystemToneService(CStifItemParser& aItem ) + { + TPtrC StopType; + TInt error = KErrNone; + + error = aItem.GetNextString(StopType); + + + if (StopType == KTrue) + { + iLog->Log(_L("Stop Tone with recognized context number")); + + iSts->StopTone(iCurrentContext); + } + else + { + iLog->Log(_L("Stop Tone with unrecognized context number")); + + iSts->StopTone(iCurrentContext+1); + } + + return error; +} + diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/inc/tms.h --- a/mmmw_plat/telephony_multimedia_service_api/inc/tms.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/telephony_multimedia_service_api/inc/tms.h Mon May 03 12:59:52 2010 +0300 @@ -182,8 +182,7 @@ #define TMS_INBAND_NO_SEQUENCE ((gint)8) #define TMS_INBAND_BEEP_SEQUENCE ((gint)9) - -// TMSSignalEvent structure for callback notifications +// Structure signalling callback notifications struct TMSSignalEvent { guint type; @@ -194,12 +193,12 @@ gint prev_state; }; -// TMSRTPStreamDescription for RTP -struct TMSRTPStreamDescription +// Structure for global volume effect change event +struct TMSVolumeEventChangeData { - gint filler1; - gint filler2; - gint filler3; + guint level; + TMSAudioOutput output; + gboolean output_changed; }; } //namespace TMS diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/inc/tmsclientsinkobsrvr.h --- a/mmmw_plat/telephony_multimedia_service_api/inc/tmsclientsinkobsrvr.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsclientsinkobsrvr.h Mon May 03 12:59:52 2010 +0300 @@ -11,7 +11,8 @@ * * Contributors: * - * Description: Telephony Multimedia Service + * Description: This class provides callback mechanism for TMSClientSink + * listeners. * */ @@ -57,7 +58,7 @@ * Buffer with recorded data to be emptied by the client. * */ - virtual void ProcessBuffer(TMSBuffer* buffer) = 0; + virtual void ProcessBuffer(const TMSBuffer* buffer) = 0; }; } //namespace TMS diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/inc/tmsclientsourceobsrvr.h --- a/mmmw_plat/telephony_multimedia_service_api/inc/tmsclientsourceobsrvr.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsclientsourceobsrvr.h Mon May 03 12:59:52 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * - * Description:This class provides callback mechanism for TMSClientSource + * Description: This class provides callback mechanism for TMSClientSource * listeners. * */ @@ -72,7 +72,7 @@ * The status of the operation. * */ - virtual void BufferProcessed(TMSBuffer* buffer, gint reason) = 0; + virtual void BufferProcessed(const TMSBuffer* buffer, gint reason) = 0; }; } //namespace TMS diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/inc/tmsdtmfobsrvr.h --- a/mmmw_plat/telephony_multimedia_service_api/inc/tmsdtmfobsrvr.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsdtmfobsrvr.h Mon May 03 12:59:52 2010 +0300 @@ -11,8 +11,7 @@ * * Contributors: * - * Description: Telephony Multimedia Service - * This class provides callback mechanism for TMSDTMF listeners. + * Description: This class provides callback mechanism for TMSDTMF listeners. * */ @@ -54,12 +53,12 @@ * TMS_EVENT_DTMF_TONE_STOPPED * @param dtmf - * Pointer to the object that is being signaled. + * Reference to the object that is being signaled. * * @param event * Event descriptor. */ - virtual void DTMFEvent(TMSDTMF* dtmf, TMSSignalEvent event) = 0; + virtual void DTMFEvent(const TMSDTMF& dtmf, TMSSignalEvent event) = 0; }; } //namespace TMS diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/inc/tmseffectobsrvr.h --- a/mmmw_plat/telephony_multimedia_service_api/inc/tmseffectobsrvr.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmseffectobsrvr.h Mon May 03 12:59:52 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * - * Description:This class provides callback mechanism for TMSEffect listeners. + * Description: This class provides callback mechanism for TMSEffect listeners. * */ @@ -74,13 +74,14 @@ * TMS_EVENT_EFFECT_GAIN_CHANGED * * @param tmseffect - * Pointer to the object that is being signaled. + * Reference to the object that is being signaled. * * @param event * Event descriptor. * */ - virtual void EffectsEvent(TMSEffect* tmseffect, TMSSignalEvent event) = 0; + virtual void EffectsEvent(const TMSEffect& tmseffect, + TMSSignalEvent event) = 0; }; } //namespace TMS diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/inc/tmsglobalroutingobsrvr.h --- a/mmmw_plat/telephony_multimedia_service_api/inc/tmsglobalroutingobsrvr.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsglobalroutingobsrvr.h Mon May 03 12:59:52 2010 +0300 @@ -11,7 +11,8 @@ * * Contributors: * - * Description:This class provides callback mechanism for TMSGlobalRouting listeners. + * Description: This class provides callback mechanism for TMSGlobalRouting + * listeners. * */ @@ -72,7 +73,7 @@ * TMS_EVENT_ROUTING_SET_OUTPUT_COMPLETE * * @param routing - * Pointer to the object that is being signaled. + * Reference to the object that is being signaled. * * @param event * Event descriptor. @@ -81,7 +82,7 @@ * Indicates the output device that audio will be routed to. * */ - virtual void GlobalRoutingEvent(TMSGlobalRouting* routing, + virtual void GlobalRoutingEvent(const TMSGlobalRouting& routing, TMSSignalEvent event, TMSAudioOutput output) = 0; }; diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/inc/tmsinbandtoneobsrvr.h --- a/mmmw_plat/telephony_multimedia_service_api/inc/tmsinbandtoneobsrvr.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsinbandtoneobsrvr.h Mon May 03 12:59:52 2010 +0300 @@ -11,7 +11,8 @@ * * Contributors: * - * Description: Telephony Multimedia Service + * Description: This class provides callback mechanism for TMSInbandTone + * listeners. * */ @@ -44,6 +45,7 @@ * @lib tmsapi.lib * */ + class TMSInbandToneObserver { public: @@ -53,12 +55,13 @@ * TMS_EVENT_INBAND_TONE_STOPPED * @param inbandtone - * Pointer to the object that is being signaled. + * Reference to the object that is being signaled. * * @param event * Event descriptor. */ - virtual void InbandToneEvent(TMSInbandTone* inbandtone, TMSSignalEvent event) = 0; + virtual void InbandToneEvent(const TMSInbandTone& inbandtone, + TMSSignalEvent event) = 0; }; } //namespace TMS diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/inc/tmsringtoneobsrvr.h --- a/mmmw_plat/telephony_multimedia_service_api/inc/tmsringtoneobsrvr.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsringtoneobsrvr.h Mon May 03 12:59:52 2010 +0300 @@ -11,7 +11,8 @@ * * Contributors: * - * Description: Telephony Multimedia Service + * Description: This class provides callback mechanism for TMSRingTone + * listeners. * */ @@ -45,13 +46,14 @@ * TMS_EVENT_RINGTONE_PLAY_COMPLETE * * @param rt - * Pointer to the object that is being signaled. + * Reference to the object that is being signaled. * * @param event * Event descriptor. * */ - virtual void RingtoneEvent(TMSRingTone* rt, TMSSignalEvent event) = 0; + virtual void RingtoneEvent(const TMSRingTone& rt, + TMSSignalEvent event) = 0; }; } //namespace TMS diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/inc/tmsstreamobsrvr.h --- a/mmmw_plat/telephony_multimedia_service_api/inc/tmsstreamobsrvr.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsstreamobsrvr.h Mon May 03 12:59:52 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * - * Description: Telephony Multimedia Service + * Description: This class provides callback mechanism for TMSStream listeners. * */ @@ -64,13 +64,14 @@ * * * @param stream - * Pointer to the object that is being signaled. + * Reference to the object that is being signaled. * * @param event * Event descriptor. * */ - virtual void TMSStreamEvent(TMSStream* stream, TMSSignalEvent event) = 0; + virtual void TMSStreamEvent(const TMSStream& stream, + TMSSignalEvent event) = 0; }; } //namespace TMS diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/inc/TMSAudioServicesTestClass.h --- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/inc/TMSAudioServicesTestClass.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/inc/TMSAudioServicesTestClass.h Mon May 03 12:59:52 2010 +0300 @@ -211,20 +211,20 @@ void HandleTimeout(TInt error); //From TMSStreamObserver - void TMSStreamEvent(TMSStream* stream, TMSSignalEvent event); + void TMSStreamEvent(const TMSStream& stream, TMSSignalEvent event); //From TMSClientSourceObserver void FillBuffer(TMSBuffer& buffer); - void BufferProcessed(TMSBuffer* buffer, gint reason); + void BufferProcessed(const TMSBuffer* buffer, gint reason); //From TMSClientSinkObserver - void ProcessBuffer(TMSBuffer* buffer); + void ProcessBuffer(const TMSBuffer* buffer); //From TMSClientSinkObserver starts - void EffectsEvent(TMSEffect* tmseffect, TMSSignalEvent event); + void EffectsEvent(const TMSEffect& tmseffect, TMSSignalEvent event); // from TMSGlobalRoutingObserver - void GlobalRoutingEvent(TMSGlobalRouting* /*routing*/, + void GlobalRoutingEvent(const TMSGlobalRouting& /*routing*/, TMSSignalEvent event, TMSAudioOutput output); private: diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/create_sis.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/create_sis.bat Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,22 @@ +cls +@echo off +echo. + +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of the "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +echo Description: TMS SIS package creation utility +rem + +del TmsAudioServicesTestClass.sis* +makesis ..\group\TmsAudioServicesTestClass.pkg TmsAudioServicesTestClass.sis +rem signsis TmsAudioServicesTestClass.sis TmsAudioServicesTestClass.sisx rd.crt rd.key diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TimeoutController.cpp --- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TimeoutController.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TimeoutController.cpp Mon May 03 12:59:52 2010 +0300 @@ -175,7 +175,7 @@ miliseconds /= 1000; TBuf<30> dateString; - TRAPD(ignore, endTime.FormatL(dateString, KFormatTimeStamp)); + TRAP_IGNORE(endTime.FormatL(dateString, KFormatTimeStamp)); iLog->Log(_L("Timer=%LD ms, EndTime=%S"), miliseconds, &dateString); // Store absolute timeout @@ -248,9 +248,7 @@ { if (iTestCaseTimeout > timeout) { - RDebug::Print( - _L("Absolute timer still valid. Restaring timer. iStatus: %d"), - iStatus.Int()); + RDebug::Print(_L("Absolute timer still valid. Restaring timer. iStatus: %d"), iStatus.Int()); // Start new timer iStatus = KErrNone; // reset value iTimer.At(iStatus, iTestCaseTimeout); // restart timer diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocks.cpp --- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocks.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocks.cpp Mon May 03 12:59:52 2010 +0300 @@ -112,7 +112,7 @@ iExpectedEvents.Close(); iOcurredEvents.Close(); - iLog->Log(_L("Deleti ng test class...")); + iLog->Log(_L("Deleting test class...")); iLog->Log(_L("")); iLog->Log(_L("")); @@ -322,8 +322,7 @@ // CTmsAudioServicesTestClass::RemoveExpectedEvent // Remove the indicated event from the expected events' list // ----------------------------------------------------------------------------- -TBool CTmsAudioServicesTestClass::RemoveExpectedEvent( - TTmsExpectedEvent aEvent) +TBool CTmsAudioServicesTestClass::RemoveExpectedEvent(TTmsExpectedEvent aEvent) { FTRACE(FPrint(_L("CTmsAudioServicesTestClass::RemoveExpectedEvent"))); iLog->Log(_L("CTmsAudioServicesTestClass::RemoveExpectedEvent")); @@ -555,9 +554,7 @@ case TMS_CALL_IP: { error = iFactory->CreateCall(calltype, iTmsCall, 0); - iLog->Log( - _L("CTmsAudioServicesTestClass::CreateCall, error [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::CreateCall, error [%d]"), error); } break; default: @@ -586,58 +583,49 @@ if (iFactory && !iTmsFormat) { - iLog ->Log( - _L("CTmsAudioServicesTestClass::CreateFormat - input format")); + iLog ->Log(_L("CTmsAudioServicesTestClass::CreateFormat - input format")); if (formatType == KTagG711) { format = TMS_FORMAT_G711; - iLog->Log( - _L("CTmsAudioServicesTestClass::CreateFormat - input format TMS_FORMAT_G711")); + iLog->Log(_L("CTmsAudioServicesTestClass::CreateFormat - input format TMS_FORMAT_G711")); } else if (formatType == KTagG729) { format = TMS_FORMAT_G729; - iLog->Log( - _L("CTmsAudioServicesTestClass::CreateFormat - input format TMS_FO RMAT_G729")); + iLog->Log(_L("CTmsAudioServicesTestClass::CreateFormat - input format TMS_FO RMAT_G729")); } else if (formatType == KTagILBC) { format = TMS_FORMAT_ILBC; - iLog->Log( - _L("CTmsAudioServicesTestClass::CreateFormat - input format TMS_FORMAT_ILBC")); + iLog->Log(_L("CTmsAudioServicesTestClass::CreateFormat - input format TMS_FORMAT_ILBC")); } else if (formatType == KTagAMRNB) { format = TMS_FORMAT_AMR; - iLog->Log( - _L("CTmsAudioServicesTestClass::CreateFormat - input format TMS_FORMAT_AMR")); + iLog->Log(_L("CTmsAudioServicesTestClass::CreateFormat - input format TMS_FORMAT_AMR")); } else if (formatType == KTagPCM16) { format = TMS_FORMAT_PCM; - iLog->Log( - _L("CTmsAudioServicesTestClass::CreateFormat - input format TMS_FORMAT_PCM")); + iLog->Log(_L("CTmsAudioServicesTestClass::CreateFormat - input format TMS_FORMAT_PCM")); } else { - iLog->Log( - _L("CTmsAudioServicesTestClass::CreateFormat failed, format not supported")); + iLog->Log(_L("CTmsAudioServicesTestClass::CreateFormat failed, format not supported")); error = KErrNotSupported; return error; } if (StreamType == KTagDnlink) { - iLog ->Log( - _L("CTmsAudioServicesTestClass::CreateFormat - iTmsFormatDn")); + iLog ->Log(_L("CTmsAudioServicesTestClass::CreateFormat - iTmsFormatDn")); error = iFactory->CreateFormat(format, iTmsFormatDn); iDnLinkCodec = format; } else if (StreamType == KTagUplink) { - iLog->Log( - _L("CTmsAudioServicesTestClass::CreateFormat - iTmsFormatUp")); + iLog->Log(_L("CTmsAudioServicesTestClass::CreateFormat - iTmsFormatUp")); error = iFactory->CreateFormat(format, iTmsFormatUp); iUpLinkCodec = format; } @@ -740,8 +728,7 @@ else { error = KErrNotReady; - iLog->Log( - _L("CTmsAudioServicesTestClass::CreateGlobalRouting - Need create TMSFactory first" )); + iLog->Log(_L("CTmsAudioServicesTestClass::CreateGlobalRouting - Need create TMSFactory first" )); } return error; @@ -872,9 +859,7 @@ if (itSourceType != sourcetype) { - iLog->Log( - _L("returned souece type is not same as expected, returned sourcetype :[%d]"), - itSourceType); + iLog->Log(_L("returned souece type is not same as expected, returned sourcetype :[%d]"), itSourceType); error = KErrUnexpectedValue; } return error; @@ -917,9 +902,7 @@ if (itSinkType != sinktype) { - iLog->Log( - _L("retur ned sink type is not sameas expected, returned sinktype :[%d]"), - itSinkType); + iLog->Log(_L("retur ned sink type is not sameas expected, returned sinktype :[%d]"), itSinkType); error = KErrUnexpectedValue; } } @@ -984,9 +967,7 @@ if (itEffectType != effecttype) { - iLog->Log( - _L("returned effecttype type is not same as expected, returned effecttype :[%d]"), - itEffectType); + iLog->Log(_L("returned effecttype type is not same as expected, returned effecttype :[%d]"), itEffectType); error = KErrUnexpectedValue; } return error; @@ -1004,9 +985,7 @@ error = iFactory->DeleteSource(iTmsClientSource); if (error != KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::DeleteClientSource, failed [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::DeleteClientSource, failed [%d]"), error); return error; } } @@ -1015,9 +994,7 @@ error = iFactory->DeleteSource(iTmsModemSource); if (error != KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::DeleteModemSource, failed [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::DeleteModemSource, failed [%d]"), error); return error; } } @@ -1026,9 +1003,7 @@ error = iFactory->DeleteSource(iTmsMicSource); if (error != KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::DeleteMicSource, failed [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::DeleteMicSource, failed [%d]"), error); return error; } } @@ -1049,9 +1024,7 @@ error = iFactory->DeleteSink(iTmsClientSink); if (error != KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::DeleteClientSource, failed [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::DeleteClientSource, failed [%d]"), error); return error; } } @@ -1060,9 +1033,7 @@ error = iFactory->DeleteSink(iTmsModemSink); if (error != KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::DeleteModemSource, failed [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::DeleteModemSource, failed [%d]"), error); return error; } } @@ -1071,9 +1042,7 @@ error = iFactory->DeleteSink(iTmsSpkrSink); if (error != KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::DeleteSpkrSource, failed [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::DeleteSpkrSource, failed [%d]"), error); return error; } } @@ -1093,9 +1062,7 @@ error = iTmsCall->CreateStream(TMS_STREAM_DOWNLINK, iTmsDnlink); } - iLog->Log( - _L("CTmsAudioServicesTestClass::CreateDownlinkStream Error [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::CreateDownlinkStream Error [%d]"), error); return error; } @@ -1229,9 +1196,7 @@ } else { - error - = iFactory->GetSupportedFormats(TMS_STREAM_DOWNLINK, - iCodec); + error = iFactory->GetSupportedFormats(TMS_STREAM_DOWNLINK, iCodec); } if (error != KErrNone) @@ -1257,7 +1222,6 @@ iCodec.erase(itCodecs); //delete *itDnlCodecs; iFactory->DeleteFormat(*itCodecs); - } } } @@ -1306,8 +1270,7 @@ || (formatType == KTagAMRNB && fmttype != TMS_FORMAT_AMR) || (formatType == KTagPCM16 && fmttype != TMS_FORMAT_PCM)) { - iLog->Log( - _L("CTmsAudioServicesTestClass::GetType failed, Format is same as expected")); + iLog->Log(_L("CTmsAudioServicesTestClass::GetType failed, Format is same as expected")); error = KErrUnexpectedValue; } } @@ -1332,8 +1295,7 @@ if (error != KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::SetDownlinkFormat - failed, return error = %d" ), + iLog->Log(_L("CTmsAudioServicesTestClass::SetDownlinkFormat - failed, return error = %d" ), error); return error; } @@ -1341,8 +1303,7 @@ else { error = KErrNotReady; - iLog->Log( - _L("CTmsAudioServicesTestClass::SetDownlinkFormat - Need create TMSStream & TMSFormat first" )); + iLog->Log(_L("CTmsAudioServicesTestClass::SetDownlinkFormat - Need create TMSStream & TMSFormat first" )); } return error; @@ -1359,8 +1320,7 @@ error = iTmsDnlink->ResetFormat(iTmsFormatDn); if (error != KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::ReSetDownlinkFormat - failed, return error = %d" ), + iLog->Log(_L("CTmsAudioServicesTestClass::ReSetDownlinkFormat - failed, return error = %d" ), error); return error; } @@ -1368,8 +1328,7 @@ else { error = KErrNotReady; - iLog->Log( - _L("CTmsAudioServicesTestClass::ReSetDownlinkFormat - Need create TMSStream & TMSFormat first" )); + iLog->Log(_L("CTmsAudioServicesTestClass::ReSetDownlinkFormat - Need create TMSStream & TMSFormat first" )); } return error; } @@ -1383,8 +1342,7 @@ { if (iTmsDnlink) { - iLog->Log( - _L("CTmsAudioServicesTestClass::OpenDownlink - init Downlink")); + iLog->Log(_L("CTmsAudioServicesTestClass::OpenDownlink - init Downlink")); iTmsDnlink->AddObserver(*this, NULL); error = iTmsDnlink->Init(); } @@ -1420,15 +1378,13 @@ } else { - iLog->Log( - _L("CTmsAudioServicesTestClass::SetUplinkFormat - iTmsFormat")); + iLog->Log(_L("CTmsAudioServicesTestClass::SetUplinkFormat - iTmsFormat")); error = iTmsUplink->SetFormat(iTmsFormat); } if (error != KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::SetUplinkFormat - failed, return error = %d" ), + iLog->Log(_L("CTmsAudioServicesTestClass::SetUplinkFormat - failed, return error = %d" ), error); return error; } @@ -1436,8 +1392,7 @@ else { error = KErrNotReady; - iLog->Log( - _L("CTmsAudioServicesTestClass::SetUplinkFormat - Need create TMSStream & TMSFormat first" )); + iLog->Log(_L("CTmsAudioServicesTestClass::SetUplinkFormat - Need create TMSStream & TMSFormat first" )); } return error; } @@ -1453,17 +1408,14 @@ error = iTmsUplink->ResetFormat(iTmsFormatUp); if (error != KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::ReSetUplinkFormat - failed, return error = %d" ), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::ReSetUplinkFormat - failed, return error = %d" ), error); return error; } } else { error = KErrNotReady; - iLog->Log( - _L("CTmsAudioServicesTestClass::ReSetUplinkFormat - Need create TMSStream & TMSFormat first" )); + iLog->Log(_L("CTmsAudioServicesTestClass::ReSetUplinkFormat - Need create TMSStream & TMSFormat first" )); } return error; } @@ -1478,8 +1430,7 @@ { if (iTmsUplink) { - iLog->Log( - _L("CTmsAudioServicesTestClass::OpenDownlink - init Uplink")); + iLog->Log(_L("CTmsAudioServicesTestClass::OpenDownlink - init Uplink")); iTmsUplink->AddObserver(*this, NULL); error = iTmsUplink->Init(); } @@ -1739,72 +1690,59 @@ if (effecttype == TMS_EFFECT_GAIN) { RDebug::Printf("[TMS STIF] GAIN, GetMaxLevel"); - ret = ((TMSGainEffect*) iTmsUplinkEffect)->GetMaxLevel(iMaxGain); - RDebug::Printf( - "[TMS STIF] GAIN, GetMaxLevel Level [%d] Ret Err [%d]", - iMaxGain, ret); + ret = static_cast(iTmsUplinkEffect)->GetMaxLevel( + iMaxGain); + RDebug::Printf("[TMS STIF] GAIN, GetMaxLevel Level [%d] Ret Err [%d]", iMaxGain, ret); RDebug::Printf("[TMS STIF] GAIN, SetLevel to [%d]", iMaxGain); - ret = ((TMSGainEffect*) iTmsUplinkEffect)->SetLevel(iMaxGain); + ret = static_cast(iTmsUplinkEffect)->SetLevel(iMaxGain); RDebug::Printf("[TMS STIF] GAIN, SetLevel ret [%d]", ret); iLog->Log(_L("SetMaxGain: %d"), iMaxGain); RDebug::Printf("[TMS STIF] GAIN, GetLevel"); - ret = ((TMSGainEffect*) iTmsUplinkEffect)->GetLevel(iGain); - RDebug::Printf( - "[TMS STIF] GAIN, Exp Level [%d] Ret Level [%d] Ret Err [%d]", - iMaxGain, iGain, ret); + ret = static_cast(iTmsUplinkEffect)->GetLevel(iGain); + RDebug::Printf("[TMS STIF] GAIN, Exp Level [%d] Ret Level [%d] Ret Err [%d]", iMaxGain, iGain, ret); if (iGain != iMaxGain) { - iLog->Log( - _L("GetGain doesn't return expected MaxGain!!! returned Gain = %d"), - iGain); + iLog->Log(_L("GetGain doesn't return expected MaxGain!!! returned Gain = %d"), iGain); return KErrUnexpectedValue; } - ((TMSGainEffect*) iTmsUplinkEffect)->SetLevel(0); + static_cast(iTmsUplinkEffect)->SetLevel(0); iLog->Log(_L("MuteMic")); - ((TMSGainEffect*) iTmsUplinkEffect)->GetLevel(iGain); + static_cast(iTmsUplinkEffect)->GetLevel(iGain); if (iGain != 0) { - iLog->Log( - _L("GetGain does not return expected Mute value!!! returned Gain = %d"), - iGain); + iLog->Log(_L("GetGain does not return expected Mute value!!! returned Gain = %d"), iGain); return KErrUnexpectedValue; } } else if (effecttype == TMS_EFFECT_GLOBAL_GAIN) { RDebug::Printf("[TMS STIF] GLOBAL GAIN, GetMaxLevel"); - ret = ((TMSGlobalGainEffect*) iGlobalGain)->GetMaxLevel(iMaxGain); - RDebug::Printf( - "[TMS STIF] GLOBAL GAIN, GetMaxLevel Level [%d] Ret Err [%d]", - iMaxGain, ret); + ret = static_cast(iGlobalGain)->GetMaxLevel( + iMaxGain); + RDebug::Printf("[TMS STIF] GLOBAL GAIN, GetMaxLevel Level [%d] Ret Err [%d]", iMaxGain, ret); RDebug::Printf("[TMS STIF] GLOBAL GAIN, SetLevel to [%d]", iMaxGain); - ret = ((TMSGlobalGainEffect*) iGlobalGain)->SetLevel(iMaxGain); + ret = static_cast(iGlobalGain)->SetLevel( + iMaxGain); RDebug::Printf("[TMS STIF] GLOBAL GAIN, SetLevel ret [%d]", ret); iLog->Log(_L("SetGlobleMaxGain: %d"), iMaxGain); RDebug::Printf("[TMS STIF] GLOBAL GAIN, GetLevel"); - ret = ((TMSGlobalGainEffect*) iGlobalGain)->GetLevel(iGain); - RDebug::Printf( - "[TMS STIF] GLOBAL GAIN, Exp Level [%d] Ret Level [%d] Ret Err [%d]", - iMaxGain, iGain, ret); + ret = static_cast(iGlobalGain)->GetLevel(iGain); + RDebug::Printf("[TMS STIF] GLOBAL GAIN, Exp Level [%d] Ret Level [%d] Ret Err [%d]", iMaxGain, iGain, ret); if (iGain != iMaxGain) { - iLog->Log( - _L("GetGain doesn't return expected Globle MaxGain!!! returned Gain = %d"), - iGain); + iLog->Log(_L("GetGain doesn't return expected Globle MaxGain!!! returned Gain = %d"), iGain); return KErrUnexpectedValue; } - ((TMSGlobalGainEffect*) iGlobalGain)->SetLevel(0); + static_cast(iGlobalGain)->SetLevel(0); iLog->Log(_L("MuteMic")); - ((TMSGlobalGainEffect*) iGlobalGain)->GetLevel(iGain); + static_cast(iGlobalGain)->GetLevel(iGain); if (iGain != 0) { - iLog->Log( - _L("GetGain does not return expected loble Mute value!!! returned Gain = %d"), - iGain); + iLog->Log(_L("GetGain does not return expected loble Mute value!!! returned Gain = %d"), iGain); return KErrUnexpectedValue; } } @@ -1826,76 +1764,68 @@ if (effecttype == TMS_EFFECT_VOLUME) { RDebug::Printf("[TMS STIF] Volume, GetMaxLevel"); - ret = ((TMSVolumeEffect*) iTmsDnlinkEffect)->GetMaxLevel(iMaxVolume); - RDebug::Printf("[TMS STIF] MaxLevel [%d] Ret Error [%d]", iMaxVolume, - ret); - RDebug::Printf("[TMS STIF] Volume, SetLevel to MaxLevel [%d]", + ret = static_cast(iTmsDnlinkEffect)->GetMaxLevel( iMaxVolume); - ret = ((TMSVolumeEffect*) iTmsDnlinkEffect)->SetLevel(iMaxVolume); + RDebug::Printf("[TMS STIF] MaxLevel [%d] Ret Error [%d]", iMaxVolume, ret); + RDebug::Printf("[TMS STIF] Volume, SetLevel to MaxLevel [%d]", iMaxVolume); + ret = static_cast(iTmsDnlinkEffect)->SetLevel( + iMaxVolume); RDebug::Printf("[TMS STIF] SetLevel Ret Error [%d]", ret); iLog->Log(_L("SetMaxVolume: %d"), iMaxVolume); RDebug::Printf("[TMS STIF] GetLevel"); - ret = ((TMSVolumeEffect*) iTmsDnlinkEffect)->GetLevel(iVolume); + ret = static_cast(iTmsDnlinkEffect)->GetLevel( + iVolume); RDebug::Printf("[TMS STIF] Level [%d] Ret Error [%d]", iVolume, ret); if (iVolume != iMaxVolume) { - iLog->Log( - _L("GetVolume doesn't return expected MaxVolume!!! returned Volume = %d"), - iVolume); + iLog->Log(_L("GetVolume doesn't return expected MaxVolume!!! returned Volume = %d"), iVolume); return KErrUnexpectedValue; } RDebug::Printf("[TMS STIF] Volume, SetLevel to 0 "); - ret = ((TMSVolumeEffect*) iTmsDnlinkEffect)->SetLevel(0); + ret = static_cast(iTmsDnlinkEffect)->SetLevel(0); RDebug::Printf("[TMS STIF] SetLevel Ret Error [%d]", ret); iLog->Log(_L("Mute Volume")); - ret = ((TMSVolumeEffect*) iTmsDnlinkEffect)->GetLevel(iVolume); + ret = static_cast(iTmsDnlinkEffect)->GetLevel( + iVolume); RDebug::Printf("[TMS STIF] Level [%d] Ret Error [%d]", iVolume, ret); if (iVolume != 0) { - iLog->Log( - _L("GetVolume does not return expected Mute value!!! returned Volume = %d"), - iVolume); + iLog->Log(_L("GetVolume does not return expected Mute value!!! returned Volume = %d"), iVolume); return KErrUnexpectedValue; } } else if (effecttype == TMS_EFFECT_GLOBAL_VOL) { RDebug::Printf("[TMS STIF] GLOBAL_VOL, Get Current Level"); - ret = ((TMSGlobalVolEffect*) iGlobalVol)->GetLevel(iVolume); - RDebug::Printf("[TMS STIF] Current Vol Level [%d] Ret Error [%d]", - iVolume, ret); + ret = static_cast(iGlobalVol)->GetLevel(iVolume); + RDebug::Printf("[TMS STIF] Current Vol Level [%d] Ret Error [%d]", iVolume, ret); RDebug::Printf("[TMS STIF] GLOBAL_VOL, GetMaxLevel"); - ret = ((TMSGlobalVolEffect*) iGlobalVol)->GetMaxLevel(iMaxVolume); - RDebug::Printf("[TMS STIF] MaxLevel [%d] Ret Error [%d]", iMaxVolume, - ret); + ret = static_cast(iGlobalVol)->GetMaxLevel( + iMaxVolume); + RDebug::Printf("[TMS STIF] MaxLevel [%d] Ret Error [%d]", iMaxVolume, ret); RDebug::Printf("[TMS STIF] GLOBAL_VOL, SetLevel to [%d]", iMaxVolume); - ret = ((TMSGlobalVolEffect*) iGlobalVol)->SetLevel(iMaxVolume); + ret = static_cast(iGlobalVol)->SetLevel( + iMaxVolume); RDebug::Printf("[TMS STIF] SetLevel Ret Error [%d]", ret); iLog->Log(_L("SetMaxGlobleVolume: %d"), iMaxVolume); RDebug::Printf("[TMS STIF] GLOBAL_VOL,GetLevel"); - ret = ((TMSGlobalVolEffect*) iGlobalVol)->GetLevel(iVolume); - RDebug::Printf( - "[TMS STIF] Expected Level [%d] Ret Level [%d] Ret Error [%d]", - iMaxVolume, iVolume, ret); + ret = static_cast(iGlobalVol)->GetLevel(iVolume); + RDebug::Printf("[TMS STIF] Expected Level [%d] Ret Level [%d] Ret Error [%d]", iMaxVolume, iVolume, ret); iLog->Log(_L("GetMaxGlobleVolume: %d"), iVolume); if (iVolume != iMaxVolume) { - iLog->Log( - _L("GetGlobleVolume doesn't return expected MaxVolume!!! returned Volume = %d"), - iVolume); + iLog->Log(_L("GetGlobleVolume doesn't return expected MaxVolume!!! returned Volume = %d"), iVolume); return KErrUnexpectedValue; } - ((TMSGlobalVolEffect*) iGlobalVol)->SetLevel(0); + static_cast(iGlobalVol)->SetLevel(0); iLog->Log(_L("Mute Globle Volume")); - ((TMSGlobalVolEffect*) iGlobalVol)->GetLevel(iVolume); + static_cast(iGlobalVol)->GetLevel(iVolume); if (iVolume != 0) { - iLog->Log( - _L("GetGlobleVolume does not return expected Mute value!!! returned Volume = %d"), - iVolume); + iLog->Log(_L("GetGlobleVolume does not return expected Mute value!!! returned Volume = %d"), iVolume); return KErrUnexpectedValue; } } @@ -1989,9 +1919,7 @@ if (error != KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::AddGlobalRoutingObserver failed error [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobalRoutingObserver failed error [%d]"), error); } return error; } @@ -2008,9 +1936,7 @@ if (error != KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::DeleteGlobalRoutingObserver failed error [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::DeleteGlobalRoutingObserver failed error [%d]"), error); } return error; } @@ -2026,59 +1952,43 @@ if (OutputType == KTagNone) { error = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_NONE); - iLog->Log( - _L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_NONE, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_NONE, error:[%d] "), error); } else if (OutputType == KTagPublic) { error = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_PUBLIC); - iLog->Log( - _L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_PUBLIC, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_PUBLIC, error:[%d] "), error); } else if (OutputType == KTagPrivate) { error = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_PRIVATE); - iLog->Log( - _L ("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_PRIVATE, error:[%d] "), - error); + iLog->Log(_L ("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_PRIVATE, error:[%d] "), error); } else if (OutputType == KTagHandset) { error = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_HANDSET); - iLog->Log( - _L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_HANDSET, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_HANDSET, error:[%d] "), error); } else if (OutputType == KTagLoudspeaker) { error = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_LOUDSPEAKER); - iLog->Log( - _L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_LOUDSPEAKER, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_LOUDSPEAKER, error:[%d] "), error); } else if (OutputType == KTagWiredAccessory) { error = iTmsGlobalRouting->SetOutput( TMS_AUDIO_OUTPUT_WIRED_ACCESSORY); - iLog->Log( - _L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_WIRED_ACCESSORY, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_WIRED_ACCESSORY, error:[%d] "), error); } else if (OutputType == KTagAccessory) { error = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_ACCESSORY); - iLog->Log( - _L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_ACCESSORY, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_ACCESSORY, error:[%d] "), error); } else if (OutputType == KTagTTY) { error = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_ETTY); - iLog->Log( - _L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_ETTY, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::SetOutputDevice - TMS_AUDIO_OUTPUT_ETTY, error:[%d] "), error); } else { @@ -2101,9 +2011,7 @@ if (iTmsGlobalRouting) { error = iTmsGlobalRouting->GetOutput(iDevice); - iLog->Log( - _L("CTmsAudioServicesTestClass::GetOutput, error:[%d] iDevice:[%d]"), - error, iDevice); + iLog->Log(_L("CTmsAudioServicesTestClass::GetOutput, error:[%d] iDevice:[%d]"), error, iDevice); } if (error != KErrNone) @@ -2120,9 +2028,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_NONE) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetOutput - not expected output, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetOutput - not expected output, error:[%d] "), error); } } else if (OutputType == KTagPublic) @@ -2130,9 +2036,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_PUBLIC) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetOutput - TMS_AUDIO_OUTPUT_PUBLIC, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetOutput - TMS_AUDIO_OUTPUT_PUBLIC, error:[%d] "), error); } } else if (OutputType == KTagPrivate) @@ -2140,9 +2044,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_PRIVATE) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetOutput - TMS_AUDIO_OUTPUT_PRIVATE, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetOutput - TMS_AUDIO_OUTPUT_PRIVATE, error:[%d] "), error); } } else if (OutputType == KTagHandset) @@ -2150,9 +2052,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_HANDSET) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetOutput - not expected output, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetOutput - not expected output, error:[%d] "), error); } } else if (OutputType == KTagLoudspeaker) @@ -2160,9 +2060,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_LOUDSPEAKER) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetOutput - not expected output, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetOutput - not expected output, error:[%d] "), error); } } else if (OutputType == KTagWiredAccessory) @@ -2170,9 +2068,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_WIRED_ACCESSORY) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetOutput - not expected output, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetOutput - not expected output, error:[%d] "), error); } } else if (OutputType == KTagAccessory) @@ -2180,9 +2076,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_ACCESSORY) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetOutput - not expected output, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetOutput - not expected output, error:[%d] "), error); } } else if (OutputType == KTagTTY) @@ -2190,9 +2084,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_ETTY) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetOutput - not expected output, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetOutput - not expected output, error:[%d] "), error); } } else @@ -2213,9 +2105,7 @@ if (iTmsGlobalRouting) { error = iTmsGlobalRouting->GetPreviousOutput(iDevice); - iLog->Log( - _L("CTmsAudioServicesTestClass::GetPreviousOutput, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetPreviousOutput, error:[%d] "), error); } if (error != KErrNone) @@ -2232,9 +2122,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_NONE) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetPreviousOutput - not expected output, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetPreviousOutput - not expected output, error:[%d] "), error); } } else if (OutputType == KTagPublic) @@ -2242,9 +2130,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_PUBLIC) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetPreviousOutput - TMS_AUDIO_OUTPUT_PUBLIC, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetPreviousOutput - TMS_AUDIO_OUTPUT_PUBLIC, error:[%d] "), error); } } else if (OutputType == KTagPrivate) @@ -2252,9 +2138,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_PRIVATE) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetPreviousOutput - TMS_AUDIO_OUTPUT_PRIVATE, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetPreviousOutput - TMS_AUDIO_OUTPUT_PRIVATE, error:[%d] "), error); } } else if (OutputType == KTagHandset) @@ -2262,9 +2146,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_HANDSET) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetPreviousOutput - not expected output, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetPreviousOutput - not expected output, error:[%d] "), error); } } else if (OutputType == KTagLoudspeaker) @@ -2272,9 +2154,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_LOUDSPEAKER) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetPreviousOutput - not expected output, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetPreviousOutput - not expected output, error:[%d] "), error); } } else if (OutputType == KTagWiredAccessory) @@ -2282,9 +2162,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_WIRED_ACCESSORY) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetPreviousOutput - not expected output, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetPreviousOutput - not expected output, error:[%d] "), error); } } else if (OutputType == KTagAccessory) @@ -2292,9 +2170,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_ACCESSORY) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetPreviousOutput - not expected output, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetPreviousOutput - not expected output, error:[%d] "), error); } } else if (OutputType == KTagTTY) @@ -2302,9 +2178,7 @@ if (iDevice != TMS_AUDIO_OUTPUT_ETTY) { error = KErrUnexpectedValue; - iLog->Log( - _L("CTmsAudioServicesTestClass::GetPr eviousOutput - not expected output, error:[%d] "), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetPr eviousOutput - not expected output, error:[%d] "), error); } } else @@ -2328,8 +2202,7 @@ if (error == KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::GetAvailableOutputs, display output")); + iLog->Log(_L("CTmsAudioServicesTestClass::GetAvailableOutputs, display output")); std::vector::iterator iteroutputs = iAvailableoutputs.begin(); @@ -2340,9 +2213,7 @@ } else { - iLog->Log( - _L("CTmsAudioServicesTestClass::GetAvailableOutputs failed, error = %d"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetAvailableOutputs failed, error = %d"), error); } } else @@ -2446,21 +2317,16 @@ if (error == KErrNone) { - iLog->Log( - _L("CTmsAudioServicesTestClass::GetBitRateList - display supported bitRate list")); + iLog->Log(_L("CTmsAudioServicesTestClass::GetBitRateList - display supported bitRate list")); std::vector::iterator itBitrates = iBitratesVector.begin(); for (; itBitrates <= iBitratesVector.end(); itBitrates++) { - iLog->Log( - _L("CTmsAudioServicesTestClass::GetBitRateList BR: %d"), - *itBitrates); + iLog->Log(_L("CTmsAudioServicesTestClass::GetBitRateList BR: %d"), *itBitrates); } } else { - iLog->Log( - _L("CTmsAudioServicesTestClass::GetBitRateList failed. error: %d"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::GetBitRateList failed. error: %d"), error); } return error; } @@ -2559,13 +2425,13 @@ switch (iUpLinkCodec) { case TMS_FORMAT_G711: - error = ((TMSG711Format*) iTmsFormatUp)->GetVADMode(aVad); + error = static_cast(iTmsFormatUp)->GetVADMode(aVad); break; case TMS_FORMAT_G729: - error = ((TMSG729Format*) iTmsFormatUp)->GetVADMode(aVad); + error = static_cast(iTmsFormatUp)->GetVADMode(aVad); break; case TMS_FORMAT_ILBC: - error = ((TMSILBCFormat*) iTmsFormatUp)->GetVADMode(aVad); + error = static_cast(iTmsFormatUp)->GetVADMode(aVad); break; default: break; @@ -2590,13 +2456,13 @@ switch (iUpLinkCodec) { case TMS_FORMAT_G711: - error = ((TMSG711Format*) iTmsFormatUp)->SetVADMode(iVad); + error = static_cast(iTmsFormatUp)->SetVADMode(iVad); break; case TMS_FORMAT_G729: - error = ((TMSG729Format*) iTmsFormatUp)->SetVADMode(iVad); + error = static_cast(iTmsFormatUp)->SetVADMode(iVad); break; case TMS_FORMAT_ILBC: - error = ((TMSILBCFormat*) iTmsFormatUp)->SetVADMode(iVad); + error = static_cast(iTmsFormatUp)->SetVADMode(iVad); break; default: break; @@ -2616,7 +2482,7 @@ if ((linkType == KTagUplink) && (iUpLinkCodec == TMS_FORMAT_G711)) { TMSG711CodecMode aMode; - ((TMSG711Format*) iTmsFormatUp)->GetMode(aMode); + static_cast(iTmsFormatUp)->GetMode(aMode); if (aMode == TMS_G711_CODEC_MODE_ALAW) { @@ -2635,7 +2501,7 @@ && (iUpLinkCodec == TMS_FORMAT_ILBC)) { TMSILBCCodecMode aMode; - ((TMSILBCFormat*) iTmsFormatUp)->GetMode(aMode); + static_cast(iTmsFormatUp)->GetMode(aMode); if (aMode == TMS_ILBC_CODEC_MODE_20MS_FRAME) { @@ -2654,7 +2520,7 @@ && (iDnLinkCodec == TMS_FORMAT_G711)) { TMSG711CodecMode aMode; - ((TMSG711Format*) iTmsFormatDn)->GetMode(aMode); + static_cast(iTmsFormatDn)->GetMode(aMode); if (aMode == TMS_G711_CODEC_MODE_ALAW) { @@ -2673,7 +2539,7 @@ && (iDnLinkCodec == TMS_FORMAT_ILBC)) { TMSILBCCodecMode aMode; - ((TMSILBCFormat*) iTmsFormatDn)->GetMode(aMode); + static_cast(iTmsFormatDn)->GetMode(aMode); if (aMode == TMS_ILBC_CODEC_MODE_20MS_FRAME) { @@ -2716,54 +2582,56 @@ && (mode == KTagALaw)) { iLog->Log(_L("UPL Mode Set: aLaw")); - ((TMSG711Format*) iTmsFormatUp)->SetMode(TMS_G711_CODEC_MODE_ALAW); + static_cast(iTmsFormatUp)->SetMode( + TMS_G711_CODEC_MODE_ALAW); } else if ((linkType == KTagUplink) && (iUpLinkCodec == TMS_FORMAT_G711) && (mode == KTagULaw)) { iLog->Log(_L("UPL Mode Set: uLaw")); - ((TMSG711Format*) iTmsFormatUp)->SetMode( + static_cast(iTmsFormatUp)->SetMode( TMS_G711_CODEC_MODE_MULAW); } else if ((linkType == KTagUplink) && (iUpLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag20ms)) { iLog->Log(_L("UPL Mode Set: 20ms frame")); - ((TMSILBCFormat*) iTmsFormatUp)->SetMode( + static_cast(iTmsFormatUp)->SetMode( TMS_ILBC_CODEC_MODE_20MS_FRAME); } else if ((linkType == KTagUplink) && (iUpLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag30ms)) { iLog->Log(_L("UPL Mode Set: 30ms frame")); - ((TMSILBCFormat*) iTmsFormatUp)->SetMode( + static_cast(iTmsFormatUp)->SetMode( TMS_ILBC_CODEC_MODE_30MS_FRAME); } else if ((linkType == KTagDnlink) && (iDnLinkCodec == TMS_FORMAT_G711) && (mode == KTagALaw)) { iLog->Log(_L("DNL Mode Set: aLaw")); - ((TMSG711Format*) iTmsFormatDn)->SetMode(TMS_G711_CODEC_MODE_ALAW); + static_cast(iTmsFormatDn)->SetMode( + TMS_G711_CODEC_MODE_ALAW); } else if ((linkType == KTagDnlink) && (iDnLinkCodec == TMS_FORMAT_G711) && (mode == KTagULaw)) { iLog->Log(_L("DNL Mode Set: uLaw")); - ((TMSG711Format*) iTmsFormatDn)->SetMode( + static_cast(iTmsFormatDn)->SetMode( TMS_G711_CODEC_MODE_MULAW); } else if ((linkType == KTagDnlink) && (iDnLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag20ms)) { iLog->Log(_L("DNL Mode Set: 20ms frame")); - ((TMSILBCFormat*) iTmsFormatDn)->SetMode( + static_cast(iTmsFormatDn)->SetMode( TMS_ILBC_CODEC_MODE_20MS_FRAME); } else if ((linkType == KTagDnlink) && (iDnLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag30ms)) { iLog->Log(_L("DNL Mode Set: 30ms frame")); - ((TMSILBCFormat*) iTmsFormatDn)->SetMode( + static_cast(iTmsFormatDn)->SetMode( TMS_ILBC_CODEC_MODE_30MS_FRAME); } else @@ -2784,11 +2652,11 @@ switch (iDnLinkCodec) { case TMS_FORMAT_G711: - error = ((TMSG711Format*) iTmsFormatDn)->GetCNG(aCng); + error = static_cast(iTmsFormatDn)->GetCNG(aCng); iLog->Log(_L("CNG: %d"), aCng); break; case TMS_FORMAT_ILBC: - error = ((TMSILBCFormat*) iTmsFormatDn)->GetCNG(aCng); + error = static_cast(iTmsFormatDn)->GetCNG(aCng); iLog->Log(_L("CNG: %d"), aCng); break; default: @@ -2812,11 +2680,11 @@ switch (iDnLinkCodec) { case TMS_FORMAT_G711: - ((TMSG711Format*) iTmsFormatDn)->SetCNG(iCng); + static_cast(iTmsFormatDn)->SetCNG(iCng); iLog->Log(_L("CNG set: %d"), iCng); break; case TMS_FORMAT_ILBC: - ((TMSILBCFormat*) iTmsFormatDn)->SetCNG(iCng); + static_cast(iTmsFormatDn)->SetCNG(iCng); iLog->Log(_L("CNG set: %d"), iCng); break; default: @@ -2832,7 +2700,7 @@ TBool aPlc = EFalse; if (iDnLinkCodec == TMS_FORMAT_G711) { - ((TMSG711Format*) iTmsFormatDn)->GetPlc(aPlc); + static_cast(iTmsFormatDn)->GetPlc(aPlc); iLog->Log(_L("PLC: %d"), aPlc); } @@ -2852,7 +2720,7 @@ iPlc = (iPlc) ? EFalse : ETrue; if (iDnLinkCodec == TMS_FORMAT_G711) { - error = ((TMSG711Format*) iTmsFormatDn)->SetPlc(iPlc); + error = static_cast(iTmsFormatDn)->SetPlc(iPlc); iLog->Log(_L("PLC set: %d"), iPlc); } @@ -2909,9 +2777,7 @@ { error = iTmsUplink->AddSource(iTmsMicSource); } - iLog->Log( - _L("CTmsAudioServicesTestClass::AddMicSrcToUplStream Error [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::AddMicSrcToUplStream Error [%d]"), error); return error; } @@ -2924,9 +2790,7 @@ { error = iTmsDnlink->AddSource(iTmsModemSource); } - iLog->Log( - _L("CTmsAudioServicesTestClass::AddModemSrcToDnlStream Error [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::AddModemSrcToDnlStream Error [%d]"), error); return error; } @@ -2940,14 +2804,13 @@ { error = iTmsDnlink->RemoveSource(iTmsClientSource); } - iLog->Log( - _L("CTmsAudioServicesTestClass::RemoveClientSrcFromDnlStream Error [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::RemoveClientSrcFromDnlStream Error [%d]"), error); return error; } // Note: CS and IP -TInt CTmsAudioServicesTestClass::RemoveMicSrcFromUplStream(CStifItemParser& /*aItem*/) +TInt CTmsAudioServicesTestClass::RemoveMicSrcFromUplStream( + CStifItemParser& /*aItem*/) { iLog->Log(_L("CTmsAudioServicesTestClass::RemoveMicSrcFromUplStream")); TInt error = KErrNone; @@ -2955,14 +2818,13 @@ { error = iTmsUplink->RemoveSource(iTmsMicSource); } - iLog->Log( - _L("CTmsAudioServicesTestClass::RemoveMicSrcFromUplStream Error [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::RemoveMicSrcFromUplStream Error [%d]"), error); return error; } // Note: CS ONLY -TInt CTmsAudioServicesTestClass::RemoveModemSrcFromDnlStream(CStifItemParser& /*aItem*/) +TInt CTmsAudioServicesTestClass::RemoveModemSrcFromDnlStream( + CStifItemParser& /*aItem*/) { iLog->Log(_L("CTmsAudioServicesTestClass::RemoveModemSrcFromDnlStream")); TInt error = KErrNone; @@ -2970,9 +2832,7 @@ { error = iTmsDnlink->RemoveSource(iTmsModemSource); } - iLog->Log( - _L("CTmsAudioServicesTestClass::RemoveModemSrcFromDnlStream Error [%d]"), - error); + iLog->Log(_L("CTmsAudioServicesTestClass::RemoveModemSrcFromDnlStream Error [%d]"), error); return error; } @@ -2982,48 +2842,53 @@ TInt error = KErrNone; if (iTmsClientSource) { - error = ((TMSClientSource*) iTmsClientSource)->AddObserver(*this, - NULL); + error = static_cast(iTmsClientSource)->AddObserver( + *this, NULL); } return error; } -TInt CTmsAudioServicesTestClass::RemoveSourceObserver(CStifItemParser& /*aItem*/) +TInt CTmsAudioServicesTestClass::RemoveSourceObserver( + CStifItemParser& /*aItem*/) { iLog->Log(_L("CTmsAudioServicesTestClass::RemoveSourceObserver")); TInt error = KErrNone; if (iTmsClientSource) { - error = ((TMSClientSource*) iTmsClientSource)->RemoveObserver(*this); + error = static_cast(iTmsClientSource)->RemoveObserver( + *this); } return error; } -TInt CTmsAudioServicesTestClass::AddClientSinkToUplStream(CStifItemParser& /*aItem*/) +TInt CTmsAudioServicesTestClass::AddClientSinkToUplStream( + CStifItemParser& /*aItem*/) { iLog->Log(_L("CTmsAudioServicesTestClass::AddClientSinkToUplStream")); TInt error = KErrNone; if (iTmsUplink && iTmsClientSink) { - //((TMSClientSink*) iTmsSink)->AddObserver(*this, NULL); + //static_cast(iTmsSink)->AddObserver(*this, NULL); error = iTmsUplink->AddSink(iTmsClientSink); } return error; } -TInt CTmsAudioServicesTestClass::AddModemSinkToUplStream(CStifItemParser& /*aItem*/) +TInt CTmsAudioServicesTestClass::AddModemSinkToUplStream( + CStifItemParser& /*aItem*/) { iLog->Log(_L("CTmsAudioServicesTestClass::AddModemSinkToUplStream")); TInt error = KErrNone; if (iTmsUplink && iTmsModemSink) { - //((TMSClientSink*) iTmsSink)->AddObserver(*this, NULL); + //static_cast(iTmsSink)->AddObserver(*this, NULL); error = iTmsUplink->AddSink(iTmsModemSink); } return error; } -TInt CTmsAudioServicesTestClass::AddSpkrSinkToDnlStream(CStifItemParser& /*aItem*/) +TInt CTmsAudioServicesTestClass::AddSpkrSinkToDnlStream( + CStifItemParser& /*aItem*/) { iLog->Log(_L("CTmsAudioServicesTestClass::AddSpkrSinkToDnlStream")); TInt error = KErrNone; @@ -3058,7 +2923,8 @@ return error; } -TInt CTmsAudioServicesTestClass::RemoveSpkrSinkFromDnlStream(CStifItemParser& /*aItem*/) +TInt CTmsAudioServicesTestClass::RemoveSpkrSinkFromDnlStream( + CStifItemParser& /*aItem*/) { iLog->Log(_L("CTmsAudioServicesTestClass::RemoveSpkrSinkFromDnlStream")); TInt error = KErrNone; @@ -3075,7 +2941,8 @@ TInt error = KErrNone; if (iTmsUplink && iTmsClientSink) { - error = ((TMSClientSink*) iTmsClientSink)->AddObserver(*this, NULL); + error = static_cast(iTmsClientSink)->AddObserver(*this, + NULL); } return error; } @@ -3086,7 +2953,8 @@ TInt error = KErrNone; if (iTmsUplink && iTmsClientSink) { - error = ((TMSClientSink*) iTmsClientSink)->RemoveObserver(*this); + error = static_cast(iTmsClientSink)->RemoveObserver( + *this); } return error; } @@ -3100,7 +2968,8 @@ status = iFactory->CreateEffect(TMS_EFFECT_VOLUME, iTmsDnlinkEffect); if (status == KErrNone) { - ((TMSVolumeEffect*) iTmsDnlinkEffect)->AddObserver(*this, NULL); + static_cast(iTmsDnlinkEffect)->AddObserver(*this, + NULL); } } RDebug::Printf("[TMS STIF] CreateVolumeEffect Return [%d]", status); @@ -3117,16 +2986,17 @@ if (status == KErrNone) { - ((TMSGlobalVolEffect*) iGlobalVol)->AddObserver(*this, NULL); - iLog->Log( - _L("CTmsAudioServicesTestClass::CreateVolumeGlobleEffect - AddObserver")); + static_cast(iGlobalVol)->AddObserver(*this, + NULL); + iLog->Log(_L("CTmsAudioServicesTestClass::CreateVolumeGlobleEffect - AddObserver")); } } RDebug::Printf("[TMS STIF] CreateVolumeGlobleEffect Return [%d]", status); return status; } -TInt CTmsAudioServicesTestClass::AddVolumeEffectToStream(CStifItemParser& /*aItem*/) +TInt CTmsAudioServicesTestClass::AddVolumeEffectToStream( + CStifItemParser& /*aItem*/) { iLog->Log(_L("CTmsAudioServicesTestClass::AddVolumeEffectToStream")); TInt error = KErrNone; @@ -3152,8 +3022,7 @@ TInt CTmsAudioServicesTestClass::RemoveGlobleVolumeEffectToStream( CStifItemParser& /*aItem*/) { - iLog->Log( - _L("CTmsAudioServicesTestClass::RemoveGlobleVolumeEffectToStream")); + iLog->Log(_L("CTmsAudioServicesTestClass::RemoveGlobleVolumeEffectToStream")); TInt error = KErrNone; if (iTmsDnlink && iGlobalVol) { @@ -3172,7 +3041,8 @@ status = iFactory->CreateEffect(TMS_EFFECT_GAIN, iTmsUplinkEffect); if (status == KErrNone) { - ((TMSGainEffect*) iTmsUplinkEffect)->AddObserver(*this, NULL); + static_cast(iTmsUplinkEffect)->AddObserver(*this, + NULL); } } RDebug::Printf("[TMS STIF] CreateGainEffect Return [%d]", status); @@ -3188,14 +3058,16 @@ status = iFactory->CreateEffect(TMS_EFFECT_GLOBAL_GAIN, iGlobalGain); if (status == KErrNone) { - ((TMSGlobalGainEffect*) iGlobalGain)->AddObserver(*this, NULL); + static_cast(iGlobalGain)->AddObserver(*this, + NULL); } } RDebug::Printf("[TMS STIF] CreateGlobleGainEffect Return [%d]", status); return status; } -TInt CTmsAudioServicesTestClass::AddGainEffectToStream(CStifItemParser& /*aItem*/) +TInt CTmsAudioServicesTestClass::AddGainEffectToStream( + CStifItemParser& /*aItem*/) { iLog->Log(_L("CTmsAudioServicesTestClass::AddGainEffectToStream")); TInt error = KErrNone; @@ -3206,7 +3078,8 @@ return error; } -TInt CTmsAudioServicesTestClass::AddGlobleGainEffectToStream(CStifItemParser& /*aItem*/) +TInt CTmsAudioServicesTestClass::AddGlobleGainEffectToStream( + CStifItemParser& /*aItem*/) { iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobleGainEffectToStream")); TInt error = KErrNone; @@ -3220,8 +3093,7 @@ TInt CTmsAudioServicesTestClass::RemoveGlobleGainEffectToStream( CStifItemParser& /*aItem*/) { - iLog->Log( - _L("CTmsAudioServicesTestClass::RemoveGlobleGainEffectToStream")); + iLog->Log(_L("CTmsAudioServicesTestClass::RemoveGlobleGainEffectToStream")); TInt error = KErrNone; if (iTmsUplink && iGlobalGain) { @@ -3255,8 +3127,9 @@ Mem::Copy(desptr, srcptr, srcsize); - ((TMSClientSource*) iTmsClientSource)->BufferFilled(*iPlayBuf); - ((TMSClientSink*) iTmsClientSink)->BufferProcessed(iRecBuf); + static_cast(iTmsClientSource)->BufferFilled( + *iPlayBuf); + static_cast(iTmsClientSink)->BufferProcessed(iRecBuf); iPlayBufReady = EFalse; // buf filled, ready for FillBuffer iRecBufReady = EFalse; // buf consumed, ready for EmptyBuffer diff -r 5a06f39ad45b -r 80975da52420 mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocksCallbacks.cpp --- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocksCallbacks.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocksCallbacks.cpp Mon May 03 12:59:52 2010 +0300 @@ -19,11 +19,11 @@ #include "TmsAudioServicesTestClass.h" #include "debug.h" -void CTmsAudioServicesTestClass::TMSStreamEvent(TMSStream* stream, +void CTmsAudioServicesTestClass::TMSStreamEvent(const TMSStream& stream, TMSSignalEvent event) { iLog->Log(_L("[tms cb]CTmsAudioServicesTestClass::TMSStreamEvent")); - switch (stream->GetStreamType()) + switch (const_cast(stream).GetStreamType()) { case TMS_STREAM_UPLINK: { @@ -36,26 +36,22 @@ { case TMS_STREAM_INITIALIZED: iUpLinkStatus = INITIALIZED; - iLog->Log( - _L("[tms cb]TMSStreamEvent EOpenUplinkComplete")); + iLog->Log(_L("[tms cb]TMSStreamEvent EOpenUplinkComplete")); ProcessEvent(EOpenUplinkComplete, KErrNone); break; case TMS_STREAM_UNINITIALIZED: iUpLinkStatus = UNINITIALIZED; - iLog->Log( - _L("[tms cb]TMSStreamEvent EUplinkClosed")); + iLog->Log(_L("[tms cb]TMSStreamEvent EUplinkClosed")); ProcessEvent(EUplinkClosed, KErrNone); break; case TMS_STREAM_PAUSED: iUpLinkStatus = PAUSED; - iLog->Log( - _L("[tms cb]TMSStreamEvent EStreamPaused")); + iLog->Log(_L("[tms cb]TMSStreamEvent EStreamPaused")); ProcessEvent(EStreamPaused, KErrNone); break; case TMS_STREAM_STARTED: iUpLinkStatus = STARTED; - iLog->Log( - _L("[tms cb]TMSStreamEvent EStreamStarted")); + iLog->Log(_L("[tms cb]TMSStreamEvent EStreamStarted")); ProcessEvent(EStreamStarted, KErrNone); break; default: @@ -78,26 +74,22 @@ { case TMS_STREAM_INITIALIZED: iDnLinkStatus = INITIALIZED; - iLog->Log( - _L("[tms cb]TMSStreamEvent EOpenDownlinkComplete")); + iLog->Log(_L("[tms cb]TMSStreamEvent EOpenDownlinkComplete")); ProcessEvent(EOpenDownlinkComplete, KErrNone); break; case TMS_STREAM_UNINITIALIZED: iDnLinkStatus = UNINITIALIZED; - iLog->Log( - _L("[tms cb]TMSStreamEvent EDownlinkClosed")); + iLog->Log(_L("[tms cb]TMSStreamEvent EDownlinkClosed")); ProcessEvent(EDownlinkClosed, KErrNone); break; case TMS_STREAM_PAUSED: iDnLinkStatus = PAUSED; - iLog->Log( - _L("[tms cb]TMSStreamEvent EStreamPaused")); + iLog->Log(_L("[tms cb]TMSStreamEvent EStreamPaused")); ProcessEvent(EStreamPaused, KErrNone); break; case TMS_STREAM_STARTED: iDnLinkStatus = STARTED; - iLog->Log( - _L("[tms cb]TMSStreamEvent EStreamStarted")); + iLog->Log(_L("[tms cb]TMSStreamEvent EStreamStarted")); ProcessEvent(EStreamStarted, KErrNone); break; default: @@ -128,32 +120,32 @@ } } -void CTmsAudioServicesTestClass::BufferProcessed(TMSBuffer* /*buffer*/, +void CTmsAudioServicesTestClass::BufferProcessed(const TMSBuffer* /*buffer*/, gint /*reason*/) { iLog->Log(_L("[tms cb]CTmsAudioServicesTestClass::BufferProcessed")); } //From TMSClientSinkObserver -void CTmsAudioServicesTestClass::ProcessBuffer(TMSBuffer* buffer) +void CTmsAudioServicesTestClass::ProcessBuffer(const TMSBuffer* buffer) { iLog->Log(_L("[tms cb]CTmsAudioServicesTestClass::ProcessBuffer")); ProcessEvent(EEmptyBuffer, KErrNone); iRecBufReady = ETrue; - iRecBuf = buffer; + iRecBuf = const_cast(buffer); if (iUpLinkStatus == STARTED) { // Process recorded buffer here. DoLoopback(); - // ((TMSClientSink*)iTmsSink)->BufferProcessed(iRecBuf); + //static_cast(iTmsSink)->BufferProcessed(iRecBuf); } } -void CTmsAudioServicesTestClass::EffectsEvent(TMSEffect* tmseffect, +void CTmsAudioServicesTestClass::EffectsEvent(const TMSEffect& tmseffect, TMSSignalEvent /*event*/) { TMSEffectType effecttype; - tmseffect->GetType(effecttype); + const_cast(tmseffect).GetType(effecttype); switch (effecttype) { case TMS_EFFECT_VOLUME: @@ -166,7 +158,7 @@ // From TMSGlobalRoutingObserver void CTmsAudioServicesTestClass::GlobalRoutingEvent( - TMSGlobalRouting* /*routing*/, TMSSignalEvent event, + const TMSGlobalRouting& /*routing*/, TMSSignalEvent event, TMSAudioOutput /*output*/) { iLog->Log(_L("[tms cb]CTmsAudioServicesTestClass::GlobalRoutingEvent")); diff -r 5a06f39ad45b -r 80975da52420 mmserv/group/bld.inf --- a/mmserv/group/bld.inf Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/group/bld.inf Mon May 03 12:59:52 2010 +0300 @@ -27,6 +27,7 @@ #include "../callaudiocontrol/group/bld.inf" #include "../metadatautility/Group/bld.inf" #include "../radioutility/group/bld.inf" +#include "../sts/group/bld.inf" #include "../thumbnailengine/Group/bld.inf" #include "../tms/group/bld.inf" #include "../voipaudioservices/group/bld.inf" diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/bwins/FmPresetUtilityu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/bwins/FmPresetUtilityu.def Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,23 @@ +EXPORTS + ??1CRadioFmPresetUtility@@UAE@XZ @ 1 NONAME ; CRadioFmPresetUtility::~CRadioFmPresetUtility(void) + ?DeletePresetL@CRadioFmPresetUtility@@UAEXH@Z @ 2 NONAME ; void CRadioFmPresetUtility::DeletePresetL(int) + ?GetFirstPresetL@CRadioFmPresetUtility@@UBEXAAH@Z @ 3 NONAME ; void CRadioFmPresetUtility::GetFirstPresetL(int &) const + ?GetMaxNumberOfPresets@CRadioFmPresetUtility@@UBEHAAH@Z @ 4 NONAME ; int CRadioFmPresetUtility::GetMaxNumberOfPresets(int &) const + ?GetNextPresetL@CRadioFmPresetUtility@@UBEXHAAH@Z @ 5 NONAME ; void CRadioFmPresetUtility::GetNextPresetL(int, int &) const + ?GetNumberOfPresets@CRadioFmPresetUtility@@UBEHAAH@Z @ 6 NONAME ; int CRadioFmPresetUtility::GetNumberOfPresets(int &) const + ?GetPresetL@CRadioFmPresetUtility@@UAEXHAAV?$TBuf@$0CA@@@AAH@Z @ 7 NONAME ; void CRadioFmPresetUtility::GetPresetL(int, class TBuf<32> &, int &) + ?NewL@CRadioFmPresetUtility@@SAPAV1@AAVMRadioPresetObserver@@@Z @ 8 NONAME ; class CRadioFmPresetUtility * CRadioFmPresetUtility::NewL(class MRadioPresetObserver &) + ?SetPresetL@CRadioFmPresetUtility@@UAEXHABV?$TBuf@$0CA@@@H@Z @ 9 NONAME ; void CRadioFmPresetUtility::SetPresetL(int, class TBuf<32> const &, int) + ?GetPresetFrequencyL@CRadioFmPresetUtility@@UAEXHAAH@Z @ 10 NONAME ; void CRadioFmPresetUtility::GetPresetFrequencyL(int, int &) + ?GetPresetNameL@CRadioFmPresetUtility@@UAEXHAAV?$TBuf@$0CA@@@@Z @ 11 NONAME ; void CRadioFmPresetUtility::GetPresetNameL(int, class TBuf<32> &) + ?SetPresetFavouriteInfoL@CRadioFmPresetUtility@@QAEXHH@Z @ 12 NONAME ; void CRadioFmPresetUtility::SetPresetFavouriteInfoL(int, int) + ?SetPresetUserRenameInfoL@CRadioFmPresetUtility@@QAEXHH@Z @ 13 NONAME ; void CRadioFmPresetUtility::SetPresetUserRenameInfoL(int, int) + ?SetPresetPICodeL@CRadioFmPresetUtility@@QAEXHI@Z @ 14 NONAME ; void CRadioFmPresetUtility::SetPresetPICodeL(int, unsigned int) + ?GetPresetUserRenameInfoL@CRadioFmPresetUtility@@QAEXHAAH@Z @ 15 NONAME ; void CRadioFmPresetUtility::GetPresetUserRenameInfoL(int, int &) + ?GetPresetPtyL@CRadioFmPresetUtility@@QAEXHAAI@Z @ 16 NONAME ; void CRadioFmPresetUtility::GetPresetPtyL(int, unsigned int &) + ?SetPresetPtyL@CRadioFmPresetUtility@@QAEXHI@Z @ 17 NONAME ; void CRadioFmPresetUtility::SetPresetPtyL(int, unsigned int) + ?GetPresetPICodeL@CRadioFmPresetUtility@@QAEXHAAI@Z @ 18 NONAME ; void CRadioFmPresetUtility::GetPresetPICodeL(int, unsigned int &) + ?SetPresetUrlL@CRadioFmPresetUtility@@QAEXHABV?$TBuf@$0EA@@@@Z @ 19 NONAME ; void CRadioFmPresetUtility::SetPresetUrlL(int, class TBuf<64> const &) + ?GetPresetFavouriteInfoL@CRadioFmPresetUtility@@QAEXHAAH@Z @ 20 NONAME ; void CRadioFmPresetUtility::GetPresetFavouriteInfoL(int, int &) + ?GetPresetUrlL@CRadioFmPresetUtility@@QAEXHAAV?$TBuf@$0EA@@@@Z @ 21 NONAME ; void CRadioFmPresetUtility::GetPresetUrlL(int, class TBuf<64> &) + diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/bwins/presetutilityu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/bwins/presetutilityu.def Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,26 @@ +EXPORTS + ?SetRenamedByUser@TPreset@@QAEXH@Z @ 1 NONAME ; void TPreset::SetRenamedByUser(int) + ?Name@TPreset@@QBE?AVTPtrC16@@XZ @ 2 NONAME ; class TPtrC16 TPreset::Name(void) const + ??1CPresetUtility@@UAE@XZ @ 3 NONAME ; CPresetUtility::~CPresetUtility(void) + ?SetFavorite@TPreset@@QAEXH@Z @ 4 NONAME ; void TPreset::SetFavorite(int) + ?SetFrequency@TPreset@@QAEXI@Z @ 5 NONAME ; void TPreset::SetFrequency(unsigned int) + ?PiCode@TPreset@@QBEHXZ @ 6 NONAME ; int TPreset::PiCode(void) const + ?MyExternalizedDataSize@TPreset@@UBEIXZ @ 7 NONAME ; unsigned int TPreset::MyExternalizedDataSize(void) const + ?LocalStation@TPreset@@QBEHXZ @ 8 NONAME ; int TPreset::LocalStation(void) const + ?ExternalizeL@TPreset@@UBEXAAVRWriteStream@@@Z @ 9 NONAME ; void TPreset::ExternalizeL(class RWriteStream &) const + ?SetGenre@TPreset@@QAEXH@Z @ 10 NONAME ; void TPreset::SetGenre(int) + ?Genre@TPreset@@QBEHXZ @ 11 NONAME ; int TPreset::Genre(void) const + ?Favorite@TPreset@@QBEHXZ @ 12 NONAME ; int TPreset::Favorite(void) const + ?SetName@TPreset@@QAEXABV?$TBuf@$0CA@@@@Z @ 13 NONAME ; void TPreset::SetName(class TBuf<32> const &) + ?Frequency@TPreset@@QBEIXZ @ 14 NONAME ; unsigned int TPreset::Frequency(void) const + ?NewL@CPresetUtilityBody@@SAPAV1@XZ @ 15 NONAME ; class CPresetUtilityBody * CPresetUtilityBody::NewL(void) + ?SetPiCode@TPreset@@QAEXH@Z @ 16 NONAME ; void TPreset::SetPiCode(int) + ?SetLocalStation@TPreset@@QAEXH@Z @ 17 NONAME ; void TPreset::SetLocalStation(int) + ??1CPresetUtilityBody@@UAE@XZ @ 18 NONAME ; CPresetUtilityBody::~CPresetUtilityBody(void) + ?RenamedByUser@TPreset@@QBEHXZ @ 19 NONAME ; int TPreset::RenamedByUser(void) const + ??0TPreset@@QAE@XZ @ 20 NONAME ; TPreset::TPreset(void) + ?Url@TPreset@@QBE?AVTPtrC16@@XZ @ 21 NONAME ; class TPtrC16 TPreset::Url(void) const + ?InternalizeL@TPreset@@UAEXAAVRReadStream@@@Z @ 22 NONAME ; void TPreset::InternalizeL(class RReadStream &) + ?NewL@CPresetUtility@@SAPAV1@XZ @ 23 NONAME ; class CPresetUtility * CPresetUtility::NewL(void) + ?SetUrl@TPreset@@QAEXABV?$TBuf@$0DC@@@@Z @ 24 NONAME ; void TPreset::SetUrl(class TBuf<50> const &) + diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/cenrep/10207b87.txt Binary file mmserv/radioutility/presetutility/cenrep/10207b87.txt has changed diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/conf/presetutility.confml Binary file mmserv/radioutility/presetutility/conf/presetutility.confml has changed diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/conf/presetutility_10207B87.crml Binary file mmserv/radioutility/presetutility/conf/presetutility_10207B87.crml has changed diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/eabi/FmPresetUtilityu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/eabi/FmPresetUtilityu.def Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,40 @@ +EXPORTS + _ZN21CRadioFmPresetUtility10GetPresetLEiR4TBufILi32EERi @ 1 NONAME + _ZN21CRadioFmPresetUtility10SetPresetLEiRK4TBufILi32EEi @ 2 NONAME + _ZN21CRadioFmPresetUtility13DeletePresetLEi @ 3 NONAME + _ZN21CRadioFmPresetUtility4NewLER20MRadioPresetObserver @ 4 NONAME + _ZN21CRadioFmPresetUtilityD0Ev @ 5 NONAME + _ZN21CRadioFmPresetUtilityD1Ev @ 6 NONAME + _ZN21CRadioFmPresetUtilityD2Ev @ 7 NONAME + _ZNK21CRadioFmPresetUtility14GetNextPresetLEiRi @ 8 NONAME + _ZNK21CRadioFmPresetUtility15GetFirstPresetLERi @ 9 NONAME + _ZNK21CRadioFmPresetUtility18GetNumberOfPresetsERi @ 10 NONAME + _ZNK21CRadioFmPresetUtility21GetMaxNumberOfPresetsERi @ 11 NONAME + _ZTI21CRadioFmPresetUtility @ 12 NONAME ; ## + _ZTI25CCentralRepositoryHandler @ 13 NONAME ; ## + _ZTIN21CRadioFmPresetUtility5CBodyE @ 14 NONAME ; ## + _ZTV21CRadioFmPresetUtility @ 15 NONAME ; ## + _ZTV25CCentralRepositoryHandler @ 16 NONAME ; ## + _ZTVN21CRadioFmPresetUtility5CBodyE @ 17 NONAME ; ## + _ZThn4_N21CRadioFmPresetUtility13DeletePresetLEi @ 18 NONAME ; ## + _ZThn4_NK21CRadioFmPresetUtility14GetNextPresetLEiRi @ 19 NONAME ; ## + _ZThn4_NK21CRadioFmPresetUtility15GetFirstPresetLERi @ 20 NONAME ; ## + _ZThn4_NK21CRadioFmPresetUtility18GetNumberOfPresetsERi @ 21 NONAME ; ## + _ZThn4_NK21CRadioFmPresetUtility21GetMaxNumberOfPresetsERi @ 22 NONAME ; ## + _ZThn8_N21CRadioFmPresetUtility10GetPresetLEiR4TBufILi32EERi @ 23 NONAME ; ## + _ZThn8_N21CRadioFmPresetUtility10SetPresetLEiRK4TBufILi32EEi @ 24 NONAME ; ## + _ZN21CRadioFmPresetUtility14GetPresetNameLEiR4TBufILi32EE @ 25 NONAME + _ZN21CRadioFmPresetUtility19GetPresetFrequencyLEiRi @ 26 NONAME + _ZThn8_N21CRadioFmPresetUtility14GetPresetNameLEiR4TBufILi32EE @ 27 NONAME ; ## + _ZThn8_N21CRadioFmPresetUtility19GetPresetFrequencyLEiRi @ 28 NONAME ; ## + _ZN21CRadioFmPresetUtility13GetPresetPtyLEiRj @ 29 NONAME + _ZN21CRadioFmPresetUtility13GetPresetUrlLEiR4TBufILi64EE @ 30 NONAME + _ZN21CRadioFmPresetUtility13SetPresetPtyLEij @ 31 NONAME + _ZN21CRadioFmPresetUtility13SetPresetUrlLEiRK4TBufILi64EE @ 32 NONAME + _ZN21CRadioFmPresetUtility16GetPresetPICodeLEiRj @ 33 NONAME + _ZN21CRadioFmPresetUtility16SetPresetPICodeLEij @ 34 NONAME + _ZN21CRadioFmPresetUtility23GetPresetFavouriteInfoLEiRi @ 35 NONAME + _ZN21CRadioFmPresetUtility23SetPresetFavouriteInfoLEii @ 36 NONAME + _ZN21CRadioFmPresetUtility24GetPresetUserRenameInfoLEiRi @ 37 NONAME + _ZN21CRadioFmPresetUtility24SetPresetUserRenameInfoLEii @ 38 NONAME + diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/eabi/presetutilityu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/eabi/presetutilityu.def Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,35 @@ +EXPORTS + _ZN14CPresetUtility4NewLEv @ 1 NONAME + _ZN14CPresetUtilityD0Ev @ 2 NONAME + _ZN14CPresetUtilityD1Ev @ 3 NONAME + _ZN14CPresetUtilityD2Ev @ 4 NONAME + _ZN18CPresetUtilityBody4NewLEv @ 5 NONAME + _ZN18CPresetUtilityBodyD0Ev @ 6 NONAME + _ZN18CPresetUtilityBodyD1Ev @ 7 NONAME + _ZN18CPresetUtilityBodyD2Ev @ 8 NONAME + _ZN7TPreset11SetFavoriteEi @ 9 NONAME + _ZN7TPreset12InternalizeLER11RReadStream @ 10 NONAME + _ZN7TPreset12SetFrequencyEj @ 11 NONAME + _ZN7TPreset15SetLocalStationEi @ 12 NONAME + _ZN7TPreset16SetRenamedByUserEi @ 13 NONAME + _ZN7TPreset6SetUrlERK4TBufILi50EE @ 14 NONAME + _ZN7TPreset7SetNameERK4TBufILi32EE @ 15 NONAME + _ZN7TPreset8SetGenreEi @ 16 NONAME + _ZN7TPreset9SetPiCodeEi @ 17 NONAME + _ZN7TPresetC1Ev @ 18 NONAME + _ZN7TPresetC2Ev @ 19 NONAME + _ZNK7TPreset12ExternalizeLER12RWriteStream @ 20 NONAME + _ZNK7TPreset12LocalStationEv @ 21 NONAME + _ZNK7TPreset13RenamedByUserEv @ 22 NONAME + _ZNK7TPreset22MyExternalizedDataSizeEv @ 23 NONAME + _ZNK7TPreset3UrlEv @ 24 NONAME + _ZNK7TPreset4NameEv @ 25 NONAME + _ZNK7TPreset5GenreEv @ 26 NONAME + _ZNK7TPreset6PiCodeEv @ 27 NONAME + _ZNK7TPreset8FavoriteEv @ 28 NONAME + _ZNK7TPreset9FrequencyEv @ 29 NONAME + _ZTI14CCenrepHandler @ 30 NONAME + _ZTI7TPreset @ 31 NONAME + _ZTV14CCenrepHandler @ 32 NONAME + _ZTV7TPreset @ 33 NONAME + diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/group/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/group/backup_registration.xml Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/group/bld.inf Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project build file for RadioPresetUtility +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +// Generic configuration interface for component cenrep settings +// presetutility_10207B87 implementation specifics for cenrep data +../conf/presetutility.confml MW_LAYER_CONFML(presetutility.confml) +../conf/presetutility_10207B87.crml MW_LAYER_CRML(presetutility_10207B87.crml) + + +// iby files +../rom/fmpresetutility.iby CORE_MW_LAYER_IBY_EXPORT_PATH(fmpresetutility.iby) +../rom/presetutility.iby CORE_MW_LAYER_IBY_EXPORT_PATH(presetutility.iby) + + +PRJ_MMPFILES +presetutility.mmp +fmpresetutility.mmp diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/group/fmpresetutility.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/group/fmpresetutility.mmp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Project definition file for FmPresetUtility. +* +*/ + + +//#include +//#include +#include + +TARGET FmPresetUtility.dll +TARGETTYPE DLL +CAPABILITY CAP_GENERAL_DLL ReadUserData +VENDORID VID_DEFAULT +UID 0x1000008D 0x10207B87 +VERSION 10.3 + +SOURCEPATH ../src/old_api +SOURCE radiofmpresetutility.cpp // Compatibility api +SOURCE radiofmpresetcentralrepositoryhandler.cpp + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY presetutility.lib +LIBRARY cenrepnotifhandler.lib +LIBRARY centralrepository.lib +LIBRARY euser.lib +LIBRARY estor.lib +//LIBRARY dsclient.lib + + diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/group/presetutility.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/group/presetutility.mmp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Project definition file for RadioPresetUtility. +* +*/ + + +//#include +//#include +#include + +TARGET presetutility.dll // Temporarily renamed to not clash with the existing utility +TARGETTYPE DLL +CAPABILITY CAP_GENERAL_DLL ReadUserData +VENDORID VID_DEFAULT +UID 0x1000008D 0x2002C307 +VERSION 10.3 + +SOURCEPATH ../src +SOURCE presetutility.cpp +SOURCE presetutilitybody.cpp +SOURCE preset.cpp +SOURCE cenrephandler.cpp +SOURCE cenrepbookkeeping.cpp +USERINCLUDE ../cenrep +USERINCLUDE ../src +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY cenrepnotifhandler.lib +LIBRARY centralrepository.lib +LIBRARY euser.lib +LIBRARY estor.lib +//LIBRARY dsclient.lib + + diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/inc/cenrepbookkeeping.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/inc/cenrepbookkeeping.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is a class, responsible of keeping track of existing presets +* and their indexes. +* +* +*/ + +#ifndef CCENREPBOOKKEEPING_H_ +#define CCENREPBOOKKEEPING_H_ + +#include + +class RWriteStream; +class RReadStream; + +const TInt KMaxNumberOfPresetStations = 100; // One temporarily used for internal book keeping + +#define LENGTHOFUSEDINDEXLWORDSARRAY ((KMaxNumberOfPresetStations/32) + 1) +/** + * it is a class, responsible of keeping track of existing presets and their indexes. + */ +NONSHARABLE_CLASS( CCenrepBookKeeping ) : public CBase +{ +public: + + /** + * Default class constructor. + */ + CCenrepBookKeeping(); + + /** + * Destructor of CCenrepBookKeeping class. + */ + ~CCenrepBookKeeping(); + + /** + * Get the current number of presets. + * @return The number of presets. + */ + TInt PresetCount() const; + + /** + * Get the index of first preset. + * @return The first preset index. + */ + TInt FirstIndex() const; + + /** + * Get the index of the next preset. + * @param aFromIndex - Start from index after this. + * @return the next preset index. + */ + TInt NextIndex( TInt aFromIndex = 0 ); + + /** + * Find an unused preset index. + * @return Allocated index. + */ + TInt FindUnusedIndex() const; + + /** + * Check if given index is used. + * @return ETrue if used, otherwise EFalse + */ + TBool IsIndexUsed( const TInt aIndex ); + + /** + * Add a preset. + * @param aIndex - Proposed index. + * @return Used/Allocated index. + */ + void AddIndex( const TInt aIndex ); + + /** + * Remove a preset. + * @param aIndex - Index of the preset to be removed. + * @return Used/Allocated index. + */ + void RemoveIndex( const TInt aIndex ); + + /** + * Clear all data. + * @return The first preset index. + */ + void Clear(); + + /** + * Gives descriptor pointer to bookkeeping's data. + * @return TPtr8 Descriptor that contains bookkeeping data. + */ + TPtr8 BookKeepingData(); + +private: + + // This data is copied to Central Repository Key (buffer) as such without + // actual serialization. + // Therefore in order to keep backward incombatibility don't + // change the order of fields. Only the last array field can be allowed to grow. + // If a new field is added to the end, the preceding array field cannot grow anymore. + // Additionally the size of this structure should never shrink. + class TBookKeepingData + { + public: + TInt iCount; + TUint32 iUsedIndexLWords[ LENGTHOFUSEDINDEXLWORDSARRAY ]; + } iBookKeepingData; + +}; + +#endif // CCENREPBOOKKEEPING_H_ diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/inc/cenrephandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/inc/cenrephandler.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is a wrapper class of Central Repository, responsible +* for the operations that need to access the central respository. +* +* +*/ + +#ifndef CCENREPHANDLER_H +#define CCENREPHANDLER_H + +// System includes +#include + +// Constants +const TInt KBufferLength = 20; +const TInt KStreamBufferSize = 100; + +// Forward declarations +class CRepository; +class TPreset; +class CCenrepBookKeeping; + +// Class declaration + +/** + * it is a wrapper of Central Repository, responsible for the operations that need to access + * the central respository. + */ +class CCenrepHandler : public CBase + { +public: + + /** + * Two-phased class constructor. + */ + static CCenrepHandler* NewL(); + + /** + * Destructor of CCenrepHandler class. + */ + virtual ~CCenrepHandler(); + + /** + * Get the maximum number of presets. + * @return The maximum number of presets. + */ + TInt MaxPresetCount() const; + + /** + * Get the current number of presets. + * @return The number of presets. + */ + TInt PresetCount() const; + + /** + * Get the index of first preset. + * @return The first preset index. + */ + TInt FirstPreset() const; + + /** + * Get the index of the next preset. + * @param aFromIndex - Start from index after this. + * @return the next preset index. + */ + TInt NextPreset( TInt aFromIndex ) const; + + /** + * Delete the specified preset. + * Specifying aIndex < 0, will delete all presets. + * Has no effect if specified index contains no preset. + */ + TInt DeletePreset( TInt aIndex ); + + /** + * Save the preset. + * @param aPreset Preset object. + * @param aIndex - Preset index. + * @return given/allocated(in case given value was -1) index. + */ + TInt SavePresetL( const TPreset& aPreset, TInt aIndex = -1 ); + + + /** + * Read a preset. + * @param aIndex - Preset index. + * @param aPreset Preset object to where to update the data. + * @return none + */ + void ReadPresetL( TInt aIndex, TPreset& aPreset ); + +private: + + /** + * Default class constructor. + */ + CCenrepHandler(); + + /** + * Second phase class constructor. + */ + void ConstructL(); + + /** + * Read bookkeeping information from the permanent storage. + */ + void ReadBookKeepingL(); + + /** + * Save bookkeeping information to the permanent storage. + */ + void SaveBookKeeping(); + + /** + * Read preconfigured presets from the permanent storage. + */ + void ReadPreDefinedPresetsL(); + +private: // data + + // Central Repository + CRepository* iCentralRepository; + + // Bookkeeping of existing presets + CCenrepBookKeeping* iBookKeeping; + + }; + +#endif // CCENREPHANDLER_H diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/inc/presetcrkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/inc/presetcrkeys.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Preset Utility's Central Repository key index definitions. +* +* +*/ + + +#ifndef RADIOPRESETCRKEYS_H +#define RADIOPRESETCRKEYS_H + +// Preset Utility UID +const TUid KCRUidPresetUtility = {0x10207B87}; + +// The first preset channel's location in central repository +const TUint32 KRadioBookKeepingLocation = 0x00000001; +const TUint32 KRadioPresetChannel1 = 0x00001000; +const TUint32 KNbrOfParametersPerChannelSequence = 0x10; +const TUint32 KChannelNameOffset = 0x0; +const TUint32 KFrequencyOffset = 0x1; +const TUint32 KUrlOffset = 0x2; +const TUint32 KRestOfParametersOffset = 0xF; + +#endif // RADIOPRESETCRKEYS_H diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/inc/presetutilitybody.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/inc/presetutilitybody.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Preset Utility Body class. +* +* +*/ + +#ifndef C_PRESETUTILITYBODY_H +#define C_PRESETUTILITYBODY_H + +#include + +class MPresetUtilityObserver; +class CCenrepHandler; + +NONSHARABLE_CLASS( CPresetUtilityBody ) : public CPresetUtility + { +public: + + /** + * Two-phased class constructor. + */ + IMPORT_C static CPresetUtilityBody* NewL(); + + /** + * Destructor of CPresetUtilityBody class. + */ + IMPORT_C ~CPresetUtilityBody(); + +// from base class CFmRadioPresetUtility + + void SetObserver( MPresetUtilityObserver* aObserver ); + TInt MaxNumberOfPresets() const; + TInt PresetCount() const; + TInt FirstPreset() const; + TInt NextPreset( TInt aFromIndex ) const; + TInt DeletePreset( TInt aIndex ); + TInt SavePresetL( const TPreset& aPreset, TInt aIndex ); + void ReadPresetL( TInt aIndex, TPreset& aPreset ); + +private: + + /** + * Default class constructor. + */ + CPresetUtilityBody(); + + /** + * Second phase class constructor. + */ + void ConstructL(); + +private: + + // Observer object + MPresetUtilityObserver* iObserver; + + // Central Repository interface + CCenrepHandler* iCenrepHandler; + + }; + +#endif // C_PRESETUTILITYBODY_H diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/inc/trace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/inc/trace.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,596 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Trace macro definitions. +* +*/ + +#ifndef TRACE_H +#define TRACE_H + +#include // TCleanupItem +#include "traceconfiguration.hrh" + +#ifdef TRACE_INTO_FILE +#include // RFileLogger +#else +#include // RDebug +#endif + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- +// + +// NOTE! +// Replace all COMPONENT_NAME occurnaces with your own component / module name. + +/** +* Prefix trace macro to complete tracing with component name. +* Returns TDesC which can be used directly with RDebug or RFileLogger. +*/ +#define _PREFIX_TRACE( aMsg ) TPtrC( (const TText*)L"[PresetUtility]: " L##aMsg ) + +/** +* Prefix error trace +*/ +#define _PREFIX_ERROR( aMsg ) _PREFIX_TRACE( "[ERROR: %d]: " L##aMsg ) + +/** +* Prefix info trace. +*/ +#define _PREFIX_INFO( aMsg ) _PREFIX_TRACE( "[INFO]: " L##aMsg ) + +/** +* Prefix macro for strings +*/ +#define _PREFIX_CHAR( aMsg ) (const char*)"[PresetUtility]: " ##aMsg + +/** +* Define needed directories if TRACE_INTO_FILE macro in use +*/ +#ifdef TRACE_INTO_FILE + + _LIT( KDir, "PresetUtility" ); + _LIT( KFile, "PresetUtility_log.txt" ); + _LIT( KFullPath, "c:\\logs\\PresetUtility\\" ); + +#endif + +//----------------------------------------------------------------------------- +// Error trace macros +//----------------------------------------------------------------------------- +// +#ifdef ERROR_TRACE + + /** + * Error trace definitions. + */ + #ifdef TRACE_INTO_FILE + + #define ERROR( aErr, aMsg )\ + {\ + if( aErr < KErrNone )\ + {\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr );\ + }\ + } + #define ERROR_1( aErr, aMsg, aP1 )\ + {\ + if( aErr < KErrNone )\ + {\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1 );\ + }\ + } + #define ERROR_2( aErr, aMsg, aP1, aP2 )\ + {\ + if( aErr < KErrNone )\ + {\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\ + }\ + } + #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\ + {\ + if( aErr < KErrNone )\ + {\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\ + }\ + } + #define ERROR_4( aErr, aMsg, aP1, aP2, aP3, aP4 )\ + {\ + if( aErr < KErrNone )\ + {\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3, aP4 );\ + }\ + } + #define ERROR_5( aErr, aMsg, aP1, aP2, aP3, aP4, aP5 )\ + {\ + if( aErr < KErrNone )\ + {\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3, aP4, aP5 );\ + }\ + } + #define ERROR_6( aErr, aMsg, aP1, aP2, aP3, aP4, aP5, aP6 )\ + {\ + if( aErr < KErrNone )\ + {\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3, aP4, aP5 );\ + }\ + } + + #else//TRACE_INTO_FILE not defined + + #define ERROR( aErr, aMsg )\ + {\ + if( aErr < KErrNone )\ + {\ + RDebug::Print( _PREFIX_ERROR( aMsg ), aErr );\ + }\ + } + #define ERROR_1( aErr, aMsg, aP1 )\ + {\ + if( aErr < KErrNone )\ + {\ + RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1 );\ + }\ + } + #define ERROR_2( aErr, aMsg, aP1, aP2 )\ + {\ + if( aErr < KErrNone )\ + {\ + RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\ + }\ + } + #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\ + {\ + if( aErr < KErrNone )\ + {\ + RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\ + }\ + } + #define ERROR_4( aErr, aMsg, aP1, aP2, aP3, aP4 )\ + {\ + if( aErr < KErrNone )\ + {\ + RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3, aP4 );\ + }\ + } + #define ERROR_5( aErr, aMsg, aP1, aP2, aP3, aP4, aP5 )\ + {\ + if( aErr < KErrNone )\ + {\ + RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3, aP4, aP5 );\ + }\ + } + #define ERROR_6( aErr, aMsg, aP1, aP2, aP3, aP4, aP5, aP6 )\ + {\ + if( aErr < KErrNone )\ + {\ + RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3, aP4, aP5, aP6 );\ + }\ + } + + #endif//TRACE_INTO_FILE + + #define ERROR_GEN( aMsg ) ERROR( KErrGeneral, aMsg ) + #define ERROR_GEN_1( aMsg, aP1 ) ERROR_1( KErrGeneral, aMsg, aP1 ) + #define ERROR_GEN_2( aMsg, aP1, aP2 ) ERROR_2( KErrGeneral, aMsg, aP1, aP2 ) + #define ERROR_GEN_3( aMsg, aP1, aP2, aP3 ) ERROR_3( KErrGeneral, aMsg, aP1, aP3 ) + #define ERROR_GEN_4( aMsg, aP1, aP2, aP3, aP4 ) ERROR_4( KErrGeneral, aMsg, aP1, aP3, aP4 ) + #define ERROR_GEN_5( aMsg, aP1, aP2, aP3, aP4, aP5 ) ERROR_5( KErrGeneral, aMsg, aP1, aP3, aP4, aP5 ) + #define ERROR_GEN_6( aMsg, aP1, aP2, aP3, aP4, aP5, aP6 ) ERROR_6( KErrGeneral, aMsg, aP1, aP3, aP4, aP5, aP6 ) + +#else//ERROR_TRACE not defined + + #define ERROR( aErr, aMsg ) + #define ERROR_1( aErr, aMsg, aP1 ) + #define ERROR_2( aErr, aMsg, aP1, aP2 ) + #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 ) + #define ERROR_4( aErr, aMsg, aP1, aP2, aP3, aP4 ) + #define ERROR_5( aErr, aMsg, aP1, aP2, aP3, aP4, aP5 ) + #define ERROR_6( aErr, aMsg, aP1, aP2, aP3, aP4, aP5, aP6 ) + + #define ERROR_GEN( aMsg ) + #define ERROR_GEN_1( aMsg, aP1 ) + #define ERROR_GEN_2( aMsg, aP1, aP2 ) + #define ERROR_GEN_3( aMsg, aP1, aP2, aP3 ) + #define ERROR_GEN_4( aMsg, aP1, aP2, aP3, aP4 ) + #define ERROR_GEN_5( aMsg, aP1, aP2, aP3, aP4, aP5 ) + #define ERROR_GEN_6( aMsg, aP1, aP2, aP3, aP4, aP5, aP6 ) + +#endif//ERROR_TRACE + +//----------------------------------------------------------------------------- +// TRAP and trace with error macro +//----------------------------------------------------------------------------- +// +#define TRAP_ERROR( aErr, aFunction )\ + {\ + TRAP( aErr, aFunction );\ + TPtrC8 file( ( TText8* )__FILE__ );\ + ERROR_2( aErr, "Trapped leave in '%S' line %d", &file, __LINE__);\ + } + +//----------------------------------------------------------------------------- +// Info trace macros +//----------------------------------------------------------------------------- +// +#ifdef INFO_TRACE + + /** + * Info log message definitions. + */ + #ifdef TRACE_INTO_FILE + + #define INFO( aMsg )\ + {\ + RFileLogger::Write( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ) );\ + } + #define INFO_1( aMsg, aP1 )\ + {\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1 );\ + } + #define INFO_2( aMsg, aP1, aP2 )\ + {\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2 );\ + } + #define INFO_3( aMsg, aP1, aP2, aP3 )\ + {\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2, aP3 );\ + } + #define INFO_4( aMsg, aP1, aP2, aP3, aP4 )\ + {\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4 );\ + } + #define INFO_5( aMsg, aP1, aP2, aP3, aP4, aP5 )\ + {\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4, aP5 );\ + } + #define INFO_6( aMsg, aP1, aP2, aP3, aP4, aP5, aP6 )\ + {\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4, aP5, aP6 );\ + } + + #else//TRACE_INTO_FILE not defined + + #define INFO( aMsg )\ + {\ + RDebug::Print( _PREFIX_INFO( aMsg ) );\ + } + #define INFO_1( aMsg, aP1 )\ + {\ + RDebug::Print( _PREFIX_INFO( aMsg ), aP1 );\ + } + #define INFO_2( aMsg, aP1, aP2 )\ + {\ + RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2 );\ + } + #define INFO_3( aMsg, aP1, aP2, aP3 )\ + {\ + RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3 );\ + } + #define INFO_4( aMsg, aP1, aP2, aP3, aP4 )\ + {\ + RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4 );\ + } + #define INFO_5( aMsg, aP1, aP2, aP3, aP4, aP5 )\ + {\ + RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4, aP5 );\ + } + #define INFO_6( aMsg, aP1, aP2, aP3, aP4, aP5, aP6 )\ + {\ + RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4, aP5, aP6 );\ + } + + #endif//TRACE_INTO_FILE + +#else//INFO_TRACE not defined + + #define INFO( aMsg ) + #define INFO_1( aMsg, aP1 ) + #define INFO_2( aMsg, aP1, aP2 ) + #define INFO_3( aMsg, aP1, aP2, aP3 ) + #define INFO_4( aMsg, aP1, aP2, aP3, aP4 ) + #define INFO_5( aMsg, aP1, aP2, aP3, aP4, aP5 ) + #define INFO_6( aMsg, aP1, aP2, aP3, aP4, aP5, aP6 ) + +#endif//INFO_TRACE + +//----------------------------------------------------------------------------- +// Trace current client thread name and process id +//----------------------------------------------------------------------------- +// +#ifdef CLIENT_TRACE + + #define CLIENT_PROCESS\ + {\ + CLIENT_PROCESS_PREFIX( "" );\ + } + + #define CLIENT_PROCESS_PREFIX( aPrefix )\ + {\ + RProcess process;\ + TPtrC name( process.Name() );\ + TSecureId sid( process.SecureId() );\ + TPtrC prefix( _S( aPrefix ) );\ + if( prefix.Length() )\ + {\ + INFO_3( "%S: CLIENT - Name: [%S], Sid: [0x%x]", &prefix, &name, sid.iId );\ + }\ + else\ + {\ + INFO_2( "CLIENT - Name: [%S], Sid: [0x%x]", &name, sid.iId );\ + }\ + process.Close();\ + } + + #define CLIENT_MESSAGE( aMsg )\ + {\ + CLIENT_MESSAGE_PREFIX( "", aMsg );\ + } + + #define CLIENT_MESSAGE_PREFIX( aPrefix, aMsg )\ + {\ + RThread thread;\ + TInt err = aMsg.Client( thread );\ + if( err == KErrNone )\ + {\ + RProcess process;\ + err = thread.Process( process );\ + if( err == KErrNone )\ + {\ + TPtrC threadName( thread.Name() );\ + TUid processUid( process.SecureId() );\ + TPtrC prefix( _S( aPrefix ) );\ + if( prefix.Length() )\ + {\ + INFO_4( "%S: MSG - Name: [%S], Sid: [0x%x], Message ID: [%d]",\ + &prefix,\ + &threadName,\ + processUid,\ + aMsg.Function() );\ + }\ + else\ + {\ + INFO_3( "MSG - Name: [%S], Sid: [0x%x], Message ID: [%d]",\ + &threadName,\ + processUid,\ + aMsg.Function() );\ + }\ + }\ + process.Close();\ + }\ + thread.Close();\ + } + +#else + + #define CLIENT_PROCESS + #define CLIENT_PROCESS_PREFIX( aPrefix ) + #define CLIENT_MESSAGE( aMsg ) + #define CLIENT_MESSAGE_PREFIX( aPrefix, aMsg ) + +#endif + +//----------------------------------------------------------------------------- +// Function trace macros +//----------------------------------------------------------------------------- +// +#ifdef FUNC_TRACE + + /** + * Function logging definitions. + */ + #ifdef TRACE_INTO_FILE + + #define FUNC( aMsg, aP1 )\ + {\ + TPtrC8 trace( _S8( aMsg ) );\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, trace, aP1 );\ + }\ + + #else//TRACE_INTO_FILE not defined + + #define FUNC( aMsg, aP1 )\ + {\ + RDebug::Printf( aMsg, aP1 );\ + }\ + + #endif//TRACE_INTO_FILE + + /** + * Function trace helper class. + * + * NOTE: + * LC -methods cannot be trapped. Therefore if LC -method leaves + * END trace is used instead of LEAVE trace. + * If you have an idea how to round this problem please tell. + */ + _LIT8( KFuncNameTerminator, "(" ); + _LIT8( KFuncLeavePatternL, "L" ); + class TFuncLog + { + public: + static void Cleanup( TAny* aPtr ) + { + TFuncLog* self = static_cast< TFuncLog* >( aPtr ); + self->iLeft = ETrue; + FUNC( _PREFIX_CHAR("%S-LEAVE"), &self->iFunc ); // Leave detected + } + inline TFuncLog( const char* aFunc ) : + iFunc( aFunc ? _S8( aFunc ) : _S8("") ), + iLeft( EFalse ), + iCleanupItem( Cleanup, this ), + iCanLeave( EFalse ) + { + TInt pos( iFunc.Find( KFuncNameTerminator ) ); + if( pos != KErrNotFound ) + { + iFunc.Set( iFunc.Left( pos ) ); + iCanLeave = !iFunc.Right( KFuncLeavePatternL().Length() ).Compare( KFuncLeavePatternL ); + if ( iCanLeave ) + { + CleanupStack::PushL( iCleanupItem ); // Ignore warnings + } + } + FUNC( _PREFIX_CHAR("%S-START"), &iFunc ); + } + + inline ~TFuncLog() + { + if ( !iLeft ) + { + if ( iCanLeave ) + { + CleanupStack::Pop( this ); // Pop the cleanup item + } + FUNC( _PREFIX_CHAR("%S-END"), &iFunc ); // Normally finished + } + } + + private: // Data + TPtrC8 iFunc; + TBool iLeft; + TCleanupItem iCleanupItem; + TBool iCanLeave; + }; + #define FUNC_LOG TFuncLog _fl( __PRETTY_FUNCTION__ ); + +#else//FUNC_TRACE not defined + + #define FUNC_LOG + +#endif//FUNC_TRACE + +//----------------------------------------------------------------------------- +// Timestamp trace macros +//----------------------------------------------------------------------------- +// +#ifdef TIMESTAMP_TRACE + + #ifdef TRACE_INTO_FILE + + #define TIMESTAMP( aCaption )\ + {\ + TTime t;\ + t.HomeTime();\ + TDateTime dt = t.DateTime();\ + _LIT( KCaption, aCaption );\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend,\ + _PREFIX_TRACE("[TIMESTAMP] %S %d:%02d:%02d.%d us"),\ + &KCaption, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\ + } + + #else//TRACE_INTO_FILE not defined + + #define TIMESTAMP( aCaption )\ + {\ + TTime t;\ + t.HomeTime();\ + TDateTime dt = t.DateTime();\ + _LIT( KCaption, aCaption );\ + RDebug::Print( _PREFIX_TRACE("[TIMESTAMP] %S %d:%02d:%02d.%d us"),\ + &KCaption, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\ + } + + #endif//TRACE_INTO_FILE + +#else//TIMESTAMP_TRACE not defined + + #define TIMESTAMP( aCaption ) + +#endif//TIMESTAMP_TRACE + +#ifdef HEAP_TRACE + + #ifdef TRACE_INTO_FILE + + #define HEAP( aMsg )\ + {\ + TInt totalAllocSpace = 0;\ + User::AllocSize( totalAllocSpace );\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace );\ + } + #define HEAP_1( aMsg, aP1 )\ + {\ + TInt totalAllocSpace = 0;\ + User::AllocSize( totalAllocSpace );\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1 );\ + } + #define HEAP_2( aMsg, aP1, aP2 )\ + {\ + TInt totalAllocSpace = 0;\ + User::AllocSize( totalAllocSpace );\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2 );\ + } + #define HEAP_3( aMsg, aP1, aP2, aP3 )\ + {\ + TInt totalAllocSpace = 0;\ + User::AllocSize( totalAllocSpace );\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2, aP3 );\ + } + #define HEAP_4( aMsg, aP1, aP2, aP3, aP4 )\ + {\ + TInt totalAllocSpace = 0;\ + User::AllocSize( totalAllocSpace );\ + RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2, aP3, aP4 );\ + } + + #else//TRACE_INTO_FILE not defined + + #define HEAP( aMsg )\ + {\ + TInt totalAllocSpace = 0;\ + User::AllocSize( totalAllocSpace );\ + RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace );\ + } + #define HEAP_1( aMsg, aP1 )\ + {\ + TInt totalAllocSpace = 0;\ + User::AllocSize( totalAllocSpace );\ + RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1 );\ + } + #define HEAP_2( aMsg, aP1, aP2 )\ + {\ + TInt totalAllocSpace = 0;\ + User::AllocSize( totalAllocSpace );\ + RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2 );\ + } + #define HEAP_3( aMsg, aP1, aP2, aP3 )\ + {\ + TInt totalAllocSpace = 0;\ + User::AllocSize( totalAllocSpace );\ + RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2, aP3 );\ + } + #define HEAP_4( aMsg, aP1, aP2, aP3, aP4 )\ + {\ + TInt totalAllocSpace = 0;\ + User::AllocSize( totalAllocSpace );\ + RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2, aP3, aP4 );\ + } + + #endif//TRACE_INTO_FILE + +#else//HEAP_TRACE not defined + + #define HEAP( aMsg ) + #define HEAP_1( aMsg, aP1 ) + #define HEAP_2( aMsg, aP1, aP2 ) + #define HEAP_3( aMsg, aP1, aP2, aP3 ) + #define HEAP_4( aMsg, aP1, aP2, aP3, aP4 ) + +#endif//HEAP_TRACE + +#endif + diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/inc/traceconfiguration.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/inc/traceconfiguration.hrh Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Trace Macro Configurations. +* +*/ + +#ifndef TRACECONFIGURATION_HRH +#define TRACECONFIGURATION_HRH + +//----------------------------------------------------------------------------- +// Trace definitions +//----------------------------------------------------------------------------- +// + +/** +* Error trace enabled +*/ +#ifdef _DEBUG + #define ERROR_TRACE +#else + #undef ERROR_TRACE +#endif + +/** +* Info trace enabled +*/ +#ifdef _DEBUG + #define INFO_TRACE +#else + #undef INFO_TRACE +#endif + +/** +* Timestamp tracing on +*/ +#ifdef _DEBUG + #define TIMESTAMP_TRACE +#else + #undef TIMESTAMP_TRACE +#endif + +/** +* Tracing current client process and thread +*/ +#ifdef _DEBUG + #define CLIENT_TRACE +#else + #undef CLIENT_TRACE +#endif + +/** +* Function trace enabled +*/ +#ifdef _DEBUG + #define FUNC_TRACE +#else + #undef FUNC_TRACE +#endif + +/** +* Tracing into file enabled, default RDebug +*/ +#undef TRACE_INTO_FILE + +#endif + diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/rom/fmpresetutility.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/rom/fmpresetutility.iby Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY file for the FmPresetUtility +* +*/ + + +#ifndef FMPRESETUTILITY_IBY +#define FMPRESETUTILITY_IBY + +file=ABI_DIR\BUILD_DIR\fmPresetUtility.dll SHARED_LIB_DIR\fmPresetUtility.dll + +// Backup +//data=ZPRIVATE\10207B87\backup_registration.xml PRIVATE\10207B87\backup_registration.xml + +#endif // FMPRESETUTILITY_IBY + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/rom/presetutility.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/rom/presetutility.iby Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY file for the presetutility +* +*/ + + +#ifndef PRESETUTILITY_IBY +#define PRESETUTILITY_IBY + +file=ABI_DIR\BUILD_DIR\presetutility.dll SHARED_LIB_DIR\presetutility.dll + +// Backup +data=ZPRIVATE\10207B87\backup_registration.xml PRIVATE\10207B87\backup_registration.xml + +#endif // PRESETUTILITY_IBY + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/src/cenrepbookkeeping.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/src/cenrepbookkeeping.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,281 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + +#include // RWriteStream, RReadStream + +#include "cenrepbookkeeping.h" +#include "trace.h" + + +const TUint8 KNbrOfBitsPerByte = 8; + + +#define BITSPERLWORD ( sizeof(iBookKeepingData.iUsedIndexLWords[0]) * KNbrOfBitsPerByte) + + +// ============= MEMBER FUNCTIONS ============== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCenrepBookKeeping::CCenrepBookKeeping() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCenrepBookKeeping::~CCenrepBookKeeping() + { + FUNC_LOG; + Clear(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CCenrepBookKeeping::PresetCount() const + { + FUNC_LOG; + return iBookKeepingData.iCount; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CCenrepBookKeeping::FirstIndex() const + { + FUNC_LOG; + TInt retIndex( KErrGeneral ); + TUint32 bitMask( 0 ); + for ( TInt lwordOffset = 0; ; ++lwordOffset) + { + if ( 0 !=iBookKeepingData.iUsedIndexLWords[lwordOffset] ) + { + bitMask = 1; + for ( TUint8 bitOffset( 0 ); BITSPERLWORD > bitOffset; ++bitOffset ) + { + if ( KMaxNumberOfPresetStations <= ( ( BITSPERLWORD * lwordOffset ) + bitOffset ) ) + { + retIndex = KErrNotFound; + break; + } + if ( 0 != ( iBookKeepingData.iUsedIndexLWords[lwordOffset] & bitMask) ) + { + retIndex = ( BITSPERLWORD * lwordOffset ) + bitOffset; + break; + } + bitMask = bitMask << 1; + } + } + else if ( KMaxNumberOfPresetStations < ( BITSPERLWORD * (lwordOffset + 1) ) ) + { + retIndex = KErrNotFound; + break; + } + if ( KErrGeneral != retIndex ) + { + break; + } + } + INFO_1( "retIndex: %i", retIndex ); + return retIndex; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CCenrepBookKeeping::NextIndex( TInt aFromIndex ) + { + FUNC_LOG; + TInt retIndex( KErrGeneral ); + TInt startIndex( aFromIndex + 1 ); + TUint32 bitMask( 0 ); + TUint8 bitOffset( 0 ); + for ( TInt lwordOffset(startIndex/BITSPERLWORD); ; ++lwordOffset) + { + if ( lwordOffset == (startIndex/BITSPERLWORD) ) + { + bitMask = 1 << (startIndex%BITSPERLWORD); + bitOffset = (startIndex%BITSPERLWORD); + } + else + { + bitMask = 1; + bitOffset = 0; + } + if ( 0 !=iBookKeepingData.iUsedIndexLWords[lwordOffset] ) + { + for ( ; BITSPERLWORD > bitOffset; ++bitOffset ) + { + if ( KMaxNumberOfPresetStations <= ( ( BITSPERLWORD * lwordOffset ) + bitOffset ) ) + { + retIndex = KErrNotFound; + break; + } + if ( 0 != ( iBookKeepingData.iUsedIndexLWords[lwordOffset] & bitMask) ) + { + retIndex = ( BITSPERLWORD * lwordOffset ) + bitOffset; + break; + } + bitMask = bitMask << 1; + } + } + else if ( KMaxNumberOfPresetStations < ( BITSPERLWORD * (lwordOffset + 1) ) ) + { + retIndex = KErrNotFound; + break; + } + if ( KErrGeneral != retIndex ) + { + break; + } + } + INFO_1( "retIndex: %i", retIndex ); + return retIndex; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCenrepBookKeeping::AddIndex( const TInt aIndex ) + { + FUNC_LOG; + if ( + ( KMaxNumberOfPresetStations >iBookKeepingData.iCount ) && + ( !IsIndexUsed( aIndex ) ) + ) + { + TInt lwordOffset(aIndex/BITSPERLWORD); + TUint bitOffset( (aIndex%BITSPERLWORD) ); + TUint32 bitMask( 1 ); + bitMask = bitMask << bitOffset; + iBookKeepingData.iUsedIndexLWords[lwordOffset] |= bitMask; + ++iBookKeepingData.iCount; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCenrepBookKeeping::RemoveIndex( const TInt aIndex ) + { + FUNC_LOG; + if ( + ( 0 lwordOffset; ++lwordOffset) + { + iBookKeepingData.iUsedIndexLWords[lwordOffset] = 0; + } + iBookKeepingData.iCount = 0; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CCenrepBookKeeping::FindUnusedIndex() const + { + FUNC_LOG; + TInt retIndex( KErrGeneral ); + TUint32 bitMask( 0 ); + for ( TInt lwordOffset = 0; ; ++lwordOffset) + { + if ( 0xFFFFFFFF !=iBookKeepingData.iUsedIndexLWords[lwordOffset] ) + { + bitMask = 1; + for ( TUint8 bitOffset = 0; BITSPERLWORD > bitOffset; ++bitOffset ) + { + if ( KMaxNumberOfPresetStations <= ( ( BITSPERLWORD * lwordOffset ) + bitOffset ) ) + { + retIndex = KErrNotFound; + break; + } + if ( 0 == ( iBookKeepingData.iUsedIndexLWords[lwordOffset] & bitMask) ) + { + retIndex = ( BITSPERLWORD * lwordOffset ) + bitOffset; + break; + } + bitMask = bitMask << 1; + } + } + else if ( KMaxNumberOfPresetStations < ( BITSPERLWORD * (lwordOffset + 1) ) ) + { + retIndex = KErrNotFound; + break; + } + if ( KErrGeneral != retIndex ) + { + break; + } + } + INFO_1( "retIndex: %i", retIndex ); + return retIndex; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCenrepBookKeeping::IsIndexUsed( const TInt aIndex ) + { + FUNC_LOG; + TInt lwordOffset(aIndex/BITSPERLWORD); + TUint bitOffset( (aIndex%BITSPERLWORD) ); + TUint32 bitMask( 1 ); + bitMask = bitMask << bitOffset; + return ( iBookKeepingData.iUsedIndexLWords[lwordOffset] & bitMask); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TPtr8 CCenrepBookKeeping::BookKeepingData() + { + TPtr8 bookKeepingData( (TUint8*)&iBookKeepingData, sizeof( iBookKeepingData ), sizeof( iBookKeepingData ) ); + return bookKeepingData; + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/src/cenrephandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/src/cenrephandler.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,390 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + + +// System includes +#include +#include + +// User includes +#include "cenrephandler.h" +#include "presetcrkeys.h" +#include +#include "cenrepbookkeeping.h" +#include "trace.h" + + +class TChannelIndexList + { +public: + TInt iChannelIndex; + TInt iNameIndex; + TInt iFrequencyIndex; + TInt iUrlIndex; + TInt iRestOfParametersIndex; + }; + +// ============= STATIC FUNCTIONS ============== + +static TInt CalculateChannelIndexes( const TInt aChannelIndex, TChannelIndexList& aChannelIndexList) + { + FUNC_LOG; + TInt err( KErrNone ); + if ( ( KMaxNumberOfPresetStations <= aChannelIndex ) || + ( 0 > aChannelIndex ) ) + { + err = KErrArgument; + } + else + { + aChannelIndexList.iChannelIndex = + KRadioPresetChannel1 + ( KNbrOfParametersPerChannelSequence * aChannelIndex ); + aChannelIndexList.iNameIndex = + aChannelIndexList.iChannelIndex + KChannelNameOffset; + aChannelIndexList.iFrequencyIndex = + aChannelIndexList.iChannelIndex + KFrequencyOffset; + aChannelIndexList.iUrlIndex = + aChannelIndexList.iChannelIndex + KUrlOffset; + aChannelIndexList.iRestOfParametersIndex = + aChannelIndexList.iChannelIndex + KRestOfParametersOffset; + } + return err; + } + +// ============= MEMBER FUNCTIONS ============== + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CCenrepHandler::CCenrepHandler() + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCenrepHandler::ConstructL() + { + FUNC_LOG; + iCentralRepository = CRepository::NewL( KCRUidPresetUtility ); + iBookKeeping = new (ELeave) CCenrepBookKeeping; + ReadBookKeepingL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CCenrepHandler* CCenrepHandler::NewL() + { + FUNC_LOG; + CCenrepHandler* self = new (ELeave) CCenrepHandler(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CCenrepHandler::~CCenrepHandler() + { + FUNC_LOG; + delete iCentralRepository; + delete iBookKeeping; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CCenrepHandler::MaxPresetCount() const + { + FUNC_LOG; + return KMaxNumberOfPresetStations; + } + +// ----------------------------------------------------------------------------- +// Get the current number of presets +// ----------------------------------------------------------------------------- +// +TInt CCenrepHandler::PresetCount() const + { + FUNC_LOG; + return iBookKeeping->PresetCount(); + } + +// ----------------------------------------------------------------------------- +// Gets the first preset +// ----------------------------------------------------------------------------- +// +TInt CCenrepHandler::FirstPreset() const + { + FUNC_LOG; + return iBookKeeping->FirstIndex(); + } + +// ----------------------------------------------------------------------------- +// Get the next preset index that has been set, given the current index +// ----------------------------------------------------------------------------- +// +TInt CCenrepHandler::NextPreset( TInt aFromIndex ) const + { + FUNC_LOG; + return iBookKeeping->NextIndex( aFromIndex ); + } + +// ----------------------------------------------------------------------------- +// Delete the current preset +// ----------------------------------------------------------------------------- +// +TInt CCenrepHandler::DeletePreset( TInt aIndex ) + { + FUNC_LOG; + TInt err( KErrNone ); + if ( -1 == aIndex ) + { + // Delete all + TChannelIndexList channelIndexList; + for ( TInt j( FirstPreset() ); 0 <= j; j = FirstPreset() ) + { + INFO_1("Deleting index: %i", j ); + if ( KErrNone == CalculateChannelIndexes( j, channelIndexList ) ) + { + iCentralRepository->Delete( channelIndexList.iNameIndex ); + iCentralRepository->Delete( channelIndexList.iFrequencyIndex ); + iCentralRepository->Delete( channelIndexList.iUrlIndex ); + iCentralRepository->Delete( channelIndexList.iRestOfParametersIndex ); + iBookKeeping->RemoveIndex( j ); + } + } + } + else + { + TChannelIndexList channelIndexList; + err = CalculateChannelIndexes( aIndex, channelIndexList ); + if ( KErrNone == err ) + { + iCentralRepository->Delete( channelIndexList.iNameIndex ); + iCentralRepository->Delete( channelIndexList.iFrequencyIndex ); + iCentralRepository->Delete( channelIndexList.iUrlIndex ); + iCentralRepository->Delete( channelIndexList.iRestOfParametersIndex ); + iBookKeeping->RemoveIndex( aIndex ); + } + } + if ( KErrNone == err ) + { + SaveBookKeeping(); + } + return err; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CCenrepHandler::SavePresetL( const TPreset& aPreset, TInt aIndex ) + { + FUNC_LOG; + if ( 0 > aIndex ) + { + aIndex = iBookKeeping->FindUnusedIndex(); + } + if ( 0 > aIndex ) + { + User::Leave( KErrDiskFull ); // Not really a good code for this + } + TChannelIndexList channelIndexList; + User::LeaveIfError( CalculateChannelIndexes( aIndex, channelIndexList) ); + + // First save name to its own key in the key sequence. + User::LeaveIfError( iCentralRepository->Set( channelIndexList.iNameIndex, aPreset.Name() ) ); + + // Frequency to its own key in the key sequence. + User::LeaveIfError( iCentralRepository->Set( channelIndexList.iFrequencyIndex, (TInt)aPreset.Frequency() ) ); + + // Url to its own key in the key sequence. + User::LeaveIfError( iCentralRepository->Set( channelIndexList.iUrlIndex, aPreset.Url() ) ); + + // Then externalize the rest of the data to a common key. + TInt err( KErrNone ); + TInt length( aPreset.MyExternalizedDataSize() ); + TUint i ( 1 ); + INFO_1( "aPreset.MyExternalizedDataSize()=%i", length ); + for ( TBool cont = ( 0 < length ) ? ETrue : EFalse; (cont); cont = ( KErrOverflow == err ) ? ETrue : EFalse ) + { + HBufC8* buf = HBufC8::NewLC( i * length ); + TPtr8 bufPtr = buf->Des(); + RDesWriteStream outStream( bufPtr ); + CleanupClosePushL( outStream ); + TRAP( err, aPreset.ExternalizeL( outStream ) ); + if ( KErrNone == err ) + { + outStream.CommitL(); + User::LeaveIfError( iCentralRepository->Set( channelIndexList.iRestOfParametersIndex, *buf ) ); + } + else + { + INFO_2( "SavePresetL bigger buffer (%i) needed than required by aPreset.MyExternalizedDataSize()=%i", i*length, aPreset.MyExternalizedDataSize() ); + ++i; + } + CleanupStack::PopAndDestroy( &outStream ); + CleanupStack::PopAndDestroy( buf ); + } + User::LeaveIfError( err ); + + iBookKeeping->AddIndex( aIndex ); + SaveBookKeeping(); + return aIndex; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCenrepHandler::ReadPresetL( TInt aIndex, TPreset& aPreset ) + { + FUNC_LOG; + + // Read name from its own key in the key sequence + TChannelIndexList channelIndexList; + User::LeaveIfError( CalculateChannelIndexes( aIndex, channelIndexList) ); + TPresetName tempChannelName; + User::LeaveIfError( iCentralRepository->Get(channelIndexList.iNameIndex, tempChannelName ) ); + aPreset.SetName( tempChannelName ); + + // Read frequency from its own key in the key sequence + TInt frequency( 0 ); + User::LeaveIfError( iCentralRepository->Get( channelIndexList.iFrequencyIndex, frequency ) ); + aPreset.SetFrequency( frequency ); + + // Read url from its own key in the key sequence + TRadioUrl tempUrlName; + TInt err = iCentralRepository->Get( channelIndexList.iUrlIndex, tempUrlName ); + if ( KErrNone == err ) + { + aPreset.SetUrl( tempUrlName ); + } + else if ( KErrNotFound == err ) + { + // This is an optional parameter. + } + else + { + User::Leave( err ); + } + + + // Then use the below code to internalize rest of parameters from the common key + TInt actualLength( aPreset.MyExternalizedDataSize() ); + INFO_1( "ReadPresetL aPreset.MyExternalizedDataSize()=%i", actualLength ); + for ( TBool cont = ( 0 < actualLength ) ? ETrue : EFalse; (cont); cont = ( KErrOverflow == err ) ? ETrue : EFalse ) + { + HBufC8* buf = HBufC8::NewLC( actualLength ); + TPtr8 bufPtr = buf->Des(); + err = iCentralRepository->Get( channelIndexList.iRestOfParametersIndex, bufPtr, actualLength ); + if ( ( KErrNone == err ) && ( 0 < buf->Length() ) ) + { + RDesReadStream inStream; + inStream.Open( *buf ); + CleanupClosePushL( inStream ); + aPreset.InternalizeL( inStream ); + CleanupStack::PopAndDestroy( &inStream ); + } + else if ( KErrNotFound == err ) + { + // This is not filled by CT tool even though name, frequency and URL might be + // filled for the current channel. Don't leave. + INFO_1( "ReadPresetL KErrNotFound, key=%i", channelIndexList.iRestOfParametersIndex ); + } + else if ( KErrOverflow == err ) + { + INFO_2( "ReadPresetL KErrOverflow, buf->Length()=%i actualLength=%i", buf->Length(), actualLength ); + // Trying again with actual with buffer that can store the whole key + } + else + { + User::Leave( err ); + } + CleanupStack::PopAndDestroy(buf); + } // for (;;) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCenrepHandler::ReadBookKeepingL() + { + FUNC_LOG; + TPtr8 bufPtr = iBookKeeping->BookKeepingData(); + + TInt err( iCentralRepository->Get( KRadioBookKeepingLocation, bufPtr ) ); + if ( KErrNotFound == err ) + { + // Bookkeeping does not exist. Search possible preconfigured channels. + ReadPreDefinedPresetsL(); + err = KErrNone; + } + User::LeaveIfError( err ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCenrepHandler::SaveBookKeeping() + { + FUNC_LOG; + TInt err( iCentralRepository->Set( KRadioBookKeepingLocation, iBookKeeping->BookKeepingData() ) ); + if ( KErrNone != err ) + { + INFO_1("Saving of BookKeeping failed with error: %i ", err) + // It is better to destroy data that is out of sync + iCentralRepository->Delete( KRadioBookKeepingLocation ); + // Go on with local bookkeeping data + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCenrepHandler::ReadPreDefinedPresetsL() + { + FUNC_LOG; + TInt frequency ( 0 ); + TInt err( KErrNone ); + TChannelIndexList channelIndexList; + iBookKeeping->Clear(); + for(TInt index = 0; index < KMaxNumberOfPresetStations; index++) + { + User::LeaveIfError( CalculateChannelIndexes( index, channelIndexList) ); + err = iCentralRepository->Get( channelIndexList.iFrequencyIndex, frequency ); + if ( KErrNone == err ) + { + iBookKeeping->AddIndex( index ); + } + } + SaveBookKeeping(); + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/src/old_api/radiofmpresetcentralrepositoryhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/src/old_api/radiofmpresetcentralrepositoryhandler.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains a dummy implementation of the CCentralRepositoryHandler class. +* +*/ + + +// INCLUDE FILES +#include "radiofmpresetcentralrepositoryhandler.h" +#include "trace.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ---------------------------------------------------- +// CCentralRepositoryHandler::CCentralRepositoryHandler +// Default class constructor. +// ---------------------------------------------------- +// +CCentralRepositoryHandler::CCentralRepositoryHandler() + { + FUNC_LOG; + } + + +// ---------------------------------------------------- +// CCentralRepositoryHandler::NewL +// Two-phased class constructor. +// ---------------------------------------------------- +// +CCentralRepositoryHandler* CCentralRepositoryHandler::NewL() + { + FUNC_LOG; + CCentralRepositoryHandler *self = new(ELeave) CCentralRepositoryHandler(); + return self; + } + +// ---------------------------------------------------- +// CCentralRepositoryHandler::~CCentralRepositoryHandler +// Destructor of CCentralRepositoryHandler class. +// ---------------------------------------------------- +// +CCentralRepositoryHandler::~CCentralRepositoryHandler() + { + FUNC_LOG; + } + +// end of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/src/old_api/radiofmpresetcentralrepositoryhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/src/old_api/radiofmpresetcentralrepositoryhandler.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines APIs to communicate with Central Repository +* +*/ + + +#ifndef RADIOFMPRESETCENTRALREPOSITORYHANDLER_H +#define RADIOFMPRESETCENTRALREPOSITORYHANDLER_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* it is a wrapper of Central Repository, responsible for the operations that need to access +* the central respositorhy. +* +* @lib FmPresetUtility.lib +* @since Series 60 3.0_version +*/ +class CCentralRepositoryHandler : public CBase + { + public: + /** + * Two-phased class constructor. + */ + static CCentralRepositoryHandler* NewL(); + /** + * Destructor of CCentralRepositoryHandler class. + */ + virtual ~CCentralRepositoryHandler(); + + private: + /** + * Default class constructor. + */ + CCentralRepositoryHandler(); + }; + +#endif // RADIOFMPRESETCENTRALREPOSITORYHANDLER_H + +// end of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/src/old_api/radiofmpresetutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/src/old_api/radiofmpresetutility.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,354 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains implementation of the CRadioFmPresetUtility class, +* which controlls the presets for an FM tuner. +*/ + + +#include +#include +#include "presetutilitybody.h" +#include +#include "trace.h" + +// ############################################################################# +// This file has been deprecated! It is kept only for BC compatibility purposes +// Please use the new API instead of this one +// ############################################################################# + +// Dummy body +class CRadioFmPresetUtility::CBody : public CBase, + public MRadioPreset, + public MRadioFmPreset + { +public: + ~CBody(); + CBody(); + }; +CRadioFmPresetUtility::CBody::CBody() {} +CRadioFmPresetUtility::CBody::~CBody() {} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CRadioFmPresetUtility* CRadioFmPresetUtility::NewL( MRadioPresetObserver& aObserver ) + { + FUNC_LOG; + CRadioFmPresetUtility* self = new (ELeave) CRadioFmPresetUtility( aObserver ); + CleanupStack::PushL(self); + self->iBody = CPresetUtilityBody::NewL(); + self->iBody->SetObserver( self ); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CRadioFmPresetUtility::~CRadioFmPresetUtility() + { + FUNC_LOG; + delete iBody; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CRadioFmPresetUtility::CRadioFmPresetUtility( MRadioPresetObserver& aObserver ): + iObserver( aObserver ) + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CRadioFmPresetUtility::SetPresetL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::SetPresetL( TInt aIndex, const TFmPresetName& aName, TInt aFrequency ) + { + FUNC_LOG; + TPreset radioPreset; + TInt err( KErrNone ); + TRAP(err, iBody->ReadPresetL( aIndex, radioPreset ) ); + if (KErrNotFound == err) + { + // Preset doesn't need to exist yet. + // Handling of err only to get rid of compile warning. + err = KErrNone; + } + User::LeaveIfError(err); + radioPreset.SetName( aName ); + radioPreset.SetFrequency( aFrequency ); + if ( 0 >= aFrequency ) + { + // aFrequency values 0, -1(Or <=0) means that it is better to destroy + // rest of parameters and also URL + TFmPresetUrl url; + radioPreset.SetUrl( url ); + radioPreset.SetGenre( 0 ); + radioPreset.SetPiCode( 0 ); + radioPreset.SetLocalStation( 0 ); + radioPreset.SetFavorite( EFalse ); + radioPreset.SetRenamedByUser( EFalse ); + } + User::LeaveIfError( iBody->SavePresetL( radioPreset, aIndex ) ); + } + +// ----------------------------------------------------------------------------- +// CRadioFmPresetUtility::SetPresetUrlL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::SetPresetUrlL( TInt aIndex, const TFmPresetUrl& aUrl ) + { + FUNC_LOG; + TPreset radioPreset; + iBody->ReadPresetL( aIndex, radioPreset ); + radioPreset.SetUrl( aUrl ); + User::LeaveIfError( iBody->SavePresetL( radioPreset, aIndex ) ); + } + +// ----------------------------------------------------------------------------- +// CRadioFmPresetUtility::SetPresetPtyL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::SetPresetPtyL( TInt aIndex, TUint aPty ) + { + FUNC_LOG; + TPreset radioPreset; + iBody->ReadPresetL( aIndex, radioPreset ); + radioPreset.SetGenre( aPty ); + User::LeaveIfError( iBody->SavePresetL( radioPreset, aIndex ) ); + } + +// ----------------------------------------------------------------------------- +// CRadioFmPresetUtility::SetPresetPICodeL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::SetPresetPICodeL( TInt aIndex, TUint aPICode ) + { + FUNC_LOG; + TPreset radioPreset; + iBody->ReadPresetL( aIndex, radioPreset ); + radioPreset.SetPiCode( aPICode ); + User::LeaveIfError( iBody->SavePresetL( radioPreset, aIndex ) ); + } +// ----------------------------------------------------------------------------- +// CRadioFmPresetUtility::SetPresetFavouriteInfoL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::SetPresetFavouriteInfoL( TInt aIndex, TBool aFavourite ) + { + FUNC_LOG; + TPreset radioPreset; + iBody->ReadPresetL( aIndex, radioPreset ); + radioPreset.SetFavorite( aFavourite ); + User::LeaveIfError( iBody->SavePresetL( radioPreset, aIndex ) ); + } + +// ----------------------------------------------------------------------------- +// CRadioFmPresetUtility::SetPresetUserRenameInfoL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::SetPresetUserRenameInfoL( TInt aIndex, TBool aRename ) + { + FUNC_LOG; + TPreset radioPreset; + iBody->ReadPresetL( aIndex, radioPreset ); + radioPreset.SetRenamedByUser( aRename ); + User::LeaveIfError( iBody->SavePresetL( radioPreset, aIndex ) ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::GetPresetL( TInt aIndex, TFmPresetName& aName, TInt& aFrequency ) + { + FUNC_LOG; + TPreset preset; + iBody->ReadPresetL( aIndex, preset ); + aName.Copy( preset.Name() ); + aFrequency = preset.Frequency(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::GetPresetNameL( TInt aIndex, TFmPresetName& aName) + { + FUNC_LOG; + TInt unused; + GetPresetL( aIndex, aName, unused ); + } + +// ----------------------------------------------------------------------------- +// CRadioFmPresetUtility::GetPresetUrlL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::GetPresetUrlL( TInt aIndex, TFmPresetUrl& aUrl) + { + FUNC_LOG; + TPreset radioPreset; + iBody->ReadPresetL( aIndex, radioPreset); + aUrl.Copy( radioPreset.Url() ); + } + +// ----------------------------------------------------------------------------- +// CRadioFmPresetUtility::GetPresetPtyL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::GetPresetPtyL( TInt aIndex, TUint& aPty) + { + FUNC_LOG; + TPreset radioPreset; + iBody->ReadPresetL( aIndex, radioPreset); + aPty = radioPreset.Genre(); + } + +// ----------------------------------------------------------------------------- +// CRadioFmPresetUtility::GetPresetPICodeL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::GetPresetPICodeL( TInt aIndex, TUint& aPICode) + { + FUNC_LOG; + TPreset radioPreset; + iBody->ReadPresetL( aIndex, radioPreset); + aPICode = radioPreset.PiCode(); + } + + +// ----------------------------------------------------------------------------- +// CRadioFmPresetUtility::GetPresetFavouriteInfoL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::GetPresetFavouriteInfoL( TInt aIndex, TBool& aFavourite) + { + FUNC_LOG; + TPreset radioPreset; + iBody->ReadPresetL( aIndex, radioPreset); + aFavourite = radioPreset.Favorite(); + } + +// ----------------------------------------------------------------------------- +// CRadioFmPresetUtility::GetPresetUserRenameInfoL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::GetPresetUserRenameInfoL( TInt aIndex, TBool& aRename) + { + FUNC_LOG; + TPreset preset; + iBody->ReadPresetL( aIndex, preset); + aRename = preset.RenamedByUser(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::GetPresetFrequencyL( TInt aIndex, TInt& aFrequency) + { + FUNC_LOG; + TPreset preset; + iBody->ReadPresetL( aIndex, preset ); + aFrequency = preset.Frequency(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRadioFmPresetUtility::GetMaxNumberOfPresets( TInt& aMaxNumOfPresets ) const + { + FUNC_LOG; + aMaxNumOfPresets = iBody->MaxNumberOfPresets(); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRadioFmPresetUtility::GetNumberOfPresets( TInt& aNumOfPresets ) const + { + FUNC_LOG; + aNumOfPresets = iBody->PresetCount(); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::GetFirstPresetL( TInt& aIndex) const + { + FUNC_LOG; + aIndex = iBody->FirstPreset(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::GetNextPresetL( TInt aIndex, TInt& aNextIndex ) const + { + FUNC_LOG; + aNextIndex = iBody->NextPreset( aIndex ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CRadioFmPresetUtility::DeletePresetL( TInt aIndex ) + { + FUNC_LOG; + User::LeaveIfError( iBody->DeletePreset( aIndex ) ); + } + +// ----------------------------------------------------------------------------- +// CRadioFmPresetUtility::PresetChanged() +// Returns: None +// ----------------------------------------------------------------------------- +void CRadioFmPresetUtility::PresetChanged( TPresetChangeEvent aChange, TInt aIndex ) + { + FUNC_LOG; + iObserver.MrpeoPresetChanged( (MRadioPresetObserver::TPresetChangeEvent)aChange, aIndex ); + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/src/preset.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/src/preset.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,268 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + + +// INCLUDES +#include // RWriteStream, RReadStream + +#include +#include "trace.h" + +/** + * On/Off type flags + * + * Bit shifting in the value initialization is used to easily create + * progressing bit patterns like so: + * 1 << 0 equals 0001 equals 0x1 + * 1 << 1 equals 0010 equals 0x2 + * 1 << 2 equals 0100 equals 0x4 + * 1 << 3 equals 1000 equals 0x8 + */ +enum TFlagValues + { + EFavorite = 1 << 0 + ,ELocalStation = 1 << 1 + ,ERenamedByUser = 1 << 2 + }; + +// ============== LOCAL FUNCTIONS =============== + +/** + * Normalize return value from TBitFlags to ETrue or EFalse values + * Two negations: 16 => 0 => 1 + */ +static TBool NormalizeBool( TBool aBool ) + { + return !( !aBool ); + } + +const TUint8 KNbrOfMyExternalizedUint32Items = 3; + +// ============= MEMBER FUNCTIONS ============== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TPreset::TPreset() + : iPresetFrequency( 0 ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// Returns the channel frequency +// --------------------------------------------------------------------------- +// +EXPORT_C TUint TPreset::Frequency() const + { + FUNC_LOG; + return iPresetFrequency; + } + +// --------------------------------------------------------------------------- +// Returns the channel name +// --------------------------------------------------------------------------- +// +EXPORT_C TPtrC TPreset::Name() const + { + FUNC_LOG; + return TPtrC( iPresetName ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TPtrC TPreset::Url() const + { + FUNC_LOG; + return TPtrC( iUrl ); + } + + +// --------------------------------------------------------------------------- +// Sets the channel name +// --------------------------------------------------------------------------- +// +EXPORT_C void TPreset::SetName( const TPresetName& aStationName ) + { + FUNC_LOG; + iPresetName = aStationName; + } + +// --------------------------------------------------------------------------- +// Sets the channel frequency +// --------------------------------------------------------------------------- +// +EXPORT_C void TPreset::SetFrequency( const TUint aFrequency ) + { + FUNC_LOG; + iPresetFrequency = aFrequency; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void TPreset::SetUrl( const TRadioUrl& aUrl ) + { + FUNC_LOG; + iUrl = aUrl; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void TPreset::SetFavorite( TBool aFavorite ) + { + FUNC_LOG; + iFlags.Assign( EFavorite, aFavorite ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool TPreset::Favorite() const + { + FUNC_LOG; + // Normalize return value from TBitFlags to 1 or 0 just in case + // Two negations: 16 => 0 => 1 + return NormalizeBool( iFlags.IsSet( EFavorite ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void TPreset::SetLocalStation( TBool aLocalStation ) + { + FUNC_LOG; + iFlags.Assign( ELocalStation, aLocalStation ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool TPreset::LocalStation() const + { + FUNC_LOG; + // Normalize return value from TBitFlags to 1 or 0 just in case + // Two negations: 16 => 0 => 1 + return NormalizeBool( iFlags.IsSet( ELocalStation ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void TPreset::SetRenamedByUser( TBool aRenamed ) + { + FUNC_LOG; + iFlags.Assign( ERenamedByUser, aRenamed ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool TPreset::RenamedByUser() const + { + FUNC_LOG; + // Normalize return value from TBitFlags to 1 or 0 just in case + // Two negations: 16 => 0 => 1 + return NormalizeBool( iFlags.IsSet( ERenamedByUser ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void TPreset::SetGenre( TInt aGenre ) + { + FUNC_LOG; + iGenre = aGenre; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt TPreset::Genre() const + { + FUNC_LOG; + return iGenre; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void TPreset::SetPiCode( TInt aPiCode ) + { + FUNC_LOG; + iPiCode = aPiCode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt TPreset::PiCode() const + { + FUNC_LOG; + return iPiCode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TUint TPreset::MyExternalizedDataSize() const + { + FUNC_LOG; + return ( KNbrOfMyExternalizedUint32Items * sizeof(TUint32) ); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void TPreset::ExternalizeL( RWriteStream& aStream ) const + { + FUNC_LOG; + aStream.WriteUint32L( iGenre ); + aStream.WriteUint32L( iPiCode ); + aStream.WriteUint32L( iFlags.Value() ); + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void TPreset::InternalizeL( RReadStream& aStream ) + { + FUNC_LOG; + iGenre = aStream.ReadUint32L(); + iPiCode = aStream.ReadUint32L(); + iFlags = TBitFlags( aStream.ReadUint32L() ); + + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/src/presetutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/src/presetutility.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + +#include +#include "presetutilitybody.h" +#include "trace.h" + +// ============= MEMBER FUNCTIONS ============== + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CPresetUtility* CPresetUtility::NewL() + { + FUNC_LOG; + return CPresetUtilityBody::NewL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CPresetUtility::~CPresetUtility() + { + FUNC_LOG; + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/src/presetutilitybody.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/src/presetutilitybody.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + +#include "presetutilitybody.h" +#include "cenrephandler.h" +#include "presetcrkeys.h" +#include +#include "trace.h" + + +// ============= MEMBER FUNCTIONS ============== + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CPresetUtilityBody* CPresetUtilityBody::NewL() + { + FUNC_LOG; + CPresetUtilityBody* self = new (ELeave) CPresetUtilityBody(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CPresetUtilityBody::CPresetUtilityBody() + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CPresetUtilityBody::~CPresetUtilityBody() + { + FUNC_LOG; + delete iCenrepHandler; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CPresetUtilityBody::ConstructL() + { + FUNC_LOG; + iCenrepHandler = CCenrepHandler::NewL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CPresetUtilityBody::SetObserver( MPresetUtilityObserver* aObserver ) + { + FUNC_LOG; + iObserver = aObserver; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CPresetUtilityBody::MaxNumberOfPresets() const + { + FUNC_LOG; + return iCenrepHandler->MaxPresetCount(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CPresetUtilityBody::PresetCount() const + { + FUNC_LOG; + return iCenrepHandler->PresetCount(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CPresetUtilityBody::FirstPreset() const + { + FUNC_LOG; + return iCenrepHandler->FirstPreset(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CPresetUtilityBody::NextPreset( TInt aFromIndex ) const + { + return iCenrepHandler->NextPreset( aFromIndex ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CPresetUtilityBody::DeletePreset( TInt aIndex ) + { + FUNC_LOG; + TInt err( iCenrepHandler->DeletePreset( aIndex ) ); + if ( iObserver ) + { + iObserver->PresetChanged( MPresetUtilityObserver::EPresetDeleted, aIndex ); + } + return err; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CPresetUtilityBody::SavePresetL( const TPreset& aPreset, TInt aIndex ) + { + FUNC_LOG; + TInt usedIndex = iCenrepHandler->SavePresetL( aPreset, aIndex ); + if ( iObserver ) + { + iObserver->PresetChanged( MPresetUtilityObserver::EPresetAdded, aIndex ); + } + return usedIndex; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CPresetUtilityBody::ReadPresetL( TInt aIndex, TPreset& aPreset ) + { + FUNC_LOG; + iCenrepHandler->ReadPresetL( aIndex, aPreset ); + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/Bmarm/PresetUtilityTestModuleU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/Bmarm/PresetUtilityTestModuleU.DEF Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) + diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/Bwins/PresetUtilityTestModuleU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/Bwins/PresetUtilityTestModuleU.DEF Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) + diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/EABI/PresetUtilityTestModuleU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/EABI/PresetUtilityTestModuleU.def Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/cenrep/10207B87.txt Binary file mmserv/radioutility/presetutility/tsrc/cenrep/10207B87.txt has changed diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/cenrep/presetutility.confml Binary file mmserv/radioutility/presetutility/tsrc/cenrep/presetutility.confml has changed diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/cenrep/presetutility_10207B87.crml Binary file mmserv/radioutility/presetutility/tsrc/cenrep/presetutility_10207B87.crml has changed diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/conf/10207B87.txt Binary file mmserv/radioutility/presetutility/tsrc/conf/10207B87.txt has changed diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/conf/PresetUtilityTestModule.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/conf/PresetUtilityTestModule.cfg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,698 @@ +[Define] +ChannelNameNull "EMPTYSTRING" +ChannelFrequencyNull 0 +ChannelUrlNull "EMPTYSTRING" +ChannelName0 "Radio Pop" +ChannelFrequency0 104000000 +ChannelUrl0 "www.radiopop.fi" +ChannelName1 "Radio Soul" +ChannelFrequency1 97500000 +ChannelUrl1 "www.radiosoul.fi" +ChannelName2 "Radio Rock" +ChannelFrequency2 91300000 +ChannelUrl2 "www.radiorock.fi" +ChannelName3 "Radio Humppa" +ChannelFrequency3 11300000 +ChannelUrl3 "www.radiohumppa.fi" +KErrNotFound -1 +KErrGeneral -2 +KErrArgument -6 +KErrDiskFull -26 +KErrBadTestParameter -1000 +KErrEventPending -2000 +KErrCallbackErrorCode -2001 +KErrUnexpectedValue -2002 +KExpectedFrequencyChange -2003 +KErrTimeoutController -2007 +[Enddefine] + +[Test] +title Example +create PresetUtilityTestModule PresetUtility +PresetUtility Example pa ra me ters +delete PresetUtility +[Endtest] + +// Preset Utility API functions' tests + +[Test] +title 1.1 Create PresetUtility +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.1a OOM for creation of PresetUtility +create PresetUtilityTestModule PresetUtility +oomignorefailure ON +loop 9 +oomheapfailnext LOOP_COUNTER +PresetUtility CreatePresetUtility Preset +print LOOP_COUNTER +endloop +oomignorefailure OFF +oomheaptonormal +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.2 Get current and max number of preset channels +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +PresetUtility PresetCount 2 +allownextresult 100 +PresetUtility MaxNumberOfPresets +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.3 Get preset channels 1 and 2 +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +PresetUtility ReadPresetL 0 ChannelName0 ChannelFrequency0 ChannelUrl0 +PresetUtility ReadPresetL 1 ChannelName1 ChannelFrequency1 ChannelUrl1 +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.4 Get first preset channels +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +PresetUtility FirstPreset 0 +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.5 Get next preset channels +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +PresetUtility NextPreset 0 1 +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.5a Set and delete preset channels x +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +allownextresult 2 +PresetUtility SavePresetL -1 ChannelName2 ChannelFrequency2 ChannelUrl2 +PresetUtility DeletePreset 2 +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.5b Read unexisting preset channels x +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +allowerrorcodes KErrArgument +PresetUtility ReadPresetL 101 ChannelName2 ChannelFrequency2 ChannelUrl2 +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.6 Save, Get and Delete preset channels 2 and 3 +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +allownextresult 2 +PresetUtility SavePresetL 2 ChannelName2 ChannelFrequency2 ChannelUrl2 +allownextresult 3 +PresetUtility SavePresetL 3 ChannelName3 ChannelFrequency3 ChannelUrl3 +PresetUtility ReadPresetL 2 ChannelName2 ChannelFrequency2 ChannelUrl2 +PresetUtility ReadPresetL 3 ChannelName3 ChannelFrequency3 ChannelUrl3 +PresetUtility DeletePreset 2 +PresetUtility DeletePreset 3 +PresetUtility ReadPresetL 0 ChannelName0 ChannelFrequency0 ChannelUrl0 +PresetUtility ReadPresetL 1 ChannelName1 ChannelFrequency1 ChannelUrl1 +allowerrorcodes KErrUnexpectedValue KErrNotFound +PresetUtility ReadPresetL 2 ChannelName2 ChannelFrequency2 ChannelUrl2 +allowerrorcodes KErrUnexpectedValue KErrNotFound +PresetUtility ReadPresetL 3 ChannelName3 ChannelFrequency3 ChannelUrl3 +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.7 Save preset channels 3 and 4, delete all +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +allownextresult 2 +PresetUtility SavePresetL 2 ChannelName2 ChannelFrequency2 ChannelUrl2 +allownextresult 3 +PresetUtility SavePresetL 3 ChannelName3 ChannelFrequency3 ChannelUrl3 +PresetUtility ReadPresetL 2 ChannelName2 ChannelFrequency2 ChannelUrl2 +PresetUtility ReadPresetL 3 ChannelName3 ChannelFrequency3 ChannelUrl3 +PresetUtility DeletePreset -1 +allowerrorcodes KErrUnexpectedValue KErrNotFound +PresetUtility ReadPresetL 0 ChannelName0 ChannelFrequency0 ChannelUrl0 +allowerrorcodes KErrUnexpectedValue KErrNotFound +PresetUtility ReadPresetL 1 ChannelName1 ChannelFrequency1 ChannelUrl1 +allowerrorcodes KErrUnexpectedValue KErrNotFound +PresetUtility ReadPresetL 2 ChannelName2 ChannelFrequency2 ChannelUrl2 +allowerrorcodes KErrUnexpectedValue KErrNotFound +PresetUtility ReadPresetL 3 ChannelName3 ChannelFrequency3 ChannelUrl3 +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.7a Try to delete unexisting channel +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +allowerrorcodes KErrArgument +PresetUtility DeletePreset 3 +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.8 Try to read from an unexisting and also from an illegal preset index. +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +allowerrorcodes KErrNotFound +PresetUtility ReadPresetL 44 ChannelNameNull ChannelFrequencyNull ChannelUrlNull +allowerrorcodes KErrArgument +PresetUtility ReadPresetL 100 ChannelNameNull ChannelFrequencyNull ChannelUrlNull +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.9 OOM test for SavePresetL. +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +oomignorefailure ON +loop 7 +oomheapfailnext LOOP_COUNTER +PresetUtility SavePresetL 3 ChannelName3 ChannelFrequency3 ChannelUrl3 +print LOOP_COUNTER +endloop +oomignorefailure OFF +oomheaptonormal +PresetUtility DeletePreset 3 +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.10 OOM test for ReadPresetL. +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +allownextresult 3 +PresetUtility SavePresetL 3 ChannelName3 ChannelFrequency3 ChannelUrl3 +oomignorefailure ON +loop 6 +oomheapfailnext LOOP_COUNTER +PresetUtility ReadPresetL 3 ChannelName3 ChannelFrequency3 ChannelUrl3 +print LOOP_COUNTER +endloop +oomignorefailure OFF +oomheaptonormal +PresetUtility DeletePreset 3 +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.11 OOM test for DeletePreset. +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +allownextresult 3 +PresetUtility SavePresetL 3 ChannelName3 ChannelFrequency3 ChannelUrl3 +oomignorefailure ON +loop 2 +oomheapfailnext LOOP_COUNTER +PresetUtility DeletePreset -1 +print LOOP_COUNTER +endloop +oomignorefailure OFF +oomheaptonormal +PresetUtility DeletePreset -1 +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + +[Test] +title 1.12 Add maximum number of presets +create PresetUtilityTestModule PresetUtility +PresetUtility CreatePresetUtility Preset +PresetUtility DeletePreset -1 +loop 10 +print LOOP_COUNTER +allownextresult 1 2 3 4 5 6 7 8 9 0 +PresetUtility SavePresetL -1 ChannelName1 ChannelFrequency1 +endloop +loop 10 +print LOOP_COUNTER +allownextresult 11 12 13 14 15 16 17 18 19 10 +PresetUtility SavePresetL -1 ChannelName1 ChannelFrequency1 +endloop +loop 10 +print LOOP_COUNTER +allownextresult 21 22 23 24 25 26 27 28 29 20 +PresetUtility SavePresetL -1 ChannelName1 ChannelFrequency1 +endloop +loop 10 +print LOOP_COUNTER +allownextresult 31 32 33 34 35 36 37 38 39 30 +PresetUtility SavePresetL -1 ChannelName1 ChannelFrequency1 +endloop +loop 10 +print LOOP_COUNTER +allownextresult 41 42 43 44 45 46 47 48 49 40 +PresetUtility SavePresetL -1 ChannelName1 ChannelFrequency1 +endloop +loop 10 +print LOOP_COUNTER +allownextresult 51 52 53 54 55 56 57 58 59 50 +PresetUtility SavePresetL -1 ChannelName1 ChannelFrequency1 +endloop +loop 10 +print LOOP_COUNTER +allownextresult 61 62 63 64 65 66 67 68 69 60 +PresetUtility SavePresetL -1 ChannelName1 ChannelFrequency1 +endloop +loop 10 +print LOOP_COUNTER +allownextresult 71 72 73 74 75 76 77 78 79 70 +PresetUtility SavePresetL -1 ChannelName1 ChannelFrequency1 +endloop +loop 10 +print LOOP_COUNTER +allownextresult 81 82 83 84 85 86 87 88 89 80 +PresetUtility SavePresetL -1 ChannelName1 ChannelFrequency1 +endloop +loop 10 +print LOOP_COUNTER +allownextresult 91 92 93 94 95 96 97 98 99 90 +PresetUtility SavePresetL -1 ChannelName1 ChannelFrequency1 +endloop +allowerrorcodes KErrArgument KErrDiskFull +PresetUtility SavePresetL 100 ChannelName2 ChannelFrequency2 +oomignorefailure ON +loop 3 +oomheapfailnext LOOP_COUNTER +allowerrorcodes KErrArgument KErrDiskFull +PresetUtility SavePresetL -1 ChannelName1 ChannelFrequency1 +PresetUtility DeletePreset 50 +print LOOP_COUNTER +endloop +oomignorefailure OFF +oomheaptonormal +oomignorefailure ON +loop 3 +oomheapfailnext LOOP_COUNTER +PresetUtility DeletePreset -1 +print LOOP_COUNTER +endloop +oomignorefailure OFF +oomheaptonormal +PresetUtility DeletePreset -1 +PresetUtility DestroyPresetUtility +delete PresetUtility +[Endtest] + + +// TRadioPreset class tests 2.1 --> + +[Test] +title 2.1 TRadioPreset, Set and Get PI code +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateRadioPresetL +FmPresetUtility SetPiCode 7 +FmPresetUtility PiCode 7 +FmPresetUtility SetPiCode 0 +FmPresetUtility PiCode 0 +FmPresetUtility DestroyRadioPreset +delete FmPresetUtility +[Endtest] + +[Test] +title 2.2 TRadioPreset, Set and Get PTY +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateRadioPresetL +FmPresetUtility SetGenre 7 +FmPresetUtility Genre 7 +FmPresetUtility SetGenre 0 +FmPresetUtility Genre 0 +FmPresetUtility DestroyRadioPreset +delete FmPresetUtility +[Endtest] + +[Test] +title 2.3 TRadioPreset, Set and Get favourite status +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateRadioPresetL +FmPresetUtility SetFavorite 1 +FmPresetUtility Favorite 1 +FmPresetUtility SetFavorite 0 +FmPresetUtility Favorite 0 +FmPresetUtility SetFavorite 1100 +FmPresetUtility Favorite 1 +FmPresetUtility DestroyRadioPreset +delete FmPresetUtility +[Endtest] + +[Test] +title 2.4 TRadioPreset, Set and Get the local station information. +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateRadioPresetL +FmPresetUtility SetLocalStation 1 +FmPresetUtility LocalStation 1 +FmPresetUtility SetLocalStation 5612 +FmPresetUtility LocalStation 1 +FmPresetUtility SetLocalStation 0 +FmPresetUtility LocalStation 0 +FmPresetUtility DestroyRadioPreset +delete FmPresetUtility +[Endtest] + +[Test] +title 2.5 TRadioPreset, Set and Get the user rename information. +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateRadioPresetL +FmPresetUtility SetRenamedByUser 1 +FmPresetUtility RenamedByUser 1 +FmPresetUtility SetRenamedByUser 1100 +FmPresetUtility RenamedByUser 1 +FmPresetUtility SetRenamedByUser 0 +FmPresetUtility RenamedByUser 0 +FmPresetUtility DestroyRadioPreset +delete FmPresetUtility +[Endtest] + +// Deprecating Fm Preset Utility API functions' tests + +[Test] +title 3.1 Create FmPresetUtility +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility DeletePresetL -1 +FmPresetUtility GetNumberOfPresets 0 +FmPresetUtility SetPresetL 0 ChannelName0 ChannelFrequency0 +FmPresetUtility SetPresetL 1 ChannelName1 ChannelFrequency1 +FmPresetUtility SetPresetUrlL 0 ChannelUrl0 +FmPresetUtility SetPresetUrlL 1 ChannelUrl1 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.2 Get current and max number of presets +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility GetNumberOfPresets 2 +allownextresult 100 +FmPresetUtility GetMaxNumberOfPresets +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.3 Get presets 0 an 1 +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility GetPresetL 0 ChannelName0 ChannelFrequency0 +FmPresetUtility GetPresetL 1 ChannelName1 ChannelFrequency1 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.4 Get first preset +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility GetFirstPresetL 0 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.5 Get next preset +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility GetNextPresetL 0 1 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.6 Set and delete preset x +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +allowerrorcodes KErrArgument +FmPresetUtility SetPresetL -1 ChannelName2 ChannelFrequency2 +allowerrorcodes KErrArgument +FmPresetUtility DeletePresetL 2 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.7 Read unexisting preset x +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +allowerrorcodes KErrArgument KErrNotFound +FmPresetUtility GetPresetL 100 ChannelName2 ChannelFrequency2 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.8 Save, Get and Delete presets 2 and 3 +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility SetPresetL 2 ChannelName2 ChannelFrequency2 +FmPresetUtility SetPresetL 3 ChannelName3 ChannelFrequency3 +FmPresetUtility GetPresetL 2 ChannelName2 ChannelFrequency2 +FmPresetUtility GetPresetL 3 ChannelName3 ChannelFrequency3 +FmPresetUtility DeletePresetL 2 +FmPresetUtility DeletePresetL 3 +FmPresetUtility GetPresetL 0 ChannelName0 ChannelFrequency0 +FmPresetUtility GetPresetL 1 ChannelName1 ChannelFrequency1 +allowerrorcodes KErrUnexpectedValue KErrNotFound +FmPresetUtility GetPresetL 2 ChannelName2 ChannelFrequency2 +allowerrorcodes KErrUnexpectedValue KErrNotFound +FmPresetUtility GetPresetL 3 ChannelName3 ChannelFrequency3 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.9 Save presets 2 and 3, delete all +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility SetPresetL 2 ChannelName2 ChannelFrequency2 +FmPresetUtility SetPresetL 3 ChannelName3 ChannelFrequency3 +FmPresetUtility GetPresetL 2 ChannelName2 ChannelFrequency2 +FmPresetUtility GetPresetL 3 ChannelName3 ChannelFrequency3 +FmPresetUtility DeletePresetL -1 +allowerrorcodes KErrUnexpectedValue KErrNotFound +FmPresetUtility GetPresetL 0 ChannelName0 ChannelFrequency0 +allowerrorcodes KErrUnexpectedValue KErrNotFound +FmPresetUtility GetPresetL 1 ChannelName1 ChannelFrequency1 +allowerrorcodes KErrUnexpectedValue KErrNotFound +FmPresetUtility GetPresetL 2 ChannelName2 ChannelFrequency2 +allowerrorcodes KErrUnexpectedValue KErrNotFound +FmPresetUtility GetPresetL 3 ChannelName3 ChannelFrequency3 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.10 Try to delete unexisting preset +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +allowerrorcodes KErrArgument +FmPresetUtility DeletePresetL 3 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.11 Set and Get PI code +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility SetPresetL 2 ChannelName2 ChannelFrequency2 +FmPresetUtility SetPresetPICodeL 2 7 +FmPresetUtility GetPresetPICodeL 2 7 +FmPresetUtility SetPresetPICodeL 2 0 +FmPresetUtility GetPresetPICodeL 2 0 +FmPresetUtility DeletePresetL 2 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.12 Set and Get favourite status +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility SetPresetL 2 ChannelName2 ChannelFrequency2 +FmPresetUtility SetPresetFavouriteInfoL 2 1 +FmPresetUtility GetPresetFavouriteInfoL 2 1 +FmPresetUtility SetPresetFavouriteInfoL 2 0 +FmPresetUtility GetPresetFavouriteInfoL 2 0 +FmPresetUtility DeletePresetL 2 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.12a Set and Get favourite status. Setting with >1 value. +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility SetPresetL 2 ChannelName2 ChannelFrequency2 +FmPresetUtility SetPresetFavouriteInfoL 2 2 +FmPresetUtility GetPresetFavouriteInfoL 2 1 +FmPresetUtility SetPresetFavouriteInfoL 2 1100 +FmPresetUtility GetPresetFavouriteInfoL 2 1 +FmPresetUtility SetPresetFavouriteInfoL 2 0 +FmPresetUtility GetPresetFavouriteInfoL 2 0 +FmPresetUtility DeletePresetL 2 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.12b Try to set and get an unexisting preset with specified favourite. +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +allowerrorcodes KErrNotFound +FmPresetUtility SetPresetFavouriteInfoL 10 1 +allowerrorcodes KErrNotFound +FmPresetUtility GetPresetFavouriteInfoL 11 0 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.13 Set and Get the preset with specified user rename information. +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility SetPresetL 3 ChannelName3 ChannelFrequency3 +FmPresetUtility SetPresetUserRenameInfoL 3 1 +FmPresetUtility GetPresetUserRenameInfoL 3 1 +FmPresetUtility SetPresetUserRenameInfoL 3 0 +FmPresetUtility GetPresetUserRenameInfoL 3 0 +FmPresetUtility DeletePresetL 3 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.13a Set and Get the preset with specified user rename information. Setting with >1 value. +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility SetPresetL 3 ChannelName3 ChannelFrequency3 +FmPresetUtility SetPresetUserRenameInfoL 3 2 +FmPresetUtility GetPresetUserRenameInfoL 3 1 +FmPresetUtility SetPresetUserRenameInfoL 3 15 +FmPresetUtility GetPresetUserRenameInfoL 3 1 +FmPresetUtility SetPresetUserRenameInfoL 3 0 +FmPresetUtility GetPresetUserRenameInfoL 3 0 +FmPresetUtility DeletePresetL 3 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.13b Try to set and get an unexisting preset with specified user rename information. +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +allowerrorcodes KErrNotFound +FmPresetUtility SetPresetUserRenameInfoL 10 1 +allowerrorcodes KErrNotFound +FmPresetUtility GetPresetUserRenameInfoL 11 0 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.14 Set and Get the preset with specified channel PTY (genre). +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility SetPresetL 3 ChannelName3 ChannelFrequency3 +FmPresetUtility SetPresetPtyL 3 8 +FmPresetUtility GetPresetPtyL 3 8 +FmPresetUtility SetPresetPtyL 3 0 +FmPresetUtility GetPresetPtyL 3 0 +FmPresetUtility DeletePresetL 3 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.15 Set and Get preset with specified URL. +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility SetPresetL 3 ChannelName3 ChannelFrequency3 +FmPresetUtility SetPresetUrlL 3 ChannelUrl3 +FmPresetUtility GetPresetUrlL 3 ChannelUrl3 +FmPresetUtility SetPresetUrlL 3 ChannelUrl1 +allowerrorcodes KErrUnexpectedValue +FmPresetUtility GetPresetUrlL 3 ChannelUrl2 +FmPresetUtility GetPresetUrlL 3 ChannelUrl1 +FmPresetUtility DeletePresetL 3 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.16 Set preset x, Set name to empty and frequency to 0, try to get URL, UserRenameInfo and FavouriteInfo. +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +FmPresetUtility SetPresetL 2 ChannelName2 ChannelFrequency2 +FmPresetUtility SetPresetUrlL 2 ChannelUrl2 +FmPresetUtility GetPresetNameL 2 ChannelName2 +FmPresetUtility GetPresetFrequencyL 2 ChannelFrequency2 +FmPresetUtility GetPresetUrlL 2 ChannelUrl2 +FmPresetUtility SetPresetL 1 ChannelName1 ChannelFrequency1 +FmPresetUtility GetPresetUrlL 2 ChannelUrl2 +FmPresetUtility SetPresetL 2 ChannelNameNull ChannelFrequencyNull +FmPresetUtility GetPresetUrlL 2 ChannelUrlNull +FmPresetUtility SetPresetUserRenameInfoL 2 0 +FmPresetUtility GetPresetFavouriteInfoL 2 0 +FmPresetUtility GetPresetNameL 2 ChannelNameNull +FmPresetUtility GetPresetFrequencyL 2 ChannelFrequencyNull +FmPresetUtility DeletePresetL 2 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.17 Try to get a frequency from an unexisting and also from an illegal preset index. +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +allowerrorcodes KErrNotFound +FmPresetUtility GetPresetFrequencyL 44 ChannelFrequencyNull +allowerrorcodes KErrArgument +FmPresetUtility GetPresetFrequencyL 101 ChannelFrequencyNull +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + +[Test] +title 3.18 OOM Set and delete preset +create PresetUtilityTestModule FmPresetUtility +FmPresetUtility CreateFmPresetUtility Preset +oomignorefailure ON +loop 3 +oomheapfailnext LOOP_COUNTER +FmPresetUtility SetPresetL 2 ChannelName2 ChannelFrequency2 +print LOOP_COUNTER +endloop +oomignorefailure OFF +oomheaptonormal +FmPresetUtility DeletePresetL 2 +FmPresetUtility DestroyFmPresetUtility +delete FmPresetUtility +[Endtest] + diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/conf/presetutility.confml Binary file mmserv/radioutility/presetutility/tsrc/conf/presetutility.confml has changed diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/conf/presetutility_10207B87.crml Binary file mmserv/radioutility/presetutility/tsrc/conf/presetutility_10207B87.crml has changed diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/group/Bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/group/Bld.inf Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include + + +PRJ_PLATFORMS +// specify the platforms your component needs to be built for here +// defaults to WINS MARM so you can ignore this if you just build these + + DEFAULT + +PRJ_TESTEXPORTS +// NOTE: If using ARS requirements all export operations should be done under this. +// 'abld test export' + +PRJ_EXPORTS +// Specify the source file followed by its destination here +// copy will be used to copy the source file to its destination +// If there's no destination then the source file will be copied +// to the same name in /epoc32/include +// Example: +/* +/agnmodel/inc/AGMCOMON.H +*/ + +PRJ_TESTMMPFILES + + PresetUtilityTestModule.mmp + +PRJ_MMPFILES + + PresetUtilityTestModule_nrm.mmp + +// Specify the .mmp files required for building the important component +// releasables. +// +// Specify "tidy" if the component you need to build doesn't need to be +// released. Specify "ignore" if the MMP file exists but should be +// ignored. +// Example: +/* +/agnmodel/group/agnmodel.mmp +#if defined(MARM) +/agnmodel/group/agsvexe.mmp +#endif +*/ + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/group/PresetUtilityTestModule.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/group/PresetUtilityTestModule.mmp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,78 @@ +/*TYPE TESTCLASS*/ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MMP file for STIF Test Framework's TestScripter +* testclass test module. +* +*/ + +#include + +TARGET PresetUtilityTestModule.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB +/* Remove comments and replace 0x00000000 with correct vendor id */ +// VENDORID 0x00000000 +/* Remove comments and replace 0x00000000 with correct secure id */ +// SECUREID 0x00000000 + +//TARGETPATH ?target_path +DEFFILE PresetUtilityTestModule.def + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE PresetUtilityTestModule.cpp +SOURCE PresetUtilityTestModuleBlocks.cpp + +//RESOURCE resource_file +//RESOURCE resource_file2 + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib +LIBRARY presetutility.lib +LIBRARY fmpresetutility.lib + +LANG SC + +/* +START WINS +?wins_specific_information +END + +START MARM +?marm_specific_information +END +*/ +// Other possible keywords: + +// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) +/* +START BITMAP ?target +TARGETPATH ?emulated_path_on_target_machine +HEADER +SOURCE ?color_depth ?source_bitmap +END +*/ +// DEFFILE ?filename +// AIF ?filename + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/group/PresetUtilityTestModule.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/group/PresetUtilityTestModule.pkg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,60 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; Installation file for STIF +; + +; Languages +&EN + +; Provide value for uid +#{"STIF"},(0x00000000),1,1,0,TYPE=SA + +; Series60 product id for S60 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Logo +; None + +; Package signature - Optional +; None + +; Start of Package body + +; Condition blocks +; None + +; Options list +; None + +; Install files +"\epoc32\release\armv5\udeb\PresetUtilityTestModule.dll" - "!:\Sys\Bin\PresetUtilityTestModule.dll" + +; Embedded SIS +; None + +; End of Package body + +; PKG dependencies +; None + +; PKG capabilities +; None diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/group/PresetUtilityTestModule_DoxyFile.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/group/PresetUtilityTestModule_DoxyFile.txt Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,239 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +# + +# Doxyfile 1.4.1 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = PresetUtilityTestModule +PROJECT_NUMBER = +OUTPUT_DIRECTORY = C:\Symbian\Carbide\workspace\PresetUtilityTestModule\ +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = YES +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = NO +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = YES +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = NO +GENERATE_BUGLIST = NO +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = C:\Symbian\Carbide\workspace\PresetUtilityTestModule\ +FILE_PATTERNS = *.h \ + *.rh \ + *.hrh +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = NO +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = YES +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = YES +TOC_EXPAND = YES +DISABLE_INDEX = YES +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = YES +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = YES +RTF_OUTPUT = Doc +COMPACT_RTF = YES +RTF_HYPERLINKS = YES +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = NONSHARABLE_CLASS +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/group/PresetUtilityTestModule_nrm.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/group/PresetUtilityTestModule_nrm.mmp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,78 @@ +/*TYPE TESTCLASS*/ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MMP file for STIF Test Framework's TestScripter +* testclass test module. +* +*/ + +#include + +TARGET PresetUtilityTestModule.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB +/* Remove comments and replace 0x00000000 with correct vendor id */ +// VENDORID 0x00000000 +/* Remove comments and replace 0x00000000 with correct secure id */ +// SECUREID 0x00000000 + +//TARGETPATH ?target_path +DEFFILE PresetUtilityTestModule.def + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE PresetUtilityTestModule.cpp +SOURCE PresetUtilityTestModuleBlocks.cpp + +//RESOURCE resource_file +//RESOURCE resource_file2 + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib +LIBRARY presetutility.lib +LIBRARY fmpresetutility.lib + +LANG SC + +/* +START WINS +?wins_specific_information +END + +START MARM +?marm_specific_information +END +*/ +// Other possible keywords: + +// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) +/* +START BITMAP ?target +TARGETPATH ?emulated_path_on_target_machine +HEADER +SOURCE ?color_depth ?source_bitmap +END +*/ +// DEFFILE ?filename +// AIF ?filename + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/group/RestoreOrigCenrep.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/group/RestoreOrigCenrep.cmd Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,25 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +@echo Original environment restoration by presetutilitytestmodule... +del \epoc32\winscw\c\TestFramework\PresetUtilityTestModule.cfg +del \epoc32\wins\c\TestFramework\TestFramework.ini +del \epoc32\winscw\c\TestFramework\TestFramework.ini +copy ..\cenrep\10207b87.txt \epoc32\data\z\private\10202be9\10207b87.txt +copy ..\cenrep\10207b87.txt \epoc32\RELEASE\winscw\UDEB\Z\private\10202be9\10207b87.txt +copy ..\cenrep\10207b87.txt \epoc32\RELEASE\winscw\UREL\Z\private\10202be9\10207b87.txt +del \epoc32\winscw\c\private\10202BE9\persists\10207b87.cre +@echo Original environment restoration by presetutilitytestmodule... Finished. \ No newline at end of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/group/TestEnvInit.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/group/TestEnvInit.cmd Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,25 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +@echo Initializing test environment for presetutilitytestmodule... +copy ..\conf\PresetUtilityTestModule.cfg \epoc32\winscw\c\TestFramework\PresetUtilityTestModule.cfg +copy ..\init\PresetUtilityTestModule.ini \epoc32\wins\c\TestFramework\TestFramework.ini +copy ..\init\PresetUtilityTestModule.ini \epoc32\winscw\c\TestFramework\TestFramework.ini +copy ..\conf\10207b87.txt \epoc32\data\z\private\10202be9\10207b87.txt +copy ..\conf\10207b87.txt \epoc32\RELEASE\winscw\UDEB\Z\private\10202be9\10207b87.txt +copy ..\conf\10207b87.txt \epoc32\RELEASE\winscw\UREL\Z\private\10202be9\10207b87.txt +del \epoc32\winscw\c\private\10202BE9\persists\10207b87.cre +@echo Test environment initialization for presetutilitytestmodule... Finished. \ No newline at end of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/inc/PresetUtilityTestModule.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/inc/PresetUtilityTestModule.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,284 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: STIF testclass declaration +* +*/ + +#ifndef PRESETUTILITYTESTMODULE_H +#define PRESETUTILITYTESTMODULE_H + +// INCLUDES +#include +#include +#include +#include +//INTERNAL INCLUDES +#include +#include +#include +#include +#include "trace.h" + + +// CONSTANTS +const TInt KErrBadTestParameter= -1000; // Error on configuration file + +const TInt KErrEventPending =-2000; // Timeout and not callback +const TInt KErrCallbackErrorCode = -2001; // Callback return error code +const TInt KErrUnexpectedValue =-2002; // Unexpected value at setting +const TInt KExpectedFrequencyChange = -2003; // Is not finding more than one station +const TInt KErrTimeoutController = -2007; // Unexpected notification + +// MACROS +//#define ?macro ?macro_def +#define TEST_CLASS_VERSION_MAJOR 1 +#define TEST_CLASS_VERSION_MINOR 1 +#define TEST_CLASS_VERSION_BUILD 1 + +// Logging path +_LIT( KPresetUtilityTestModuleLogPath, "\\logs\\testframework\\PresetUtilityTestModule\\" ); +// Log file +_LIT( KPresetUtilityTestModuleLogFile, "PresetUtilityTestModule.txt" ); +_LIT( KPresetUtilityTestModuleLogFileWithTitle, "PresetUtilityTestModule_[%S].txt" ); + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +//class CPresetUtilityTestModule; + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// CLASS DECLARATION + +/** +* CPresetUtilityTestModule test class for STIF Test Framework TestScripter. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CPresetUtilityTestModule) : public CScriptBase, public MRadioPresetObserver, public MPresetUtilityObserver + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CPresetUtilityTestModule* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CPresetUtilityTestModule(); + + public: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + /** + * From MPresetUtilityObserver + * Called when a preset changes. + * + * NOTE: EPresetDeleted with aIndex == 0, indicates that all presets have been deleted. + * + * @since S60 3.2 + * @param aChange Change event type + * @param aIndex Index to the preset that has changed. Zero means all presets. + */ + virtual void PresetChanged( MPresetUtilityObserver::TPresetChangeEvent aChange, TInt aIndex ); + + /** + * From MRadioPresetObserver + * Called when a preset changes. + * + * NOTE: EPresetDeleted with aIndex == 0, indicates that all presets have been deleted. + * + * @since S60 3.2 + * @param aChange Change event type + * @param aIndex Index to the preset that has changed. Zero means all presets. + */ + virtual void MrpeoPresetChanged( MRadioPresetObserver::TPresetChangeEvent aChange, TInt aIndex ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + // Test case functions + TInt CreateRadioPresetL( CStifItemParser& aItem ); + TInt CreatePresetUtilityL( CStifItemParser& aItem ); + TInt CreateFmPresetUtilityL( CStifItemParser& aItem ); + TInt DestroyRadioPresetL( CStifItemParser& aItem ); + TInt DestroyPresetUtilityL( CStifItemParser& aItem ); + TInt DestroyFmPresetUtilityL( CStifItemParser& aItem ); + + TInt SavePresetL( CStifItemParser& aItem ); + + TInt ReadPresetL( CStifItemParser& aItem ); + + TInt MaxNumberOfPresets( CStifItemParser& aItem ); + + TInt PresetCount( CStifItemParser& aItem ); + + TInt FirstPreset( CStifItemParser& aItem ); + + TInt NextPreset( CStifItemParser& aItem ); + + TInt DeletePreset( CStifItemParser& aItem ); + + // Old API + TInt SetPresetL( CStifItemParser& aItem ); + TInt GetPresetL( CStifItemParser& aItem ); + TInt GetPresetNameL( CStifItemParser& aItem ); + TInt GetPresetFrequencyL( CStifItemParser& aItem ); + TInt GetMaxNumberOfPresets( CStifItemParser& aItem ); + TInt GetNumberOfPresets( CStifItemParser& aItem ); + TInt GetFirstPresetL( CStifItemParser& aItem ); + TInt GetNextPresetL( CStifItemParser& aItem ); + TInt DeletePresetL( CStifItemParser& aItem ); + + TInt SetPresetUrlL( CStifItemParser& aItem ); + TInt SetPresetPtyL( CStifItemParser& aItem ); + TInt SetPresetPICodeL( CStifItemParser& aItem ); + TInt SetPresetFavouriteInfoL( CStifItemParser& aItem ); + TInt SetPresetUserRenameInfoL( CStifItemParser& aItem ); + TInt GetPresetUrlL( CStifItemParser& aItem ); + TInt GetPresetPtyL( CStifItemParser& aItem ); + TInt GetPresetPICodeL( CStifItemParser& aItem ); + TInt GetPresetFavouriteInfoL( CStifItemParser& aItem ); + TInt GetPresetUserRenameInfoL( CStifItemParser& aItem ); + + TInt SetFavorite( CStifItemParser& aItem ); + TInt Favorite( CStifItemParser& aItem ); + TInt SetLocalStation( CStifItemParser& aItem ); + TInt LocalStation( CStifItemParser& aItem ); + TInt SetRenamedByUser( CStifItemParser& aItem ); + TInt RenamedByUser( CStifItemParser& aItem ); + TInt SetGenre( CStifItemParser& aItem ); + TInt Genre( CStifItemParser& aItem ); + TInt SetPiCode( CStifItemParser& aItem ); + TInt PiCode( CStifItemParser& aItem ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CPresetUtilityTestModule( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + /** + * Frees all resources allocated from test methods. + * @since ?Series60_version + */ + void Delete(); + + /** + * Test methods are listed below. + */ + + /** + * Example test method. + * @since ?Series60_version + * @param aItem Script line containing parameters. + * @return Symbian OS error code. + */ + virtual TInt ExampleL( CStifItemParser& aItem ); + + /** + * Method used to log version of test class + */ + void SendTestClassVersion(); + + //ADD NEW METHOD DEC HERE + //[TestMethods] - Do not remove + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + + // ?one_line_short_description_of_data + //?data_declaration; + + // Reserved pointer for future extension + //TAny* iReserved; + + /** FM Preset Utility */ + CPresetUtility* iPresetUtility; + + /** Old interface FM Preset Utility */ + CRadioFmPresetUtility* iRadioFmPresetUtility; + + /** Preset class instance */ + TPreset* iPreset; + + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +#endif // PRESETUTILITYTESTMODULE_H + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/init/PresetUtilityTestModule.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/init/PresetUtilityTestModule.ini Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,197 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# +# This is STIFTestFramework initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. +# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation +# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 +# + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= c:\LOGS\TestFramework\ +TestReportFileName= TestReport + +TestReportFormat= TXT # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +DisableMeasurement= stifmeasurementdisablenone # Possible values are: + # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' + # 'stifmeasurementplugin01', 'stifmeasurementplugin02', + # 'stifmeasurementplugin03', 'stifmeasurementplugin04', + # 'stifmeasurementplugin05' or 'stifbappeaprofiler' + +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module +[New_Module] +ModuleName= TestScripter +TestCaseFile= c:\testframework\PresetUtilityTestModule.cfg +[End_Module] + +# Load testmoduleXXX, optionally with initialization file and/or test case files +#[New_Module] +#ModuleName= testmodulexxx + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) +#TestCaseFile= c:\testframework\testcases1.cfg +#TestCaseFile= c:\testframework\testcases2.cfg +#TestCaseFile= c:\testframework\manualtestcases.cfg + +#[End_Module] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIFTestFramework logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\LOGS\Module\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' +#NOTE: TestEngine and TestServer logging settings cannot change here + +#CreateLogDirectories= YES # Possible values: YES or NO + +#EmulatorBasePath= C:\LOGS\TestFramework\ +#EmulatorFormat= HTML # Possible values: TXT or HTML +#EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/src/PresetUtilityTestModule.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/src/PresetUtilityTestModule.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,207 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// INCLUDE FILES +#include +#include +#include "PresetUtilityTestModule.h" +#include "trace.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::CPresetUtilityTestModule +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CPresetUtilityTestModule::CPresetUtilityTestModule( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CPresetUtilityTestModule::ConstructL() + { + FUNC_LOG; + + //Read logger settings to check whether test case name is to be + //appended to log file name. + RSettingServer settingServer; + TInt ret = settingServer.Connect(); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Struct to StifLogger settigs. + TLoggerSettings loggerSettings; + // Parse StifLogger defaults from STIF initialization file. + ret = settingServer.GetLoggerSettings(loggerSettings); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Close Setting server session + settingServer.Close(); + + TFileName logFileName; + + if(loggerSettings.iAddTestCaseTitle) + { + TName title; + TestModuleIf().GetTestCaseTitleL(title); + logFileName.Format(KPresetUtilityTestModuleLogFileWithTitle, &title); + } + else + { + logFileName.Copy(KPresetUtilityTestModuleLogFile); + } + + iLog = CStifLogger::NewL( KPresetUtilityTestModuleLogPath, + logFileName, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + SendTestClassVersion(); + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CPresetUtilityTestModule* CPresetUtilityTestModule::NewL( + CTestModuleIf& aTestModuleIf ) + { + FUNC_LOG; + CPresetUtilityTestModule* self = new (ELeave) CPresetUtilityTestModule( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + + } + +// Destructor +CPresetUtilityTestModule::~CPresetUtilityTestModule() + { + FUNC_LOG; + + // Delete resources allocated from test methods + Delete(); + + // Delete logger + delete iLog; + + } + +//----------------------------------------------------------------------------- +// CPresetUtilityTestModule::SendTestClassVersion +// Method used to send version of test class +//----------------------------------------------------------------------------- +// +void CPresetUtilityTestModule::SendTestClassVersion() + { + FUNC_LOG; + TVersion moduleVersion; + moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; + moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; + moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L("PresetUtilityTestModule.dll"); + + TBool newVersionOfMethod = ETrue; + TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + FUNC_LOG; + + return ( CScriptBase* ) CPresetUtilityTestModule::NewL( aTestModuleIf ); + + } + + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/presetutility/tsrc/src/PresetUtilityTestModuleBlocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/radioutility/presetutility/tsrc/src/PresetUtilityTestModuleBlocks.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,1479 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include "PresetUtilityTestModule.h" +#include + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; +_LIT( KStifScriptEmptyString, "EMPTYSTRING" ); +_LIT( KEmptyString, "" ); + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::Delete +// Delete here all resources allocated and opened from test methods. +// Called from destructor. +// ----------------------------------------------------------------------------- +// +void CPresetUtilityTestModule::Delete() + { + FUNC_LOG; + + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CPresetUtilityTestModule::RunMethodL( + CStifItemParser& aItem ) + { + FUNC_LOG; + + static TStifFunctionInfo const KFunctions[] = + { + // Copy this line for every implemented function. + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + ENTRY( "Example", CPresetUtilityTestModule::ExampleL ), + // [test cases entries] - Do not remove + ENTRY( "CreateRadioPresetL", CPresetUtilityTestModule::CreateRadioPresetL ), + ENTRY( "DestroyRadioPreset", CPresetUtilityTestModule::DestroyRadioPresetL ), + ENTRY( "CreatePresetUtility", CPresetUtilityTestModule::CreatePresetUtilityL ), + ENTRY( "DestroyPresetUtility", CPresetUtilityTestModule::DestroyPresetUtilityL ), + ENTRY( "CreateFmPresetUtility", CPresetUtilityTestModule::CreateFmPresetUtilityL ), + ENTRY( "DestroyFmPresetUtility", CPresetUtilityTestModule::DestroyFmPresetUtilityL ), + ENTRY( "SavePresetL", CPresetUtilityTestModule::SavePresetL ), + ENTRY( "ReadPresetL", CPresetUtilityTestModule::ReadPresetL ), + ENTRY( "MaxNumberOfPresets", CPresetUtilityTestModule::MaxNumberOfPresets ), + ENTRY( "PresetCount", CPresetUtilityTestModule::PresetCount ), + ENTRY( "FirstPreset", CPresetUtilityTestModule::FirstPreset ), + ENTRY( "NextPreset", CPresetUtilityTestModule::NextPreset ), + ENTRY( "DeletePreset", CPresetUtilityTestModule::DeletePreset ), + ENTRY( "SetPresetL", CPresetUtilityTestModule::SetPresetL ), + ENTRY( "GetPresetL", CPresetUtilityTestModule::GetPresetL ), + ENTRY( "GetPresetNameL", CPresetUtilityTestModule::GetPresetNameL ), + ENTRY( "GetPresetFrequencyL", CPresetUtilityTestModule::GetPresetFrequencyL ), + ENTRY( "GetMaxNumberOfPresets", CPresetUtilityTestModule::GetMaxNumberOfPresets ), + ENTRY( "GetNumberOfPresets", CPresetUtilityTestModule::GetNumberOfPresets ), + ENTRY( "GetFirstPresetL", CPresetUtilityTestModule::GetFirstPresetL ), + ENTRY( "GetNextPresetL", CPresetUtilityTestModule::GetNextPresetL ), + ENTRY( "DeletePresetL", CPresetUtilityTestModule::DeletePresetL ), + + ENTRY( "SetPresetUrlL", CPresetUtilityTestModule::SetPresetUrlL ), + ENTRY( "SetPresetPtyL", CPresetUtilityTestModule::SetPresetPtyL ), + ENTRY( "SetPresetPICodeL", CPresetUtilityTestModule::SetPresetPICodeL ), + ENTRY( "SetPresetFavouriteInfoL", CPresetUtilityTestModule::SetPresetFavouriteInfoL ), + ENTRY( "SetPresetUserRenameInfoL", CPresetUtilityTestModule::SetPresetUserRenameInfoL ), + ENTRY( "GetPresetUrlL", CPresetUtilityTestModule::GetPresetUrlL ), + ENTRY( "GetPresetPtyL", CPresetUtilityTestModule::GetPresetPtyL ), + ENTRY( "GetPresetPICodeL", CPresetUtilityTestModule::GetPresetPICodeL ), + ENTRY( "GetPresetFavouriteInfoL", CPresetUtilityTestModule::GetPresetFavouriteInfoL ), + ENTRY( "GetPresetUserRenameInfoL", CPresetUtilityTestModule::GetPresetUserRenameInfoL ), + + ENTRY( "SetFavorite", CPresetUtilityTestModule::SetFavorite ), + ENTRY( "Favorite", CPresetUtilityTestModule::Favorite ), + ENTRY( "SetLocalStation", CPresetUtilityTestModule::SetLocalStation ), + ENTRY( "LocalStation", CPresetUtilityTestModule::LocalStation ), + ENTRY( "SetRenamedByUser", CPresetUtilityTestModule::SetRenamedByUser ), + ENTRY( "RenamedByUser", CPresetUtilityTestModule::RenamedByUser ), + ENTRY( "SetGenre", CPresetUtilityTestModule::SetGenre ), + ENTRY( "Genre", CPresetUtilityTestModule::Genre ), + ENTRY( "SetPiCode", CPresetUtilityTestModule::SetPiCode ), + ENTRY( "PiCode", CPresetUtilityTestModule::PiCode ) + //ADD NEW ENTRY HERE + + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::ExampleL +// Example test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CPresetUtilityTestModule::ExampleL( CStifItemParser& aItem ) + { + FUNC_LOG; + + // Print to UI + _LIT( KPresetUtilityTestModule, "PresetUtilityTestModule" ); + _LIT( KExample, "In Example" ); + TestModuleIf().Printf( 0, KPresetUtilityTestModule, KExample ); + // Print to log file + iLog->Log( KExample ); + + TInt i = 0; + TPtrC string; + _LIT( KParam, "Param[%i]: %S" ); + while ( aItem.GetNextString ( string ) == KErrNone ) + { + TestModuleIf().Printf( i, KPresetUtilityTestModule, + KParam, i, &string ); + i++; + } + + return KErrNone; + + } + +//----------------------------------------------------------------------------- +// CPresetUtilityTest::CreateRadioPresetL +//----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::CreateRadioPresetL( + CStifItemParser& /*aItem*/ ) + { + FUNC_LOG; + + TInt err = KErrNone; + if( !iPreset ) + { + iPreset = new( ELeave ) TPreset; + } + else + { + err = KErrArgument; + } + + return err; + } + +//----------------------------------------------------------------------------- +// CPresetUtilityTest::CreatePresetUtilityL +//----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::CreatePresetUtilityL( + CStifItemParser& /*aItem*/ ) + { + FUNC_LOG; + + TInt err = KErrNone; + if( !iPresetUtility ) + { + iPresetUtility = CPresetUtility::NewL(); + } + else + { + err = KErrArgument; + } + + return err; + } + +//----------------------------------------------------------------------------- +// CPresetUtilityTest::CreatePresetFmUtilityL +//----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::CreateFmPresetUtilityL( + CStifItemParser& /*aItem*/ ) + { + FUNC_LOG; + + TInt err = KErrNone; + if( !iRadioFmPresetUtility ) + { + iRadioFmPresetUtility = CRadioFmPresetUtility::NewL(*this); + } + else + { + err = KErrArgument; + } + + return err; + } + +//----------------------------------------------------------------------------- +// CPresetUtilityTestModule::DestroyRadioPresetL +//----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::DestroyRadioPresetL( + CStifItemParser& /*aItem*/ ) + { + FUNC_LOG; + + delete iPreset; + iPreset = NULL; + + return KErrNone; + } + + + +//----------------------------------------------------------------------------- +// CPresetUtilityTestModule::DestroyPresetUtilityL +//----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::DestroyPresetUtilityL( + CStifItemParser& /*aItem*/ ) + { + FUNC_LOG; + + delete iPresetUtility; + iPresetUtility = NULL; + + return KErrNone; + } + +//----------------------------------------------------------------------------- +// CPresetUtilityTestModule::DestroyFmPresetUtilityL +//----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::DestroyFmPresetUtilityL( + CStifItemParser& /*aItem*/ ) + { + FUNC_LOG; + + delete iRadioFmPresetUtility; + iRadioFmPresetUtility = NULL; + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::SavePresetL() +// Get program status. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::SavePresetL( CStifItemParser& aItem ) +{ + FUNC_LOG; + TInt err=KErrNone; + TInt index; + TPtrC name; + TInt freq; + TPtrC url; + TInt usedIndex( -1 ); + + // read parameters + if ( aItem.GetNextInt(index) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Preset index." ); + } + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + if ( aItem.GetNextString(name) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Preset name." ); + } + aItem.SetParsingType( CStifItemParser::ENormalParsing ); + if ( aItem.GetNextInt(freq) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Preset frequency." ); + } + + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + if ( aItem.GetNextString(url) ) + { + INFO( "Missing Parameter: url." ); + } + aItem.SetParsingType( CStifItemParser::ENormalParsing ); + + TPreset preset; + preset.SetName( name ); + preset.SetFrequency( freq ); + preset.SetUrl( url ); + + TRAP(err, usedIndex = iPresetUtility->SavePresetL(preset, index)); + INFO_4( "SavePreset: Index=%d, Name=%S, Freq=%d, Url=%S", usedIndex, &name, freq, &url ); + if ( KErrNone != err ) + { + INFO_1( "SavePresetL Failed error code=%i", err ); + User::Leave( err ); + } + return usedIndex; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::ReadPresetL() +// Read preset channel. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::ReadPresetL( CStifItemParser& aItem ) +{ + FUNC_LOG; + TInt err = KErrNone; + TInt index; + TPtrC expectedName; + TInt expectedFreq; + TPtrC expectedUrl; + + // read parameters + if ( aItem.GetNextInt(index) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Preset index." ); + } + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + if ( aItem.GetNextString(expectedName) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Expected preset name." ); + } + INFO_1( "ExpectedName=%S.", &expectedName ); + + aItem.SetParsingType( CStifItemParser::ENormalParsing ); + if ( aItem.GetNextInt(expectedFreq) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Expected preset frequency." ); + } + INFO_1( "ExpectedFreq=%d.", expectedFreq); + + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + if ( aItem.GetNextString(expectedUrl) ) + { + INFO( "Missing Parameter: Expected Url." ); + } + aItem.SetParsingType( CStifItemParser::ENormalParsing ); + + TPreset preset; + TRAP(err, iPresetUtility->ReadPresetL(index,preset)); + TPtrC actualName( preset.Name() ); + TPtrC actualUrl( preset.Url() ); + INFO_4( "ReadPreset Index=%d, Name=%S, Freq=%d, Url=%S", index, &expectedName, preset.Frequency(), &expectedUrl ); + if ( !err ) + { + // Verification + if ( preset.Name() != expectedName ) + { + INFO_2( "Failed: name=%S, expectedName=%S.", &actualName, &expectedName ); + err = KErrUnexpectedValue; + } + else if ( preset.Frequency() != expectedFreq ) + { + INFO_2( "Failed: freq=%d, expectedFreq=%d.", preset.Frequency(), expectedFreq); + err = KErrUnexpectedValue; + } + else if ( ( 0 < expectedUrl.Length() ) && ( preset.Url() != expectedUrl ) ) + { + INFO_2( "Failed: Url=%S, expectedUrl=%S.", &actualUrl, &expectedUrl ); + err = KErrUnexpectedValue; + } + } + return err; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::MaxNumberOfPresets() +// Get program status. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::MaxNumberOfPresets( CStifItemParser& /*aItem*/ ) +{ + FUNC_LOG; + TInt maxPreset; + + maxPreset = iPresetUtility->MaxNumberOfPresets(); + INFO_1( "MaxNumberOfPresets: maxPreset=%d", maxPreset); + return maxPreset; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::PresetCount() +// Get program status. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::PresetCount( CStifItemParser& aItem ) +{ + FUNC_LOG; + TInt err=KErrNone; + TInt numPresets; + TInt expectedNumPresets; + + // read parameters + if ( aItem.GetNextInt(expectedNumPresets) ) + { + INFO( "Missing Parameter: Expected number of presets."); + err = KErrBadTestParameter; + } + + numPresets =iPresetUtility->PresetCount(); + INFO_1( "PresetCount: numPresets=%d", numPresets); + // Verification + if ( numPresets != expectedNumPresets ) + { + INFO_2( "Failed: numPresets=%d, expectedNumPresets=%d.", numPresets, expectedNumPresets); + err = KErrUnexpectedValue; + } + return err; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::FirstPreset() +// Get program status. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::FirstPreset( CStifItemParser& aItem ) +{ + FUNC_LOG; + TInt err = KErrNone; + TInt index; + TInt expectedIndex; + + // read parameters + if ( aItem.GetNextInt(expectedIndex) ) + { + INFO( "Missing Parameter: Expected preset index."); + err = KErrBadTestParameter; + } + + index = iPresetUtility->FirstPreset(); + INFO_1( "FirstPreset: index=%d", index); + // Verification + if ( index != expectedIndex ) + { + INFO_2( "Failed: index=%d, expectedIndex=%d.", index, expectedIndex); + err = KErrUnexpectedValue; + } + return err; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::NextPreset() +// Get program status. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::NextPreset( CStifItemParser& aItem ) +{ + FUNC_LOG; + TInt err=KErrNone; + TInt index; + TInt nextIndex; + TInt expectedNextIndex; + + // read parameters + if ( aItem.GetNextInt(index) ) + { + INFO( "Missing Parameter: Current preset index."); + err = KErrBadTestParameter; + } + if ( aItem.GetNextInt(expectedNextIndex) ) + { + INFO( "Missing Parameter: Expected next preset index."); + err = KErrBadTestParameter; + } + + nextIndex = iPresetUtility->NextPreset(index); + INFO_1( "NextPreset: nextIndex=%d", nextIndex); + // Verification + if ( nextIndex != expectedNextIndex ) + { + INFO_2( "Failed: nextIndex=%d, expectedNextIndex=%d.", nextIndex, expectedNextIndex); + err = KErrUnexpectedValue; + } + return err; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::DeletePreset() +// Get program status. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::DeletePreset( CStifItemParser& aItem ) +{ + FUNC_LOG; + TInt err=KErrNone; + TInt index; + + // read parameters + if ( aItem.GetNextInt(index) ) + { + INFO( "Missing Parameter: Preset index to delete."); + err = KErrBadTestParameter; + } + + err = iPresetUtility->DeletePreset(index); + INFO_1( "DeletePreset: index=%d", index); + return err; +} + +// Old preset utility API functions + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::SetPresetL() +// Get program status. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::SetPresetL( CStifItemParser& aItem ) +{ + FUNC_LOG; + TInt err=KErrNone; + TInt index; + TPtrC name; + TInt freq; + + // read parameters + if ( aItem.GetNextInt(index) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Preset index." ); + } + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + if ( aItem.GetNextString(name) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Preset name." ); + } + TPtrC stifScriptEmptyString( KStifScriptEmptyString ); + if ( !stifScriptEmptyString.Compare( name ) ) + { + TPtrC emptyString( KEmptyString ); + name.Set(emptyString); + } + aItem.SetParsingType( CStifItemParser::ENormalParsing ); + if ( aItem.GetNextInt(freq) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Preset frequency." ); + } + + TPresetName presetName( name ); + TRAP(err, iRadioFmPresetUtility->SetPresetL(index, presetName, freq)); + INFO_3("SetPresetL: Index=%d, Name=%S, Freq=%d", index, &name, freq ); + return err; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::GetPresetL() +// Read preset channel. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::GetPresetL( CStifItemParser& aItem ) +{ + FUNC_LOG; + TInt err = KErrNone; + TInt index; + TPtrC expectedName; + TInt expectedFreq; + TPtrC expectedUrl; + + // read parameters + if ( aItem.GetNextInt(index) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Preset index." ); + } + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + if ( aItem.GetNextString(expectedName) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Expected preset name." ); + } + TPtrC stifScriptEmptyString( KStifScriptEmptyString ); + if ( !stifScriptEmptyString.Compare( expectedName ) ) + { + TPtrC emptyString( KEmptyString ); + expectedName.Set(emptyString); + } + INFO_1( "ExpectedName=%S.", &expectedName ); + + aItem.SetParsingType( CStifItemParser::ENormalParsing ); + if ( aItem.GetNextInt(expectedFreq) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Expected preset frequency." ); + } + INFO_1( "ExpectedFreq=%d.", expectedFreq); + + aItem.SetParsingType( CStifItemParser::ENormalParsing ); + + TPresetName presetName; + TInt actualFreq( 0 ); + TRAP(err, iRadioFmPresetUtility->GetPresetL(index, presetName, actualFreq)); + INFO_3( "GetPresetL Index=%d, Name=%S, Freq=%d", index, &presetName, actualFreq ); + if ( !err ) + { + // Verification + if ( presetName != expectedName ) + { + INFO_2( "Failed: name=%S, expectedName=%S.", &presetName, &expectedName ); + err = KErrUnexpectedValue; + } + else if ( actualFreq != expectedFreq ) + { + INFO_2( "Failed: freq=%d, expectedFreq=%d.", actualFreq, expectedFreq); + err = KErrUnexpectedValue; + } + } + return err; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::GetMaxNumberOfPresets() +// Get program status. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::GetMaxNumberOfPresets( CStifItemParser& /*aItem*/ ) +{ + FUNC_LOG; + TInt maxPreset; + + iRadioFmPresetUtility->GetMaxNumberOfPresets( maxPreset ); + INFO_1( "GetMaxNumberOfPresets: maxPreset=%d", maxPreset); + return maxPreset; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::GetNumberOfPresets() +// Get program status. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::GetNumberOfPresets( CStifItemParser& aItem ) +{ + FUNC_LOG; + TInt err=KErrNone; + TInt numPresets; + TInt expectedNumPresets; + + // read parameters + if ( aItem.GetNextInt(expectedNumPresets) ) + { + INFO( "Missing Parameter: Expected number of presets."); + err = KErrBadTestParameter; + } + + err = iRadioFmPresetUtility->GetNumberOfPresets( numPresets ); + INFO_1( "GetNumberOfPresets: numPresets=%d", numPresets); + // Verification + if ( numPresets != expectedNumPresets ) + { + INFO_2( "Failed: numPresets=%d, expectedNumPresets=%d.", numPresets, expectedNumPresets); + err = KErrUnexpectedValue; + } + return err; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::GetFirstPresetL() +// Get program status. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::GetFirstPresetL( CStifItemParser& aItem ) +{ + FUNC_LOG; + TInt err = KErrNone; + TInt index; + TInt expectedIndex; + + // read parameters + if ( aItem.GetNextInt(expectedIndex) ) + { + INFO( "Missing Parameter: Expected preset index."); + err = KErrBadTestParameter; + } + + iRadioFmPresetUtility->GetFirstPresetL( index ); + INFO_1( "GetFirstPresetL: index=%d", index); + // Verification + if ( index != expectedIndex ) + { + INFO_2( "Failed: index=%d, expectedIndex=%d.", index, expectedIndex); + err = KErrUnexpectedValue; + } + return err; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::GetNextPresetL() +// Get program status. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::GetNextPresetL( CStifItemParser& aItem ) +{ + FUNC_LOG; + TInt err=KErrNone; + TInt index; + TInt nextIndex; + TInt expectedNextIndex; + + // read parameters + if ( aItem.GetNextInt(index) ) + { + INFO( "Missing Parameter: Current preset index."); + err = KErrBadTestParameter; + } + if ( aItem.GetNextInt(expectedNextIndex) ) + { + INFO( "Missing Parameter: Expected next preset index."); + err = KErrBadTestParameter; + } + + iRadioFmPresetUtility->GetNextPresetL( index, nextIndex ); + INFO_1( "GetNextPresetL: nextIndex=%d", nextIndex); + // Verification + if ( nextIndex != expectedNextIndex ) + { + INFO_2( "Failed: nextIndex=%d, expectedNextIndex=%d.", nextIndex, expectedNextIndex); + err = KErrUnexpectedValue; + } + return err; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::DeletePresetL() +// Get program status. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::DeletePresetL( CStifItemParser& aItem ) +{ + FUNC_LOG; + TInt err=KErrNone; + TInt index; + + // read parameters + if ( aItem.GetNextInt(index) ) + { + INFO( "Missing Parameter: Preset index to delete."); + err = KErrBadTestParameter; + } + + TRAP( err, iRadioFmPresetUtility->DeletePresetL(index) ); + INFO_1( "DeletePresetL: index=%d", index); + return err; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::GetPresetNameL() +// Read preset channel. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::GetPresetNameL( CStifItemParser& aItem ) +{ + FUNC_LOG; + TInt err = KErrNone; + TInt index; + TPtrC expectedName; + + // read parameters + if ( aItem.GetNextInt(index) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Preset index." ); + } + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + if ( aItem.GetNextString(expectedName) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Expected preset name." ); + } + TPtrC stifScriptEmptyString( KStifScriptEmptyString ); + if ( !stifScriptEmptyString.Compare( expectedName ) ) + { + TPtrC emptyString( KEmptyString ); + expectedName.Set(emptyString); + } + INFO_1( "ExpectedName=%S.", &expectedName ); + + + TFmPresetName presetName; + TRAP(err, iRadioFmPresetUtility->GetPresetNameL(index,presetName)); + INFO_2( "GetPresetNameL Index=%d, Name=%S", index, &presetName ); + if ( !err ) + { + // Verification + if ( presetName != expectedName ) + { + INFO_2( "Failed: name=%S, expectedName=%S.", &presetName, &expectedName ); + err = KErrUnexpectedValue; + } + } + return err; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::GetPresetFrequencyL() +// Read preset channel's frequency value. +// Returns: Errors. +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::GetPresetFrequencyL( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt index; + TInt expectedFreq( 0 ); + TInt freq( 0 ); + TInt err( KErrNone ); + + // read parameters + if ( aItem.GetNextInt(index) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Preset index." ); + } + if ( aItem.GetNextInt(expectedFreq) ) + { + err = KErrBadTestParameter; + ERROR( err, "Missing Parameter: Expected preset frequency." ); + } + iRadioFmPresetUtility->GetPresetFrequencyL( index, freq ); + INFO_1( "GetPresetrequency=%d.", freq ); + if ( freq != expectedFreq ) + { + INFO_2( "Failed: freq=%d, expectedFreq=%d.", freq, expectedFreq); + err = KErrUnexpectedValue; + } + return err; +} + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::PresetChanged() +// Returns: None +// ----------------------------------------------------------------------------- +void CPresetUtilityTestModule::PresetChanged + ( MPresetUtilityObserver::TPresetChangeEvent /*aChange*/, TInt /*aIndex*/ ) + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::MrpeoPresetChanged() +// Returns: None +// ----------------------------------------------------------------------------- +void CPresetUtilityTestModule::MrpeoPresetChanged + ( MRadioPresetObserver::TPresetChangeEvent /*aChange*/, TInt /*aIndex*/ ) + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CFmPresetUtilityTestModule::SetPresetUrlL() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::SetPresetUrlL( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt index; + TPtrC urlName; + + // read parameters + if ( aItem.GetNextInt(index) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: Preset index." ); + } + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + if ( aItem.GetNextString(urlName) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: URL name." ); + } + aItem.SetParsingType( CStifItemParser::ENormalParsing ); + + TFmPresetUrl presetName( urlName ); + TRAP(ret, iRadioFmPresetUtility->SetPresetUrlL(index, urlName )); + INFO_2("SetPresetUrlL: Index=%d, urlName=%S", index, &urlName ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::SetPresetPtyL() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::SetPresetPtyL( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt index( 0 ); + TInt PTYCode( 0 ); + + // read parameters + if ( aItem.GetNextInt(index) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: Preset index." ); + } + if ( !ret && aItem.GetNextInt(PTYCode) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: PTYCode." ); + } + iRadioFmPresetUtility->SetPresetPtyL( index, PTYCode ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::SetPresetPICodeL() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::SetPresetPICodeL( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt index( 0 ); + TInt PICode( 0 ); + + // read parameters + if ( aItem.GetNextInt(index) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: Preset index." ); + } + if ( !ret && aItem.GetNextInt(PICode) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: PICode." ); + } + iRadioFmPresetUtility->SetPresetPICodeL( index, PICode ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::SetPresetFavouriteInfoL() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::SetPresetFavouriteInfoL( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt index( 0 ); + TInt favouriteInt( 0 ); + TBool favouriteStatus( EFalse ); + + // read parameters + if ( aItem.GetNextInt(index) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: Preset index." ); + } + if ( !ret && aItem.GetNextInt(favouriteInt) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: favouriteInt." ); + } + if ( favouriteInt ) + { + favouriteStatus = ETrue; + } + iRadioFmPresetUtility->SetPresetFavouriteInfoL( index, favouriteStatus ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::SetPresetUserRenameInfoL() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::SetPresetUserRenameInfoL( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt index( 0 ); + TInt renameInt( 0 ); + TBool renameStatus( EFalse ); + + // read parameters + if ( aItem.GetNextInt(index) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: Preset index." ); + } + if ( !ret && aItem.GetNextInt(renameInt) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: renameInt." ); + } + if ( renameInt ) + { + renameStatus = ETrue; + } + iRadioFmPresetUtility->SetPresetUserRenameInfoL ( index, renameStatus ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::GetPresetUrlL() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::GetPresetUrlL( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt index; + TPtrC expectedUrlName; + + // read parameters + if ( aItem.GetNextInt(index) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: Preset index." ); + } + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + if ( aItem.GetNextString(expectedUrlName) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: Expected preset name." ); + } + TPtrC stifScriptEmptyString( KStifScriptEmptyString ); + if ( !stifScriptEmptyString.Compare( expectedUrlName ) ) + { + TPtrC emptyString( KEmptyString ); + expectedUrlName.Set(emptyString); + } + INFO_1( "ExpectedUrlName=%S.", &expectedUrlName ); + + TFmPresetUrl urlName; + TRAP(ret, iRadioFmPresetUtility->GetPresetUrlL(index,urlName)); + INFO_2( "GetPresetUrlL Index=%d, urlName=%S", index, &urlName ); + if ( !ret ) + { + // Verification + if ( urlName != expectedUrlName ) + { + INFO_2( "Failed: urlName=%S, expectedUrlName=%S.", &urlName, &expectedUrlName ); + ret = KErrUnexpectedValue; + } + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::GetPresetPtyL() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::GetPresetPtyL( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt index( 0 ); + TUint expectedPTYCode( 0 ); + TUint PTYCode( 0 ); + + // read parameters + if ( aItem.GetNextInt(index) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: Preset index." ); + } + if ( !ret && aItem.GetNextInt(expectedPTYCode) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: expectedPTYCode." ); + } + if ( !ret ) + { + INFO_1( "GetPresetPTYCodeL=%d.", expectedPTYCode ); + TRAP( ret, iRadioFmPresetUtility->GetPresetPtyL( index, PTYCode ) ); + if ( PTYCode != expectedPTYCode ) + { + INFO_2( "Failed: PTYCode=%d, expectedPTYCode=%d.", PTYCode, expectedPTYCode ); + ret = KErrUnexpectedValue; + } + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::GetPresetPICodeL() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::GetPresetPICodeL( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt index( 0 ); + TUint expectedPICode( 0 ); + TUint PICode( 0 ); + + // read parameters + if ( aItem.GetNextInt(index) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: Preset index." ); + } + if ( !ret && aItem.GetNextInt(expectedPICode) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: expectedPICode." ); + } + if ( !ret ) + { + INFO_1( "GetPresetPICodeL=%d.", expectedPICode ); + TRAP( ret, iRadioFmPresetUtility->GetPresetPICodeL( index, PICode ) ); + if ( PICode != expectedPICode ) + { + INFO_2( "Failed: PICode=%d, expectedPICode=%d.", PICode, expectedPICode ); + ret = KErrUnexpectedValue; + } + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::GetPresetFavouriteInfoL() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::GetPresetFavouriteInfoL( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt index( 0 ); + TInt expectedFavourite( 0 ); + TBool favouriteStatus( EFalse ); + + // read parameters + if ( aItem.GetNextInt(index) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: Preset index." ); + } + if ( !ret && aItem.GetNextInt(expectedFavourite) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: expectedFavourite." ); + } + if ( !ret ) + { + INFO_1( "GetPresetFavouriteInfoL=%d.", expectedFavourite ); + TRAP( ret, iRadioFmPresetUtility->GetPresetFavouriteInfoL( index, favouriteStatus ) ); + if ( !( ( favouriteStatus && expectedFavourite ) || + ( !favouriteStatus && !expectedFavourite ) ) ) + { + INFO_2( "Failed: favouriteStatus=%d, expectedFavourite=%d.", favouriteStatus, expectedFavourite ); + ret = KErrUnexpectedValue; + } + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::GetPresetUserRenameInfoL() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::GetPresetUserRenameInfoL( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt index( 0 ); + TInt expectedRename( 0 ); + TBool renameStatus( EFalse ); + + // read parameters + if ( aItem.GetNextInt(index) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: Preset index." ); + } + if ( !ret && aItem.GetNextInt(expectedRename) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: expectedRename." ); + } + if ( !ret ) + { + INFO_1( "GetPresetUserRenameInfoL=%d.", expectedRename ); + TRAP( ret, iRadioFmPresetUtility->GetPresetUserRenameInfoL( index, renameStatus ) ); + if ( !( ( renameStatus && expectedRename ) || + ( !renameStatus && !expectedRename ) ) ) + { + INFO_2( "Failed: renameStatus=%d, expectedRename=%d.", renameStatus, expectedRename ); + ret = KErrUnexpectedValue; + } + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::SetFavorite() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::SetFavorite( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TBool favoriteStatus( EFalse ); + if ( !ret && aItem.GetNextInt(favoriteStatus) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: favoriteStatus." ); + } + iPreset->SetFavorite( favoriteStatus ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::Favorite() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::Favorite( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt expectedFavorite( 0 ); + TBool favoriteStatus( EFalse ); + if ( !ret && aItem.GetNextInt(expectedFavorite) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: expectedFavorite." ); + } + favoriteStatus = iPreset->Favorite(); + if ( !( ( favoriteStatus && expectedFavorite ) || + ( !favoriteStatus && !expectedFavorite ) ) ) + { + INFO_2( "Failed: favoriteStatus=%d, expectedFavorite=%d.", favoriteStatus, expectedFavorite ); + ret = KErrUnexpectedValue; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::SetLocalStation() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::SetLocalStation( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TBool localStationStatus( EFalse ); + if ( !ret && aItem.GetNextInt(localStationStatus) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: localStationStatus." ); + } + iPreset->SetLocalStation( localStationStatus ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::LocalStation() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::LocalStation( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt expectedLocalStationStatus( 0 ); + TBool localStationStatus( EFalse ); + if ( !ret && aItem.GetNextInt(expectedLocalStationStatus) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: expectedLocalStationStatus." ); + } + localStationStatus = iPreset->LocalStation(); + if ( !( ( localStationStatus && expectedLocalStationStatus ) || + ( !localStationStatus && !expectedLocalStationStatus ) ) ) + { + INFO_2( "Failed: localStationStatus=%d, expectedLocalStationStatus=%d.", localStationStatus, expectedLocalStationStatus ); + ret = KErrUnexpectedValue; + } + return ret; + } + + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::SetRenamedByUser() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::SetRenamedByUser( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TBool renameStatus( EFalse ); + if ( !ret && aItem.GetNextInt(renameStatus) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: renameStatus." ); + } + iPreset->SetRenamedByUser( renameStatus ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::RenamedByUser() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::RenamedByUser( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt expectedRename( 0 ); + TBool renameStatus( EFalse ); + if ( !ret && aItem.GetNextInt(expectedRename) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: expectedRename." ); + } + renameStatus = iPreset->RenamedByUser(); + if ( !( ( renameStatus && expectedRename ) || + ( !renameStatus && !expectedRename ) ) ) + { + INFO_2( "Failed: renameStatus=%d, expectedRename=%d.", renameStatus, expectedRename ); + ret = KErrUnexpectedValue; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::SetGenre() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::SetGenre( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt genre( 0 ); + if ( !ret && aItem.GetNextInt(genre) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: genre." ); + } + iPreset->SetGenre( genre ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::Genre() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::Genre( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt expectedGenre( 0 ); + TInt genre( 0 ); + if ( !ret && aItem.GetNextInt(expectedGenre) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: expectedGenre." ); + } + genre = iPreset->Genre(); + if ( genre != expectedGenre ) + { + INFO_2( "Failed: genre=%d, expectedGenre=%d.", genre, expectedGenre ); + ret = KErrUnexpectedValue; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::SetPiCode() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::SetPiCode( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt piCode( 0 ); + if ( !ret && aItem.GetNextInt(piCode) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: piCode." ); + } + iPreset->SetPiCode( piCode ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModule::PiCode() +// Returns: None +// ----------------------------------------------------------------------------- +TInt CPresetUtilityTestModule::PiCode( CStifItemParser& aItem ) + { + FUNC_LOG; + TInt ret( KErrNone ); + TInt expectedPiCode( 0 ); + TInt piCode( 0 ); + if ( !ret && aItem.GetNextInt(expectedPiCode) ) + { + ret = KErrBadTestParameter; + ERROR( ret, "Missing Parameter: expectedPiCode." ); + } + piCode = iPreset->PiCode(); + if ( piCode != expectedPiCode ) + { + INFO_2( "Failed: piCode=%d, expectedPiCode=%d.", piCode, expectedPiCode ); + ret = KErrUnexpectedValue; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CPresetUtilityTestModuleModule::?member_function +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +/* +TInt CPresetUtilityTestModule::?member_function( + CItemParser& aItem ) + { + FUNC_LOG; + + ?code + + } +*/ + +// ========================== OTHER EXPORTED FUNCTIONS ========================= +// None + +// [End of File] - Do not remove diff -r 5a06f39ad45b -r 80975da52420 mmserv/radioutility/radioserver/Server/Src/RadioServer.cpp --- a/mmserv/radioutility/radioserver/Server/Src/RadioServer.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/radioutility/radioserver/Server/Src/RadioServer.cpp Mon May 03 12:59:52 2010 +0300 @@ -695,6 +695,15 @@ TRadioServerError aError ) { RADIO_RDEBUG_INT2(_L("[RADIO-SVR] SetFrequencyComplete(%d) State[%d]"), aError, iState); + + // Disable squelching, if on + if ( iSquelch ) + { + // Restore the last volume + iDevSound->SetVolume(iSettings->Volume()); + iSquelch = EFalse; + } + if ( iAsyncRequest && iAsyncRequest->iType == ERadioServSetFrequency ) { if ( aError == KErrNone ) @@ -1798,6 +1807,12 @@ } else { + if ( iSettings->IsSquelchEnabled() && !iSettings->IsMute() ) + { + // Simulate squelching + iDevSound->SetVolume(0); + iSquelch = ETrue; + } iTunerControl->SetFrequency(aFrequency); } break; diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/bwins/systemtoneservice.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/bwins/systemtoneservice.def Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,7 @@ +EXPORTS + ?Delete@CSystemToneService@@SAXPAV1@@Z @ 1 NONAME ; void CSystemToneService::Delete(class CSystemToneService *) + ?StopTone@CSystemToneService@@QAEXI@Z @ 2 NONAME ; void CSystemToneService::StopTone(unsigned int) + ?PlayTone@CSystemToneService@@QAEXW4TToneType@1@AAI@Z @ 3 NONAME ; void CSystemToneService::PlayTone(enum CSystemToneService::TToneType, unsigned int &) + ?Create@CSystemToneService@@SAPAV1@XZ @ 4 NONAME ; class CSystemToneService * CSystemToneService::Create(void) + ?PlayTone@CSystemToneService@@QAEXW4TToneType@1@@Z @ 5 NONAME ; void CSystemToneService::PlayTone(enum CSystemToneService::TToneType) + diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/data/create_sts_stub_sis.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/data/create_sts_stub_sis.bat Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,21 @@ +cls +@echo off +echo. + +rem +rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: PKG for System Tone Service (STS) +rem + +makesis -s sts_stub.pkg sts_stub.sis diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/data/sts_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/data/sts_stub.pkg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,29 @@ +; +; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: System Tone Service Stub SIS (STS) +; +;File: sts_stub.pkg + +;Languages +&EN + +;Header +#{"System Tone Service"},(0x10207C90),1,0,0, TYPE=SA + +;Localised Vendor name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/data/sts_stub.sis Binary file mmserv/sts/data/sts_stub.sis has changed diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/eabi/systemtoneservice.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/eabi/systemtoneservice.def Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,7 @@ +EXPORTS + _ZN18CSystemToneService6CreateEv @ 1 NONAME + _ZN18CSystemToneService6DeleteEPS_ @ 2 NONAME + _ZN18CSystemToneService8PlayToneENS_9TToneTypeE @ 3 NONAME + _ZN18CSystemToneService8PlayToneENS_9TToneTypeERj @ 4 NONAME + _ZN18CSystemToneService8StopToneEj @ 5 NONAME + diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/group/bld.inf Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file provides the information required for building the + * whole of System Tone Service. + */ + +#include "../stsimplementation/group/bld.inf" +#include "../stsplayer/group/bld.inf" +#include "../stsserver/group/bld.inf" + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../data/sts_stub.sis /epoc32/data/z/system/install/sts_stub.sis +../rom/systemtoneservice.iby CORE_MW_LAYER_IBY_EXPORT_PATH(systemtoneservice.iby) + +PRJ_MMPFILES +systemtoneservice.mmp diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/group/systemtoneservice.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/group/systemtoneservice.mmp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This is the project specification file for building the + * systemtoneservice dynamic library. + */ + +#include + +TARGET systemtoneservice.dll +TARGETTYPE dll +UID 0x1000008d 0x10207C8F +CAPABILITY ALL -TCB + +MW_LAYER_SYSTEMINCLUDE +USERINCLUDE ../inc + +SOURCEPATH ../src + +SOURCE systemtoneservice.cpp + +DEFFILE systemtoneservice.def +NOSTRICTDEF + +LIBRARY euser.lib +STATICLIBRARY stsimplementation.lib diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/inc/sts.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/inc/sts.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file defines an interface to an System Tone Service used by the + * STS Server for playing and stopping tones. Only one instance of this + * class is created by the server, and it exists for the lifetime of the + * server. This class manages all of the active players, and guarantees + * that the context values are unique. + */ + +#ifndef STS_H_ +#define STS_H_ + +#include +#include + +#include "stsplayer.h" + +class CSts : private MStsPlayerObserver + { +public: + static CSts* Create(); + static void Delete(CSts* aSts); + void PlayTone(CSystemToneService::TToneType aToneType, + unsigned int& aPlayToneContext); + void StopTone(unsigned int aPlayToneContext); + +protected: + CSts(); + virtual ~CSts(); + bool Init(); + +private: + void CleanUpPlayers(); + + // inherited from MPlayerObserver + virtual void PlayToneComplete(unsigned int aPlayToneContext); + +private: + unsigned int iNextContext; + typedef std::map TPlayerMap; + TPlayerMap iMap; + }; + +#endif //STS_H diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/inc/stsclientservercommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/inc/stsclientservercommon.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file defines common types and constants used by the STS server + * and sessions. + */ + +#ifndef STSCLIENTSERVERCOMMON_H_ +#define STSCLIENTSERVERCOMMON_H_ + +// SYMBIAN INCLUDES +#include +#include + +// CONSTANTS +_LIT( KStsServerFile, "StsServer" ); +_LIT( KStsServerName, "!StsServer" ); + +const TInt KStsServerMajorVersion = 0; +const TInt KStsServerMinorVersion = 1; +const TInt KStsServerBuild = 0; + +// This type enumerates the client/server messages for the STS server. +enum TStsServerCommandType + { + StsMsg_PlayTone, + StsMsg_StopTone, + StsMsg_ENDMARKER + }; + +const TStsServerCommandType KStsCmdLast = + (TStsServerCommandType) ((int) StsMsg_ENDMARKER - 1); + +#endif // STSCLIENTSERVERCOMMON_H_ diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/inc/stsimplementation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/inc/stsimplementation.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file defines the interface to the class that provides the + * implementation logic of the STS API. + */ + +#ifndef STSIMPLEMENTATION_H_ +#define STSIMPLEMENTATION_H_ + +#include + +class RStsSession; + +NONSHARABLE_CLASS(CStsImplementation) : public CBase + { +public: + static CStsImplementation* Create(); + virtual ~CStsImplementation(); +public: + void PlayTone(CSystemToneService::TToneType aTone); + void + PlayTone(CSystemToneService::TToneType aTone, unsigned int& aPlayToneContext); + void StopTone(unsigned int aPlayToneContext); +private: + CStsImplementation(); + bool Init(); + + RStsSession* iSession; + }; + +#endif /* STSIMPLEMENTATION_H_ */ diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/inc/stsplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/inc/stsplayer.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file defines the interface for creating, playing, + * stopping, and deleting an MMF player for a tone type. + */ +#ifndef STSPLAYER_H_ +#define STSPLAYER_H_ + +#include +#include + +class MStsPlayerObserver + { +public: + virtual void PlayToneComplete(unsigned int aPlayToneContext) = 0; + }; + +class CStsPlayer : private MMdaAudioPlayerCallback + { +public: + static CStsPlayer* Create(MStsPlayerObserver& aObserver, + CSystemToneService::TToneType aToneType, unsigned int aPlayToneContext); + virtual ~CStsPlayer(); + void Play(); + void Stop(); + +protected: + CStsPlayer(MStsPlayerObserver& aObserver, const TDesC& aFileName, + int aRepeatNumberOfTimes, unsigned int aPlayToneContext); + bool Init(); + +private: + void MapcInitComplete(TInt aError, + const TTimeIntervalMicroSeconds& aDuration); + void MapcPlayComplete(TInt aError); + + MStsPlayerObserver& iObserver; + CMdaAudioPlayerUtility* iPlayer; + TPtrC iFileName; + int iRepeatNumberOfTimes; + unsigned int iPlayToneContext; + }; + +#endif // STSPLAYER_H_ diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/rom/systemtoneservice.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/rom/systemtoneservice.iby Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: STS IBY file +* +*/ +/* + * sts.iby + * + */ + +#ifndef SYSTEMTONESERVICE_IBY +#define SYSTEMTONESERVICE_IBY + +#include + +file=ABI_DIR/BUILD_DIR/systemtoneservice.dll SHARED_LIB_DIR/systemtoneservice.dll +file=ABI_DIR/BUILD_DIR/stsserver.exe SHARED_LIB_DIR/stsserver.exe + +//STS_Stub +data=ZSYSTEM/install/sts_stub.sis System/Install/sts_stub.sis + +#endif //SYSTEMTONESERVICE_IBY + +//End of File \ No newline at end of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/sis/create_all_sis.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/sis/create_all_sis.bat Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,22 @@ +cls +@echo off +echo. + +rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of the "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +echo Description: System Tone Service package creation utility +rem + +call create_sis.bat +echo. +call create_udeb_sis.bat diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/sis/create_sis.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/sis/create_sis.bat Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,21 @@ +@echo off +echo. + +rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of the "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +echo Description: System Tone Service package creation utility - UREL +rem + +del systemtoneservice.sis* +makesis systemtoneservice.pkg systemtoneservice.sis +signsis systemtoneservice.sis systemtoneservice.sisx rd.crt rd.key diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/sis/create_udeb_sis.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/sis/create_udeb_sis.bat Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,21 @@ +@echo off +echo. + +rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of the "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +echo Description: System Tone Service package creation utility - UDEB +rem + +del systemtoneservice_udeb.sis* +makesis systemtoneservice_udeb.pkg systemtoneservice_udeb.sis +signsis systemtoneservice_udeb.sis systemtoneservice_udeb.sisx rd.crt rd.key diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/sis/systemtoneservice.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/sis/systemtoneservice.pkg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,35 @@ +; +; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: System Tone Service - UREL build +; +;File: systemtoneservice.pkg + +;Languages +&EN + +;Header +#{"System Tone Service"},(0x10207C90),1,0,0, TYPE=SA, RU + +;Series 60 v5.0 +[0x1028315F], 0,0,0, {"Series60ProductID"} + +;Localised Vendor name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +;Files To Copy... +"/epoc32/release/armv5/urel/systemtoneservice.dll" -"!:/sys/bin/systemtoneservice.dll" +"/epoc32/release/armv5/urel/stsserver.exe" -"!:/sys/bin/stsserver.exe" diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/sis/systemtoneservice_udeb.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/sis/systemtoneservice_udeb.pkg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,35 @@ +; +; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: System Tone Service - UDEB build +; +;File: systemtoneservice.pkg + +;Languages +&EN + +;Header +#{"System Tone Service"},(0x10207C90),1,0,0, TYPE=SA, RU + +;Series 60 v5.0 +[0x1028315F], 0,0,0, {"Series60ProductID"} + +;Localised Vendor name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +;Files To Copy... +"/epoc32/release/armv5/udeb/systemtoneservice.dll" -"!:/sys/bin/systemtoneservice.dll" +"/epoc32/release/armv5/udeb/stsserver.exe" -"!:/sys/bin/stsserver.exe" diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/src/systemtoneservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/src/systemtoneservice.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file is the direct implementation of the System Tone Service + * API. This acts as a facade to the actual implementation logic + * which is in the CStsImplementation class. + */ + +// Include Files +#include // CSystemToneService +#include "stsimplementation.h" + +// Member Functions +EXPORT_C /*static*/CSystemToneService* CSystemToneService::Create() + { + CSystemToneService* self = 0; + CStsImplementation* implementation = CStsImplementation::Create(); + if (implementation != 0) + { + self = new CSystemToneService(*implementation); + if (self == 0) + { + delete implementation; + } + } + return self; + } + +EXPORT_C /*static*/void CSystemToneService::Delete( + CSystemToneService* aSystemToneService) + { + delete &(aSystemToneService->iImplementation); + delete aSystemToneService; + } + +CSystemToneService::CSystemToneService(CStsImplementation& aImplementation) : + iImplementation(aImplementation) + { + } + +CSystemToneService::~CSystemToneService() + { + } + +EXPORT_C void CSystemToneService::PlayTone(TToneType aTone) + { + iImplementation.PlayTone(aTone); + } + +EXPORT_C void CSystemToneService::PlayTone(TToneType aTone, + unsigned int& aPlayToneContext) + { + iImplementation.PlayTone(aTone, aPlayToneContext); + } + +EXPORT_C void CSystemToneService::StopTone(unsigned int aPlayToneContext) + { + iImplementation.StopTone(aPlayToneContext); + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsimplementation/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsimplementation/group/bld.inf Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file provides the information required for building the + * system tone service implementation. + */ + +PRJ_MMPFILES +stsimplementation.mmp diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsimplementation/group/stsimplementation.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsimplementation/group/stsimplementation.mmp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This is the project specification file for building the + * stsimplementation static library. + */ + +#include + +TARGET stsimplementation.lib +TARGETTYPE lib + +MW_LAYER_SYSTEMINCLUDE +USERINCLUDE ../../inc + +SOURCEPATH ../src + +SOURCE stsimplementation.cpp rstssession.cpp diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsimplementation/src/rstssession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsimplementation/src/rstssession.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * The file provides the implementation of the client side session + * to the STS Server. + */ + +#include "rstssession.h" +#include "stsclientservercommon.h" + +const TUint KNumSlots = 30; + +TInt RStsSession::StartServer() + { + TInt err = KErrNone; + + // Launch the server executable (i.e. in it its own process). + + // Create a new server process. Simultaneous launching of two such processes + // should be detected when the second one attempts to create the server + // object, failing with KErrAlreadyExists. + RProcess server; + err = server.Create(KStsServerFile, KNullDesC); + + if (err == KErrNone) + { + TRequestStatus rendezvousStatus; + server.Rendezvous(rendezvousStatus); + + if (rendezvousStatus != KRequestPending) + { + server.Kill(0); // abort startup + } + else + { + server.Resume(); // logon OK - start the server thread + } // end if + + User::WaitForRequest(rendezvousStatus); // wait for start or death + + // we can't use the 'exit reason' if the server panicked as this + // is the panic 'reason' and may be '0' which cannot be distinguished + // from KErrNone + err = (server.ExitType() == EExitPanic) + ? KErrGeneral + : rendezvousStatus.Int(); + server.Close(); + } + + return err; + } + +TInt RStsSession::Connect() + { + TInt result = CreateSession(KStsServerName, TVersion( + KStsServerMajorVersion, KStsServerMinorVersion, KStsServerBuild), + KNumSlots, EIpcSession_Sharable); + + if (result == KErrNotFound) + { + result = StartServer(); + if (result == KErrNone || result == KErrAlreadyExists) + { + result = CreateSession(KStsServerName, TVersion( + KStsServerMajorVersion, KStsServerMinorVersion, + KStsServerBuild), KNumSlots); + } + } + + if (result == KErrNone) + { + result = ShareAuto(); + + if (result != KErrNone) + { + Close(); + } + } + + return result; + } + +void RStsSession::Close() + { + RSessionBase::Close(); + } + +TInt RStsSession::SendPlayTone(CSystemToneService::TToneType aToneType, + unsigned int& aPlayToneContext) + { + TPckg playToneContextPckg(aPlayToneContext); + return SendReceive(StsMsg_PlayTone, TIpcArgs((TInt) aToneType, + &playToneContextPckg)); + } + +TInt RStsSession::SendStopTone(unsigned int aPlayToneContext) + { + return SendReceive(StsMsg_StopTone, TIpcArgs(aPlayToneContext)); + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsimplementation/src/rstssession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsimplementation/src/rstssession.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file defines the interface to the client side session of the + * STS Server. + */ + +#ifndef RSTSSESSION_H_ +#define RSTSSESSION_H_ + +#include +#include + +class RStsSession : public RSessionBase + { +public: + + TInt Connect(); + + void Close(); + + TInt SendPlayTone(CSystemToneService::TToneType aToneType, + unsigned int& aPlayToneContext); + + TInt SendStopTone(unsigned int aPlayToneContext); + +private: + + TInt StartServer(); + + }; + +#endif // RSTSSESSION_H_ diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsimplementation/src/stsimplementation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsimplementation/src/stsimplementation.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * The file provides the actual implementation of the STS API. + * All of the STS API methods are implemented by passing the + * calls to the STS Server through the client side STS + * Session. + */ + +// Include Files +#include "stsimplementation.h" +#include "rstssession.h" + +// Member Functions +/*static*/CStsImplementation* CStsImplementation::Create() + { + CStsImplementation* self = new CStsImplementation(); + if (self != 0) + { + bool successful = self->Init(); + if (!successful) + { + delete self; + self = 0; + } + } + return self; + } + +CStsImplementation::CStsImplementation() : + iSession(NULL) + { + } + +CStsImplementation::~CStsImplementation() + { + iSession->Close(); + delete iSession; + } + +bool CStsImplementation::Init() + { + bool result = false; + iSession = new RStsSession(); + if (iSession) + { + TInt err = iSession->Connect(); + result = err == KErrNone; + } + return result; + } + +void CStsImplementation::PlayTone(CSystemToneService::TToneType aTone) + { + unsigned int playToneContext; + PlayTone(aTone, playToneContext); + } + +void CStsImplementation::PlayTone(CSystemToneService::TToneType aTone, + unsigned int& aPlayToneContext) + { + //TODO: Add logging and error checking + iSession->SendPlayTone(aTone, aPlayToneContext); + } + +void CStsImplementation::StopTone(unsigned int aPlayToneContext) + { + //TODO: Add logging and error checking + iSession->SendStopTone(aPlayToneContext); + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsplayer/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsplayer/group/bld.inf Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file provides the information required for building the + * system tone service player. + */ + +PRJ_MMPFILES +stsplayer.mmp diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsplayer/group/stsplayer.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsplayer/group/stsplayer.mmp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This is the project specification file for building the + * stsimplementation static library. + */ + +#include + +TARGET stsplayer.lib +TARGETTYPE lib + +MW_LAYER_SYSTEMINCLUDE +OS_LAYER_LIBC_SYSTEMINCLUDE +OS_LAYER_STDCPP_SYSTEMINCLUDE +USERINCLUDE ../../inc + +SOURCEPATH ../src + +SOURCE sts.cpp +SOURCE stsplayer.cpp diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsplayer/src/sts.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsplayer/src/sts.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file provides the implementation of System Tone Service used + * by the STS Server. + */ + +#include "sts.h" + +/*static*/CSts* CSts::Create() + { + CSts* self = new CSts(); + if (self != 0) + { + bool successful = self->Init(); + if (!successful) + { + delete self; + self = 0; + } + } + return self; + } + +/*static*/void CSts::Delete(CSts* aSts) + { + delete aSts; + } + +CSts::CSts() : + iNextContext(1) + { + } + +bool CSts::Init() + { + return true; + } + +CSts::~CSts() + { + CleanUpPlayers(); + } + +void CSts::PlayTone(CSystemToneService::TToneType aToneType, + unsigned int& aPlayToneContext) + { + CStsPlayer* player = CStsPlayer::Create(*this, aToneType, iNextContext); + if (player != 0) + { + iMap[iNextContext] = player; + aPlayToneContext = iNextContext; + iNextContext++; + player->Play(); + } + else + { + aPlayToneContext = 0; + } + } + +void CSts::StopTone(unsigned int aPlayToneContext) + { + CStsPlayer* player = iMap[aPlayToneContext]; + if (player) + { + player->Stop(); + PlayToneComplete(aPlayToneContext); + } + } + +void CSts::CleanUpPlayers() + { + for (TPlayerMap::iterator i = iMap.begin(); i != iMap.end(); i++) + { + StopTone(i->first); + } + } + +void CSts::PlayToneComplete(unsigned int aPlayToneContext) + { + CStsPlayer* player = iMap[aPlayToneContext]; + iMap[aPlayToneContext] = 0; + if (player) + { + delete player; + } + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsplayer/src/stsplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsplayer/src/stsplayer.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file provides the implementation for creating and deleting a + * an MMF based player for playing and stopping a tone playback. + */ +#include "stsplayer.h" +_LIT(KDefaultFile,"z:\\data\\sounds\\digital\\clock.aac"); + +/*static*/CStsPlayer* CStsPlayer::Create(MStsPlayerObserver& aObserver, + CSystemToneService::TToneType aToneType, unsigned int aPlayToneContext) + { + CStsPlayer* self = 0; + switch (aToneType) + { + case CSystemToneService::EClockAlarm: + self = new CStsPlayer(aObserver, KDefaultFile, 10, aPlayToneContext); + break; + default: + self = new CStsPlayer(aObserver, KDefaultFile, 0, aPlayToneContext); + break; + } + if (self != 0) + { + bool successful = self->Init(); + if (!successful) + { + delete self; + self = 0; + } + } + return self; + } + +CStsPlayer::CStsPlayer(MStsPlayerObserver& aObserver, const TDesC& aFileName, + int aRepeatNumberOfTimes, unsigned int aPlayToneContext) : + iObserver(aObserver), iPlayer(0), iFileName(aFileName), + iRepeatNumberOfTimes(aRepeatNumberOfTimes), iPlayToneContext( + aPlayToneContext) + { + } + +bool CStsPlayer::Init() + { + TRAPD(result, iPlayer = CMdaAudioPlayerUtility::NewL(*this)); + return result == KErrNone; + } + +CStsPlayer::~CStsPlayer() + { + delete iPlayer; + } + +void CStsPlayer::Play() + { + TRAP_IGNORE(iPlayer->OpenFileL(iFileName)); + } + +void CStsPlayer::Stop() + { + iPlayer->Stop(); + } + +void CStsPlayer::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/) + { + if (aError == KErrNone) + { + TTimeIntervalMicroSeconds delay = 0; + iPlayer->SetRepeats(iRepeatNumberOfTimes, delay); + iPlayer->Play(); + } + else + { + //TODO: add trace + } + } + +void CStsPlayer::MapcPlayComplete(TInt aError) + { + if (aError != KErrNone) + { + //TODO: add trace + } + iObserver.PlayToneComplete(iPlayToneContext); + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsserver/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsserver/group/bld.inf Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This is the top level build file for the STS Server. + */ + +PRJ_MMPFILES + +stsserver.mmp diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsserver/group/stsserver.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsserver/group/stsserver.mmp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This is the build file for the STS Server. + */ + +#include +#include + +TARGET stsserver.exe +TARGETTYPE exe +UID 0 0x10207C90 +CAPABILITY MultiMediaDD ReadDeviceData WriteDeviceData ReadUserData WriteUserData ProtServ +VENDORID VID_DEFAULT + +EPOCPROCESSPRIORITY high +EPOCSTACKSIZE 0x5000 +EPOCHEAPSIZE 0x400 0x1000000 + +MW_LAYER_SYSTEMINCLUDE +OS_LAYER_LIBC_SYSTEMINCLUDE +OS_LAYER_STDCPP_SYSTEMINCLUDE + +USERINCLUDE ../../inc +SOURCEPATH ../src + +SOURCE stsserverexe.cpp +SOURCE stsserver.cpp +SOURCE stsserversession.cpp + +STATICLIBRARY stsplayer.lib + +LIBRARY ecom.lib +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY libc.lib +LIBRARY libstdcpp.lib +LIBRARY mediaclientaudio.lib diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsserver/src/stsserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsserver/src/stsserver.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file is the implementation of the Symbian STS Server. This + * file handles the Symbian specific server creation/deletation + * activities, and adding/removing sessions. The actual STS + * functionality is handled in the STS class. + */ + +#include "stsserver.h" + +#include +#include "stsserversession.h" +#include "sts.h" + +// TODO: IMPLEMENT PLATFORM SECURITY CHECKS ON THIS API. + +// Total number of ranges +const TUint KStsRangeCount = 2; + +// Definition of the ranges of IPC numbers +const TInt KStsRanges[KStsRangeCount] = + { + 0, KStsCmdLast + 1 + }; + +// Policy to implement for each of the above ranges +const TUint8 KStsElementsIndex[KStsRangeCount] = + { + CPolicyServer::EAlwaysPass, CPolicyServer::ENotSupported + }; + +// Package all the above together into a policy +const CPolicyServer::TPolicy KStsPolicy = + { + CPolicyServer::EAlwaysPass, // specifies all connect attempts should pass + KStsRangeCount, // number of ranges + KStsRanges, // ranges array + KStsElementsIndex, // elements<->ranges index + NULL + }; + +// CStsServer IMPLEMENTATION + +CStsServer* CStsServer::NewLC() + { + CStsServer* self = new (ELeave) CStsServer(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +CStsServer::CStsServer() : + CPolicyServer(0, KStsPolicy, ESharableSessions), iSts(0) + { + } + +void CStsServer::ConstructL() + { + StartL(KStsServerName); + iSts = CSts::Create(); + if (iSts == 0) + { + User::Leave(KErrNoMemory); + } + } + +CStsServer::~CStsServer() + { + iSessions.ResetAndDestroy(); + CSts::Delete(iSts); + REComSession::FinalClose(); + } + +CSession2* CStsServer::NewSessionL(const TVersion& aVersion, const RMessage2& /*aMessage*/) const + { + if (aVersion.iMajor != KStsServerMajorVersion || aVersion.iMinor + != KStsServerMinorVersion || aVersion.iBuild != KStsServerBuild) + { + User::Leave(KErrNotSupported); + } // end if + + CStsServer& nonConstThis = *const_cast (this); + + // Construct a new session, passing it a pointer to the server object. This function + // is const, so the const-ness must be cast away from the this pointer. + CSession2* returnValue = new (ELeave) CStsServerSession(nonConstThis, *iSts); + + return returnValue; + } + +void CStsServer::AddSession(CStsServerSession* aSession) + { + iSessions.Append(aSession); + } + +void CStsServer::DropSession(CStsServerSession* aSession) + { + // Find the current session in the list of sessions. + TInt index = iSessions.Find(aSession); + + if (index != KErrNotFound) + { + // Remove the session from the list of sessions. + iSessions.Remove(index); + } // end if + + if (iSessions.Count() == 0) + { + // No more clients. Shutdown the server. + CActiveScheduler::Stop(); + } + } + +// SERVER LAUNCHING FUNCTIONALITY + +EXPORT_C void CStsServer::RunServerL(bool aPerformProcessRendezvous, + bool aPerformThreadRendezvous) + { + // naming the server thread after the server helps to debug panics + User::LeaveIfError(User::RenameThread(KStsServerName)); + + // create and install the active scheduler + CActiveScheduler* scheduler = new (ELeave) CActiveScheduler(); + CleanupStack::PushL(scheduler); + CActiveScheduler::Install(scheduler); + + // create the server (leave it on the cleanup stack) + CStsServer* server = CStsServer::NewLC(); + + // Initialisation complete, now signal the client, if requested. + + if (aPerformProcessRendezvous) + { + RProcess::Rendezvous(KErrNone); + } + + if (aPerformThreadRendezvous) + { + RThread::Rendezvous(KErrNone); + } + + // Ready to run + // Start wait loop, will return when server is shutdown + CActiveScheduler::Start(); + + // Cleanup the server + CleanupStack::PopAndDestroy(server); + + // Cleanup scheduler after shutdown + CleanupStack::PopAndDestroy(scheduler); + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsserver/src/stsserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsserver/src/stsserver.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file defines the interface into the STS server. + */ + +#ifndef STSSERVER_H_ +#define STSSERVER_H_ + +#include + +class CSts; +class CStsServerSession; + +class CStsServer : private CPolicyServer + { +public: + + // Runs the server on the current thread, and blocks until the server exits. + IMPORT_C static void RunServerL(bool aPerformProcessRendezvous = EFalse, + bool aPerformThreadRendezvous = EFalse); + + void AddSession(CStsServerSession* aSession); + + void DropSession(CStsServerSession* aSession); + +private: + + static CStsServer* NewLC(); + + CStsServer(); + void ConstructL(); + virtual ~CStsServer(); + + // inherited from CPolicyServer + CSession2* NewSessionL(const TVersion& aVersion, + const RMessage2& aMessage) const; + + RPointerArray iSessions; + CSts* iSts; + + }; + +#endif //STSSERVER_H_ diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsserver/src/stsserverexe.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsserver/src/stsserverexe.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * The file containt the main method of the STS Server. + */ + +#include "stsserver.h" +#include "stsclientservercommon.h" + +TInt E32Main() + { + TInt returnValue = KErrNoMemory; + + RThread myThread; + myThread.SetPriority(EPriorityAbsoluteRealTime1); + + __UHEAP_MARK; + + CTrapCleanup* cleanup = CTrapCleanup::New(); + + if (cleanup) + { + // Run the server and request a process rendezvous. + TRAP( returnValue, CStsServer::RunServerL( ETrue ) ); + delete cleanup; + } + __UHEAP_MARKEND; + + return returnValue; + } // end E32Main diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsserver/src/stsserversession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsserver/src/stsserversession.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This method provides the generic Symbian specific message handling + * for the server session. The actual STS specific processing occurs + * in the STS class. + */ + +#include "stsserversession.h" +#include "stsserver.h" +#include "sts.h" + +// CStsServerSession IMPLEMENTATION +CStsServerSession::CStsServerSession(CStsServer& aServer, CSts& aSts) : + iServer(aServer), iSts(aSts) + { + } + +CStsServerSession::~CStsServerSession() + { + iServer.DropSession(this); + } + +void CStsServerSession::CreateL() + { + iServer.AddSession(this); + } + +void CStsServerSession::ServiceL(const RMessage2& aMessage) + { + switch (aMessage.Function()) + { + case StsMsg_PlayTone: + DoPlayToneL(aMessage); + break; + case StsMsg_StopTone: + DoStopToneL(aMessage); + break; + default: + break; + } + } + +void CStsServerSession::ServiceError(const RMessage2& aMessage, TInt aError) + { + CSession2::ServiceError(aMessage, aError); + } + +void CStsServerSession::DoPlayToneL(const RMessage2& aMessage) + { + CSystemToneService::TToneType toneType = + (CSystemToneService::TToneType) aMessage.Int0(); + unsigned int context = 0; + iSts.PlayTone(toneType, context); + TPckg contextPckg(context); + TRAPD(err,aMessage.WriteL(1,contextPckg)); + aMessage.Complete(err); + } + +void CStsServerSession::DoStopToneL(const RMessage2& aMessage) + { + unsigned int context = aMessage.Int0(); + aMessage.Complete(KErrNone); + iSts.StopTone(context); + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/stsserver/src/stsserversession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/stsserver/src/stsserversession.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file defines the interface for the STS server side session. + */ + +#ifndef STSSERVERSESSION_H_ +#define STSSERVERSESSION_H_ + +#include +#include + +#include "stsclientservercommon.h" + +class CSts; +class CStsServer; + +class CStsServerSession : public CSession2 + { +public: + + CStsServerSession(CStsServer& aServer, CSts& aSts); + + virtual ~CStsServerSession(); + + // inherited from CSession2 + void CreateL(); + void ServiceL(const RMessage2& aMessage); + void ServiceError(const RMessage2& aMessage, TInt aError); + +private: + + void DoPlayToneL(const RMessage2& aMessage); + void DoStopToneL(const RMessage2& aMessage); + + CStsServer& iServer; + CSts& iSts; + + }; + +#endif // STSSERVERSESSION_H_ diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/tsrc/ststester/data/ststester_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/tsrc/ststester/data/ststester_reg.rss Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include + +UID2 KUidAppRegistrationResourceFile +UID3 0x10207C88 + +RESOURCE APP_REGISTRATION_INFO +{ + app_file="STSTester"; +} diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/tsrc/ststester/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/tsrc/ststester/group/bld.inf Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file provides the information required for building the + * whole of System Tone Service Tester. + */ + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +ststester.mmp diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/tsrc/ststester/group/ststester.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/tsrc/ststester/group/ststester.mmp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This is the project specification file for building the + * ststester application. + */ + +#include + +TARGET ststester.exe +TARGETTYPE exe +UID 0 0x10207C88 +CAPABILITY SwEvent + +VENDORID VID_DEFAULT + +EPOCSTACKSIZE 0x5000 //20KB +EPOCHEAPSIZE 0x400 0x1000000 //1KB-16MB + +START RESOURCE ../data/ststester_reg.rss +TARGETPATH /private/10003a3f/apps +END + +MW_LAYER_SYSTEMINCLUDE +USERINCLUDE ../inc + +SOURCEPATH ../src + +SOURCE ststestermain.cpp +SOURCE ststester.cpp +SOURCE testappbase.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY fbscli.lib +LIBRARY fntstr.lib +LIBRARY gce.lib +LIBRARY gdi.lib +LIBRARY ws32.lib +LIBRARY systemtoneservice.lib +LIBRARY remconcoreapi.lib +LIBRARY remconinterfacebase.lib diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/tsrc/ststester/inc/ststestermain.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/tsrc/ststester/inc/ststestermain.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file defines API into the System Tone Service Tester. + */ + +#ifndef STSTESTERMAIN_H_ +#define STSTESTERMAIN_H_ + +// Include Files +#include + +// Function Prototypes +GLDEF_C TInt E32Main(); + +#endif // STSTESTERMAIN_H_ diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/tsrc/ststester/sis/create_sis.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/tsrc/ststester/sis/create_sis.bat Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,22 @@ +cls +@echo off +echo. + +rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of the "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +echo Description: STS Tester package creation utility +rem + +del ststester.sis* +\epoc32\tools\makesis ststester.pkg ststester.sis +\epoc32\tools\signsis ststester.sis ststester.sisx rd.crt rd.key diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/tsrc/ststester/sis/ststester.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/tsrc/ststester/sis/ststester.pkg Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,38 @@ +; +; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: System Tone Service Tester - UDEB build +; +;File: ststester.pkg + +;Languages +&EN + +;Header +#{"ststester EXE"},(0x10207C88),1,0,0, TYPE=SA, RU + +;Series 60 v5.0 +[0x1028315F], 0,0,0, {"Series60ProductID"} + +;Localised Vendor name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +;Add System Tone Service package +@"../../../sis/systemtoneservice.sisx",(0x10207C90) + +;Files To Copy... +"/epoc32/release/armv5/udeb/ststester.exe" -"!:/sys/bin/ststester.exe" +"/epoc32/data/z/private/10003a3f/apps/ststester_reg.rsc" -"!:/private/10003a3f/import/apps/ststester_reg.rsc" diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/tsrc/ststester/src/profileutilmacro.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/tsrc/ststester/src/profileutilmacro.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This file defines macros for different types of performance + * measurement traces. + */ + +#ifndef PROFILEUTILMACRO_H_ +#define PROFILEUTILMACRO_H_ + +/* + MACROS to be defined to use profiling + PROFILE_TIME + PROFILE_RAM_USAGE + PROFILE_HEAP_USAGE + PRINT_TO_CONSOLE_HEAP_DIFF + PRINT_TO_CONSOLE_RAM_DIFF + PRINT_TO_CONSOLE_HEAP_DIFF + */ +#if defined(PROFILE_TIME) || defined(PROFILE_RAM_USAGE) || defined(PROFILE_HEAP_USAGE) +#include +#include +#endif + +#ifdef PROFILE_TIME +#define TAG_TIME_PROFILING_BEGIN \ + TTime beginProfilingTime; \ + beginProfilingTime.HomeTime() + +#define TAG_TIME_PROFILING_END \ + TTime endProfilingTime; \ + endProfilingTime.HomeTime(); \ + TTimeIntervalMicroSeconds diffInMicroSecs = endProfilingTime.MicroSecondsFrom(beginProfilingTime) + +#define PRINT_TO_CONSOLE_TIME_DIFF \ + RDebug::Printf("VPROFILEDAT: %s : Time taken[%u]microseconds ", __PRETTY_FUNCTION__, diffInMicroSecs.Int64()) +#else /* Empty macros */ +#define TAG_TIME_PROFILING_BEGIN +#define TAG_TIME_PROFILING_END +#define PRINT_TO_CONSOLE_TIME_DIFF +#endif /*PROFILE_TIME*/ + +#ifdef PROFILE_RAM_USAGE +#define TAG_RAM_PROFILING_BEGIN \ + TInt beginProfilingRAM; \ + TInt err1 = HAL::Get(HALData::EMemoryRAMFree, beginProfilingRAM) + +#define TAG_RAM_PROFILING_END \ + TInt endProfilingRAM; \ + TInt err2 = HAL::Get(HALData::EMemoryRAMFree, endProfilingRAM) + +#define PRINT_TO_CONSOLE_RAM_DIFF \ + if ((err1 == KErrNone) && (err2 == KErrNone)) \ + { \ + TInt diffRAM = (beginProfilingRAM - endProfilingRAM); \ + if ( diffRAM > 0 ) \ + { \ + RDebug::Printf("VPROFILEDAT: %s : RAM used[%u]bytes ", __PRETTY_FUNCTION__, diffRAM); \ + } \ + else \ + { \ + RDebug::Printf("VPROFILEDAT: %s : RAM freed[%u]bytes ", __PRETTY_FUNCTION__, (-diffRAM)); \ + } \ + } \ + else \ + { \ + RDebug::Printf("VPROFILEDAT: %s : Error1[%d] Error2[%d] ", __PRETTY_FUNCTION__, err1, err2); \ + } + +#else /* Empty macros */ +#define TAG_RAM_PROFILING_BEGIN +#define TAG_RAM_PROFILING_END +#define PRINT_TO_CONSOLE_RAM_DIFF +#endif /*PROFILE_RAM_USAGE*/ + +#ifdef PROFILE_HEAP_USAGE +#define TAG_DEFAULT_HEAP_PROFILING_BEGIN \ + TInt beginProfilingHEAPBiggestBlock; \ + TInt beginProfilingHEAP = User::Available(beginProfilingHEAPBiggestBlock) \ + +#define TAG_DEFAULT_HEAP_PROFILING_END \ + TInt endProfilingHEAPBiggestBlock; \ + TInt endProfilingHEAP = User::Available(endProfilingHEAPBiggestBlock) \ + +#define PRINT_TO_CONSOLE_HEAP_DIFF \ + TInt diffHEAP = beginProfilingHEAP - endProfilingHEAP; \ + if ( diffHEAP > 0 ) \ + { \ + RDebug::Printf("VPROFILEDAT: %s : HEAP used[%u]bytes ", __PRETTY_FUNCTION__, diffHEAP); \ + } \ + else \ + { \ + RDebug::Printf("VPROFILEDAT: %s : HEAP freed[%u]bytes ", __PRETTY_FUNCTION__, (-diffHEAP)); \ + } +#else /* Empty macros */ +#define TAG_DEFAULT_HEAP_PROFILING_BEGIN +#define TAG_DEFAULT_HEAP_PROFILING_END +#define PRINT_TO_CONSOLE_HEAP_DIFF +#endif /*PROFILE_HEAP_USAGE*/ + +#endif /*PROFILEUTILMACRO_H_*/ diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/tsrc/ststester/src/ststester.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/tsrc/ststester/src/ststester.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * The file contains the implementation of the STS Tester. + */ + +#include "ststester.h" + +#include +#define PROFILE_TIME 1 +#include "profileutilmacro.h" + +const TInt KKeyMapPageCount = 1; + +const TInt KFontSize = 15; + +const TOperationsPage KKeyMap[KKeyMapPageCount] = + { + {STR("Standard controls"), 5, // default softkey index + { + // Enter + {STR(""), KOperation_ExecuteOption}, + // Up / Down / Left / Right + {STR(""), KOperation_PreviousOption}, + {STR(""), KOperation_NextOption}, + {STR(""), KOperation_PreviousOptionPage}, + {STR(""), KOperation_NextOptionPage}, + // 0 - 9 + {STR("Play Default Beep"), EOperation_PlayDefaultBeep}, + {STR("Play Clock Alarm"), EOperation_PlayClockAlarm}, + {STR("Stop Clock Alarm"), EOperation_StopClockAlarm}, + {STR(""), KOperation_None}, + {STR(""), KOperation_None}, + {STR(""), KOperation_None}, + {STR(""), KOperation_None}, + {STR(""), KOperation_None}, + {STR(""), KOperation_None}, + {STR("Exit"), KOperation_Exit} + } + } + }; + +void CStsTester::ExecuteL() + { + CStsTester* self = new (ELeave) CStsTester; + CleanupStack::PushL(self); + self->InitL(); + self->Main(); + CleanupStack::PopAndDestroy(self); + } + +CStsTester::CStsTester() : + CTestAppBase(KFontSize), iPlayState(EStopped) + { + } + +CStsTester::~CStsTester() + { + CSystemToneService::Delete( iSts); + } + +void CStsTester::InitL() + { + BaseConstructL(KKeyMap, KKeyMapPageCount); + iSts = CSystemToneService::Create(); + } + +void CStsTester::Main() + { + TRAP_IGNORE( MainL() ); + } + +void CStsTester::MainL() + { + _LIT( KPlayDefault, "Play Default Beep" ); + _LIT( KPlayClockAlarm, "Play Clock Alarm" ); + _LIT( KStopClockAlarm, "Stop Clock Alarm" ); + _LIT( KExit, "Exit"); + + bool done = false; + + while (!done) + { + RPointerArray operations; + operations.Append(&KPlayDefault); + operations.Append(&KPlayClockAlarm); + operations.Append(&KStopClockAlarm); + operations.Append(&KExit); + + TInt index = SelectFromListL(TPoint(0, 0), iDisplaySize, + _L("Select STS operation to perform:"), operations); + + operations.Reset(); + + TPtrC operationName(STR("Play Default Beep")); + + switch (index) + { + case -1: + done = true; + break; + case 0: + ExecuteOperation(EOperation_PlayDefaultBeep, operationName); + break; + case 1: + ExecuteOperation(EOperation_PlayClockAlarm, operationName); + break; + case 2: + ExecuteOperation(EOperation_StopClockAlarm, operationName); + break; + case 3: + done = true; + break; + } + } + } + +void CStsTester::ExecuteOperation(TInt aOperation, const TDesC& /*aOperationText*/) + { + switch (aOperation) + { + case EOperation_PlayDefaultBeep: + { + TAG_TIME_PROFILING_BEGIN; + iSts->PlayTone(CSystemToneService::EDefaultBeep); + TAG_TIME_PROFILING_END; + PRINT_TO_CONSOLE_TIME_DIFF; + break; + } + case EOperation_PlayClockAlarm: + { + // Only play if not already playing + if (iPlayState != EPlaying) + { + TAG_TIME_PROFILING_BEGIN; + iSts->PlayTone(CSystemToneService::EClockAlarm, + iCurrentContext); + TAG_TIME_PROFILING_END; + PRINT_TO_CONSOLE_TIME_DIFF; + iPlayState = EPlaying; + } + break; + } + case EOperation_StopClockAlarm: + { + TAG_TIME_PROFILING_BEGIN; + iSts->StopTone(iCurrentContext); + TAG_TIME_PROFILING_END; + PRINT_TO_CONSOLE_TIME_DIFF; + iPlayState = EStopped; + break; + } + default: + { + break; + } + } + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/tsrc/ststester/src/ststester.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/tsrc/ststester/src/ststester.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * The file defines the interface for the STS Tester. + */ + +#ifndef STSTESTER_H_ +#define STSTESTER_H_ + +#include "testappbase.h" + +class CSystemToneService; + +enum TOperations + { + EOperation_PlayDefaultBeep = KOperation_FirstCustomIndex, + EOperation_PlayClockAlarm, + EOperation_StopClockAlarm + }; + +class CStsTester : public CTestAppBase + { +public: + // Methods + + static void ExecuteL(); + +private: + // Methods + + CStsTester(); + + ~CStsTester(); + + void InitL(); + + void Main(); + + void MainL(); + + // inherited from CTestAppBase + virtual void ExecuteOperation(TInt aOperation, + const TDesC& aOperationText); + +private: + // Attributes + + enum TPlayState + { + EStopped, EPlaying + }; + + // STS attributes + CSystemToneService* iSts; + unsigned int iCurrentContext; + TPlayState iPlayState; + + }; + +#endif // STSTESTER_H_ diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/tsrc/ststester/src/ststestermain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/tsrc/ststester/src/ststestermain.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * This is the main driver of System Tone Service Tester. + */ + +// Include Files +#include "ststestermain.h" +#include "ststester.h" + +// Global Functions +GLDEF_C TInt E32Main() + { + __UHEAP_MARK; + CActiveScheduler* scheduler = new CActiveScheduler; + CTrapCleanup* cleanup = CTrapCleanup::New(); + if( scheduler != NULL && cleanup != NULL ) + { + CActiveScheduler::Install( scheduler ); + TRAP_IGNORE( CStsTester::ExecuteL() ); + } + delete cleanup; + delete scheduler; + __UHEAP_MARKEND; + return KErrNone; + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/tsrc/ststester/src/testappbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/tsrc/ststester/src/testappbase.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,1236 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * Source file containing common test app functionality. + */ + +#include +#include +#include + +#include "testappbase.h" + +const TInt KLeftSoftKeyScanCode = EStdKeyDevice0; +const TInt KRightSoftKeyScanCode = EStdKeyDevice1; + +const TInt KHelpWindowBorderPixels = 20; +const TInt KHelpWindowSpaceBetweenColumns = 25; +const TInt KHelpWindowSpaceBetweenRows = 2; + +// TODO: WOULD BE BETTER TO DYNAMICALLY DETECT THE AVAILABLE DRIVES +_LIT( KDriveC, "C:" ); +_LIT( KDriveE, "E:" ); +_LIT( KDriveF, "F:" ); +_LIT( KDriveZ, "Z:" ); + +struct TKeyListEntry + { + TInt scanCode; + TInt scanCode2; + const TText* keyName; + }; + +// Some emulators return '1' when key 1 is pressed and others returned EStdKeyNkp1. +// Convert both case into '1'. +const TKeyListEntry KSupportedKeys[KSupportedKeysCount] = + { + {EStdKeyEnter, EStdKeyNull, STR("Enter")}, + {EStdKeyUpArrow, EStdKeyNull, STR("Up")}, + {EStdKeyDownArrow, EStdKeyNull, STR("Down")}, + {EStdKeyLeftArrow, EStdKeyNull, STR("Left")}, + {EStdKeyRightArrow, EStdKeyNull, STR("Right")}, + {'0', EStdKeyNkp0, STR("0")}, + {'1', EStdKeyNkp1, STR("1")}, + {'2', EStdKeyNkp2, STR("2")}, + {'3', EStdKeyNkp3, STR("3")}, + {'4', EStdKeyNkp4, STR("4")}, + {'5', EStdKeyNkp5, STR("5")}, + {'6', EStdKeyNkp6, STR("6")}, + {'7', EStdKeyNkp7, STR("7")}, + {'8', EStdKeyNkp8, STR("8")}, + {'9', EStdKeyNkp9, STR("9")} + }; + +static TPtrC KeyName(TInt aIndex) + { + //TODO: Check aIndex range + return TPtrC(KSupportedKeys[aIndex].keyName); + } + +// Portable app implementation + +CTestAppBase::CTestAppBase(TInt aFontSize) : + CActive(EPriorityStandard), iFontSize(aFontSize), + iHelpSemitransparentBackgroundActive(true) + { + CActiveScheduler::Add(this); + } + +CTestAppBase::~CTestAppBase() + { + delete iInterfaceSelector; + delete iHelpWindow; + delete iSelectionWindow; + delete iGc; + delete iWindowGroup; + delete iScreenDevice; + delete iTypefaceStore; + iWs.Close(); + iFs.Close(); + iFileHistory.ResetAndDestroy(); + } + +void CTestAppBase::BaseConstructL(const TOperationsPage* aKeyMap, + TInt aPageCount) + { + iKeyMap = aKeyMap; + iPageCount = aPageCount; + + User::LeaveIfError(iFs.Connect()); + + User::LeaveIfError(iWs.Connect()); + + iScreenDevice = new (ELeave) CWsScreenDevice(iWs); + User::LeaveIfError(iScreenDevice->Construct()); + iDisplaySize = iScreenDevice->SizeInPixels(); + + User::LeaveIfError(iScreenDevice->CreateContext(iGc)); + + iWindowGroup = new (ELeave) RWindowGroup(iWs); + User::LeaveIfError(iWindowGroup->Construct(KNullWsHandle)); + + iSelectionWindow = new (ELeave) RWindow(iWs); + User::LeaveIfError(iSelectionWindow->Construct(*iWindowGroup, + KNullWsHandle)); + iSelectionWindow->SetVisible(false); + iSelectionWindow->Activate(); + + // Load the font to be used for all text operations. + TFontSpec fontSpec; + fontSpec.iHeight = iFontSize; + iTypefaceStore = CFbsTypefaceStore::NewL(NULL); + + User::LeaveIfError(iTypefaceStore->GetNearestFontToDesignHeightInPixels( + iFont, fontSpec)); + + CalculateHelpWindowSize(); + + iHelpWindowTopRight = TPoint(iDisplaySize.iWidth / 2 + - iHelpWindowSize.iWidth / 2, iDisplaySize.iHeight / 2 + - iHelpWindowSize.iHeight / 2); + + iHelpWindow = new (ELeave) RWindow(iWs); + User::LeaveIfError(iHelpWindow->Construct(*iWindowGroup, KNullWsHandle)); + iHelpWindow->SetExtent(iHelpWindowTopRight, iHelpWindowSize); + iHelpWindow->SetTransparencyAlphaChannel(); + iHelpWindow->SetBackgroundColor(KRgbTransparent); + iHelpWindow->SetVisible(false); + iHelpWindow->Activate(); + + iSoftkeyIndex = iKeyMap[iCurrentPage].defaultSoftkeyIndex; + + // Only need to draw the help text when the options page is changed. Window is displayed later by + // toggling the visibility of the window. + DrawHelpText(); + + // THE FOLLOWING CODE IS COMMENTED OUT BECAUSE IT CAUSES A CRASH IN NCP BUILDS. + // THIS CAN BE ENABLED IN DFS BUILDS, TO ALLOW FOR TWO BUTTON OPERATION USING THE VOLUME KEYS. + // + // Since some phone have no keyboard or soft keys, treat the volume keys like the soft keys. + // SetupVolumeKeysL(); + } + +void CTestAppBase::SetupVolumeKeysL() + { + iInterfaceSelector = CRemConInterfaceSelector::NewL(); + iCoreTarget = CRemConCoreApiTarget::NewL(*iInterfaceSelector, *this); + iInterfaceSelector->OpenTargetL(); + } + +void CTestAppBase::StartMonitoringWindowEvents() + { + // Request notification for windows server events, to detect key presses. + SetActive(); + iWs.EventReady(&iStatus); + } + +TInt CTestAppBase::CurrentPageNumber() + { + return iCurrentPage + 1; + } + +TPtrC CTestAppBase::CurrentPageName() + { + return TPtrC(iKeyMap[iCurrentPage].pageName); + } + +TPtrC CTestAppBase::CurrentSoftkeyName() + { + return TPtrC(iKeyMap[iCurrentPage].mapping[iSoftkeyIndex].text); + } + +TPtrC CTestAppBase::KeyMapText(TInt aIndex, TInt aPage) + { + return TPtrC(iKeyMap[aPage].mapping[aIndex].text); + } + +TInt CTestAppBase::KeyMapOperation(TInt aIndex, TInt aPage) + { + return iKeyMap[aPage].mapping[aIndex].operation; + } + +void CTestAppBase::IncrementKeymapIndex(TInt& aIndex, TInt aPage) + { + aIndex = (aIndex + 1) % KSupportedKeysCount; + while (iKeyMap[aPage].mapping[aIndex].operation == KOperation_None) + { + aIndex = (aIndex + 1) % KSupportedKeysCount; + } + } + +void CTestAppBase::DecrementKeymapIndex(TInt& aIndex, TInt aPage) + { + aIndex = (aIndex + KSupportedKeysCount - 1) % KSupportedKeysCount; + while (iKeyMap[aPage].mapping[aIndex].operation == KOperation_None) + { + aIndex = (aIndex + KSupportedKeysCount - 1) % KSupportedKeysCount; + } + } + +void CTestAppBase::CalculateHelpWindowSize() + { + iHelpWindowColumn1Width = 0; + iHelpWindowColumn2Width = 0; + + // Find the widest strings for each column to determine the width of the window. + for (TInt index = 0; index < KSupportedKeysCount; index++) + { + TInt width = iFont->TextWidthInPixels(KeyName(index)); + if (width > iHelpWindowColumn1Width) + { + iHelpWindowColumn1Width = width; + } + + for (TInt index2 = 0; index2 < iPageCount; index2++) + { + width = iFont->TextWidthInPixels(KeyMapText(index, index2)); + if (width > iHelpWindowColumn2Width) + { + iHelpWindowColumn2Width = width; + } + } + } + + iHelpWindowSize.iWidth = 2 * KHelpWindowBorderPixels + + iHelpWindowColumn1Width + KHelpWindowSpaceBetweenColumns + + iHelpWindowColumn2Width; + + iHelpWindowSize.iHeight = 2 * KHelpWindowBorderPixels + iFontSize + * KSupportedKeysCount + KHelpWindowSpaceBetweenRows + * (KSupportedKeysCount - 1); + } + +CTestAppBase::TTestAppPointerEvent CTestAppBase::CharacterizePointerEvent( + TAdvancedPointerEvent& event) + { + TTestAppPointerEvent returnValue = EPointerEvent_None; + + RDebug::Printf("POINTER EVENT:"); + RDebug::Printf("iType=%i", event.iType); + RDebug::Printf("iModifiers=%x", event.iModifiers); + RDebug::Printf("iPosition=%i,%i", event.iPosition.iX, event.iPosition.iY); + RDebug::Printf("iParentPosition=%i,%i", event.iParentPosition.iX, + event.iParentPosition.iY); + RDebug::Printf("PointerNumber=%i", event.PointerNumber()); + RDebug::Printf("Proximity=%i", event.Proximity()); + RDebug::Printf("Pressure=%i", event.Pressure()); + RDebug::Printf("ProximityAndPressure=%i", event.ProximityAndPressure()); + RDebug::Printf("Position3D=%i,%i,%i", event.Position3D().iX, + event.Position3D().iY, event.Position3D().iZ); + RDebug::Printf("Pressure3D=%i,%i,%i", event.Pressure3D().iX, + event.Pressure3D().iY, event.Pressure3D().iZ); + RDebug::Printf("PositionAndPressure3D=%i,%i,%i", + event.PositionAndPressure3D().iX, + event.PositionAndPressure3D().iY, + event.PositionAndPressure3D().iZ); + + switch (event.iType) + { + case TPointerEvent::EButton1Down: + { + iPointerDownPosition = event.iPosition; + break; + } + case TPointerEvent::EButton1Up: + { + TInt xDelta = event.iPosition.iX - iPointerDownPosition.iX; + TInt yDelta = event.iPosition.iY - iPointerDownPosition.iY; + + TInt xMagnitude = xDelta; + if (xMagnitude < 0) + { + xMagnitude = -xMagnitude; + } + + TInt yMagnitude = yDelta; + if (yMagnitude < 0) + { + yMagnitude = -yMagnitude; + } + + const TInt KTapThreshold = 30; + + if (yMagnitude > xMagnitude) + { + if (yMagnitude < KTapThreshold) + { + RDebug::Printf("POINTER EVENT ENTER x=%i y=%i", xDelta, + yDelta); + returnValue = EPointerEvent_Select; + } + else if (yDelta < 0) + { + RDebug::Printf("POINTER EVENT UP x=%i y=%i", xDelta, + yDelta); + returnValue = EPointerEvent_Up; + } + else + { + RDebug::Printf("POINTER EVENT DOWN x=%i y=%i", xDelta, + yDelta); + returnValue = EPointerEvent_Down; + } + } + else + { + if (xMagnitude < KTapThreshold) + { + RDebug::Printf("POINTER EVENT ENTER x=%i y=%i", xDelta, + yDelta); + returnValue = EPointerEvent_Select; + } + else if (xDelta < 0) + { + RDebug::Printf("POINTER EVENT LEFT x=%i y=%i", xDelta, + yDelta); + returnValue = EPointerEvent_Left; + } + else + { + RDebug::Printf("POINTER EVENT RIGHT x=%i y=%i", xDelta, + yDelta); + returnValue = EPointerEvent_Right; + } + } + break; + } + } + + return returnValue; + } + +void CTestAppBase::RunL() + { + if (iWait.IsStarted()) + { + // This is an event during synchronous list selection. Stop the nested scheduler. + iWait.AsyncStop(); + return; + } + + TWsEvent event; + iWs.GetEvent(event); + + TInt operationIndex = -1; + + TInt scanCode = 0; + bool processScanCode = false; + + TInt operation = KOperation_None; + + // Other potentially useful events are EEventKeyUp and EEventKeyDown. + + if (event.Type() == EEventKey) + { + scanCode = event.Key()->iScanCode; + + RDebug::Printf("key event %x %c", scanCode, scanCode); + + // Allow subclasses a chance to consume the key event directly. If that happens, then + // do not handle the key as normal. + if (!ConsumeKeyEvent(scanCode)) + { + processScanCode = true; + } + } + else if (event.Type() == EEventPointer) + { + TAdvancedPointerEvent* p = event.Pointer(); + + TTestAppPointerEvent pointerEvent = CharacterizePointerEvent(*p); + + switch (pointerEvent) + { + case EPointerEvent_None: + // Do nothing. + break; + case EPointerEvent_Up: + operation = KOperation_PreviousOption; + break; + case EPointerEvent_Down: + operation = KOperation_NextOption; + break; + case EPointerEvent_Left: + operation = KOperation_PreviousOptionPage; + break; + case EPointerEvent_Right: + operation = KOperation_NextOptionPage; + break; + case EPointerEvent_Select: + operation = KOperation_ExecuteOption; + break; + } + } + + if (processScanCode) + { + // If one of the softkeys were pressed then take the appropriate action. + // This is to support a two button touch device with no numeric keypad. + // Support 'A' and 'B' also, for the NCP emulator where a keyboard is + // not displayed. + switch (scanCode) + { + case KLeftSoftKeyScanCode: + case 'a': + case 'A': + { + operation = KOperation_NextOption; + break; + } + case KRightSoftKeyScanCode: + case 'b': + case 'B': + { + // Execute softkey function. + operation = KOperation_ExecuteOption; + break; + } + default: + { + // Search for scancode in keymap. If not found then the key was not a valid + // key, so ignore. + TInt index = 0; + while ((index < KSupportedKeysCount) + && (operationIndex == -1)) + { + if (KSupportedKeys[index].scanCode == scanCode + || KSupportedKeys[index].scanCode2 == scanCode) + { + // Found! + operationIndex = index; + } + else + { + index++; + } + } + break; + } + } + } + + if (operation == KOperation_ExecuteOption) + { + operationIndex = iSoftkeyIndex; + } + + if (operationIndex >= 0) + { + operation = KeyMapOperation(operationIndex, iCurrentPage); + } + + if (operation != KOperation_None) + { + // Valid operation. + + switch (operation) + { + case KOperation_Exit: + { + CActiveScheduler::Stop(); + break; + } + case KOperation_PreviousOption: + { + // Change softkey function. + DecrementKeymapIndex(iSoftkeyIndex, iCurrentPage); + + // Redraw help text, since a new function should now be underlined. + DrawHelpText(); + + // Notify subclass that softkey function has been updated. + SoftkeyFunctionUpdated(); + break; + } + case KOperation_NextOption: + { + // Change softkey function. + IncrementKeymapIndex(iSoftkeyIndex, iCurrentPage); + + // Redraw help text, since a new function should now be underlined. + DrawHelpText(); + + // Notify subclass that softkey function has been updated. + SoftkeyFunctionUpdated(); + break; + } + case KOperation_PreviousOptionPage: + { + iCurrentPage = (iCurrentPage + iPageCount - 1) % iPageCount; + iSoftkeyIndex = iKeyMap[iCurrentPage].defaultSoftkeyIndex; + DrawHelpText(); + SoftkeyFunctionUpdated(); + break; + } + case KOperation_NextOptionPage: + { + iCurrentPage = (iCurrentPage + 1) % iPageCount; + iSoftkeyIndex = iKeyMap[iCurrentPage].defaultSoftkeyIndex; + DrawHelpText(); + SoftkeyFunctionUpdated(); + break; + } + case KOperation_ToggleHelpVisibility: + { + // Toggle help text on/off. + iHelpActive = !iHelpActive; + iHelpWindow->SetVisible(iHelpActive); + break; + } + case KOperation_ToggleHelpTransparency: + { + iHelpSemitransparentBackgroundActive + = !iHelpSemitransparentBackgroundActive; + if (iHelpSemitransparentBackgroundActive) + { + // Turn on help if it is currently off. + iHelpActive = true; + iHelpWindow->SetVisible(true); + } + DrawHelpText(); + break; + } + default: + { + // Pass operation to subclass. + TPtrC operatioName(KeyMapText(operationIndex, iCurrentPage)); + ExecuteOperation(operation, operatioName); + break; + } + } + } + + SetActive(); + iWs.EventReady(&iStatus); + } + +void CTestAppBase::DoCancel() + { + iWs.EventReadyCancel(); + } + +// TODO: ALLOW SUBCLASS TO SPECIFY COLOR SELECTIONS + +TInt CTestAppBase::SelectFromListL(TPoint aTopLeft, TSize aSize, + const TDesC& aHeaderText, RPointerArray& aSelectionList, + TInt aInitialSelectionIndex) + { + iSelectionWindow->SetExtent(aTopLeft, aSize); + iSelectionWindow->SetVisible(true); + + const TInt KRowIncrement = iFontSize + 2; + + TInt entriesPerPage = aSize.iHeight / KRowIncrement - 4; + + TInt returnValue = -2; + TInt startIndex = 0; + TInt selected = aInitialSelectionIndex; + + while (returnValue == -2) + { + iGc->Activate(*iSelectionWindow); + + iSelectionWindow->Invalidate(); + iSelectionWindow->BeginRedraw(); + + iGc->Reset(); + + iGc->UseFont(iFont); + iGc->SetBrushColor(KRgbDarkBlue); + + iGc->Clear(); + + // KRgbWhite seems to be having problems (0xffffff) in some emulators, + // but 0xfefefe is working, so use that instead of white. + iGc->SetPenColor(0xfefefe); + + const TInt KHeaderColumn = 5; + const TInt KEntryColumn = 15; + + TInt row = KRowIncrement; + + iGc->SetUnderlineStyle(EUnderlineOff); + + iGc->DrawText(aHeaderText, TPoint(KHeaderColumn, row)); + row += (KRowIncrement + 5); + + TBool again = true; + TInt backIndex = -1; + TInt forwardIndex = -1; + TInt offset = 0; + + while (again) + { + if (selected == offset) + { + iGc->SetUnderlineStyle(EUnderlineOn); + } + else + { + iGc->SetUnderlineStyle(EUnderlineOff); + } + + if ((offset < entriesPerPage) && (startIndex + offset + < aSelectionList.Count())) + { + iGc->DrawText(*aSelectionList[startIndex + offset], TPoint( + KEntryColumn, row)); + row += KRowIncrement; + + offset++; + } + else + { + again = false; + if (startIndex + offset < aSelectionList.Count()) + { + iGc->DrawText(_L(""), + TPoint(KEntryColumn, row)); + row += KRowIncrement; + + forwardIndex = offset; + offset++; + } + if (startIndex > 0) + { + iGc->DrawText(_L(""), TPoint(KEntryColumn, row)); + row += KRowIncrement; + + backIndex = offset; + offset++; + } + } + } + + iSelectionWindow->EndRedraw(); + + iGc->Deactivate(); + + TInt scanCode = WaitForAnyKey(); + + switch (scanCode) + { + case EStdKeyUpArrow: + if (selected == 0) + { + selected = offset - 1; + } + else + { + selected -= 1; + } + break; + + case EStdKeyDownArrow: + case KLeftSoftKeyScanCode: + case 'a': + case 'A': + selected += 1; + if (selected == offset) + { + selected = 0; + } + break; + + case EStdKeyLeftArrow: + if (backIndex >= 0) + { + startIndex -= entriesPerPage; + selected = 0; + } + else + { + returnValue = -1; + again = false; + } + break; + + case EStdKeyRightArrow: + if (forwardIndex >= 0) + { + startIndex += entriesPerPage; + selected = 0; + } + break; + + case EStdKeyEnter: + case KRightSoftKeyScanCode: + case 'b': + case 'B': + if (selected == forwardIndex) + { + startIndex += entriesPerPage; + selected = 0; + } + else if (selected == backIndex) + { + startIndex -= entriesPerPage; + selected = 0; + } + else + { + returnValue = startIndex + selected; + } + break; + } + } + + iSelectionWindow->SetVisible(false); + + return returnValue; + } + +bool CTestAppBase::SelectDriveL(TPoint aTopLeft, TSize aWindowSize, + const TDesC& aHeaderText, TDes& aDrive) + { + RPointerArray drives; + + // Select drive letter. + drives.Append(&KDriveC); + drives.Append(&KDriveE); + drives.Append(&KDriveF); + drives.Append(&KDriveZ); + + TInt index = SelectFromListL(aTopLeft, aWindowSize, aHeaderText, drives); + + bool returnValue = false; + + if (index >= 0) + { + returnValue = true; + aDrive.Copy(*(drives[index])); + aDrive.Append(_L("\\")); + } + + drives.Reset(); + + return returnValue; + } + +bool CTestAppBase::SelectFileL(TPoint aTopLeft, TSize aWindowSize, + const TDesC& aHeaderText, const TDesC& aDrive, TDes& aFullFilename) + { + TFileName directory; + + DoSelectFileL(aTopLeft, aWindowSize, aHeaderText, aDrive, 0, directory, + aFullFilename); + + aFullFilename.Insert(0, directory); + + return aFullFilename.Length() > 0; + } + +bool CTestAppBase::SelectFileWithHistoryL(TPoint aTopLeft, TSize aSize, + TDes& aFullFilename, const TDesC& aHistoryFilename, + TInt aMaxHistoryEntries) + { + RPointerArray selections; + + selections.Append(&KDriveC); + selections.Append(&KDriveE); + selections.Append(&KDriveF); + selections.Append(&KDriveZ); + + // Add file history to the end of the drive list. Newest files are last, so add in reverse order. + ReadFileHistory(aHistoryFilename); + for (TInt index = iFileHistory.Count() - 1; index >= 0; index--) + { + selections.Append(iFileHistory[index]); + } + + bool done = false; + bool selected = true; + + while (!done) + { + TInt index = SelectFromListL(aTopLeft, aSize, + _L("Select drive or recent file:"), selections); + + if (index < 0) + { + selected = false; + done = true; + } + else if (index < 4) + { + TBuf<10> drive; + drive.Copy(*(selections[index])); + drive.Append(_L("\\")); + + done = SelectFileL(aTopLeft, aSize, _L("Select file:"), drive, + aFullFilename); + } + else + { + // Remove the selected file from the history, so that it will pop up to the top of the list + // as the most recently selected file. + TInt historyIndex = iFileHistory.Count() - index + 3; + iFileHistory.Remove(historyIndex); + aFullFilename.Copy(*(selections[index])); + + done = true; + } + } + + if (selected) + { + AddToFileHistory(aFullFilename, aHistoryFilename, aMaxHistoryEntries); + } + + selections.Reset(); + + return selected; + } + +bool CTestAppBase::SelectIntegerL(TPoint aTopLeft, TSize aSize, + const TDesC& aHeaderText, TInt aMin, TInt aMax, TInt& aSelection) + { + // currently no way to exit out of this selection + + iSelectionWindow->SetExtent(aTopLeft, aSize); + iSelectionWindow->SetVisible(true); + + bool done = false; + + while (!done) + { + iGc->Activate(*iSelectionWindow); + + iSelectionWindow->Invalidate(); + iSelectionWindow->BeginRedraw(); + + iGc->Reset(); + + iGc->UseFont(iFont); + iGc->SetBrushColor(KRgbDarkBlue); + + iGc->Clear(); + + // KRgbWhite seems to be having problems (0xffffff) in some emulators, + // but 0xfefefe is working, so use that instead of white. + iGc->SetPenColor(0xfefefe); + + TBuf<120> buffer; + buffer.Copy(aHeaderText); + buffer.AppendFormat(_L(" %i"), aSelection); + + iGc->DrawText(buffer, TPoint(5, iFontSize + 2)); + + iSelectionWindow->EndRedraw(); + + iGc->Deactivate(); + + TInt scanCode = WaitForAnyKey(); + + switch (scanCode) + { + case EStdKeyUpArrow: + aSelection -= 10; + break; + + case EStdKeyDownArrow: + case KLeftSoftKeyScanCode: + case 'a': + case 'A': + aSelection += 10; + break; + + case EStdKeyLeftArrow: + aSelection--; + break; + + case EStdKeyRightArrow: + aSelection++; + break; + + case EStdKeyEnter: + case KRightSoftKeyScanCode: + case 'b': + case 'B': + done = true; + break; + } + + if (aSelection > aMax) + { + aSelection = aMin; + } + else if (aSelection < aMin) + { + aSelection = aMax; + } + } + + iSelectionWindow->SetVisible(false); + + return true; + } + +TInt CTestAppBase::WaitForAnyKey() + { + TInt returnValue = 0; + + bool done = false; + + while (!done) + { + // Have to use this tricky nested active scheduler technique to allow the active object + // used to remap volume keys to run. + SetActive(); + iWs.EventReady(&iStatus); + iWait.Start(); + + TWsEvent event; + iWs.GetEvent(event); + + // Other potentially useful events are EEventKeyUp and EEventKeyDown. + + if (event.Type() == EEventKey) + { + done = true; + returnValue = event.Key()->iScanCode; + } + else if (event.Type() == EEventPointer) + { + TAdvancedPointerEvent* p = event.Pointer(); + + TTestAppPointerEvent pointerEvent = CharacterizePointerEvent(*p); + + switch (pointerEvent) + { + case EPointerEvent_None: + // Do nothing. + break; + case EPointerEvent_Up: + returnValue = EStdKeyUpArrow; + done = true; + break; + case EPointerEvent_Down: + returnValue = EStdKeyDownArrow; + done = true; + break; + case EPointerEvent_Left: + returnValue = EStdKeyLeftArrow; + done = true; + break; + case EPointerEvent_Right: + returnValue = EStdKeyRightArrow; + done = true; + break; + case EPointerEvent_Select: + returnValue = EStdKeyEnter; + done = true; + break; + } + } + } + + return returnValue; + } + +void CTestAppBase::ReadFileHistory(const TDesC& aHistoryFilename) + { + iFileHistory.Reset(); + + RFile historyFile; + TInt err = historyFile.Open(iFs, aHistoryFilename, EFileShareReadersOnly + | EFileStream | EFileRead); + + if (err == KErrNone) + { + TInt historyFileSize; + historyFile.Size(historyFileSize); + + RBuf8 contents; + contents.Create(historyFileSize); + + historyFile.Read(contents, historyFileSize); + + historyFile.Close(); + + TPtrC8 remaining(contents); + + while (remaining.Length() > 0) + { + TInt separatorIndex = remaining.Locate('\n'); + + if (separatorIndex < 0) + { + separatorIndex = remaining.Length(); + } + + HBufC* filename = HBufC::NewL(separatorIndex); + TPtrC8 filename8 = remaining.Left(separatorIndex); + filename->Des().Copy(filename8); + + iFileHistory.Append(filename); + + TInt remainingLength = remaining.Length() - separatorIndex - 1; + + if (remainingLength > 0) + { + remaining.Set(remaining.Right(remaining.Length() + - separatorIndex - 1)); + } + else + { + break; + } + } + + contents.Close(); + } + } + +void CTestAppBase::AddToFileHistory(const TDesC& aFilename, + const TDesC& aHistoryFilename, TInt aMaxHistoryEntries) + { + HBufC* filename = HBufC::NewL(aFilename.Length()); + filename->Des().Copy(aFilename); + iFileHistory.Append(filename); + + while (iFileHistory.Count() > aMaxHistoryEntries) + { + delete iFileHistory[0]; + iFileHistory.Remove(0); + } + + RFile historyFile; + TInt err = historyFile.Create(iFs, aHistoryFilename, EFileStream + | EFileWrite); + if (err == KErrAlreadyExists) + { + err = historyFile.Open(iFs, aHistoryFilename, EFileStream + | EFileWrite); + historyFile.SetSize(0); + } + + if (err == KErrNone) + { + for (TInt index = 0; index < iFileHistory.Count(); index++) + { + TBuf8 filename8; + filename8.Copy(iFileHistory[index]->Des()); + historyFile.Write(filename8); + historyFile.Write(_L8("\n")); + } + } + + historyFile.Close(); + } + +void CTestAppBase::DoSelectFileL(TPoint aTopRight, TSize aWindowSize, + const TDesC& aHeaderText, const TFileName& aDirectory, + TInt aDirectoryLevel, TDes& aSelectedDirectory, + TDes& aSelectedFilename) + { + RPointerArray fileNames; + + ReadDirectoryEntriesL(aDirectory, fileNames); + + TInt initialSelectionIndex = 0; + _LIT( KUp, ".." ); + if (aDirectoryLevel > 0) + { + TFileName* newEntry = new (ELeave) TFileName; + newEntry->Copy(KUp); + fileNames.Insert(newEntry, 0); + initialSelectionIndex++; + } + + bool done = false; + + while (!done && (aSelectedFilename.Length() == 0)) + { + TInt index = SelectFromListL(aTopRight, aWindowSize, aHeaderText, + fileNames, initialSelectionIndex); + + if (index == -1) + { + done = true; + } + else if (fileNames[index]->Compare(KUp) == 0) + { + // Go up one directory. Return to caller without setting aFilename + break; + } + else if ((*fileNames[index])[fileNames[index]->Length() - 1] == '\\') + { + // Directory selected. + TFileName directory; + directory.Copy(aDirectory); + directory.Append(*fileNames[index]); + DoSelectFileL(aTopRight, aWindowSize, aHeaderText, directory, + aDirectoryLevel + 1, aSelectedDirectory, + aSelectedFilename); + } + else + { + // File selected. + aSelectedDirectory.Copy(aDirectory); + aSelectedFilename.Copy(*fileNames[index]); + done = true; + } + + } + + fileNames.ResetAndDestroy(); + } + +void CTestAppBase::ReadDirectoryEntriesL(const TFileName& aDirectoryName, + RPointerArray& aFileNames) + { + aFileNames.ResetAndDestroy(); + + RDir dir; + User::LeaveIfError(dir.Open(iFs, aDirectoryName, KEntryAttNormal + | KEntryAttDir)); + + TEntryArray entries; + TInt err = KErrNone; + while (err == KErrNone) + { + err = dir.Read(entries); + + for (TInt index = 0; index < entries.Count(); index++) + { + TFileName* newTail = new (ELeave) TFileName; + newTail->Copy(entries[index].iName); + if (entries[index].IsDir()) + { + newTail->Append(_L("\\")); + } + aFileNames.Append(newTail); + } + } + + dir.Close(); + } + +void CTestAppBase::DrawHelpText() + { + iGc->Activate(*iHelpWindow); + + iHelpWindow->Invalidate(); + iHelpWindow->BeginRedraw(); + + iGc->Reset(); + + iGc->UseFont(iFont); + iGc->SetBrushColor(KRgbTransparent); + + iGc->Clear(); + + if (iHelpSemitransparentBackgroundActive) + { + iGc->SetPenColor(KRgbTransparent); + iGc->SetBrushStyle(CWindowGc::ESolidBrush); + iGc->SetBrushColor(TRgb(0x7f7f7faf)); + iGc->DrawRect(TRect(iHelpWindowSize)); + } + + // KRgbWhite seems to be having problems (0xffffff) in some emulators, + // but 0xfefefe is working, so use that instead of white. + iGc->SetPenColor(0xfefefe); + + const TInt KColumn1 = KHelpWindowBorderPixels; + const TInt KColumn2 = KColumn1 + iHelpWindowColumn1Width + + KHelpWindowSpaceBetweenColumns; + const TInt KRowIncrement = iFontSize + KHelpWindowSpaceBetweenRows; + + TInt row = iFontSize + KHelpWindowBorderPixels; + + for (TInt index = 0; index < KSupportedKeysCount; index++) + { + iGc->SetUnderlineStyle(EUnderlineOff); + + TPtrC text = KeyMapText(index, iCurrentPage); + + iGc->DrawText(KeyName(index), TPoint(KColumn1, row)); + + if (index == iSoftkeyIndex) + { + iGc->SetUnderlineStyle(EUnderlineOn); + } + else + { + iGc->SetUnderlineStyle(EUnderlineOff); + } + + iGc->DrawText(text, TPoint(KColumn2, row)); + + row += KRowIncrement; + } + + iHelpWindow->EndRedraw(); + + iGc->Deactivate(); + } + +void CTestAppBase::MrccatoCommand(TRemConCoreApiOperationId aOperationId, + TRemConCoreApiButtonAction /*aButtonAct*/) + { + // Treat volume up like the right soft key, and volume down like the left soft key. + TKeyEvent keyEvent; + keyEvent.iCode = 0; + keyEvent.iScanCode = 0; + keyEvent.iModifiers = 0; + keyEvent.iRepeats = 0; + + switch (aOperationId) + { + case ERemConCoreApiVolumeUp: + keyEvent.iScanCode = KRightSoftKeyScanCode; + iWs.SimulateKeyEvent(keyEvent); + iWs.Flush(); + break; + case ERemConCoreApiVolumeDown: + keyEvent.iScanCode = KLeftSoftKeyScanCode; + iWs.SimulateKeyEvent(keyEvent); + iWs.Flush(); + break; + default: + break; + } + } diff -r 5a06f39ad45b -r 80975da52420 mmserv/sts/tsrc/ststester/src/testappbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/sts/tsrc/ststester/src/testappbase.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * Header specifying the common test functionality. + */ + +#ifndef TESTAPPBASE_H_ +#define TESTAPPBASE_H_ + +#include +#include +#include // for volume key handling +class CRemConCoreApiTarget; +class CRemConInterfaceSelector; + +#define STR(a) (TText*)L##a + +// 15 keys are supported. The keys are in this order: +// Enter, Up, Down, Left, Right, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 +const TInt KSupportedKeysCount = 15; + +struct TOperationEntry + { + const TText* text; + TInt operation; + }; + +struct TOperationsPage + { + const TText* pageName; + TInt defaultSoftkeyIndex; + TOperationEntry mapping[KSupportedKeysCount]; + }; + +// Predefined standard operations +const TInt KOperation_None = 0; +const TInt KOperation_Exit = 1; +const TInt KOperation_PreviousOptionPage = 2; +const TInt KOperation_NextOptionPage = 3; +const TInt KOperation_NextOption = 4; +const TInt KOperation_PreviousOption = 5; +const TInt KOperation_ExecuteOption = 6; +const TInt KOperation_ToggleHelpVisibility = 7; +const TInt KOperation_ToggleHelpTransparency = 8; +const TInt KOperation_FirstCustomIndex = 10; // app-specific operations can start here + +const TUint32 KNullWsHandle = 0xFFFFFFFF; + +class CTestAppBase : public CActive, private MRemConCoreApiTargetObserver + { +public: + + CTestAppBase(TInt aFontSize); + + ~CTestAppBase(); + + // inherited from CActive + void RunL(); + void DoCancel(); + +protected: + + virtual void ExecuteOperation(TInt aOperation, + const TDesC& aOperationText) = 0; + + // Subclasses can override this function to take action when the current softkey function has been changed. + virtual void SoftkeyFunctionUpdated() + { + } + ; + + // Subclasses can override this function to override the default key event handling. + virtual bool ConsumeKeyEvent(TInt /*aScanCode*/) + { + return false; + } + ; + + void BaseConstructL(const TOperationsPage* aKeyMap, TInt aPageCount); + + void SetupVolumeKeysL(); + + void StartMonitoringWindowEvents(); + + TInt CurrentPageNumber(); + + TPtrC CurrentPageName(); + + TPtrC CurrentSoftkeyName(); + + // Presents a selection list to the user and returns the index of the selected entry. + // Synchronous call. + // returns -1 if the selection was backed out without making a selection + TInt SelectFromListL(TPoint aTopLeft, TSize aSize, + const TDesC& aHeaderText, RPointerArray& aSelectionList, + TInt aInitialSelectionIndex = 0); + + // Synchronous call. + // returns false if the selection was backed out without making a selection + bool SelectDriveL(TPoint aTopLeft, TSize aSize, const TDesC& aHeaderText, + TDes& aDrive); + + // Synchronous call. + // returns false if the selection was backed out without making a selection + bool SelectFileL(TPoint aTopLeft, TSize aSize, const TDesC& aHeaderText, + const TDesC& aDrive, TDes& aFullFilename); + + // Synchronous call. + // returns false if the selection was backed out without making a selection + bool SelectFileWithHistoryL(TPoint aTopLeft, TSize aSize, + TDes& aFullFilename, const TDesC& aHistoryFilename, + TInt aMaxHistoryEntries); + + // Synchronous call. + // returns false if the selection was backed out without making a selection + bool SelectIntegerL(TPoint aTopLeft, TSize aSize, + const TDesC& aHeaderText, TInt aMin, TInt aMax, TInt& aSelection); // set aSelection to default value + + // Synchronous call. Returns the scan code of the pressed key. + TInt WaitForAnyKey(); + + const TInt iFontSize; + + RFs iFs; + RWsSession iWs; + CWsScreenDevice* iScreenDevice; + RWindowGroup* iWindowGroup; + CWindowGc* iGc; + CFont* iFont; + CFbsTypefaceStore* iTypefaceStore; + TSize iDisplaySize; + RWindow* iSelectionWindow; + RWindow* iHelpWindow; + +private: + + enum TTestAppPointerEvent + { + EPointerEvent_None, + EPointerEvent_Up, + EPointerEvent_Down, + EPointerEvent_Left, + EPointerEvent_Right, + EPointerEvent_Select + }; + + // inherited from MRemConCoreApiTargetObserver + void MrccatoCommand(TRemConCoreApiOperationId aOperationId, + TRemConCoreApiButtonAction aButtonAct); + + TInt KeyMapOperation(TInt aIndex, TInt aPage); + + TPtrC KeyMapText(TInt aIndex, TInt aPage); + + void IncrementKeymapIndex(TInt& aIndex, TInt aPage); + + void DecrementKeymapIndex(TInt& aIndex, TInt aPage); + + void CalculateHelpWindowSize(); + + void DrawHelpText(); + + void DoSelectFileL(TPoint aTopRight, TSize aWindowSize, + const TDesC& aHeaderText, const TFileName& aDirectory, + TInt aDirectoryLevel, TDes& aSelectedDirectory, + TDes& aSelectedFilename); + + void ReadDirectoryEntriesL(const TFileName& aDirectoryName, + RPointerArray& aFileNames); + + void ReadFileHistory(const TDesC& aHistoryFilename); + + void AddToFileHistory(const TDesC& aFilename, + const TDesC& aHistoryFilename, TInt aMaxHistoryEntries); + + TTestAppPointerEvent CharacterizePointerEvent( + TAdvancedPointerEvent& event); + + const TOperationsPage* iKeyMap; + TInt iPageCount; + TInt iCurrentPage; + TInt iSoftkeyIndex; + RPointerArray iFileHistory; + + CActiveSchedulerWait iWait; + + TPoint iHelpWindowTopRight; + TSize iHelpWindowSize; + TInt iHelpWindowColumn1Width; + TInt iHelpWindowColumn2Width; + bool iHelpActive; + bool iHelpSemitransparentBackgroundActive; + + TPoint iPointerDownPosition; + + // For volume key support + CRemConCoreApiTarget* iCoreTarget; + CRemConInterfaceSelector* iInterfaceSelector; + }; + +#endif // TESTAPPBASE_H_ diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/inc/tmsclientserver.h --- a/mmserv/tms/inc/tmsclientserver.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/inc/tmsclientserver.h Mon May 03 12:59:52 2010 +0300 @@ -128,6 +128,7 @@ gint iStatus; gboolean iBool; gint iInt; + gint iInt2; gint64 iInt64; guint iUint; guint32 iUint32; diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/inc/tmsproxy.h --- a/mmserv/tms/inc/tmsproxy.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/inc/tmsproxy.h Mon May 03 12:59:52 2010 +0300 @@ -116,7 +116,7 @@ gpointer obsrvr); // From MQueueHandlerObserver - virtual void QueueEvent(gint aEventType, gint aError, void* user_data); + virtual void QueueEvent(gint aEventType, gint aError, void* event_data); private: void PopulateArrayL(TMSClientServerRequest aRequest, diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/inc/tmsqueuehandler.h --- a/mmserv/tms/inc/tmsqueuehandler.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/inc/tmsqueuehandler.h Mon May 03 12:59:52 2010 +0300 @@ -37,7 +37,8 @@ class MQueueHandlerObserver { public: - virtual void QueueEvent(gint aEventType, gint aError, void* user_data) = 0; + virtual void QueueEvent(gint aEventType, gint aError, + void* event_data) = 0; }; /** diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsapi/src/tmsinbandtone.cpp --- a/mmserv/tms/tmsapi/src/tmsinbandtone.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsapi/src/tmsinbandtone.cpp Mon May 03 12:59:52 2010 +0300 @@ -21,7 +21,6 @@ using namespace TMS; - EXPORT_C TMSInbandTone::TMSInbandTone(void) : iBody(NULL) { @@ -32,7 +31,8 @@ delete iBody; } -EXPORT_C gint TMSInbandTone::AddObserver(TMSInbandToneObserver& obsrvr, gpointer user_data) +EXPORT_C gint TMSInbandTone::AddObserver(TMSInbandToneObserver& obsrvr, + gpointer user_data) { gint status(TMS_RESULT_UNINITIALIZED_OBJECT); if (iBody) diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/group/tmscallserver.mmp --- a/mmserv/tms/tmscallserver/group/tmscallserver.mmp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmscallserver/group/tmscallserver.mmp Mon May 03 12:59:52 2010 +0300 @@ -35,28 +35,28 @@ SOURCE tmscallserver.cpp SOURCE tmscallsrvrstart.cpp -SOURCE delaytimer.cpp +SOURCE tmsdelaytimer.cpp SOURCE tmscallsession.cpp -SOURCE calladpt.cpp -SOURCE callcsadpt.cpp -SOURCE callipadpt.cpp -SOURCE ipcallstreambase.cpp +SOURCE tmscalladpt.cpp +SOURCE tmscallcsadpt.cpp +SOURCE tmscallipadpt.cpp +SOURCE tmsipcallstreambase.cpp #ifdef __USE_GSTREAMER__ -SOURCE ipcalldownlink.cpp -SOURCE ipcalluplink.cpp +SOURCE tmsipcalldownlink.cpp +SOURCE tmsipcalluplink.cpp #else //__USE_GSTREAMER__ -SOURCE ipcalldownlinkds.cpp -SOURCE ipcalluplinkds.cpp +SOURCE tmsipcalldownlinkds.cpp +SOURCE tmsipcalluplinkds.cpp #endif //__USE_GSTREAMER__ -SOURCE cspdevsound.cpp -SOURCE csdownlink.cpp -SOURCE csuplink.cpp -SOURCE tarsettings.cpp -SOURCE cpeaudiodtmftoneplayer.cpp -SOURCE cspdtmfprovider.cpp -SOURCE cspeteldtmfmonitor.cpp -SOURCE cspeteldtmfstopmonitor.cpp -SOURCE dtmfnotifier.cpp +SOURCE tmscsdevsound.cpp +SOURCE tmscsdownlink.cpp +SOURCE tmscsuplink.cpp +SOURCE tmstarsettings.cpp +SOURCE tmsdtmftoneplayer.cpp +SOURCE tmsdtmfprovider.cpp +SOURCE tmseteldtmfmonitor.cpp +SOURCE tmseteldtmfstopmonitor.cpp +SOURCE tmsdtmfnotifier.cpp USERINCLUDE ../inc USERINCLUDE ../../inc diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/calladpt.h --- a/mmserv/tms/tmscallserver/inc/calladpt.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef CALLADPT_H -#define CALLADPT_H - -#include -#include - -namespace TMS { - -// TMSCallAdpt class -class TMSCallAdpt - { -public: - static gint CreateCallL(gint callType, TMSCallAdpt*& callAdpt); - virtual ~TMSCallAdpt(); - virtual gint CreateStream(TMSCallType callType, - TMSStreamType strmType, gint& outStrmId) = 0; - virtual gint InitStreamL(TMSCallType callType, - TMSStreamType strmType, gint strmId, TMSFormatType frmtType, - const RMessage2& aMessage) = 0; - virtual gint StartStream(TMSCallType callType, - TMSStreamType strmType, gint strmId) = 0; - virtual gint PauseStream(TMSCallType callType, - TMSStreamType strmType, gint strmId) = 0; - virtual gint StopStream(TMSCallType callType, TMSStreamType strmType, - gint strmId) = 0; - virtual gint DeinitStream(TMSCallType callType, - TMSStreamType strmType, gint strmId) = 0; - virtual gint DeleteStream(TMSCallType callType, - TMSStreamType strmType, gint strmId) = 0; - virtual gint DataXferBufferEmptied(TMSCallType callType, - TMSStreamType strmType, gint strmId) = 0; - virtual gint DataXferBufferFilled(TMSCallType callType, - TMSStreamType strmType, gint strmId, guint datasize) = 0; - virtual gint GetDataXferBufferHndl(const TMSCallType callType, - const TMSStreamType strmType, const gint strmId, - const guint32 key, RChunk& chunk) = 0; - - virtual gint GetMaxVolume(guint& volume) = 0; - virtual gint SetVolume(const guint volume) = 0; - virtual gint GetVolume(guint& volume) = 0; - virtual gint GetMaxGain(guint& gain) = 0; - virtual gint SetGain(const guint gain) = 0; - virtual gint GetGain(guint& gain) = 0; - virtual gint GetGlobalMaxVolume(guint& volume) = 0; - virtual gint SetGlobalVolume(const guint volume) = 0; - virtual gint GetGlobalVolume(guint& volume) = 0; - virtual gint GetGlobalMaxGain(guint& gain) = 0; - virtual gint SetGlobalGain(const guint gain) = 0; - virtual gint GetGlobalGain(guint& gain) = 0; - - virtual gint GetCodecMode(const TMSFormatType fmttype, - const TMSStreamType strmtype, gint& mode) = 0; - virtual gint SetCodecMode(const TMSFormatType fmttype, - const TMSStreamType strmtype, const gint mode) = 0; - virtual gint GetSupportedBitRatesCount(guint& count) = 0; - virtual gint GetSupportedBitRates(CBufFlat*& brbuffer) = 0; - virtual gint GetBitRate(guint& bitrate) = 0; - virtual gint SetBitRate(const guint bitrate) = 0; - virtual gint GetVAD(const TMSFormatType fmttype, gboolean& vad) = 0; - virtual gint SetVAD(const TMSFormatType fmttype, const gboolean vad) = 0; - virtual gint GetCNG(const TMSFormatType fmttype, gboolean& cng) = 0; - virtual gint SetCNG(const TMSFormatType fmttype, const gboolean cng) = 0; - virtual gint GetPlc(const TMSFormatType fmttype, gboolean& plc) = 0; - virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc) = 0; - virtual gint SetOutput(TMSAudioOutput output) = 0; - virtual gint GetOutput(TMSAudioOutput& output) = 0; - virtual gint GetPreviousOutput(TMSAudioOutput& output) = 0; - virtual gint GetAvailableOutputsL(gint& count, - CBufFlat*& outputsbuffer) = 0; - virtual gint StartDTMF(TMSStreamType streamtype, TDes& dtmfstring) = 0; - virtual gint StopDTMF(TMSStreamType streamtype) = 0; - virtual gint ContinueDTMF(TBool continuesending) = 0; - -protected: - TMSCallAdpt(); - virtual gint PostConstruct(); - -protected: - gint iGlobalVol; - gint iGlobalGain; - }; - -} //namespace TMS - -#endif // CALLADPT_H - -// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/callcsadpt.h --- a/mmserv/tms/tmscallserver/inc/callcsadpt.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef CALLCSADPT_H -#define CALLCSADPT_H - -#include -#include -#include -#include -#include -#include "tmsclientserver.h" -#include "dtmftoneplayerobserver.h" -#include "calladpt.h" -#include "mcspdevsoundobserver.h" -#include "mccpdtmfobserver.h" - -namespace TMS { - -// FORWARD DECLARATIONS -class TMSCSUplink; -class TMSCSDownlink; -class TMSTarSettings; -class TMSAudioDtmfTonePlayer; -class TMSDTMFProvider; -class TMSDtmfNotifier; - -/* - * CallCSAdapt class - */ -class TMSCallCSAdpt : public TMSCallAdpt, - public TMSCSPDevSoundObserver, - public MTelephonyAudioRoutingObserver, - public TMSDTMFTonePlayerObserver, - public TMSCCPDTMFObserver - { -public: - TMSCallCSAdpt(); - virtual ~TMSCallCSAdpt(); - virtual gint PostConstruct(); - - virtual gint CreateStream(TMSCallType callType, TMSStreamType strmType, - gint& outStrmId); - virtual gint InitStreamL(TMSCallType callType, TMSStreamType strmType, - gint strmId, TMSFormatType frmtType, const RMessage2& aMessage); - virtual gint StartStream(TMSCallType callType, TMSStreamType strmType, - gint strmId); - virtual gint PauseStream(TMSCallType callType, TMSStreamType strmType, - gint strmId); - virtual gint StopStream(TMSCallType callType, TMSStreamType strmType, - gint strmId); - virtual gint DeinitStream(TMSCallType callType, TMSStreamType strmType, - gint strmId); - virtual gint DeleteStream(TMSCallType callType, TMSStreamType strmType, - gint strmId); - virtual gint DataXferBufferEmptied(TMSCallType callType, - TMSStreamType strmType, gint strmId); - virtual gint DataXferBufferFilled(TMSCallType callType, - TMSStreamType strmType, gint strmId, guint datasize); - virtual gint GetDataXferBufferHndl(const TMSCallType callType, - const TMSStreamType strmType, const gint strmId, - const guint32 key, RChunk& chunk); - virtual gint GetMaxVolume(guint& volume); - virtual gint SetVolume(const guint volume); - virtual gint GetVolume(guint& volume); - virtual gint GetMaxGain(guint& gain); - virtual gint SetGain(const guint gain); - virtual gint GetGain(guint& gain); - virtual gint GetGlobalMaxVolume(guint& volume); - virtual gint SetGlobalVolume(const guint volume); - virtual gint GetGlobalVolume(guint& volume); - virtual gint GetGlobalMaxGain(guint& gain); - virtual gint SetGlobalGain(const guint gain); - virtual gint GetGlobalGain(guint& gain); - - virtual gint GetCodecMode(const TMSFormatType fmttype, - const TMSStreamType strmtype, gint& mode); - virtual gint SetCodecMode(const TMSFormatType fmttype, - const TMSStreamType strmtype, const gint mode); - virtual gint GetSupportedBitRatesCount(guint& count); - virtual gint GetSupportedBitRates(CBufFlat*& brbuffer); - virtual gint GetBitRate(guint& bitrate); - virtual gint SetBitRate(const guint bitrate); - virtual gint GetVAD(const TMSFormatType fmttype, gboolean& vad); - virtual gint SetVAD(const TMSFormatType fmttype, const gboolean vad); - virtual gint GetCNG(const TMSFormatType fmttype, gboolean& cng); - virtual gint SetCNG(const TMSFormatType fmttype, const gboolean cng); - virtual gint GetPlc(const TMSFormatType fmttype, gboolean& plc); - virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc); - - virtual gint SetOutput(TMSAudioOutput output); - virtual gint GetOutput(TMSAudioOutput& output); - virtual gint GetPreviousOutput(TMSAudioOutput& output); - virtual gint GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuffer); - virtual gint StartDTMF(TMSStreamType streamtype, TDes& dtmfstring); - virtual gint StopDTMF(TMSStreamType streamtype); - virtual gint ContinueDTMF(TBool continuesending); - - void NotifyClient(const gint strmId, const gint aCommand, - const gint aStatus = KErrNone, const gint64 aInt64 = TInt64(0)); - - //From TMSCSPDevSoundObserver - void DownlinkInitCompleted(TInt status); - void UplinkInitCompleted(TInt status); - void UplinkActivatedSuccessfully(); - void DownlinkActivatedSuccessfully(); - void UplinkActivationFailed(); - void DownlinkActivationFailed(); - - //From DTMFTonePlayerObserver - void DTMFInitCompleted(TInt error); - void DTMFToneFinished(TInt error); - - //From TMSCCPDTMFObserver - void HandleDTMFEvent(const TMSCCPDTMFObserver::TCCPDtmfEvent aEvent, - const TInt aError, const TChar aTone); - -protected: - void AvailableOutputsChanged( - CTelephonyAudioRouting& aTelephonyAudioRouting); - void OutputChanged(CTelephonyAudioRouting& aTelephonyAudioRouting); - void SetOutputComplete(CTelephonyAudioRouting& aTelephonyAudioRouting, - gint aError); - void GetSupportedBitRatesL(CBufFlat*& brbuffer); - -private: - gint iNextStreamId; - - TMSCSUplink* iCSUplink; - TMSCSDownlink* iCSDownlink; - CTelephonyAudioRouting* iRouting; - TMSTarSettings* iTarSettings; - TMSAudioDtmfTonePlayer* iDTMFDnlinkPlayer; - TMSDtmfNotifier* iDTMFNotifier; - TMSDTMFProvider* iDTMFUplinkPlayer; - TMSStreamType iStrmtype; - - RMsgQueue iMsgQueueUp; - RMsgQueue iMsgQueueDn; - TmsMsgBuf iMsgBuffer; - - gboolean iUplinkInitialized; - gint iUplinkStreamId; - gboolean iDnlinkInitialized; - gint iDnlinkStreamId; - }; - -} //namespace TMS - -#endif // CALLCSADPT_H - -// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/callipadpt.h --- a/mmserv/tms/tmscallserver/inc/callipadpt.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef __CALLIPADAPT_H -#define __CALLIPADAPT_H - -// INCLUDES -#include -#include -#include "tmsclientserver.h" -#include "tmsshared.h" -#include "calladpt.h" -#include "cpeaudiodtmftoneplayer.h" -#include "dtmfnotifier.h" - -namespace TMS { - -// FORWARD DECLARATIONS -class TMSIPDownlink; -class TMSIPUplink; - -// TMSCallIPAdpt class -class TMSCallIPAdpt : public TMSCallAdpt, - public TMSDTMFTonePlayerObserver - { -public: - // Constractor - static TMSCallIPAdpt* NewL(); - - virtual ~TMSCallIPAdpt(); - virtual gint PostConstruct(); - - virtual gint CreateStream(TMSCallType callType, TMSStreamType strmType, - gint& outStrmId); - virtual gint InitStreamL(TMSCallType callType, TMSStreamType strmType, - gint strmId, TMSFormatType frmtType, const RMessage2& aMessage); - virtual gint StartStream(TMSCallType callType, TMSStreamType strmType, - gint strmId); - virtual gint PauseStream(TMSCallType callType, TMSStreamType strmType, - gint strmId); - virtual gint StopStream(TMSCallType callType, TMSStreamType strmType, - gint strmId); - virtual gint DeinitStream(TMSCallType callType, TMSStreamType strmType, - gint strmId); - virtual gint DeleteStream(TMSCallType callType, TMSStreamType strmType, - gint strmId); - virtual gint DataXferBufferEmptied(TMSCallType callType, - TMSStreamType strmType, gint strmId); - virtual gint DataXferBufferFilled(TMSCallType callType, - TMSStreamType strmType, gint strmId, guint datasize); - virtual gint GetDataXferBufferHndl(const TMSCallType callType, - const TMSStreamType strmType, const gint strmId, - const guint32 key, RChunk& chunk); - - virtual gint GetMaxVolume(guint& volume); - virtual gint SetVolume(const guint volume); - virtual gint GetVolume(guint& volume); - virtual gint GetMaxGain(guint& gain); - virtual gint SetGain(const guint gain); - virtual gint GetGain(guint& gain); - virtual gint GetGlobalMaxVolume(guint& volume); - virtual gint SetGlobalVolume(const guint volume); - virtual gint GetGlobalVolume(guint& volume); - virtual gint GetGlobalMaxGain(guint& gain); - virtual gint SetGlobalGain(const guint gain); - virtual gint GetGlobalGain(guint& gain); - - virtual gint GetCodecMode(const TMSFormatType fmttype, - const TMSStreamType strmtype, gint& mode); - virtual gint SetCodecMode(const TMSFormatType fmttype, - const TMSStreamType strmtype, const gint mode); - virtual gint GetSupportedBitRatesCount(guint& count); - virtual gint GetSupportedBitRates(CBufFlat*& brbuffer); - virtual gint GetBitRate(guint& bitrate); - virtual gint SetBitRate(const guint bitrate); - virtual gint GetVAD(const TMSFormatType fmttype, gboolean& vad); - virtual gint SetVAD(const TMSFormatType fmttype, const gboolean vad); - virtual gint GetCNG(const TMSFormatType fmttype, gboolean& cng); - virtual gint SetCNG(const TMSFormatType fmttype, const gboolean cng); - virtual gint GetPlc(const TMSFormatType fmttype, gboolean& plc); - virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc); - - virtual gint SetOutput(TMSAudioOutput output); - virtual gint GetOutput(TMSAudioOutput& output); - virtual gint GetPreviousOutput(TMSAudioOutput& output); - virtual gint GetAvailableOutputsL(TInt& count, CBufFlat*& outputsbuffer); - - virtual gint StartDTMF(TMSStreamType streamtype, TDes& dtmfstring); - virtual gint StopDTMF(TMSStreamType streamtype); - virtual gint ContinueDTMF(TBool continuesending); - - gint SetIlbcCodecMode(const gint mode, const TMSStreamType strmtype); - gint GetIlbcCodecMode(gint& mode, const TMSStreamType strmtype); - gint SetG711CodecMode(const gint mode, const TMSStreamType strmtype); - gint GetG711CodecMode(gint& mode, const TMSStreamType strmtype); - gint FrameModeRqrdForEC(gboolean& frmodereq); - gint SetFrameMode(const gboolean frmode); - gint GetFrameMode(gboolean& frmode); - gint ConcealErrorForNextBuffer(); - gint BadLsfNextBuffer(); - - gint OpenDownlinkL(const RMessage2& aMessage); - gint OpenUplinkL(const RMessage2& aMessage); - void SetFormat(const gint strmId, const TUint32 aFormat); - - void BufferFilledL(TUint dataSize); - void BufferEmptiedL(); - gint GetDataXferChunkHndl(const TMSStreamType strmType, - const TUint32 key, RChunk& chunk); - - //From DTMFTonePlayerObserver - void DTMFInitCompleted(TInt error); - void DTMFToneFinished(TInt error); - -private: - void ConstructL(); - TMSCallIPAdpt(); - - void NotifyClient(const gint strmId, const TInt aCommand, - const TInt aStatus = KErrNone, const TInt64 aInt64 = TInt64(0)); - //void DetermineG711FrameRateL(); //G711 10/20ms - void GetSupportedBitRatesL(CBufFlat*& brbuffer); - -private: - gint iNextStreamId; - gboolean iUplinkInitialized; - gint iUplinkStreamId; - gboolean iDnlinkInitialized; - gint iDnlinkStreamId; - - TMSIPDownlink* iIPDownlink; - TMSIPUplink* iIPUplink; - - // Message queues for communication and data transfer back to the client - RMsgQueue iMsgQueueUp; - RMsgQueue iMsgQueueDn; - - TmsMsgBuf iMsgBuffer; - TMMFPrioritySettings iPriority; - TUint32 iUpFourCC; - TUint32 iDnFourCC; - TInt iMaxVolume; - TInt iMaxGain; - RArray iArrBitrates; - RArray iCodecs; - TInt iCodecsCount; - - TMSAudioDtmfTonePlayer* iDTMFDnlinkPlayer; - TMSAudioDtmfTonePlayer* iDTMFUplinkPlayer; - TMSDtmfNotifier* iDTMFNotifier; - }; - -} //namespace TMS - -#endif //__CALLIPADAPT_H - -// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/cpeaudiodtmftoneplayer.h --- a/mmserv/tms/tmscallserver/inc/cpeaudiodtmftoneplayer.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef CPEAUDIODTMFTONEPLAYER_H -#define CPEAUDIODTMFTONEPLAYER_H - -// INCLUDES -#include -#include -#include "dtmftoneplayerobserver.h" - -// FORWARD DECLARATIONS -class CMMFDevSound; - -// CLASS DECLARATION - -/** - * plays DTMF tones using media server - * - * @lib audiohandling.lib - */ - -namespace TMS { - -class TMSAudioDtmfTonePlayer : public MDevSoundObserver - { -public: - // Constructors and destructor - - /** - * Two-phased constructor. - */ - static TMSAudioDtmfTonePlayer* NewL(TMSDTMFTonePlayerObserver& obsrvr, - guint aAudioPreference, guint aAudioPriority); - - /** - * Destructor. - */ - virtual ~TMSAudioDtmfTonePlayer(); - -public: - - /** - * Sets volume. - * @param aVolume volume value or KDtmfSilent. - * @return None. - */ - void SetVolume(gint aVolume); - - /** - * Starts playing given dtmf tone infinitely. - * @param aTone Tone to be played. - * @return None. - */ - //void PlayDtmfTone( TChar aTone ); - void PlayDtmfTone(TDes& tone); - - /** - * Cancels playing. - * @param None. - * @return None. - */ - void Cancel(); - -public: - //From MDevSoundObserver - /** - * See MDevSoundObserver - */ - void InitializeComplete(TInt aError); - - /** - * See MDevSoundObserver - */ - void ToneFinished(TInt aError); - - /** - * See MDevSoundObserver - */ - void BufferToBeFilled(CMMFBuffer* aBuffer); - - /** - * See MDevSoundObserver - */ - void PlayError(TInt aError); - - /** - * See MDevSoundObserver - */ - void BufferToBeEmptied(CMMFBuffer* aBuffer); - - /** - * See MDevSoundObserver - */ - void RecordError(TInt aError); - - /** - * See MDevSoundObserver - */ - void ConvertError(TInt aError); - /** - * See MDevSoundObserver - */ - void DeviceMessage(TUid aMessageType, const TDesC8& aMsg); - -protected: - - /** - * C++ default constructor. - */ - TMSAudioDtmfTonePlayer(TMSDTMFTonePlayerObserver& obsrvr, - guint aAudioPreference, guint aAudioPriority); - - void ConstructL(); - - /** - * Normalize tone. - * @param aTone dtmf tone. - * @return None. - */ - void Normalize(TChar& aTone); - -private: - //new functions - - /** - * Converts the given value to the one that matches tha range used by - * CMMFDevSound. The CMMFDevSound uses valuess that can from 0 to the - * value returned by a call to CMMFDevSound::MaxVolume(). - */ - gint ConvertVolume(gint aVolume); - -protected: - // Data - - // Current volume setting. - gint iVolume; - - // DTMF player instance - CMMFDevSound* iDTMFPlayer; - - TMSDTMFTonePlayerObserver& iObserver; - guint iPref; - guint iPrior; - - }; - -} //namespace TMS - -#endif // CPEAUDIODTMFTONEPLAYER_H - -// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/csdownlink.h --- a/mmserv/tms/tmscallserver/inc/csdownlink.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef CSDownlink_H -#define CSDownlink_H - -#include -#include "cspdevsound.h" - -namespace TMS { - -// -class TMSCSPDevSoundObserver; - -/** - * Provides Downlink functionality. - * - */ -NONSHARABLE_CLASS(TMSCSDownlink) : public TMSCSPDevSound - { -public: - - static TMSCSDownlink* NewL(TMSCSPDevSoundObserver& aObserver); - - virtual ~TMSCSDownlink(); - - /** - * Sets volume. - * @param aVolume Volume. - */ - void SetVolume(gint aVolume); - - /** - * Gets volume. - * @return Current volume. - */ - gint Volume(); - - /** - * Gets max volume. - * @return Current volume. - */ - gint MaxVolume(); - - // from base class MDevSoundObserver - - /** - * From MDevSoundObserver. - * Indication from devsound that stream (Downlink) has been activated - * successfully. - */ - void BufferToBeFilled(CMMFBuffer* /*aBuffer*/); - - /** - * From MDevSoundObserver. - * Indication from devsound that activation of stream( Downlink) - * failed. - */ - void PlayError(TInt aErrorCode); - -private: - - /** - * From CSPDevSound. - * Tries to activate the mic stream. - */ - void DoActivateL(); - -protected: - - TMSCSDownlink(TMSCSPDevSoundObserver& aObserver); - - void ConstructL(); - }; - -} //namespace TMS - -#endif // CSDownlink_H diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/cspdevsound.h --- a/mmserv/tms/tmscallserver/inc/cspdevsound.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef CSPDEVSOUND_H -#define CSPDEVSOUND_H - -#include - -namespace TMS { - -class TMSCSPDevSoundObserver; - -/** - * Wrapper for CMMFDevSound - * - */ -NONSHARABLE_CLASS(TMSCSPDevSound) : public CBase, - public MDevSoundObserver - { -public: - - /** - * Destructor. - */ - virtual ~TMSCSPDevSound(); - - /** - * Activates the dev sound stream. TMSCSPDevSoundObserver methods are called - * when activation goes ok or fails. If the stream is already active or - * activating then nothing is done. - */ - virtual void Activate(); - - /** - * Deactivates the devsound stream. If stream is not active or - * activation is not ongoing then nothing is done. - */ - virtual void Deactivate(); - - /** - * Indicates that activation is ongoing, - * but the result of the activation is still unknown. - * @return ETrue - activation ongoing, EFalse - activation not ongoing. - */ - TBool IsActivationOngoing() const; - - /** - * Determines wether the devsound stream is active or not. - * @return ETrue - Stream is active, EFalse - Stream not active. - */ - TBool IsActive() const; - - CMMFDevSound& DevSound(); - - // from base class MDevSoundObserver - - /** - * From MDevSoundObserver - * Empty implementation - */ - void InitializeComplete(TInt aError); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void BufferToBeFilled(CMMFBuffer* aBuffer); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void PlayError(TInt aError); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void ToneFinished(TInt aError); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void BufferToBeEmptied(CMMFBuffer* aBuffer); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void RecordError(TInt aError); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void ConvertError(TInt aError); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void DeviceMessage(TUid aMessageType, const TDesC8& aMsg); - -protected: - - TMSCSPDevSound(TMSCSPDevSoundObserver& aObserver); - - void ConstructL(TMMFState aMode, gint aAudioPreference, - gint aAudioPriority); - -private: - - /** - * Derived class has to activate the stream here. - */ - virtual void DoActivateL() = 0; - -protected: - - TUint iStreamType; - - /** - * Indication if device is activated. Derived class has to update this. - */ - TBool iActive; - - /** - * Indication if activation is ongoing. - * Derived class has to update this. - */ - TBool iActivationOngoing; - - /** - * Devsound instance - * Own. - */ - CMMFDevSound* iDevSound; - - /** - * Observer for successfull activation. - * Not own. - */ - TMSCSPDevSoundObserver& iObserver; - - }; - -} //namespace TMS - -#endif // CSPDEVSOUND_H diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/cspdtmfprovider.h --- a/mmserv/tms/tmscallserver/inc/cspdtmfprovider.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef CSPDTMFPROVIDER_H -#define CSPDTMFPROVIDER_H - -#include -#include -#include -#include -#include - -namespace TMS { - -// FORWARD DECLARATIONS -class TMSEtelDtmfMonitor; -class TMSEtelDtmfStopMonitor; - -/** - * TMSDTMFProvider class - * Makes asynchronic request to ETel interface according to given request type. - * Provides canceling via CActive::Cancel(). - */ -class TMSDTMFProvider : public CActive - { -public: - - /** - * Two phased constructing of the DTMF provider instance. - * @param aPhone mobile phone handle - * @param aMmCustom custom API handle for special DTMF event - * monitoring. - * @return the DTMF provider instance - */ - static TMSDTMFProvider* NewL(); - - /** - * C++ default destructor - */ - virtual ~TMSDTMFProvider(); - - /** - * HandleDTMFEvents. - * @param aEvent Event type - * @param aError Error code - * @param aTone Character - */ - void NotifyDTMFEvent(const TMSCCPDTMFObserver::TCCPDtmfEvent aEvent, - const TInt aError, const TChar aTone); - - // from base class MCCPDTMFProvider - /** - * Cancels asynchronous DTMF string sending. - * @return KErrNone if succesfull, otherwise another system wide error code - */ - TInt CancelDtmfStringSending(); - - /** - * Starts the transmission of a single DTMF tone across a - * connected and active call. - * @param aTone Tone to be played. - * @return KErrNone if succesfull, otherwise another system wide error code - */ - TInt StartDtmfTone(const TChar aTone); - - /** - * Stops playing current DTMF tone. - * @return KErrNone if succesfull, otherwise another system wide error code - */ - TInt StopDtmfTone(); - - /** - * Plays DTMF string. - * @param aString String to be played. - * @return KErrNone if succesfull, otherwise another system wide error code - * KErrArgument if the specified string contains illegal DTMF characters - */ - TInt SendDtmfToneString(const TDesC& aString); - - /** - * Continue or cancel sending DTMF string which was stopped with 'w' - * character in string. - * @param aContinue ETrue if sending of the DTMF string should continue, - * EFalse if the rest of the DTMF string is to be discarded. - * @return KErrNone if succesfull, otherwise another system wide error code - */ - TInt ContinueDtmfStringSending(const TBool aContinue); - - /** - * Add an observer for DTMF related events. - * Plug-in dependent feature if duplicates or more than one observers - * are allowed or not. Currently CCE will set only one observer. - * @param aObserver Observer - * @leave system error if observer adding fails - */ - void AddObserverL(const TMSCCPDTMFObserver& aObserver); - - /** - * Remove an observer. - * @param aObserver Observer - * @return KErrNone if removed succesfully. KErrNotFound if observer was - * not found. Any other system error depending on the error. - */ - TInt RemoveObserver(const TMSCCPDTMFObserver& aObserver); - - // from base class CActive -protected: - /** - * From CActive - * RunL - */ - void RunL(); - - /** - * From CActive - * Cancels the monitor - */ - void DoCancel(); - -private: - /** - * Constructs the requester. - * - * @param aPhone handle to ETel phone - * @param aMmCustom custom API handle - */ - TMSDTMFProvider(); - - /** - * Constructing the provider in the second phase. - */ - void ConstructL(); - -private: - /** - * DTMF event observer. - */ - RPointerArray iObservers; - - /** - * ETel phone handle for DTMF functionality. - */ - RMobilePhone iPhone; - - /** - * Monitor for DTMF events and changes. - * Own. - */ - TMSEtelDtmfMonitor* iMonitor; - - /** - * Monitor for DTMF stopping. - * Own. - */ - TMSEtelDtmfStopMonitor* iStopMonitor; - - /** - * Custom API reference. - */ - RMmCustomAPI iMmCustom; - - RTelServer iServer; - TBuf<25> iTsyname; - }; - -} //namespace TMS - -#endif // CSPDTMFPROVIDER diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/cspeteldtmfmonitor.h --- a/mmserv/tms/tmscallserver/inc/cspeteldtmfmonitor.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef CSPETELDTMFMONITOR_H -#define CSPETELDTMFMONITOR_H - -#include -#include -#include - -namespace TMS { - -// FORWARD DECLARATIONS -class TMSCSPCall; -class TMSDTMFProvider; - -/** - * TMSEtelDtmfMonitor class - * - * Monitors ETel for DTMF events. - * - * This monitor is applied only for listening incoming calls, i.e. - * line capabilites are not monitored. - * - * @lib csplugin.dll - * - */ -class TMSEtelDtmfMonitor : public CActive - { -public: - /** - * Two-phased constructing for the monitor. - * - * @param aObserver the observer for getting notification - * @param aMmCustom Custom API handle - */ - static TMSEtelDtmfMonitor* NewL(TMSDTMFProvider& aObserver, - RMmCustomAPI& aMmCustom); - - /** - * C++ default destructor - */ - virtual ~TMSEtelDtmfMonitor(); - - /** - * Start monitoring call events - */ - void StartMonitoring(); - -protected: // From CActive - /** - * From CActive - * RunL - */ - void RunL(); - - /** - * From CActive - * Cancels the monitor - */ - void DoCancel(); - -private: - /** - * C++ default constructor - * @param aObserver the observer for status change (incoming call) - * @param aMmCustom Custom API handle - */ - TMSEtelDtmfMonitor(TMSDTMFProvider& aObserver, RMmCustomAPI& aMmCustom); - -private: - /** - * Forwards events. - */ - TMSDTMFProvider& iObserver; - - /** - * Event data. Updated when event occurs. - */ - RMmCustomAPI::TDtmfInfo iEventData; - - /** - * Custom API reference. - */ - RMmCustomAPI& iMmCustom; - - }; -} //namespace TMS - -#endif // CSPETELDTMFMONITOR_H - diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/cspeteldtmfstopmonitor.h --- a/mmserv/tms/tmscallserver/inc/cspeteldtmfstopmonitor.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef CSPETELDTMFSTOPMONITOR_H -#define CSPETELDTMFSTOPMONITOR_H - -#include -#include - -namespace TMS { - -// FORWARD DECLARATIONS -class TMSDTMFProvider; - -/** - * TMSEtelDtmfStopMonitor class - * - * Monitors single ETel RMobilePhone for DTMF events. - * - * This monitor is applied only for listening incoming calls, i.e. - * line capabilites are not monitored. - * - * @lib csplugin.dll - * - */ -class TMSEtelDtmfStopMonitor : public CActive - { -public: - /** - * Two-phased constructing for the monitor. - * - * @param aObserver the observer for getting notification - * @param aPhone the line to monitor - */ - static TMSEtelDtmfStopMonitor* NewL(TMSDTMFProvider& aObserver, - RMobilePhone& aPhone); - - /** - * C++ default destructor - */ - virtual ~TMSEtelDtmfStopMonitor(); - - /** - * Start monitoring call events - */ - void StartMonitoring(); - -protected: // From CActive - /** - * From CActive - * RunL - */ - void RunL(); - - /** - * From CActive - * Cancels the monitor - */ - void DoCancel(); - -private: - /** - * C++ default constructor - * @param aObserver the observer for status change (incoming call) - * @param aPhone the line associated with the call - */ - TMSEtelDtmfStopMonitor(TMSDTMFProvider& aObserver, RMobilePhone& aPhone); - -private: - /** - * Forwards events. - */ - TMSDTMFProvider& iObserver; - - /** - * Phone that is being observed for incoming call. - */ - RMobilePhone& iPhone; - - /** - * Event received. - */ - RMobilePhone::TMobilePhoneDTMFEvent iEventData; - - }; - -} //namespace TMS - -#endif // CSPETELDTMFSTOPMONITOR_H - diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/csuplink.h --- a/mmserv/tms/tmscallserver/inc/csuplink.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef CS_UPLINK_H -#define CS_UPLINK_H - -#include -#include "cspdevsound.h" - -namespace TMS { - -/** - * Provides uplink functionality. - * - */ -NONSHARABLE_CLASS(TMSCSUplink) : public TMSCSPDevSound - { -public: - - static TMSCSUplink* NewL(TMSCSPDevSoundObserver& aObserver); - - virtual ~TMSCSUplink(); - - /** - * Determines mic mute state. - * - * @return ETrue - mic is muted, EFalse - mic is not muted. - */ - TBool IsMuted(); - - /** - * Set mic muted. - */ - void SetMuted(); - - /** - * Set mic unmuted. - */ - void SetUnmuted(); - - /** - * Set mic gain. - */ - void SetGain(gint aGain); - - /** - * Get mic muted. - */ - gint Gain(); - - /** - * Get max gain. - */ - gint MaxGain(); - - // from base class MDevSoundObserver - - /** - * From MDevSoundObserver - * Notification from Devsound that stream (mic) is - * activated successfully. - */ - void BufferToBeEmptied(CMMFBuffer* aBuffer); - - /** - * From MDevSoundObserver - * Notification from devsound that downstream(mic) activation - * feiled. - */ - void RecordError(TInt aError); - -private: - - // from base class MCSPDevSound - - /** - * From MCSPDevSound. - * Tries to activate the mic stream. - */ - void DoActivateL(); - -protected: - - TMSCSUplink(TMSCSPDevSoundObserver& aObserver); - void ConstructL(); - }; - -} //namespace TMS - -#endif // CSUplink_H diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/delaytimer.h --- a/mmserv/tms/tmscallserver/inc/delaytimer.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef DELAYTIMER_H -#define DELAYTIMER_H - -#include - -namespace TMS { - -/** - * A Timer utility class used by the Server for shutdown purpose. - */ -class TMSCallDelayTimer : public CActive - { -public: - // Construct/destruct - static TMSCallDelayTimer* NewL(); - ~TMSCallDelayTimer(); - -public: - // Request a timeout after aDelay - void SetDelay(TTimeIntervalMicroSeconds32 aDelay); - -protected: - // From CActive - void RunL(); - void DoCancel(); - -private: - // Construct/destruct - TMSCallDelayTimer(); - void ConstructL(); - -private: - RTimer iShutDownTimer; // Has - }; - -} //namespace TMS - -#endif //DELAYTIMER_H - -// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/dtmfnotifier.h --- a/mmserv/tms/tmscallserver/inc/dtmfnotifier.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef DTMFNOTIFIER_H -#define DTMFNOTIFIER_H - -// INCLUDES -#include -#include -#include "tmsclientserver.h" - -namespace TMS { - -// CLASS DECLARATION -class TMSDtmfNotifier - { -public: - // Constructors and destructor - - /** - * Two-phased constructor. - */ - static TMSDtmfNotifier* NewL(); - - /** - * Destructor. - */ - virtual ~TMSDtmfNotifier(); - -public: - // New functions - - void SetDtmf(TmsMsgBufPckg dtmfpckg, TBool aPublish = ETrue); - -private: - - /** - * C++ default constructor. - */ - TMSDtmfNotifier(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - -private: - TInt iVolume; //Volume - }; - -} //namespace TMS - -#endif // DTMFNOTIFIER_H - -// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/dtmftoneplayerobserver.h --- a/mmserv/tms/tmscallserver/inc/dtmftoneplayerobserver.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef DTMFTONEPLAYEROBSERVER_H -#define DTMFTONEPLAYEROBSERVER_H - -namespace TMS { - -/** - * Observer interface for knowing when dtmf tone player has been initialized. - */ -class TMSDTMFTonePlayerObserver - { -public: - virtual void DTMFInitCompleted(TInt error) = 0; - virtual void DTMFToneFinished(TInt error) = 0; - }; -} //namespace TMS - -#endif // DTMFTONEPLAYEROBSERVER_H - diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/ipcallstream.h --- a/mmserv/tms/tmscallserver/inc/ipcallstream.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,312 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef __IPCALLSTREAM_H -#define __IPCALLSTREAM_H - -//#define __PLAY_WAV_FROM_FILE__ - -#include -#include -#include -#include "tmsgstreamer.h" -#include "tmsshared.h" -#include "tmsclientserver.h" - -#ifdef __USE_GSTREAMER__ -#include -#include "gstg711encoderinterface.h" -#include "gstspeechencoderconfig.h" -#include "gsterrorconcealmentinterface.h" -#include "gstg711decoderinterface.h" -#include "gstilbcdecoderinterface.h" -#include "gstilbcencoderinterface.h" -#include "gstg729encoderinterface.h" -#include "gstg729decoderinterface.h" -#else //__USE_GSTREAMER__ -#include -#include -#include - -// FORWARD DECLARATIONS -class CAudioOutput; -class CErrorConcealmentIntfc; -class CSpeechEncoderConfig; -class CG711DecoderIntfc; -class CG729DecoderIntfc; -class CIlbcDecoderIntfc; -class CG711EncoderIntfc; -class CG729EncoderIntfc; -class CIlbcEncoderIntfc; -#endif //__USE_GSTREAMER__ - -namespace TMS { - -// ----------------------------------------------------------------------------- -// Class Name: TMSIPCallStreamBase -// -// Base abstract class for creating VoIP uplink and downlink streams. -// ----------------------------------------------------------------------------- -class TMSIPCallStreamBase : public CBase -#ifndef __USE_GSTREAMER__ - , public MDevSoundObserver -#endif //__USE_GSTREAMER__ - { -public: - enum TStreamState - { - ENotReady, // not initialized - EReady, // initialized and ready for streaming - EStreaming - // active streaming - }; - -public: - virtual ~TMSIPCallStreamBase(); - - virtual void Start() = 0; - virtual void Stop() = 0; - virtual gint SetCodecCi() = 0; - -#ifndef __USE_GSTREAMER__ - void InitDevSoundL(const TMMFState aDevSoundState, - const TMMFPrioritySettings priority); -#endif //__USE_GSTREAMER__ - void SetMsgQueue(const RMsgQueue aMsgQueue); - gint DoChunk(const gint aDataLen, TmsMsgBuf& aMsgBuffer); - gint ConfigureMedia(const guint32 aCodecID); - -protected: -#ifndef __USE_GSTREAMER__ - // From MDevSoundObserver - virtual void InitializeComplete(TInt aError) = 0; - virtual void BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) {} - virtual void RecordError(TInt /*aError*/) {} - virtual void BufferToBeFilled(CMMFBuffer* /*aBuffer*/) {} - virtual void PlayError(TInt /*aError*/) {} - virtual void ToneFinished(TInt /*aError*/) {} - virtual void ConvertError(TInt /*aError*/) {} - virtual void DeviceMessage(TUid /*aMessageType*/, const TDesC8& /*aMsg*/) {} - virtual void SendEventToClient(const TMMFEvent& /*aEvent*/) {} -#endif //__USE_GSTREAMER__ - -protected: - - CActiveScheduler* iActiveScheduler; - TStreamState iStatus; - -#ifndef __USE_GSTREAMER__ - CMMFDevSound* iDevSound; - CMMFDataBuffer* iDevSoundBufPtr; -#endif //__USE_GSTREAMER__ - - RMsgQueue iMsgQueue; // ITC back to client - TmsMsgBuf iMsgBuffer; - RChunk iChunk; - gint iMaxBufLen; - guint32 iCodecID; - TMMFPrioritySettings iPriority; - const gchar* iMediaType; - - gint iG711DecodeMode; - gint iILBCDecodeMode; - gint iG711EncodeMode; - gint iILBCEncodeMode; - gint iBufLen; - TBool iWriteDataXferHndlToClient; - TUint32 iKey; - }; - -// ----------------------------------------------------------------------------- -// Class Name: TMSIPDownlink -// -// Class handling VoIP downlink stream object. -// ----------------------------------------------------------------------------- -class TMSIPDownlink : public TMSIPCallStreamBase - { -public: - virtual ~TMSIPDownlink(); - -#ifdef __USE_GSTREAMER__ - static void cb_raw_playback_handoff(GstElement* appsrc, guint size); - static gboolean bus_call(GstBus* bus, GstMessage* msg, gpointer data); -#endif //__USE_GSTREAMER__ - static TMSIPDownlink* NewL(const guint32 codecID, - const TMMFPrioritySettings priority); - TMSIPDownlink(); - void ConstructL(const guint32 codecID, - const TMMFPrioritySettings priority); - - gint SetCodecCi(); - void Start(); - void Stop(); - void BufferFilled(const guint buflen); - gint SetVolume(const guint volume); - gint GetVolume(guint& volume); - gint GetMaxVolume(guint& volume); - gint GetDataXferChunkHndl(const TUint32 key, RChunk& chunk); - - // For CIs - gint SetIlbcCodecMode(const gint mode); - gint GetIlbcCodecMode(gint& mode); - gint SetG711CodecMode(const gint mode); - gint GetG711CodecMode(gint& mode); - gint FrameModeRqrdForEC(gboolean& frmodereq); - gint SetFrameMode(gboolean frmode); - gint GetFrameMode(gboolean& frmode); - gint ConcealErrorForNextBuffer(); - gint SetCng(const TMSFormatType fmttype, const gboolean cng); - gint GetCng(const TMSFormatType fmttype, gboolean& cng); - gint SetPlc(const TMSFormatType fmttype, const gboolean plc); - gint GetPlc(const TMSFormatType fmttype, gboolean& plc); - gint BadLsfNextBuffer(); - - void SetAudioDeviceL(TMSAudioOutput output); - void GetAudioDeviceL(TMSAudioOutput& output); - -private: - void SetCodecCiL(); - -#ifdef __USE_GSTREAMER__ - void BufferToBeFilled(); - gint gst_play_raw(); - gint gst_initialize_play(); -#else //__USE_GSTREAMER__ - // From MDevSoundObserver - virtual void BufferToBeFilled(CMMFBuffer* aBuffer); - virtual void InitializeComplete(TInt aError); - virtual void PlayError(TInt aError); -#endif //__USE_GSTREAMER__ - -private: - - gboolean iFrameMode; - gboolean iPlc; - gint iMaxVolume; - -#ifndef __USE_GSTREAMER__ - CAudioOutput* iAudioOutput; - CErrorConcealmentIntfc* iErrConcealmentIntfc; - CG711DecoderIntfc* iG711DecoderIntfc; - CG729DecoderIntfc* iG729DecoderIntfc; - CIlbcDecoderIntfc* iIlbcDecoderIntfc; -#else //__USE_GSTREAMER__ - GstErrorConcealmentIntfc* iErrConcealmentIntfc; - GstG711DecoderIntfc* iG711DecoderIntfc; - GstG729DecoderIntfc* iG729DecoderIntfc; - GstIlbcDecoderIntfc* iIlbcDecoderIntfc; - GstElement* iPipelinePlay; - GstElement* iAppSrc; - GstElement* iSink; - GstBus* iBusPlay; -#endif //__USE_GSTREAMER__ -#ifdef _DEBUG - gint iSamplesPlayedCount; -#endif - -#ifdef __PLAY_WAV_FROM_FILE__ - RFile iFile; - gint fsize; - gint iReadSize; - gint iReadBytes; - RFs iFs; - HBufC8* fbuf; -#endif - }; - -// ----------------------------------------------------------------------------- -// Class Name: TMSIPUplink -// -// Class handling VoIP uplink stream. -// ----------------------------------------------------------------------------- -class TMSIPUplink : public TMSIPCallStreamBase - { -public: - virtual ~TMSIPUplink(); - -#ifdef __USE_GSTREAMER__ - static void cb_record_raw_handoff(GstElement *sink); - static gboolean bus_call(GstBus* bus, GstMessage* msg, gpointer data); -#endif //__USE_GSTREAMER__ - static TMSIPUplink* NewL(const guint32 codecID, - const TMMFPrioritySettings priority); - TMSIPUplink(); - void ConstructL(const guint32 codecID, - const TMMFPrioritySettings priority); - - gint SetCodecCi(); - void Start(); - void Stop(); - void BufferEmptied(); - gint SetGain(const guint gain); - gint GetGain(guint& gain); - gint GetMaxGain(guint& gain); - gint GetDataXferChunkHndl(const TUint32 key, RChunk& chunk); - - // For CIs - gint SetIlbcCodecMode(const gint mode); - gint GetIlbcCodecMode(gint& mode); - gint SetG711CodecMode(const gint mode); - gint GetG711CodecMode(gint& mode); - gint GetSupportedBitrates(RArray& bitrates); - gint SetBitrate(guint bitrate); - gint GetBitrate(guint& bitrate); - gint SetVad(const TMSFormatType fmttype, const gboolean vad); - gint GetVad(const TMSFormatType fmttype, gboolean& vad); - -private: - void SetCodecCiL(); - -#ifdef __USE_GSTREAMER__ - void BufferToBeEmptied(); - gint gst_record_raw(); - gint gst_initialize_record(); -#else //__USE_GSTREAMER__ - // From MDevSoundObserver - virtual void BufferToBeEmptied(CMMFBuffer* aBuffer); - virtual void InitializeComplete(TInt aError); - virtual void RecordError(TInt /*aError*/); -#endif //__USE_GSTREAMER__ - -private: - gint iMaxGain; - -#ifndef __USE_GSTREAMER__ - CSpeechEncoderConfig* iSpeechEncoderConfig; - CG711EncoderIntfc* iG711EncoderIntfc; - CG729EncoderIntfc* iG729EncoderIntfc; - CIlbcEncoderIntfc* iIlbcEncoderIntfc; -#else //__USE_GSTREAMER__ - GstSpeechEncoderConfigIntfc* iSpeechEncoderConfig; - GstG711EncoderIntfc* iG711EncoderIntfc; - GstG729EncoderIntfc* iG729EncoderIntfc; - GstIlbcEncoderIntfc* iIlbcEncoderIntfc; - GstElement* iPipelineRec; - GstElement* iSource; - GstElement* iAppSink; - GstBus* iBusRec; -#endif //__USE_GSTREAMER__ -#ifdef _DEBUG - gint iSamplesRecCount; -#endif - }; - -} //namespace TMS - -#endif //__IPCALLSTREAM_H - -// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/mccpdtmfobserver.h --- a/mmserv/tms/tmscallserver/inc/mccpdtmfobserver.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef MCCPDTMFOBSERVER_H -#define MCCPDTMFOBSERVER_H - -#include - -namespace TMS { - -/** - * CCP DTMF related events observer class. - * This class is used for notifying DTMF specific events. - */ -class TMSCCPDTMFObserver - { -public: - - /** DTMF Events */ - enum TCCPDtmfEvent - { - /** Unknown */ - ECCPDtmfUnknown = 0, - /** DTMF sending started manually */ - ECCPDtmfManualStart = 5, - /** DTMF sending stopped manually */ - ECCPDtmfManualStop = 6, - /** DTMF sending aborted manually */ - ECCPDtmfManualAbort = 7, - /** Automatic DTMF sending initialized */ - ECCPDtmfSequenceStart = 9, - /** Automatic DTMF sending stopped */ - ECCPDtmfSequenceStop = 10, - /** Automatic DTMF sending aborted */ - ECCPDtmfSequenceAbort = 11, - /** There was stop mark in DTMF string */ - ECCPDtmfStopInDtmfString, - /** DTMF sending completed succesfully */ - ECCPDtmfStringSendingCompleted - }; - - //protected: - /** - * Protects the observer being deleted through the observer interface. - */ - //virtual inline ~TMSCCPDTMFObserver() {}; - -public: - - /** - * HandleDTMFEvents. - * @param aEvent Event type - * @param aError Error code - * @param aTone Character - * @return none - */ - virtual void HandleDTMFEvent(const TMSCCPDTMFObserver::TCCPDtmfEvent aEvent, - const TInt aError, const TChar aTone) /*const*/ = 0; - }; - -} //namespace TMS - -#endif // MCCPDTMFOBSERVER_H - -// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/mcspdevsoundobserver.h --- a/mmserv/tms/tmscallserver/inc/mcspdevsoundobserver.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef MCSPDEVSOUNDOBSERVER_H -#define MCSPDEVSOUNDOBSERVER_H - -namespace TMS { - -/** - * Observer interface for knowing when audio streams have been - * successfully ramped up. - * - */ -class TMSCSPDevSoundObserver - { -public: - virtual void DownlinkInitCompleted(TInt x) = 0; - virtual void UplinkInitCompleted(TInt x) = 0; - - /** - * Notification that Mic has been activated successfully - * - */ - virtual void UplinkActivatedSuccessfully() = 0; - - /** - * Notification that speaker has been activated successfully - * - */ - virtual void DownlinkActivatedSuccessfully() = 0; - - /** - * Notification that Mic initialisation failed. - * - */ - virtual void UplinkActivationFailed() = 0; - - /** - * Notification that Speaker activation failed. - * - */ - virtual void DownlinkActivationFailed() = 0; - }; - -} //namespace TMS - -#endif // MCSPDEVSOUNDOBSERVER_H diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tarsettings.h --- a/mmserv/tms/tmscallserver/inc/tarsettings.h Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#ifndef TARSETTINGS_H -#define TARSETTINGS_H - -// INCLUDES -#include -#include -#include -#include "tmsclientserver.h" - -namespace TMS { - -// CLASS DECLARATION -class TMSTarSettings - { -public: - // Constructors and destructor - - /** - * Two-phased constructor. - */ - static TMSTarSettings* NewL(); - - /** - * Destructor. - */ - virtual ~TMSTarSettings(); - -public: - // New functions - - void SetTar(TRoutingMsgBufPckg rountingpckg, TBool aPublish = ETrue); - -private: - - /** - * C++ default constructor. - */ - TMSTarSettings(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - -private: - gint iVolume; //Volume - }; - -} //namespace TMS - -#endif // TarSETTINGS_H - -// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmscalladpt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmscalladpt.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef CALLADPT_H +#define CALLADPT_H + +#include +#include + +namespace TMS { + +// TMSCallAdpt class +class TMSCallAdpt + { +public: + static gint CreateCallL(gint callType, TMSCallAdpt*& callAdpt); + virtual ~TMSCallAdpt(); + virtual gint CreateStream(TMSCallType callType, + TMSStreamType strmType, gint& outStrmId) = 0; + virtual gint InitStreamL(TMSCallType callType, + TMSStreamType strmType, gint strmId, TMSFormatType frmtType, + const RMessage2& aMessage) = 0; + virtual gint StartStream(TMSCallType callType, + TMSStreamType strmType, gint strmId) = 0; + virtual gint PauseStream(TMSCallType callType, + TMSStreamType strmType, gint strmId) = 0; + virtual gint StopStream(TMSCallType callType, TMSStreamType strmType, + gint strmId) = 0; + virtual gint DeinitStream(TMSCallType callType, + TMSStreamType strmType, gint strmId) = 0; + virtual gint DeleteStream(TMSCallType callType, + TMSStreamType strmType, gint strmId) = 0; + virtual gint DataXferBufferEmptied(TMSCallType callType, + TMSStreamType strmType, gint strmId) = 0; + virtual gint DataXferBufferFilled(TMSCallType callType, + TMSStreamType strmType, gint strmId, guint datasize) = 0; + virtual gint GetDataXferBufferHndl(const TMSCallType callType, + const TMSStreamType strmType, const gint strmId, + const guint32 key, RChunk& chunk) = 0; + + virtual gint GetMaxVolume(guint& volume) = 0; + virtual gint SetVolume(const guint volume) = 0; + virtual gint GetVolume(guint& volume) = 0; + virtual gint GetMaxGain(guint& gain) = 0; + virtual gint SetGain(const guint gain) = 0; + virtual gint GetGain(guint& gain) = 0; + virtual gint GetGlobalMaxVolume(guint& volume) = 0; + virtual gint SetGlobalVolume(const guint volume) = 0; + virtual gint GetGlobalVolume(guint& volume) = 0; + virtual gint GetGlobalMaxGain(guint& gain) = 0; + virtual gint SetGlobalGain(const guint gain) = 0; + virtual gint GetGlobalGain(guint& gain) = 0; + + virtual gint GetCodecMode(const TMSFormatType fmttype, + const TMSStreamType strmtype, gint& mode) = 0; + virtual gint SetCodecMode(const TMSFormatType fmttype, + const TMSStreamType strmtype, const gint mode) = 0; + virtual gint GetSupportedBitRatesCount(guint& count) = 0; + virtual gint GetSupportedBitRates(CBufFlat*& brbuffer) = 0; + virtual gint GetBitRate(guint& bitrate) = 0; + virtual gint SetBitRate(const guint bitrate) = 0; + virtual gint GetVAD(const TMSFormatType fmttype, gboolean& vad) = 0; + virtual gint SetVAD(const TMSFormatType fmttype, const gboolean vad) = 0; + virtual gint GetCNG(const TMSFormatType fmttype, gboolean& cng) = 0; + virtual gint SetCNG(const TMSFormatType fmttype, const gboolean cng) = 0; + virtual gint GetPlc(const TMSFormatType fmttype, gboolean& plc) = 0; + virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc) = 0; + virtual gint SetOutput(TMSAudioOutput output) = 0; + virtual gint GetOutput(TMSAudioOutput& output) = 0; + virtual gint GetPreviousOutput(TMSAudioOutput& output) = 0; + virtual gint GetAvailableOutputsL(gint& count, + CBufFlat*& outputsbuffer) = 0; + virtual gint StartDTMF(TMSStreamType streamtype, TDes& dtmfstring) = 0; + virtual gint StopDTMF(TMSStreamType streamtype) = 0; + virtual gint ContinueDTMF(TBool continuesending) = 0; + +protected: + TMSCallAdpt(); + virtual gint PostConstruct(); + +protected: + gint iGlobalVol; + gint iGlobalGain; + }; + +} //namespace TMS + +#endif // CALLADPT_H + +// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmscallcsadpt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmscallcsadpt.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef CALLCSADPT_H +#define CALLCSADPT_H + +#include +#include +#include +#include +#include +#include "tmsclientserver.h" +#include "tmsdtmftoneplayerobserver.h" +#include "tmscalladpt.h" +#include "tmscsdevsoundobserver.h" +#include "tmsdtmfobserver.h" + +namespace TMS { + +// FORWARD DECLARATIONS +class TMSCSUplink; +class TMSCSDownlink; +class TMSTarSettings; +class TMSAudioDtmfTonePlayer; +class TMSDTMFProvider; +class TMSDtmfNotifier; + +/* + * CallCSAdapt class + */ +class TMSCallCSAdpt : public TMSCallAdpt, + public TMSCSPDevSoundObserver, + public MTelephonyAudioRoutingObserver, + public TMSDTMFTonePlayerObserver, + public TMSDTMFObserver + { +public: + TMSCallCSAdpt(); + virtual ~TMSCallCSAdpt(); + virtual gint PostConstruct(); + + virtual gint CreateStream(TMSCallType callType, TMSStreamType strmType, + gint& outStrmId); + virtual gint InitStreamL(TMSCallType callType, TMSStreamType strmType, + gint strmId, TMSFormatType frmtType, const RMessage2& aMessage); + virtual gint StartStream(TMSCallType callType, TMSStreamType strmType, + gint strmId); + virtual gint PauseStream(TMSCallType callType, TMSStreamType strmType, + gint strmId); + virtual gint StopStream(TMSCallType callType, TMSStreamType strmType, + gint strmId); + virtual gint DeinitStream(TMSCallType callType, TMSStreamType strmType, + gint strmId); + virtual gint DeleteStream(TMSCallType callType, TMSStreamType strmType, + gint strmId); + virtual gint DataXferBufferEmptied(TMSCallType callType, + TMSStreamType strmType, gint strmId); + virtual gint DataXferBufferFilled(TMSCallType callType, + TMSStreamType strmType, gint strmId, guint datasize); + virtual gint GetDataXferBufferHndl(const TMSCallType callType, + const TMSStreamType strmType, const gint strmId, + const guint32 key, RChunk& chunk); + virtual gint GetMaxVolume(guint& volume); + virtual gint SetVolume(const guint volume); + virtual gint GetVolume(guint& volume); + virtual gint GetMaxGain(guint& gain); + virtual gint SetGain(const guint gain); + virtual gint GetGain(guint& gain); + virtual gint GetGlobalMaxVolume(guint& volume); + virtual gint SetGlobalVolume(const guint volume); + virtual gint GetGlobalVolume(guint& volume); + virtual gint GetGlobalMaxGain(guint& gain); + virtual gint SetGlobalGain(const guint gain); + virtual gint GetGlobalGain(guint& gain); + + virtual gint GetCodecMode(const TMSFormatType fmttype, + const TMSStreamType strmtype, gint& mode); + virtual gint SetCodecMode(const TMSFormatType fmttype, + const TMSStreamType strmtype, const gint mode); + virtual gint GetSupportedBitRatesCount(guint& count); + virtual gint GetSupportedBitRates(CBufFlat*& brbuffer); + virtual gint GetBitRate(guint& bitrate); + virtual gint SetBitRate(const guint bitrate); + virtual gint GetVAD(const TMSFormatType fmttype, gboolean& vad); + virtual gint SetVAD(const TMSFormatType fmttype, const gboolean vad); + virtual gint GetCNG(const TMSFormatType fmttype, gboolean& cng); + virtual gint SetCNG(const TMSFormatType fmttype, const gboolean cng); + virtual gint GetPlc(const TMSFormatType fmttype, gboolean& plc); + virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc); + + virtual gint SetOutput(TMSAudioOutput output); + virtual gint GetOutput(TMSAudioOutput& output); + virtual gint GetPreviousOutput(TMSAudioOutput& output); + virtual gint GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuffer); + virtual gint StartDTMF(TMSStreamType streamtype, TDes& dtmfstring); + virtual gint StopDTMF(TMSStreamType streamtype); + virtual gint ContinueDTMF(TBool continuesending); + + void NotifyClient(const gint strmId, const gint aCommand, + const gint aStatus = KErrNone, const gint64 aInt64 = TInt64(0)); + + //From TMSCSPDevSoundObserver + void DownlinkInitCompleted(TInt status); + void UplinkInitCompleted(TInt status); + void UplinkActivatedSuccessfully(); + void DownlinkActivatedSuccessfully(); + void UplinkActivationFailed(); + void DownlinkActivationFailed(); + + //From DTMFTonePlayerObserver + void DTMFInitCompleted(TInt error); + void DTMFToneFinished(TInt error); + + //From TMSDTMFObserver + void HandleDTMFEvent(const TMSDTMFObserver::TCCPDtmfEvent aEvent, + const TInt aError, const TChar aTone); + +protected: + void AvailableOutputsChanged( + CTelephonyAudioRouting& aTelephonyAudioRouting); + void OutputChanged(CTelephonyAudioRouting& aTelephonyAudioRouting); + void SetOutputComplete(CTelephonyAudioRouting& aTelephonyAudioRouting, + gint aError); + void GetSupportedBitRatesL(CBufFlat*& brbuffer); + +private: + gint iNextStreamId; + + TMSCSUplink* iCSUplink; + TMSCSDownlink* iCSDownlink; + CTelephonyAudioRouting* iRouting; + TMSTarSettings* iTarSettings; + TMSAudioDtmfTonePlayer* iDTMFDnlinkPlayer; + TMSDtmfNotifier* iDTMFNotifier; + TMSDTMFProvider* iDTMFUplinkPlayer; + TMSStreamType iStrmtype; + + RMsgQueue iMsgQueueUp; + RMsgQueue iMsgQueueDn; + TmsMsgBuf iMsgBuffer; + + gboolean iUplinkInitialized; + gint iUplinkStreamId; + gboolean iDnlinkInitialized; + gint iDnlinkStreamId; + }; + +} //namespace TMS + +#endif // CALLCSADPT_H + +// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmscallipadpt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmscallipadpt.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef __CALLIPADAPT_H +#define __CALLIPADAPT_H + +// INCLUDES +#include +#include +#include "tmsclientserver.h" +#include "tmsshared.h" +#include "tmscalladpt.h" +#include "tmsdtmftoneplayer.h" +#include "tmsdtmfnotifier.h" + +namespace TMS { + +// FORWARD DECLARATIONS +class TMSIPDownlink; +class TMSIPUplink; + +// TMSCallIPAdpt class +class TMSCallIPAdpt : public TMSCallAdpt, + public TMSDTMFTonePlayerObserver + { +public: + // Constractor + static TMSCallIPAdpt* NewL(); + + virtual ~TMSCallIPAdpt(); + virtual gint PostConstruct(); + + virtual gint CreateStream(TMSCallType callType, TMSStreamType strmType, + gint& outStrmId); + virtual gint InitStreamL(TMSCallType callType, TMSStreamType strmType, + gint strmId, TMSFormatType frmtType, const RMessage2& aMessage); + virtual gint StartStream(TMSCallType callType, TMSStreamType strmType, + gint strmId); + virtual gint PauseStream(TMSCallType callType, TMSStreamType strmType, + gint strmId); + virtual gint StopStream(TMSCallType callType, TMSStreamType strmType, + gint strmId); + virtual gint DeinitStream(TMSCallType callType, TMSStreamType strmType, + gint strmId); + virtual gint DeleteStream(TMSCallType callType, TMSStreamType strmType, + gint strmId); + virtual gint DataXferBufferEmptied(TMSCallType callType, + TMSStreamType strmType, gint strmId); + virtual gint DataXferBufferFilled(TMSCallType callType, + TMSStreamType strmType, gint strmId, guint datasize); + virtual gint GetDataXferBufferHndl(const TMSCallType callType, + const TMSStreamType strmType, const gint strmId, + const guint32 key, RChunk& chunk); + + virtual gint GetMaxVolume(guint& volume); + virtual gint SetVolume(const guint volume); + virtual gint GetVolume(guint& volume); + virtual gint GetMaxGain(guint& gain); + virtual gint SetGain(const guint gain); + virtual gint GetGain(guint& gain); + virtual gint GetGlobalMaxVolume(guint& volume); + virtual gint SetGlobalVolume(const guint volume); + virtual gint GetGlobalVolume(guint& volume); + virtual gint GetGlobalMaxGain(guint& gain); + virtual gint SetGlobalGain(const guint gain); + virtual gint GetGlobalGain(guint& gain); + + virtual gint GetCodecMode(const TMSFormatType fmttype, + const TMSStreamType strmtype, gint& mode); + virtual gint SetCodecMode(const TMSFormatType fmttype, + const TMSStreamType strmtype, const gint mode); + virtual gint GetSupportedBitRatesCount(guint& count); + virtual gint GetSupportedBitRates(CBufFlat*& brbuffer); + virtual gint GetBitRate(guint& bitrate); + virtual gint SetBitRate(const guint bitrate); + virtual gint GetVAD(const TMSFormatType fmttype, gboolean& vad); + virtual gint SetVAD(const TMSFormatType fmttype, const gboolean vad); + virtual gint GetCNG(const TMSFormatType fmttype, gboolean& cng); + virtual gint SetCNG(const TMSFormatType fmttype, const gboolean cng); + virtual gint GetPlc(const TMSFormatType fmttype, gboolean& plc); + virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc); + + virtual gint SetOutput(TMSAudioOutput output); + virtual gint GetOutput(TMSAudioOutput& output); + virtual gint GetPreviousOutput(TMSAudioOutput& output); + virtual gint GetAvailableOutputsL(TInt& count, CBufFlat*& outputsbuffer); + + virtual gint StartDTMF(TMSStreamType streamtype, TDes& dtmfstring); + virtual gint StopDTMF(TMSStreamType streamtype); + virtual gint ContinueDTMF(TBool continuesending); + + gint SetIlbcCodecMode(const gint mode, const TMSStreamType strmtype); + gint GetIlbcCodecMode(gint& mode, const TMSStreamType strmtype); + gint SetG711CodecMode(const gint mode, const TMSStreamType strmtype); + gint GetG711CodecMode(gint& mode, const TMSStreamType strmtype); + gint FrameModeRqrdForEC(gboolean& frmodereq); + gint SetFrameMode(const gboolean frmode); + gint GetFrameMode(gboolean& frmode); + gint ConcealErrorForNextBuffer(); + gint BadLsfNextBuffer(); + + gint OpenDownlinkL(const RMessage2& aMessage); + gint OpenUplinkL(const RMessage2& aMessage); + void SetFormat(const gint strmId, const TUint32 aFormat); + + void BufferFilledL(TUint dataSize); + void BufferEmptiedL(); + gint GetDataXferChunkHndl(const TMSStreamType strmType, + const TUint32 key, RChunk& chunk); + + //From DTMFTonePlayerObserver + void DTMFInitCompleted(TInt error); + void DTMFToneFinished(TInt error); + +private: + void ConstructL(); + TMSCallIPAdpt(); + + void NotifyClient(const gint strmId, const TInt aCommand, + const TInt aStatus = KErrNone, const TInt64 aInt64 = TInt64(0)); + //void DetermineG711FrameRateL(); //G711 10/20ms + void GetSupportedBitRatesL(CBufFlat*& brbuffer); + +private: + gint iNextStreamId; + gboolean iUplinkInitialized; + gint iUplinkStreamId; + gboolean iDnlinkInitialized; + gint iDnlinkStreamId; + + TMSIPDownlink* iIPDownlink; + TMSIPUplink* iIPUplink; + + // Message queues for communication and data transfer back to the client + RMsgQueue iMsgQueueUp; + RMsgQueue iMsgQueueDn; + + TmsMsgBuf iMsgBuffer; + TMMFPrioritySettings iPriority; + TUint32 iUpFourCC; + TUint32 iDnFourCC; + TInt iMaxVolume; + TInt iMaxGain; + RArray iArrBitrates; + RArray iCodecs; + TInt iCodecsCount; + + TMSAudioDtmfTonePlayer* iDTMFDnlinkPlayer; + TMSAudioDtmfTonePlayer* iDTMFUplinkPlayer; + TMSDtmfNotifier* iDTMFNotifier; + }; + +} //namespace TMS + +#endif //__CALLIPADAPT_H + +// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmscsdevsound.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmscsdevsound.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef TMSCSDEVSOUND_H +#define TMSCSDEVSOUND_H + +#include + +namespace TMS { + +class TMSCSPDevSoundObserver; + +/** + * Wrapper for CMMFDevSound + * + */ +NONSHARABLE_CLASS(TMSCSPDevSound) : public CBase, + public MDevSoundObserver + { +public: + + /** + * Destructor. + */ + virtual ~TMSCSPDevSound(); + + /** + * Activates the dev sound stream. TMSCSPDevSoundObserver methods are called + * when activation goes ok or fails. If the stream is already active or + * activating then nothing is done. + */ + virtual void Activate(); + + /** + * Deactivates the devsound stream. If stream is not active or + * activation is not ongoing then nothing is done. + */ + virtual void Deactivate(); + + /** + * Indicates that activation is ongoing, + * but the result of the activation is still unknown. + * @return ETrue - activation ongoing, EFalse - activation not ongoing. + */ + TBool IsActivationOngoing() const; + + /** + * Determines wether the devsound stream is active or not. + * @return ETrue - Stream is active, EFalse - Stream not active. + */ + TBool IsActive() const; + + CMMFDevSound& DevSound(); + + // from base class MDevSoundObserver + + /** + * From MDevSoundObserver + * Empty implementation + */ + void InitializeComplete(TInt aError); + + /** + * From MDevSoundObserver + * Empty implementation + */ + void BufferToBeFilled(CMMFBuffer* aBuffer); + + /** + * From MDevSoundObserver + * Empty implementation + */ + void PlayError(TInt aError); + + /** + * From MDevSoundObserver + * Empty implementation + */ + void ToneFinished(TInt aError); + + /** + * From MDevSoundObserver + * Empty implementation + */ + void BufferToBeEmptied(CMMFBuffer* aBuffer); + + /** + * From MDevSoundObserver + * Empty implementation + */ + void RecordError(TInt aError); + + /** + * From MDevSoundObserver + * Empty implementation + */ + void ConvertError(TInt aError); + + /** + * From MDevSoundObserver + * Empty implementation + */ + void DeviceMessage(TUid aMessageType, const TDesC8& aMsg); + +protected: + + TMSCSPDevSound(TMSCSPDevSoundObserver& aObserver); + + void ConstructL(TMMFState aMode, gint aAudioPreference, + gint aAudioPriority); + +private: + + /** + * Derived class has to activate the stream here. + */ + virtual void DoActivateL() = 0; + +protected: + + TUint iStreamType; + + /** + * Indication if device is activated. Derived class has to update this. + */ + TBool iActive; + + /** + * Indication if activation is ongoing. + * Derived class has to update this. + */ + TBool iActivationOngoing; + + /** + * Devsound instance + * Own. + */ + CMMFDevSound* iDevSound; + + /** + * Observer for successfull activation. + * Not own. + */ + TMSCSPDevSoundObserver& iObserver; + + }; + +} //namespace TMS + +#endif // TMSCSDEVSOUND_H diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmscsdevsoundobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmscsdevsoundobserver.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef TMSCSDEVSOUNDOBSERVER_H +#define TMSCSDEVSOUNDOBSERVER_H + +namespace TMS { + +/** + * Observer interface for knowing when audio streams have been + * successfully ramped up. + * + */ +class TMSCSPDevSoundObserver + { +public: + virtual void DownlinkInitCompleted(TInt status) = 0; + virtual void UplinkInitCompleted(TInt status) = 0; + + /** + * Notification that Mic has been activated successfully + * + */ + virtual void UplinkActivatedSuccessfully() = 0; + + /** + * Notification that speaker has been activated successfully + * + */ + virtual void DownlinkActivatedSuccessfully() = 0; + + /** + * Notification that Mic initialisation failed. + * + */ + virtual void UplinkActivationFailed() = 0; + + /** + * Notification that Speaker activation failed. + * + */ + virtual void DownlinkActivationFailed() = 0; + }; + +} //namespace TMS + +#endif // TMSCSDEVSOUNDOBSERVER_H diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmscsdownlink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmscsdownlink.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef CSDOWNLINK_H +#define CSDOWNLINK_H + +#include +#include "tmscsdevsound.h" + +namespace TMS { + +// +class TMSCSPDevSoundObserver; + +/** + * Provides Downlink functionality. + * + */ +NONSHARABLE_CLASS(TMSCSDownlink) : public TMSCSPDevSound + { +public: + + static TMSCSDownlink* NewL(TMSCSPDevSoundObserver& aObserver); + + virtual ~TMSCSDownlink(); + + /** + * Sets volume. + * @param aVolume Volume. + */ + void SetVolume(gint aVolume); + + /** + * Gets volume. + * @return Current volume. + */ + gint Volume(); + + /** + * Gets max volume. + * @return Current volume. + */ + gint MaxVolume(); + + // from base class MDevSoundObserver + + /** + * From MDevSoundObserver. + * Indication from devsound that stream (Downlink) has been activated + * successfully. + */ + void BufferToBeFilled(CMMFBuffer* /*aBuffer*/); + + /** + * From MDevSoundObserver. + * Indication from devsound that activation of stream( Downlink) + * failed. + */ + void PlayError(TInt aErrorCode); + +private: + + /** + * From CSPDevSound. + * Tries to activate the mic stream. + */ + void DoActivateL(); + +protected: + + TMSCSDownlink(TMSCSPDevSoundObserver& aObserver); + + void ConstructL(); + }; + +} //namespace TMS + +#endif // CSDOWNLINK_H diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmscsuplink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmscsuplink.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef CS_UPLINK_H +#define CS_UPLINK_H + +#include +#include "tmscsdevsound.h" + +namespace TMS { + +/** + * Provides uplink functionality. + * + */ +NONSHARABLE_CLASS(TMSCSUplink) : public TMSCSPDevSound + { +public: + + static TMSCSUplink* NewL(TMSCSPDevSoundObserver& aObserver); + + virtual ~TMSCSUplink(); + + /** + * Determines mic mute state. + * + * @return ETrue - mic is muted, EFalse - mic is not muted. + */ + TBool IsMuted(); + + /** + * Set mic muted. + */ + void SetMuted(); + + /** + * Set mic unmuted. + */ + void SetUnmuted(); + + /** + * Set mic gain. + */ + void SetGain(gint aGain); + + /** + * Get mic muted. + */ + gint Gain(); + + /** + * Get max gain. + */ + gint MaxGain(); + + // from base class MDevSoundObserver + + /** + * From MDevSoundObserver + * Notification from Devsound that stream (mic) is + * activated successfully. + */ + void BufferToBeEmptied(CMMFBuffer* aBuffer); + + /** + * From MDevSoundObserver + * Notification from devsound that downstream(mic) activation + * feiled. + */ + void RecordError(TInt aError); + +private: + + // from base class MCSPDevSound + + /** + * From MCSPDevSound. + * Tries to activate the mic stream. + */ + void DoActivateL(); + +protected: + + TMSCSUplink(TMSCSPDevSoundObserver& aObserver); + void ConstructL(); + }; + +} //namespace TMS + +#endif // CS_UPLINK_H diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmsdelaytimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmsdelaytimer.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef DELAYTIMER_H +#define DELAYTIMER_H + +#include + +namespace TMS { + +/** + * A Timer utility class used by the Server for shutdown purpose. + */ +class TMSCallDelayTimer : public CActive + { +public: + // Construct/destruct + static TMSCallDelayTimer* NewL(); + ~TMSCallDelayTimer(); + +public: + // Request a timeout after aDelay + void SetDelay(TTimeIntervalMicroSeconds32 aDelay); + +protected: + // From CActive + void RunL(); + void DoCancel(); + +private: + // Construct/destruct + TMSCallDelayTimer(); + void ConstructL(); + +private: + RTimer iShutDownTimer; // Has + }; + +} //namespace TMS + +#endif //DELAYTIMER_H + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmsdtmfnotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmsdtmfnotifier.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef DTMFNOTIFIER_H +#define DTMFNOTIFIER_H + +// INCLUDES +#include +#include +#include "tmsclientserver.h" + +namespace TMS { + +// CLASS DECLARATION +class TMSDtmfNotifier + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static TMSDtmfNotifier* NewL(); + + /** + * Destructor. + */ + virtual ~TMSDtmfNotifier(); + +public: + // New functions + + void SetDtmf(TmsMsgBufPckg dtmfpckg, TBool aPublish = ETrue); + +private: + + /** + * C++ default constructor. + */ + TMSDtmfNotifier(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: + TInt iVolume; //Volume + }; + +} //namespace TMS + +#endif // DTMFNOTIFIER_H + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmsdtmfobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmsdtmfobserver.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef TMSDTMFOBSERVER_H +#define TMSDTMFOBSERVER_H + +#include + +namespace TMS { + +/** + * CCP DTMF related events observer class. + * This class is used for notifying DTMF specific events. + */ +class TMSDTMFObserver + { +public: + + /** DTMF Events */ + enum TCCPDtmfEvent + { + /** Unknown */ + ECCPDtmfUnknown = 0, + /** DTMF sending started manually */ + ECCPDtmfManualStart = 5, + /** DTMF sending stopped manually */ + ECCPDtmfManualStop = 6, + /** DTMF sending aborted manually */ + ECCPDtmfManualAbort = 7, + /** Automatic DTMF sending initialized */ + ECCPDtmfSequenceStart = 9, + /** Automatic DTMF sending stopped */ + ECCPDtmfSequenceStop = 10, + /** Automatic DTMF sending aborted */ + ECCPDtmfSequenceAbort = 11, + /** There was stop mark in DTMF string */ + ECCPDtmfStopInDtmfString, + /** DTMF sending completed succesfully */ + ECCPDtmfStringSendingCompleted + }; + + //protected: + /** + * Protects the observer being deleted through the observer interface. + */ + //virtual inline ~TMSDTMFObserver() {}; + +public: + + /** + * HandleDTMFEvents. + * @param aEvent Event type + * @param aError Error code + * @param aTone Character + * @return none + */ + virtual void HandleDTMFEvent(const TMSDTMFObserver::TCCPDtmfEvent aEvent, + const TInt aError, const TChar aTone) /*const*/ = 0; + }; + +} //namespace TMS + +#endif // TMSDTMFOBSERVER_H + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmsdtmfprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmsdtmfprovider.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef TMSDTMFPROVIDER_H +#define TMSDTMFPROVIDER_H + +#include +#include +#include +#include "tmsdtmfobserver.h" + +namespace TMS { + +// FORWARD DECLARATIONS +class TMSEtelDtmfMonitor; +class TMSEtelDtmfStopMonitor; + +/** + * TMSDTMFProvider class + * Makes asynchronic request to ETel interface according to given request type. + * Provides canceling via CActive::Cancel(). + */ +class TMSDTMFProvider : public CActive + { +public: + + /** + * Two phased constructing of the DTMF provider instance. + * @param aPhone mobile phone handle + * @param aMmCustom custom API handle for special DTMF event + * monitoring. + * @return the DTMF provider instance + */ + static TMSDTMFProvider* NewL(); + + /** + * C++ default destructor + */ + virtual ~TMSDTMFProvider(); + + /** + * HandleDTMFEvents. + * @param aEvent Event type + * @param aError Error code + * @param aTone Character + */ + void NotifyDTMFEvent(const TMSDTMFObserver::TCCPDtmfEvent aEvent, + const TInt aError, const TChar aTone); + + // from base class MCCPDTMFProvider + /** + * Cancels asynchronous DTMF string sending. + * @return KErrNone if succesfull, otherwise another system wide error code + */ + TInt CancelDtmfStringSending(); + + /** + * Starts the transmission of a single DTMF tone across a + * connected and active call. + * @param aTone Tone to be played. + * @return KErrNone if succesfull, otherwise another system wide error code + */ + TInt StartDtmfTone(const TChar aTone); + + /** + * Stops playing current DTMF tone. + * @return KErrNone if succesfull, otherwise another system wide error code + */ + TInt StopDtmfTone(); + + /** + * Plays DTMF string. + * @param aString String to be played. + * @return KErrNone if succesfull, otherwise another system wide error code + * KErrArgument if the specified string contains illegal DTMF characters + */ + TInt SendDtmfToneString(const TDesC& aString); + + /** + * Continue or cancel sending DTMF string which was stopped with 'w' + * character in string. + * @param aContinue ETrue if sending of the DTMF string should continue, + * EFalse if the rest of the DTMF string is to be discarded. + * @return KErrNone if succesfull, otherwise another system wide error code + */ + TInt ContinueDtmfStringSending(const TBool aContinue); + + /** + * Add an observer for DTMF related events. + * Plug-in dependent feature if duplicates or more than one observers + * are allowed or not. Currently CCE will set only one observer. + * @param aObserver Observer + * @leave system error if observer adding fails + */ + void AddObserverL(const TMSDTMFObserver& aObserver); + + /** + * Remove an observer. + * @param aObserver Observer + * @return KErrNone if removed succesfully. KErrNotFound if observer was + * not found. Any other system error depending on the error. + */ + TInt RemoveObserver(const TMSDTMFObserver& aObserver); + + // from base class CActive +protected: + /** + * From CActive + * RunL + */ + void RunL(); + + /** + * From CActive + * Cancels the monitor + */ + void DoCancel(); + +private: + /** + * Constructs the requester. + * + * @param aPhone handle to ETel phone + * @param aMmCustom custom API handle + */ + TMSDTMFProvider(); + + /** + * Constructing the provider in the second phase. + */ + void ConstructL(); + +private: + /** + * DTMF event observer. + */ + RPointerArray iObservers; + + /** + * ETel phone handle for DTMF functionality. + */ + RMobilePhone iPhone; + + /** + * Monitor for DTMF events and changes. + * Own. + */ + TMSEtelDtmfMonitor* iMonitor; + + /** + * Monitor for DTMF stopping. + * Own. + */ + TMSEtelDtmfStopMonitor* iStopMonitor; + + /** + * Custom API reference. + */ + RMmCustomAPI iMmCustom; + + RTelServer iServer; + TBuf<25> iTsyname; + }; + +} //namespace TMS + +#endif //TMSDTMFPROVIDER_H diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmsdtmftoneplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmsdtmftoneplayer.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef TMSAUDIODTMFTONEPLAYER_H +#define TMSAUDIODTMFTONEPLAYER_H + +// INCLUDES +#include +#include +#include "tmsdtmftoneplayerobserver.h" + +// FORWARD DECLARATIONS +class CMMFDevSound; + +// CLASS DECLARATION + +/** + * plays DTMF tones using media server + */ + +namespace TMS { + +class TMSAudioDtmfTonePlayer : public MDevSoundObserver + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static TMSAudioDtmfTonePlayer* NewL(TMSDTMFTonePlayerObserver& obsrvr, + guint aAudioPreference, guint aAudioPriority); + + /** + * Destructor. + */ + virtual ~TMSAudioDtmfTonePlayer(); + +public: + + /** + * Sets volume. + * @param aVolume volume value or KDtmfSilent. + * @return None. + */ + void SetVolume(gint aVolume); + + /** + * Starts playing given dtmf tone infinitely. + * @param aTone Tone to be played. + * @return None. + */ + void PlayDtmfTone(TDes& tone); + + /** + * Cancels playing. + * @param None. + * @return None. + */ + void Cancel(); + +public: + //From MDevSoundObserver + /** + * See MDevSoundObserver + */ + void InitializeComplete(TInt aError); + + /** + * See MDevSoundObserver + */ + void ToneFinished(TInt aError); + + /** + * See MDevSoundObserver + */ + void BufferToBeFilled(CMMFBuffer* aBuffer); + + /** + * See MDevSoundObserver + */ + void PlayError(TInt aError); + + /** + * See MDevSoundObserver + */ + void BufferToBeEmptied(CMMFBuffer* aBuffer); + + /** + * See MDevSoundObserver + */ + void RecordError(TInt aError); + + /** + * See MDevSoundObserver + */ + void ConvertError(TInt aError); + /** + * See MDevSoundObserver + */ + void DeviceMessage(TUid aMessageType, const TDesC8& aMsg); + +protected: + + /** + * C++ default constructor. + */ + TMSAudioDtmfTonePlayer(TMSDTMFTonePlayerObserver& obsrvr, + guint aAudioPreference, guint aAudioPriority); + + void ConstructL(); + + /** + * Normalize tone. + * @param aTone dtmf tone. + * @return None. + */ + void Normalize(TChar& aTone); + +private: + //new functions + + /** + * Converts the given value to the one that matches tha range used by + * CMMFDevSound. The CMMFDevSound uses valuess that can from 0 to the + * value returned by a call to CMMFDevSound::MaxVolume(). + */ + gint ConvertVolume(gint aVolume); + +protected: + // Data + + // Current volume setting. + gint iVolume; + + // DTMF player instance + CMMFDevSound* iDTMFPlayer; + + TMSDTMFTonePlayerObserver& iObserver; + guint iPref; + guint iPrior; + + }; + +} //namespace TMS + +#endif // TMSAUDIODTMFTONEPLAYER_H + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmsdtmftoneplayerobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmsdtmftoneplayerobserver.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef DTMFTONEPLAYEROBSERVER_H +#define DTMFTONEPLAYEROBSERVER_H + +namespace TMS { + +/** + * Observer interface for knowing when dtmf tone player has been initialized. + */ +class TMSDTMFTonePlayerObserver + { +public: + virtual void DTMFInitCompleted(TInt error) = 0; + virtual void DTMFToneFinished(TInt error) = 0; + }; +} //namespace TMS + +#endif // DTMFTONEPLAYEROBSERVER_H + diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmseteldtmfmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmseteldtmfmonitor.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef TMSETELDTMFMONITOR_H +#define TMSETELDTMFMONITOR_H + +#include +#include +#include + +namespace TMS { + +// FORWARD DECLARATIONS +class TMSCSPCall; +class TMSDTMFProvider; + +/** + * TMSEtelDtmfMonitor class + * + * Monitors ETel for DTMF events. + * + * This monitor is applied only for listening incoming calls, i.e. + * line capabilites are not monitored. + * + * @lib csplugin.dll + * + */ +class TMSEtelDtmfMonitor : public CActive + { +public: + /** + * Two-phased constructing for the monitor. + * + * @param aObserver the observer for getting notification + * @param aMmCustom Custom API handle + */ + static TMSEtelDtmfMonitor* NewL(TMSDTMFProvider& aObserver, + RMmCustomAPI& aMmCustom); + + /** + * C++ default destructor + */ + virtual ~TMSEtelDtmfMonitor(); + + /** + * Start monitoring call events + */ + void StartMonitoring(); + +protected: // From CActive + /** + * From CActive + * RunL + */ + void RunL(); + + /** + * From CActive + * Cancels the monitor + */ + void DoCancel(); + +private: + /** + * C++ default constructor + * @param aObserver the observer for status change (incoming call) + * @param aMmCustom Custom API handle + */ + TMSEtelDtmfMonitor(TMSDTMFProvider& aObserver, RMmCustomAPI& aMmCustom); + +private: + /** + * Forwards events. + */ + TMSDTMFProvider& iObserver; + + /** + * Event data. Updated when event occurs. + */ + RMmCustomAPI::TDtmfInfo iEventData; + + /** + * Custom API reference. + */ + RMmCustomAPI& iMmCustom; + + }; + +} //namespace TMS + +#endif // TMSETELDTMFMONITOR_H + diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmseteldtmfstopmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmseteldtmfstopmonitor.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef TMSETELDTMFSTOPMONITOR_H +#define TMSETELDTMFSTOPMONITOR_H + +#include +#include + +namespace TMS { + +// FORWARD DECLARATIONS +class TMSDTMFProvider; + +/** + * TMSEtelDtmfStopMonitor class + * + * Monitors single ETel RMobilePhone for DTMF events. + * + * This monitor is applied only for listening incoming calls, i.e. + * line capabilites are not monitored. + * + */ +class TMSEtelDtmfStopMonitor : public CActive + { +public: + /** + * Two-phased constructing for the monitor. + * + * @param aObserver the observer for getting notification + * @param aPhone the line to monitor + */ + static TMSEtelDtmfStopMonitor* NewL(TMSDTMFProvider& aObserver, + RMobilePhone& aPhone); + + /** + * C++ default destructor + */ + virtual ~TMSEtelDtmfStopMonitor(); + + /** + * Start monitoring call events + */ + void StartMonitoring(); + +protected: // From CActive + /** + * From CActive + * RunL + */ + void RunL(); + + /** + * From CActive + * Cancels the monitor + */ + void DoCancel(); + +private: + /** + * C++ default constructor + * @param aObserver the observer for status change (incoming call) + * @param aPhone the line associated with the call + */ + TMSEtelDtmfStopMonitor(TMSDTMFProvider& aObserver, RMobilePhone& aPhone); + +private: + /** + * Forwards events. + */ + TMSDTMFProvider& iObserver; + + /** + * Phone that is being observed for incoming call. + */ + RMobilePhone& iPhone; + + /** + * Event received. + */ + RMobilePhone::TMobilePhoneDTMFEvent iEventData; + + }; + +} //namespace TMS + +#endif // TMSETELDTMFSTOPMONITOR_H + diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmsipcallstream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmsipcallstream.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef __IPCALLSTREAM_H +#define __IPCALLSTREAM_H + +//#define __PLAY_WAV_FROM_FILE__ + +#include +#include +#include +#include "tmsgstreamer.h" +#include "tmsshared.h" +#include "tmsclientserver.h" + +#ifdef __USE_GSTREAMER__ +#include +#include "gstg711encoderinterface.h" +#include "gstspeechencoderconfig.h" +#include "gsterrorconcealmentinterface.h" +#include "gstg711decoderinterface.h" +#include "gstilbcdecoderinterface.h" +#include "gstilbcencoderinterface.h" +#include "gstg729encoderinterface.h" +#include "gstg729decoderinterface.h" +#else //__USE_GSTREAMER__ +#include +#include +#include + +// FORWARD DECLARATIONS +class CAudioOutput; +class CErrorConcealmentIntfc; +class CSpeechEncoderConfig; +class CG711DecoderIntfc; +class CG729DecoderIntfc; +class CIlbcDecoderIntfc; +class CG711EncoderIntfc; +class CG729EncoderIntfc; +class CIlbcEncoderIntfc; +#endif //__USE_GSTREAMER__ + +namespace TMS { + +// ----------------------------------------------------------------------------- +// Class Name: TMSIPCallStreamBase +// +// Base abstract class for creating VoIP uplink and downlink streams. +// ----------------------------------------------------------------------------- +class TMSIPCallStreamBase : public CBase +#ifndef __USE_GSTREAMER__ + , public MDevSoundObserver +#endif //__USE_GSTREAMER__ + { +public: + enum TStreamState + { + ENotReady, // not initialized + EReady, // initialized and ready for streaming + EStreaming + // active streaming + }; + +public: + virtual ~TMSIPCallStreamBase(); + + virtual void Start() = 0; + virtual void Stop() = 0; + virtual gint SetCodecCi() = 0; + +#ifndef __USE_GSTREAMER__ + void InitDevSoundL(const TMMFState aDevSoundState, + const TMMFPrioritySettings priority); +#endif //__USE_GSTREAMER__ + void SetMsgQueue(const RMsgQueue aMsgQueue); + gint DoChunk(const gint aDataLen, TmsMsgBuf& aMsgBuffer); + gint ConfigureMedia(const guint32 aCodecID); + +protected: +#ifndef __USE_GSTREAMER__ + // From MDevSoundObserver + virtual void InitializeComplete(TInt aError) = 0; + virtual void BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) {} + virtual void RecordError(TInt /*aError*/) {} + virtual void BufferToBeFilled(CMMFBuffer* /*aBuffer*/) {} + virtual void PlayError(TInt /*aError*/) {} + virtual void ToneFinished(TInt /*aError*/) {} + virtual void ConvertError(TInt /*aError*/) {} + virtual void DeviceMessage(TUid /*aMessageType*/, const TDesC8& /*aMsg*/) {} + virtual void SendEventToClient(const TMMFEvent& /*aEvent*/) {} +#endif //__USE_GSTREAMER__ + +protected: + + CActiveScheduler* iActiveScheduler; + TStreamState iStatus; + +#ifndef __USE_GSTREAMER__ + CMMFDevSound* iDevSound; + CMMFDataBuffer* iDevSoundBufPtr; +#endif //__USE_GSTREAMER__ + + RMsgQueue iMsgQueue; // ITC back to client + TmsMsgBuf iMsgBuffer; + RChunk iChunk; + gint iMaxBufLen; + guint32 iCodecID; + TMMFPrioritySettings iPriority; + const gchar* iMediaType; + + gint iG711DecodeMode; + gint iILBCDecodeMode; + gint iG711EncodeMode; + gint iILBCEncodeMode; + gint iBufLen; + TBool iWriteDataXferHndlToClient; + TUint32 iKey; + }; + +// ----------------------------------------------------------------------------- +// Class Name: TMSIPDownlink +// +// Class handling VoIP downlink stream object. +// ----------------------------------------------------------------------------- +class TMSIPDownlink : public TMSIPCallStreamBase + { +public: + virtual ~TMSIPDownlink(); + +#ifdef __USE_GSTREAMER__ + static void cb_raw_playback_handoff(GstElement* appsrc, guint size); + static gboolean bus_call(GstBus* bus, GstMessage* msg, gpointer data); +#endif //__USE_GSTREAMER__ + static TMSIPDownlink* NewL(const guint32 codecID, + const TMMFPrioritySettings priority); + TMSIPDownlink(); + void ConstructL(const guint32 codecID, + const TMMFPrioritySettings priority); + + gint SetCodecCi(); + void Start(); + void Stop(); + void BufferFilled(const guint buflen); + gint SetVolume(const guint volume); + gint GetVolume(guint& volume); + gint GetMaxVolume(guint& volume); + gint GetDataXferChunkHndl(const TUint32 key, RChunk& chunk); + + // For CIs + gint SetIlbcCodecMode(const gint mode); + gint GetIlbcCodecMode(gint& mode); + gint SetG711CodecMode(const gint mode); + gint GetG711CodecMode(gint& mode); + gint FrameModeRqrdForEC(gboolean& frmodereq); + gint SetFrameMode(gboolean frmode); + gint GetFrameMode(gboolean& frmode); + gint ConcealErrorForNextBuffer(); + gint SetCng(const TMSFormatType fmttype, const gboolean cng); + gint GetCng(const TMSFormatType fmttype, gboolean& cng); + gint SetPlc(const TMSFormatType fmttype, const gboolean plc); + gint GetPlc(const TMSFormatType fmttype, gboolean& plc); + gint BadLsfNextBuffer(); + + void SetAudioDeviceL(TMSAudioOutput output); + void GetAudioDeviceL(TMSAudioOutput& output); + +private: + void SetCodecCiL(); + +#ifdef __USE_GSTREAMER__ + void BufferToBeFilled(); + gint gst_play_raw(); + gint gst_initialize_play(); +#else //__USE_GSTREAMER__ + // From MDevSoundObserver + virtual void BufferToBeFilled(CMMFBuffer* aBuffer); + virtual void InitializeComplete(TInt aError); + virtual void PlayError(TInt aError); +#endif //__USE_GSTREAMER__ + +private: + + gboolean iFrameMode; + gboolean iPlc; + gint iMaxVolume; + +#ifndef __USE_GSTREAMER__ + CAudioOutput* iAudioOutput; + CErrorConcealmentIntfc* iErrConcealmentIntfc; + CG711DecoderIntfc* iG711DecoderIntfc; + CG729DecoderIntfc* iG729DecoderIntfc; + CIlbcDecoderIntfc* iIlbcDecoderIntfc; +#else //__USE_GSTREAMER__ + GstErrorConcealmentIntfc* iErrConcealmentIntfc; + GstG711DecoderIntfc* iG711DecoderIntfc; + GstG729DecoderIntfc* iG729DecoderIntfc; + GstIlbcDecoderIntfc* iIlbcDecoderIntfc; + GstElement* iPipelinePlay; + GstElement* iAppSrc; + GstElement* iSink; + GstBus* iBusPlay; +#endif //__USE_GSTREAMER__ +#ifdef _DEBUG + gint iSamplesPlayedCount; +#endif + +#ifdef __PLAY_WAV_FROM_FILE__ + RFile iFile; + gint fsize; + gint iReadSize; + gint iReadBytes; + RFs iFs; + HBufC8* fbuf; +#endif + }; + +// ----------------------------------------------------------------------------- +// Class Name: TMSIPUplink +// +// Class handling VoIP uplink stream. +// ----------------------------------------------------------------------------- +class TMSIPUplink : public TMSIPCallStreamBase + { +public: + virtual ~TMSIPUplink(); + +#ifdef __USE_GSTREAMER__ + static void cb_record_raw_handoff(GstElement *sink); + static gboolean bus_call(GstBus* bus, GstMessage* msg, gpointer data); +#endif //__USE_GSTREAMER__ + static TMSIPUplink* NewL(const guint32 codecID, + const TMMFPrioritySettings priority); + TMSIPUplink(); + void ConstructL(const guint32 codecID, + const TMMFPrioritySettings priority); + + gint SetCodecCi(); + void Start(); + void Stop(); + void BufferEmptied(); + gint SetGain(const guint gain); + gint GetGain(guint& gain); + gint GetMaxGain(guint& gain); + gint GetDataXferChunkHndl(const TUint32 key, RChunk& chunk); + + // For CIs + gint SetIlbcCodecMode(const gint mode); + gint GetIlbcCodecMode(gint& mode); + gint SetG711CodecMode(const gint mode); + gint GetG711CodecMode(gint& mode); + gint GetSupportedBitrates(RArray& bitrates); + gint SetBitrate(guint bitrate); + gint GetBitrate(guint& bitrate); + gint SetVad(const TMSFormatType fmttype, const gboolean vad); + gint GetVad(const TMSFormatType fmttype, gboolean& vad); + +private: + void SetCodecCiL(); + +#ifdef __USE_GSTREAMER__ + void BufferToBeEmptied(); + gint gst_record_raw(); + gint gst_initialize_record(); +#else //__USE_GSTREAMER__ + // From MDevSoundObserver + virtual void BufferToBeEmptied(CMMFBuffer* aBuffer); + virtual void InitializeComplete(TInt aError); + virtual void RecordError(TInt /*aError*/); +#endif //__USE_GSTREAMER__ + +private: + gint iMaxGain; + +#ifndef __USE_GSTREAMER__ + CSpeechEncoderConfig* iSpeechEncoderConfig; + CG711EncoderIntfc* iG711EncoderIntfc; + CG729EncoderIntfc* iG729EncoderIntfc; + CIlbcEncoderIntfc* iIlbcEncoderIntfc; +#else //__USE_GSTREAMER__ + GstSpeechEncoderConfigIntfc* iSpeechEncoderConfig; + GstG711EncoderIntfc* iG711EncoderIntfc; + GstG729EncoderIntfc* iG729EncoderIntfc; + GstIlbcEncoderIntfc* iIlbcEncoderIntfc; + GstElement* iPipelineRec; + GstElement* iSource; + GstElement* iAppSink; + GstBus* iBusRec; +#endif //__USE_GSTREAMER__ +#ifdef _DEBUG + gint iSamplesRecCount; +#endif + }; + +} //namespace TMS + +#endif //__IPCALLSTREAM_H + +// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/inc/tmstarsettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/inc/tmstarsettings.h Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#ifndef TARSETTINGS_H +#define TARSETTINGS_H + +// INCLUDES +#include +#include +#include +#include "tmsclientserver.h" + +namespace TMS { + +// CLASS DECLARATION +class TMSTarSettings + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static TMSTarSettings* NewL(); + + /** + * Destructor. + */ + virtual ~TMSTarSettings(); + +public: + // New functions + + void SetTar(TRoutingMsgBufPckg rountingpckg, TBool aPublish = ETrue); + +private: + + /** + * C++ default constructor. + */ + TMSTarSettings(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: + gint iVolume; //Volume + }; + +} //namespace TMS + +#endif // TarSETTINGS_H + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/calladpt.cpp --- a/mmserv/tms/tmscallserver/src/calladpt.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include "callipadpt.h" -#include "callcsadpt.h" -#include "calladpt.h" -#include "tmsutility.h" - -using namespace TMS; - -// ----------------------------------------------------------------------------- -// TMSCallAdpt::TMSCallAdpt -// -// ----------------------------------------------------------------------------- -// -TMSCallAdpt::TMSCallAdpt() - { - TRACE_PRN_FN_ENT; - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallAdpt::~TMSCallAdpt -// -// ----------------------------------------------------------------------------- -// -TMSCallAdpt::~TMSCallAdpt() - { - TRACE_PRN_FN_ENT; - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallAdpt::CreateCallL -// -// ----------------------------------------------------------------------------- -// -gint TMSCallAdpt::CreateCallL(gint callType, TMSCallAdpt*& callAdpt) - { - TRACE_PRN_FN_ENT; - TMSCallAdpt* self(NULL); - gint retVal(TMS_RESULT_SUCCESS); - switch (callType) - { - case TMS_CALL_IP: - retVal = TMS_RESULT_INSUFFICIENT_MEMORY; - self = TMSCallIPAdpt::NewL(); - if (self) - { - retVal = self->PostConstruct(); - if (retVal != TMS_RESULT_SUCCESS) - { - delete self; - self = NULL; - } - } - break; - - case TMS_CALL_CS: - retVal = TMS_RESULT_INSUFFICIENT_MEMORY; - self = new TMSCallCSAdpt(); - if (self) - { - retVal = self->PostConstruct(); - if (retVal != TMS_RESULT_SUCCESS) - { - delete self; - self = NULL; - } - } - break; - default: - retVal = TMS_RESULT_CALL_TYPE_NOT_SUPPORTED; - break; - } - callAdpt = self; - TRACE_PRN_FN_EXT; - return retVal; - } - -// ----------------------------------------------------------------------------- -// TMSCallAdpt::PostConstruct -// -// ----------------------------------------------------------------------------- -// -gint TMSCallAdpt::PostConstruct() - { - return TMS_RESULT_SUCCESS; - } - -// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/callcsadpt.cpp --- a/mmserv/tms/tmscallserver/src/callcsadpt.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1276 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include -#include -#include -#include "csuplink.h" -#include "csdownlink.h" -#include "callcsadpt.h" -#include "tmsutility.h" -#include "tmsshared.h" -#include "tmsclientserver.h" -#include "tarsettings.h" -#include "cpeaudiodtmftoneplayer.h" -#include "cspdtmfprovider.h" -#include "dtmfnotifier.h" - -using namespace TMS; - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::TMSCallCSAdpt -// -// ----------------------------------------------------------------------------- -// -TMSCallCSAdpt::TMSCallCSAdpt() - { - TRACE_PRN_FN_ENT; - - iCSDownlink = NULL; - iCSUplink = NULL; - iRouting = NULL; - iDTMFDnlinkPlayer = NULL; - iDTMFUplinkPlayer = NULL; - iDTMFNotifier = NULL; - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::~TMSCallCSAdpt -// -// ----------------------------------------------------------------------------- -// -TMSCallCSAdpt::~TMSCallCSAdpt() - { - TRACE_PRN_FN_ENT; - delete iCSDownlink; - delete iCSUplink; - delete iRouting; - delete iTarSettings; - delete iDTMFDnlinkPlayer; - delete iDTMFUplinkPlayer; - delete iDTMFNotifier; - - if (iMsgQueueUp.Handle() > 0) - { - iMsgQueueUp.Close(); - } - - if (iMsgQueueDn.Handle() > 0) - { - iMsgQueueDn.Close(); - } - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::PostConstruct -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::PostConstruct() - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - iNextStreamId = 1; - iUplinkInitialized = FALSE; - iDnlinkInitialized = FALSE; - - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::CreateStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::CreateStream(TMSCallType /*callType*/, - TMSStreamType strmType, gint& outStrmId) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - switch (strmType) - { - case TMS_STREAM_UPLINK: - status = TMS_RESULT_ALREADY_EXIST; - if (!iUplinkInitialized) - { - iUplinkInitialized = TRUE; - iUplinkStreamId = iNextStreamId; - outStrmId = iUplinkStreamId; - iNextStreamId++; - iUplinkInitialized = TRUE; - status = TMS_RESULT_SUCCESS; - } - break; - case TMS_STREAM_DOWNLINK: - status = TMS_RESULT_ALREADY_EXIST; - if (!iDnlinkInitialized) - { - iDnlinkInitialized = TRUE; - iDnlinkStreamId = iNextStreamId; - outStrmId = iDnlinkStreamId; - iNextStreamId++; - iDnlinkInitialized = TRUE; - status = TMS_RESULT_SUCCESS; - } - break; - default: - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::InitStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::InitStreamL(TMSCallType /*callType*/, - TMSStreamType strmType, gint strmId, TMSFormatType /*frmtType*/, - const RMessage2& aMessage) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - - switch (strmType) - { - case TMS_STREAM_UPLINK: - if (strmId == iUplinkStreamId) - { - // Open message queue handling client-server communication - if (iMsgQueueUp.Handle() <= 0) - { - // Third argument in TMSCallProxy::InitStream - status = iMsgQueueUp.Open(aMessage, 1); - } - if (status == TMS_RESULT_SUCCESS) - { - TRAP(status, iCSUplink = TMSCSUplink::NewL(*this)); - - if (status == TMS_RESULT_SUCCESS) - { - iDTMFUplinkPlayer = TMSDTMFProvider::NewL(); - iDTMFUplinkPlayer->AddObserverL(*this); - if(!iDTMFNotifier) - { - iDTMFNotifier = TMSDtmfNotifier::NewL(); - } - } - } - iStrmtype = TMS_STREAM_UPLINK; - } - else - { - status = TMS_RESULT_DOES_NOT_EXIST; - } - break; - case TMS_STREAM_DOWNLINK: - if (strmId == iDnlinkStreamId) - { - // Open message queue handling client-server communication - if (iMsgQueueDn.Handle() <= 0) - { - // Third argument in TMSCallProxy::InitStream - status = iMsgQueueDn.Open(aMessage, 1); - } - if (status == TMS_RESULT_SUCCESS) - { - TRAP(status, iCSDownlink = TMSCSDownlink::NewL(*this)); - if (status == TMS_RESULT_SUCCESS) - { - TRAP(status, iRouting = - CTelephonyAudioRouting::NewL(*this)); - if (status == TMS_RESULT_SUCCESS) - { - iTarSettings = TMSTarSettings::NewL(); - } - if (status == TMS_RESULT_SUCCESS) - { - TRAP(status, iDTMFDnlinkPlayer = - TMSAudioDtmfTonePlayer::NewL(*this, - KAudioPrefKeyDownDTMF, - KAudioPriorityDtmfKeyPress)); - if(!iDTMFNotifier) - { - iDTMFNotifier = TMSDtmfNotifier::NewL(); - } - } - } - } - iStrmtype = TMS_STREAM_DOWNLINK; - } - else - { - status = TMS_RESULT_DOES_NOT_EXIST; - } - break; - default: - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - - TRACE_PRN_IF_ERR(status); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::StartStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::StartStream(TMSCallType /*callType*/, - TMSStreamType strmType, gint strmId) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - switch (strmType) - { - case TMS_STREAM_UPLINK: - if (iCSUplink && strmId == iUplinkStreamId) - { - iCSUplink->Activate(); - } - break; - case TMS_STREAM_DOWNLINK: - if (iCSDownlink && strmId == iDnlinkStreamId) - { - iCSDownlink->Activate(); - } - break; - default: - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::PauseStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::PauseStream(TMSCallType /*callType*/, - TMSStreamType /*strmType*/, gint /*strmId*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::StopStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::StopStream(TMSCallType /*callType*/, TMSStreamType strmType, - gint strmId) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - switch (strmType) - { - case TMS_STREAM_UPLINK: - if (iCSUplink && strmId == iUplinkStreamId) - { - iCSUplink->Deactivate(); - NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, - status, 0); - } - break; - case TMS_STREAM_DOWNLINK: - if (iCSDownlink && strmId == iDnlinkStreamId) - { - iCSDownlink->Deactivate(); - NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, - status, 0); - } - break; - default: - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::DeinitStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::DeinitStream(TMSCallType /*callType*/, - TMSStreamType strmType, gint strmId) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - switch (strmType) - { - case TMS_STREAM_UPLINK: - if (iCSUplink && strmId == iUplinkStreamId) - { - iCSUplink->Deactivate(); - iUplinkInitialized = FALSE; - NotifyClient(iUplinkStreamId, ECmdUplinkDeInitComplete, - status, 0); - } - break; - case TMS_STREAM_DOWNLINK: - if (iCSDownlink && strmId == iDnlinkStreamId) - { - iCSDownlink->Deactivate(); - iDnlinkInitialized = FALSE; - NotifyClient(iDnlinkStreamId, ECmdDownlinkDeInitComplete, - status, 0); - } - break; - default: - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::DeleteStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::DeleteStream(TMSCallType /*callType*/, - TMSStreamType strmType, gint strmId) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - switch (strmType) - { - case TMS_STREAM_UPLINK: - if (strmId == iUplinkStreamId) - { - iUplinkStreamId = -1; - iUplinkInitialized = FALSE; - } - break; - case TMS_STREAM_DOWNLINK: - if (strmId == iDnlinkStreamId) - { - iDnlinkStreamId = -1; - iDnlinkInitialized = FALSE; - } - break; - default: - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::DataXferBufferEmptied -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::DataXferBufferEmptied(TMSCallType /*callType*/, - TMSStreamType /*strmType*/, gint /*strmId*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::DataXferBufferFilled -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::DataXferBufferFilled(TMSCallType /*callType*/, - TMSStreamType /*strmType*/, gint /*strmId*/, guint /*datasize*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetDataXferBufferHndl -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetDataXferBufferHndl(const TMSCallType /*callType*/, - const TMSStreamType /*strmType*/, const gint /*strmId*/, - const guint32 /*key*/, RChunk& /*chunk*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetMaxVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetMaxVolume(guint& volume) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_ILLEGAL_OPERATION); - if (iCSDownlink && iDnlinkInitialized) - { - volume = iCSDownlink->MaxVolume(); - status = TMS_RESULT_SUCCESS; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::SetVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::SetVolume(const guint volume) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_ILLEGAL_OPERATION); - if (iCSDownlink && iDnlinkInitialized) - { - iCSDownlink->SetVolume(volume); - status = TMS_RESULT_SUCCESS; - NotifyClient(iDnlinkStreamId, ECmdSetVolume, status, 0); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetVolume(guint& volume) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_ILLEGAL_OPERATION); - if (iCSDownlink && iDnlinkInitialized) - { - volume = iCSDownlink->Volume(); - status = TMS_RESULT_SUCCESS; - } - - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetMaxGain -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetMaxGain(guint& gain) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_ILLEGAL_OPERATION); - if (iCSUplink && iUplinkInitialized) - { - gain = iCSUplink->MaxGain(); - status = TMS_RESULT_SUCCESS; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::SetGain -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::SetGain(const guint gain) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_ILLEGAL_OPERATION); - if (iUplinkInitialized) - { - iCSUplink->SetGain(gain); - status = TMS_RESULT_SUCCESS; - NotifyClient(iUplinkInitialized, ECmdSetGain, status, 0); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetGain -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetGain(guint& gain) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_ILLEGAL_OPERATION); - if (iCSUplink && iUplinkInitialized) - { - gain = iCSUplink->Gain(); - status = TMS_RESULT_SUCCESS; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetGlobalMaxVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetGlobalMaxVolume(guint& volume) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_ILLEGAL_OPERATION); - if (iCSDownlink && iDnlinkInitialized) - { - volume = iCSDownlink->MaxVolume(); - status = TMS_RESULT_SUCCESS; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::SetGlobalVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::SetGlobalVolume(const guint volume) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - - iGlobalVol = volume; - if (iCSDownlink && iDnlinkInitialized) - { - iCSDownlink->SetVolume(volume); - status = TMS_RESULT_SUCCESS; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetGlobalVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetGlobalVolume(guint& volume) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_ILLEGAL_OPERATION); - if (iCSDownlink && iDnlinkInitialized) - { - volume = iCSDownlink->Volume(); - status = TMS_RESULT_SUCCESS; - } - - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetMaxGain -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetGlobalMaxGain(guint& gain) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_ILLEGAL_OPERATION); - if (iCSUplink && iUplinkInitialized) - { - gain = iCSUplink->MaxGain(); - status = TMS_RESULT_SUCCESS; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::SetGain -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::SetGlobalGain(const guint gain) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - - iGlobalGain = gain; - if (iCSUplink && iUplinkInitialized) - { - iCSUplink->SetGain(gain); - status = TMS_RESULT_SUCCESS; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetGlobalGain -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetGlobalGain(guint& gain) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_ILLEGAL_OPERATION); - if (iCSUplink && iUplinkInitialized) - { - gain = iCSUplink->Gain(); - status = TMS_RESULT_SUCCESS; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetCodecMode(const TMSFormatType /*fmttype*/, - const TMSStreamType /*strmtype*/, gint& /*mode*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::SetCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::SetCodecMode(const TMSFormatType /*fmttype*/, - const TMSStreamType /*strmtype*/, const gint /*mode*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetSupportedBitRatesCount -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetSupportedBitRatesCount(guint& /*count*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetSupportedBitRates -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetSupportedBitRates(CBufFlat*& brbuffer) - { - TRACE_PRN_FN_ENT; - TRAPD(status, GetSupportedBitRatesL(brbuffer)); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetSupportedBitRatesL -// -// GetSupportedBitRates implementation which can leave. -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::GetSupportedBitRatesL(CBufFlat*& /*brbuffer*/) - { - User::Leave(TMS_RESULT_FEATURE_NOT_SUPPORTED); - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetBitRate -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetBitRate(guint& /*bitrate*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::SetBitRate -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::SetBitRate(const guint /*bitrate*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetVAD -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetVAD(const TMSFormatType /*fmttype*/, gboolean& /*vad*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::SetVAD -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::SetVAD(const TMSFormatType /*fmttype*/, const gboolean /*vad*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetCNG -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetCNG(const TMSFormatType /*fmttype*/, gboolean& /*cng*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::SetCNG -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::SetCNG(const TMSFormatType /*fmttype*/, - const gboolean /*cng*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetPlc -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetPlc(const TMSFormatType /*fmttype*/, gboolean& /*plc*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::SetPlc -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::SetPlc(const TMSFormatType /*fmttype*/, - const gboolean /*plc*/) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::SetOutput -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::SetOutput(TMSAudioOutput output) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - - if (iRouting) - { - CTelephonyAudioRouting::TAudioOutput taroutput = TOTAROUTPUT(output); - TRAP(status, iRouting->SetOutputL(taroutput)); - if (status == KErrArgument) - { - status = TMS_RESULT_INVALID_ARGUMENT; - } - else - { - status = TMS_RESULT_SUCCESS; - } - } - - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetOutput -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetOutput(TMSAudioOutput& output) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - - if (iRouting) - { - CTelephonyAudioRouting::TAudioOutput taroutput; - taroutput = iRouting->Output(); - status = TMS_RESULT_SUCCESS; - output = TOTMSOUTPUT(taroutput); - } - - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetPreviousOutput -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetPreviousOutput(TMSAudioOutput& output) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - - if (iRouting) - { - CTelephonyAudioRouting::TAudioOutput taroutput; - taroutput = iRouting->PreviousOutput(); - status = TMS_RESULT_SUCCESS; - output = TOTMSOUTPUT(taroutput); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::GetAvailableOutputsL -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuffer) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - TMSAudioOutput tmsoutput; - - if (iRouting) - { - RBufWriteStream stream; - stream.Open(*outputsbuffer); - CleanupClosePushL(stream); - - TArray availableOutputs = - iRouting->AvailableOutputs(); - - guint numOfItems = availableOutputs.Count(); - count = numOfItems; - for (guint i = 0; i < numOfItems; i++) - { - tmsoutput = TOTMSOUTPUT(availableOutputs[i]); - stream.WriteUint32L(tmsoutput); - //TRACE_PRN_N1(_L("TMS->CallIPAdpt: outputs: [%d]"), availableOutputs[i]); - } - - CleanupStack::PopAndDestroy(&stream); - status = TMS_RESULT_SUCCESS; - } - - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::StartDTMF -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::StartDTMF(TMSStreamType strmtype, TDes& dtmfstring) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - - TmsMsgBufPckg dtmfpckg; - - if (strmtype == TMS_STREAM_DOWNLINK && iDnlinkInitialized) - { - if (iDTMFDnlinkPlayer) - { - iDTMFDnlinkPlayer->PlayDtmfTone(dtmfstring); - } - - dtmfpckg().iStatus = TMS_RESULT_SUCCESS; - //TMS_EVENT_DTMF_TONE_STARTED; - dtmfpckg().iRequest = ECmdDTMFOpenDnlinkComplete; - if (iDTMFNotifier) - { - iDTMFNotifier->SetDtmf(dtmfpckg, TRUE); - } - } - else if (strmtype == TMS_STREAM_UPLINK && iUplinkInitialized) - { - //use etel for uplink - if (iDTMFUplinkPlayer) - { - status = iDTMFUplinkPlayer->SendDtmfToneString(dtmfstring); - } - - dtmfpckg().iStatus = TMSUtility::EtelToTMSResult(status); - //TMS_EVENT_DTMF_TONE_STARTED; - dtmfpckg().iRequest = ECmdDTMFOpenUplinkComplete; - - if (iDTMFNotifier) - { - iDTMFNotifier->SetDtmf(dtmfpckg, TRUE); - } - } - - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::StopDTMF -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::StopDTMF(TMSStreamType streamtype) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - - if (streamtype == TMS_STREAM_DOWNLINK && iDTMFDnlinkPlayer) - { - iDTMFDnlinkPlayer->Cancel(); - } - else if (streamtype == TMS_STREAM_UPLINK && iDTMFUplinkPlayer) - { - status = iDTMFUplinkPlayer->StopDtmfTone(); - status = TMSUtility::EtelToTMSResult(status); - } - - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::ContinueDTMF -// -// ----------------------------------------------------------------------------- -// -gint TMSCallCSAdpt::ContinueDTMF(TBool continuesending) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - - if (iDTMFUplinkPlayer) - { - status = iDTMFUplinkPlayer->ContinueDtmfStringSending(continuesending); - status = TMSUtility::EtelToTMSResult(status); - } - - TRACE_PRN_FN_EXT; - return status; - } - -//From DTMFTonePlayerObserver -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::DTMFInitCompleted -// -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::DTMFInitCompleted(TInt /*error*/) - { - TRACE_PRN_FN_ENT; - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::DTMFToneFinished -// -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::DTMFToneFinished(TInt error) - { - TRACE_PRN_FN_ENT; - TmsMsgBufPckg dtmfpckg; - - if (error == KErrUnderflow || error == KErrInUse) - { - error = TMS_RESULT_SUCCESS; - } - - dtmfpckg().iStatus = TMSUtility::TMSResult(error); - //TMS_EVENT_DTMF_TONE_STOPPED - dtmfpckg().iRequest = ECmdDTMFTonePlayFinished; - if (iDTMFNotifier) - { - iDTMFNotifier->SetDtmf(dtmfpckg, TRUE); - } - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::HandleDTMFEvent -// -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::HandleDTMFEvent( - const TMSCCPDTMFObserver::TCCPDtmfEvent aEvent, const TInt aError, - const TChar /*aTone*/) - { - TRACE_PRN_FN_ENT; - TmsMsgBufPckg dtmfpckg; - - TRACE_PRN_N1(_L("**TMS TMSCallCSAdpt::HandleDTMFEvent error:%d"),aError); - - dtmfpckg().iStatus = TMSUtility::EtelToTMSResult(aError); - - switch (aEvent) - { - /** Unknown */ - case ECCPDtmfUnknown: - break; - /** DTMF sending started manually */ - case ECCPDtmfManualStart: - /** Automatic DTMF sending initialized */ - case ECCPDtmfSequenceStart: - //TMS_EVENT_DTMF_TONE_STARTED - dtmfpckg().iRequest = ECmdDTMFOpenUplinkComplete; - break; - - /** DTMF sending stopped manually */ - case ECCPDtmfManualStop: - //break; - /** DTMF sending aborted manually */ - case ECCPDtmfManualAbort: - //break; - /** Automatic DTMF sending stopped */ - case ECCPDtmfSequenceStop: - //break; - /** Automatic DTMF sending aborted */ - case ECCPDtmfSequenceAbort: - //break; - /** There was stop mark in DTMF string */ - case ECCPDtmfStopInDtmfString: - //break; - /** DTMF sending completed succesfully */ - case ECCPDtmfStringSendingCompleted: - //TMS_EVENT_DTMF_TONE_STOPPED - dtmfpckg().iRequest = ECmdDTMFTonePlayFinished; - break; - default: - break; - } - - if (iDTMFNotifier) - { - iDTMFNotifier->SetDtmf(dtmfpckg, TRUE); - } - TRACE_PRN_FN_EXT; - } - -// From TMSCSPDevSoundObserver - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::DownlinkInitCompleted -// -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::DownlinkInitCompleted(TInt status) - { - TRACE_PRN_FN_ENT; - NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status, 0); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::UplinkInitCompleted -// -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::UplinkInitCompleted(TInt status) - { - TRACE_PRN_FN_ENT; - NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status, 0); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::UplinkActivatedSuccessfully -// -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::UplinkActivatedSuccessfully() - { - TRACE_PRN_FN_ENT; - NotifyClient(iUplinkStreamId, ECmdUplinkStarted, KErrNone, 0); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::DownlinkActivatedSuccessfully -// -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::DownlinkActivatedSuccessfully() - { - TRACE_PRN_FN_ENT; - NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, KErrNone, 0); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::UplinkActivationFailed -// -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::UplinkActivationFailed() - { - TRACE_PRN_FN_ENT; - NotifyClient(iUplinkStreamId, ECmdUplinkStarted, TMS_RESULT_FATAL_ERROR, 0); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::DownlinkActivationFailed -// -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::DownlinkActivationFailed() - { - TRACE_PRN_FN_ENT; - NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, - TMS_RESULT_FATAL_ERROR, 0); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::AvailableOutputsChanged -// -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::AvailableOutputsChanged( - CTelephonyAudioRouting& /*aTelephonyAudioRouting*/) - { - TRACE_PRN_FN_ENT; - TRoutingMsgBufPckg pckg; - pckg().iEvent = TMS_EVENT_ROUTING_AVAIL_OUTPUTS_CHANGED; - iTarSettings->SetTar(pckg, ETrue); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::OutputChanged -// -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::OutputChanged( - CTelephonyAudioRouting& aTelephonyAudioRouting) - { - TRACE_PRN_FN_ENT; - TRoutingMsgBufPckg pckg; - pckg().iEvent = TMS_EVENT_ROUTING_OUTPUT_CHANGED; - pckg().iOutput = TOTMSOUTPUT(aTelephonyAudioRouting.Output()); - iTarSettings->SetTar(pckg, ETrue); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::SetOutputComplete -// -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::SetOutputComplete( - CTelephonyAudioRouting& aTelephonyAudioRouting, gint /*aError*/) - { - TRACE_PRN_FN_ENT; - TRoutingMsgBufPckg pckg; - pckg().iEvent = TMS_EVENT_ROUTING_SET_OUTPUT_COMPLETE; - pckg().iOutput = TOTMSOUTPUT(aTelephonyAudioRouting.Output()); - if (iTarSettings) - { - iTarSettings->SetTar(pckg, ETrue); - } - //TRACE_PRN_IF_ERR(aError); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallCSAdpt::NotifyClient -// -// ----------------------------------------------------------------------------- -// -void TMSCallCSAdpt::NotifyClient(const gint strmId, const gint aCommand, - const gint aStatus, const gint64 /*aInt64*/) - { - iMsgBuffer.iRequest = aCommand; - iMsgBuffer.iStatus = aStatus; - - if (strmId == iUplinkStreamId) - { - iMsgQueueUp.Send(iMsgBuffer); - } - else if (strmId == iDnlinkStreamId) - { - iMsgQueueDn.Send(iMsgBuffer); - } - } - -// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/callipadpt.cpp --- a/mmserv/tms/tmscallserver/src/callipadpt.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1536 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include "tmsutility.h" -#include "tmsclientserver.h" -#include "tmsshared.h" -#include "ipcallstream.h" -#include "callipadpt.h" - -using namespace TMS; - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::NewL -// Symbian constructor. -// ----------------------------------------------------------------------------- -// -TMSCallIPAdpt* TMSCallIPAdpt::NewL() - { - TMSCallIPAdpt* self = new (ELeave) TMSCallIPAdpt(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::ConstructL -// 2-nd phase constructor. -// ----------------------------------------------------------------------------- -// -void TMSCallIPAdpt::ConstructL() - { - TRACE_PRN_FN_ENT; - iIPUplink = NULL; - iIPDownlink = NULL; - iDTMFDnlinkPlayer = NULL; - iDTMFUplinkPlayer = NULL; - iDTMFNotifier = NULL; - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::TMSCallIPAdpt -// -// ----------------------------------------------------------------------------- -// -TMSCallIPAdpt::TMSCallIPAdpt() - { - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::~TMSCallIPAdpt -// -// ----------------------------------------------------------------------------- -// -TMSCallIPAdpt::~TMSCallIPAdpt() - { - TRACE_PRN_FN_ENT; - - iCodecs.Reset(); - iCodecs.Close(); - iArrBitrates.Reset(); - delete iDTMFUplinkPlayer; - delete iDTMFDnlinkPlayer; - delete iDTMFNotifier; - delete iIPUplink; - delete iIPDownlink; - - if (iMsgQueueUp.Handle() > 0) - { - iMsgQueueUp.Close(); - } - if (iMsgQueueDn.Handle() > 0) - { - iMsgQueueDn.Close(); - } - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::PostConstruct -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::PostConstruct() - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - iNextStreamId = 1; - iUplinkInitialized = FALSE; - iDnlinkInitialized = FALSE; - - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::CreateStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::CreateStream(TMSCallType /*callType*/, - TMSStreamType strmType, gint& outStrmId) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - switch (strmType) - { - case TMS_STREAM_UPLINK: - { - status = TMS_RESULT_ALREADY_EXIST; - if (!iUplinkInitialized) - { - iUplinkInitialized = TRUE; - iUplinkStreamId = iNextStreamId; - outStrmId = iUplinkStreamId; - iNextStreamId++; - status = TMS_RESULT_SUCCESS; - } - break; - } - case TMS_STREAM_DOWNLINK: - { - status = TMS_RESULT_ALREADY_EXIST; - if (!iDnlinkInitialized) - { - iDnlinkInitialized = TRUE; - iDnlinkStreamId = iNextStreamId; - outStrmId = iDnlinkStreamId; - iNextStreamId++; - status = TMS_RESULT_SUCCESS; - } - break; - } - default: - { - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::InitStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::InitStreamL(TMSCallType /*callType*/, - TMSStreamType strmType, gint strmId, TMSFormatType frmtType, - const RMessage2& aMessage) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - - TUint32 fourCC = TOFOURCC(frmtType); - if (fourCC == NULL) - { - return TMS_RESULT_INVALID_ARGUMENT; - } - - switch (strmType) - { - case TMS_STREAM_UPLINK: - { - status = TMS_RESULT_DOES_NOT_EXIST; - if (strmId == iUplinkStreamId) - { - SetFormat(iUplinkStreamId, fourCC); - status = OpenUplinkL(aMessage); - - iDTMFUplinkPlayer = TMSAudioDtmfTonePlayer::NewL(*this, - KAudioPrefUnknownVoipAudioUplink, - KAudioPriorityUnknownVoipAudioUplink); - - if(!iDTMFNotifier) - { - iDTMFNotifier = TMSDtmfNotifier::NewL(); - } - - NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status); - } - break; - } - case TMS_STREAM_DOWNLINK: - { - status = TMS_RESULT_DOES_NOT_EXIST; - if (strmId == iDnlinkStreamId) - { - SetFormat(iDnlinkStreamId, fourCC); - status = OpenDownlinkL(aMessage); - - iDTMFDnlinkPlayer = TMSAudioDtmfTonePlayer::NewL(*this, - KAudioPrefUnknownVoipAudioDownlink, - KAudioPriorityUnknownVoipAudioDownlink); - - if(!iDTMFNotifier) - { - iDTMFNotifier = TMSDtmfNotifier::NewL(); - } - - NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status); - } - break; - } - default: - { - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - } - - TRACE_PRN_IF_ERR(status); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::StartStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::StartStream(TMSCallType /*callType*/, - TMSStreamType strmType, gint strmId) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - switch (strmType) - { - case TMS_STREAM_UPLINK: - { - if (strmId == iUplinkStreamId && iIPUplink) - { - iIPUplink->Start(); - status = TMS_RESULT_SUCCESS; - NotifyClient(iUplinkStreamId, ECmdUplinkStarted, status); - } - break; - } - case TMS_STREAM_DOWNLINK: - { - if (strmId == iDnlinkStreamId && iIPDownlink) - { - iIPDownlink->Start(); - status = TMS_RESULT_SUCCESS; - NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, status); - } - break; - } - default: - { - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::PauseStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::PauseStream(TMSCallType /*callType*/, - TMSStreamType strmType, gint strmId) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - switch (strmType) - { - case TMS_STREAM_UPLINK: - { - if (strmId == iUplinkStreamId && iIPUplink) - { - iIPUplink->Stop(); - status = TMS_RESULT_SUCCESS; - NotifyClient(iUplinkStreamId, ECmdUplinkPaused, status); - } - break; - } - case TMS_STREAM_DOWNLINK: - { - if (strmId == iDnlinkStreamId && iIPDownlink) - { - iIPDownlink->Stop(); - status = TMS_RESULT_SUCCESS; - NotifyClient(iDnlinkStreamId, ECmdDownlinkPaused, status); - } - break; - } - default: - { - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::StopStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::StopStream(TMSCallType /*callType*/, TMSStreamType strmType, - gint strmId) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - - switch (strmType) - { - case TMS_STREAM_UPLINK: - { - if (strmId == iUplinkStreamId && iIPUplink) - { - iIPUplink->Stop(); - status = TMS_RESULT_SUCCESS; - NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status); - } - break; - } - case TMS_STREAM_DOWNLINK: - { - if (strmId == iDnlinkStreamId && iIPDownlink) - { - iIPDownlink->Stop(); - status = TMS_RESULT_SUCCESS; - NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status); - } - break; - } - default: - { - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::DeinitStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::DeinitStream(TMSCallType /*callType*/, - TMSStreamType strmType, gint strmId) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - - switch (strmType) - { - case TMS_STREAM_UPLINK: - { - if (strmId == iUplinkStreamId && iIPUplink) - { - iIPUplink->Stop(); - //iUplinkStreamId = -1; - iUplinkInitialized = FALSE; - status = TMS_RESULT_SUCCESS; - NotifyClient(iUplinkStreamId, ECmdDownlinkDeInitComplete, - status); - } - break; - } - case TMS_STREAM_DOWNLINK: - { - if (strmId == iDnlinkStreamId && iIPDownlink) - { - iIPDownlink->Stop(); - //iDnlinkStreamId = -1; - iDnlinkInitialized = FALSE; - status = TMS_RESULT_SUCCESS; - NotifyClient(iDnlinkStreamId, ECmdDownlinkDeInitComplete, - status); - } - break; - } - default: - { - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - } - - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::DeleteStream -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::DeleteStream(TMSCallType /*callType*/, - TMSStreamType strmType, gint strmId) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - switch (strmType) - { - case TMS_STREAM_UPLINK: - { - // This is additional error checking - if (strmId == iUplinkStreamId) - { - iUplinkStreamId = -1; - iUplinkInitialized = FALSE; - } - break; - } - case TMS_STREAM_DOWNLINK: - { - // This is additional error checking - if (strmId == iDnlinkStreamId) - { - iDnlinkStreamId = -1; - iDnlinkInitialized = FALSE; - } - break; - } - default: - { - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::DataXferBufferEmptied -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::DataXferBufferEmptied(TMSCallType /*callType*/, - TMSStreamType strmType, gint strmId) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - switch (strmType) - { - case TMS_STREAM_UPLINK: - { - if (strmId == iUplinkStreamId) - { - TRAP(status, BufferEmptiedL()); - } - break; - } - case TMS_STREAM_DOWNLINK: - status = TMS_RESULT_ILLEGAL_OPERATION; - break; - default: - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::DataXferBufferFilled -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::DataXferBufferFilled(TMSCallType /*callType*/, - TMSStreamType strmType, gint strmId, guint datasize) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - switch (strmType) - { - case TMS_STREAM_DOWNLINK: - if (strmId == iDnlinkStreamId) - { - TRAP(status, BufferFilledL(datasize)); - } - break; - case TMS_STREAM_UPLINK: - status = TMS_RESULT_ILLEGAL_OPERATION; - break; - default: - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetDataXferBufferHndl -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetDataXferBufferHndl(const TMSCallType /*callType*/, - const TMSStreamType strmType, const gint strmId, const guint32 key, - RChunk& chunk) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - switch (strmType) - { - case TMS_STREAM_DOWNLINK: - { - if (strmId == iDnlinkStreamId) - { - TRAP(status, GetDataXferChunkHndl(strmType, key, chunk)); - } - break; - } - case TMS_STREAM_UPLINK: - { - if (strmId == iUplinkStreamId) - { - TRAP(status, GetDataXferChunkHndl(strmType, key, chunk)); - } - break; - } - default: - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetMaxVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetMaxVolume(guint& volume) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - - if (iDnlinkInitialized && iIPDownlink) - { - status = iIPDownlink->GetMaxVolume(volume); - iMaxVolume = volume; - TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: GetMaxVolume [%d]"), iMaxVolume); - } - - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::SetVolume(const guint volume) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iDnlinkInitialized && iIPDownlink) - { - status = iIPDownlink->SetVolume(volume); - NotifyClient(iDnlinkStreamId, ECmdSetVolume, status); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetVolume(guint& volume) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iDnlinkInitialized && iIPDownlink) - { - status = iIPDownlink->GetVolume(volume); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetMaxGain -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetMaxGain(guint& gain) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iUplinkInitialized && iIPUplink) - { - status = iIPUplink->GetMaxGain(gain); - iMaxGain = gain; - TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetMaxGain [%d]"), iMaxGain); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetGain -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::SetGain(const guint gain) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iUplinkInitialized && iIPUplink) - { - status = iIPUplink->SetGain(gain); - NotifyClient(iUplinkStreamId, ECmdSetGain, status); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetGain -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetGain(guint& gain) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iUplinkInitialized && iIPUplink) - { - status = iIPUplink->GetGain(gain); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetGlobalMaxVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetGlobalMaxVolume(guint& volume) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iDnlinkInitialized && iIPDownlink) - { - status = iIPDownlink->GetMaxVolume(volume); - iMaxVolume = volume; - TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: GetMaxVolume [%d]"), iMaxVolume); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetGlobalVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::SetGlobalVolume(const guint volume) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iDnlinkInitialized && iIPDownlink) - { - status = iIPDownlink->SetVolume(volume); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetGlobalVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetGlobalVolume(guint& volume) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iDnlinkInitialized && iIPDownlink) - { - status = iIPDownlink->GetVolume(volume); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetGlobalMaxGain -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetGlobalMaxGain(guint& gain) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iUplinkInitialized && iIPUplink) - { - status = iIPUplink->GetMaxGain(gain); - iMaxGain = gain; - TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetMaxGain [%d]"), iMaxGain); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetGlobalGain -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::SetGlobalGain(const guint gain) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iUplinkInitialized && iIPUplink) - { - status = iIPUplink->SetGain(gain); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetGlobalGain -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetGlobalGain(guint& gain) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iUplinkInitialized && iIPUplink) - { - status = iIPUplink->GetGain(gain); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetCodecMode(const TMSFormatType fmttype, - const TMSStreamType strmtype, gint& mode) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - switch (fmttype) - { - case TMS_FORMAT_ILBC: - status = GetIlbcCodecMode(mode, strmtype); - break; - case TMS_FORMAT_G711: - status = GetG711CodecMode(mode, strmtype); - break; - default: - status = TMS_RESULT_FORMAT_TYPE_NOT_SUPPORTED; - break; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::SetCodecMode(const TMSFormatType fmttype, - const TMSStreamType strmtype, const gint mode) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - switch (fmttype) - { - case TMS_FORMAT_ILBC: - status = SetIlbcCodecMode(mode, strmtype); - break; - case TMS_FORMAT_G711: - status = SetG711CodecMode(mode, strmtype); - break; - default: - status = TMS_RESULT_FORMAT_TYPE_NOT_SUPPORTED; - break; - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetSupportedBitRatesCount -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetSupportedBitRatesCount(guint& count) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iIPUplink) - { - status = iIPUplink->GetSupportedBitrates(iArrBitrates); - count = iArrBitrates.Count(); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetSupportedBitRates -// -// Bitrates are already returned from the codec as a result of call to -// GetSupportedBitratesCount(). Just pack them into a descriptor and return -// back to the client. -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetSupportedBitRates(CBufFlat*& brbuffer) - { - TRAPD(status, GetSupportedBitRatesL(brbuffer)); - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetSupportedBitRatesL -// -// GetSupportedBitRates implementation which can leave. -// ----------------------------------------------------------------------------- -// -void TMSCallIPAdpt::GetSupportedBitRatesL(CBufFlat*& brbuffer) - { - TRACE_PRN_FN_ENT; - RBufWriteStream stream; - stream.Open(*brbuffer); - CleanupClosePushL(stream); - guint numOfItems = iArrBitrates.Count(); - - for (guint i = 0; i < numOfItems; i++) - { - stream.WriteUint32L(iArrBitrates[i]); - //TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: BR: [%d]"), iArrBitrates[i]); - } - - CleanupStack::PopAndDestroy(&stream); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetBitRate -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetBitRate(guint& bitrate) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iIPUplink) - { - status = iIPUplink->GetBitrate(bitrate); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetBitRate -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::SetBitRate(const guint bitrate) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iIPUplink) - { - status = iIPUplink->SetBitrate(bitrate); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetVAD -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetVAD(const TMSFormatType fmttype, gboolean& vad) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iIPUplink) - { - status = iIPUplink->GetVad(fmttype, vad); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetVAD -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::SetVAD(const TMSFormatType fmttype, const gboolean vad) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iIPUplink) - { - status = iIPUplink->SetVad(fmttype, vad); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetCNG -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetCNG(const TMSFormatType fmttype, gboolean& cng) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iIPDownlink) - { - status = iIPDownlink->GetCng(fmttype, cng); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetCNG -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::SetCNG(const TMSFormatType fmttype, const gboolean cng) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iIPDownlink) - { - status = iIPDownlink->SetCng(fmttype, cng); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetPlc -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetPlc(const TMSFormatType fmttype, gboolean& plc) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iIPDownlink) - { - status = iIPDownlink->GetPlc(fmttype, plc); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetPlc -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::SetPlc(const TMSFormatType fmttype, const gboolean plc) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_INVALID_STATE); - if (iIPDownlink) - { - status = iIPDownlink->SetPlc(fmttype, plc); - } - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::OpenDownlinkL -// Method for player initialization. -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::OpenDownlinkL(const RMessage2& aMessage) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - - // Clients must have MultimediaDD capability to use this priority/pref. - // TODO: Also, TMS will monitor for emergency call and if detected it - // will deny access to audio resources. - iPriority.iPref = KAudioPrefVoipAudioDownlink; - iPriority.iPriority = KAudioPriorityVoipAudioDownlink; - - if (!iIPDownlink) - { - iIPDownlink = TMSIPDownlink::NewL(iDnFourCC, iPriority); - } - - if (iIPDownlink) - { - // Open message queue for handling server notifications to the client - if (iMsgQueueDn.Handle() <= 0) - { - // Second argument in TMSCallProxy::InitStream - status = iMsgQueueDn.Open(aMessage, 1); - } - - if (status == TMS_RESULT_SUCCESS) - { - // For transfer data buffer processing - iIPDownlink->SetMsgQueue(iMsgQueueDn); - } - } - - TRACE_PRN_IF_ERR(status); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::OpenUplinkL -// Method for recorder initialization. -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::OpenUplinkL(const RMessage2& aMessage) - { - TRACE_PRN_FN_ENT; - gint status(TMS_RESULT_SUCCESS); - - // Ensure clients have MultimediaDD capability to use this priority/pref - iPriority.iPref = KAudioPrefVoipAudioUplink; - iPriority.iPriority = KAudioPriorityVoipAudioUplink; - - if (!iIPUplink) - { - iIPUplink = TMSIPUplink::NewL(iUpFourCC, iPriority); - } - - if (iIPUplink) - { - // Open message queue for handling server notifications to the client - if (iMsgQueueUp.Handle() <= 0) - { - // Second argument in TMSCallProxy::InitStream - status = iMsgQueueUp.Open(aMessage, 1); - } - - if (status == TMS_RESULT_SUCCESS) - { - // For transfer data buffer processing - iIPUplink->SetMsgQueue(iMsgQueueUp); - } - } - - TRACE_PRN_IF_ERR(status); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetFormat -// -// ----------------------------------------------------------------------------- -// -void TMSCallIPAdpt::SetFormat(const gint strmId, const TUint32 aFormat) - { - if (strmId == iUplinkStreamId) - { - iUpFourCC = aFormat; - } - else if (strmId == iDnlinkStreamId) - { - iDnFourCC = aFormat; - } - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::BufferFilled -// -// ----------------------------------------------------------------------------- -// -void TMSCallIPAdpt::BufferFilledL(TUint dataSize) - { - if (iIPDownlink) - { - iIPDownlink->BufferFilled(dataSize); - } - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::BufferEmptied -// -// ----------------------------------------------------------------------------- -// -void TMSCallIPAdpt::BufferEmptiedL() - { - if (iIPUplink) - { - iIPUplink->BufferEmptied(); - } - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetDataXferChunkHndl -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetDataXferChunkHndl(const TMSStreamType strmType, - const TUint32 key, RChunk& chunk) - { - TRACE_PRN_FN_ENT; - - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - switch (strmType) - { - case TMS_STREAM_DOWNLINK: - { - if (iIPDownlink) - { - status = iIPDownlink->GetDataXferChunkHndl(key, chunk); - } - break; - } - case TMS_STREAM_UPLINK: - { - if (iIPUplink) - { - status = iIPUplink->GetDataXferChunkHndl(key, chunk); - } - break; - } - default: - status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; - break; - } - - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetIlbcCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::SetIlbcCodecMode(const gint mode, - const TMSStreamType strmtype) - { - gint status(TMS_RESULT_INVALID_ARGUMENT); - - if (strmtype == TMS_STREAM_DOWNLINK) - { - if (iDnlinkInitialized && iIPDownlink) - { - status = iIPDownlink->SetIlbcCodecMode(mode); - } - } - else if (strmtype == TMS_STREAM_UPLINK) - { - if (iUplinkInitialized && iIPUplink) - { - status = iIPUplink->SetIlbcCodecMode(mode); - } - } - - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetIlbcCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetIlbcCodecMode(gint& mode, const TMSStreamType strmtype) - { - gint status(TMS_RESULT_INVALID_ARGUMENT); - - if (strmtype == TMS_STREAM_DOWNLINK) - { - if (iDnlinkInitialized && iIPDownlink) - { - status = iIPDownlink->GetIlbcCodecMode(mode); - } - } - else if (strmtype == TMS_STREAM_UPLINK) - { - if (iUplinkInitialized && iIPUplink) - { - status = iIPUplink->GetIlbcCodecMode(mode); - } - } - - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetG711CodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::SetG711CodecMode(const gint mode, - const TMSStreamType strmtype) - { - gint status(TMS_RESULT_INVALID_ARGUMENT); - - if (strmtype == TMS_STREAM_DOWNLINK) - { - if (iDnlinkInitialized && iIPDownlink) - { - status = iIPDownlink->SetG711CodecMode(mode); - } - } - else if (strmtype == TMS_STREAM_UPLINK) - { - if (iUplinkInitialized && iIPUplink) - { - status = iIPUplink->SetG711CodecMode(mode); - } - } - - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetG711CodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetG711CodecMode(gint& mode, const TMSStreamType strmtype) - { - gint status(TMS_RESULT_INVALID_ARGUMENT); - - if (strmtype == TMS_STREAM_DOWNLINK) - { - if (iDnlinkInitialized && iIPDownlink) - { - status = iIPDownlink->GetG711CodecMode(mode); - } - } - else if (strmtype == TMS_STREAM_UPLINK) - { - if (iUplinkInitialized && iIPUplink) - { - status = iIPUplink->GetG711CodecMode(mode); - } - } - - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::FrameModeRequiredForEC -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::FrameModeRqrdForEC(gboolean& frmodereq) - { - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - if (iIPDownlink) - { - status = iIPDownlink->FrameModeRqrdForEC(frmodereq); - } - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetFrameMode -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::SetFrameMode(const gboolean frmode) - { - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - if (iIPDownlink) - { - status = iIPDownlink->SetFrameMode(frmode); - } - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetFrameMode -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetFrameMode(gboolean& frmode) - { - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - if (iIPDownlink) - { - status = iIPDownlink->GetFrameMode(frmode); - } - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::ConcealErrorForNextBuffer -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::ConcealErrorForNextBuffer() - { - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - if (iIPDownlink) - { - status = iIPDownlink->ConcealErrorForNextBuffer(); - } - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::BadLsfNextBuffer -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::BadLsfNextBuffer() - { - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - if (iIPDownlink) - { - status = iIPDownlink->BadLsfNextBuffer(); - } - return status; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::SetOutput -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::SetOutput(TMSAudioOutput output) - { - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - if (iDnlinkInitialized && iIPDownlink) - { - TRAP(status, iIPDownlink->SetAudioDeviceL(output)); - } - return status; - } -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetOutput -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetOutput(TMSAudioOutput& output) - { - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - if (iDnlinkInitialized && iIPDownlink) - { - TRAP(status, iIPDownlink->GetAudioDeviceL(output)); - } - return status; - } -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetPreviousOutput -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetPreviousOutput(TMSAudioOutput& /*output*/) - { - return TMS_RESULT_FEATURE_NOT_SUPPORTED; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::GetAvailableOutputsL -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::GetAvailableOutputsL(gint& /*count*/, - CBufFlat*& /*outputsbuffer*/) - { - return TMS_RESULT_FEATURE_NOT_SUPPORTED; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::StartDTMF -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::StartDTMF(TMSStreamType strmtype, TDes& dtmfstring) - { - TRACE_PRN_FN_ENT; - TmsMsgBufPckg dtmfpckg; - if (strmtype == TMS_STREAM_DOWNLINK) - { - if (iDTMFDnlinkPlayer /*&& iDTMFDnlinkStatus*/) - { - iDTMFDnlinkPlayer->PlayDtmfTone(dtmfstring); - dtmfpckg().iStatus = TMS_RESULT_SUCCESS; - //TMS_EVENT_DTMF_TONE_STARTED - dtmfpckg().iRequest = ECmdDTMFOpenDnlinkComplete; - } - } - else if (strmtype == TMS_STREAM_UPLINK) - { - if (iDTMFUplinkPlayer /*&& iDTMFUplinkStatus*/) - { - iDTMFUplinkPlayer->PlayDtmfTone(dtmfstring); - dtmfpckg().iStatus = TMS_RESULT_SUCCESS; - //TMS_EVENT_DTMF_TONE_STARTED - dtmfpckg().iRequest = ECmdDTMFOpenUplinkComplete; - } - } - - if (iDTMFNotifier) - { - iDTMFNotifier->SetDtmf(dtmfpckg, TRUE); - } - TRACE_PRN_FN_EXT; - return TMS_RESULT_SUCCESS; - } -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::StopDTMF -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::StopDTMF(TMSStreamType streamtype) - { - TRACE_PRN_FN_ENT; - - if (streamtype == TMS_STREAM_DOWNLINK) - { - iDTMFDnlinkPlayer->Cancel(); - } - else - { - iDTMFUplinkPlayer->Cancel(); - } - - TRACE_PRN_FN_EXT; - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::ContinueDTMF -// -// ----------------------------------------------------------------------------- -// -gint TMSCallIPAdpt::ContinueDTMF(TBool /*continuesending*/) - { - TRACE_PRN_FN_ENT; - TRACE_PRN_FN_EXT; - return TMS_RESULT_FEATURE_NOT_SUPPORTED; - } - -//From DTMFTonePlayerObserver -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::DTMFInitCompleted -// -// ----------------------------------------------------------------------------- -// -void TMSCallIPAdpt::DTMFInitCompleted(TInt /*error*/) - { - //DTMF init status - TRACE_PRN_FN_ENT; - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::DTMFToneFinished -// -// ----------------------------------------------------------------------------- -// -void TMSCallIPAdpt::DTMFToneFinished(TInt error) - { - TRACE_PRN_FN_ENT; - TmsMsgBufPckg dtmfpckg; - - if(error == KErrUnderflow || error == KErrInUse) - { - error = TMS_RESULT_SUCCESS; - } - - dtmfpckg().iStatus = error; - //TMS_EVENT_DTMF_TONE_STOPPED - dtmfpckg().iRequest = ECmdDTMFTonePlayFinished; - if (iDTMFNotifier) - { - iDTMFNotifier->SetDtmf(dtmfpckg, TRUE); - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallIPAdpt::NotifyClient -// ----------------------------------------------------------------------------- -// -void TMSCallIPAdpt::NotifyClient(const gint strmId, const TInt aCommand, - const TInt aStatus, const TInt64 /*aInt64*/) - { - iMsgBuffer.iRequest = aCommand; - iMsgBuffer.iStatus = aStatus; - - if (strmId == iUplinkStreamId) - { - iMsgQueueUp.Send(iMsgBuffer); - } - else if (strmId == iDnlinkStreamId) - { - iMsgQueueDn.Send(iMsgBuffer); - } - } - -// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/cpeaudiodtmftoneplayer.cpp --- a/mmserv/tms/tmscallserver/src/cpeaudiodtmftoneplayer.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -// INCLUDE FILES -#include -#include -#include "tmsutility.h" -#include "cpeaudiodtmftoneplayer.h" - -// CONSTANTS -const gint KBufSize = 10; -const gint KMaxVolumeLevel = 10; - -_LIT(KPhoneTone_Asterisk, "*+w"); - -//from voip -const guint KDTMFToneLengthOn = 250000; -const guint KDTMFToneLengthOff = 50000; -const guint KDTMFToneLengthPause = 2500000; - -using namespace TMS; - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -TMSAudioDtmfTonePlayer* TMSAudioDtmfTonePlayer::NewL( - TMSDTMFTonePlayerObserver& obsrvr, guint aAudioPreference, - guint aAudioPriority) - { - //iObserver = obsrvr; - TMSAudioDtmfTonePlayer* self = new (ELeave) TMSAudioDtmfTonePlayer( - obsrvr, aAudioPreference, aAudioPriority); - - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -//Destructor -TMSAudioDtmfTonePlayer::~TMSAudioDtmfTonePlayer() - { - TRACE_PRN_FN_ENT; - Cancel(); - delete iDTMFPlayer; - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::TMSAudioDtmfTonePlayer -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -TMSAudioDtmfTonePlayer::TMSAudioDtmfTonePlayer( - TMSDTMFTonePlayerObserver& obsrvr, guint aAudioPreference, - guint aAudioPriority) : - iObserver(obsrvr), - iPref(aAudioPreference), - iPrior(aAudioPriority) - { - TRACE_PRN_FN_ENT; - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void TMSAudioDtmfTonePlayer::ConstructL() - { - TRACE_PRN_FN_ENT; - - TMMFPrioritySettings dtmfClickPlayerPrioritySettings; - iDTMFPlayer = CMMFDevSound::NewL(); - iDTMFPlayer->InitializeL(*this, EMMFStateTonePlaying); - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::SetVolume -// Sets the volume level that is used when the dtmf tone is played. -// ----------------------------------------------------------------------------- -// -void TMSAudioDtmfTonePlayer::SetVolume(gint aVolume) - { - TRACE_PRN_FN_ENT; - gint vol = ConvertVolume(aVolume); - - if (vol != iVolume) - { - iVolume = vol; - iDTMFPlayer->SetVolume(iVolume); - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::PlayDtmfTone -// Searches the given DTMF tone from iToneArray and calls PlayCurrentTone -// member function. -// ----------------------------------------------------------------------------- -// -void TMSAudioDtmfTonePlayer::PlayDtmfTone(TDes& aTone) - { - TRACE_PRN_FN_ENT; - Cancel(); - - // DTMF signalling. - if (iDTMFPlayer) - { - TBuf key; - key.Append(aTone); - TRAP_IGNORE(iDTMFPlayer->PlayDTMFStringL(aTone)); - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::Cancel -// Cancels the currently playing tone. -// ----------------------------------------------------------------------------- -// -void TMSAudioDtmfTonePlayer::Cancel() - { - TRACE_PRN_FN_ENT; - iDTMFPlayer->Stop(); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::Normalize -// Lowers case for chars and if its '*','+', or 'w' sets it to asterisk -// char ('*'). -// ----------------------------------------------------------------------------- -// -void TMSAudioDtmfTonePlayer::Normalize(TChar& aTone) - { - TRACE_PRN_FN_ENT; - aTone.LowerCase(); - - TPtrC ast(KPhoneTone_Asterisk); - - if (ast.Locate(aTone) != KErrNotFound) - { - aTone = ast[0]; - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::InitializeComplete -// ----------------------------------------------------------------------------- -// -void TMSAudioDtmfTonePlayer::InitializeComplete(TInt aError) - { - TRACE_PRN_FN_ENT; - - if (aError == KErrNone) - { - TMMFPrioritySettings dtmfPlayerSettings; - dtmfPlayerSettings.iPref = (TMdaPriorityPreference) iPref; - dtmfPlayerSettings.iPriority = iPrior; - dtmfPlayerSettings.iState = EMMFStateTonePlaying; - iDTMFPlayer->SetPrioritySettings(dtmfPlayerSettings); - - TTimeIntervalMicroSeconds32 length(KDTMFToneLengthOn); - TTimeIntervalMicroSeconds32 pause(KDTMFToneLengthOff); - TTimeIntervalMicroSeconds32 zero(KDTMFToneLengthPause); - iDTMFPlayer->SetDTMFLengths(length, pause, zero); - iDTMFPlayer->SetVolume(iDTMFPlayer->MaxVolume()); - } - - iObserver.DTMFInitCompleted(aError); - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::ToneFinished -// ----------------------------------------------------------------------------- -// -void TMSAudioDtmfTonePlayer::ToneFinished(TInt aError) - { - TRACE_PRN_FN_ENT; - iObserver.DTMFToneFinished(aError); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::BufferToBeFilled -// ----------------------------------------------------------------------------- -// -void TMSAudioDtmfTonePlayer::BufferToBeFilled(CMMFBuffer* /*aBuffer*/) - { - TRACE_PRN_FN_ENT; - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::PlayError -// ----------------------------------------------------------------------------- -// -void TMSAudioDtmfTonePlayer::PlayError(TInt /*aError*/) - { - TRACE_PRN_FN_ENT; - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::BufferToBeEmptied -// ----------------------------------------------------------------------------- -// -void TMSAudioDtmfTonePlayer::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) - { - TRACE_PRN_FN_ENT; - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::RecordError -// ----------------------------------------------------------------------------- -// -void TMSAudioDtmfTonePlayer::RecordError(TInt /*aError*/) - { - TRACE_PRN_FN_ENT; - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::ConvertError -// ----------------------------------------------------------------------------- -// -void TMSAudioDtmfTonePlayer::ConvertError(TInt /*aError*/) - { - TRACE_PRN_FN_ENT; - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::DeviceMessage -// ----------------------------------------------------------------------------- -// -void TMSAudioDtmfTonePlayer::DeviceMessage(TUid /*aMessageType*/, - const TDesC8& /*aMsg*/) - { - TRACE_PRN_FN_ENT; - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSAudioDtmfTonePlayer::ConvertVolume -// ----------------------------------------------------------------------------- -// -gint TMSAudioDtmfTonePlayer::ConvertVolume(gint aVolume) - { - TRACE_PRN_FN_ENT; - gint result = iDTMFPlayer->MaxVolume() * aVolume / KMaxVolumeLevel; - TRACE_PRN_FN_EXT; - return result; - } - -// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/csdownlink.cpp --- a/mmserv/tms/tmscallserver/src/csdownlink.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include "csdownlink.h" -#include "mcspdevsoundobserver.h" - -using namespace TMS; - -const gint KDefaultVolume = 4; -const gint KDefaultMaxVolume = 10; - -// ----------------------------------------------------------------------------- -// Static constructor -// ----------------------------------------------------------------------------- -// -TMSCSDownlink* TMSCSDownlink::NewL(TMSCSPDevSoundObserver& aObserver) - { - TMSCSDownlink* self = new (ELeave) TMSCSDownlink(aObserver); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// Destructor. -// ----------------------------------------------------------------------------- -// -TMSCSDownlink::~TMSCSDownlink() - { - } - -// ----------------------------------------------------------------------------- -// Sets volume -// ----------------------------------------------------------------------------- -// -void TMSCSDownlink::SetVolume(gint aVolume) - { - if (iDevSound) - { - gint maxVolume(iDevSound->MaxVolume()); - maxVolume = (maxVolume > 0) ? maxVolume : KDefaultMaxVolume; - gint scaledVolume = (aVolume * maxVolume) / KDefaultMaxVolume; - iDevSound->SetVolume(scaledVolume); - } - } - -// ----------------------------------------------------------------------------- -// Gives volume -// ----------------------------------------------------------------------------- -// -gint TMSCSDownlink::Volume() - { - gint vol = 0; - if (iDevSound) - { - vol = iDevSound->Volume(); - } - return vol; - } - -// ----------------------------------------------------------------------------- -// Gives max volume -// ----------------------------------------------------------------------------- -// -gint TMSCSDownlink::MaxVolume() - { - gint vol = 0; - if (iDevSound) - { - vol = iDevSound->MaxVolume(); - } - return vol; - } - -// ----------------------------------------------------------------------------- -// From class MDevSoundObserver -// Downlink stream has been activated successfully. -// ----------------------------------------------------------------------------- -// -void TMSCSDownlink::BufferToBeFilled(CMMFBuffer* /*aBuffer*/) - { - //CSPLOGSTRING( CSPINT, "TMSCSDownlink:: activated" ); - // We dont react to devsound messages unless we are activating. - if (IsActivationOngoing()) - { - iActive = ETrue; - iActivationOngoing = EFalse; - iObserver.DownlinkActivatedSuccessfully(); - } - } - -// ----------------------------------------------------------------------------- -// From class MDevSoundObserver -// Downlink stream activation failed -// ----------------------------------------------------------------------------- -// -void TMSCSDownlink::PlayError(TInt aError) - { - //CSPLOGSTRING( CSPINT, "TMSCSDownlink::PlayError" ); - - // We dont react to devsound messages unless we are activating. - if (IsActivationOngoing()) - { - //CSPLOGSTRING( CSPINT, "TMSCSDownlink::PlayError activation failed" ); - if (aError == KErrAccessDenied) - { - iActivationOngoing = EFalse; - iObserver.DownlinkActivationFailed(); - } - } - } - -// ----------------------------------------------------------------------------- -// From class CSPDevsound -// Tries to activate Downlink stream. -// ----------------------------------------------------------------------------- -// -void TMSCSDownlink::DoActivateL() - { - if (iDevSound) - { - iDevSound->PlayInitL(); - } - } - -// ----------------------------------------------------------------------------- -// Constructor -// ----------------------------------------------------------------------------- -// -TMSCSDownlink::TMSCSDownlink(TMSCSPDevSoundObserver& aObserver) : - TMSCSPDevSound(aObserver) - { - } - -// ----------------------------------------------------------------------------- -// Second phase constructor -// ----------------------------------------------------------------------------- -// -void TMSCSDownlink::ConstructL() - { - TMSCSPDevSound::ConstructL(EMMFStatePlaying, KAudioPrefCSCallDownlink, - KAudioPriorityCSCallDownlink); - - if (iDevSound) - { - iDevSound->SetVolume(KDefaultVolume); - } - } - -// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/cspdevsound.cpp --- a/mmserv/tms/tmscallserver/src/cspdevsound.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include -#include -#include "cspdevsound.h" -#include "mcspdevsoundobserver.h" - -using namespace TMS; - -// ----------------------------------------------------------------------------- -// TMSCSPDevSound -// ----------------------------------------------------------------------------- -// -TMSCSPDevSound::TMSCSPDevSound(TMSCSPDevSoundObserver& aObserver) : - iObserver(aObserver) - { - } - -// ----------------------------------------------------------------------------- -// ConstructL -// ----------------------------------------------------------------------------- -// -void TMSCSPDevSound::ConstructL(TMMFState aMode, gint aAudioPreference, - gint aAudioPriority) - { - TMMFPrioritySettings audioPriority; - TFourCC modemFourCC; - modemFourCC.Set(KS60FourCCCodeModem); - iDevSound = CMMFDevSound::NewL(); - if (iDevSound) - { -#ifndef __WINSCW__ - iDevSound->InitializeL(*this, modemFourCC, aMode); -#else //For testing TMS in WINSCW - iDevSound->InitializeL(*this, KMMFFourCCCodePCM16, aMode); -#endif - iStreamType = aAudioPreference; - audioPriority.iPriority = aAudioPriority; - audioPriority.iPref = aAudioPreference; - audioPriority.iState = aMode; - iDevSound->SetPrioritySettings(audioPriority); - } - } - -// ----------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// ----------------------------------------------------------------------------- -// -TMSCSPDevSound::~TMSCSPDevSound() - { - delete iDevSound; - } - -// ----------------------------------------------------------------------------- -// Tries to activate the audio stream if not active or activating -// ----------------------------------------------------------------------------- -// -void TMSCSPDevSound::Activate() - { - if (!IsActive() && !IsActivationOngoing()) - { - iActivationOngoing = ETrue; - gint err = KErrNone; - TRAP(err, DoActivateL()); - } - } - -// ----------------------------------------------------------------------------- -// Deactivates the audio device. -// ----------------------------------------------------------------------------- -// -void TMSCSPDevSound::Deactivate() - { - if (iDevSound && (IsActive() || IsActivationOngoing())) - { - iDevSound->Stop(); - iActive = EFalse; - iActivationOngoing = EFalse; - } - } - -// ----------------------------------------------------------------------------- -// ActivationOngoing -// ----------------------------------------------------------------------------- -// -TBool TMSCSPDevSound::IsActivationOngoing() const - { - return iActivationOngoing; - } - -// ----------------------------------------------------------------------------- -// IsActive -// ----------------------------------------------------------------------------- -// -TBool TMSCSPDevSound::IsActive() const - { - return iActive; - } - -// ----------------------------------------------------------------------------- -// DevSound -// ----------------------------------------------------------------------------- -// -CMMFDevSound& TMSCSPDevSound::DevSound() - { - return *iDevSound; - } - -// ----------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// ----------------------------------------------------------------------------- -// -void TMSCSPDevSound::InitializeComplete(TInt aError) - { - if (iStreamType == KAudioPrefCSCallDownlink) - { - iObserver.DownlinkInitCompleted(aError); - } - else - { - iObserver.UplinkInitCompleted(aError); - } - } - -// ----------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// ----------------------------------------------------------------------------- -// -void TMSCSPDevSound::BufferToBeFilled(CMMFBuffer* /*aBuffer*/) - { - } - -// ----------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// ----------------------------------------------------------------------------- -// -void TMSCSPDevSound::PlayError(TInt /*aError*/) - { - } - -// ----------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// ----------------------------------------------------------------------------- -// -void TMSCSPDevSound::ToneFinished(TInt /*aError*/) - { - } - -// ----------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// ----------------------------------------------------------------------------- -// -void TMSCSPDevSound::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) - { - } - -// ----------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// ----------------------------------------------------------------------------- -// -void TMSCSPDevSound::RecordError(TInt /*aError*/) - { - } - -// ----------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// ----------------------------------------------------------------------------- -// -void TMSCSPDevSound::ConvertError(TInt /*aError*/) - { - } - -// ----------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// ----------------------------------------------------------------------------- -// -void TMSCSPDevSound::DeviceMessage(TUid /*aMessageType*/, - const TDesC8& /*aMsg*/) - { - } - -// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/cspdtmfprovider.cpp --- a/mmserv/tms/tmscallserver/src/cspdtmfprovider.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,312 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include -#include -#include -#include "cspdtmfprovider.h" -#include "tmsutility.h" -#include "cspeteldtmfmonitor.h" -#include "cspeteldtmfstopmonitor.h" - -using namespace TMS; - -TMSDTMFProvider* TMSDTMFProvider::NewL() - { - TRACE_PRN_FN_ENT; - TMSDTMFProvider* self = new (ELeave) TMSDTMFProvider(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - TRACE_PRN_FN_EXT; - return self; - } - -// ----------------------------------------------------------------------------- -// Destructor of the object. -// ----------------------------------------------------------------------------- -// -TMSDTMFProvider::~TMSDTMFProvider() - { - TRACE_PRN_FN_ENT; - Cancel(); - iObservers.Close(); - delete iMonitor; - delete iStopMonitor; - - iMmCustom.Close(); - iPhone.Close(); - iServer.UnloadPhoneModule(iTsyname); - iServer.Close(); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// Notifies observers about a DTMF event -// ----------------------------------------------------------------------------- -// -void TMSDTMFProvider::NotifyDTMFEvent( - const TMSCCPDTMFObserver::TCCPDtmfEvent aEvent, const gint aError, - const TChar aTone) - { - TRACE_PRN_FN_ENT; - for (gint i = 0; i < iObservers.Count(); i++) - { - TMSCCPDTMFObserver *obs = iObservers[i]; - if (obs) - { - iObservers[i]->HandleDTMFEvent(aEvent, aError, aTone); - } - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// Cancel DTMF string sending -// ----------------------------------------------------------------------------- -// -TInt TMSDTMFProvider::CancelDtmfStringSending() - { - TRACE_PRN_FN_ENT; - gint ret(KErrAlreadyExists); - if (IsActive()) - { - Cancel(); - ret = KErrNone; - } - TRACE_PRN_FN_EXT; - return ret; - } - -// ----------------------------------------------------------------------------- -// Starts DTMF string sending -// ----------------------------------------------------------------------------- -// -TInt TMSDTMFProvider::StartDtmfTone(const TChar aTone) - { - TRACE_PRN_FN_ENT; - gint ret(KErrAlreadyExists); - if (!IsActive()) - { - ret = iPhone.StartDTMFTone(aTone); - } - TRACE_PRN_FN_EXT; - return ret; - } - -// ----------------------------------------------------------------------------- -// Stop DTMF tone -// ----------------------------------------------------------------------------- -// -TInt TMSDTMFProvider::StopDtmfTone() - { - TRACE_PRN_FN_ENT; - gint ret(KErrAlreadyExists); - if (!IsActive()) - { - ret = iPhone.StopDTMFTone(); - } - TRACE_PRN_FN_EXT; - return ret; - } - -// ----------------------------------------------------------------------------- -// Send DTMF string -// ----------------------------------------------------------------------------- -// -TInt TMSDTMFProvider::SendDtmfToneString(const TDesC& aString) - { - TRACE_PRN_FN_ENT; - gint ret = KErrInUse; - if (!IsActive()) - { - iStatus = KRequestPending; - iPhone.SendDTMFTones(iStatus, aString); - SetActive(); - ret = KErrNone; - } - TRACE_PRN_FN_EXT; - return ret; - } - -// ----------------------------------------------------------------------------- -// Continue DTMF string sending -// ----------------------------------------------------------------------------- -// -TInt TMSDTMFProvider::ContinueDtmfStringSending(const TBool aContinue) - { - TRACE_PRN_FN_ENT; - gint status = iPhone.ContinueDTMFStringSending(aContinue); - TRACE_PRN_FN_EXT; - return status; - } - -// ----------------------------------------------------------------------------- -// Adds observer. -// ----------------------------------------------------------------------------- -// -void TMSDTMFProvider::AddObserverL(const TMSCCPDTMFObserver& aObserver) - { - TRACE_PRN_FN_ENT; - if (iObservers.Find(&aObserver) == KErrNotFound) - { - iObservers.Append(&aObserver); - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// Removes given observer. -// ----------------------------------------------------------------------------- -// -TInt TMSDTMFProvider::RemoveObserver(const TMSCCPDTMFObserver& aObserver) - { - TRACE_PRN_FN_ENT; - gint ret = KErrNotFound; - gint found = iObservers.Find(&aObserver); - if (found != KErrNotFound) - { - iObservers.Remove(found); - ret = KErrNone; - } - TRACE_PRN_FN_EXT; - return ret; - } - -// ----------------------------------------------------------------------------- -// From CActive. -// Handles request completion. -// ----------------------------------------------------------------------------- -// -void TMSDTMFProvider::RunL() - { - TRACE_PRN_FN_ENT; - if (iStatus == KErrNone) - { - TMSCCPDTMFObserver::TCCPDtmfEvent event = - TMSCCPDTMFObserver::ECCPDtmfStringSendingCompleted; - NotifyDTMFEvent(event, KErrNone, NULL); - } - else - { - gint error = iStatus.Int(); - if (error != KErrCancel) - { - TMSCCPDTMFObserver::TCCPDtmfEvent event = - TMSCCPDTMFObserver::ECCPDtmfStringSendingCompleted; - NotifyDTMFEvent(event, error, NULL); - } - else - { - // Cancel is not notified - } - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// From CActive -// Canceling functionality. -// ----------------------------------------------------------------------------- -// -void TMSDTMFProvider::DoCancel() - { - TRACE_PRN_FN_ENT; - if (iStatus == KRequestPending) - { - iPhone.CancelAsyncRequest(EMobilePhoneSendDTMFTones); - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// Constructs the requester. -// ----------------------------------------------------------------------------- -// -TMSDTMFProvider::TMSDTMFProvider() : - CActive(EPriorityStandard) - { - TRACE_PRN_FN_ENT; - CActiveScheduler::Add(this); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// Constructs the requester in the second phase. -// ----------------------------------------------------------------------------- -// -void TMSDTMFProvider::ConstructL() - { - TRACE_PRN_FN_ENT; - - CleanupClosePushL(iServer); - User::LeaveIfError(iServer.Connect()); - - TRACE_PRN_N(_L("**TMS ETel iServer.Connect")); - - iServer.GetTsyName(0, iTsyname); - - //Load in the phone device driver - User::LeaveIfError(iServer.LoadPhoneModule(iTsyname)); - - TRACE_PRN_N(_L("**TMS ETel iServer.LoadPhoneModule")); - - //Find the number of phones available from the tel server - gint numberPhones; - User::LeaveIfError(iServer.EnumeratePhones(numberPhones)); - - TRACE_PRN_N(_L("**TMS ETel iServer.EnumeratePhones")); - - //Check there are available phones - if (numberPhones < 1) - { - User::Leave(KErrNotFound); - } - - //Get info about the first available phone - RTelServer::TPhoneInfo info; - User::LeaveIfError(iServer.GetPhoneInfo(0, info)); - - TRACE_PRN_N(_L("**TMS ETel iServer.GetPhoneInfo")); - - CleanupClosePushL(iPhone); - User::LeaveIfError(iPhone.Open(iServer, info.iName)); - - TRACE_PRN_N(_L("**TMS ETel iPhone.Open")); - - RMobilePhone::TLineInfo lineInfo; - User::LeaveIfError(iPhone.GetLineInfo(0, lineInfo)); - - TRACE_PRN_N(_L("**TMS ETel iPhone.GetLineInfo")); - - gint errorCode = iMmCustom.Open(iPhone); - - if (!iPhone.SubSessionHandle() || !iMmCustom.SubSessionHandle()) - { - User::Leave(KErrArgument); - } - iMonitor = TMSEtelDtmfMonitor::NewL(*this, iMmCustom); - iMonitor->StartMonitoring(); - iStopMonitor = TMSEtelDtmfStopMonitor::NewL(*this, iPhone); - // iStopMonitor->StartMonitoring(); - - CleanupStack::Pop(2);//telserver,phone - TRACE_PRN_FN_EXT; - } - -// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/cspeteldtmfmonitor.cpp --- a/mmserv/tms/tmscallserver/src/cspeteldtmfmonitor.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include -#include -#include "cspeteldtmfmonitor.h" -#include "tmsutility.h" -#include "cspdtmfprovider.h" -#include "cspdtmfprovider.h" - -using namespace TMS; - -// ----------------------------------------------------------------------------- -// TMSEtelDtmfMonitor::NewL. -// ----------------------------------------------------------------------------- -// -TMSEtelDtmfMonitor* TMSEtelDtmfMonitor::NewL(TMSDTMFProvider& aObserver, - RMmCustomAPI& aMmCustom) - { - TRACE_PRN_FN_ENT; - TMSEtelDtmfMonitor* self = new (ELeave) TMSEtelDtmfMonitor(aObserver, - aMmCustom); - TRACE_PRN_FN_EXT; - return self; - } - -// ----------------------------------------------------------------------------- -// Destructs the object by canceling first ongoing monitoring. -// ----------------------------------------------------------------------------- -// -TMSEtelDtmfMonitor::~TMSEtelDtmfMonitor() - { - TRACE_PRN_FN_ENT; - Cancel(); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// Starts the monitor. -// ----------------------------------------------------------------------------- -// -void TMSEtelDtmfMonitor::StartMonitoring() - { - TRACE_PRN_FN_ENT; - if (!IsActive()) - { - iStatus = KRequestPending; - iMmCustom.NotifyDtmfEvent(iStatus, iEventData); - SetActive(); - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// From CActive. -// Handles line status change notifying. -// ----------------------------------------------------------------------------- -// -void TMSEtelDtmfMonitor::RunL() - { - TRACE_PRN_FN_ENT; - TInt err = iStatus.Int(); - TRACE_PRN_N1(_L("**TMS TMSEtelDtmfMonitor::RunL: status:%d"), err); - - if (err == KErrNone) - { - TMSCCPDTMFObserver::TCCPDtmfEvent event; - if (iEventData.iEvent == RMmCustomAPI::EDtmfStart - && iEventData.iType == RMmCustomAPI::EDtmfManual) - { - event = TMSCCPDTMFObserver::ECCPDtmfManualStart; - } - else if (iEventData.iEvent == RMmCustomAPI::EDtmfStart - && iEventData.iType == RMmCustomAPI::EDtmfSequence) - { - event = TMSCCPDTMFObserver::ECCPDtmfSequenceStart; - } - else if (iEventData.iEvent == RMmCustomAPI::EDtmfStop - && iEventData.iType == RMmCustomAPI::EDtmfManual) - { - event = TMSCCPDTMFObserver::ECCPDtmfManualStop; - } - else if (iEventData.iEvent == RMmCustomAPI::EDtmfStop - && iEventData.iType == RMmCustomAPI::EDtmfSequence) - { - event = TMSCCPDTMFObserver::ECCPDtmfSequenceStop; - } - else if (iEventData.iEvent == RMmCustomAPI::EDtmfAbort - && iEventData.iType == RMmCustomAPI::EDtmfManual) - { - event = TMSCCPDTMFObserver::ECCPDtmfManualAbort; - } - else if (iEventData.iEvent == RMmCustomAPI::EDtmfAbort - && iEventData.iType == RMmCustomAPI::EDtmfSequence) - { - event = TMSCCPDTMFObserver::ECCPDtmfSequenceAbort; - } - else - { - // Refresh and return (no observer notfiying). - TRACE_PRN_N2(_L("**TMS TMSEtelDtmfMonitor::RunL: Unknown event \ - = %¨d, type = %d"), iEventData.iEvent,iEventData.iType); - StartMonitoring(); - return; - } - - iObserver.NotifyDTMFEvent(event, err, iEventData.iTone); - } - else - { - TRACE_PRN_N1(_L("**TMS TMSEtelDtmfMonitor::RunL: Error \ - from DTMF: %d"),err); - } - - // Continue if not in offline mode - if (err != KErrGsmOfflineOpNotAllowed && err != KErrCancel - && err != KErrNotSupported) - { - StartMonitoring(); - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// From CActive -// Canceling functionality. -// ----------------------------------------------------------------------------- -// -void TMSEtelDtmfMonitor::DoCancel() - { - TRACE_PRN_FN_ENT; - if (iStatus == KRequestPending) - { - iMmCustom.CancelAsyncRequest(ECustomNotifyDtmfEventIPC); - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// Constructs the monitor. -// ----------------------------------------------------------------------------- -// -TMSEtelDtmfMonitor::TMSEtelDtmfMonitor(TMSDTMFProvider& aObserver, - RMmCustomAPI& aMmCustom) : - CActive(EPriorityStandard), - iObserver(aObserver), - iMmCustom(aMmCustom) - { - TRACE_PRN_FN_ENT; - CActiveScheduler::Add(this); - TRACE_PRN_FN_EXT; - } - -// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/cspeteldtmfstopmonitor.cpp --- a/mmserv/tms/tmscallserver/src/cspeteldtmfstopmonitor.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include -#include "cspeteldtmfstopmonitor.h" -#include "tmsutility.h" -#include "cspdtmfprovider.h" -#include "cspdtmfprovider.h" - -using namespace TMS; - -// ----------------------------------------------------------------------------- -// TMSEtelDtmfStopMonitor::NewL. -// ----------------------------------------------------------------------------- -// -TMSEtelDtmfStopMonitor* TMSEtelDtmfStopMonitor::NewL(TMSDTMFProvider& aObserver, - RMobilePhone& aPhone) - { - TRACE_PRN_FN_EXT; - TMSEtelDtmfStopMonitor* self = new (ELeave) TMSEtelDtmfStopMonitor( - aObserver, aPhone); - TRACE_PRN_FN_EXT; - return self; - } - -// ----------------------------------------------------------------------------- -// Constructs the monitor. -// ----------------------------------------------------------------------------- -// -TMSEtelDtmfStopMonitor::TMSEtelDtmfStopMonitor(TMSDTMFProvider& aObserver, - RMobilePhone& aPhone) : - CActive(EPriorityStandard), - iObserver(aObserver), - iPhone(aPhone) - { - TRACE_PRN_FN_ENT; - CActiveScheduler::Add(this); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// Destructs the object by canceling first ongoing monitoring. -// ----------------------------------------------------------------------------- -// -TMSEtelDtmfStopMonitor::~TMSEtelDtmfStopMonitor() - { - TRACE_PRN_FN_ENT; - Cancel(); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// Starts the monitor. -// ----------------------------------------------------------------------------- -// -void TMSEtelDtmfStopMonitor::StartMonitoring() - { - TRACE_PRN_FN_ENT; - if (!IsActive()) - { - iStatus = KRequestPending; - iPhone.NotifyStopInDTMFString(iStatus); - SetActive(); - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// From CActive. -// Handles line status change notifying. -// ----------------------------------------------------------------------------- -// -void TMSEtelDtmfStopMonitor::RunL() - { - TRACE_PRN_FN_ENT; - gint err = iStatus.Int(); - TRACE_PRN_N1(_L("**TMS TMSEtelDtmfStopMonitor::RunL: status: %d"), err); - - if (err != KErrCancel && err != KErrServerTerminated) - { - TChar tone = NULL; - TMSCCPDTMFObserver::TCCPDtmfEvent event = - TMSCCPDTMFObserver::ECCPDtmfStopInDtmfString; - iObserver.NotifyDTMFEvent(event, err, tone); - } - else - { - TRACE_PRN_N1(_L("**TMS TMSEtelDtmfStopMonitor::RunL: Error \ - from RMobilePhone: %d"),iStatus.Int()); - } - - // Continue if not in offline mode - if (err != KErrGsmOfflineOpNotAllowed && err != KErrCancel - && err != KErrNotSupported) - { - StartMonitoring(); - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// From CActive -// Canceling functionality. -// ----------------------------------------------------------------------------- -// -void TMSEtelDtmfStopMonitor::DoCancel() - { - TRACE_PRN_FN_ENT; - if (iStatus == KRequestPending) - { - iPhone.CancelAsyncRequest(EMobilePhoneNotifyStopInDTMFString); - } - TRACE_PRN_FN_EXT; - } - -// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/csuplink.cpp --- a/mmserv/tms/tmscallserver/src/csuplink.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include "csuplink.h" -#include "mcspdevsoundobserver.h" - -using namespace TMS; - -// Mute value -const gint KSetMuteToDevSound = 0; - -// ----------------------------------------------------------------------------- -// Static constructor. -// ----------------------------------------------------------------------------- -// -TMSCSUplink* TMSCSUplink::NewL(TMSCSPDevSoundObserver& aObserver) - { - TMSCSUplink* self = new (ELeave) TMSCSUplink(aObserver); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -TMSCSUplink::~TMSCSUplink() - { - } - -// ----------------------------------------------------------------------------- -// Gives mic mute state -// ----------------------------------------------------------------------------- -// -TBool TMSCSUplink::IsMuted() - { - TBool isMuted = EFalse; - gint gain = 0; - if (iDevSound) - { - gain = iDevSound->Gain(); - } - if (!gain) - { - // Mute is on - isMuted = ETrue; - } - // CSPLOGSTRING( CSPINT, "TMSCSUplink::IsMuted" ); - return isMuted; - } - -// ----------------------------------------------------------------------------- -// Set mic muted. -// ----------------------------------------------------------------------------- -// -void TMSCSUplink::SetMuted() - { - if (iDevSound) - { - iDevSound->SetGain(KSetMuteToDevSound); - } - } - -// ----------------------------------------------------------------------------- -// Set mic unmuted -// ----------------------------------------------------------------------------- -// -void TMSCSUplink::SetUnmuted() - { - if (iDevSound) - { - iDevSound->SetGain(iDevSound->MaxGain()); - } - } - -// ----------------------------------------------------------------------------- -// Sets gain -// ----------------------------------------------------------------------------- -// -void TMSCSUplink::SetGain(gint aGain) - { - if (iDevSound) - { - iDevSound->SetGain(aGain); - } - } - -// ----------------------------------------------------------------------------- -// Gives volume -// ----------------------------------------------------------------------------- -// -gint TMSCSUplink::Gain() - { - gint gain = 0; - if (iDevSound) - { - gain = iDevSound->Gain(); - } - return gain; - } - -// ----------------------------------------------------------------------------- -// Gives max gain -// ----------------------------------------------------------------------------- -// -gint TMSCSUplink::MaxGain() - { - gint gain = 0; - if (iDevSound) - { - gain = iDevSound->MaxGain(); - } - return gain; - } - -// ----------------------------------------------------------------------------- -// From class MDevSoundObserver -// Activation was successfull. -// ----------------------------------------------------------------------------- -// -void TMSCSUplink::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) - { - // CSPLOGSTRING( CSPINT, "TMSCSUplink::BufferToBeEmptied" ); - - // We dont react to devsound messages unless we are activating. - if (IsActivationOngoing()) - { - iActive = ETrue; - iActivationOngoing = EFalse; - iObserver.UplinkActivatedSuccessfully(); - } - } - -// ----------------------------------------------------------------------------- -// From class MDevSoundObserver -// Activation feiled -// ----------------------------------------------------------------------------- -// -void TMSCSUplink::RecordError(TInt aError) - { - // CSPLOGSTRING( CSPINT, "TMSCSUplink::RecordError" ); - - // We dont react to devsound messages unless we are activating. - if (IsActivationOngoing()) - { - if (aError == KErrAccessDenied) - { - iActivationOngoing = EFalse; - iObserver.UplinkActivationFailed(); - } - } - } - -// ----------------------------------------------------------------------------- -// From class TMSCSPDevSound -// Tries to activate mic stream. Stream becomes active when BufferToBeFilled -// gets called. -// ----------------------------------------------------------------------------- -// -void TMSCSUplink::DoActivateL() - { - if (iDevSound) - { - iDevSound->RecordInitL(); - } - } - -// ----------------------------------------------------------------------------- -// Constructor -// ----------------------------------------------------------------------------- -// -TMSCSUplink::TMSCSUplink(TMSCSPDevSoundObserver& aObserver) : - TMSCSPDevSound(aObserver) - { - } - -// ----------------------------------------------------------------------------- -// Second phase constructor -// ----------------------------------------------------------------------------- -// -void TMSCSUplink::ConstructL() - { - TMSCSPDevSound::ConstructL(EMMFStateRecording, KAudioPrefCSCallUplink, - KAudioPriorityCSCallUplink); - } - -// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/delaytimer.cpp --- a/mmserv/tms/tmscallserver/src/delaytimer.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -// INCLUDE FILES -#include "delaytimer.h" -#include "tmsutility.h" - -using namespace TMS; - -// ----------------------------------------------------------------------------- -// TMSCallDelayTimer::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -TMSCallDelayTimer* TMSCallDelayTimer::NewL() - { - TRACE_PRN_FN_ENT; - TMSCallDelayTimer* self = new (ELeave) TMSCallDelayTimer; - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - TRACE_PRN_FN_EXT; - return self; - } - -// ----------------------------------------------------------------------------- -// TMSCallDelayTimer::TMSCallDelayTimer() -// C++ constructor. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TMSCallDelayTimer::TMSCallDelayTimer() : - CActive(CActive::EPriorityStandard) - { - TRACE_PRN_FN_ENT; - CActiveScheduler::Add(this); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallDelayTimer::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void TMSCallDelayTimer::ConstructL() - { - TRACE_PRN_FN_ENT; - User::LeaveIfError(iShutDownTimer.CreateLocal()); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallDelayTimer::~TMSCallDelayTimer -// Destructor -// ----------------------------------------------------------------------------- -// -TMSCallDelayTimer::~TMSCallDelayTimer() - { - TRACE_PRN_FN_ENT; - Cancel(); - iShutDownTimer.Close(); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallDelayTimer::SetDelay -// Request a timeout after aDelay -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void TMSCallDelayTimer::SetDelay(TTimeIntervalMicroSeconds32 aDelay) - { - TRACE_PRN_FN_ENT; - if (!IsActive()) - { - iStatus = KRequestPending; - SetActive(); - iShutDownTimer.After(iStatus, aDelay); - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallDelayTimer::RunL -// Called by Active object framework when timer times out. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void TMSCallDelayTimer::RunL() - { - TRACE_PRN_FN_ENT; - CActiveScheduler::Stop(); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSCallDelayTimer::DoCancel -// Called by the Active object framework when user cancels active object. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void TMSCallDelayTimer::DoCancel() - { - TRACE_PRN_FN_ENT; - iShutDownTimer.Cancel(); - TRACE_PRN_FN_EXT; - } - -// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/dtmfnotifier.cpp --- a/mmserv/tms/tmscallserver/src/dtmfnotifier.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -// INCLUDE FILES -#include "dtmfnotifier.h" -#include "tmsclientserver.h" -#include "tmsutility.h" - -using namespace TMS; - -// CONSTANTS -_LIT_SECURITY_POLICY_PASS(KTMSServerReadPolicy); -_LIT_SECURITY_POLICY_C1(KTMSServerWritePolicy, ECapabilityWriteUserData); - -// ----------------------------------------------------------------------------- -// TMSDtmfNotifier::TMSDtmfNotifier -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -TMSDtmfNotifier::TMSDtmfNotifier() - { - } - -// ----------------------------------------------------------------------------- -// TMSDtmfNotifier::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void TMSDtmfNotifier::ConstructL() - { - TRACE_PRN_FN_ENT; - TInt err = RProperty::Define(EDtmfPs, RProperty::EByteArray, - KTMSServerReadPolicy, KTMSServerWritePolicy); - TRACE_PRN_N1(_L("DtmfSetting::ConstructL err:%d"),err); - - if (err != KErrAlreadyExists) - { - User::LeaveIfError(err); - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSDtmfNotifier::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -TMSDtmfNotifier* TMSDtmfNotifier::NewL() - { - TMSDtmfNotifier* self = new (ELeave) TMSDtmfNotifier(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// Destructor -TMSDtmfNotifier::~TMSDtmfNotifier() - { - TRACE_PRN_FN_ENT; - TInt err = RProperty::Delete(KTMSPropertyCategory, EDtmfPs); - TRACE_PRN_N1(_L("DtmfSetting::~TMSDtmfNotifier err:%d"),err); - TRACE_PRN_FN_ENT; - } - -// ----------------------------------------------------------------------------- -// TMSDtmfNotifier::SetVolume -// ----------------------------------------------------------------------------- -// -void TMSDtmfNotifier::SetDtmf(TmsMsgBufPckg dtmfpckg, TBool aPublish) - { - TRACE_PRN_FN_ENT; - //TInt err(KErrNone); - if (aPublish) - { - /*err =*/RProperty::Set(KTMSPropertyCategory, EDtmfPs, dtmfpckg); - } - - //TRACE_PRN_N1(_L("DtmfSetting::SetDtmf err:%d"),err); - TRACE_PRN_FN_EXT; - } - -// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/ipcalldownlink.cpp --- a/mmserv/tms/tmscallserver/src/ipcalldownlink.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,911 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include -#include -#include -#include "tmsutility.h" -#include "gsterrorconcealmentinterface.h" -#include "gstg711decoderinterface.h" -#include "gstilbcdecoderinterface.h" -#include "gstg729decoderinterface.h" -#include "ipcallstream.h" - -using namespace TMS; - -static TMSIPDownlink* iSelfDn; -#ifdef _DEBUG -static TInt iHeap; -#endif //_DEBUG -GstBuffer* gstDnlBuffer; -GstCaps* caps; -gint requestBufLen; - -#ifdef __PLAY_WAV_FROM_FILE__ -_LIT16(KTestFile1, "c:\\data\\sounds\\digital\\sample1.wav"); -#endif - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::cb_raw_playback_handoff -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::cb_raw_playback_handoff(GstElement* /*appsrc*/, - guint size) - { - TRACE_PRN_N(_L("TMS->DNL: cb_raw_playback_handoff")); - - requestBufLen = size; - -#ifdef _DEBUG - TInt block; - RHeap &heap = User::Heap(); - TInt avail = heap.Available(block); - RDebug::Print(_L("TMS->PRINT-HEAP-DN:Size[%d], Available[%d], delta[%d]"), - heap.Size(), avail, (iHeap - avail)); - iHeap = avail; -#endif //_DEBUG - iSelfDn->BufferToBeFilled(); - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::bus_call -// ----------------------------------------------------------------------------- -// -gboolean TMSIPDownlink::bus_call(GstBus* /*bus*/, GstMessage* msg, - gpointer /*data*/) - { - switch (GST_MESSAGE_TYPE(msg)) - { - case GST_MESSAGE_EOS: - { - gst_element_set_state(iSelfDn->iPipelinePlay, GST_STATE_NULL); - gst_object_unref(GST_OBJECT(iSelfDn->iPipelinePlay)); - break; - } - case GST_MESSAGE_ERROR: - { - gchar* debug; - GError* err; - gst_message_parse_error(msg, &err, &debug); - g_free(debug); - g_print("Error: %s\n", err->message); - g_error_free(err); - break; - } - default: - { - break; - } - } - - return ETrue; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::gst_initialize_play -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::gst_initialize_play() - { - TRACE_PRN_FN_ENT; - - gint err = KErrNone; - - // create elements - iPipelinePlay = gst_pipeline_new("pipelinePlay"); - iAppSrc = gst_element_factory_make("appsrc", "source"); - iSink = gst_element_factory_make("devsoundsink", "sink"); - - if (!iAppSrc || !iSink) - { - err = KErrNotFound; - TRACE_PRN_IF_ERR(err); - return err; - } - - iBusPlay = gst_pipeline_get_bus(GST_PIPELINE(iPipelinePlay)); - gst_bus_add_watch(iBusPlay, TMSIPDownlink::bus_call, NULL); - gst_object_unref(iBusPlay); - - iMaxBufLen = ConfigureMedia(iCodecID); - - g_object_set(iAppSrc, "stream-type", 0, "blocksize", iMaxBufLen, NULL); - gst_bin_add_many(GST_BIN(iPipelinePlay), iAppSrc, iSink, NULL); - gst_element_link(iAppSrc, iSink); - - caps = gst_caps_new_simple(iMediaType, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "signed", G_TYPE_BOOLEAN, TRUE, - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "rate", G_TYPE_INT, 8000, - "channels", G_TYPE_INT, 1, - NULL); - - //NOTE: d/s is not ready at this time to return true maxvolume - TInt maxvol = 10; -#ifdef __WINSCW__ - maxvol = 10000; -#endif //__WINSCW__ - g_object_set(G_OBJECT(iSink), - "volume", maxvol, -#ifndef __WINSCW__ - "priority", (gint)iPriority.iPriority, - "preference", (gint)iPriority.iPref, -#endif - NULL); - - gst_app_src_set_caps(GST_APP_SRC(iAppSrc), caps); - gst_app_src_set_max_bytes(GST_APP_SRC(iAppSrc), iMaxBufLen); - err = SetCodecCi(); - //gst_element_set_state(iPipelinePlay, GST_STATE_READY); - - TRACE_PRN_FN_EXT; - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::gst_play_raw -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::gst_play_raw() - { - TRACE_PRN_FN_ENT; - - // start playback - gst_element_set_state(iPipelinePlay, GST_STATE_PLAYING); - - //configure the appsrc, we will push buffer to appsrc when it needs more data - g_signal_connect(iAppSrc, "need-data", - G_CALLBACK (cb_raw_playback_handoff), - NULL); - TRACE_PRN_FN_EXT; - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::TMSIPDownlink -// Standard Constructor -// ----------------------------------------------------------------------------- -// -TMSIPDownlink::TMSIPDownlink() - { - iSelfDn = this; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::~TMSIPDownlink -// Standard Constructor -// ----------------------------------------------------------------------------- -// -TMSIPDownlink::~TMSIPDownlink() - { - TRACE_PRN_FN_ENT; - - Stop(); - gst_caps_unref(caps); - gst_object_unref(GST_OBJECT(iPipelinePlay)); - gst_deinit(); - - delete iErrConcealmentIntfc; - delete iG711DecoderIntfc; - delete iG729DecoderIntfc; - delete iIlbcDecoderIntfc; - -#ifdef __PLAY_WAV_FROM_FILE__ - iFs.Close(); - delete fbuf; -#endif - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::NewL -// Symbian two-phase constructor -// ----------------------------------------------------------------------------- -// -TMSIPDownlink* TMSIPDownlink::NewL(const guint32 codecID, - const TMMFPrioritySettings priority) - { - TMSIPDownlink* self = new (ELeave) TMSIPDownlink(); - CleanupStack::PushL(self); - self->ConstructL(codecID, priority); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::ConstructL -// Part two of Symbian two phase construction -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::ConstructL(const guint32 codecID, - const TMMFPrioritySettings priority) - { - TRACE_PRN_FN_ENT; - - iCodecID = codecID; - iPriority = priority; - // SetTime(); - gst_init(NULL, NULL); - // CalcLatency(); - // SetTime(); - - gint err = gst_initialize_play(); - if (err != TMS_RESULT_SUCCESS) - { - User::Leave(err); - } - - // Client must set these before querying! - iG711DecodeMode = TMS_G711_CODEC_MODE_ALAW; - iILBCDecodeMode = TMS_ILBC_CODEC_MODE_20MS_FRAME; - -#ifdef __PLAY_WAV_FROM_FILE__ - iReadSize = KVoIPPCM16FrameLen; - err = iFs.Connect(); - if (err == KErrNone) - { - err = iFile.Open(iFs, KTestFile1, EFileShareAny | EFileRead); - } - if (err == KErrNone) - { - iFile.Size(fsize); - } - fbuf = HBufC8::NewL(fsize); - TPtr8 p = fbuf->Des(); - iFile.Read(p, fsize); - iFile.Close(); -#endif - // CalcLatency(); - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::Start -// -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::Start() - { - TRACE_PRN_FN_ENT; - - gst_play_raw(); - iStatus = EStreaming; - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::Stop -// -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::Stop() - { - TRACE_PRN_FN_ENT; - - if (iStatus == EStreaming) - { - if (iPipelinePlay != NULL && - iPipelinePlay->current_state == GST_STATE_PLAYING) - { - gst_element_set_state(iPipelinePlay, GST_STATE_NULL); - } - - iStatus = EReady; - } - - if (gstDnlBuffer) - { - gst_buffer_unref(gstDnlBuffer); - } - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::BufferToBeFilled -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::BufferToBeFilled() - { - TRACE_PRN_N1(_L("TMS->DNL->BTBF: requestBufLen[%d]"), requestBufLen); - -#ifndef __PLAY_WAV_FROM_FILE__ - // Create or adjust the chunk - TInt err = DoChunk(requestBufLen, iMsgBuffer); - - if (err != TMS_RESULT_SUCCESS) - { - Stop(); - iMsgBuffer.iStatus = err; - } - else - { - // Notify client there is buffer ready to be filled - iMsgBuffer.iStatus = iChunk.Handle(); - iMsgBuffer.iInt = requestBufLen; - iStatus = EStreaming; - // If chunk is opened, we will expect a call from the client to - // get chunk handle. When we get a call to copy chunk handle, - // check these variables and see if they match. This is not - // completely secure, but will provide some level of security - if (iMsgBuffer.iBool == TRUE) - { - iWriteDataXferHndlToClient = TRUE; - iKey = iMsgBuffer.iUint32; - } - } - - iMsgBuffer.iRequest = ECmdFillBuffer; - iMsgQueue.Send(iMsgBuffer); - -#else //__PLAY_WAV_FROM_FILE__ - TInt err = KErrNone; - BufferFilled(); -#endif //__PLAY_WAV_FROM_FILE__ - TRACE_PRN_IF_ERR(err); - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::BufferFilled -// -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::BufferFilled(const guint buflen) - { -#ifndef __PLAY_WAV_FROM_FILE__ - gstDnlBuffer = gst_buffer_new(); - gst_buffer_set_caps(gstDnlBuffer, caps); - GST_BUFFER_SIZE(gstDnlBuffer) = buflen; - - //TODO: what if bufLen > requestBufLen? - - // IMPL#1: - // gstDnlBuffer->data pointer is set to use chunk pointer. - // Although unlikely in the pull mode, this may potentially result - // in data loss if chunk gets overwritten before it is consumed. - gst_buffer_set_data(gstDnlBuffer, iChunk.Base(), buflen); - - // IMPL#2 - // Alternative implementation with new buffer alloc and memcpy. - // GStreamer will free this memory when buffer refcount becomes 0. - //guint8* ptr = (guint8*)g_malloc(buflen); - //GST_BUFFER_MALLOCDATA(gstDnlBuffer) = GST_BUFFER_DATA(gstDnlBuffer) = ptr; - //memcpy(ptr, iChunk.Base(), buflen); - -#else //__PLAY_WAV_FROM_FILE__ - User::After(TTimeIntervalMicroSeconds32(150000)); - - TPtr8 p = fbuf->Des(); - TInt buflen = iReadSize; - gstDnlBuffer = gst_buffer_new_and_alloc(buflen); - gst_buffer_set_caps(gstDnlBuffer, caps); - unsigned char* ptr = (unsigned char*)((fbuf->Ptr())+iReadBytes); - gst_buffer_set_data(gstDnlBuffer, ptr, buflen); - - if ((iReadBytes + iReadSize> fsize)) - { - // start over from the beginning - iReadBytes = 0; - } - else - { - iReadBytes += iReadSize; - } - -#endif //__PLAY_WAV_FROM_FILE__ - gst_app_src_push_buffer(GST_APP_SRC(iAppSrc), gstDnlBuffer); - TRACE_PRN_N1(_L("TMS->DNL->BF: LEN[%d]"), buflen); - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetCodecCi -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetCodecCi() - { - TRAPD(err, SetCodecCiL()); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetCodecCiL -// -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::SetCodecCiL() - { - TRACE_PRN_FN_ENT; - - switch (iCodecID) - { - case KMccFourCCIdG711: - { - if (!iG711DecoderIntfc) - { - iG711DecoderIntfc = GST_G711_DECODER_GET_IFACE(iSink); - } - break; - } - case KMccFourCCIdG729: - { - if (!iG729DecoderIntfc) - { - iG729DecoderIntfc = GST_G729_DECODER_GET_IFACE(iSink); - } - break; - } - case KMccFourCCIdILBC: - { - if (!iIlbcDecoderIntfc) - { - iIlbcDecoderIntfc = GST_ILBC_DECODER_GET_IFACE(iSink); - } - break; - } - case KMccFourCCIdAMRNB: - case KMMFFourCCCodePCM16: - { - break; - } - default: - { - User::Leave(TMS_RESULT_INVALID_ARGUMENT); - } - } - - if (iCodecID == KMccFourCCIdG711 || - iCodecID == KMccFourCCIdG729 || - iCodecID == KMccFourCCIdILBC || - iCodecID == KMccFourCCIdAMRNB) - { - if (!iErrConcealmentIntfc) - { - iErrConcealmentIntfc = GST_ERROR_CONCEALMENT_GET_IFACE(iSink); - } - } - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetVolume(const guint volume) - { - g_object_set(G_OBJECT(iSink), "volume", volume, NULL); - TRACE_PRN_N1(_L("TMS->DNL: SetVolume [%d]"), volume); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetVolume(guint& volume) - { - g_object_get(G_OBJECT(iSink), "volume", &volume, NULL); - TRACE_PRN_N1(_L("TMS->DNL: GetVolume [%d]"), volume); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetMaxVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetMaxVolume(guint& volume) - { - g_object_get(G_OBJECT(iSink), "maxvolume", &volume, NULL); - TRACE_PRN_N1(_L("TMS->DNL: MaxVolume [%d]"), volume); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetDataXferChunkHndl -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk) - { - gint status = TMS_RESULT_DOES_NOT_EXIST; - - if (iChunk.Handle()) - { - if (iWriteDataXferHndlToClient && (iKey == key)) - { - chunk = iChunk; - iWriteDataXferHndlToClient = FALSE; - iKey = 0; - status = TMS_RESULT_SUCCESS; - } - else - { - status = TMS_RESULT_ILLEGAL_OPERATION; - } - } - - TRACE_PRN_IF_ERR(status); - return status; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetIlbcCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetIlbcCodecMode(gint mode) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - iILBCDecodeMode = mode; - - if (iIlbcDecoderIntfc && iCodecID == KMccFourCCIdILBC) - { - if (mode == TMS_ILBC_CODEC_MODE_20MS_FRAME) - { - err = iIlbcDecoderIntfc->SetDecoderMode(E20msFrame); - TRACE_PRN_N(_L("TMS->DNL: iLBC Mode Set [20ms]")); - } - else if (mode == TMS_ILBC_CODEC_MODE_30MS_FRAME) - { - err = iIlbcDecoderIntfc->SetDecoderMode(E30msFrame); - TRACE_PRN_N(_L("TMS->DNL: iLBC Mode Set [30ms]")); - } - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetIlbcCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetIlbcCodecMode(gint& mode) - { - // not available through CIs -> return cashed value - mode = iILBCDecodeMode; - TRACE_PRN_N1(_L("TMS->DNL: GetIlbcCodecMode [%d]"), mode); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetG711CodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetG711CodecMode(gint mode) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - iG711DecodeMode = mode; - - if (iG711DecoderIntfc && iCodecID == KMccFourCCIdG711) - { - if (mode == TMS_G711_CODEC_MODE_ALAW) - { - err = iG711DecoderIntfc->SetDecoderMode(EDecALaw); - TRACE_PRN_N(_L("TMS->DNL: G711 Mode Set [ALaw]")); - } - else if (mode == TMS_G711_CODEC_MODE_MULAW) - { - err = iG711DecoderIntfc->SetDecoderMode(EDecULaw); - TRACE_PRN_N(_L("TMS->DNL: G711 Mode Set [uLaw]")); - } - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetG711CodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetG711CodecMode(gint& mode) - { - // not available through CIs -> return cached value - mode = iG711DecodeMode; - TRACE_PRN_N1(_L("TMS->DNL: GetG711CodecMode [%d]"), mode); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::FrameModeRqrdForEC -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::FrameModeRqrdForEC(gboolean& frmodereq) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - if (iErrConcealmentIntfc) - { - err = iErrConcealmentIntfc->FrameModeRqrdForEC(&frmodereq); - TRACE_PRN_N1(_L("TMS->DNL: FrameModeRqrdForEC [%d]"), frmodereq); - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetFrameMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetFrameMode(const gboolean frmode) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - iFrameMode = frmode; - - if (iErrConcealmentIntfc) - { - err = iErrConcealmentIntfc->SetFrameMode(frmode); - TRACE_PRN_N1(_L("TMS->DNL: SetFrameMode [%d]"), frmode); - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetFrameMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetFrameMode(gboolean& frmode) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iErrConcealmentIntfc) - { - // not available through CIs -> return cached value - frmode = iFrameMode; - TRACE_PRN_N1(_L("TMS->DNL: GetFrameMode [%d]"), frmode); - err = TMS_RESULT_SUCCESS; - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::ConcealErrorForNextBuffer -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::ConcealErrorForNextBuffer() - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iErrConcealmentIntfc) - { - err = iErrConcealmentIntfc->ConcealErrorForNextBuffer(); - TRACE_PRN_N(_L("TMS->DNL: ConcealErrorForNextBuffer")); - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetCng -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetCng(const TMSFormatType fmttype, const gboolean cng) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) - { - err = iG711DecoderIntfc->SetCng(cng); - TRACE_PRN_N1(_L("TMS->DNL: SetCng [%d]"), cng); - } - else if (fmttype == TMS_FORMAT_ILBC && iIlbcDecoderIntfc) - { - err = iIlbcDecoderIntfc->SetCng(cng); - TRACE_PRN_N1(_L("TMS->DNL: SetCng [%d]"), cng); - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetCng -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetCng(const TMSFormatType fmttype, gboolean& cng) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) - { - err = iG711DecoderIntfc->GetCng(&cng); - TRACE_PRN_N1(_L("TMS->DNL: GetCng [%d]"), cng); - } - else if (fmttype == TMS_FORMAT_ILBC && iIlbcDecoderIntfc) - { - err = iIlbcDecoderIntfc->GetCng(&cng); - TRACE_PRN_N1(_L("TMS->DNL: GetCng [%d]"), cng); - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetPlc -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetPlc(const TMSFormatType fmttype, const gboolean plc) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) - { - iPlc = plc; - err = iG711DecoderIntfc->SetPlc(iPlc); - TRACE_PRN_N1(_L("TMS->DNL: SetPlc [%d]"), plc); - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetPlc -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetPlc(const TMSFormatType fmttype, gboolean& plc) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) - { - // not available through CIs -> return cached value - plc = iPlc; - err = TMS_RESULT_SUCCESS; - TRACE_PRN_N1(_L("TMS->DNL: GetPlc [%d]"), plc); - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::BadLsfNextBuffer -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::BadLsfNextBuffer() - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EStreaming) - { - if (iCodecID == KMccFourCCIdG729 && iG729DecoderIntfc) - { - err = iG729DecoderIntfc->BadLsfNextBuffer(); - TRACE_PRN_N(_L("TMS->DNL: BadLsfNextBuffer")); - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetAudioDeviceL -// -// ----------------------------------------------------------------------------- -void TMSIPDownlink::SetAudioDeviceL(TMSAudioOutput output) - { - gint outputDev; - - // ENoPreference=0, EAll=1, ENoOutput=2, EPrivate=3, EPublic=4 - switch (output) - { - case TMS_AUDIO_OUTPUT_PRIVATE: - case TMS_AUDIO_OUTPUT_HANDSET: - outputDev = (gint)CAudioOutput::EPrivate; - break; - case TMS_AUDIO_OUTPUT_PUBLIC: - case TMS_AUDIO_OUTPUT_LOUDSPEAKER: - outputDev = (gint)CAudioOutput::EPublic; - break; - default: // Use default device routing - outputDev = (gint)CAudioOutput::ENoPreference; - break; - } - - g_object_set(G_OBJECT(iSink), "outputdevice", outputDev, NULL); - TRACE_PRN_N1(_L("TMS->DNL: SetAudioDeviceL [%d]"), outputDev); - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetAudioDeviceL -// -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::GetAudioDeviceL(TMSAudioOutput& output) - { - TRACE_PRN_FN_ENT; - - gint outputDev; - g_object_get(G_OBJECT(iSink), "outputdevice", &outputDev, NULL); - TRACE_PRN_N1(_L("TMS->DNL: GetAudioDevice [%d]"), outputDev); - - switch (outputDev) - { - case CAudioOutput::ENoPreference: - case CAudioOutput::EAll: - case CAudioOutput::ENoOutput: - case CAudioOutput::EPrivate: - output = TMS_AUDIO_OUTPUT_PRIVATE; - break; - case CAudioOutput::EPublic: - output = TMS_AUDIO_OUTPUT_PUBLIC; - break; - default: - output = TMS_AUDIO_OUTPUT_PRIVATE; - break; - } - - TRACE_PRN_FN_EXT; - } - -// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/ipcalldownlinkds.cpp --- a/mmserv/tms/tmscallserver/src/ipcalldownlinkds.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,822 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include "tmsutility.h" -#include "ipcallstream.h" - -using namespace TMS; - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::TMSIPDownlink -// Standard Constructor -// ----------------------------------------------------------------------------- -// -TMSIPDownlink::TMSIPDownlink() - { - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::~TMSIPDownlink -// Standard Constructor -// ----------------------------------------------------------------------------- -// -TMSIPDownlink::~TMSIPDownlink() - { - TRACE_PRN_FN_ENT; - - Stop(); - - delete iAudioOutput; - delete iErrConcealmentIntfc; - delete iG711DecoderIntfc; - delete iG729DecoderIntfc; - delete iIlbcDecoderIntfc; - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::NewL -// Symbian two-phase constructor -// ----------------------------------------------------------------------------- -// -TMSIPDownlink* TMSIPDownlink::NewL(const guint32 codecID, - const TMMFPrioritySettings priority) - { - TMSIPDownlink* self = new (ELeave) TMSIPDownlink(); - CleanupStack::PushL(self); - self->ConstructL(codecID, priority); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::ConstructL -// Part two of Symbian two phase construction -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::ConstructL(const guint32 codecID, - const TMMFPrioritySettings priority) - { - TRACE_PRN_FN_ENT; - - iCodecID = codecID; - iPriority = priority; - - // Client must set these before querying! - iG711DecodeMode = TMS_G711_CODEC_MODE_ALAW; - iILBCDecodeMode = TMS_ILBC_CODEC_MODE_20MS_FRAME; - - TRAPD(err, InitDevSoundL(EMMFStatePlaying, priority)); - if (err != TMS_RESULT_SUCCESS) - { - User::Leave(err); - } - - iMaxBufLen = ConfigureMedia(iCodecID); - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::Start -// -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::Start() - { - TRACE_PRN_FN_ENT; - - gint err = TMS_RESULT_ILLEGAL_OPERATION; - - if (iStatus == EReady && iDevSound) - { - TRAP(err, iDevSound->PlayInitL()); - TRACE_PRN_IF_ERR(err); - -#ifdef _DEBUG - iSamplesPlayedCount = 0; -#endif - if (err != TMS_RESULT_SUCCESS) - { - iStatus = EReady; - } - } - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::Stop -// -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::Stop() - { - TRACE_PRN_FN_ENT; - - if (iStatus == EStreaming && iDevSound) - { - iDevSound->Stop(); - iStatus = EReady; - } - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::BufferToBeFilled -// A reference to the buffer delivered from the DevSound is stored locally -// for later use. It will be filled with the data passed from the client -// when it calls BufferFilled. -// -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::BufferToBeFilled(CMMFBuffer* aBuffer) - { - // Store pointer to the received buffer - iDevSoundBufPtr = static_cast (aBuffer); - iBufLen = iDevSoundBufPtr->RequestSize(); - TRACE_PRN_N1(_L("TMS->DNL->BTBF: LEN[%d]"), iBufLen); - -#ifndef __WINSCW__ - //TODO: revisit this! - // The first AMR buffer returns 1 for no data frame. - /*if (iCodecID == KMccFourCCIdAMRNB) - { - iBufLen = iMaxBufLen; - }*/ -#endif //__WINSCW__ - // Create or adjust the chunk - gint err = DoChunk(iBufLen, iMsgBuffer); - - if (err != TMS_RESULT_SUCCESS) - { - Stop(); - iMsgBuffer.iStatus = err; - } - else - { - // Notify client there is buffer ready to be filled - iMsgBuffer.iStatus = err; - iMsgBuffer.iInt = iBufLen; - iStatus = EStreaming; - // If chunk is opened, we will expect a call from the client to - // get chunk handle. When we get a call to copy chunk handle, - // check these variables and see if they match. This is not - // completely secure, but will provide some level of security - if (iMsgBuffer.iBool == TRUE) - { - iWriteDataXferHndlToClient = TRUE; - iKey = iMsgBuffer.iUint32; - } - } - - iMsgBuffer.iRequest = ECmdFillBuffer; - err = iMsgQueue.Send(iMsgBuffer); - - TRACE_PRN_IF_ERR(err); - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::BufferFilled -// -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::BufferFilled(const guint buflen) - { - TRACE_PRN_N1(_L("TMS->DNL->BF: LEN[%d]"), buflen); - - // Copy data over from chunk - TPtr8 dataPtr(iChunk.Base(), buflen, iMaxBufLen); - // RDebug::RawPrint(dataPtr); - - if (iStatus == EStreaming && iDevSound && iDevSoundBufPtr) - { - // Fill D/S buffer and send it for playback - iDevSoundBufPtr->Data() = dataPtr; - TRAPD(ignore, iDevSoundBufPtr->SetRequestSizeL(buflen)); - if (ignore) //makes compiler happy - { - //try playing anyway - iDevSound->PlayData(); - } - else - { - iDevSound->PlayData(); - } - } - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetCodecCi -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetCodecCi() - { - TRAPD(err, SetCodecCiL()); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetCodecCiL -// -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::SetCodecCiL() - { - TRACE_PRN_FN_ENT; - - switch (iCodecID) - { - case KMccFourCCIdG711: - { - if (!iG711DecoderIntfc) - { - iG711DecoderIntfc = CG711DecoderIntfc::NewL(*iDevSound); - } - break; - } - case KMccFourCCIdG729: - { - if (!iG729DecoderIntfc) - { - iG729DecoderIntfc = CG729DecoderIntfc::NewL(*iDevSound); - } - break; - } - case KMccFourCCIdILBC: - { - if (!iIlbcDecoderIntfc) - { - iIlbcDecoderIntfc = CIlbcDecoderIntfc::NewL(*iDevSound); - } - break; - } - case KMccFourCCIdAMRNB: - case KMMFFourCCCodePCM16: - { - break; - } - default: - { - User::Leave(TMS_RESULT_INVALID_ARGUMENT); - break; - } - } - - if (!iErrConcealmentIntfc && iCodecID != KMMFFourCCCodePCM16) - { - iErrConcealmentIntfc = CErrorConcealmentIntfc::NewL(*iDevSound); - } - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetVolume(const guint volume) - { - gint ret(TMS_RESULT_UNINITIALIZED_OBJECT); - if (iDevSound) - { - iDevSound->SetVolume(volume); - ret = TMS_RESULT_SUCCESS; - } - TRACE_PRN_N1(_L("TMS->DNL: SetVolume [%d]"), volume); - return ret; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetVolume(guint& volume) - { - gint ret(TMS_RESULT_UNINITIALIZED_OBJECT); - if (iDevSound) - { - volume = iDevSound->Volume(); - ret = TMS_RESULT_SUCCESS; - } - TRACE_PRN_N1(_L("TMS->DNL: GetVolume [%d]"), volume); - return ret; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetMaxVolume -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetMaxVolume(guint& volume) - { - gint ret(TMS_RESULT_UNINITIALIZED_OBJECT); - if (iDevSound) - { - volume = iDevSound->MaxVolume(); - ret = TMS_RESULT_SUCCESS; - } - TRACE_PRN_N1(_L("TMS->DNL: MaxVolume [%d]"), volume); - return ret; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetDataXferChunkHndl -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk) - { - gint status = TMS_RESULT_DOES_NOT_EXIST; - - if (iChunk.Handle()) - { - if (iWriteDataXferHndlToClient && (iKey == key)) - { - chunk = iChunk; - iWriteDataXferHndlToClient = FALSE; - iKey = 0; - status = TMS_RESULT_SUCCESS; - } - else - { - status = TMS_RESULT_ILLEGAL_OPERATION; - } - } - - TRACE_PRN_IF_ERR(status); - return status; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetIlbcCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetIlbcCodecMode(gint mode) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - iILBCDecodeMode = mode; - - if (iIlbcDecoderIntfc && iCodecID == KMccFourCCIdILBC) - { - if (mode == TMS_ILBC_CODEC_MODE_20MS_FRAME) - { - err = iIlbcDecoderIntfc->SetDecoderMode( - CIlbcDecoderIntfc::E20msFrame); - TRACE_PRN_N(_L("TMS->DNL: iLBC Mode Set [20ms]")); - } - else if (mode == TMS_ILBC_CODEC_MODE_30MS_FRAME) - { - err = iIlbcDecoderIntfc->SetDecoderMode( - CIlbcDecoderIntfc::E30msFrame); - TRACE_PRN_N(_L("TMS->DNL: iLBC Mode Set [30ms]")); - } - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetIlbcCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetIlbcCodecMode(gint& mode) - { - // not available through CIs -> return cashed value - mode = iILBCDecodeMode; - TRACE_PRN_N1(_L("TMS->DNL: GetIlbcCodecMode [%d]"), mode); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetG711CodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetG711CodecMode(gint mode) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - iG711DecodeMode = mode; - - if (iG711DecoderIntfc && iCodecID == KMccFourCCIdG711) - { - if (mode == TMS_G711_CODEC_MODE_ALAW) - { - err = iG711DecoderIntfc->SetDecoderMode( - CG711DecoderIntfc::EDecALaw); - TRACE_PRN_N(_L("TMS->DNL: G711 Mode Set [ALaw]")); - } - else if (mode == TMS_G711_CODEC_MODE_MULAW) - { - err = iG711DecoderIntfc->SetDecoderMode( - CG711DecoderIntfc::EDecULaw); - TRACE_PRN_N(_L("TMS->DNL: G711 Mode Set [uLaw]")); - } - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetG711CodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetG711CodecMode(gint& mode) - { - // not available through CIs -> return cached value - mode = iG711DecodeMode; - TRACE_PRN_N1(_L("TMS->DNL: GetG711CodecMode [%d]"), mode); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::FrameModeRqrdForEC -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::FrameModeRqrdForEC(gboolean& frmodereq) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - if (iErrConcealmentIntfc) - { - err = iErrConcealmentIntfc->FrameModeRqrdForEC(frmodereq); - TRACE_PRN_N1(_L("TMS->DNL: FrameModeRqrdForEC [%d]"), frmodereq); - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetFrameMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetFrameMode(const gboolean frmode) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - iFrameMode = frmode; - - if (iErrConcealmentIntfc) - { - err = iErrConcealmentIntfc->SetFrameMode(frmode); - TRACE_PRN_N1(_L("TMS->DNL: SetFrameMode [%d]"), frmode); - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetFrameMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetFrameMode(gboolean& frmode) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iErrConcealmentIntfc) - { - // not available through CIs -> return cached value - frmode = iFrameMode; - TRACE_PRN_N1(_L("TMS->DNL: GetFrameMode [%d]"), frmode); - err = TMS_RESULT_SUCCESS; - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::ConcealErrorForNextBuffer -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::ConcealErrorForNextBuffer() - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iErrConcealmentIntfc) - { - err = iErrConcealmentIntfc->ConcealErrorForNextBuffer(); - TRACE_PRN_N(_L("TMS->DNL: ConcealErrorForNextBuffer")); - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetCng -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetCng(const TMSFormatType fmttype, const gboolean cng) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) - { - err = iG711DecoderIntfc->SetCng(cng); - TRACE_PRN_N1(_L("TMS->DNL: SetCng [%d]"), cng); - } - else if (fmttype == TMS_FORMAT_ILBC && iIlbcDecoderIntfc) - { - err = iIlbcDecoderIntfc->SetCng(cng); - TRACE_PRN_N1(_L("TMS->DNL: SetCng [%d]"), cng); - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetCng -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetCng(const TMSFormatType fmttype, gboolean& cng) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) - { - err = iG711DecoderIntfc->GetCng(cng); - TRACE_PRN_N1(_L("TMS->DNL: GetCng [%d]"), cng); - } - else if (fmttype == TMS_FORMAT_ILBC && iIlbcDecoderIntfc) - { - err = iIlbcDecoderIntfc->GetCng(cng); - TRACE_PRN_N1(_L("TMS->DNL: GetCng [%d]"), cng); - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetPlc -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::SetPlc(const TMSFormatType fmttype, const gboolean plc) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) - { - iPlc = plc; - err = iG711DecoderIntfc->SetPlc(iPlc); - TRACE_PRN_N1(_L("TMS->DNL: SetPlc [%d]"), plc); - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetPlc -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::GetPlc(const TMSFormatType fmttype, gboolean& plc) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) - { - // not available through CIs -> return cached value - plc = iPlc; - err = TMS_RESULT_SUCCESS; - TRACE_PRN_N1(_L("TMS->DNL: GetPlc [%d]"), plc); - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::BadLsfNextBuffer -// -// ----------------------------------------------------------------------------- -// -gint TMSIPDownlink::BadLsfNextBuffer() - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EStreaming) - { - if (iCodecID == KMccFourCCIdG729 && iG729DecoderIntfc) - { - err = iG729DecoderIntfc->BadLsfNextBuffer(); - TRACE_PRN_N(_L("TMS->DNL: BadLsfNextBuffer")); - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::SetAudioDeviceL -// -// ----------------------------------------------------------------------------- -void TMSIPDownlink::SetAudioDeviceL(TMSAudioOutput output) - { - TRACE_PRN_FN_ENT; - - if (!iAudioOutput) - { - iAudioOutput = CAudioOutput::NewL(*iDevSound); - } - - if (iAudioOutput) - { - // ENoPreference=0, EAll=1, ENoOutput=2, EPrivate=3, EPublic=4 - CAudioOutput::TAudioOutputPreference outputDev; - - switch (output) - { - case TMS_AUDIO_OUTPUT_PRIVATE: - case TMS_AUDIO_OUTPUT_HANDSET: - outputDev = CAudioOutput::EPrivate; - break; - case TMS_AUDIO_OUTPUT_PUBLIC: - case TMS_AUDIO_OUTPUT_LOUDSPEAKER: - outputDev = CAudioOutput::EPublic; - break; - default: // Use default device routing - outputDev = CAudioOutput::ENoPreference; - break; - } - - iAudioOutput->SetAudioOutputL(outputDev); - TRACE_PRN_N1(_L("TMS->DNL: SetAudioDeviceL [%d]"), outputDev); - } - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::GetAudioDeviceL -// -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::GetAudioDeviceL(TMSAudioOutput& output) - { - TRACE_PRN_FN_ENT; - - if (!iAudioOutput) - { - iAudioOutput = CAudioOutput::NewL(*iDevSound); - } - - if (iAudioOutput) - { - CAudioOutput::TAudioOutputPreference outputDev = - iAudioOutput->AudioOutput(); - - switch (outputDev) - { - case CAudioOutput::ENoPreference: - case CAudioOutput::EAll: - case CAudioOutput::ENoOutput: - case CAudioOutput::EPrivate: - output = TMS_AUDIO_OUTPUT_PRIVATE; - break; - case CAudioOutput::EPublic: - output = TMS_AUDIO_OUTPUT_PUBLIC; - break; - default: - output = TMS_AUDIO_OUTPUT_PRIVATE; - break; - } - } - - TRACE_PRN_FN_EXT; - } - -// CALLBACKS - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::InitializeComplete -// A callback from the DevSound indicating completion of the initialization. -// It will send config data to the D/S and configure the encoder via CI. -// If everything goes well, the state of the thread is set EReady. -// The initialization completion message is sent back to the main thread. -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::InitializeComplete(TInt aError) - { - TRACE_PRN_FN_ENT; - - gint err = aError; - - if (err == TMS_RESULT_SUCCESS && iDevSound) - { - TMMFCapabilities conf; - conf = iDevSound->Config(); - conf.iRate = EMMFSampleRate8000Hz; - conf.iChannels = EMMFMono; - TRAP(err, iDevSound->SetConfigL(conf)); - if (err == TMS_RESULT_SUCCESS) - { - // We are ready to stream even in case of later CI setting failure - iStatus = EReady; - iMaxVolume = iDevSound->MaxVolume(); - } - - // Init Custom Interface API to the decoder - err = SetCodecCi(); - if (err != TMS_RESULT_SUCCESS) - { - // DEBUG only - // Can ignore error - although decoder is not fully configured but - // it can still run in the default mode. - TRACE_PRN_IF_ERR(err); - } - } - - // TODO: Notify client - - TRACE_PRN_IF_ERR(err); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPDownlink::PlayError -// From MDevSoundObserver -// Record error is send to client over comm channel. -// The state of recorder is rolled back to EReady. -// ----------------------------------------------------------------------------- -// -void TMSIPDownlink::PlayError(TInt /*aError*/) - { - //TRACE_PRN_IF_ERR(aError); - -#ifdef _DEBUG - iSamplesPlayedCount = 0; -#endif - iStatus = EReady; - - // TODO: Notify client - } - -// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/ipcallstreambase.cpp --- a/mmserv/tms/tmscallserver/src/ipcallstreambase.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include -#include "tmsutility.h" -#include "tmsshared.h" -#include "ipcallstream.h" - -using namespace TMS; - -// ----------------------------------------------------------------------------- -// TMSIPCallStreamBase::~TMSIPCallStreamBase -// Destructor -// ----------------------------------------------------------------------------- -// -TMSIPCallStreamBase::~TMSIPCallStreamBase() - { - TRACE_PRN_FN_ENT; - - if (iChunk.Handle() > 0) - { - iChunk.Close(); - } - -#ifndef __USE_GSTREAMER__ - delete iDevSound; -#endif //__USE_GSTREAMER__ - TRACE_PRN_FN_EXT; - } - -#ifndef __USE_GSTREAMER__ -// ----------------------------------------------------------------------------- -// TMSIPCallStreamBase::InitDevSoundL -// -// ----------------------------------------------------------------------------- -// -void TMSIPCallStreamBase::InitDevSoundL(const TMMFState aDevSoundState, - const TMMFPrioritySettings priority) - { - TRACE_PRN_FN_ENT; - - if (!iDevSound) - { - // Create D/S recording/playing device - iDevSound = CMMFDevSound::NewL(); - } - - if (iDevSound) - { - iDevSound->InitializeL(*this, TFourCC(iCodecID), aDevSoundState); - iDevSound->SetPrioritySettings(priority); - } - } -#endif //__USE_GSTREAMER__ - -// ----------------------------------------------------------------------------- -// TMSIPCallStreamBase::SetMsgQueue -// -// ----------------------------------------------------------------------------- -// -void TMSIPCallStreamBase::SetMsgQueue(const RMsgQueue aMsgQueue) - { - iMsgQueue = aMsgQueue; - } - -// ----------------------------------------------------------------------------- -// TMSIPCallStreamBase::ConfigureMedia -// -// ----------------------------------------------------------------------------- -// -gint TMSIPCallStreamBase::ConfigureMedia(const guint32 aCodecID) - { - gint framelen = 0; - - switch (aCodecID) - { - case KMccFourCCIdG711: - iMediaType = "audio/x-alaw"; - // iMediaType = "audio/x-mulaw"; - framelen = KTMSG711FrameLen10ms; //TODO: may be H/W specific! - //framelen = KTMSG711FrameLen20ms; - break; - case KMccFourCCIdG729: - iMediaType = "audio/g729"; - framelen = KTMSG729FrameLen; - break; - case KMccFourCCIdILBC: - iMediaType = "audio/ilbc"; - framelen = KTMSILBCFrameLen20ms; - //framelen = KTMSILBCFrameLen30ms; - break; - case KMccFourCCIdAMRNB: - iMediaType = "audio/amr"; - framelen = KTMSAMRNBFrameLen; - //framelen = KTMSAMRNBFrameLenFM; - break; - case KMMFFourCCCodePCM16: - default: - iMediaType = "audio/x-raw-int"; - framelen = KTMSPCM16FrameLen; -#ifdef __WINSCW__ - framelen *= 4; //16kB -#endif - break; - } - - //TODO: DEVLON TEST - if (iCodecID != KMMFFourCCCodePCM16) - { - framelen *= 10; - } - //TODO: DEVLON TEST - - return framelen; - } - -// ----------------------------------------------------------------------------- -// TMSIPCallStreamBase::DoChunk -// Checks, adjusts and creates global RChunk. -// ----------------------------------------------------------------------------- -// -gint TMSIPCallStreamBase::DoChunk(const gint aDataLen, TmsMsgBuf& aMsgBuffer) - { - gint status(KErrNone); - - // If chunk already created, try to reuse it - if (iChunk.Handle()) - { - // committed size is smaller but chunk is large enough to hold data - if ((iChunk.Size() < aDataLen) && (aDataLen <= iChunk.MaxSize())) - { - status = iChunk.Adjust(aDataLen); - TRACE_PRN_N1(_L("IP_CALL: DoChunk->Chunk Adjusted [%d]"), aDataLen); - } - else if (aDataLen > iChunk.MaxSize()) - { - iChunk.Close(); - TRACE_PRN_N(_L("IP_CALL: DoChunk->Chunk Closed")); - } - } - RET_ERR_IF_ERR(status); - - // Request kernel to create global RChunk if needed - aMsgBuffer.iBool = FALSE; - if (!iChunk.Handle()) - { - // TODO consider using some max instead - status = iChunk.CreateGlobal(KNullDesC, aDataLen, aDataLen); - // Mark to re-open chunk handle - aMsgBuffer.iBool = TRUE; - aMsgBuffer.iUint32 = Math::Random(); - TRACE_PRN_N2(_L("IP_CALL: DoChunk->Chunk Created [%d]key[%d]"), - aDataLen, aMsgBuffer.iUint32); - } - TRACE_PRN_IF_ERR(status); - return status; - } - -// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/ipcalluplink.cpp --- a/mmserv/tms/tmscallserver/src/ipcalluplink.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,758 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include -#include -#include "tmsutility.h" -#include "ipcallstream.h" - -using namespace TMS; - -static TMSIPUplink* iSelfUp; -GstBuffer* gstUplBuffer; -#ifdef _DEBUG -//static TInt iHeapUp; -#endif //_DEBUG - -// ----------------------------------------------------------------------------- -// TMSIPUplink::cb_record_raw_handoff -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::cb_record_raw_handoff(GstElement *sink) - { - TRACE_PRN_N(_L("TMS->UPL: cb_record_raw_handoff Enter")); - -#ifdef _DEBUG - /* TInt block; - RHeap &heap = User::Heap(); - TInt avail = heap.Available(block); - RDebug::Print(_L("VoIP->PRINT-HEAP-UP:Available:[%d], delta:[%d]"), - avail, iHeapUp-avail); - iHeapUp = avail;*/ -#endif - - gstUplBuffer = gst_app_sink_pull_buffer(GST_APP_SINK(sink)); - iSelfUp->BufferToBeEmptied(); - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::bus_call -// ----------------------------------------------------------------------------- -// -gboolean TMSIPUplink::bus_call(GstBus* /*bus*/, GstMessage* msg, - gpointer /*data*/) - { - switch (GST_MESSAGE_TYPE(msg)) - { - case GST_MESSAGE_EOS: - { - gst_element_set_state(iSelfUp->iPipelineRec, GST_STATE_NULL); - gst_object_unref(GST_OBJECT(iSelfUp->iPipelineRec)); - break; - } - case GST_MESSAGE_ERROR: - { - gchar *debug; - GError *err; - gst_message_parse_error(msg, &err, &debug); - g_free(debug); - g_print("Error: %s\n", err->message); - g_error_free(err); - break; - } - default: - { - break; - } - } - return ETrue; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::gst_initialize_record -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::gst_initialize_record() - { - TRACE_PRN_FN_ENT; - - gint err = KErrNone; - - // create a new bin to hold the elements - iPipelineRec = gst_pipeline_new("pipelineRec"); - iSource = gst_element_factory_make("devsoundsrc", "record_audio"); - iAppSink = gst_element_factory_make("appsink", "appsink"); - - if (!iSource || !iAppSink) - { - err = KErrNotFound; - TRACE_PRN_IF_ERR(err); - return err; - } - - iMaxBufLen = ConfigureMedia(iCodecID); - - GstCaps* caps = gst_caps_new_simple(iMediaType, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "signed", G_TYPE_BOOLEAN, TRUE, - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "rate", G_TYPE_INT, 8000, - "channels", G_TYPE_INT, 1, - NULL); - - iBusRec = gst_pipeline_get_bus(GST_PIPELINE(iPipelineRec)); - gst_bus_add_watch(iBusRec, (TMSIPUplink::bus_call), NULL); - gst_object_unref(iBusRec); - - // add objects to the main iPipelineRec - gst_bin_add_many(GST_BIN(iPipelineRec), iSource, iAppSink, NULL); - - // link the elements - gst_element_link_filtered(iSource, iAppSink, caps); - - g_object_set(G_OBJECT(iAppSink), - "max-buffers", 1, - "emit-signals", TRUE, - "sync", FALSE, - NULL); - - g_signal_connect(iAppSink, "new-buffer", - G_CALLBACK(cb_record_raw_handoff), - NULL); - - gst_app_sink_set_caps(GST_APP_SINK(iAppSink), caps); - gst_caps_unref(caps); - - //NOTE: d/s is not ready at this time to return true maxgain - TInt maxgain = 1; -#ifdef __WINSCW__ - maxgain = 64; -#endif //__WINSCW__ - g_object_set(G_OBJECT(iSource), - "blocksize", iMaxBufLen, - "gain", maxgain, -#ifndef __WINSCW__ - "priority", (gint)iPriority.iPriority, - "preference", (gint)iPriority.iPref, -#endif - NULL); - - err = SetCodecCi(); - //gst_element_set_state(iPipelineRec, GST_STATE_READY); - - TRACE_PRN_FN_EXT; - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::gst_record_raw -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::gst_record_raw() - { - // start recording - gst_element_set_state(iPipelineRec, GST_STATE_PLAYING); - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::TMSIPUplink -// Standard Constructor -// ----------------------------------------------------------------------------- -// -TMSIPUplink::TMSIPUplink() - { - iSelfUp = this; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::~TMSIPUplink -// Standard Constructor -// ----------------------------------------------------------------------------- -// -TMSIPUplink::~TMSIPUplink() - { - TRACE_PRN_FN_ENT; - - Stop(); - gst_object_unref(GST_OBJECT(iPipelineRec)); - gst_deinit(); - - delete iSpeechEncoderConfig; - delete iG711EncoderIntfc; - delete iG729EncoderIntfc; - delete iIlbcEncoderIntfc; - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::NewL -// Symbian two-phase constructor -// ----------------------------------------------------------------------------- -// -TMSIPUplink* TMSIPUplink::NewL(const guint32 codecID, - const TMMFPrioritySettings priority) - { - TMSIPUplink* self = new (ELeave) TMSIPUplink(); - CleanupStack::PushL(self); - self->ConstructL(codecID, priority); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::ConstructL -// Part two of Symbian two phase construction -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::ConstructL(const guint32 codecID, - const TMMFPrioritySettings priority) - { - TRACE_PRN_FN_ENT; - - iCodecID = codecID; - iPriority = priority; - // SetTime(); - gst_init(NULL, NULL); - // CalcLatency(); - // SetTime(); - gint err = gst_initialize_record(); - if (err != TMS_RESULT_SUCCESS) - { - User::Leave(err); - } - - // Client must set these before querying! - iG711EncodeMode = TMS_G711_CODEC_MODE_ALAW; - iILBCEncodeMode = TMS_ILBC_CODEC_MODE_20MS_FRAME; - // CalcLatency(); - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::Start -// -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::Start() - { - TRACE_PRN_FN_ENT; - - gst_record_raw(); - iStatus = EStreaming; - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::Stop -// -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::Stop() - { - TRACE_PRN_FN_ENT; - - if (iStatus == EStreaming) - { - if (iPipelineRec != NULL && - iPipelineRec->current_state == GST_STATE_PLAYING) - { - GstStateChangeReturn ret; - ret = gst_element_set_state(iPipelineRec, GST_STATE_NULL); - if (ret == GST_STATE_CHANGE_FAILURE) - { - ;// retry??? - //GST_STATE_CHANGE_SUCCESS - } - } - iStatus = EReady; - } - - if (gstUplBuffer) - { - gst_buffer_unref(gstUplBuffer); - } - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::BufferToBeEmptied -// From MDevSoundObserver -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::BufferToBeEmptied() - { - TInt buflen = GST_BUFFER_SIZE(gstUplBuffer); - TRACE_PRN_N1(_L("TMS->UPL: BTBE->LEN [%d]"), buflen); - - // Adjust/create RChunk if necessary - TInt err = DoChunk(buflen, iMsgBuffer); - - if (err != TMS_RESULT_SUCCESS) - { - Stop(); - iMsgBuffer.iStatus = err; - } - else - { - // Pass buffer parameters to the client - iMsgBuffer.iStatus = err; - iMsgBuffer.iInt = buflen; - - // Copy data over to RChunk - TPtr8 dataPtr(iChunk.Base(), buflen, iMaxBufLen); - dataPtr.Copy(GST_BUFFER_DATA(gstUplBuffer), buflen); - gst_buffer_unref(gstUplBuffer); - - //RDebug::RawPrint(dataPtr); - iStatus = EStreaming; - - // If chunk is opened, we will expect a call from the client to - // get chunk handle. When we get a call to copy chunk handle, - // check these variables and see if they match. This is not - // completely secure, but will provide some level of security. - if (iMsgBuffer.iBool == TRUE) - { - iWriteDataXferHndlToClient = TRUE; - iKey = iMsgBuffer.iUint32; - } - } - - // Notify client there is buffer ready to be emptied - iMsgBuffer.iRequest = ECmdEmptyBuffer; - err = iMsgQueue.Send(iMsgBuffer); - TRACE_PRN_IF_ERR(err); - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::BufferEmptied -// -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::BufferEmptied() - { - //TRACE_PRN_N(_L("TMS->UPL->BE")); - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetCodecCi -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::SetCodecCi() - { - TRAPD(err, SetCodecCiL()); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetCodecCiL -// -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::SetCodecCiL() - { - TRACE_PRN_FN_ENT; - - switch (iCodecID) - { - case KMccFourCCIdG711: - { - if (!iG711EncoderIntfc) - { - iG711EncoderIntfc = GST_G711_ENCODER_GET_IFACE(iSource); - } - break; - } - case KMccFourCCIdG729: - { - if (!iG729EncoderIntfc) - { - iG729EncoderIntfc = GST_G729_ENCODER_GET_IFACE(iSource); - } - break; - } - case KMccFourCCIdILBC: - { - if (!iIlbcEncoderIntfc) - { - iIlbcEncoderIntfc = GST_ILBC_ENCODER_GET_IFACE(iSource); - } - break; - } - case KMccFourCCIdAMRNB: - case KMMFFourCCCodePCM16: - { - break; - } - default: - { - User::Leave(TMS_RESULT_INVALID_ARGUMENT); - } - } - - if (!iSpeechEncoderConfig && iCodecID != KMMFFourCCCodePCM16) - { - iSpeechEncoderConfig = GST_SPEECH_ENCODER_CONFIG_GET_IFACE(iSource); - } - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetGain -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::SetGain(const guint gain) - { - g_object_set(G_OBJECT(iSource), "gain", gain, NULL); - TRACE_PRN_N1(_L("TMS->UPL: SetGain [%d]"), gain); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetGain -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetGain(guint& gain) - { - g_object_get(G_OBJECT(iSource), "gain", &gain, NULL); - TRACE_PRN_N1(_L("TMS->UPL: GetGain [%d]"), gain); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetMaxGain -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetMaxGain(guint& gain) - { - g_object_get(G_OBJECT(iSource), "maxgain", &gain, NULL); - TRACE_PRN_N1(_L("TMS->UPL: MaxGain [%d]"), gain); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetDataXferChunkHndl -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk) - { - gint status = TMS_RESULT_SUCCESS; - - if (iChunk.Handle()) - { - if (iWriteDataXferHndlToClient && (iKey == key)) - { - chunk = iChunk; - iWriteDataXferHndlToClient = FALSE; - iKey = 0; - } - else - { - status = TMS_RESULT_ILLEGAL_OPERATION; - } - } - - return status; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetIlbcCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::SetIlbcCodecMode(const gint mode) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - iILBCEncodeMode = mode; - - if (iIlbcEncoderIntfc && iCodecID == KMccFourCCIdILBC) - { - if (mode == TMS_ILBC_CODEC_MODE_20MS_FRAME) - { - err = iIlbcEncoderIntfc->SetEncoderMode(EIlbc20msFrame); - TRACE_PRN_N(_L("TMS->UPL: SetIlbcCodecMode [20ms Frame]")); - } - else if (mode == TMS_ILBC_CODEC_MODE_30MS_FRAME) - { - err = iIlbcEncoderIntfc->SetEncoderMode(EIlbc30msFrame); - TRACE_PRN_N(_L("TMS->UPL: SetIlbcCodecMode [30ms Frame]")); - } - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetIlbcCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetIlbcCodecMode(gint& mode) - { - // not available through CIs -> return cached value - mode = iILBCEncodeMode; - TRACE_PRN_N1(_L("TMS->UPL: GetIlbcCodecMode [%d]"), mode); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetG711CodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::SetG711CodecMode(const gint mode) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - iG711EncodeMode = mode; - - if (iG711EncoderIntfc && iCodecID == KMccFourCCIdG711) - { - if (mode == TMS_G711_CODEC_MODE_ALAW) - { - err = iG711EncoderIntfc->SetEncoderMode(EEncALaw); - TRACE_PRN_N(_L("TMS->UPL: SetG711CodecMode [ALaw]")); - } - else if (mode == TMS_G711_CODEC_MODE_MULAW) - { - err = iG711EncoderIntfc->SetEncoderMode(EEncULaw); - TRACE_PRN_N(_L("TMS->UPL: SetG711CodecMode [uLaw]")); - } - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetG711CodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetG711CodecMode(gint& mode) - { - // not available through CIs -> return cached value - mode = iG711EncodeMode; - TRACE_PRN_N1(_L("TMS->UPL: GetG711CodecMode [%d]"), mode); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetSupportedBitrates -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetSupportedBitrates(RArray& bitrates) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - bitrates.Reset(); - - if (iSpeechEncoderConfig) - { - gint i = 0; - GList* gbitrates = NULL; - // GList* walk; - err = iSpeechEncoderConfig->GetSupportedBitrates(&gbitrates); - - //TODO: try returning GList and do not convert to RArray - for (; gbitrates; gbitrates = g_list_next (gbitrates)) - { - // guint br = GPOINTER_TO_INT(gbitrates->data); - guint br = GPOINTER_TO_UINT(gbitrates->data); - bitrates.Append(br); - TRACE_PRN_N2(_L("TMS->UPL: GetSupportedBitrates %d:[%d]"), i+1, br); - i++; - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetBitrate -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::SetBitrate(guint bitrate) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iSpeechEncoderConfig) - { - err = iSpeechEncoderConfig->SetBitrate(bitrate); - TRACE_PRN_N1(_L("TMS->UPL: SetBitrate [%d]"), bitrate); - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetBitrate -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetBitrate(guint& bitrate) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iSpeechEncoderConfig) - { - err = iSpeechEncoderConfig->GetBitrate(&bitrate); - TRACE_PRN_N1(_L("TMS->UPL: GetBitrate [%d]"), bitrate); - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetVad -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::SetVad(const TMSFormatType fmttype, const gboolean vad) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - switch (fmttype) - { - case TMS_FORMAT_G711: - { - if (iG711EncoderIntfc) - { - err = iG711EncoderIntfc->SetVadMode(vad); - TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); - } - break; - } - case TMS_FORMAT_G729: - { - if (iG729EncoderIntfc) - { - err = iG729EncoderIntfc->SetVadMode(vad); - TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); - } - break; - } - case TMS_FORMAT_ILBC: - { - if (iIlbcEncoderIntfc) - { - err = iIlbcEncoderIntfc->SetVadMode(vad); - TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); - } - break; - } - case TMS_FORMAT_AMR: - { - if (iSpeechEncoderConfig) - { - err = iSpeechEncoderConfig->SetVadMode(vad); - TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); - } - break; - } - default: - { - break; //TMS_RESULT_DOES_NOT_EXIST - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetVad -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetVad(const TMSFormatType fmttype, gboolean& vad) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - switch (fmttype) - { - case TMS_FORMAT_G711: - { - if (iG711EncoderIntfc) - { - err = iG711EncoderIntfc->GetVadMode(&vad); - TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); - } - break; - } - case TMS_FORMAT_G729: - { - if (iG729EncoderIntfc) - { - err = iG729EncoderIntfc->GetVadMode(&vad); - TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); - } - break; - } - case TMS_FORMAT_ILBC: - { - if (iIlbcEncoderIntfc) - { - err = iIlbcEncoderIntfc->GetVadMode(&vad); - TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); - } - break; - } - case TMS_FORMAT_AMR: - { - if (iSpeechEncoderConfig) - { - err = iSpeechEncoderConfig->GetVadMode(&vad); - TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); - } - break; - } - default: - { - break; //TMS_RESULT_DOES_NOT_EXIST - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/ipcalluplinkds.cpp --- a/mmserv/tms/tmscallserver/src/ipcalluplinkds.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,690 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -#include -#include -#include -#include -#include -#include -#include "tmsutility.h" -#include "ipcallstream.h" - -using namespace TMS; - -// ----------------------------------------------------------------------------- -// TMSIPUplink::TMSIPUplink -// Standard Constructor -// ----------------------------------------------------------------------------- -// -TMSIPUplink::TMSIPUplink() - { - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::~TMSIPUplink -// Standard Constructor -// ----------------------------------------------------------------------------- -// -TMSIPUplink::~TMSIPUplink() - { - TRACE_PRN_FN_ENT; - - Stop(); - - delete iSpeechEncoderConfig; - delete iG711EncoderIntfc; - delete iG729EncoderIntfc; - delete iIlbcEncoderIntfc; - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::NewL -// Symbian two-phase constructor -// ----------------------------------------------------------------------------- -// -TMSIPUplink* TMSIPUplink::NewL(const guint32 codecID, - const TMMFPrioritySettings priority) - { - TMSIPUplink* self = new (ELeave) TMSIPUplink(); - CleanupStack::PushL(self); - self->ConstructL(codecID, priority); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::ConstructL -// Part two of Symbian two phase construction -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::ConstructL(const guint32 codecID, - const TMMFPrioritySettings priority) - { - TRACE_PRN_FN_ENT; - - iCodecID = codecID; - iPriority = priority; - - // Client must set these before querying! - iG711EncodeMode = TMS_G711_CODEC_MODE_ALAW; - iILBCEncodeMode = TMS_ILBC_CODEC_MODE_20MS_FRAME; - - TRAPD(err, InitDevSoundL(EMMFStateRecording, priority)); - if (err != TMS_RESULT_SUCCESS) - { - User::Leave(err); - } - - iMaxBufLen = ConfigureMedia(iCodecID); - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::Start -// -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::Start() - { - TRACE_PRN_FN_ENT; - - gint err = TMS_RESULT_ILLEGAL_OPERATION; - iWriteDataXferHndlToClient = FALSE; - - if (iStatus == EReady && iDevSound) - { - TRAP(err, iDevSound->RecordInitL()); - TRACE_PRN_IF_ERR(err); - - if (err != TMS_RESULT_SUCCESS) - { - //TODO: Notify main thread - iStatus = EReady; - } -#ifdef _DEBUG - else - { - iSamplesRecCount = 0; - } -#endif - } - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::Stop -// -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::Stop() - { - TRACE_PRN_FN_ENT; - - if (iStatus == EStreaming && iDevSound) - { - iDevSound->Stop(); - iStatus = EReady; - } - else - { - //TODO: Notify main thread - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::BufferToBeEmptied -// From MDevSoundObserver -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::BufferToBeEmptied(CMMFBuffer* aBuffer) - { - iDevSoundBufPtr = static_cast (aBuffer); - TDes8& data = iDevSoundBufPtr->Data(); - - iBufLen = iDevSoundBufPtr->BufferSize(); - TRACE_PRN_N1(_L("TMS->UPL: BTBE->LEN [%d]"), iBufLen); - - // Adjust/create RChunk if necessary - gint err = DoChunk(iBufLen, iMsgBuffer); - - if (err != TMS_RESULT_SUCCESS) - { - Stop(); - iMsgBuffer.iStatus = err; - } - else - { - // Pass buffer parameters to the client - iMsgBuffer.iStatus = err; - iMsgBuffer.iInt = iBufLen; - - // Copy data over to RChunk - TPtr8 dataPtr(iChunk.Base(), iBufLen, iBufLen); - dataPtr = data; - iStatus = EStreaming; - - // If chunk is opened, we will expect a call from the client to - // get chunk handle. When we get a call to copy chunk handle, - // check these variables and see if they match. This is not - // completely secure, but will provide some level of security. - if (iMsgBuffer.iBool == TRUE) - { - iWriteDataXferHndlToClient = TRUE; - iKey = iMsgBuffer.iUint32; - } - } - - // Notify client there is buffer ready to be emptied - iMsgBuffer.iRequest = ECmdEmptyBuffer; - err = iMsgQueue.Send(iMsgBuffer); - TRACE_PRN_IF_ERR(err); - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::BufferEmptied -// -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::BufferEmptied() - { - //TRACE_PRN_N(_L("TMS->UPL->BE")); - if (iDevSound) - { - iDevSound->RecordData(); - } - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetCodecCi -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::SetCodecCi() - { - TRAPD(err, SetCodecCiL()); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetCodecCiL -// -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::SetCodecCiL() - { - TRACE_PRN_FN_ENT; - - switch (iCodecID) - { - case KMccFourCCIdG711: - { - if (!iG711EncoderIntfc) - { - iG711EncoderIntfc = CG711EncoderIntfc::NewL(*iDevSound); - } - break; - } - case KMccFourCCIdG729: - { - if (!iG729EncoderIntfc) - { - iG729EncoderIntfc = CG729EncoderIntfc::NewL(*iDevSound); - } - break; - } - case KMccFourCCIdILBC: - { - if (!iIlbcEncoderIntfc) - { - iIlbcEncoderIntfc = CIlbcEncoderIntfc::NewL(*iDevSound); - } - break; - } - case KMccFourCCIdAMRNB: - case KMMFFourCCCodePCM16: - { - break; - } - default: - { - User::Leave(TMS_RESULT_INVALID_ARGUMENT); - break; - } - } - - if (!iSpeechEncoderConfig && iCodecID != KMMFFourCCCodePCM16) - { - iSpeechEncoderConfig = CSpeechEncoderConfig::NewL(*iDevSound); - } - - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetGain -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::SetGain(const guint gain) - { - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - if (iDevSound) - { - iDevSound->SetGain(gain); - status = TMS_RESULT_SUCCESS; - } - TRACE_PRN_N1(_L("TMS->UPL: SetGain [%d]"), gain); - return status; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetGain -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetGain(guint& gain) - { - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - if (iDevSound) - { - gain = iDevSound->Gain(); - status = TMS_RESULT_SUCCESS; - } - TRACE_PRN_N1(_L("TMS->UPL: GetGain [%d]"), gain); - return status; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetMaxGain -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetMaxGain(guint& gain) - { - gint status(TMS_RESULT_UNINITIALIZED_OBJECT); - if (iDevSound) - { - gain = iDevSound->MaxGain(); - status = TMS_RESULT_SUCCESS; - } - TRACE_PRN_N1(_L("TMS->UPL: MaxGain [%d]"), gain); - return status; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetDataXferChunkHndl -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk) - { - gint status = TMS_RESULT_SUCCESS; - - if (iChunk.Handle()) - { - if (iWriteDataXferHndlToClient && (iKey == key)) - { - chunk = iChunk; - iWriteDataXferHndlToClient = FALSE; - iKey = 0; - } - else - { - status = TMS_RESULT_ILLEGAL_OPERATION; - } - } - - return status; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetIlbcCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::SetIlbcCodecMode(const gint mode) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - iILBCEncodeMode = mode; - - if (iIlbcEncoderIntfc && iCodecID == KMccFourCCIdILBC) - { - if (mode == TMS_ILBC_CODEC_MODE_20MS_FRAME) - { - err = iIlbcEncoderIntfc->SetEncoderMode( - CIlbcEncoderIntfc::E20msFrame); - TRACE_PRN_N(_L("TMS->UPL: SetIlbcCodecMode [20ms Frame]")); - } - else if (mode == TMS_ILBC_CODEC_MODE_30MS_FRAME) - { - err = iIlbcEncoderIntfc->SetEncoderMode( - CIlbcEncoderIntfc::E30msFrame); - TRACE_PRN_N(_L("TMS->UPL: SetIlbcCodecMode [30ms Frame]")); - } - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetIlbcCodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetIlbcCodecMode(gint& mode) - { - // not available through CIs -> return cached value - mode = iILBCEncodeMode; - TRACE_PRN_N1(_L("TMS->UPL: GetIlbcCodecMode [%d]"), mode); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetG711CodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::SetG711CodecMode(const gint mode) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iStatus == EReady) - { - iG711EncodeMode = mode; - - if (iG711EncoderIntfc && iCodecID == KMccFourCCIdG711) - { - if (mode == TMS_G711_CODEC_MODE_ALAW) - { - err = iG711EncoderIntfc->SetEncoderMode( - CG711EncoderIntfc::EEncALaw); - TRACE_PRN_N(_L("TMS->UPL: SetG711CodecMode [ALaw]")); - } - else if (mode == TMS_G711_CODEC_MODE_MULAW) - { - err = iG711EncoderIntfc->SetEncoderMode( - CG711EncoderIntfc::EEncULaw); - TRACE_PRN_N(_L("TMS->UPL: SetG711CodecMode [uLaw]")); - } - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetG711CodecMode -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetG711CodecMode(gint& mode) - { - // not available through CIs -> return cached value - mode = iG711EncodeMode; - TRACE_PRN_N1(_L("TMS->UPL: GetG711CodecMode [%d]"), mode); - return TMS_RESULT_SUCCESS; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetSupportedBitrates -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetSupportedBitrates(RArray& bitrates) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - bitrates.Reset(); - - if (iSpeechEncoderConfig) - { - err = iSpeechEncoderConfig->GetSupportedBitrates(bitrates); - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetBitrate -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::SetBitrate(guint bitrate) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iSpeechEncoderConfig) - { - err = iSpeechEncoderConfig->SetBitrate(bitrate); - TRACE_PRN_N1(_L("TMS->UPL: SetBitrate [%d]"), bitrate); - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetBitrate -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetBitrate(guint& bitrate) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - if (iSpeechEncoderConfig) - { - err = iSpeechEncoderConfig->GetBitrate(bitrate); - TRACE_PRN_N1(_L("TMS->UPL: GetBitrate [%d]"), bitrate); - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::SetVad -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::SetVad(const TMSFormatType fmttype, const gboolean vad) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - switch (fmttype) - { - case TMS_FORMAT_G711: - { - if (iG711EncoderIntfc) - { - err = iG711EncoderIntfc->SetVadMode(vad); - TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); - } - break; - } - case TMS_FORMAT_G729: - { - if (iG729EncoderIntfc) - { - err = iG729EncoderIntfc->SetVadMode(vad); - TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); - } - break; - } - case TMS_FORMAT_ILBC: - { - if (iIlbcEncoderIntfc) - { - err = iIlbcEncoderIntfc->SetVadMode(vad); - TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); - } - break; - } - case TMS_FORMAT_AMR: - { - if (iSpeechEncoderConfig) - { - err = iSpeechEncoderConfig->SetVadMode(vad); - TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); - } - break; - } - default: - { - break; //TMS_RESULT_DOES_NOT_EXIST - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::GetVad -// -// ----------------------------------------------------------------------------- -// -gint TMSIPUplink::GetVad(const TMSFormatType fmttype, gboolean& vad) - { - gint err = TMS_RESULT_DOES_NOT_EXIST; - - switch (fmttype) - { - case TMS_FORMAT_G711: - { - if (iG711EncoderIntfc) - { - err = iG711EncoderIntfc->GetVadMode(vad); - TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); - } - break; - } - case TMS_FORMAT_G729: - { - if (iG729EncoderIntfc) - { - err = iG729EncoderIntfc->GetVadMode(vad); - TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); - } - break; - } - case TMS_FORMAT_ILBC: - { - if (iIlbcEncoderIntfc) - { - err = iIlbcEncoderIntfc->GetVadMode(vad); - TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); - } - break; - } - case TMS_FORMAT_AMR: - { - if (iSpeechEncoderConfig) - { - err = iSpeechEncoderConfig->GetVadMode(vad); - TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); - } - break; - } - default: - { - break; //TMS_RESULT_DOES_NOT_EXIST - } - } - - TRACE_PRN_IF_ERR(err); - return err; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::InitializeComplete -// A callback from the DevSound indicating completion of the initialization. -// It will send config data to the D/S and configure the encoder via CI. -// If everything goes well, the state of the thread is set EReady. -// The initialization completion message is sent back to the main thread. -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::InitializeComplete(TInt aError) - { - TRACE_PRN_FN_ENT; - - gint err = aError; - - if (err == TMS_RESULT_SUCCESS && iDevSound) - { - TMMFCapabilities conf; - conf = iDevSound->Config(); - conf.iRate = EMMFSampleRate8000Hz; - conf.iChannels = EMMFMono; - TRAP(err, iDevSound->SetConfigL(conf)); - if (err == TMS_RESULT_SUCCESS) - { - // We are ready to stream even in case of CI setting failure - iStatus = EReady; - iMaxGain = iDevSound->MaxGain(); - } - - // Init Custom Interface API to the Encoder - err = SetCodecCi(); - if (err != TMS_RESULT_SUCCESS) - { - // DEBUG only - // Can ignore error - although encoder is not fully configured but - // it can still run in the default mode. - TRACE_PRN_IF_ERR(err); - } - } - - // TODO: Notify client - - TRACE_PRN_IF_ERR(err); - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSIPUplink::RecordError -// From MDevSoundObserver -// Recording error is send to the main thread. -// The state of recorder is rolled back to EReady. -// ----------------------------------------------------------------------------- -// -void TMSIPUplink::RecordError(TInt /*aError*/) - { - //TRACE_PRN_IF_ERR(aError); - -#ifdef _DEBUG - iSamplesRecCount = 0; -#endif - iStatus = EReady; - - // TODO: Notify client - } - -// End of file - diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tarsettings.cpp --- a/mmserv/tms/tmscallserver/src/tarsettings.cpp Fri Apr 16 15:29:42 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Telephony Multimedia Service - * - */ - -// INCLUDE FILES -#include "tarsettings.h" -#include "tmsclientserver.h" -#include "tmsutility.h" - -using namespace TMS; - -// CONSTANTS -_LIT_SECURITY_POLICY_PASS(KTMSServerReadPolicy); -_LIT_SECURITY_POLICY_C1(KTMSServerWritePolicy, ECapabilityWriteUserData); - -// ----------------------------------------------------------------------------- -// TMSTarSettings::TMSTarSettings -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -TMSTarSettings::TMSTarSettings() - { - } - -// ----------------------------------------------------------------------------- -// TMSTarSettings::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void TMSTarSettings::ConstructL() - { - TRACE_PRN_FN_ENT; - TInt err = RProperty::Define(ERoutingPs, RProperty::EByteArray, - KTMSServerReadPolicy, KTMSServerWritePolicy); - TRACE_PRN_N1(_L("TarSetting::ConstructL err:%d"),err); - - if (err != KErrAlreadyExists) - { - User::LeaveIfError(err); - } - TRACE_PRN_FN_EXT; - } - -// ----------------------------------------------------------------------------- -// TMSTarSettings::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -TMSTarSettings* TMSTarSettings::NewL() - { - TMSTarSettings* self = new (ELeave) TMSTarSettings(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// Destructor -TMSTarSettings::~TMSTarSettings() - { - TRACE_PRN_FN_ENT; - TInt err = RProperty::Delete(KTMSPropertyCategory, ERoutingPs); - TRACE_PRN_N1(_L("TarSetting::~TMSTarSettings err:%d"),err); - TRACE_PRN_FN_ENT; - } - -// ----------------------------------------------------------------------------- -// TMSTarSettings::SetVolume -// ----------------------------------------------------------------------------- -// -void TMSTarSettings::SetTar(TRoutingMsgBufPckg rountingpckg, TBool aPublish) - { - TRACE_PRN_FN_ENT; - // TInt err(KErrNone); - if (aPublish) - { - /*err =*/RProperty::Set(KTMSPropertyCategory, ERoutingPs, rountingpckg); - } - - //TRACE_PRN_N1(_L("TarSetting::SetTar err:%d"),err); - TRACE_PRN_FN_EXT; - } - -// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmscalladpt.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmscalladpt.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include "tmscallipadpt.h" +#include "tmscallcsadpt.h" +#include "tmscalladpt.h" +#include "tmsutility.h" + +using namespace TMS; + +// ----------------------------------------------------------------------------- +// TMSCallAdpt::TMSCallAdpt +// +// ----------------------------------------------------------------------------- +// +TMSCallAdpt::TMSCallAdpt() + { + TRACE_PRN_FN_ENT; + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallAdpt::~TMSCallAdpt +// +// ----------------------------------------------------------------------------- +// +TMSCallAdpt::~TMSCallAdpt() + { + TRACE_PRN_FN_ENT; + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallAdpt::CreateCallL +// +// ----------------------------------------------------------------------------- +// +gint TMSCallAdpt::CreateCallL(gint callType, TMSCallAdpt*& callAdpt) + { + TRACE_PRN_FN_ENT; + TMSCallAdpt* self(NULL); + gint retVal(TMS_RESULT_SUCCESS); + switch (callType) + { + case TMS_CALL_IP: + retVal = TMS_RESULT_INSUFFICIENT_MEMORY; + self = TMSCallIPAdpt::NewL(); + if (self) + { + retVal = self->PostConstruct(); + if (retVal != TMS_RESULT_SUCCESS) + { + delete self; + self = NULL; + } + } + break; + + case TMS_CALL_CS: + retVal = TMS_RESULT_INSUFFICIENT_MEMORY; + self = new TMSCallCSAdpt(); + if (self) + { + retVal = self->PostConstruct(); + if (retVal != TMS_RESULT_SUCCESS) + { + delete self; + self = NULL; + } + } + break; + default: + retVal = TMS_RESULT_CALL_TYPE_NOT_SUPPORTED; + break; + } + callAdpt = self; + TRACE_PRN_FN_EXT; + return retVal; + } + +// ----------------------------------------------------------------------------- +// TMSCallAdpt::PostConstruct +// +// ----------------------------------------------------------------------------- +// +gint TMSCallAdpt::PostConstruct() + { + return TMS_RESULT_SUCCESS; + } + +// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmscallcsadpt.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmscallcsadpt.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,1277 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include +#include +#include +#include "tmscsuplink.h" +#include "tmscsdownlink.h" +#include "tmscallcsadpt.h" +#include "tmsutility.h" +#include "tmsshared.h" +#include "tmsclientserver.h" +#include "tmstarsettings.h" +#include "tmsdtmftoneplayer.h" +#include "tmsdtmfprovider.h" +#include "tmsdtmfnotifier.h" + +using namespace TMS; + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::TMSCallCSAdpt +// +// ----------------------------------------------------------------------------- +// +TMSCallCSAdpt::TMSCallCSAdpt() + { + TRACE_PRN_FN_ENT; + + iCSDownlink = NULL; + iCSUplink = NULL; + iRouting = NULL; + iTarSettings = NULL; + iDTMFDnlinkPlayer = NULL; + iDTMFUplinkPlayer = NULL; + iDTMFNotifier = NULL; + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::~TMSCallCSAdpt +// +// ----------------------------------------------------------------------------- +// +TMSCallCSAdpt::~TMSCallCSAdpt() + { + TRACE_PRN_FN_ENT; + delete iCSDownlink; + delete iCSUplink; + delete iRouting; + delete iTarSettings; + delete iDTMFDnlinkPlayer; + delete iDTMFUplinkPlayer; + delete iDTMFNotifier; + + if (iMsgQueueUp.Handle() > 0) + { + iMsgQueueUp.Close(); + } + + if (iMsgQueueDn.Handle() > 0) + { + iMsgQueueDn.Close(); + } + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::PostConstruct +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::PostConstruct() + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + iNextStreamId = 1; + iUplinkInitialized = FALSE; + iDnlinkInitialized = FALSE; + + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::CreateStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::CreateStream(TMSCallType /*callType*/, + TMSStreamType strmType, gint& outStrmId) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + switch (strmType) + { + case TMS_STREAM_UPLINK: + status = TMS_RESULT_ALREADY_EXIST; + if (!iUplinkInitialized) + { + iUplinkInitialized = TRUE; + iUplinkStreamId = iNextStreamId; + outStrmId = iUplinkStreamId; + iNextStreamId++; + iUplinkInitialized = TRUE; + status = TMS_RESULT_SUCCESS; + } + break; + case TMS_STREAM_DOWNLINK: + status = TMS_RESULT_ALREADY_EXIST; + if (!iDnlinkInitialized) + { + iDnlinkInitialized = TRUE; + iDnlinkStreamId = iNextStreamId; + outStrmId = iDnlinkStreamId; + iNextStreamId++; + iDnlinkInitialized = TRUE; + status = TMS_RESULT_SUCCESS; + } + break; + default: + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::InitStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::InitStreamL(TMSCallType /*callType*/, + TMSStreamType strmType, gint strmId, TMSFormatType /*frmtType*/, + const RMessage2& aMessage) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + + switch (strmType) + { + case TMS_STREAM_UPLINK: + if (strmId == iUplinkStreamId) + { + // Open message queue handling client-server communication + if (iMsgQueueUp.Handle() <= 0) + { + // Third argument in TMSCallProxy::InitStream + status = iMsgQueueUp.Open(aMessage, 1); + } + if (status == TMS_RESULT_SUCCESS) + { + TRAP(status, iCSUplink = TMSCSUplink::NewL(*this)); + + if (status == TMS_RESULT_SUCCESS) + { + iDTMFUplinkPlayer = TMSDTMFProvider::NewL(); + iDTMFUplinkPlayer->AddObserverL(*this); + if(!iDTMFNotifier) + { + iDTMFNotifier = TMSDtmfNotifier::NewL(); + } + } + } + iStrmtype = TMS_STREAM_UPLINK; + } + else + { + status = TMS_RESULT_DOES_NOT_EXIST; + } + break; + case TMS_STREAM_DOWNLINK: + if (strmId == iDnlinkStreamId) + { + // Open message queue handling client-server communication + if (iMsgQueueDn.Handle() <= 0) + { + // Third argument in TMSCallProxy::InitStream + status = iMsgQueueDn.Open(aMessage, 1); + } + if (status == TMS_RESULT_SUCCESS) + { + TRAP(status, iCSDownlink = TMSCSDownlink::NewL(*this)); + if (status == TMS_RESULT_SUCCESS) + { + TRAP(status, iRouting = + CTelephonyAudioRouting::NewL(*this)); + if (status == TMS_RESULT_SUCCESS) + { + iTarSettings = TMSTarSettings::NewL(); + } + if (status == TMS_RESULT_SUCCESS) + { + TRAP(status, iDTMFDnlinkPlayer = + TMSAudioDtmfTonePlayer::NewL(*this, + KAudioPrefKeyDownDTMF, + KAudioPriorityDtmfKeyPress)); + if(!iDTMFNotifier) + { + iDTMFNotifier = TMSDtmfNotifier::NewL(); + } + } + } + } + iStrmtype = TMS_STREAM_DOWNLINK; + } + else + { + status = TMS_RESULT_DOES_NOT_EXIST; + } + break; + default: + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + + TRACE_PRN_IF_ERR(status); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::StartStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::StartStream(TMSCallType /*callType*/, + TMSStreamType strmType, gint strmId) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + switch (strmType) + { + case TMS_STREAM_UPLINK: + if (iCSUplink && strmId == iUplinkStreamId) + { + iCSUplink->Activate(); + } + break; + case TMS_STREAM_DOWNLINK: + if (iCSDownlink && strmId == iDnlinkStreamId) + { + iCSDownlink->Activate(); + } + break; + default: + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::PauseStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::PauseStream(TMSCallType /*callType*/, + TMSStreamType /*strmType*/, gint /*strmId*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::StopStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::StopStream(TMSCallType /*callType*/, TMSStreamType strmType, + gint strmId) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + switch (strmType) + { + case TMS_STREAM_UPLINK: + if (iCSUplink && strmId == iUplinkStreamId) + { + iCSUplink->Deactivate(); + NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, + status, 0); + } + break; + case TMS_STREAM_DOWNLINK: + if (iCSDownlink && strmId == iDnlinkStreamId) + { + iCSDownlink->Deactivate(); + NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, + status, 0); + } + break; + default: + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::DeinitStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::DeinitStream(TMSCallType /*callType*/, + TMSStreamType strmType, gint strmId) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + switch (strmType) + { + case TMS_STREAM_UPLINK: + if (iCSUplink && strmId == iUplinkStreamId) + { + iCSUplink->Deactivate(); + iUplinkInitialized = FALSE; + NotifyClient(iUplinkStreamId, ECmdUplinkDeInitComplete, + status, 0); + } + break; + case TMS_STREAM_DOWNLINK: + if (iCSDownlink && strmId == iDnlinkStreamId) + { + iCSDownlink->Deactivate(); + iDnlinkInitialized = FALSE; + NotifyClient(iDnlinkStreamId, ECmdDownlinkDeInitComplete, + status, 0); + } + break; + default: + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::DeleteStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::DeleteStream(TMSCallType /*callType*/, + TMSStreamType strmType, gint strmId) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + switch (strmType) + { + case TMS_STREAM_UPLINK: + if (strmId == iUplinkStreamId) + { + iUplinkStreamId = -1; + iUplinkInitialized = FALSE; + } + break; + case TMS_STREAM_DOWNLINK: + if (strmId == iDnlinkStreamId) + { + iDnlinkStreamId = -1; + iDnlinkInitialized = FALSE; + } + break; + default: + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::DataXferBufferEmptied +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::DataXferBufferEmptied(TMSCallType /*callType*/, + TMSStreamType /*strmType*/, gint /*strmId*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::DataXferBufferFilled +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::DataXferBufferFilled(TMSCallType /*callType*/, + TMSStreamType /*strmType*/, gint /*strmId*/, guint /*datasize*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetDataXferBufferHndl +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetDataXferBufferHndl(const TMSCallType /*callType*/, + const TMSStreamType /*strmType*/, const gint /*strmId*/, + const guint32 /*key*/, RChunk& /*chunk*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetMaxVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetMaxVolume(guint& volume) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_ILLEGAL_OPERATION); + if (iCSDownlink && iDnlinkInitialized) + { + volume = iCSDownlink->MaxVolume(); + status = TMS_RESULT_SUCCESS; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::SetVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::SetVolume(const guint volume) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_ILLEGAL_OPERATION); + if (iCSDownlink && iDnlinkInitialized) + { + iCSDownlink->SetVolume(volume); + status = TMS_RESULT_SUCCESS; + NotifyClient(iDnlinkStreamId, ECmdSetVolume, status, 0); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetVolume(guint& volume) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_ILLEGAL_OPERATION); + if (iCSDownlink && iDnlinkInitialized) + { + volume = iCSDownlink->Volume(); + status = TMS_RESULT_SUCCESS; + } + + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetMaxGain +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetMaxGain(guint& gain) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_ILLEGAL_OPERATION); + if (iCSUplink && iUplinkInitialized) + { + gain = iCSUplink->MaxGain(); + status = TMS_RESULT_SUCCESS; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::SetGain +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::SetGain(const guint gain) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_ILLEGAL_OPERATION); + if (iUplinkInitialized) + { + iCSUplink->SetGain(gain); + status = TMS_RESULT_SUCCESS; + NotifyClient(iUplinkInitialized, ECmdSetGain, status, 0); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetGain +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetGain(guint& gain) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_ILLEGAL_OPERATION); + if (iCSUplink && iUplinkInitialized) + { + gain = iCSUplink->Gain(); + status = TMS_RESULT_SUCCESS; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetGlobalMaxVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetGlobalMaxVolume(guint& volume) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_ILLEGAL_OPERATION); + if (iCSDownlink && iDnlinkInitialized) + { + volume = iCSDownlink->MaxVolume(); + status = TMS_RESULT_SUCCESS; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::SetGlobalVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::SetGlobalVolume(const guint volume) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + + iGlobalVol = volume; + if (iCSDownlink && iDnlinkInitialized) + { + iCSDownlink->SetVolume(volume); + status = TMS_RESULT_SUCCESS; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetGlobalVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetGlobalVolume(guint& volume) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_ILLEGAL_OPERATION); + if (iCSDownlink && iDnlinkInitialized) + { + volume = iCSDownlink->Volume(); + status = TMS_RESULT_SUCCESS; + } + + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetMaxGain +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetGlobalMaxGain(guint& gain) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_ILLEGAL_OPERATION); + if (iCSUplink && iUplinkInitialized) + { + gain = iCSUplink->MaxGain(); + status = TMS_RESULT_SUCCESS; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::SetGain +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::SetGlobalGain(const guint gain) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + + iGlobalGain = gain; + if (iCSUplink && iUplinkInitialized) + { + iCSUplink->SetGain(gain); + status = TMS_RESULT_SUCCESS; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetGlobalGain +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetGlobalGain(guint& gain) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_ILLEGAL_OPERATION); + if (iCSUplink && iUplinkInitialized) + { + gain = iCSUplink->Gain(); + status = TMS_RESULT_SUCCESS; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetCodecMode(const TMSFormatType /*fmttype*/, + const TMSStreamType /*strmtype*/, gint& /*mode*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::SetCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::SetCodecMode(const TMSFormatType /*fmttype*/, + const TMSStreamType /*strmtype*/, const gint /*mode*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetSupportedBitRatesCount +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetSupportedBitRatesCount(guint& /*count*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetSupportedBitRates +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetSupportedBitRates(CBufFlat*& brbuffer) + { + TRACE_PRN_FN_ENT; + TRAPD(status, GetSupportedBitRatesL(brbuffer)); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetSupportedBitRatesL +// +// GetSupportedBitRates implementation which can leave. +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::GetSupportedBitRatesL(CBufFlat*& /*brbuffer*/) + { + User::Leave(TMS_RESULT_FEATURE_NOT_SUPPORTED); + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetBitRate +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetBitRate(guint& /*bitrate*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::SetBitRate +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::SetBitRate(const guint /*bitrate*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetVAD +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetVAD(const TMSFormatType /*fmttype*/, gboolean& /*vad*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::SetVAD +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::SetVAD(const TMSFormatType /*fmttype*/, const gboolean /*vad*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetCNG +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetCNG(const TMSFormatType /*fmttype*/, gboolean& /*cng*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::SetCNG +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::SetCNG(const TMSFormatType /*fmttype*/, + const gboolean /*cng*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetPlc +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetPlc(const TMSFormatType /*fmttype*/, gboolean& /*plc*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::SetPlc +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::SetPlc(const TMSFormatType /*fmttype*/, + const gboolean /*plc*/) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::SetOutput +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::SetOutput(TMSAudioOutput output) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + + if (iRouting) + { + CTelephonyAudioRouting::TAudioOutput taroutput = TOTAROUTPUT(output); + TRAP(status, iRouting->SetOutputL(taroutput)); + if (status == KErrArgument) + { + status = TMS_RESULT_INVALID_ARGUMENT; + } + else + { + status = TMS_RESULT_SUCCESS; + } + } + + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetOutput +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetOutput(TMSAudioOutput& output) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + + if (iRouting) + { + CTelephonyAudioRouting::TAudioOutput taroutput; + taroutput = iRouting->Output(); + status = TMS_RESULT_SUCCESS; + output = TOTMSOUTPUT(taroutput); + } + + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetPreviousOutput +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetPreviousOutput(TMSAudioOutput& output) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + + if (iRouting) + { + CTelephonyAudioRouting::TAudioOutput taroutput; + taroutput = iRouting->PreviousOutput(); + status = TMS_RESULT_SUCCESS; + output = TOTMSOUTPUT(taroutput); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::GetAvailableOutputsL +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuffer) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + TMSAudioOutput tmsoutput; + + if (iRouting) + { + RBufWriteStream stream; + stream.Open(*outputsbuffer); + CleanupClosePushL(stream); + + TArray availableOutputs = + iRouting->AvailableOutputs(); + + guint numOfItems = availableOutputs.Count(); + count = numOfItems; + for (guint i = 0; i < numOfItems; i++) + { + tmsoutput = TOTMSOUTPUT(availableOutputs[i]); + stream.WriteUint32L(tmsoutput); + //TRACE_PRN_N1(_L("TMS->CallIPAdpt: outputs: [%d]"), availableOutputs[i]); + } + + CleanupStack::PopAndDestroy(&stream); + status = TMS_RESULT_SUCCESS; + } + + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::StartDTMF +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::StartDTMF(TMSStreamType strmtype, TDes& dtmfstring) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + + TmsMsgBufPckg dtmfpckg; + + if (strmtype == TMS_STREAM_DOWNLINK && iDnlinkInitialized) + { + if (iDTMFDnlinkPlayer) + { + iDTMFDnlinkPlayer->PlayDtmfTone(dtmfstring); + } + + dtmfpckg().iStatus = TMS_RESULT_SUCCESS; + //TMS_EVENT_DTMF_TONE_STARTED; + dtmfpckg().iRequest = ECmdDTMFOpenDnlinkComplete; + if (iDTMFNotifier) + { + iDTMFNotifier->SetDtmf(dtmfpckg, TRUE); + } + } + else if (strmtype == TMS_STREAM_UPLINK && iUplinkInitialized) + { + //use etel for uplink + if (iDTMFUplinkPlayer) + { + status = iDTMFUplinkPlayer->SendDtmfToneString(dtmfstring); + } + + dtmfpckg().iStatus = TMSUtility::EtelToTMSResult(status); + //TMS_EVENT_DTMF_TONE_STARTED; + dtmfpckg().iRequest = ECmdDTMFOpenUplinkComplete; + + if (iDTMFNotifier) + { + iDTMFNotifier->SetDtmf(dtmfpckg, TRUE); + } + } + + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::StopDTMF +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::StopDTMF(TMSStreamType streamtype) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + + if (streamtype == TMS_STREAM_DOWNLINK && iDTMFDnlinkPlayer) + { + iDTMFDnlinkPlayer->Cancel(); + } + else if (streamtype == TMS_STREAM_UPLINK && iDTMFUplinkPlayer) + { + status = iDTMFUplinkPlayer->StopDtmfTone(); + status = TMSUtility::EtelToTMSResult(status); + } + + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::ContinueDTMF +// +// ----------------------------------------------------------------------------- +// +gint TMSCallCSAdpt::ContinueDTMF(TBool continuesending) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + + if (iDTMFUplinkPlayer) + { + status = iDTMFUplinkPlayer->ContinueDtmfStringSending(continuesending); + status = TMSUtility::EtelToTMSResult(status); + } + + TRACE_PRN_FN_EXT; + return status; + } + +//From DTMFTonePlayerObserver +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::DTMFInitCompleted +// +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::DTMFInitCompleted(TInt /*error*/) + { + TRACE_PRN_FN_ENT; + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::DTMFToneFinished +// +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::DTMFToneFinished(TInt error) + { + TRACE_PRN_FN_ENT; + TmsMsgBufPckg dtmfpckg; + + if (error == KErrUnderflow || error == KErrInUse) + { + error = TMS_RESULT_SUCCESS; + } + + dtmfpckg().iStatus = TMSUtility::TMSResult(error); + //TMS_EVENT_DTMF_TONE_STOPPED + dtmfpckg().iRequest = ECmdDTMFTonePlayFinished; + if (iDTMFNotifier) + { + iDTMFNotifier->SetDtmf(dtmfpckg, TRUE); + } + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::HandleDTMFEvent +// +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::HandleDTMFEvent( + const TMSDTMFObserver::TCCPDtmfEvent aEvent, const TInt aError, + const TChar /*aTone*/) + { + TRACE_PRN_FN_ENT; + TmsMsgBufPckg dtmfpckg; + + TRACE_PRN_N1(_L("**TMS TMSCallCSAdpt::HandleDTMFEvent error:%d"),aError); + + dtmfpckg().iStatus = TMSUtility::EtelToTMSResult(aError); + + switch (aEvent) + { + /** Unknown */ + case ECCPDtmfUnknown: + break; + /** DTMF sending started manually */ + case ECCPDtmfManualStart: + /** Automatic DTMF sending initialized */ + case ECCPDtmfSequenceStart: + //TMS_EVENT_DTMF_TONE_STARTED + dtmfpckg().iRequest = ECmdDTMFOpenUplinkComplete; + break; + + /** DTMF sending stopped manually */ + case ECCPDtmfManualStop: + //break; + /** DTMF sending aborted manually */ + case ECCPDtmfManualAbort: + //break; + /** Automatic DTMF sending stopped */ + case ECCPDtmfSequenceStop: + //break; + /** Automatic DTMF sending aborted */ + case ECCPDtmfSequenceAbort: + //break; + /** There was stop mark in DTMF string */ + case ECCPDtmfStopInDtmfString: + //break; + /** DTMF sending completed succesfully */ + case ECCPDtmfStringSendingCompleted: + //TMS_EVENT_DTMF_TONE_STOPPED + dtmfpckg().iRequest = ECmdDTMFTonePlayFinished; + break; + default: + break; + } + + if (iDTMFNotifier) + { + iDTMFNotifier->SetDtmf(dtmfpckg, TRUE); + } + TRACE_PRN_FN_EXT; + } + +// From TMSCSPDevSoundObserver + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::DownlinkInitCompleted +// +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::DownlinkInitCompleted(TInt status) + { + TRACE_PRN_FN_ENT; + NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status, 0); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::UplinkInitCompleted +// +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::UplinkInitCompleted(TInt status) + { + TRACE_PRN_FN_ENT; + NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status, 0); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::UplinkActivatedSuccessfully +// +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::UplinkActivatedSuccessfully() + { + TRACE_PRN_FN_ENT; + NotifyClient(iUplinkStreamId, ECmdUplinkStarted, KErrNone, 0); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::DownlinkActivatedSuccessfully +// +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::DownlinkActivatedSuccessfully() + { + TRACE_PRN_FN_ENT; + NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, KErrNone, 0); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::UplinkActivationFailed +// +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::UplinkActivationFailed() + { + TRACE_PRN_FN_ENT; + NotifyClient(iUplinkStreamId, ECmdUplinkStarted, TMS_RESULT_FATAL_ERROR, 0); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::DownlinkActivationFailed +// +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::DownlinkActivationFailed() + { + TRACE_PRN_FN_ENT; + NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, + TMS_RESULT_FATAL_ERROR, 0); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::AvailableOutputsChanged +// +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::AvailableOutputsChanged( + CTelephonyAudioRouting& /*aTelephonyAudioRouting*/) + { + TRACE_PRN_FN_ENT; + TRoutingMsgBufPckg pckg; + pckg().iEvent = TMS_EVENT_ROUTING_AVAIL_OUTPUTS_CHANGED; + iTarSettings->SetTar(pckg, ETrue); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::OutputChanged +// +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::OutputChanged( + CTelephonyAudioRouting& aTelephonyAudioRouting) + { + TRACE_PRN_FN_ENT; + TRoutingMsgBufPckg pckg; + pckg().iEvent = TMS_EVENT_ROUTING_OUTPUT_CHANGED; + pckg().iOutput = TOTMSOUTPUT(aTelephonyAudioRouting.Output()); + iTarSettings->SetTar(pckg, ETrue); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::SetOutputComplete +// +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::SetOutputComplete( + CTelephonyAudioRouting& aTelephonyAudioRouting, gint /*aError*/) + { + TRACE_PRN_FN_ENT; + TRoutingMsgBufPckg pckg; + pckg().iEvent = TMS_EVENT_ROUTING_SET_OUTPUT_COMPLETE; + pckg().iOutput = TOTMSOUTPUT(aTelephonyAudioRouting.Output()); + if (iTarSettings) + { + iTarSettings->SetTar(pckg, ETrue); + } + //TRACE_PRN_IF_ERR(aError); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallCSAdpt::NotifyClient +// +// ----------------------------------------------------------------------------- +// +void TMSCallCSAdpt::NotifyClient(const gint strmId, const gint aCommand, + const gint aStatus, const gint64 /*aInt64*/) + { + iMsgBuffer.iRequest = aCommand; + iMsgBuffer.iStatus = aStatus; + + if (strmId == iUplinkStreamId) + { + iMsgQueueUp.Send(iMsgBuffer); + } + else if (strmId == iDnlinkStreamId) + { + iMsgQueueDn.Send(iMsgBuffer); + } + } + +// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmscallipadpt.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmscallipadpt.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,1536 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include "tmsutility.h" +#include "tmsclientserver.h" +#include "tmsshared.h" +#include "tmsipcallstream.h" +#include "tmscallipadpt.h" + +using namespace TMS; + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::NewL +// Symbian constructor. +// ----------------------------------------------------------------------------- +// +TMSCallIPAdpt* TMSCallIPAdpt::NewL() + { + TMSCallIPAdpt* self = new (ELeave) TMSCallIPAdpt(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::ConstructL +// 2-nd phase constructor. +// ----------------------------------------------------------------------------- +// +void TMSCallIPAdpt::ConstructL() + { + TRACE_PRN_FN_ENT; + iIPUplink = NULL; + iIPDownlink = NULL; + iDTMFDnlinkPlayer = NULL; + iDTMFUplinkPlayer = NULL; + iDTMFNotifier = NULL; + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::TMSCallIPAdpt +// +// ----------------------------------------------------------------------------- +// +TMSCallIPAdpt::TMSCallIPAdpt() + { + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::~TMSCallIPAdpt +// +// ----------------------------------------------------------------------------- +// +TMSCallIPAdpt::~TMSCallIPAdpt() + { + TRACE_PRN_FN_ENT; + + iCodecs.Reset(); + iCodecs.Close(); + iArrBitrates.Reset(); + delete iDTMFUplinkPlayer; + delete iDTMFDnlinkPlayer; + delete iDTMFNotifier; + delete iIPUplink; + delete iIPDownlink; + + if (iMsgQueueUp.Handle() > 0) + { + iMsgQueueUp.Close(); + } + if (iMsgQueueDn.Handle() > 0) + { + iMsgQueueDn.Close(); + } + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::PostConstruct +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::PostConstruct() + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + iNextStreamId = 1; + iUplinkInitialized = FALSE; + iDnlinkInitialized = FALSE; + + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::CreateStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::CreateStream(TMSCallType /*callType*/, + TMSStreamType strmType, gint& outStrmId) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + switch (strmType) + { + case TMS_STREAM_UPLINK: + { + status = TMS_RESULT_ALREADY_EXIST; + if (!iUplinkInitialized) + { + iUplinkInitialized = TRUE; + iUplinkStreamId = iNextStreamId; + outStrmId = iUplinkStreamId; + iNextStreamId++; + status = TMS_RESULT_SUCCESS; + } + break; + } + case TMS_STREAM_DOWNLINK: + { + status = TMS_RESULT_ALREADY_EXIST; + if (!iDnlinkInitialized) + { + iDnlinkInitialized = TRUE; + iDnlinkStreamId = iNextStreamId; + outStrmId = iDnlinkStreamId; + iNextStreamId++; + status = TMS_RESULT_SUCCESS; + } + break; + } + default: + { + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::InitStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::InitStreamL(TMSCallType /*callType*/, + TMSStreamType strmType, gint strmId, TMSFormatType frmtType, + const RMessage2& aMessage) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + + TUint32 fourCC = TOFOURCC(frmtType); + if (fourCC == NULL) + { + return TMS_RESULT_INVALID_ARGUMENT; + } + + switch (strmType) + { + case TMS_STREAM_UPLINK: + { + status = TMS_RESULT_DOES_NOT_EXIST; + if (strmId == iUplinkStreamId) + { + SetFormat(iUplinkStreamId, fourCC); + status = OpenUplinkL(aMessage); + + iDTMFUplinkPlayer = TMSAudioDtmfTonePlayer::NewL(*this, + KAudioPrefUnknownVoipAudioUplink, + KAudioPriorityUnknownVoipAudioUplink); + + if (!iDTMFNotifier) + { + iDTMFNotifier = TMSDtmfNotifier::NewL(); + } + + NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status); + } + break; + } + case TMS_STREAM_DOWNLINK: + { + status = TMS_RESULT_DOES_NOT_EXIST; + if (strmId == iDnlinkStreamId) + { + SetFormat(iDnlinkStreamId, fourCC); + status = OpenDownlinkL(aMessage); + + iDTMFDnlinkPlayer = TMSAudioDtmfTonePlayer::NewL(*this, + KAudioPrefUnknownVoipAudioDownlink, + KAudioPriorityUnknownVoipAudioDownlink); + + if (!iDTMFNotifier) + { + iDTMFNotifier = TMSDtmfNotifier::NewL(); + } + + NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status); + } + break; + } + default: + { + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + } + + TRACE_PRN_IF_ERR(status); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::StartStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::StartStream(TMSCallType /*callType*/, + TMSStreamType strmType, gint strmId) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + switch (strmType) + { + case TMS_STREAM_UPLINK: + { + if (strmId == iUplinkStreamId && iIPUplink) + { + iIPUplink->Start(); + status = TMS_RESULT_SUCCESS; + NotifyClient(iUplinkStreamId, ECmdUplinkStarted, status); + } + break; + } + case TMS_STREAM_DOWNLINK: + { + if (strmId == iDnlinkStreamId && iIPDownlink) + { + iIPDownlink->Start(); + status = TMS_RESULT_SUCCESS; + NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, status); + } + break; + } + default: + { + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::PauseStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::PauseStream(TMSCallType /*callType*/, + TMSStreamType strmType, gint strmId) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + switch (strmType) + { + case TMS_STREAM_UPLINK: + { + if (strmId == iUplinkStreamId && iIPUplink) + { + iIPUplink->Stop(); + status = TMS_RESULT_SUCCESS; + NotifyClient(iUplinkStreamId, ECmdUplinkPaused, status); + } + break; + } + case TMS_STREAM_DOWNLINK: + { + if (strmId == iDnlinkStreamId && iIPDownlink) + { + iIPDownlink->Stop(); + status = TMS_RESULT_SUCCESS; + NotifyClient(iDnlinkStreamId, ECmdDownlinkPaused, status); + } + break; + } + default: + { + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::StopStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::StopStream(TMSCallType /*callType*/, TMSStreamType strmType, + gint strmId) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + + switch (strmType) + { + case TMS_STREAM_UPLINK: + { + if (strmId == iUplinkStreamId && iIPUplink) + { + iIPUplink->Stop(); + status = TMS_RESULT_SUCCESS; + NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status); + } + break; + } + case TMS_STREAM_DOWNLINK: + { + if (strmId == iDnlinkStreamId && iIPDownlink) + { + iIPDownlink->Stop(); + status = TMS_RESULT_SUCCESS; + NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status); + } + break; + } + default: + { + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::DeinitStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::DeinitStream(TMSCallType /*callType*/, + TMSStreamType strmType, gint strmId) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + + switch (strmType) + { + case TMS_STREAM_UPLINK: + { + if (strmId == iUplinkStreamId && iIPUplink) + { + iIPUplink->Stop(); + //iUplinkStreamId = -1; + iUplinkInitialized = FALSE; + status = TMS_RESULT_SUCCESS; + NotifyClient(iUplinkStreamId, ECmdDownlinkDeInitComplete, + status); + } + break; + } + case TMS_STREAM_DOWNLINK: + { + if (strmId == iDnlinkStreamId && iIPDownlink) + { + iIPDownlink->Stop(); + //iDnlinkStreamId = -1; + iDnlinkInitialized = FALSE; + status = TMS_RESULT_SUCCESS; + NotifyClient(iDnlinkStreamId, ECmdDownlinkDeInitComplete, + status); + } + break; + } + default: + { + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + } + + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::DeleteStream +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::DeleteStream(TMSCallType /*callType*/, + TMSStreamType strmType, gint strmId) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + switch (strmType) + { + case TMS_STREAM_UPLINK: + { + // This is additional error checking + if (strmId == iUplinkStreamId) + { + iUplinkStreamId = -1; + iUplinkInitialized = FALSE; + } + break; + } + case TMS_STREAM_DOWNLINK: + { + // This is additional error checking + if (strmId == iDnlinkStreamId) + { + iDnlinkStreamId = -1; + iDnlinkInitialized = FALSE; + } + break; + } + default: + { + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::DataXferBufferEmptied +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::DataXferBufferEmptied(TMSCallType /*callType*/, + TMSStreamType strmType, gint strmId) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + switch (strmType) + { + case TMS_STREAM_UPLINK: + { + if (strmId == iUplinkStreamId) + { + TRAP(status, BufferEmptiedL()); + } + break; + } + case TMS_STREAM_DOWNLINK: + status = TMS_RESULT_ILLEGAL_OPERATION; + break; + default: + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::DataXferBufferFilled +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::DataXferBufferFilled(TMSCallType /*callType*/, + TMSStreamType strmType, gint strmId, guint datasize) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + switch (strmType) + { + case TMS_STREAM_DOWNLINK: + if (strmId == iDnlinkStreamId) + { + TRAP(status, BufferFilledL(datasize)); + } + break; + case TMS_STREAM_UPLINK: + status = TMS_RESULT_ILLEGAL_OPERATION; + break; + default: + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetDataXferBufferHndl +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetDataXferBufferHndl(const TMSCallType /*callType*/, + const TMSStreamType strmType, const gint strmId, const guint32 key, + RChunk& chunk) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + switch (strmType) + { + case TMS_STREAM_DOWNLINK: + { + if (strmId == iDnlinkStreamId) + { + TRAP(status, GetDataXferChunkHndl(strmType, key, chunk)); + } + break; + } + case TMS_STREAM_UPLINK: + { + if (strmId == iUplinkStreamId) + { + TRAP(status, GetDataXferChunkHndl(strmType, key, chunk)); + } + break; + } + default: + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetMaxVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetMaxVolume(guint& volume) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + + if (iDnlinkInitialized && iIPDownlink) + { + status = iIPDownlink->GetMaxVolume(volume); + iMaxVolume = volume; + TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: GetMaxVolume [%d]"), iMaxVolume); + } + + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::SetVolume(const guint volume) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iDnlinkInitialized && iIPDownlink) + { + status = iIPDownlink->SetVolume(volume); + NotifyClient(iDnlinkStreamId, ECmdSetVolume, status); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetVolume(guint& volume) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iDnlinkInitialized && iIPDownlink) + { + status = iIPDownlink->GetVolume(volume); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetMaxGain +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetMaxGain(guint& gain) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iUplinkInitialized && iIPUplink) + { + status = iIPUplink->GetMaxGain(gain); + iMaxGain = gain; + TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetMaxGain [%d]"), iMaxGain); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetGain +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::SetGain(const guint gain) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iUplinkInitialized && iIPUplink) + { + status = iIPUplink->SetGain(gain); + NotifyClient(iUplinkStreamId, ECmdSetGain, status); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetGain +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetGain(guint& gain) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iUplinkInitialized && iIPUplink) + { + status = iIPUplink->GetGain(gain); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetGlobalMaxVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetGlobalMaxVolume(guint& volume) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iDnlinkInitialized && iIPDownlink) + { + status = iIPDownlink->GetMaxVolume(volume); + iMaxVolume = volume; + TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: GetMaxVolume [%d]"), iMaxVolume); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetGlobalVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::SetGlobalVolume(const guint volume) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iDnlinkInitialized && iIPDownlink) + { + status = iIPDownlink->SetVolume(volume); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetGlobalVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetGlobalVolume(guint& volume) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iDnlinkInitialized && iIPDownlink) + { + status = iIPDownlink->GetVolume(volume); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetGlobalMaxGain +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetGlobalMaxGain(guint& gain) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iUplinkInitialized && iIPUplink) + { + status = iIPUplink->GetMaxGain(gain); + iMaxGain = gain; + TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetMaxGain [%d]"), iMaxGain); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetGlobalGain +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::SetGlobalGain(const guint gain) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iUplinkInitialized && iIPUplink) + { + status = iIPUplink->SetGain(gain); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetGlobalGain +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetGlobalGain(guint& gain) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iUplinkInitialized && iIPUplink) + { + status = iIPUplink->GetGain(gain); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetCodecMode(const TMSFormatType fmttype, + const TMSStreamType strmtype, gint& mode) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + switch (fmttype) + { + case TMS_FORMAT_ILBC: + status = GetIlbcCodecMode(mode, strmtype); + break; + case TMS_FORMAT_G711: + status = GetG711CodecMode(mode, strmtype); + break; + default: + status = TMS_RESULT_FORMAT_TYPE_NOT_SUPPORTED; + break; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::SetCodecMode(const TMSFormatType fmttype, + const TMSStreamType strmtype, const gint mode) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + switch (fmttype) + { + case TMS_FORMAT_ILBC: + status = SetIlbcCodecMode(mode, strmtype); + break; + case TMS_FORMAT_G711: + status = SetG711CodecMode(mode, strmtype); + break; + default: + status = TMS_RESULT_FORMAT_TYPE_NOT_SUPPORTED; + break; + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetSupportedBitRatesCount +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetSupportedBitRatesCount(guint& count) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iIPUplink) + { + status = iIPUplink->GetSupportedBitrates(iArrBitrates); + count = iArrBitrates.Count(); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetSupportedBitRates +// +// Bitrates are already returned from the codec as a result of call to +// GetSupportedBitratesCount(). Just pack them into a descriptor and return +// back to the client. +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetSupportedBitRates(CBufFlat*& brbuffer) + { + TRAPD(status, GetSupportedBitRatesL(brbuffer)); + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetSupportedBitRatesL +// +// GetSupportedBitRates implementation which can leave. +// ----------------------------------------------------------------------------- +// +void TMSCallIPAdpt::GetSupportedBitRatesL(CBufFlat*& brbuffer) + { + TRACE_PRN_FN_ENT; + RBufWriteStream stream; + stream.Open(*brbuffer); + CleanupClosePushL(stream); + guint numOfItems = iArrBitrates.Count(); + + for (guint i = 0; i < numOfItems; i++) + { + stream.WriteUint32L(iArrBitrates[i]); + //TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: BR: [%d]"), iArrBitrates[i]); + } + + CleanupStack::PopAndDestroy(&stream); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetBitRate +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetBitRate(guint& bitrate) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iIPUplink) + { + status = iIPUplink->GetBitrate(bitrate); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetBitRate +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::SetBitRate(const guint bitrate) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iIPUplink) + { + status = iIPUplink->SetBitrate(bitrate); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetVAD +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetVAD(const TMSFormatType fmttype, gboolean& vad) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iIPUplink) + { + status = iIPUplink->GetVad(fmttype, vad); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetVAD +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::SetVAD(const TMSFormatType fmttype, const gboolean vad) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iIPUplink) + { + status = iIPUplink->SetVad(fmttype, vad); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetCNG +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetCNG(const TMSFormatType fmttype, gboolean& cng) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iIPDownlink) + { + status = iIPDownlink->GetCng(fmttype, cng); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetCNG +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::SetCNG(const TMSFormatType fmttype, const gboolean cng) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iIPDownlink) + { + status = iIPDownlink->SetCng(fmttype, cng); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetPlc +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetPlc(const TMSFormatType fmttype, gboolean& plc) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iIPDownlink) + { + status = iIPDownlink->GetPlc(fmttype, plc); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetPlc +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::SetPlc(const TMSFormatType fmttype, const gboolean plc) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_INVALID_STATE); + if (iIPDownlink) + { + status = iIPDownlink->SetPlc(fmttype, plc); + } + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::OpenDownlinkL +// Method for player initialization. +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::OpenDownlinkL(const RMessage2& aMessage) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + + // Clients must have MultimediaDD capability to use this priority/pref. + // TODO: Also, TMS will monitor for emergency call and if detected it + // will deny access to audio resources. + iPriority.iPref = KAudioPrefVoipAudioDownlink; + iPriority.iPriority = KAudioPriorityVoipAudioDownlink; + + if (!iIPDownlink) + { + iIPDownlink = TMSIPDownlink::NewL(iDnFourCC, iPriority); + } + + if (iIPDownlink) + { + // Open message queue for handling server notifications to the client + if (iMsgQueueDn.Handle() <= 0) + { + // Second argument in TMSCallProxy::InitStream + status = iMsgQueueDn.Open(aMessage, 1); + } + + if (status == TMS_RESULT_SUCCESS) + { + // For transfer data buffer processing + iIPDownlink->SetMsgQueue(iMsgQueueDn); + } + } + + TRACE_PRN_IF_ERR(status); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::OpenUplinkL +// Method for recorder initialization. +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::OpenUplinkL(const RMessage2& aMessage) + { + TRACE_PRN_FN_ENT; + gint status(TMS_RESULT_SUCCESS); + + // Ensure clients have MultimediaDD capability to use this priority/pref + iPriority.iPref = KAudioPrefVoipAudioUplink; + iPriority.iPriority = KAudioPriorityVoipAudioUplink; + + if (!iIPUplink) + { + iIPUplink = TMSIPUplink::NewL(iUpFourCC, iPriority); + } + + if (iIPUplink) + { + // Open message queue for handling server notifications to the client + if (iMsgQueueUp.Handle() <= 0) + { + // Second argument in TMSCallProxy::InitStream + status = iMsgQueueUp.Open(aMessage, 1); + } + + if (status == TMS_RESULT_SUCCESS) + { + // For transfer data buffer processing + iIPUplink->SetMsgQueue(iMsgQueueUp); + } + } + + TRACE_PRN_IF_ERR(status); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetFormat +// +// ----------------------------------------------------------------------------- +// +void TMSCallIPAdpt::SetFormat(const gint strmId, const TUint32 aFormat) + { + if (strmId == iUplinkStreamId) + { + iUpFourCC = aFormat; + } + else if (strmId == iDnlinkStreamId) + { + iDnFourCC = aFormat; + } + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::BufferFilled +// +// ----------------------------------------------------------------------------- +// +void TMSCallIPAdpt::BufferFilledL(TUint dataSize) + { + if (iIPDownlink) + { + iIPDownlink->BufferFilled(dataSize); + } + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::BufferEmptied +// +// ----------------------------------------------------------------------------- +// +void TMSCallIPAdpt::BufferEmptiedL() + { + if (iIPUplink) + { + iIPUplink->BufferEmptied(); + } + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetDataXferChunkHndl +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetDataXferChunkHndl(const TMSStreamType strmType, + const TUint32 key, RChunk& chunk) + { + TRACE_PRN_FN_ENT; + + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + switch (strmType) + { + case TMS_STREAM_DOWNLINK: + { + if (iIPDownlink) + { + status = iIPDownlink->GetDataXferChunkHndl(key, chunk); + } + break; + } + case TMS_STREAM_UPLINK: + { + if (iIPUplink) + { + status = iIPUplink->GetDataXferChunkHndl(key, chunk); + } + break; + } + default: + status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; + break; + } + + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetIlbcCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::SetIlbcCodecMode(const gint mode, + const TMSStreamType strmtype) + { + gint status(TMS_RESULT_INVALID_ARGUMENT); + + if (strmtype == TMS_STREAM_DOWNLINK) + { + if (iDnlinkInitialized && iIPDownlink) + { + status = iIPDownlink->SetIlbcCodecMode(mode); + } + } + else if (strmtype == TMS_STREAM_UPLINK) + { + if (iUplinkInitialized && iIPUplink) + { + status = iIPUplink->SetIlbcCodecMode(mode); + } + } + + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetIlbcCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetIlbcCodecMode(gint& mode, const TMSStreamType strmtype) + { + gint status(TMS_RESULT_INVALID_ARGUMENT); + + if (strmtype == TMS_STREAM_DOWNLINK) + { + if (iDnlinkInitialized && iIPDownlink) + { + status = iIPDownlink->GetIlbcCodecMode(mode); + } + } + else if (strmtype == TMS_STREAM_UPLINK) + { + if (iUplinkInitialized && iIPUplink) + { + status = iIPUplink->GetIlbcCodecMode(mode); + } + } + + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetG711CodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::SetG711CodecMode(const gint mode, + const TMSStreamType strmtype) + { + gint status(TMS_RESULT_INVALID_ARGUMENT); + + if (strmtype == TMS_STREAM_DOWNLINK) + { + if (iDnlinkInitialized && iIPDownlink) + { + status = iIPDownlink->SetG711CodecMode(mode); + } + } + else if (strmtype == TMS_STREAM_UPLINK) + { + if (iUplinkInitialized && iIPUplink) + { + status = iIPUplink->SetG711CodecMode(mode); + } + } + + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetG711CodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetG711CodecMode(gint& mode, const TMSStreamType strmtype) + { + gint status(TMS_RESULT_INVALID_ARGUMENT); + + if (strmtype == TMS_STREAM_DOWNLINK) + { + if (iDnlinkInitialized && iIPDownlink) + { + status = iIPDownlink->GetG711CodecMode(mode); + } + } + else if (strmtype == TMS_STREAM_UPLINK) + { + if (iUplinkInitialized && iIPUplink) + { + status = iIPUplink->GetG711CodecMode(mode); + } + } + + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::FrameModeRequiredForEC +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::FrameModeRqrdForEC(gboolean& frmodereq) + { + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + if (iIPDownlink) + { + status = iIPDownlink->FrameModeRqrdForEC(frmodereq); + } + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetFrameMode +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::SetFrameMode(const gboolean frmode) + { + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + if (iIPDownlink) + { + status = iIPDownlink->SetFrameMode(frmode); + } + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetFrameMode +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetFrameMode(gboolean& frmode) + { + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + if (iIPDownlink) + { + status = iIPDownlink->GetFrameMode(frmode); + } + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::ConcealErrorForNextBuffer +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::ConcealErrorForNextBuffer() + { + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + if (iIPDownlink) + { + status = iIPDownlink->ConcealErrorForNextBuffer(); + } + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::BadLsfNextBuffer +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::BadLsfNextBuffer() + { + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + if (iIPDownlink) + { + status = iIPDownlink->BadLsfNextBuffer(); + } + return status; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::SetOutput +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::SetOutput(TMSAudioOutput output) + { + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + if (iDnlinkInitialized && iIPDownlink) + { + TRAP(status, iIPDownlink->SetAudioDeviceL(output)); + } + return status; + } +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetOutput +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetOutput(TMSAudioOutput& output) + { + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + if (iDnlinkInitialized && iIPDownlink) + { + TRAP(status, iIPDownlink->GetAudioDeviceL(output)); + } + return status; + } +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetPreviousOutput +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetPreviousOutput(TMSAudioOutput& /*output*/) + { + return TMS_RESULT_FEATURE_NOT_SUPPORTED; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::GetAvailableOutputsL +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::GetAvailableOutputsL(gint& /*count*/, + CBufFlat*& /*outputsbuffer*/) + { + return TMS_RESULT_FEATURE_NOT_SUPPORTED; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::StartDTMF +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::StartDTMF(TMSStreamType strmtype, TDes& dtmfstring) + { + TRACE_PRN_FN_ENT; + TmsMsgBufPckg dtmfpckg; + if (strmtype == TMS_STREAM_DOWNLINK) + { + if (iDTMFDnlinkPlayer /*&& iDTMFDnlinkStatus*/) + { + iDTMFDnlinkPlayer->PlayDtmfTone(dtmfstring); + dtmfpckg().iStatus = TMS_RESULT_SUCCESS; + //TMS_EVENT_DTMF_TONE_STARTED + dtmfpckg().iRequest = ECmdDTMFOpenDnlinkComplete; + } + } + else if (strmtype == TMS_STREAM_UPLINK) + { + if (iDTMFUplinkPlayer /*&& iDTMFUplinkStatus*/) + { + iDTMFUplinkPlayer->PlayDtmfTone(dtmfstring); + dtmfpckg().iStatus = TMS_RESULT_SUCCESS; + //TMS_EVENT_DTMF_TONE_STARTED + dtmfpckg().iRequest = ECmdDTMFOpenUplinkComplete; + } + } + + if (iDTMFNotifier) + { + iDTMFNotifier->SetDtmf(dtmfpckg, TRUE); + } + TRACE_PRN_FN_EXT; + return TMS_RESULT_SUCCESS; + } +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::StopDTMF +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::StopDTMF(TMSStreamType streamtype) + { + TRACE_PRN_FN_ENT; + + if (streamtype == TMS_STREAM_DOWNLINK) + { + iDTMFDnlinkPlayer->Cancel(); + } + else + { + iDTMFUplinkPlayer->Cancel(); + } + + TRACE_PRN_FN_EXT; + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::ContinueDTMF +// +// ----------------------------------------------------------------------------- +// +gint TMSCallIPAdpt::ContinueDTMF(TBool /*continuesending*/) + { + TRACE_PRN_FN_ENT; + TRACE_PRN_FN_EXT; + return TMS_RESULT_FEATURE_NOT_SUPPORTED; + } + +//From DTMFTonePlayerObserver +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::DTMFInitCompleted +// +// ----------------------------------------------------------------------------- +// +void TMSCallIPAdpt::DTMFInitCompleted(TInt /*error*/) + { + //DTMF init status + TRACE_PRN_FN_ENT; + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::DTMFToneFinished +// +// ----------------------------------------------------------------------------- +// +void TMSCallIPAdpt::DTMFToneFinished(TInt error) + { + TRACE_PRN_FN_ENT; + TmsMsgBufPckg dtmfpckg; + + if(error == KErrUnderflow || error == KErrInUse) + { + error = TMS_RESULT_SUCCESS; + } + + dtmfpckg().iStatus = error; + //TMS_EVENT_DTMF_TONE_STOPPED + dtmfpckg().iRequest = ECmdDTMFTonePlayFinished; + if (iDTMFNotifier) + { + iDTMFNotifier->SetDtmf(dtmfpckg, TRUE); + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallIPAdpt::NotifyClient +// ----------------------------------------------------------------------------- +// +void TMSCallIPAdpt::NotifyClient(const gint strmId, const TInt aCommand, + const TInt aStatus, const TInt64 /*aInt64*/) + { + iMsgBuffer.iRequest = aCommand; + iMsgBuffer.iStatus = aStatus; + + if (strmId == iUplinkStreamId) + { + iMsgQueueUp.Send(iMsgBuffer); + } + else if (strmId == iDnlinkStreamId) + { + iMsgQueueDn.Send(iMsgBuffer); + } + } + +// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmscallserver.cpp --- a/mmserv/tms/tmscallserver/src/tmscallserver.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmscallserver/src/tmscallserver.cpp Mon May 03 12:59:52 2010 +0300 @@ -16,7 +16,7 @@ */ #include "tmscallserver.h" -#include "delaytimer.h" +#include "tmsdelaytimer.h" #include "tmsutility.h" #include "tmscallsession.h" diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmscallsession.cpp --- a/mmserv/tms/tmscallserver/src/tmscallsession.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmscallserver/src/tmscallsession.cpp Mon May 03 12:59:52 2010 +0300 @@ -17,7 +17,7 @@ #include "tmsutility.h" #include "tmsutility.h" -#include "calladpt.h" +#include "tmscalladpt.h" #include "tmscallserver.h" #include "tmscallclisrv.h" #include "tmscallsession.h" @@ -1062,7 +1062,7 @@ { TRACE_PRN_FN_ENT; gint status(TMS_RESULT_DOES_NOT_EXIST); - TMSAudioOutput outputtype; + TMSAudioOutput outputtype(TMS_AUDIO_OUTPUT_NONE); if (iCallAdpt) { status = iCallAdpt->GetOutput(outputtype); @@ -1082,7 +1082,7 @@ { TRACE_PRN_FN_ENT; gint status(TMS_RESULT_DOES_NOT_EXIST); - TMSAudioOutput outputtype; + TMSAudioOutput outputtype(TMS_AUDIO_OUTPUT_NONE); if (iCallAdpt) { status = iCallAdpt->GetPreviousOutput(outputtype); diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmscsdevsound.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmscsdevsound.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include +#include +#include "tmscsdevsound.h" +#include "tmscsdevsoundobserver.h" + +using namespace TMS; + +// ----------------------------------------------------------------------------- +// TMSCSPDevSound +// ----------------------------------------------------------------------------- +// +TMSCSPDevSound::TMSCSPDevSound(TMSCSPDevSoundObserver& aObserver) : + iObserver(aObserver) + { + } + +// ----------------------------------------------------------------------------- +// ConstructL +// ----------------------------------------------------------------------------- +// +void TMSCSPDevSound::ConstructL(TMMFState aMode, gint aAudioPreference, + gint aAudioPriority) + { + TMMFPrioritySettings audioPriority; + TFourCC modemFourCC; + modemFourCC.Set(KS60FourCCCodeModem); + iDevSound = CMMFDevSound::NewL(); + if (iDevSound) + { +#ifndef __WINSCW__ + iDevSound->InitializeL(*this, modemFourCC, aMode); +#else //For testing TMS in WINSCW + iDevSound->InitializeL(*this, KMMFFourCCCodePCM16, aMode); +#endif + iStreamType = aAudioPreference; + audioPriority.iPriority = aAudioPriority; + audioPriority.iPref = aAudioPreference; + audioPriority.iState = aMode; + iDevSound->SetPrioritySettings(audioPriority); + } + } + +// ----------------------------------------------------------------------------- +// From class MDevSoundObserver +// Not implemented +// ----------------------------------------------------------------------------- +// +TMSCSPDevSound::~TMSCSPDevSound() + { + delete iDevSound; + } + +// ----------------------------------------------------------------------------- +// Tries to activate the audio stream if not active or activating +// ----------------------------------------------------------------------------- +// +void TMSCSPDevSound::Activate() + { + if (!IsActive() && !IsActivationOngoing()) + { + iActivationOngoing = ETrue; + TRAP_IGNORE(DoActivateL()); + } + } + +// ----------------------------------------------------------------------------- +// Deactivates the audio device. +// ----------------------------------------------------------------------------- +// +void TMSCSPDevSound::Deactivate() + { + if (iDevSound && (IsActive() || IsActivationOngoing())) + { + iDevSound->Stop(); + iActive = EFalse; + iActivationOngoing = EFalse; + } + } + +// ----------------------------------------------------------------------------- +// ActivationOngoing +// ----------------------------------------------------------------------------- +// +TBool TMSCSPDevSound::IsActivationOngoing() const + { + return iActivationOngoing; + } + +// ----------------------------------------------------------------------------- +// IsActive +// ----------------------------------------------------------------------------- +// +TBool TMSCSPDevSound::IsActive() const + { + return iActive; + } + +// ----------------------------------------------------------------------------- +// DevSound +// ----------------------------------------------------------------------------- +// +CMMFDevSound& TMSCSPDevSound::DevSound() + { + return *iDevSound; + } + +// ----------------------------------------------------------------------------- +// From class MDevSoundObserver +// Not implemented +// ----------------------------------------------------------------------------- +// +void TMSCSPDevSound::InitializeComplete(TInt aError) + { + if (iStreamType == KAudioPrefCSCallDownlink) + { + iObserver.DownlinkInitCompleted(aError); + } + else + { + iObserver.UplinkInitCompleted(aError); + } + } + +// ----------------------------------------------------------------------------- +// From class MDevSoundObserver +// Not implemented +// ----------------------------------------------------------------------------- +// +void TMSCSPDevSound::BufferToBeFilled(CMMFBuffer* /*aBuffer*/) + { + } + +// ----------------------------------------------------------------------------- +// From class MDevSoundObserver +// Not implemented +// ----------------------------------------------------------------------------- +// +void TMSCSPDevSound::PlayError(TInt /*aError*/) + { + } + +// ----------------------------------------------------------------------------- +// From class MDevSoundObserver +// Not implemented +// ----------------------------------------------------------------------------- +// +void TMSCSPDevSound::ToneFinished(TInt /*aError*/) + { + } + +// ----------------------------------------------------------------------------- +// From class MDevSoundObserver +// Not implemented +// ----------------------------------------------------------------------------- +// +void TMSCSPDevSound::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) + { + } + +// ----------------------------------------------------------------------------- +// From class MDevSoundObserver +// Not implemented +// ----------------------------------------------------------------------------- +// +void TMSCSPDevSound::RecordError(TInt /*aError*/) + { + } + +// ----------------------------------------------------------------------------- +// From class MDevSoundObserver +// Not implemented +// ----------------------------------------------------------------------------- +// +void TMSCSPDevSound::ConvertError(TInt /*aError*/) + { + } + +// ----------------------------------------------------------------------------- +// From class MDevSoundObserver +// Not implemented +// ----------------------------------------------------------------------------- +// +void TMSCSPDevSound::DeviceMessage(TUid /*aMessageType*/, + const TDesC8& /*aMsg*/) + { + } + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmscsdownlink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmscsdownlink.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include "tmscsdownlink.h" +#include "tmscsdevsoundobserver.h" + +using namespace TMS; + +const gint KDefaultVolume = 4; +const gint KDefaultMaxVolume = 10; + +// ----------------------------------------------------------------------------- +// Static constructor +// ----------------------------------------------------------------------------- +// +TMSCSDownlink* TMSCSDownlink::NewL(TMSCSPDevSoundObserver& aObserver) + { + TMSCSDownlink* self = new (ELeave) TMSCSDownlink(aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +TMSCSDownlink::~TMSCSDownlink() + { + } + +// ----------------------------------------------------------------------------- +// Sets volume +// ----------------------------------------------------------------------------- +// +void TMSCSDownlink::SetVolume(gint aVolume) + { + if (iDevSound) + { + gint maxVolume(iDevSound->MaxVolume()); + maxVolume = (maxVolume > 0) ? maxVolume : KDefaultMaxVolume; + gint scaledVolume = (aVolume * maxVolume) / KDefaultMaxVolume; + iDevSound->SetVolume(scaledVolume); + } + } + +// ----------------------------------------------------------------------------- +// Gives volume +// ----------------------------------------------------------------------------- +// +gint TMSCSDownlink::Volume() + { + gint vol = 0; + if (iDevSound) + { + vol = iDevSound->Volume(); + } + return vol; + } + +// ----------------------------------------------------------------------------- +// Gives max volume +// ----------------------------------------------------------------------------- +// +gint TMSCSDownlink::MaxVolume() + { + gint vol = 0; + if (iDevSound) + { + vol = iDevSound->MaxVolume(); + } + return vol; + } + +// ----------------------------------------------------------------------------- +// From class MDevSoundObserver +// Downlink stream has been activated successfully. +// ----------------------------------------------------------------------------- +// +void TMSCSDownlink::BufferToBeFilled(CMMFBuffer* /*aBuffer*/) + { + //CSPLOGSTRING( CSPINT, "TMSCSDownlink:: activated" ); + // We dont react to devsound messages unless we are activating. + if (IsActivationOngoing()) + { + iActive = ETrue; + iActivationOngoing = EFalse; + iObserver.DownlinkActivatedSuccessfully(); + } + } + +// ----------------------------------------------------------------------------- +// From class MDevSoundObserver +// Downlink stream activation failed +// ----------------------------------------------------------------------------- +// +void TMSCSDownlink::PlayError(TInt aError) + { + //CSPLOGSTRING( CSPINT, "TMSCSDownlink::PlayError" ); + + // We dont react to devsound messages unless we are activating. + if (IsActivationOngoing()) + { + //CSPLOGSTRING( CSPINT, "TMSCSDownlink::PlayError activation failed" ); + if (aError == KErrAccessDenied) + { + iActivationOngoing = EFalse; + iObserver.DownlinkActivationFailed(); + } + } + } + +// ----------------------------------------------------------------------------- +// From class CSPDevsound +// Tries to activate Downlink stream. +// ----------------------------------------------------------------------------- +// +void TMSCSDownlink::DoActivateL() + { + if (iDevSound) + { + iDevSound->PlayInitL(); + } + } + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +// +TMSCSDownlink::TMSCSDownlink(TMSCSPDevSoundObserver& aObserver) : + TMSCSPDevSound(aObserver) + { + } + +// ----------------------------------------------------------------------------- +// Second phase constructor +// ----------------------------------------------------------------------------- +// +void TMSCSDownlink::ConstructL() + { + TMSCSPDevSound::ConstructL(EMMFStatePlaying, KAudioPrefCSCallDownlink, + KAudioPriorityCSCallDownlink); + + if (iDevSound) + { + iDevSound->SetVolume(KDefaultVolume); + } + } + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmscsuplink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmscsuplink.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include "tmscsuplink.h" +#include "tmscsdevsoundobserver.h" + +using namespace TMS; + +// Mute value +const gint KSetMuteToDevSound = 0; + +// ----------------------------------------------------------------------------- +// Static constructor. +// ----------------------------------------------------------------------------- +// +TMSCSUplink* TMSCSUplink::NewL(TMSCSPDevSoundObserver& aObserver) + { + TMSCSUplink* self = new (ELeave) TMSCSUplink(aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +TMSCSUplink::~TMSCSUplink() + { + } + +// ----------------------------------------------------------------------------- +// Gives mic mute state +// ----------------------------------------------------------------------------- +// +TBool TMSCSUplink::IsMuted() + { + TBool isMuted = EFalse; + gint gain = 0; + if (iDevSound) + { + gain = iDevSound->Gain(); + } + if (!gain) + { + // Mute is on + isMuted = ETrue; + } + // CSPLOGSTRING( CSPINT, "TMSCSUplink::IsMuted" ); + return isMuted; + } + +// ----------------------------------------------------------------------------- +// Set mic muted. +// ----------------------------------------------------------------------------- +// +void TMSCSUplink::SetMuted() + { + if (iDevSound) + { + iDevSound->SetGain(KSetMuteToDevSound); + } + } + +// ----------------------------------------------------------------------------- +// Set mic unmuted +// ----------------------------------------------------------------------------- +// +void TMSCSUplink::SetUnmuted() + { + if (iDevSound) + { + iDevSound->SetGain(iDevSound->MaxGain()); + } + } + +// ----------------------------------------------------------------------------- +// Sets gain +// ----------------------------------------------------------------------------- +// +void TMSCSUplink::SetGain(gint aGain) + { + if (iDevSound) + { + iDevSound->SetGain(aGain); + } + } + +// ----------------------------------------------------------------------------- +// Gives volume +// ----------------------------------------------------------------------------- +// +gint TMSCSUplink::Gain() + { + gint gain = 0; + if (iDevSound) + { + gain = iDevSound->Gain(); + } + return gain; + } + +// ----------------------------------------------------------------------------- +// Gives max gain +// ----------------------------------------------------------------------------- +// +gint TMSCSUplink::MaxGain() + { + gint gain = 0; + if (iDevSound) + { + gain = iDevSound->MaxGain(); + } + return gain; + } + +// ----------------------------------------------------------------------------- +// From class MDevSoundObserver +// Activation was successfull. +// ----------------------------------------------------------------------------- +// +void TMSCSUplink::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) + { + // CSPLOGSTRING( CSPINT, "TMSCSUplink::BufferToBeEmptied" ); + + // We dont react to devsound messages unless we are activating. + if (IsActivationOngoing()) + { + iActive = ETrue; + iActivationOngoing = EFalse; + iObserver.UplinkActivatedSuccessfully(); + } + } + +// ----------------------------------------------------------------------------- +// From class MDevSoundObserver +// Activation feiled +// ----------------------------------------------------------------------------- +// +void TMSCSUplink::RecordError(TInt aError) + { + // CSPLOGSTRING( CSPINT, "TMSCSUplink::RecordError" ); + + // We dont react to devsound messages unless we are activating. + if (IsActivationOngoing()) + { + if (aError == KErrAccessDenied) + { + iActivationOngoing = EFalse; + iObserver.UplinkActivationFailed(); + } + } + } + +// ----------------------------------------------------------------------------- +// From class TMSCSPDevSound +// Tries to activate mic stream. Stream becomes active when BufferToBeFilled +// gets called. +// ----------------------------------------------------------------------------- +// +void TMSCSUplink::DoActivateL() + { + if (iDevSound) + { + iDevSound->RecordInitL(); + } + } + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +// +TMSCSUplink::TMSCSUplink(TMSCSPDevSoundObserver& aObserver) : + TMSCSPDevSound(aObserver) + { + } + +// ----------------------------------------------------------------------------- +// Second phase constructor +// ----------------------------------------------------------------------------- +// +void TMSCSUplink::ConstructL() + { + TMSCSPDevSound::ConstructL(EMMFStateRecording, KAudioPrefCSCallUplink, + KAudioPriorityCSCallUplink); + } + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmsdelaytimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmsdelaytimer.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +// INCLUDE FILES +#include "tmsdelaytimer.h" +#include "tmsutility.h" + +using namespace TMS; + +// ----------------------------------------------------------------------------- +// TMSCallDelayTimer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +TMSCallDelayTimer* TMSCallDelayTimer::NewL() + { + TRACE_PRN_FN_ENT; + TMSCallDelayTimer* self = new (ELeave) TMSCallDelayTimer; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + TRACE_PRN_FN_EXT; + return self; + } + +// ----------------------------------------------------------------------------- +// TMSCallDelayTimer::TMSCallDelayTimer() +// C++ constructor. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TMSCallDelayTimer::TMSCallDelayTimer() : + CActive(CActive::EPriorityStandard) + { + TRACE_PRN_FN_ENT; + CActiveScheduler::Add(this); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallDelayTimer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void TMSCallDelayTimer::ConstructL() + { + TRACE_PRN_FN_ENT; + User::LeaveIfError(iShutDownTimer.CreateLocal()); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallDelayTimer::~TMSCallDelayTimer +// Destructor +// ----------------------------------------------------------------------------- +// +TMSCallDelayTimer::~TMSCallDelayTimer() + { + TRACE_PRN_FN_ENT; + Cancel(); + iShutDownTimer.Close(); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallDelayTimer::SetDelay +// Request a timeout after aDelay +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TMSCallDelayTimer::SetDelay(TTimeIntervalMicroSeconds32 aDelay) + { + TRACE_PRN_FN_ENT; + if (!IsActive()) + { + iStatus = KRequestPending; + SetActive(); + iShutDownTimer.After(iStatus, aDelay); + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallDelayTimer::RunL +// Called by Active object framework when timer times out. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TMSCallDelayTimer::RunL() + { + TRACE_PRN_FN_ENT; + CActiveScheduler::Stop(); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSCallDelayTimer::DoCancel +// Called by the Active object framework when user cancels active object. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void TMSCallDelayTimer::DoCancel() + { + TRACE_PRN_FN_ENT; + iShutDownTimer.Cancel(); + TRACE_PRN_FN_EXT; + } + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmsdtmfnotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmsdtmfnotifier.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +// INCLUDE FILES +#include "tmsdtmfnotifier.h" +#include "tmsclientserver.h" +#include "tmsutility.h" + +using namespace TMS; + +// CONSTANTS +_LIT_SECURITY_POLICY_PASS(KTMSServerReadPolicy); +_LIT_SECURITY_POLICY_C1(KTMSServerWritePolicy, ECapabilityWriteUserData); + +// ----------------------------------------------------------------------------- +// TMSDtmfNotifier::TMSDtmfNotifier +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +TMSDtmfNotifier::TMSDtmfNotifier() + { + } + +// ----------------------------------------------------------------------------- +// TMSDtmfNotifier::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void TMSDtmfNotifier::ConstructL() + { + TRACE_PRN_FN_ENT; + TInt err = RProperty::Define(EDtmfPs, RProperty::EByteArray, + KTMSServerReadPolicy, KTMSServerWritePolicy); + TRACE_PRN_N1(_L("DtmfSetting::ConstructL err:%d"),err); + + if (err != KErrAlreadyExists) + { + User::LeaveIfError(err); + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSDtmfNotifier::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +TMSDtmfNotifier* TMSDtmfNotifier::NewL() + { + TMSDtmfNotifier* self = new (ELeave) TMSDtmfNotifier(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// Destructor +TMSDtmfNotifier::~TMSDtmfNotifier() + { + TRACE_PRN_FN_ENT; + TInt err = RProperty::Delete(KTMSPropertyCategory, EDtmfPs); + TRACE_PRN_N1(_L("DtmfSetting::~TMSDtmfNotifier err:%d"),err); + TRACE_PRN_FN_ENT; + } + +// ----------------------------------------------------------------------------- +// TMSDtmfNotifier::SetVolume +// ----------------------------------------------------------------------------- +// +void TMSDtmfNotifier::SetDtmf(TmsMsgBufPckg dtmfpckg, TBool aPublish) + { + TRACE_PRN_FN_ENT; + //TInt err(KErrNone); + if (aPublish) + { + /*err =*/RProperty::Set(KTMSPropertyCategory, EDtmfPs, dtmfpckg); + } + + //TRACE_PRN_N1(_L("DtmfSetting::SetDtmf err:%d"),err); + TRACE_PRN_FN_EXT; + } + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmsdtmfprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmsdtmfprovider.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include +#include "tmsdtmfprovider.h" +#include "tmsdtmfobserver.h" +#include "tmsutility.h" +#include "tmseteldtmfmonitor.h" +#include "tmseteldtmfstopmonitor.h" + +using namespace TMS; + +TMSDTMFProvider* TMSDTMFProvider::NewL() + { + TRACE_PRN_FN_ENT; + TMSDTMFProvider* self = new (ELeave) TMSDTMFProvider(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + TRACE_PRN_FN_EXT; + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor of the object. +// ----------------------------------------------------------------------------- +// +TMSDTMFProvider::~TMSDTMFProvider() + { + TRACE_PRN_FN_ENT; + Cancel(); + iObservers.Close(); + delete iMonitor; + delete iStopMonitor; + + iMmCustom.Close(); + iPhone.Close(); + iServer.UnloadPhoneModule(iTsyname); + iServer.Close(); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// Notifies observers about a DTMF event +// ----------------------------------------------------------------------------- +// +void TMSDTMFProvider::NotifyDTMFEvent( + const TMSDTMFObserver::TCCPDtmfEvent aEvent, const gint aError, + const TChar aTone) + { + TRACE_PRN_FN_ENT; + for (gint i = 0; i < iObservers.Count(); i++) + { + TMSDTMFObserver* obs = iObservers[i]; + if (obs) + { + iObservers[i]->HandleDTMFEvent(aEvent, aError, aTone); + } + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// Cancel DTMF string sending +// ----------------------------------------------------------------------------- +// +TInt TMSDTMFProvider::CancelDtmfStringSending() + { + TRACE_PRN_FN_ENT; + gint ret(KErrAlreadyExists); + if (IsActive()) + { + Cancel(); + ret = KErrNone; + } + TRACE_PRN_FN_EXT; + return ret; + } + +// ----------------------------------------------------------------------------- +// Starts DTMF string sending +// ----------------------------------------------------------------------------- +// +TInt TMSDTMFProvider::StartDtmfTone(const TChar aTone) + { + TRACE_PRN_FN_ENT; + gint ret(KErrAlreadyExists); + if (!IsActive()) + { + ret = iPhone.StartDTMFTone(aTone); + } + TRACE_PRN_FN_EXT; + return ret; + } + +// ----------------------------------------------------------------------------- +// Stop DTMF tone +// ----------------------------------------------------------------------------- +// +TInt TMSDTMFProvider::StopDtmfTone() + { + TRACE_PRN_FN_ENT; + gint ret(KErrAlreadyExists); + if (!IsActive()) + { + ret = iPhone.StopDTMFTone(); + } + TRACE_PRN_FN_EXT; + return ret; + } + +// ----------------------------------------------------------------------------- +// Send DTMF string +// ----------------------------------------------------------------------------- +// +TInt TMSDTMFProvider::SendDtmfToneString(const TDesC& aString) + { + TRACE_PRN_FN_ENT; + gint ret = KErrInUse; + if (!IsActive()) + { + iStatus = KRequestPending; + iPhone.SendDTMFTones(iStatus, aString); + SetActive(); + ret = KErrNone; + } + TRACE_PRN_FN_EXT; + return ret; + } + +// ----------------------------------------------------------------------------- +// Continue DTMF string sending +// ----------------------------------------------------------------------------- +// +TInt TMSDTMFProvider::ContinueDtmfStringSending(const TBool aContinue) + { + TRACE_PRN_FN_ENT; + gint status = iPhone.ContinueDTMFStringSending(aContinue); + TRACE_PRN_FN_EXT; + return status; + } + +// ----------------------------------------------------------------------------- +// Adds observer. +// ----------------------------------------------------------------------------- +// +void TMSDTMFProvider::AddObserverL(const TMSDTMFObserver& aObserver) + { + TRACE_PRN_FN_ENT; + if (iObservers.Find(&aObserver) == KErrNotFound) + { + iObservers.Append(&aObserver); + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// Removes given observer. +// ----------------------------------------------------------------------------- +// +TInt TMSDTMFProvider::RemoveObserver(const TMSDTMFObserver& aObserver) + { + TRACE_PRN_FN_ENT; + gint ret = KErrNotFound; + gint found = iObservers.Find(&aObserver); + if (found != KErrNotFound) + { + iObservers.Remove(found); + ret = KErrNone; + } + TRACE_PRN_FN_EXT; + return ret; + } + +// ----------------------------------------------------------------------------- +// From CActive. +// Handles request completion. +// ----------------------------------------------------------------------------- +// +void TMSDTMFProvider::RunL() + { + TRACE_PRN_FN_ENT; + if (iStatus == KErrNone) + { + TMSDTMFObserver::TCCPDtmfEvent event = + TMSDTMFObserver::ECCPDtmfStringSendingCompleted; + NotifyDTMFEvent(event, KErrNone, NULL); + } + else + { + gint error = iStatus.Int(); + if (error != KErrCancel) + { + TMSDTMFObserver::TCCPDtmfEvent event = + TMSDTMFObserver::ECCPDtmfStringSendingCompleted; + NotifyDTMFEvent(event, error, NULL); + } + else + { + // Cancel is not notified + } + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// From CActive +// Canceling functionality. +// ----------------------------------------------------------------------------- +// +void TMSDTMFProvider::DoCancel() + { + TRACE_PRN_FN_ENT; + if (iStatus == KRequestPending) + { + iPhone.CancelAsyncRequest(EMobilePhoneSendDTMFTones); + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// Constructs the requester. +// ----------------------------------------------------------------------------- +// +TMSDTMFProvider::TMSDTMFProvider() : + CActive(EPriorityStandard) + { + TRACE_PRN_FN_ENT; + CActiveScheduler::Add(this); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// Constructs the requester in the second phase. +// ----------------------------------------------------------------------------- +// +void TMSDTMFProvider::ConstructL() + { + TRACE_PRN_FN_ENT; + + CleanupClosePushL(iServer); + User::LeaveIfError(iServer.Connect()); + + TRACE_PRN_N(_L("**TMS ETel iServer.Connect")); + + iServer.GetTsyName(0, iTsyname); + + //Load in the phone device driver + User::LeaveIfError(iServer.LoadPhoneModule(iTsyname)); + + TRACE_PRN_N(_L("**TMS ETel iServer.LoadPhoneModule")); + + //Find the number of phones available from the tel server + gint numberPhones; + User::LeaveIfError(iServer.EnumeratePhones(numberPhones)); + + TRACE_PRN_N(_L("**TMS ETel iServer.EnumeratePhones")); + + //Check there are available phones + if (numberPhones < 1) + { + User::Leave(KErrNotFound); + } + + //Get info about the first available phone + RTelServer::TPhoneInfo info; + User::LeaveIfError(iServer.GetPhoneInfo(0, info)); + + TRACE_PRN_N(_L("**TMS ETel iServer.GetPhoneInfo")); + + CleanupClosePushL(iPhone); + User::LeaveIfError(iPhone.Open(iServer, info.iName)); + + TRACE_PRN_N(_L("**TMS ETel iPhone.Open")); + + RMobilePhone::TLineInfo lineInfo; + User::LeaveIfError(iPhone.GetLineInfo(0, lineInfo)); + + TRACE_PRN_N(_L("**TMS ETel iPhone.GetLineInfo")); + + gint errorCode = iMmCustom.Open(iPhone); + + if (!iPhone.SubSessionHandle() || !iMmCustom.SubSessionHandle()) + { + User::Leave(KErrArgument); + } + iMonitor = TMSEtelDtmfMonitor::NewL(*this, iMmCustom); + iMonitor->StartMonitoring(); + iStopMonitor = TMSEtelDtmfStopMonitor::NewL(*this, iPhone); + // iStopMonitor->StartMonitoring(); + + CleanupStack::Pop(2);//telserver,phone + TRACE_PRN_FN_EXT; + } + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmsdtmftoneplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmsdtmftoneplayer.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +// INCLUDE FILES +#include +#include +#include "tmsutility.h" +#include "tmsdtmftoneplayer.h" + +// CONSTANTS +const gint KBufSize = 10; +const gint KMaxVolumeLevel = 10; + +_LIT(KPhoneTone_Asterisk, "*+w"); + +//from voip +const guint KDTMFToneLengthOn = 250000; +const guint KDTMFToneLengthOff = 50000; +const guint KDTMFToneLengthPause = 2500000; + +using namespace TMS; + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +TMSAudioDtmfTonePlayer* TMSAudioDtmfTonePlayer::NewL( + TMSDTMFTonePlayerObserver& obsrvr, guint aAudioPreference, + guint aAudioPriority) + { + //iObserver = obsrvr; + TMSAudioDtmfTonePlayer* self = new (ELeave) TMSAudioDtmfTonePlayer( + obsrvr, aAudioPreference, aAudioPriority); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +//Destructor +TMSAudioDtmfTonePlayer::~TMSAudioDtmfTonePlayer() + { + TRACE_PRN_FN_ENT; + Cancel(); + delete iDTMFPlayer; + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::TMSAudioDtmfTonePlayer +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +TMSAudioDtmfTonePlayer::TMSAudioDtmfTonePlayer( + TMSDTMFTonePlayerObserver& obsrvr, guint aAudioPreference, + guint aAudioPriority) : + iObserver(obsrvr), + iPref(aAudioPreference), + iPrior(aAudioPriority) + { + TRACE_PRN_FN_ENT; + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void TMSAudioDtmfTonePlayer::ConstructL() + { + TRACE_PRN_FN_ENT; + + TMMFPrioritySettings dtmfClickPlayerPrioritySettings; + iDTMFPlayer = CMMFDevSound::NewL(); + iDTMFPlayer->InitializeL(*this, EMMFStateTonePlaying); + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::SetVolume +// Sets the volume level that is used when the dtmf tone is played. +// ----------------------------------------------------------------------------- +// +void TMSAudioDtmfTonePlayer::SetVolume(gint aVolume) + { + TRACE_PRN_FN_ENT; + gint vol = ConvertVolume(aVolume); + + if (vol != iVolume) + { + iVolume = vol; + iDTMFPlayer->SetVolume(iVolume); + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::PlayDtmfTone +// Searches the given DTMF tone from iToneArray and calls PlayCurrentTone +// member function. +// ----------------------------------------------------------------------------- +// +void TMSAudioDtmfTonePlayer::PlayDtmfTone(TDes& aTone) + { + TRACE_PRN_FN_ENT; + Cancel(); + + // DTMF signalling. + if (iDTMFPlayer) + { + TBuf key; + key.Append(aTone); + TRAP_IGNORE(iDTMFPlayer->PlayDTMFStringL(aTone)); + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::Cancel +// Cancels the currently playing tone. +// ----------------------------------------------------------------------------- +// +void TMSAudioDtmfTonePlayer::Cancel() + { + TRACE_PRN_FN_ENT; + iDTMFPlayer->Stop(); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::Normalize +// Lowers case for chars and if its '*','+', or 'w' sets it to asterisk +// char ('*'). +// ----------------------------------------------------------------------------- +// +void TMSAudioDtmfTonePlayer::Normalize(TChar& aTone) + { + TRACE_PRN_FN_ENT; + aTone.LowerCase(); + + TPtrC ast(KPhoneTone_Asterisk); + + if (ast.Locate(aTone) != KErrNotFound) + { + aTone = ast[0]; + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::InitializeComplete +// ----------------------------------------------------------------------------- +// +void TMSAudioDtmfTonePlayer::InitializeComplete(TInt aError) + { + TRACE_PRN_FN_ENT; + + if (aError == KErrNone) + { + TMMFPrioritySettings dtmfPlayerSettings; + dtmfPlayerSettings.iPref = (TMdaPriorityPreference) iPref; + dtmfPlayerSettings.iPriority = iPrior; + dtmfPlayerSettings.iState = EMMFStateTonePlaying; + iDTMFPlayer->SetPrioritySettings(dtmfPlayerSettings); + + TTimeIntervalMicroSeconds32 length(KDTMFToneLengthOn); + TTimeIntervalMicroSeconds32 pause(KDTMFToneLengthOff); + TTimeIntervalMicroSeconds32 zero(KDTMFToneLengthPause); + iDTMFPlayer->SetDTMFLengths(length, pause, zero); + iDTMFPlayer->SetVolume(iDTMFPlayer->MaxVolume()); + } + + iObserver.DTMFInitCompleted(aError); + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::ToneFinished +// ----------------------------------------------------------------------------- +// +void TMSAudioDtmfTonePlayer::ToneFinished(TInt aError) + { + TRACE_PRN_FN_ENT; + iObserver.DTMFToneFinished(aError); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::BufferToBeFilled +// ----------------------------------------------------------------------------- +// +void TMSAudioDtmfTonePlayer::BufferToBeFilled(CMMFBuffer* /*aBuffer*/) + { + TRACE_PRN_FN_ENT; + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::PlayError +// ----------------------------------------------------------------------------- +// +void TMSAudioDtmfTonePlayer::PlayError(TInt /*aError*/) + { + TRACE_PRN_FN_ENT; + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::BufferToBeEmptied +// ----------------------------------------------------------------------------- +// +void TMSAudioDtmfTonePlayer::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) + { + TRACE_PRN_FN_ENT; + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::RecordError +// ----------------------------------------------------------------------------- +// +void TMSAudioDtmfTonePlayer::RecordError(TInt /*aError*/) + { + TRACE_PRN_FN_ENT; + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::ConvertError +// ----------------------------------------------------------------------------- +// +void TMSAudioDtmfTonePlayer::ConvertError(TInt /*aError*/) + { + TRACE_PRN_FN_ENT; + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::DeviceMessage +// ----------------------------------------------------------------------------- +// +void TMSAudioDtmfTonePlayer::DeviceMessage(TUid /*aMessageType*/, + const TDesC8& /*aMsg*/) + { + TRACE_PRN_FN_ENT; + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSAudioDtmfTonePlayer::ConvertVolume +// ----------------------------------------------------------------------------- +// +gint TMSAudioDtmfTonePlayer::ConvertVolume(gint aVolume) + { + TRACE_PRN_FN_ENT; + gint result = iDTMFPlayer->MaxVolume() * aVolume / KMaxVolumeLevel; + TRACE_PRN_FN_EXT; + return result; + } + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmseteldtmfmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmseteldtmfmonitor.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include +#include "tmsdtmfprovider.h" +#include "tmsdtmfobserver.h" +#include "tmseteldtmfmonitor.h" +#include "tmsutility.h" + +using namespace TMS; + +// ----------------------------------------------------------------------------- +// TMSEtelDtmfMonitor::NewL. +// ----------------------------------------------------------------------------- +// +TMSEtelDtmfMonitor* TMSEtelDtmfMonitor::NewL(TMSDTMFProvider& aObserver, + RMmCustomAPI& aMmCustom) + { + TRACE_PRN_FN_ENT; + TMSEtelDtmfMonitor* self = new (ELeave) TMSEtelDtmfMonitor(aObserver, + aMmCustom); + TRACE_PRN_FN_EXT; + return self; + } + +// ----------------------------------------------------------------------------- +// Destructs the object by canceling first ongoing monitoring. +// ----------------------------------------------------------------------------- +// +TMSEtelDtmfMonitor::~TMSEtelDtmfMonitor() + { + TRACE_PRN_FN_ENT; + Cancel(); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// Starts the monitor. +// ----------------------------------------------------------------------------- +// +void TMSEtelDtmfMonitor::StartMonitoring() + { + TRACE_PRN_FN_ENT; + if (!IsActive()) + { + iStatus = KRequestPending; + iMmCustom.NotifyDtmfEvent(iStatus, iEventData); + SetActive(); + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// From CActive. +// Handles line status change notifying. +// ----------------------------------------------------------------------------- +// +void TMSEtelDtmfMonitor::RunL() + { + TRACE_PRN_FN_ENT; + TInt err = iStatus.Int(); + TRACE_PRN_N1(_L("**TMS TMSEtelDtmfMonitor::RunL: status:%d"), err); + + if (err == KErrNone) + { + TMSDTMFObserver::TCCPDtmfEvent event; + if (iEventData.iEvent == RMmCustomAPI::EDtmfStart + && iEventData.iType == RMmCustomAPI::EDtmfManual) + { + event = TMSDTMFObserver::ECCPDtmfManualStart; + } + else if (iEventData.iEvent == RMmCustomAPI::EDtmfStart + && iEventData.iType == RMmCustomAPI::EDtmfSequence) + { + event = TMSDTMFObserver::ECCPDtmfSequenceStart; + } + else if (iEventData.iEvent == RMmCustomAPI::EDtmfStop + && iEventData.iType == RMmCustomAPI::EDtmfManual) + { + event = TMSDTMFObserver::ECCPDtmfManualStop; + } + else if (iEventData.iEvent == RMmCustomAPI::EDtmfStop + && iEventData.iType == RMmCustomAPI::EDtmfSequence) + { + event = TMSDTMFObserver::ECCPDtmfSequenceStop; + } + else if (iEventData.iEvent == RMmCustomAPI::EDtmfAbort + && iEventData.iType == RMmCustomAPI::EDtmfManual) + { + event = TMSDTMFObserver::ECCPDtmfManualAbort; + } + else if (iEventData.iEvent == RMmCustomAPI::EDtmfAbort + && iEventData.iType == RMmCustomAPI::EDtmfSequence) + { + event = TMSDTMFObserver::ECCPDtmfSequenceAbort; + } + else + { + // Refresh and return (no observer notfiying). + TRACE_PRN_N2(_L("**TMS TMSEtelDtmfMonitor::RunL: Unknown event \ + = %¨d, type = %d"), iEventData.iEvent,iEventData.iType); + StartMonitoring(); + return; + } + + iObserver.NotifyDTMFEvent(event, err, iEventData.iTone); + } + else + { + TRACE_PRN_N1(_L("**TMS TMSEtelDtmfMonitor::RunL: Error \ + from DTMF: %d"),err); + } + + // Continue if not in offline mode + if (err != KErrGsmOfflineOpNotAllowed && err != KErrCancel + && err != KErrNotSupported) + { + StartMonitoring(); + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// From CActive +// Canceling functionality. +// ----------------------------------------------------------------------------- +// +void TMSEtelDtmfMonitor::DoCancel() + { + TRACE_PRN_FN_ENT; + if (iStatus == KRequestPending) + { + iMmCustom.CancelAsyncRequest(ECustomNotifyDtmfEventIPC); + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// Constructs the monitor. +// ----------------------------------------------------------------------------- +// +TMSEtelDtmfMonitor::TMSEtelDtmfMonitor(TMSDTMFProvider& aObserver, + RMmCustomAPI& aMmCustom) : + CActive(EPriorityStandard), + iObserver(aObserver), + iMmCustom(aMmCustom) + { + TRACE_PRN_FN_ENT; + CActiveScheduler::Add(this); + TRACE_PRN_FN_EXT; + } + +// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmseteldtmfstopmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmseteldtmfstopmonitor.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include "tmsutility.h" +#include "tmsdtmfobserver.h" +#include "tmsdtmfprovider.h" +#include "tmseteldtmfstopmonitor.h" + +using namespace TMS; + +// ----------------------------------------------------------------------------- +// TMSEtelDtmfStopMonitor::NewL. +// ----------------------------------------------------------------------------- +// +TMSEtelDtmfStopMonitor* TMSEtelDtmfStopMonitor::NewL(TMSDTMFProvider& aObserver, + RMobilePhone& aPhone) + { + TRACE_PRN_FN_EXT; + TMSEtelDtmfStopMonitor* self = new (ELeave) TMSEtelDtmfStopMonitor( + aObserver, aPhone); + TRACE_PRN_FN_EXT; + return self; + } + +// ----------------------------------------------------------------------------- +// Constructs the monitor. +// ----------------------------------------------------------------------------- +// +TMSEtelDtmfStopMonitor::TMSEtelDtmfStopMonitor(TMSDTMFProvider& aObserver, + RMobilePhone& aPhone) : + CActive(EPriorityStandard), + iObserver(aObserver), + iPhone(aPhone) + { + TRACE_PRN_FN_ENT; + CActiveScheduler::Add(this); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// Destructs the object by canceling first ongoing monitoring. +// ----------------------------------------------------------------------------- +// +TMSEtelDtmfStopMonitor::~TMSEtelDtmfStopMonitor() + { + TRACE_PRN_FN_ENT; + Cancel(); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// Starts the monitor. +// ----------------------------------------------------------------------------- +// +void TMSEtelDtmfStopMonitor::StartMonitoring() + { + TRACE_PRN_FN_ENT; + if (!IsActive()) + { + iStatus = KRequestPending; + iPhone.NotifyStopInDTMFString(iStatus); + SetActive(); + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// From CActive. +// Handles line status change notifying. +// ----------------------------------------------------------------------------- +// +void TMSEtelDtmfStopMonitor::RunL() + { + TRACE_PRN_FN_ENT; + gint err = iStatus.Int(); + TRACE_PRN_N1(_L("**TMS TMSEtelDtmfStopMonitor::RunL: status: %d"), err); + + if (err != KErrCancel && err != KErrServerTerminated) + { + TChar tone = NULL; + TMSDTMFObserver::TCCPDtmfEvent event = + TMSDTMFObserver::ECCPDtmfStopInDtmfString; + iObserver.NotifyDTMFEvent(event, err, tone); + } + else + { + TRACE_PRN_N1(_L("**TMS TMSEtelDtmfStopMonitor::RunL: Error \ + from RMobilePhone: %d"),iStatus.Int()); + } + + // Continue if not in offline mode + if (err != KErrGsmOfflineOpNotAllowed && err != KErrCancel + && err != KErrNotSupported) + { + StartMonitoring(); + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// From CActive +// Canceling functionality. +// ----------------------------------------------------------------------------- +// +void TMSEtelDtmfStopMonitor::DoCancel() + { + TRACE_PRN_FN_ENT; + if (iStatus == KRequestPending) + { + iPhone.CancelAsyncRequest(EMobilePhoneNotifyStopInDTMFString); + } + TRACE_PRN_FN_EXT; + } + +// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmsipcalldownlink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmsipcalldownlink.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,911 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include +#include +#include +#include "tmsutility.h" +#include "gsterrorconcealmentinterface.h" +#include "gstg711decoderinterface.h" +#include "gstilbcdecoderinterface.h" +#include "gstg729decoderinterface.h" +#include "ipcallstream.h" + +using namespace TMS; + +static TMSIPDownlink* iSelfDn; +#ifdef _DEBUG +static TInt iHeap; +#endif //_DEBUG +GstBuffer* gstDnlBuffer; +GstCaps* caps; +gint requestBufLen; + +#ifdef __PLAY_WAV_FROM_FILE__ +_LIT16(KTestFile1, "c:\\data\\sounds\\digital\\sample1.wav"); +#endif + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::cb_raw_playback_handoff +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::cb_raw_playback_handoff(GstElement* /*appsrc*/, + guint size) + { + TRACE_PRN_N(_L("TMS->DNL: cb_raw_playback_handoff")); + + requestBufLen = size; + +#ifdef _DEBUG + TInt block; + RHeap &heap = User::Heap(); + TInt avail = heap.Available(block); + RDebug::Print(_L("TMS->PRINT-HEAP-DN:Size[%d], Available[%d], delta[%d]"), + heap.Size(), avail, (iHeap - avail)); + iHeap = avail; +#endif //_DEBUG + iSelfDn->BufferToBeFilled(); + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::bus_call +// ----------------------------------------------------------------------------- +// +gboolean TMSIPDownlink::bus_call(GstBus* /*bus*/, GstMessage* msg, + gpointer /*data*/) + { + switch (GST_MESSAGE_TYPE(msg)) + { + case GST_MESSAGE_EOS: + { + gst_element_set_state(iSelfDn->iPipelinePlay, GST_STATE_NULL); + gst_object_unref(GST_OBJECT(iSelfDn->iPipelinePlay)); + break; + } + case GST_MESSAGE_ERROR: + { + gchar* debug; + GError* err; + gst_message_parse_error(msg, &err, &debug); + g_free(debug); + g_print("Error: %s\n", err->message); + g_error_free(err); + break; + } + default: + { + break; + } + } + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::gst_initialize_play +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::gst_initialize_play() + { + TRACE_PRN_FN_ENT; + + gint err = KErrNone; + + // create elements + iPipelinePlay = gst_pipeline_new("pipelinePlay"); + iAppSrc = gst_element_factory_make("appsrc", "source"); + iSink = gst_element_factory_make("devsoundsink", "sink"); + + if (!iAppSrc || !iSink) + { + err = KErrNotFound; + TRACE_PRN_IF_ERR(err); + return err; + } + + iBusPlay = gst_pipeline_get_bus(GST_PIPELINE(iPipelinePlay)); + gst_bus_add_watch(iBusPlay, TMSIPDownlink::bus_call, NULL); + gst_object_unref(iBusPlay); + + iMaxBufLen = ConfigureMedia(iCodecID); + + g_object_set(iAppSrc, "stream-type", 0, "blocksize", iMaxBufLen, NULL); + gst_bin_add_many(GST_BIN(iPipelinePlay), iAppSrc, iSink, NULL); + gst_element_link(iAppSrc, iSink); + + caps = gst_caps_new_simple(iMediaType, + "width", G_TYPE_INT, 16, + "depth", G_TYPE_INT, 16, + "signed", G_TYPE_BOOLEAN, TRUE, + "endianness", G_TYPE_INT, G_BYTE_ORDER, + "rate", G_TYPE_INT, 8000, + "channels", G_TYPE_INT, 1, + NULL); + + //NOTE: d/s is not ready at this time to return true maxvolume + TInt maxvol = 10; +#ifdef __WINSCW__ + maxvol = 10000; +#endif //__WINSCW__ + g_object_set(G_OBJECT(iSink), + "volume", maxvol, +#ifndef __WINSCW__ + "priority", (gint)iPriority.iPriority, + "preference", (gint)iPriority.iPref, +#endif + NULL); + + gst_app_src_set_caps(GST_APP_SRC(iAppSrc), caps); + gst_app_src_set_max_bytes(GST_APP_SRC(iAppSrc), iMaxBufLen); + err = SetCodecCi(); + //gst_element_set_state(iPipelinePlay, GST_STATE_READY); + + TRACE_PRN_FN_EXT; + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::gst_play_raw +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::gst_play_raw() + { + TRACE_PRN_FN_ENT; + + // start playback + gst_element_set_state(iPipelinePlay, GST_STATE_PLAYING); + + //configure the appsrc, we will push buffer to appsrc when it needs more data + g_signal_connect(iAppSrc, "need-data", + G_CALLBACK (cb_raw_playback_handoff), + NULL); + TRACE_PRN_FN_EXT; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::TMSIPDownlink +// Standard Constructor +// ----------------------------------------------------------------------------- +// +TMSIPDownlink::TMSIPDownlink() + { + iSelfDn = this; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::~TMSIPDownlink +// Standard Constructor +// ----------------------------------------------------------------------------- +// +TMSIPDownlink::~TMSIPDownlink() + { + TRACE_PRN_FN_ENT; + + Stop(); + gst_caps_unref(caps); + gst_object_unref(GST_OBJECT(iPipelinePlay)); + gst_deinit(); + + delete iErrConcealmentIntfc; + delete iG711DecoderIntfc; + delete iG729DecoderIntfc; + delete iIlbcDecoderIntfc; + +#ifdef __PLAY_WAV_FROM_FILE__ + iFs.Close(); + delete fbuf; +#endif + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::NewL +// Symbian two-phase constructor +// ----------------------------------------------------------------------------- +// +TMSIPDownlink* TMSIPDownlink::NewL(const guint32 codecID, + const TMMFPrioritySettings priority) + { + TMSIPDownlink* self = new (ELeave) TMSIPDownlink(); + CleanupStack::PushL(self); + self->ConstructL(codecID, priority); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::ConstructL +// Part two of Symbian two phase construction +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::ConstructL(const guint32 codecID, + const TMMFPrioritySettings priority) + { + TRACE_PRN_FN_ENT; + + iCodecID = codecID; + iPriority = priority; + // SetTime(); + gst_init(NULL, NULL); + // CalcLatency(); + // SetTime(); + + gint err = gst_initialize_play(); + if (err != TMS_RESULT_SUCCESS) + { + User::Leave(err); + } + + // Client must set these before querying! + iG711DecodeMode = TMS_G711_CODEC_MODE_ALAW; + iILBCDecodeMode = TMS_ILBC_CODEC_MODE_20MS_FRAME; + +#ifdef __PLAY_WAV_FROM_FILE__ + iReadSize = KVoIPPCM16FrameLen; + err = iFs.Connect(); + if (err == KErrNone) + { + err = iFile.Open(iFs, KTestFile1, EFileShareAny | EFileRead); + } + if (err == KErrNone) + { + iFile.Size(fsize); + } + fbuf = HBufC8::NewL(fsize); + TPtr8 p = fbuf->Des(); + iFile.Read(p, fsize); + iFile.Close(); +#endif + // CalcLatency(); + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::Start +// +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::Start() + { + TRACE_PRN_FN_ENT; + + gst_play_raw(); + iStatus = EStreaming; + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::Stop +// +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::Stop() + { + TRACE_PRN_FN_ENT; + + if (iStatus == EStreaming) + { + if (iPipelinePlay != NULL && + iPipelinePlay->current_state == GST_STATE_PLAYING) + { + gst_element_set_state(iPipelinePlay, GST_STATE_NULL); + } + + iStatus = EReady; + } + + if (gstDnlBuffer) + { + gst_buffer_unref(gstDnlBuffer); + } + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::BufferToBeFilled +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::BufferToBeFilled() + { + TRACE_PRN_N1(_L("TMS->DNL->BTBF: requestBufLen[%d]"), requestBufLen); + +#ifndef __PLAY_WAV_FROM_FILE__ + // Create or adjust the chunk + TInt err = DoChunk(requestBufLen, iMsgBuffer); + + if (err != TMS_RESULT_SUCCESS) + { + Stop(); + iMsgBuffer.iStatus = err; + } + else + { + // Notify client there is buffer ready to be filled + iMsgBuffer.iStatus = iChunk.Handle(); + iMsgBuffer.iInt = requestBufLen; + iStatus = EStreaming; + // If chunk is opened, we will expect a call from the client to + // get chunk handle. When we get a call to copy chunk handle, + // check these variables and see if they match. This is not + // completely secure, but will provide some level of security + if (iMsgBuffer.iBool == TRUE) + { + iWriteDataXferHndlToClient = TRUE; + iKey = iMsgBuffer.iUint32; + } + } + + iMsgBuffer.iRequest = ECmdFillBuffer; + iMsgQueue.Send(iMsgBuffer); + +#else //__PLAY_WAV_FROM_FILE__ + TInt err = KErrNone; + BufferFilled(); +#endif //__PLAY_WAV_FROM_FILE__ + TRACE_PRN_IF_ERR(err); + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::BufferFilled +// +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::BufferFilled(const guint buflen) + { +#ifndef __PLAY_WAV_FROM_FILE__ + gstDnlBuffer = gst_buffer_new(); + gst_buffer_set_caps(gstDnlBuffer, caps); + GST_BUFFER_SIZE(gstDnlBuffer) = buflen; + + //TODO: what if bufLen > requestBufLen? + + // IMPL#1: + // gstDnlBuffer->data pointer is set to use chunk pointer. + // Although unlikely in the pull mode, this may potentially result + // in data loss if chunk gets overwritten before it is consumed. + gst_buffer_set_data(gstDnlBuffer, iChunk.Base(), buflen); + + // IMPL#2 + // Alternative implementation with new buffer alloc and memcpy. + // GStreamer will free this memory when buffer refcount becomes 0. + //guint8* ptr = (guint8*)g_malloc(buflen); + //GST_BUFFER_MALLOCDATA(gstDnlBuffer) = GST_BUFFER_DATA(gstDnlBuffer) = ptr; + //memcpy(ptr, iChunk.Base(), buflen); + +#else //__PLAY_WAV_FROM_FILE__ + User::After(TTimeIntervalMicroSeconds32(150000)); + + TPtr8 p = fbuf->Des(); + TInt buflen = iReadSize; + gstDnlBuffer = gst_buffer_new_and_alloc(buflen); + gst_buffer_set_caps(gstDnlBuffer, caps); + unsigned char* ptr = (unsigned char*)((fbuf->Ptr())+iReadBytes); + gst_buffer_set_data(gstDnlBuffer, ptr, buflen); + + if ((iReadBytes + iReadSize> fsize)) + { + // start over from the beginning + iReadBytes = 0; + } + else + { + iReadBytes += iReadSize; + } + +#endif //__PLAY_WAV_FROM_FILE__ + gst_app_src_push_buffer(GST_APP_SRC(iAppSrc), gstDnlBuffer); + TRACE_PRN_N1(_L("TMS->DNL->BF: LEN[%d]"), buflen); + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetCodecCi +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetCodecCi() + { + TRAPD(err, SetCodecCiL()); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetCodecCiL +// +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::SetCodecCiL() + { + TRACE_PRN_FN_ENT; + + switch (iCodecID) + { + case KMccFourCCIdG711: + { + if (!iG711DecoderIntfc) + { + iG711DecoderIntfc = GST_G711_DECODER_GET_IFACE(iSink); + } + break; + } + case KMccFourCCIdG729: + { + if (!iG729DecoderIntfc) + { + iG729DecoderIntfc = GST_G729_DECODER_GET_IFACE(iSink); + } + break; + } + case KMccFourCCIdILBC: + { + if (!iIlbcDecoderIntfc) + { + iIlbcDecoderIntfc = GST_ILBC_DECODER_GET_IFACE(iSink); + } + break; + } + case KMccFourCCIdAMRNB: + case KMMFFourCCCodePCM16: + { + break; + } + default: + { + User::Leave(TMS_RESULT_INVALID_ARGUMENT); + } + } + + if (iCodecID == KMccFourCCIdG711 || + iCodecID == KMccFourCCIdG729 || + iCodecID == KMccFourCCIdILBC || + iCodecID == KMccFourCCIdAMRNB) + { + if (!iErrConcealmentIntfc) + { + iErrConcealmentIntfc = GST_ERROR_CONCEALMENT_GET_IFACE(iSink); + } + } + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetVolume(const guint volume) + { + g_object_set(G_OBJECT(iSink), "volume", volume, NULL); + TRACE_PRN_N1(_L("TMS->DNL: SetVolume [%d]"), volume); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetVolume(guint& volume) + { + g_object_get(G_OBJECT(iSink), "volume", &volume, NULL); + TRACE_PRN_N1(_L("TMS->DNL: GetVolume [%d]"), volume); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetMaxVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetMaxVolume(guint& volume) + { + g_object_get(G_OBJECT(iSink), "maxvolume", &volume, NULL); + TRACE_PRN_N1(_L("TMS->DNL: MaxVolume [%d]"), volume); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetDataXferChunkHndl +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk) + { + gint status = TMS_RESULT_DOES_NOT_EXIST; + + if (iChunk.Handle()) + { + if (iWriteDataXferHndlToClient && (iKey == key)) + { + chunk = iChunk; + iWriteDataXferHndlToClient = FALSE; + iKey = 0; + status = TMS_RESULT_SUCCESS; + } + else + { + status = TMS_RESULT_ILLEGAL_OPERATION; + } + } + + TRACE_PRN_IF_ERR(status); + return status; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetIlbcCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetIlbcCodecMode(gint mode) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + iILBCDecodeMode = mode; + + if (iIlbcDecoderIntfc && iCodecID == KMccFourCCIdILBC) + { + if (mode == TMS_ILBC_CODEC_MODE_20MS_FRAME) + { + err = iIlbcDecoderIntfc->SetDecoderMode(E20msFrame); + TRACE_PRN_N(_L("TMS->DNL: iLBC Mode Set [20ms]")); + } + else if (mode == TMS_ILBC_CODEC_MODE_30MS_FRAME) + { + err = iIlbcDecoderIntfc->SetDecoderMode(E30msFrame); + TRACE_PRN_N(_L("TMS->DNL: iLBC Mode Set [30ms]")); + } + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetIlbcCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetIlbcCodecMode(gint& mode) + { + // not available through CIs -> return cashed value + mode = iILBCDecodeMode; + TRACE_PRN_N1(_L("TMS->DNL: GetIlbcCodecMode [%d]"), mode); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetG711CodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetG711CodecMode(gint mode) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + iG711DecodeMode = mode; + + if (iG711DecoderIntfc && iCodecID == KMccFourCCIdG711) + { + if (mode == TMS_G711_CODEC_MODE_ALAW) + { + err = iG711DecoderIntfc->SetDecoderMode(EDecALaw); + TRACE_PRN_N(_L("TMS->DNL: G711 Mode Set [ALaw]")); + } + else if (mode == TMS_G711_CODEC_MODE_MULAW) + { + err = iG711DecoderIntfc->SetDecoderMode(EDecULaw); + TRACE_PRN_N(_L("TMS->DNL: G711 Mode Set [uLaw]")); + } + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetG711CodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetG711CodecMode(gint& mode) + { + // not available through CIs -> return cached value + mode = iG711DecodeMode; + TRACE_PRN_N1(_L("TMS->DNL: GetG711CodecMode [%d]"), mode); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::FrameModeRqrdForEC +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::FrameModeRqrdForEC(gboolean& frmodereq) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + if (iErrConcealmentIntfc) + { + err = iErrConcealmentIntfc->FrameModeRqrdForEC(&frmodereq); + TRACE_PRN_N1(_L("TMS->DNL: FrameModeRqrdForEC [%d]"), frmodereq); + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetFrameMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetFrameMode(const gboolean frmode) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + iFrameMode = frmode; + + if (iErrConcealmentIntfc) + { + err = iErrConcealmentIntfc->SetFrameMode(frmode); + TRACE_PRN_N1(_L("TMS->DNL: SetFrameMode [%d]"), frmode); + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetFrameMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetFrameMode(gboolean& frmode) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iErrConcealmentIntfc) + { + // not available through CIs -> return cached value + frmode = iFrameMode; + TRACE_PRN_N1(_L("TMS->DNL: GetFrameMode [%d]"), frmode); + err = TMS_RESULT_SUCCESS; + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::ConcealErrorForNextBuffer +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::ConcealErrorForNextBuffer() + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iErrConcealmentIntfc) + { + err = iErrConcealmentIntfc->ConcealErrorForNextBuffer(); + TRACE_PRN_N(_L("TMS->DNL: ConcealErrorForNextBuffer")); + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetCng +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetCng(const TMSFormatType fmttype, const gboolean cng) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) + { + err = iG711DecoderIntfc->SetCng(cng); + TRACE_PRN_N1(_L("TMS->DNL: SetCng [%d]"), cng); + } + else if (fmttype == TMS_FORMAT_ILBC && iIlbcDecoderIntfc) + { + err = iIlbcDecoderIntfc->SetCng(cng); + TRACE_PRN_N1(_L("TMS->DNL: SetCng [%d]"), cng); + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetCng +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetCng(const TMSFormatType fmttype, gboolean& cng) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) + { + err = iG711DecoderIntfc->GetCng(&cng); + TRACE_PRN_N1(_L("TMS->DNL: GetCng [%d]"), cng); + } + else if (fmttype == TMS_FORMAT_ILBC && iIlbcDecoderIntfc) + { + err = iIlbcDecoderIntfc->GetCng(&cng); + TRACE_PRN_N1(_L("TMS->DNL: GetCng [%d]"), cng); + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetPlc +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetPlc(const TMSFormatType fmttype, const gboolean plc) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) + { + iPlc = plc; + err = iG711DecoderIntfc->SetPlc(iPlc); + TRACE_PRN_N1(_L("TMS->DNL: SetPlc [%d]"), plc); + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetPlc +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetPlc(const TMSFormatType fmttype, gboolean& plc) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) + { + // not available through CIs -> return cached value + plc = iPlc; + err = TMS_RESULT_SUCCESS; + TRACE_PRN_N1(_L("TMS->DNL: GetPlc [%d]"), plc); + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::BadLsfNextBuffer +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::BadLsfNextBuffer() + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EStreaming) + { + if (iCodecID == KMccFourCCIdG729 && iG729DecoderIntfc) + { + err = iG729DecoderIntfc->BadLsfNextBuffer(); + TRACE_PRN_N(_L("TMS->DNL: BadLsfNextBuffer")); + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetAudioDeviceL +// +// ----------------------------------------------------------------------------- +void TMSIPDownlink::SetAudioDeviceL(TMSAudioOutput output) + { + gint outputDev; + + // ENoPreference=0, EAll=1, ENoOutput=2, EPrivate=3, EPublic=4 + switch (output) + { + case TMS_AUDIO_OUTPUT_PRIVATE: + case TMS_AUDIO_OUTPUT_HANDSET: + outputDev = (gint)CAudioOutput::EPrivate; + break; + case TMS_AUDIO_OUTPUT_PUBLIC: + case TMS_AUDIO_OUTPUT_LOUDSPEAKER: + outputDev = (gint)CAudioOutput::EPublic; + break; + default: // Use default device routing + outputDev = (gint)CAudioOutput::ENoPreference; + break; + } + + g_object_set(G_OBJECT(iSink), "outputdevice", outputDev, NULL); + TRACE_PRN_N1(_L("TMS->DNL: SetAudioDeviceL [%d]"), outputDev); + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetAudioDeviceL +// +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::GetAudioDeviceL(TMSAudioOutput& output) + { + TRACE_PRN_FN_ENT; + + gint outputDev; + g_object_get(G_OBJECT(iSink), "outputdevice", &outputDev, NULL); + TRACE_PRN_N1(_L("TMS->DNL: GetAudioDevice [%d]"), outputDev); + + switch (outputDev) + { + case CAudioOutput::ENoPreference: + case CAudioOutput::EAll: + case CAudioOutput::ENoOutput: + case CAudioOutput::EPrivate: + output = TMS_AUDIO_OUTPUT_PRIVATE; + break; + case CAudioOutput::EPublic: + output = TMS_AUDIO_OUTPUT_PUBLIC; + break; + default: + output = TMS_AUDIO_OUTPUT_PRIVATE; + break; + } + + TRACE_PRN_FN_EXT; + } + +// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmsipcalldownlinkds.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmsipcalldownlinkds.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,815 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include "tmsutility.h" +#include "tmsipcallstream.h" + +using namespace TMS; + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::TMSIPDownlink +// Standard Constructor +// ----------------------------------------------------------------------------- +// +TMSIPDownlink::TMSIPDownlink() + { + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::~TMSIPDownlink +// Standard Constructor +// ----------------------------------------------------------------------------- +// +TMSIPDownlink::~TMSIPDownlink() + { + TRACE_PRN_FN_ENT; + + Stop(); + + delete iAudioOutput; + delete iErrConcealmentIntfc; + delete iG711DecoderIntfc; + delete iG729DecoderIntfc; + delete iIlbcDecoderIntfc; + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::NewL +// Symbian two-phase constructor +// ----------------------------------------------------------------------------- +// +TMSIPDownlink* TMSIPDownlink::NewL(const guint32 codecID, + const TMMFPrioritySettings priority) + { + TMSIPDownlink* self = new (ELeave) TMSIPDownlink(); + CleanupStack::PushL(self); + self->ConstructL(codecID, priority); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::ConstructL +// Part two of Symbian two phase construction +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::ConstructL(const guint32 codecID, + const TMMFPrioritySettings priority) + { + TRACE_PRN_FN_ENT; + + iCodecID = codecID; + iPriority = priority; + + // Client must set these before querying! + iG711DecodeMode = TMS_G711_CODEC_MODE_ALAW; + iILBCDecodeMode = TMS_ILBC_CODEC_MODE_20MS_FRAME; + + TRAPD(err, InitDevSoundL(EMMFStatePlaying, priority)); + if (err != TMS_RESULT_SUCCESS) + { + User::Leave(err); + } + + iMaxBufLen = ConfigureMedia(iCodecID); + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::Start +// +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::Start() + { + TRACE_PRN_FN_ENT; + + gint err = TMS_RESULT_ILLEGAL_OPERATION; + + if (iStatus == EReady && iDevSound) + { + TRAP(err, iDevSound->PlayInitL()); + TRACE_PRN_IF_ERR(err); + +#ifdef _DEBUG + iSamplesPlayedCount = 0; +#endif + if (err != TMS_RESULT_SUCCESS) + { + iStatus = EReady; + } + } + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::Stop +// +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::Stop() + { + TRACE_PRN_FN_ENT; + + if (iStatus == EStreaming && iDevSound) + { + iDevSound->Stop(); + iStatus = EReady; + } + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::BufferToBeFilled +// A reference to the buffer delivered from the DevSound is stored locally +// for later use. It will be filled with the data passed from the client +// when it calls BufferFilled. +// +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::BufferToBeFilled(CMMFBuffer* aBuffer) + { + // Store pointer to the received buffer + iDevSoundBufPtr = static_cast(aBuffer); + iBufLen = iDevSoundBufPtr->RequestSize(); + TRACE_PRN_N1(_L("TMS->DNL->BTBF: LEN[%d]"), iBufLen); + +#ifndef __WINSCW__ + //TODO: revisit this! + // The first AMR buffer returns 1 for no data frame. + /*if (iCodecID == KMccFourCCIdAMRNB) + { + iBufLen = iMaxBufLen; + }*/ +#endif //__WINSCW__ + // Create or adjust the chunk + gint err = DoChunk(iBufLen, iMsgBuffer); + + if (err != TMS_RESULT_SUCCESS) + { + Stop(); + iMsgBuffer.iStatus = err; + } + else + { + // Notify client there is buffer ready to be filled + iMsgBuffer.iStatus = err; + iMsgBuffer.iInt = iBufLen; + iStatus = EStreaming; + // If chunk is opened, we will expect a call from the client to + // get chunk handle. When we get a call to copy chunk handle, + // check these variables and see if they match. This is not + // completely secure, but will provide some level of security + if (iMsgBuffer.iBool == TRUE) + { + iWriteDataXferHndlToClient = TRUE; + iKey = iMsgBuffer.iUint32; + } + } + + iMsgBuffer.iRequest = ECmdFillBuffer; + err = iMsgQueue.Send(iMsgBuffer); + + TRACE_PRN_IF_ERR(err); + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::BufferFilled +// +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::BufferFilled(const guint buflen) + { + TRACE_PRN_N1(_L("TMS->DNL->BF: LEN[%d]"), buflen); + + // Copy data over from chunk + TPtr8 dataPtr(iChunk.Base(), buflen, iMaxBufLen); + // RDebug::RawPrint(dataPtr); + + if (iStatus == EStreaming && iDevSound && iDevSoundBufPtr) + { + // Fill D/S buffer and send it for playback + iDevSoundBufPtr->Data() = dataPtr; + TRAP_IGNORE(iDevSoundBufPtr->SetRequestSizeL(buflen)); + //try playing anyway + iDevSound->PlayData(); + } + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetCodecCi +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetCodecCi() + { + TRAPD(err, SetCodecCiL()); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetCodecCiL +// +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::SetCodecCiL() + { + TRACE_PRN_FN_ENT; + + switch (iCodecID) + { + case KMccFourCCIdG711: + { + if (!iG711DecoderIntfc) + { + iG711DecoderIntfc = CG711DecoderIntfc::NewL(*iDevSound); + } + break; + } + case KMccFourCCIdG729: + { + if (!iG729DecoderIntfc) + { + iG729DecoderIntfc = CG729DecoderIntfc::NewL(*iDevSound); + } + break; + } + case KMccFourCCIdILBC: + { + if (!iIlbcDecoderIntfc) + { + iIlbcDecoderIntfc = CIlbcDecoderIntfc::NewL(*iDevSound); + } + break; + } + case KMccFourCCIdAMRNB: + case KMMFFourCCCodePCM16: + { + break; + } + default: + { + User::Leave(TMS_RESULT_INVALID_ARGUMENT); + break; + } + } + + if (!iErrConcealmentIntfc && iCodecID != KMMFFourCCCodePCM16) + { + iErrConcealmentIntfc = CErrorConcealmentIntfc::NewL(*iDevSound); + } + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetVolume(const guint volume) + { + gint ret(TMS_RESULT_UNINITIALIZED_OBJECT); + if (iDevSound) + { + iDevSound->SetVolume(volume); + ret = TMS_RESULT_SUCCESS; + } + TRACE_PRN_N1(_L("TMS->DNL: SetVolume [%d]"), volume); + return ret; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetVolume(guint& volume) + { + gint ret(TMS_RESULT_UNINITIALIZED_OBJECT); + if (iDevSound) + { + volume = iDevSound->Volume(); + ret = TMS_RESULT_SUCCESS; + } + TRACE_PRN_N1(_L("TMS->DNL: GetVolume [%d]"), volume); + return ret; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetMaxVolume +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetMaxVolume(guint& volume) + { + gint ret(TMS_RESULT_UNINITIALIZED_OBJECT); + if (iDevSound) + { + volume = iDevSound->MaxVolume(); + ret = TMS_RESULT_SUCCESS; + } + TRACE_PRN_N1(_L("TMS->DNL: MaxVolume [%d]"), volume); + return ret; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetDataXferChunkHndl +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk) + { + gint status = TMS_RESULT_DOES_NOT_EXIST; + + if (iChunk.Handle()) + { + if (iWriteDataXferHndlToClient && (iKey == key)) + { + chunk = iChunk; + iWriteDataXferHndlToClient = FALSE; + iKey = 0; + status = TMS_RESULT_SUCCESS; + } + else + { + status = TMS_RESULT_ILLEGAL_OPERATION; + } + } + + TRACE_PRN_IF_ERR(status); + return status; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetIlbcCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetIlbcCodecMode(gint mode) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + iILBCDecodeMode = mode; + + if (iIlbcDecoderIntfc && iCodecID == KMccFourCCIdILBC) + { + if (mode == TMS_ILBC_CODEC_MODE_20MS_FRAME) + { + err = iIlbcDecoderIntfc->SetDecoderMode( + CIlbcDecoderIntfc::E20msFrame); + TRACE_PRN_N(_L("TMS->DNL: iLBC Mode Set [20ms]")); + } + else if (mode == TMS_ILBC_CODEC_MODE_30MS_FRAME) + { + err = iIlbcDecoderIntfc->SetDecoderMode( + CIlbcDecoderIntfc::E30msFrame); + TRACE_PRN_N(_L("TMS->DNL: iLBC Mode Set [30ms]")); + } + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetIlbcCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetIlbcCodecMode(gint& mode) + { + // not available through CIs -> return cashed value + mode = iILBCDecodeMode; + TRACE_PRN_N1(_L("TMS->DNL: GetIlbcCodecMode [%d]"), mode); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetG711CodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetG711CodecMode(gint mode) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + iG711DecodeMode = mode; + + if (iG711DecoderIntfc && iCodecID == KMccFourCCIdG711) + { + if (mode == TMS_G711_CODEC_MODE_ALAW) + { + err = iG711DecoderIntfc->SetDecoderMode( + CG711DecoderIntfc::EDecALaw); + TRACE_PRN_N(_L("TMS->DNL: G711 Mode Set [ALaw]")); + } + else if (mode == TMS_G711_CODEC_MODE_MULAW) + { + err = iG711DecoderIntfc->SetDecoderMode( + CG711DecoderIntfc::EDecULaw); + TRACE_PRN_N(_L("TMS->DNL: G711 Mode Set [uLaw]")); + } + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetG711CodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetG711CodecMode(gint& mode) + { + // not available through CIs -> return cached value + mode = iG711DecodeMode; + TRACE_PRN_N1(_L("TMS->DNL: GetG711CodecMode [%d]"), mode); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::FrameModeRqrdForEC +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::FrameModeRqrdForEC(gboolean& frmodereq) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + if (iErrConcealmentIntfc) + { + err = iErrConcealmentIntfc->FrameModeRqrdForEC(frmodereq); + TRACE_PRN_N1(_L("TMS->DNL: FrameModeRqrdForEC [%d]"), frmodereq); + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetFrameMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetFrameMode(const gboolean frmode) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + iFrameMode = frmode; + + if (iErrConcealmentIntfc) + { + err = iErrConcealmentIntfc->SetFrameMode(frmode); + TRACE_PRN_N1(_L("TMS->DNL: SetFrameMode [%d]"), frmode); + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetFrameMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetFrameMode(gboolean& frmode) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iErrConcealmentIntfc) + { + // not available through CIs -> return cached value + frmode = iFrameMode; + TRACE_PRN_N1(_L("TMS->DNL: GetFrameMode [%d]"), frmode); + err = TMS_RESULT_SUCCESS; + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::ConcealErrorForNextBuffer +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::ConcealErrorForNextBuffer() + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iErrConcealmentIntfc) + { + err = iErrConcealmentIntfc->ConcealErrorForNextBuffer(); + TRACE_PRN_N(_L("TMS->DNL: ConcealErrorForNextBuffer")); + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetCng +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetCng(const TMSFormatType fmttype, const gboolean cng) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) + { + err = iG711DecoderIntfc->SetCng(cng); + TRACE_PRN_N1(_L("TMS->DNL: SetCng [%d]"), cng); + } + else if (fmttype == TMS_FORMAT_ILBC && iIlbcDecoderIntfc) + { + err = iIlbcDecoderIntfc->SetCng(cng); + TRACE_PRN_N1(_L("TMS->DNL: SetCng [%d]"), cng); + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetCng +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetCng(const TMSFormatType fmttype, gboolean& cng) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) + { + err = iG711DecoderIntfc->GetCng(cng); + TRACE_PRN_N1(_L("TMS->DNL: GetCng [%d]"), cng); + } + else if (fmttype == TMS_FORMAT_ILBC && iIlbcDecoderIntfc) + { + err = iIlbcDecoderIntfc->GetCng(cng); + TRACE_PRN_N1(_L("TMS->DNL: GetCng [%d]"), cng); + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetPlc +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::SetPlc(const TMSFormatType fmttype, const gboolean plc) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) + { + iPlc = plc; + err = iG711DecoderIntfc->SetPlc(iPlc); + TRACE_PRN_N1(_L("TMS->DNL: SetPlc [%d]"), plc); + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetPlc +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::GetPlc(const TMSFormatType fmttype, gboolean& plc) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (fmttype == TMS_FORMAT_G711 && iG711DecoderIntfc) + { + // not available through CIs -> return cached value + plc = iPlc; + err = TMS_RESULT_SUCCESS; + TRACE_PRN_N1(_L("TMS->DNL: GetPlc [%d]"), plc); + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::BadLsfNextBuffer +// +// ----------------------------------------------------------------------------- +// +gint TMSIPDownlink::BadLsfNextBuffer() + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EStreaming) + { + if (iCodecID == KMccFourCCIdG729 && iG729DecoderIntfc) + { + err = iG729DecoderIntfc->BadLsfNextBuffer(); + TRACE_PRN_N(_L("TMS->DNL: BadLsfNextBuffer")); + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::SetAudioDeviceL +// +// ----------------------------------------------------------------------------- +void TMSIPDownlink::SetAudioDeviceL(TMSAudioOutput output) + { + TRACE_PRN_FN_ENT; + + if (!iAudioOutput) + { + iAudioOutput = CAudioOutput::NewL(*iDevSound); + } + + if (iAudioOutput) + { + // ENoPreference=0, EAll=1, ENoOutput=2, EPrivate=3, EPublic=4 + CAudioOutput::TAudioOutputPreference outputDev; + + switch (output) + { + case TMS_AUDIO_OUTPUT_PRIVATE: + case TMS_AUDIO_OUTPUT_HANDSET: + outputDev = CAudioOutput::EPrivate; + break; + case TMS_AUDIO_OUTPUT_PUBLIC: + case TMS_AUDIO_OUTPUT_LOUDSPEAKER: + outputDev = CAudioOutput::EPublic; + break; + default: // Use default device routing + outputDev = CAudioOutput::ENoPreference; + break; + } + + iAudioOutput->SetAudioOutputL(outputDev); + TRACE_PRN_N1(_L("TMS->DNL: SetAudioDeviceL [%d]"), outputDev); + } + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::GetAudioDeviceL +// +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::GetAudioDeviceL(TMSAudioOutput& output) + { + TRACE_PRN_FN_ENT; + + if (!iAudioOutput) + { + iAudioOutput = CAudioOutput::NewL(*iDevSound); + } + + if (iAudioOutput) + { + CAudioOutput::TAudioOutputPreference outputDev = + iAudioOutput->AudioOutput(); + + switch (outputDev) + { + case CAudioOutput::ENoPreference: + case CAudioOutput::EAll: + case CAudioOutput::ENoOutput: + case CAudioOutput::EPrivate: + output = TMS_AUDIO_OUTPUT_PRIVATE; + break; + case CAudioOutput::EPublic: + output = TMS_AUDIO_OUTPUT_PUBLIC; + break; + default: + output = TMS_AUDIO_OUTPUT_PRIVATE; + break; + } + } + + TRACE_PRN_FN_EXT; + } + +// CALLBACKS + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::InitializeComplete +// A callback from the DevSound indicating completion of the initialization. +// It will send config data to the D/S and configure the encoder via CI. +// If everything goes well, the state of the thread is set EReady. +// The initialization completion message is sent back to the main thread. +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::InitializeComplete(TInt aError) + { + TRACE_PRN_FN_ENT; + + gint err = aError; + + if (err == TMS_RESULT_SUCCESS && iDevSound) + { + TMMFCapabilities conf; + conf = iDevSound->Config(); + conf.iRate = EMMFSampleRate8000Hz; + conf.iChannels = EMMFMono; + TRAP(err, iDevSound->SetConfigL(conf)); + if (err == TMS_RESULT_SUCCESS) + { + // We are ready to stream even in case of later CI setting failure + iStatus = EReady; + iMaxVolume = iDevSound->MaxVolume(); + } + + // Init Custom Interface API to the decoder + err = SetCodecCi(); + if (err != TMS_RESULT_SUCCESS) + { + // DEBUG only + // Can ignore error - although decoder is not fully configured but + // it can still run in the default mode. + TRACE_PRN_IF_ERR(err); + } + } + + // TODO: Notify client + + TRACE_PRN_IF_ERR(err); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPDownlink::PlayError +// From MDevSoundObserver +// Record error is send to client over comm channel. +// The state of recorder is rolled back to EReady. +// ----------------------------------------------------------------------------- +// +void TMSIPDownlink::PlayError(TInt /*aError*/) + { + //TRACE_PRN_IF_ERR(aError); + +#ifdef _DEBUG + iSamplesPlayedCount = 0; +#endif + iStatus = EReady; + + // TODO: Notify client + } + +// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmsipcallstreambase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmsipcallstreambase.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include +#include "tmsutility.h" +#include "tmsshared.h" +#include "tmsipcallstream.h" + +using namespace TMS; + +// ----------------------------------------------------------------------------- +// TMSIPCallStreamBase::~TMSIPCallStreamBase +// Destructor +// ----------------------------------------------------------------------------- +// +TMSIPCallStreamBase::~TMSIPCallStreamBase() + { + TRACE_PRN_FN_ENT; + + if (iChunk.Handle() > 0) + { + iChunk.Close(); + } + +#ifndef __USE_GSTREAMER__ + delete iDevSound; +#endif //__USE_GSTREAMER__ + TRACE_PRN_FN_EXT; + } + +#ifndef __USE_GSTREAMER__ +// ----------------------------------------------------------------------------- +// TMSIPCallStreamBase::InitDevSoundL +// +// ----------------------------------------------------------------------------- +// +void TMSIPCallStreamBase::InitDevSoundL(const TMMFState aDevSoundState, + const TMMFPrioritySettings priority) + { + TRACE_PRN_FN_ENT; + + if (!iDevSound) + { + // Create D/S recording/playing device + iDevSound = CMMFDevSound::NewL(); + } + + if (iDevSound) + { + iDevSound->InitializeL(*this, TFourCC(iCodecID), aDevSoundState); + iDevSound->SetPrioritySettings(priority); + } + } +#endif //__USE_GSTREAMER__ + +// ----------------------------------------------------------------------------- +// TMSIPCallStreamBase::SetMsgQueue +// +// ----------------------------------------------------------------------------- +// +void TMSIPCallStreamBase::SetMsgQueue(const RMsgQueue aMsgQueue) + { + iMsgQueue = aMsgQueue; + } + +// ----------------------------------------------------------------------------- +// TMSIPCallStreamBase::ConfigureMedia +// +// ----------------------------------------------------------------------------- +// +gint TMSIPCallStreamBase::ConfigureMedia(const guint32 aCodecID) + { + gint framelen = 0; + + switch (aCodecID) + { + case KMccFourCCIdG711: + iMediaType = "audio/x-alaw"; + // iMediaType = "audio/x-mulaw"; + framelen = KTMSG711FrameLen10ms; //TODO: may be H/W specific! + //framelen = KTMSG711FrameLen20ms; + break; + case KMccFourCCIdG729: + iMediaType = "audio/g729"; + framelen = KTMSG729FrameLen; + break; + case KMccFourCCIdILBC: + iMediaType = "audio/ilbc"; + framelen = KTMSILBCFrameLen20ms; + //framelen = KTMSILBCFrameLen30ms; + break; + case KMccFourCCIdAMRNB: + iMediaType = "audio/amr"; + framelen = KTMSAMRNBFrameLen; + //framelen = KTMSAMRNBFrameLenFM; + break; + case KMMFFourCCCodePCM16: + default: + iMediaType = "audio/x-raw-int"; + framelen = KTMSPCM16FrameLen; +#ifdef __WINSCW__ + framelen *= 4; //16kB +#endif + break; + } + + //TODO: DEVLON TEST + if (iCodecID != KMMFFourCCCodePCM16) + { + framelen *= 10; + } + //TODO: DEVLON TEST + + return framelen; + } + +// ----------------------------------------------------------------------------- +// TMSIPCallStreamBase::DoChunk +// Checks, adjusts and creates global RChunk. +// ----------------------------------------------------------------------------- +// +gint TMSIPCallStreamBase::DoChunk(const gint aDataLen, TmsMsgBuf& aMsgBuffer) + { + gint status(KErrNone); + + // If chunk already created, try to reuse it + if (iChunk.Handle()) + { + // committed size is smaller but chunk is large enough to hold data + if ((iChunk.Size() < aDataLen) && (aDataLen <= iChunk.MaxSize())) + { + status = iChunk.Adjust(aDataLen); + TRACE_PRN_N1(_L("IP_CALL: DoChunk->Chunk Adjusted [%d]"), aDataLen); + } + else if (aDataLen > iChunk.MaxSize()) + { + iChunk.Close(); + TRACE_PRN_N(_L("IP_CALL: DoChunk->Chunk Closed")); + } + } + RET_ERR_IF_ERR(status); + + // Request kernel to create global RChunk if needed + aMsgBuffer.iBool = FALSE; + if (!iChunk.Handle()) + { + // TODO consider using some max instead + status = iChunk.CreateGlobal(KNullDesC, aDataLen, aDataLen); + // Mark to re-open chunk handle + aMsgBuffer.iBool = TRUE; + aMsgBuffer.iUint32 = Math::Random(); + TRACE_PRN_N2(_L("IP_CALL: DoChunk->Chunk Created [%d]key[%d]"), + aDataLen, aMsgBuffer.iUint32); + } + TRACE_PRN_IF_ERR(status); + return status; + } + +// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmsipcalluplink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmsipcalluplink.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,758 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include +#include +#include "tmsutility.h" +#include "ipcallstream.h" + +using namespace TMS; + +static TMSIPUplink* iSelfUp; +GstBuffer* gstUplBuffer; +#ifdef _DEBUG +//static TInt iHeapUp; +#endif //_DEBUG + +// ----------------------------------------------------------------------------- +// TMSIPUplink::cb_record_raw_handoff +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::cb_record_raw_handoff(GstElement *sink) + { + TRACE_PRN_N(_L("TMS->UPL: cb_record_raw_handoff Enter")); + +#ifdef _DEBUG + /* TInt block; + RHeap &heap = User::Heap(); + TInt avail = heap.Available(block); + RDebug::Print(_L("VoIP->PRINT-HEAP-UP:Available:[%d], delta:[%d]"), + avail, iHeapUp-avail); + iHeapUp = avail;*/ +#endif + + gstUplBuffer = gst_app_sink_pull_buffer(GST_APP_SINK(sink)); + iSelfUp->BufferToBeEmptied(); + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::bus_call +// ----------------------------------------------------------------------------- +// +gboolean TMSIPUplink::bus_call(GstBus* /*bus*/, GstMessage* msg, + gpointer /*data*/) + { + switch (GST_MESSAGE_TYPE(msg)) + { + case GST_MESSAGE_EOS: + { + gst_element_set_state(iSelfUp->iPipelineRec, GST_STATE_NULL); + gst_object_unref(GST_OBJECT(iSelfUp->iPipelineRec)); + break; + } + case GST_MESSAGE_ERROR: + { + gchar *debug; + GError *err; + gst_message_parse_error(msg, &err, &debug); + g_free(debug); + g_print("Error: %s\n", err->message); + g_error_free(err); + break; + } + default: + { + break; + } + } + return ETrue; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::gst_initialize_record +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::gst_initialize_record() + { + TRACE_PRN_FN_ENT; + + gint err = KErrNone; + + // create a new bin to hold the elements + iPipelineRec = gst_pipeline_new("pipelineRec"); + iSource = gst_element_factory_make("devsoundsrc", "record_audio"); + iAppSink = gst_element_factory_make("appsink", "appsink"); + + if (!iSource || !iAppSink) + { + err = KErrNotFound; + TRACE_PRN_IF_ERR(err); + return err; + } + + iMaxBufLen = ConfigureMedia(iCodecID); + + GstCaps* caps = gst_caps_new_simple(iMediaType, + "width", G_TYPE_INT, 16, + "depth", G_TYPE_INT, 16, + "signed", G_TYPE_BOOLEAN, TRUE, + "endianness", G_TYPE_INT, G_BYTE_ORDER, + "rate", G_TYPE_INT, 8000, + "channels", G_TYPE_INT, 1, + NULL); + + iBusRec = gst_pipeline_get_bus(GST_PIPELINE(iPipelineRec)); + gst_bus_add_watch(iBusRec, (TMSIPUplink::bus_call), NULL); + gst_object_unref(iBusRec); + + // add objects to the main iPipelineRec + gst_bin_add_many(GST_BIN(iPipelineRec), iSource, iAppSink, NULL); + + // link the elements + gst_element_link_filtered(iSource, iAppSink, caps); + + g_object_set(G_OBJECT(iAppSink), + "max-buffers", 1, + "emit-signals", TRUE, + "sync", FALSE, + NULL); + + g_signal_connect(iAppSink, "new-buffer", + G_CALLBACK(cb_record_raw_handoff), + NULL); + + gst_app_sink_set_caps(GST_APP_SINK(iAppSink), caps); + gst_caps_unref(caps); + + //NOTE: d/s is not ready at this time to return true maxgain + TInt maxgain = 1; +#ifdef __WINSCW__ + maxgain = 64; +#endif //__WINSCW__ + g_object_set(G_OBJECT(iSource), + "blocksize", iMaxBufLen, + "gain", maxgain, +#ifndef __WINSCW__ + "priority", (gint)iPriority.iPriority, + "preference", (gint)iPriority.iPref, +#endif + NULL); + + err = SetCodecCi(); + //gst_element_set_state(iPipelineRec, GST_STATE_READY); + + TRACE_PRN_FN_EXT; + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::gst_record_raw +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::gst_record_raw() + { + // start recording + gst_element_set_state(iPipelineRec, GST_STATE_PLAYING); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::TMSIPUplink +// Standard Constructor +// ----------------------------------------------------------------------------- +// +TMSIPUplink::TMSIPUplink() + { + iSelfUp = this; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::~TMSIPUplink +// Standard Constructor +// ----------------------------------------------------------------------------- +// +TMSIPUplink::~TMSIPUplink() + { + TRACE_PRN_FN_ENT; + + Stop(); + gst_object_unref(GST_OBJECT(iPipelineRec)); + gst_deinit(); + + delete iSpeechEncoderConfig; + delete iG711EncoderIntfc; + delete iG729EncoderIntfc; + delete iIlbcEncoderIntfc; + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::NewL +// Symbian two-phase constructor +// ----------------------------------------------------------------------------- +// +TMSIPUplink* TMSIPUplink::NewL(const guint32 codecID, + const TMMFPrioritySettings priority) + { + TMSIPUplink* self = new (ELeave) TMSIPUplink(); + CleanupStack::PushL(self); + self->ConstructL(codecID, priority); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::ConstructL +// Part two of Symbian two phase construction +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::ConstructL(const guint32 codecID, + const TMMFPrioritySettings priority) + { + TRACE_PRN_FN_ENT; + + iCodecID = codecID; + iPriority = priority; + // SetTime(); + gst_init(NULL, NULL); + // CalcLatency(); + // SetTime(); + gint err = gst_initialize_record(); + if (err != TMS_RESULT_SUCCESS) + { + User::Leave(err); + } + + // Client must set these before querying! + iG711EncodeMode = TMS_G711_CODEC_MODE_ALAW; + iILBCEncodeMode = TMS_ILBC_CODEC_MODE_20MS_FRAME; + // CalcLatency(); + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::Start +// +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::Start() + { + TRACE_PRN_FN_ENT; + + gst_record_raw(); + iStatus = EStreaming; + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::Stop +// +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::Stop() + { + TRACE_PRN_FN_ENT; + + if (iStatus == EStreaming) + { + if (iPipelineRec != NULL && + iPipelineRec->current_state == GST_STATE_PLAYING) + { + GstStateChangeReturn ret; + ret = gst_element_set_state(iPipelineRec, GST_STATE_NULL); + if (ret == GST_STATE_CHANGE_FAILURE) + { + ;// retry??? + //GST_STATE_CHANGE_SUCCESS + } + } + iStatus = EReady; + } + + if (gstUplBuffer) + { + gst_buffer_unref(gstUplBuffer); + } + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::BufferToBeEmptied +// From MDevSoundObserver +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::BufferToBeEmptied() + { + TInt buflen = GST_BUFFER_SIZE(gstUplBuffer); + TRACE_PRN_N1(_L("TMS->UPL: BTBE->LEN [%d]"), buflen); + + // Adjust/create RChunk if necessary + TInt err = DoChunk(buflen, iMsgBuffer); + + if (err != TMS_RESULT_SUCCESS) + { + Stop(); + iMsgBuffer.iStatus = err; + } + else + { + // Pass buffer parameters to the client + iMsgBuffer.iStatus = err; + iMsgBuffer.iInt = buflen; + + // Copy data over to RChunk + TPtr8 dataPtr(iChunk.Base(), buflen, iMaxBufLen); + dataPtr.Copy(GST_BUFFER_DATA(gstUplBuffer), buflen); + gst_buffer_unref(gstUplBuffer); + + //RDebug::RawPrint(dataPtr); + iStatus = EStreaming; + + // If chunk is opened, we will expect a call from the client to + // get chunk handle. When we get a call to copy chunk handle, + // check these variables and see if they match. This is not + // completely secure, but will provide some level of security. + if (iMsgBuffer.iBool == TRUE) + { + iWriteDataXferHndlToClient = TRUE; + iKey = iMsgBuffer.iUint32; + } + } + + // Notify client there is buffer ready to be emptied + iMsgBuffer.iRequest = ECmdEmptyBuffer; + err = iMsgQueue.Send(iMsgBuffer); + TRACE_PRN_IF_ERR(err); + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::BufferEmptied +// +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::BufferEmptied() + { + //TRACE_PRN_N(_L("TMS->UPL->BE")); + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetCodecCi +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::SetCodecCi() + { + TRAPD(err, SetCodecCiL()); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetCodecCiL +// +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::SetCodecCiL() + { + TRACE_PRN_FN_ENT; + + switch (iCodecID) + { + case KMccFourCCIdG711: + { + if (!iG711EncoderIntfc) + { + iG711EncoderIntfc = GST_G711_ENCODER_GET_IFACE(iSource); + } + break; + } + case KMccFourCCIdG729: + { + if (!iG729EncoderIntfc) + { + iG729EncoderIntfc = GST_G729_ENCODER_GET_IFACE(iSource); + } + break; + } + case KMccFourCCIdILBC: + { + if (!iIlbcEncoderIntfc) + { + iIlbcEncoderIntfc = GST_ILBC_ENCODER_GET_IFACE(iSource); + } + break; + } + case KMccFourCCIdAMRNB: + case KMMFFourCCCodePCM16: + { + break; + } + default: + { + User::Leave(TMS_RESULT_INVALID_ARGUMENT); + } + } + + if (!iSpeechEncoderConfig && iCodecID != KMMFFourCCCodePCM16) + { + iSpeechEncoderConfig = GST_SPEECH_ENCODER_CONFIG_GET_IFACE(iSource); + } + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetGain +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::SetGain(const guint gain) + { + g_object_set(G_OBJECT(iSource), "gain", gain, NULL); + TRACE_PRN_N1(_L("TMS->UPL: SetGain [%d]"), gain); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetGain +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetGain(guint& gain) + { + g_object_get(G_OBJECT(iSource), "gain", &gain, NULL); + TRACE_PRN_N1(_L("TMS->UPL: GetGain [%d]"), gain); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetMaxGain +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetMaxGain(guint& gain) + { + g_object_get(G_OBJECT(iSource), "maxgain", &gain, NULL); + TRACE_PRN_N1(_L("TMS->UPL: MaxGain [%d]"), gain); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetDataXferChunkHndl +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk) + { + gint status = TMS_RESULT_SUCCESS; + + if (iChunk.Handle()) + { + if (iWriteDataXferHndlToClient && (iKey == key)) + { + chunk = iChunk; + iWriteDataXferHndlToClient = FALSE; + iKey = 0; + } + else + { + status = TMS_RESULT_ILLEGAL_OPERATION; + } + } + + return status; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetIlbcCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::SetIlbcCodecMode(const gint mode) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + iILBCEncodeMode = mode; + + if (iIlbcEncoderIntfc && iCodecID == KMccFourCCIdILBC) + { + if (mode == TMS_ILBC_CODEC_MODE_20MS_FRAME) + { + err = iIlbcEncoderIntfc->SetEncoderMode(EIlbc20msFrame); + TRACE_PRN_N(_L("TMS->UPL: SetIlbcCodecMode [20ms Frame]")); + } + else if (mode == TMS_ILBC_CODEC_MODE_30MS_FRAME) + { + err = iIlbcEncoderIntfc->SetEncoderMode(EIlbc30msFrame); + TRACE_PRN_N(_L("TMS->UPL: SetIlbcCodecMode [30ms Frame]")); + } + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetIlbcCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetIlbcCodecMode(gint& mode) + { + // not available through CIs -> return cached value + mode = iILBCEncodeMode; + TRACE_PRN_N1(_L("TMS->UPL: GetIlbcCodecMode [%d]"), mode); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetG711CodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::SetG711CodecMode(const gint mode) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + iG711EncodeMode = mode; + + if (iG711EncoderIntfc && iCodecID == KMccFourCCIdG711) + { + if (mode == TMS_G711_CODEC_MODE_ALAW) + { + err = iG711EncoderIntfc->SetEncoderMode(EEncALaw); + TRACE_PRN_N(_L("TMS->UPL: SetG711CodecMode [ALaw]")); + } + else if (mode == TMS_G711_CODEC_MODE_MULAW) + { + err = iG711EncoderIntfc->SetEncoderMode(EEncULaw); + TRACE_PRN_N(_L("TMS->UPL: SetG711CodecMode [uLaw]")); + } + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetG711CodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetG711CodecMode(gint& mode) + { + // not available through CIs -> return cached value + mode = iG711EncodeMode; + TRACE_PRN_N1(_L("TMS->UPL: GetG711CodecMode [%d]"), mode); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetSupportedBitrates +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetSupportedBitrates(RArray& bitrates) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + bitrates.Reset(); + + if (iSpeechEncoderConfig) + { + gint i = 0; + GList* gbitrates = NULL; + // GList* walk; + err = iSpeechEncoderConfig->GetSupportedBitrates(&gbitrates); + + //TODO: try returning GList and do not convert to RArray + for (; gbitrates; gbitrates = g_list_next (gbitrates)) + { + // guint br = GPOINTER_TO_INT(gbitrates->data); + guint br = GPOINTER_TO_UINT(gbitrates->data); + bitrates.Append(br); + TRACE_PRN_N2(_L("TMS->UPL: GetSupportedBitrates %d:[%d]"), i+1, br); + i++; + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetBitrate +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::SetBitrate(guint bitrate) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iSpeechEncoderConfig) + { + err = iSpeechEncoderConfig->SetBitrate(bitrate); + TRACE_PRN_N1(_L("TMS->UPL: SetBitrate [%d]"), bitrate); + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetBitrate +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetBitrate(guint& bitrate) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iSpeechEncoderConfig) + { + err = iSpeechEncoderConfig->GetBitrate(&bitrate); + TRACE_PRN_N1(_L("TMS->UPL: GetBitrate [%d]"), bitrate); + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetVad +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::SetVad(const TMSFormatType fmttype, const gboolean vad) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + switch (fmttype) + { + case TMS_FORMAT_G711: + { + if (iG711EncoderIntfc) + { + err = iG711EncoderIntfc->SetVadMode(vad); + TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); + } + break; + } + case TMS_FORMAT_G729: + { + if (iG729EncoderIntfc) + { + err = iG729EncoderIntfc->SetVadMode(vad); + TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); + } + break; + } + case TMS_FORMAT_ILBC: + { + if (iIlbcEncoderIntfc) + { + err = iIlbcEncoderIntfc->SetVadMode(vad); + TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); + } + break; + } + case TMS_FORMAT_AMR: + { + if (iSpeechEncoderConfig) + { + err = iSpeechEncoderConfig->SetVadMode(vad); + TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); + } + break; + } + default: + { + break; //TMS_RESULT_DOES_NOT_EXIST + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetVad +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetVad(const TMSFormatType fmttype, gboolean& vad) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + switch (fmttype) + { + case TMS_FORMAT_G711: + { + if (iG711EncoderIntfc) + { + err = iG711EncoderIntfc->GetVadMode(&vad); + TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); + } + break; + } + case TMS_FORMAT_G729: + { + if (iG729EncoderIntfc) + { + err = iG729EncoderIntfc->GetVadMode(&vad); + TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); + } + break; + } + case TMS_FORMAT_ILBC: + { + if (iIlbcEncoderIntfc) + { + err = iIlbcEncoderIntfc->GetVadMode(&vad); + TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); + } + break; + } + case TMS_FORMAT_AMR: + { + if (iSpeechEncoderConfig) + { + err = iSpeechEncoderConfig->GetVadMode(&vad); + TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); + } + break; + } + default: + { + break; //TMS_RESULT_DOES_NOT_EXIST + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmsipcalluplinkds.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmsipcalluplinkds.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,690 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +#include +#include +#include +#include +#include +#include +#include "tmsutility.h" +#include "tmsipcallstream.h" + +using namespace TMS; + +// ----------------------------------------------------------------------------- +// TMSIPUplink::TMSIPUplink +// Standard Constructor +// ----------------------------------------------------------------------------- +// +TMSIPUplink::TMSIPUplink() + { + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::~TMSIPUplink +// Standard Constructor +// ----------------------------------------------------------------------------- +// +TMSIPUplink::~TMSIPUplink() + { + TRACE_PRN_FN_ENT; + + Stop(); + + delete iSpeechEncoderConfig; + delete iG711EncoderIntfc; + delete iG729EncoderIntfc; + delete iIlbcEncoderIntfc; + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::NewL +// Symbian two-phase constructor +// ----------------------------------------------------------------------------- +// +TMSIPUplink* TMSIPUplink::NewL(const guint32 codecID, + const TMMFPrioritySettings priority) + { + TMSIPUplink* self = new (ELeave) TMSIPUplink(); + CleanupStack::PushL(self); + self->ConstructL(codecID, priority); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::ConstructL +// Part two of Symbian two phase construction +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::ConstructL(const guint32 codecID, + const TMMFPrioritySettings priority) + { + TRACE_PRN_FN_ENT; + + iCodecID = codecID; + iPriority = priority; + + // Client must set these before querying! + iG711EncodeMode = TMS_G711_CODEC_MODE_ALAW; + iILBCEncodeMode = TMS_ILBC_CODEC_MODE_20MS_FRAME; + + TRAPD(err, InitDevSoundL(EMMFStateRecording, priority)); + if (err != TMS_RESULT_SUCCESS) + { + User::Leave(err); + } + + iMaxBufLen = ConfigureMedia(iCodecID); + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::Start +// +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::Start() + { + TRACE_PRN_FN_ENT; + + gint err = TMS_RESULT_ILLEGAL_OPERATION; + iWriteDataXferHndlToClient = FALSE; + + if (iStatus == EReady && iDevSound) + { + TRAP(err, iDevSound->RecordInitL()); + TRACE_PRN_IF_ERR(err); + + if (err != TMS_RESULT_SUCCESS) + { + //TODO: Notify main thread + iStatus = EReady; + } +#ifdef _DEBUG + else + { + iSamplesRecCount = 0; + } +#endif + } + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::Stop +// +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::Stop() + { + TRACE_PRN_FN_ENT; + + if (iStatus == EStreaming && iDevSound) + { + iDevSound->Stop(); + iStatus = EReady; + } + else + { + //TODO: Notify main thread + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::BufferToBeEmptied +// From MDevSoundObserver +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::BufferToBeEmptied(CMMFBuffer* aBuffer) + { + iDevSoundBufPtr = static_cast(aBuffer); + TDes8& data = iDevSoundBufPtr->Data(); + + iBufLen = iDevSoundBufPtr->BufferSize(); + TRACE_PRN_N1(_L("TMS->UPL: BTBE->LEN [%d]"), iBufLen); + + // Adjust/create RChunk if necessary + gint err = DoChunk(iBufLen, iMsgBuffer); + + if (err != TMS_RESULT_SUCCESS) + { + Stop(); + iMsgBuffer.iStatus = err; + } + else + { + // Pass buffer parameters to the client + iMsgBuffer.iStatus = err; + iMsgBuffer.iInt = iBufLen; + + // Copy data over to RChunk + TPtr8 dataPtr(iChunk.Base(), iBufLen, iBufLen); + dataPtr = data; + iStatus = EStreaming; + + // If chunk is opened, we will expect a call from the client to + // get chunk handle. When we get a call to copy chunk handle, + // check these variables and see if they match. This is not + // completely secure, but will provide some level of security. + if (iMsgBuffer.iBool == TRUE) + { + iWriteDataXferHndlToClient = TRUE; + iKey = iMsgBuffer.iUint32; + } + } + + // Notify client there is buffer ready to be emptied + iMsgBuffer.iRequest = ECmdEmptyBuffer; + err = iMsgQueue.Send(iMsgBuffer); + TRACE_PRN_IF_ERR(err); + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::BufferEmptied +// +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::BufferEmptied() + { + //TRACE_PRN_N(_L("TMS->UPL->BE")); + if (iDevSound) + { + iDevSound->RecordData(); + } + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetCodecCi +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::SetCodecCi() + { + TRAPD(err, SetCodecCiL()); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetCodecCiL +// +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::SetCodecCiL() + { + TRACE_PRN_FN_ENT; + + switch (iCodecID) + { + case KMccFourCCIdG711: + { + if (!iG711EncoderIntfc) + { + iG711EncoderIntfc = CG711EncoderIntfc::NewL(*iDevSound); + } + break; + } + case KMccFourCCIdG729: + { + if (!iG729EncoderIntfc) + { + iG729EncoderIntfc = CG729EncoderIntfc::NewL(*iDevSound); + } + break; + } + case KMccFourCCIdILBC: + { + if (!iIlbcEncoderIntfc) + { + iIlbcEncoderIntfc = CIlbcEncoderIntfc::NewL(*iDevSound); + } + break; + } + case KMccFourCCIdAMRNB: + case KMMFFourCCCodePCM16: + { + break; + } + default: + { + User::Leave(TMS_RESULT_INVALID_ARGUMENT); + break; + } + } + + if (!iSpeechEncoderConfig && iCodecID != KMMFFourCCCodePCM16) + { + iSpeechEncoderConfig = CSpeechEncoderConfig::NewL(*iDevSound); + } + + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetGain +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::SetGain(const guint gain) + { + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + if (iDevSound) + { + iDevSound->SetGain(gain); + status = TMS_RESULT_SUCCESS; + } + TRACE_PRN_N1(_L("TMS->UPL: SetGain [%d]"), gain); + return status; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetGain +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetGain(guint& gain) + { + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + if (iDevSound) + { + gain = iDevSound->Gain(); + status = TMS_RESULT_SUCCESS; + } + TRACE_PRN_N1(_L("TMS->UPL: GetGain [%d]"), gain); + return status; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetMaxGain +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetMaxGain(guint& gain) + { + gint status(TMS_RESULT_UNINITIALIZED_OBJECT); + if (iDevSound) + { + gain = iDevSound->MaxGain(); + status = TMS_RESULT_SUCCESS; + } + TRACE_PRN_N1(_L("TMS->UPL: MaxGain [%d]"), gain); + return status; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetDataXferChunkHndl +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk) + { + gint status = TMS_RESULT_SUCCESS; + + if (iChunk.Handle()) + { + if (iWriteDataXferHndlToClient && (iKey == key)) + { + chunk = iChunk; + iWriteDataXferHndlToClient = FALSE; + iKey = 0; + } + else + { + status = TMS_RESULT_ILLEGAL_OPERATION; + } + } + + return status; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetIlbcCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::SetIlbcCodecMode(const gint mode) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + iILBCEncodeMode = mode; + + if (iIlbcEncoderIntfc && iCodecID == KMccFourCCIdILBC) + { + if (mode == TMS_ILBC_CODEC_MODE_20MS_FRAME) + { + err = iIlbcEncoderIntfc->SetEncoderMode( + CIlbcEncoderIntfc::E20msFrame); + TRACE_PRN_N(_L("TMS->UPL: SetIlbcCodecMode [20ms Frame]")); + } + else if (mode == TMS_ILBC_CODEC_MODE_30MS_FRAME) + { + err = iIlbcEncoderIntfc->SetEncoderMode( + CIlbcEncoderIntfc::E30msFrame); + TRACE_PRN_N(_L("TMS->UPL: SetIlbcCodecMode [30ms Frame]")); + } + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetIlbcCodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetIlbcCodecMode(gint& mode) + { + // not available through CIs -> return cached value + mode = iILBCEncodeMode; + TRACE_PRN_N1(_L("TMS->UPL: GetIlbcCodecMode [%d]"), mode); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetG711CodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::SetG711CodecMode(const gint mode) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iStatus == EReady) + { + iG711EncodeMode = mode; + + if (iG711EncoderIntfc && iCodecID == KMccFourCCIdG711) + { + if (mode == TMS_G711_CODEC_MODE_ALAW) + { + err = iG711EncoderIntfc->SetEncoderMode( + CG711EncoderIntfc::EEncALaw); + TRACE_PRN_N(_L("TMS->UPL: SetG711CodecMode [ALaw]")); + } + else if (mode == TMS_G711_CODEC_MODE_MULAW) + { + err = iG711EncoderIntfc->SetEncoderMode( + CG711EncoderIntfc::EEncULaw); + TRACE_PRN_N(_L("TMS->UPL: SetG711CodecMode [uLaw]")); + } + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetG711CodecMode +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetG711CodecMode(gint& mode) + { + // not available through CIs -> return cached value + mode = iG711EncodeMode; + TRACE_PRN_N1(_L("TMS->UPL: GetG711CodecMode [%d]"), mode); + return TMS_RESULT_SUCCESS; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetSupportedBitrates +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetSupportedBitrates(RArray& bitrates) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + bitrates.Reset(); + + if (iSpeechEncoderConfig) + { + err = iSpeechEncoderConfig->GetSupportedBitrates(bitrates); + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetBitrate +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::SetBitrate(guint bitrate) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iSpeechEncoderConfig) + { + err = iSpeechEncoderConfig->SetBitrate(bitrate); + TRACE_PRN_N1(_L("TMS->UPL: SetBitrate [%d]"), bitrate); + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetBitrate +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetBitrate(guint& bitrate) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + if (iSpeechEncoderConfig) + { + err = iSpeechEncoderConfig->GetBitrate(bitrate); + TRACE_PRN_N1(_L("TMS->UPL: GetBitrate [%d]"), bitrate); + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::SetVad +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::SetVad(const TMSFormatType fmttype, const gboolean vad) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + switch (fmttype) + { + case TMS_FORMAT_G711: + { + if (iG711EncoderIntfc) + { + err = iG711EncoderIntfc->SetVadMode(vad); + TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); + } + break; + } + case TMS_FORMAT_G729: + { + if (iG729EncoderIntfc) + { + err = iG729EncoderIntfc->SetVadMode(vad); + TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); + } + break; + } + case TMS_FORMAT_ILBC: + { + if (iIlbcEncoderIntfc) + { + err = iIlbcEncoderIntfc->SetVadMode(vad); + TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); + } + break; + } + case TMS_FORMAT_AMR: + { + if (iSpeechEncoderConfig) + { + err = iSpeechEncoderConfig->SetVadMode(vad); + TRACE_PRN_N1(_L("TMS->UPL: SetVad [%d]"), vad); + } + break; + } + default: + { + break; //TMS_RESULT_DOES_NOT_EXIST + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::GetVad +// +// ----------------------------------------------------------------------------- +// +gint TMSIPUplink::GetVad(const TMSFormatType fmttype, gboolean& vad) + { + gint err = TMS_RESULT_DOES_NOT_EXIST; + + switch (fmttype) + { + case TMS_FORMAT_G711: + { + if (iG711EncoderIntfc) + { + err = iG711EncoderIntfc->GetVadMode(vad); + TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); + } + break; + } + case TMS_FORMAT_G729: + { + if (iG729EncoderIntfc) + { + err = iG729EncoderIntfc->GetVadMode(vad); + TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); + } + break; + } + case TMS_FORMAT_ILBC: + { + if (iIlbcEncoderIntfc) + { + err = iIlbcEncoderIntfc->GetVadMode(vad); + TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); + } + break; + } + case TMS_FORMAT_AMR: + { + if (iSpeechEncoderConfig) + { + err = iSpeechEncoderConfig->GetVadMode(vad); + TRACE_PRN_N1(_L("TMS->UPL: GetVad [%d]"), vad); + } + break; + } + default: + { + break; //TMS_RESULT_DOES_NOT_EXIST + } + } + + TRACE_PRN_IF_ERR(err); + return err; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::InitializeComplete +// A callback from the DevSound indicating completion of the initialization. +// It will send config data to the D/S and configure the encoder via CI. +// If everything goes well, the state of the thread is set EReady. +// The initialization completion message is sent back to the main thread. +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::InitializeComplete(TInt aError) + { + TRACE_PRN_FN_ENT; + + gint err = aError; + + if (err == TMS_RESULT_SUCCESS && iDevSound) + { + TMMFCapabilities conf; + conf = iDevSound->Config(); + conf.iRate = EMMFSampleRate8000Hz; + conf.iChannels = EMMFMono; + TRAP(err, iDevSound->SetConfigL(conf)); + if (err == TMS_RESULT_SUCCESS) + { + // We are ready to stream even in case of CI setting failure + iStatus = EReady; + iMaxGain = iDevSound->MaxGain(); + } + + // Init Custom Interface API to the Encoder + err = SetCodecCi(); + if (err != TMS_RESULT_SUCCESS) + { + // DEBUG only + // Can ignore error - although encoder is not fully configured but + // it can still run in the default mode. + TRACE_PRN_IF_ERR(err); + } + } + + // TODO: Notify client + + TRACE_PRN_IF_ERR(err); + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSIPUplink::RecordError +// From MDevSoundObserver +// Recording error is send to the main thread. +// The state of recorder is rolled back to EReady. +// ----------------------------------------------------------------------------- +// +void TMSIPUplink::RecordError(TInt /*aError*/) + { + //TRACE_PRN_IF_ERR(aError); + +#ifdef _DEBUG + iSamplesRecCount = 0; +#endif + iStatus = EReady; + + // TODO: Notify client + } + +// End of file + diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmscallserver/src/tmstarsettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmserv/tms/tmscallserver/src/tmstarsettings.cpp Mon May 03 12:59:52 2010 +0300 @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service + * + */ + +// INCLUDE FILES +#include "tmstarsettings.h" +#include "tmsclientserver.h" +#include "tmsutility.h" + +using namespace TMS; + +// CONSTANTS +_LIT_SECURITY_POLICY_PASS(KTMSServerReadPolicy); +_LIT_SECURITY_POLICY_C1(KTMSServerWritePolicy, ECapabilityWriteUserData); + +// ----------------------------------------------------------------------------- +// TMSTarSettings::TMSTarSettings +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +TMSTarSettings::TMSTarSettings() + { + } + +// ----------------------------------------------------------------------------- +// TMSTarSettings::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void TMSTarSettings::ConstructL() + { + TRACE_PRN_FN_ENT; + TInt err = RProperty::Define(ERoutingPs, RProperty::EByteArray, + KTMSServerReadPolicy, KTMSServerWritePolicy); + TRACE_PRN_N1(_L("TarSetting::ConstructL err:%d"),err); + + if (err != KErrAlreadyExists) + { + User::LeaveIfError(err); + } + TRACE_PRN_FN_EXT; + } + +// ----------------------------------------------------------------------------- +// TMSTarSettings::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +TMSTarSettings* TMSTarSettings::NewL() + { + TMSTarSettings* self = new (ELeave) TMSTarSettings(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// Destructor +TMSTarSettings::~TMSTarSettings() + { + TRACE_PRN_FN_ENT; + TInt err = RProperty::Delete(KTMSPropertyCategory, ERoutingPs); + TRACE_PRN_N1(_L("TarSetting::~TMSTarSettings err:%d"),err); + TRACE_PRN_FN_ENT; + } + +// ----------------------------------------------------------------------------- +// TMSTarSettings::SetVolume +// ----------------------------------------------------------------------------- +// +void TMSTarSettings::SetTar(TRoutingMsgBufPckg rountingpckg, TBool aPublish) + { + TRACE_PRN_FN_ENT; + // TInt err(KErrNone); + if (aPublish) + { + /*err =*/RProperty::Set(KTMSPropertyCategory, ERoutingPs, rountingpckg); + } + + //TRACE_PRN_N1(_L("TarSetting::SetTar err:%d"),err); + TRACE_PRN_FN_EXT; + } + +// End of File diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsfactory/src/tmsfactoryimpl.cpp --- a/mmserv/tms/tmsfactory/src/tmsfactoryimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsfactory/src/tmsfactoryimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -25,7 +25,6 @@ #include "tmsringtoneimpl.h" #include "tmsdtmfimpl.h" #include "tmsinbandtoneimpl.h" -//#include "tmsrtpsessionimpl.h" #include "tmsutility.h" #include "tmsproxy.h" @@ -69,8 +68,8 @@ case TMS_CALL_IP: flag = ETrue; break; - case TMS_CALL_ECS: //from TB 10.1 - case TMS_CALL_RTP: //from TB 10.1 + case TMS_CALL_ECS: //from TB 10.2 + case TMS_CALL_RTP: //from TB 10.2 default: flag = EFalse; break; diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/inc/tmsvolumeeffectbodyimpl.h --- a/mmserv/tms/tmsimpl/inc/tmsvolumeeffectbodyimpl.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/inc/tmsvolumeeffectbodyimpl.h Mon May 03 12:59:52 2010 +0300 @@ -46,7 +46,7 @@ virtual gint GetType(TMSEffectType& effecttype); // From MQueueHandlerObserver - virtual void QueueEvent(TInt aEventType, TInt aError, void* user_data); + virtual void QueueEvent(TInt aEventType, TInt aError, void* event_data); void SetParent(TMSEffect*& parent); void SetProxy(TMSCallProxy* aProxy, gpointer queuehandler); diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsamrbodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsamrbodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsamrbodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -74,7 +74,8 @@ iProxy = context->CallProxy; iStreamType = context->StreamType; TMSFormatBodyImpl::SetProxy(iProxy, queuehandler); - ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_AMR); + static_cast(queuehandler)->AddObserver(*this, + TMS_FORMAT_AMR); } } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsamrimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsamrimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsamrimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -43,7 +43,7 @@ if (ret == TMS_RESULT_SUCCESS) { this->iBody = bodyimpl; - this->iFormatBody = (TMSAMRFormatBodyImpl*) bodyimpl; + this->iFormatBody = static_cast(bodyimpl); } TRACE_PRN_FN_EXT; return ret; @@ -75,7 +75,8 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSAMRFormatBodyImpl*) this->iBody)->SetProxy(context, queuehandler); + static_cast(this->iBody)->SetProxy(context, + queuehandler); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsbufferimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsbufferimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsbufferimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -61,7 +61,7 @@ switch (buffertype) { case TMS_BUFFER_MEMORY: - delete (TMSMemBuffer*) (tmsbuffer); + delete (static_cast(tmsbuffer)); tmsbuffer = NULL; ret = TMS_RESULT_SUCCESS; break; diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmscallimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmscallimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmscallimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -87,9 +87,9 @@ { TRACE_PRN_FN_ENT; gint ret(TMS_RESULT_INSUFFICIENT_MEMORY); - delete (TMSCallImpl*) (tmscall); + delete (static_cast(tmscall)); tmscall = NULL; - TRACE_PRN_FN_EXT; + TRACE_PRN_FN_EXT; return ret; } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsclientsinkbodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsclientsinkbodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsclientsinkbodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -95,10 +95,9 @@ if (iProxy) { - ret = iProxy->BufferEmptied(TMS_CALL_IP, - TMS_STREAM_UPLINK, - 1, //TODO: must use strm_id - *buffer); + //TODO: must use strm_id instead of 1 + ret = iProxy->BufferEmptied(TMS_CALL_IP, TMS_STREAM_UPLINK, 1, + *buffer); } else { @@ -120,7 +119,8 @@ iProxy = aProxy; if (queuehandler) { - ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_SINK_CLIENT); + static_cast(queuehandler)->AddObserver(*this, + TMS_SINK_CLIENT); } } @@ -132,7 +132,7 @@ switch (aEventType) { case TMS_EVENT_SINK_PROCESS_BUFFER: - iObserver->ProcessBuffer(((TMSBuffer*) user_data)); + iObserver->ProcessBuffer(static_cast(user_data)); break; default: break; diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsclientsinkimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsclientsinkimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsclientsinkimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -73,7 +73,8 @@ gint ret = TMS_RESULT_SUCCESS; if (this->iBody) { - ((TMSClientSinkBodyImpl*) this->iBody)->SetProxy(aProxy, queuehandler); + static_cast(this->iBody)->SetProxy(aProxy, + queuehandler); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsclientsourcebodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsclientsourcebodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsclientsourcebodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -111,10 +111,8 @@ { // TODO send stream attributes here gint ret(TMS_RESULT_SUCCESS); - ret = iProxy->BufferFilled(TMS_CALL_IP, - TMS_STREAM_DOWNLINK, - iStreamId, - buffer); + ret = iProxy->BufferFilled(TMS_CALL_IP, TMS_STREAM_DOWNLINK, iStreamId, + buffer); return ret; } @@ -161,7 +159,8 @@ { iProxy = aProxy; iStreamId = strmid; - ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_SOURCE_CLIENT); + static_cast(queuehandler)->AddObserver(*this, + TMS_SOURCE_CLIENT); } void TMSClientSourceBodyImpl::QueueEvent(TInt aEventType, TInt aError, @@ -172,10 +171,11 @@ switch (aEventType) { case TMS_EVENT_SOURCE_FILL_BUFFER: - iObserver->FillBuffer(*((TMSBuffer*) user_data)); + iObserver->FillBuffer(*(static_cast(user_data))); break; case TMS_EVENT_SOURCE_PROCESSED_BUFFER: - iObserver->BufferProcessed((TMSBuffer*) user_data, aError); + iObserver->BufferProcessed(static_cast(user_data), + aError); break; default: break; diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsclientsourceimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsclientsourceimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsclientsourceimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -72,8 +72,8 @@ gpointer queuehandler) { gint ret = TMS_RESULT_SUCCESS; - ((TMSClientSourceBodyImpl*) this->iBody)->SetProxy(aProxy, strmid, - queuehandler); + static_cast(this->iBody)->SetProxy(aProxy, + strmid, queuehandler); return ret; } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsdtmfbodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsdtmfbodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsdtmfbodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -64,7 +64,10 @@ delete self; self = NULL; } - self->iStreamType = streamtype; + else + { + self->iStreamType = streamtype; + } } bodyimpl = self; return ret; @@ -91,8 +94,7 @@ return ret; } -gint TMSDTMFBodyImpl::AddObserver(TMSDTMFObserver& obsrvr, - gpointer user_data) +gint TMSDTMFBodyImpl::AddObserver(TMSDTMFObserver& obsrvr, gpointer user_data) { gint ret(TMS_RESULT_SUCCESS); if (!iObserver) diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsdtmfimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsdtmfimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsdtmfimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -77,7 +77,7 @@ { gint ret(TMS_RESULT_SUCCESS); TRACE_PRN_FN_ENT; - delete (TMSDTMFImpl*) (dtmf); + delete (static_cast(dtmf)); dtmf = NULL; TRACE_PRN_FN_EXT; return ret; @@ -88,7 +88,7 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSDTMFBodyImpl*) this->iBody)->SetParent(parent); + static_cast(this->iBody)->SetParent(parent); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmseffectimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmseffectimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmseffectimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -73,19 +73,19 @@ switch (effecttype) { case TMS_EFFECT_VOLUME: - delete (TMSVolumeEffectImpl*) (tmseffect); + delete (static_cast(tmseffect)); tmseffect = NULL; break; case TMS_EFFECT_GAIN: - delete (TMSGainEffectImpl*) (tmseffect); + delete (static_cast(tmseffect)); tmseffect = NULL; break; case TMS_EFFECT_GLOBAL_VOL: - delete (TMSGlobalVolEffectImpl*) (tmseffect); + delete (static_cast(tmseffect)); tmseffect = NULL; break; case TMS_EFFECT_GLOBAL_GAIN: - delete (TMSGlobalGainEffectImpl*) (tmseffect); + delete (static_cast(tmseffect)); tmseffect = NULL; break; default: diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsformatbodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsformatbodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsformatbodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -77,7 +77,7 @@ void TMSFormatBodyImpl::SetProxy(TMSCallProxy* aProxy, gpointer /*queuehandler*/) { iProxy = aProxy; - // ((TMSQueueHandler*)queuehandler)->AddObserver(*this,TMS_FORMAT_TYPE); + //static_cast(queuehandler)->AddObserver(*this, TMS_FORMAT_TYPE); } // End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsformatimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsformatimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsformatimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -78,23 +78,23 @@ switch (fmttype) { case TMS_FORMAT_PCM: - delete (TMSPCMFormatImpl*) (tmsfmt); + delete (static_cast(tmsfmt)); tmsfmt = NULL; break; case TMS_FORMAT_AMR: - delete (TMSAMRFormatImpl*) (tmsfmt); + delete (static_cast(tmsfmt)); tmsfmt = NULL; break; case TMS_FORMAT_G711: - delete (TMSG711FormatImpl*) (tmsfmt); + delete (static_cast(tmsfmt)); tmsfmt = NULL; break; case TMS_FORMAT_G729: - delete (TMSG729FormatImpl*) (tmsfmt); + delete (static_cast(tmsfmt)); tmsfmt = NULL; break; case TMS_FORMAT_ILBC: - delete (TMSILBCFormatImpl*) (tmsfmt); + delete (static_cast(tmsfmt)); tmsfmt = NULL; break; default: diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsg711bodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsg711bodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsg711bodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -154,7 +154,8 @@ iProxy = context->CallProxy; iStreamType = context->StreamType; TMSFormatBodyImpl::SetProxy(iProxy, queuehandler); - ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_G711); + static_cast(queuehandler)->AddObserver(*this, + TMS_FORMAT_G711); } } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsg711impl.cpp --- a/mmserv/tms/tmsimpl/src/tmsg711impl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsg711impl.cpp Mon May 03 12:59:52 2010 +0300 @@ -43,7 +43,7 @@ if (ret == TMS_RESULT_SUCCESS) { this->iBody = bodyimpl; - this->iFormatBody = (TMSG711FormatBodyImpl*) bodyimpl; + this->iFormatBody = static_cast(bodyimpl); } TRACE_PRN_FN_EXT; return ret; @@ -75,7 +75,8 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSG711FormatBodyImpl*) this->iBody)->SetProxy(context, queuehandler); + static_cast(this->iBody)->SetProxy(context, + queuehandler); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsg729bodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsg729bodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsg729bodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -94,7 +94,8 @@ iProxy = context->CallProxy; iStreamType = context->StreamType; TMSFormatBodyImpl::SetProxy(iProxy, queuehandler); - ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_G729); + static_cast(queuehandler)->AddObserver(*this, + TMS_FORMAT_G729); } } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsg729impl.cpp --- a/mmserv/tms/tmsimpl/src/tmsg729impl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsg729impl.cpp Mon May 03 12:59:52 2010 +0300 @@ -43,7 +43,7 @@ if (ret == TMS_RESULT_SUCCESS) { this->iBody = bodyimpl; - this->iFormatBody = (TMSG729FormatBodyImpl*) bodyimpl; + this->iFormatBody = static_cast(bodyimpl); } TRACE_PRN_FN_EXT; return ret; @@ -75,7 +75,8 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSG729FormatBodyImpl*) this->iBody)->SetProxy(context, queuehandler); + static_cast(this->iBody)->SetProxy(context, + queuehandler); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsgaineffectbodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsgaineffectbodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsgaineffectbodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -150,29 +150,21 @@ iProxy = aProxy; if (queuehandler) { - ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_EFFECT_GAIN); + static_cast(queuehandler)->AddObserver(*this, + TMS_EFFECT_GAIN); } } void TMSGainEffectBodyImpl::QueueEvent(TInt aEventType, TInt aError, void* /*user_data*/) { - TMSSignalEvent event; + TMSSignalEvent event = {}; //all elements initialized to zeros event.type = TMS_EVENT_EFFECT_GAIN_CHANGED; event.reason = aError; - switch (aEventType) + if (iObserver && iParent && aEventType == TMS_EVENT_EFFECT_GAIN_CHANGED) { - case TMS_EVENT_EFFECT_GAIN_CHANGED: - { - if (iObserver && iParent) - { - iObserver->EffectsEvent(iParent, event); - } - } - break; - default: - break; + iObserver->EffectsEvent(*iParent, event); } } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsgaineffectimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsgaineffectimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsgaineffectimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -77,7 +77,8 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSGainEffectBodyImpl*) this->iBody)->SetProxy(aProxy, queuehandler); + static_cast(this->iBody)->SetProxy(aProxy, + queuehandler); } else { @@ -91,7 +92,7 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSGainEffectBodyImpl*) this->iBody)->SetParent(parent); + static_cast(this->iBody)->SetParent(parent); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsglobalgaineffectimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsglobalgaineffectimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsglobalgaineffectimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -77,7 +77,8 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSGlobalGainEffectBodyImpl*) this->iBody)->SetParent(parent); + static_cast(this->iBody)->SetParent( + parent); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsglobalroutingimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsglobalroutingimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsglobalroutingimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -76,7 +76,7 @@ { gint ret(TMS_RESULT_SUCCESS); TRACE_PRN_FN_ENT; - delete (TMSGlobalRoutingImpl*) globrouting; + delete (static_cast(globrouting)); globrouting = NULL; TRACE_PRN_FN_EXT; return ret; @@ -87,7 +87,7 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSGlobalRoutingBodyImpl*) this->iBody)->SetParent(parent); + static_cast(this->iBody)->SetParent(parent); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsglobalvoleffectimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsglobalvoleffectimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsglobalvoleffectimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -77,7 +77,8 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSGlobalVolEffectBodyImpl*) this->iBody)->SetParent(parent); + static_cast(this->iBody)->SetParent( + parent); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsilbcbodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsilbcbodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsilbcbodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -134,7 +134,8 @@ iProxy = context->CallProxy; iStreamType = context->StreamType; TMSFormatBodyImpl::SetProxy(iProxy, queuehandler); - ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_ILBC); + static_cast(queuehandler)->AddObserver(*this, + TMS_FORMAT_ILBC); } } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsilbcimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsilbcimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsilbcimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -43,7 +43,7 @@ if (ret == TMS_RESULT_SUCCESS) { this->iBody = bodyimpl; - this->iFormatBody = (TMSILBCFormatBodyImpl*) bodyimpl; + this->iFormatBody = static_cast(bodyimpl); } TRACE_PRN_FN_EXT; return ret; @@ -75,7 +75,8 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSILBCFormatBodyImpl*) this->iBody)->SetProxy(context, queuehandler); + static_cast(this->iBody)->SetProxy(context, + queuehandler); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsinbandtoneimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsinbandtoneimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsinbandtoneimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -76,7 +76,7 @@ { gint ret(TMS_RESULT_SUCCESS); TRACE_PRN_FN_ENT; - delete (TMSInbandToneImpl*) (inbandtone); + delete (static_cast(inbandtone)); inbandtone = NULL; TRACE_PRN_FN_EXT; return ret; @@ -87,7 +87,7 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSInbandToneBodyImpl*) this->iBody)->SetParent(parent); + static_cast(this->iBody)->SetParent(parent); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsmembuffer.cpp --- a/mmserv/tms/tmsimpl/src/tmsmembuffer.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsmembuffer.cpp Mon May 03 12:59:52 2010 +0300 @@ -74,7 +74,7 @@ { gint ret(TMS_RESULT_SUCCESS); TRACE_PRN_FN_ENT; - iDataPtr = (guint8*) malloc(size); + iDataPtr = static_cast(malloc(size)); if (!iDataPtr) { ret = TMS_RESULT_INSUFFICIENT_MEMORY; diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsmicsourcebodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsmicsourcebodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsmicsourcebodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -64,7 +64,7 @@ gpointer /*queuehandler*/) { iProxy = aProxy; - //((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_SOURCE_MIC); + //static_cast(queuehandler)->AddObserver(*this, TMS_SOURCE_MIC); } // End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsmicsourceimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsmicsourceimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsmicsourceimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -72,7 +72,7 @@ gpointer /*queuehandler*/) { gint ret = TMS_RESULT_SUCCESS; -// ((TMSMicSourceBodyImpl*) this->iBody)->SetProxy(aProxy, queuehandler); + //static_cast(this->iBody)->SetProxy(aProxy, queuehandler); return ret; } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsmodemsinkbodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsmodemsinkbodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsmodemsinkbodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -64,7 +64,7 @@ gpointer /*queuehandler*/) { iProxy = aProxy; - //((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_SINK_MODEM); + //static_cast(queuehandler)->AddObserver(*this, TMS_SINK_MODEM); } // End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsmodemsinkimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsmodemsinkimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsmodemsinkimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -71,7 +71,7 @@ gpointer /*queuehandler*/) { gint ret = TMS_RESULT_SUCCESS; -// ((TMSModemSinkBodyImpl*) this->iBody)->SetProxy(aProxy, queuehandler); + //static_cast(this->iBody)->SetProxy(aProxy, queuehandler); return ret; } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsmodemsourcebodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsmodemsourcebodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsmodemsourcebodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -64,7 +64,7 @@ gpointer /*queuehandler*/) { iProxy = aProxy; - //((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_SOURCE_MODEM); + //static_cast(queuehandler)->AddObserver(*this, TMS_SOURCE_MODEM); } // End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsmodemsourceimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsmodemsourceimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsmodemsourceimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -71,7 +71,7 @@ gpointer /*queuehandler*/) { gint ret = TMS_RESULT_SUCCESS; -// ((TMSModemSourceBodyImpl*) this->iBody)->SetProxy(aProxy, queuehandler); + //static_cast(this->iBody)->SetProxy(aProxy, queuehandler); return ret; } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmspcmbodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmspcmbodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmspcmbodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -74,7 +74,8 @@ iProxy = context->CallProxy; iStreamType = context->StreamType; TMSFormatBodyImpl::SetProxy(iProxy, queuehandler); - ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_PCM); + static_cast(queuehandler)->AddObserver(*this, + TMS_FORMAT_PCM); } } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmspcmimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmspcmimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmspcmimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -44,7 +44,7 @@ if (ret == TMS_RESULT_SUCCESS) { this->iBody = bodyimpl; - this->iFormatBody = (TMSPCMFormatBodyImpl*) bodyimpl; + this->iFormatBody = static_cast(bodyimpl); } TRACE_PRN_FN_EXT; return ret; @@ -76,7 +76,8 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSPCMFormatBodyImpl*) this->iBody)->SetProxy(context, queuehandler); + static_cast(this->iBody)->SetProxy(context, + queuehandler); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsqueuehandler.cpp --- a/mmserv/tms/tmsimpl/src/tmsqueuehandler.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsqueuehandler.cpp Mon May 03 12:59:52 2010 +0300 @@ -301,7 +301,7 @@ if (!iBuffer) { TMSMemBuffer::Create((guint) aBufLen, - const_cast (iChunkDataPtr.Ptr()), iBuffer); + const_cast(iChunkDataPtr.Ptr()), iBuffer); } iBuffer->SetDataSize(aBufLen); @@ -362,7 +362,7 @@ if (!iBuffer) { TMSMemBuffer::Create((guint) aBufLen, - const_cast (iChunkDataPtr.Ptr()), iBuffer); + const_cast(iChunkDataPtr.Ptr()), iBuffer); } iBuffer->SetDataSize(aBufLen); gint index = iClientList.Find(TMS_SINK_CLIENT); diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsringtoneimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsringtoneimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsringtoneimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -116,7 +116,7 @@ { TRACE_PRN_FN_ENT; gint ret(TMS_RESULT_SUCCESS); - delete (TMSRingToneImpl*) (rt); + delete (static_cast(rt)); rt = NULL; TRACE_PRN_FN_EXT; return ret; @@ -127,7 +127,7 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSRingToneBodyImpl*) this->iBody)->SetParent(parent); + static_cast(this->iBody)->SetParent(parent); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmssinkimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmssinkimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmssinkimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -69,21 +69,21 @@ { case TMS_SINK_CLIENT: { - delete (TMSClientSinkImpl*) (tmssink); + delete (static_cast(tmssink)); tmssink = NULL; ret = TMS_RESULT_SUCCESS; } break; case TMS_SINK_MODEM: { - delete (TMSModemSinkImpl*) (tmssink); + delete (static_cast(tmssink)); tmssink = NULL; ret = TMS_RESULT_SUCCESS; } break; case TMS_SINK_SPEAKER: { - delete (TMSSpeakerSinkImpl*) (tmssink); + delete (static_cast(tmssink)); tmssink = NULL; ret = TMS_RESULT_SUCCESS; } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmssourceimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmssourceimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmssourceimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -69,20 +69,20 @@ switch (sourcetype) { case TMS_SOURCE_CLIENT: - delete (TMSClientSourceImpl*) (tmssource); + delete (static_cast(tmssource)); tmssource = NULL; ret = TMS_RESULT_SUCCESS; break; case TMS_SOURCE_MODEM: { - delete (TMSModemSourceImpl*) (tmssource); + delete (static_cast(tmssource)); tmssource = NULL; ret = TMS_RESULT_SUCCESS; } break; case TMS_SOURCE_MIC: { - delete (TMSMicSourceImpl*) (tmssource); + delete (static_cast(tmssource)); tmssource = NULL; ret = TMS_RESULT_SUCCESS; } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsspeakersinkbodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsspeakersinkbodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsspeakersinkbodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -64,7 +64,7 @@ gpointer /*queuehandler*/) { iProxy = aProxy; - //((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_SINK_SPEAKER); + //static_cast(queuehandler)->AddObserver(*this, TMS_SINK_SPEAKER); } // End of file diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsspeakersinkimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsspeakersinkimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsspeakersinkimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -68,7 +68,7 @@ gpointer /*queuehandler*/) { gint ret = TMS_RESULT_SUCCESS; - //((TMSSpeakerSinkBodyImpl*) this->iBody)->SetProxy(aProxy, queuehandler); + //static_cast(this->iBody)->SetProxy(aProxy, queuehandler); return ret; } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsstreambodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsstreambodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsstreambodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -342,7 +342,7 @@ RET_REASON_IF_ERR(ret); - TMSFormatType fmttype; + TMSFormatType fmttype(TMS_FORMAT_PCM); if (!iFormat && iContext.CallType == TMS_CALL_IP) { return TMS_RESULT_FORMAT_TYPE_UNSPECIFIED; @@ -373,12 +373,13 @@ switch (effecttype) { case TMS_EFFECT_GAIN: - ((TMSGainEffectImpl*) iEffectsList[i])->SetProxy( + static_cast(iEffectsList[i])->SetProxy( iContext.CallProxy, iMsgQHandler); break; case TMS_EFFECT_VOLUME: - ((TMSVolumeEffectImpl*) iEffectsList[i])->SetProxy( - iContext.CallProxy, iMsgQHandler); + static_cast + (iEffectsList[i])->SetProxy(iContext.CallProxy, + iMsgQHandler); break; default: ret = TMS_RESULT_INVALID_ARGUMENT; @@ -394,23 +395,23 @@ switch (fmttype) { case TMS_FORMAT_PCM: - ((TMSPCMFormatImpl*) iFormat)->SetProxy(&iContext, + static_cast(iFormat)->SetProxy(&iContext, iMsgQHandler); break; case TMS_FORMAT_AMR: - ((TMSAMRFormatImpl*) iFormat)->SetProxy(&iContext, + static_cast(iFormat)->SetProxy(&iContext, iMsgQHandler); break; case TMS_FORMAT_G711: - ((TMSG711FormatImpl*) iFormat)->SetProxy(&iContext, + static_cast(iFormat)->SetProxy(&iContext, iMsgQHandler); break; case TMS_FORMAT_G729: - ((TMSG729FormatImpl*) iFormat)->SetProxy(&iContext, + static_cast(iFormat)->SetProxy(&iContext, iMsgQHandler); break; case TMS_FORMAT_ILBC: - ((TMSILBCFormatImpl*) iFormat)->SetProxy(&iContext, + static_cast(iFormat)->SetProxy(&iContext, iMsgQHandler); break; default: @@ -428,7 +429,7 @@ switch (sinkType) { case TMS_SINK_CLIENT: - ((TMSClientSinkImpl*) iSink)->SetProxy( + static_cast(iSink)->SetProxy( iContext.CallProxy, iMsgQHandler); break; case TMS_SINK_MODEM: @@ -453,7 +454,7 @@ switch (sourceType) { case TMS_SOURCE_CLIENT: - ((TMSClientSourceImpl*) iSource)->SetProxy( + static_cast(iSource)->SetProxy( iContext.CallProxy, iContext.StreamId, iMsgQHandler); break; @@ -717,7 +718,7 @@ void TMSStreamBodyImpl::QueueEvent(TInt aEventType, TInt aError, void* user_data) { - TMSSignalEvent event; + TMSSignalEvent event = {}; //all elements initialized to zeros event.reason = aError; event.user_data = user_data; iStreamState = aEventType; @@ -734,7 +735,7 @@ if (iObserver) { event.type = TMS_EVENT_STREAM_STATE_CHANGED; - iObserver->TMSStreamEvent(iParent, event); + iObserver->TMSStreamEvent(*iParent, event); } break; } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsstreamimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsstreamimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsstreamimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -71,7 +71,7 @@ { TRACE_PRN_FN_ENT; gint ret(TMS_RESULT_SUCCESS); - delete (TMSStreamImpl*) (strm); + delete (static_cast(strm)); strm = NULL; TRACE_PRN_FN_EXT; return ret; diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsvolumeeffectbodyimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsvolumeeffectbodyimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsvolumeeffectbodyimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -150,30 +150,27 @@ iProxy = aProxy; if (queuehandler) { - ((TMSQueueHandler*) queuehandler)->AddObserver(*this, + static_cast(queuehandler)->AddObserver(*this, TMS_EFFECT_VOLUME); } } void TMSVolumeEffectBodyImpl::QueueEvent(TInt aEventType, TInt aError, - void* /*user_data*/) + void* event_data) { - TMSSignalEvent event; + TMSSignalEvent event = {}; //all elements initialized to zeros + event.user_data = NULL; //use only to return data passed in by the user event.type = TMS_EVENT_EFFECT_VOL_CHANGED; event.reason = aError; - switch (aEventType) + if (event_data) { - case TMS_EVENT_EFFECT_VOL_CHANGED: - { - if (iObserver && iParent) - { - iObserver->EffectsEvent(iParent, event); - } - } - break; - default: - break; + event.event_data = static_cast(event_data); + } + + if (iObserver && iParent && aEventType == TMS_EVENT_EFFECT_VOL_CHANGED) + { + iObserver->EffectsEvent(*iParent, event); } } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsimpl/src/tmsvolumeeffectimpl.cpp --- a/mmserv/tms/tmsimpl/src/tmsvolumeeffectimpl.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsimpl/src/tmsvolumeeffectimpl.cpp Mon May 03 12:59:52 2010 +0300 @@ -77,7 +77,7 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSVolumeEffectBodyImpl*) this->iBody)->SetProxy(aProxy, + static_cast(this->iBody)->SetProxy(aProxy, queuehandler); } else @@ -92,7 +92,7 @@ gint ret(TMS_RESULT_SUCCESS); if (this->iBody) { - ((TMSVolumeEffectBodyImpl*) this->iBody)->SetParent(parent); + static_cast(this->iBody)->SetParent(parent); } else { diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsproxy/src/tmsproxy.cpp --- a/mmserv/tms/tmsproxy/src/tmsproxy.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsproxy/src/tmsproxy.cpp Mon May 03 12:59:52 2010 +0300 @@ -655,24 +655,28 @@ { case EMsgQueueGlobalVolumeType: case EMsgQueueGlobalGainType: - status = AddGlobalEffectObserver((*(TMSEffectObserver*) obsrv), - (*(TMSEffect*) parent), clientid); - break; + status = AddGlobalEffectObserver( + *(static_cast(obsrv)), + *(static_cast(parent)), clientid); + break; case EMsgQueueGlobalRoutingType: - status = AddRoutingObserver((*(TMSGlobalRoutingObserver*) obsrv), - (*(TMSGlobalRouting*) parent), clientid); + status = AddRoutingObserver( + *(static_cast(obsrv)), + *(static_cast(parent)), clientid); break; case EMsgQueueRingtoneType: - status = AddRingToneObserver((*(TMSRingToneObserver*) obsrv), - (*(TMSRingTone*) parent), clientid); + status = AddRingToneObserver( + *(static_cast(obsrv)), + *(static_cast(parent)), clientid); break; case EMsgQueueDTMFType: - status = AddDTMFObserver((*(TMSDTMFObserver*) obsrv), - (*(TMSDTMF*) parent), clientid); + status = AddDTMFObserver(*(static_cast(obsrv)), + *(static_cast(parent)), clientid); break; case EMsgQueueInbandToneType: - status = AddInbandToneObserver((*(TMSInbandToneObserver*) obsrv), - (*(TMSInbandTone*) parent), clientid); + status = AddInbandToneObserver( + *(static_cast(obsrv)), + *(static_cast(parent)), clientid); break; default: status = TMS_RESULT_INVALID_ARGUMENT; @@ -694,21 +698,24 @@ { case EMsgQueueGlobalVolumeType: case EMsgQueueGlobalGainType: - status = RemoveGlobalEffectObserver((*(TMSEffectObserver*) obsrv)); + status = RemoveGlobalEffectObserver( + *(static_cast(obsrv))); break; case EMsgQueueGlobalRoutingType: - status = RemoveRoutingObserver((*(TMSGlobalRoutingObserver*) - obsrv)); + status = RemoveRoutingObserver( + *(static_cast(obsrv))); break; case EMsgQueueRingtoneType: - status = RemoveRingToneObserver((*(TMSRingToneObserver*) obsrv)); + status = RemoveRingToneObserver( + *(static_cast(obsrv))); break; case EMsgQueueDTMFType: - status = RemoveDTMFObserver((*(TMSDTMFObserver*) obsrv)); + status = RemoveDTMFObserver( + *(static_cast(obsrv))); break; case EMsgQueueInbandToneType: - status = RemoveInbandToneObserver((*(TMSInbandToneObserver*) - obsrv)); + status = RemoveInbandToneObserver( + *(static_cast(obsrv))); break; default: status = TMS_RESULT_INVALID_ARGUMENT; @@ -954,21 +961,33 @@ // Call from QueueHandler as a result of TMS Server callback. // --------------------------------------------------------------------------- // -void TMSProxy::QueueEvent(gint aEventType, gint aError, void* user_data) +void TMSProxy::QueueEvent(gint aEventType, gint aError, void* event_data) { - TMSSignalEvent event; + TMSSignalEvent event = {}; //all elements initialized to zeros event.type = aEventType; event.reason = aError; - event.user_data = user_data; + event.user_data = NULL; //use only to return data passed in by the user switch (aEventType) { case TMS_EVENT_EFFECT_VOL_CHANGED: + { + if (event_data) + { + event.event_data = static_cast(event_data); + } + for (gint i = 0; i < iEffectsObsrvrList.Count(); i++) + { + iEffectsObsrvrList[i]->EffectsEvent(*iEffectsParentList[i], + event); + } + break; + } case TMS_EVENT_EFFECT_GAIN_CHANGED: { for (gint i = 0; i < iEffectsObsrvrList.Count(); i++) { - iEffectsObsrvrList[i]->EffectsEvent(iEffectsParentList[i], + iEffectsObsrvrList[i]->EffectsEvent(*iEffectsParentList[i], event); } break; @@ -978,14 +997,14 @@ case TMS_EVENT_ROUTING_SET_OUTPUT_COMPLETE: { guint output(0); - if (user_data != NULL) + if (event_data != NULL) { - output = *((guint*) user_data); + output = *(static_cast(event_data)); } for (gint i = 0; i < iRoutingObsrvrList.Count(); i++) { iRoutingObsrvrList[i]->GlobalRoutingEvent( - iRoutingParentList[i], event, output); + *iRoutingParentList[i], event, output); } break; } @@ -995,7 +1014,7 @@ { for (gint i = 0; i < iRingToneObsrvrList.Count(); i++) { - iRingToneObsrvrList[i]->RingtoneEvent(iRingToneParentList[i], + iRingToneObsrvrList[i]->RingtoneEvent(*iRingToneParentList[i], event); } break; @@ -1005,7 +1024,7 @@ { for (gint i = 0; i < iDTMFObsrvrList.Count(); i++) { - iDTMFObsrvrList[i]->DTMFEvent(iDTMFParentList[i], event); + iDTMFObsrvrList[i]->DTMFEvent(*iDTMFParentList[i], event); } break; } @@ -1015,7 +1034,7 @@ for (gint i = 0; i < iInbandToneObsrvrList.Count(); i++) { iInbandToneObsrvrList[i]->InbandToneEvent( - iInbandToneParentList[i], event); + *iInbandToneParentList[i], event); } break; } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsproxy/src/tmsqueuehandler.cpp --- a/mmserv/tms/tmsproxy/src/tmsqueuehandler.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsproxy/src/tmsqueuehandler.cpp Mon May 03 12:59:52 2010 +0300 @@ -178,7 +178,11 @@ switch (msgBuf.iRequest) { case ECmdGlobalEffectChange: - iObserver->QueueEvent(msgBuf.iInt, msgBuf.iStatus, NULL); + TMSVolumeEventChangeData event; + event.level = msgBuf.iUint; + event.output = static_cast(msgBuf.iInt2); + event.output_changed = msgBuf.iBool; + iObserver->QueueEvent(msgBuf.iInt, msgBuf.iStatus, &event); break; case ECmdGlobalRoutingChange: iObserver->QueueEvent(msgBuf.iInt, msgBuf.iStatus, diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsserver/inc/tmsserversession.h --- a/mmserv/tms/tmsserver/inc/tmsserversession.h Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsserver/inc/tmsserversession.h Mon May 03 12:59:52 2010 +0300 @@ -45,7 +45,9 @@ // Destructor ~TMSServerSession(); - void HandleGlobalEffectChange(TInt globalevent); + void HandleGlobalEffectChange(TInt globalevent, TInt level, + TBool output_change = EFalse, + TMSAudioOutput output = TMS_AUDIO_OUTPUT_PRIVATE); void HandleRoutingChange(TRoutingMsgBufPckg routinginfo); // Send notifications to clients diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsserver/src/tmscenrepaudiohandler.cpp --- a/mmserv/tms/tmsserver/src/tmscenrepaudiohandler.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsserver/src/tmscenrepaudiohandler.cpp Mon May 03 12:59:52 2010 +0300 @@ -75,17 +75,23 @@ { err = iMuteListener->Get(muteVal); } - if (iTMSSer && err == KErrNone && muteVal == EPSTelMicMuteOn) + if (err == KErrNone && muteVal == EPSTelMicMuteOn) { #if !defined(__WINSCW__) - iTMSSer->SetGain(NULL, 0); + if (iTMSSer) + { + iTMSSer->SetGain(NULL, 0); + } #endif //__WINSCW__ } else if (err == KErrNone) { #if !defined(__WINSCW__) // Change when gain is really changed - iTMSSer->SetGain(NULL, KDefaultMaxGain); + if (iTMSSer) + { + iTMSSer->SetGain(NULL, KDefaultMaxGain); + } #endif //__WINSCW__ } } diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsserver/src/tmsrtaudiohdlr.cpp --- a/mmserv/tms/tmsserver/src/tmsrtaudiohdlr.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsserver/src/tmsrtaudiohdlr.cpp Mon May 03 12:59:52 2010 +0300 @@ -99,11 +99,15 @@ iTtsPlayer = NULL; iTtsPlayer = CMdaAudioPlayerUtility::NewL(*this, aPriority, aPreference); + __ASSERT_DEBUG(iTtsPlayer, PANIC(TMS_RESULT_UNINITIALIZED_OBJECT)); + delete iTtsText; iTtsText = NULL; // UTF-8 strings can take up to 4 bytes per character iTtsText = HBufC8::NewL(aTtsText.Length() << KUTF8Multiply); + __ASSERT_DEBUG(iTtsText, PANIC(TMS_RESULT_UNINITIALIZED_OBJECT)); + TPtr8 refText = iTtsText->Des(); User::LeaveIfError(CnvUtfConverter::ConvertFromUnicodeToUtf8(refText, aTtsText)); @@ -534,6 +538,7 @@ TInt rampTime(0); if (iFormat == EFormatTone) { + __ASSERT_DEBUG(iTonePlayer, PANIC(TMS_RESULT_UNINITIALIZED_OBJECT)); switch (iRingType) { case ETypeRinging: @@ -604,6 +609,7 @@ } else if (iFormat == EFormatTts) { + __ASSERT_DEBUG(iTtsPlayer, PANIC(TMS_RESULT_UNINITIALIZED_OBJECT)); switch (iRingType) { case ETypeRinging: @@ -628,6 +634,7 @@ } else { + __ASSERT_DEBUG(iSamplePlayer, PANIC(TMS_RESULT_UNINITIALIZED_OBJECT)); switch (iRingType) { case ETypeRinging: @@ -707,20 +714,29 @@ // Check that volume is in a valid range. TInt volume = aVolume < 1 ? 1 : aVolume; - if (iFormat == EFormatTone && iTonePlayer) + if (iFormat == EFormatTone) { - iTonePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(aRamptime)); - iTonePlayer->SetVolume(ConvertVolume(volume)); + if (iTonePlayer) + { + iTonePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(aRamptime)); + iTonePlayer->SetVolume(ConvertVolume(volume)); + } } - else if (iFormat == EFormatTts && iTtsPlayer) + else if (iFormat == EFormatTts) { - iTtsPlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(aRamptime)); - iTtsPlayer->SetVolume(ConvertVolume(volume)); + if (iTtsPlayer) + { + iTtsPlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(aRamptime)); + iTtsPlayer->SetVolume(ConvertVolume(volume)); + } } else { - iSamplePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(aRamptime)); - iSamplePlayer->SetVolume(ConvertVolume(volume)); + if (iSamplePlayer) + { + iSamplePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(aRamptime)); + iSamplePlayer->SetVolume(ConvertVolume(volume)); + } } } @@ -734,15 +750,24 @@ if (iFormat == EFormatTone) { - result = iTonePlayer->MaxVolume() * aVolume / KMaxVolumeLevel; + if (iTonePlayer) + { + result = iTonePlayer->MaxVolume() * aVolume / KMaxVolumeLevel; + } } else if (iFormat == EFormatTts) { - result = iTtsPlayer->MaxVolume() * aVolume / KMaxVolumeLevel; + if (iTtsPlayer) + { + result = iTtsPlayer->MaxVolume() * aVolume / KMaxVolumeLevel; + } } else { - result = iSamplePlayer->MaxVolume() * aVolume / KMaxVolumeLevel; + if (iSamplePlayer) + { + result = iSamplePlayer->MaxVolume() * aVolume / KMaxVolumeLevel; + } } // If user selected minimum volume level set HW volume 1 @@ -772,15 +797,24 @@ { if (iFormat == EFormatTone) { - iTonePlayer->SetVolume(0); + if (iTonePlayer) + { + iTonePlayer->SetVolume(0); + } } - else if (iFormat == EFormatTts) + else if (iFormat == EFormatTts && iTtsPlayer) { - iTtsPlayer->SetVolume(0); + if (iTtsPlayer) + { + iTtsPlayer->SetVolume(0); + } } else // EFormatSample { - iSamplePlayer->SetVolume(0); + if (iSamplePlayer) + { + iSamplePlayer->SetVolume(0); + } } } else diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsserver/src/tmsserver.cpp --- a/mmserv/tms/tmsserver/src/tmsserver.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsserver/src/tmsserver.cpp Mon May 03 12:59:52 2010 +0300 @@ -82,7 +82,7 @@ iUplCodecs.Reset(); iUplCodecs.Close(); delete iEffectSettings; - CancelRoutingNotifier(); + delete iTarHandler; CancelCenRepHandler(); CancelDTMFNotifier(); DeinitRingTonePlayer(); @@ -136,8 +136,13 @@ iTarHandler = NULL; iAudioCenRepHandler = NULL; iDTMFHandler = NULL; - iCurrentRouting = TMS_AUDIO_OUTPUT_NONE; - InitRingTonePlayerL(); + iCurrentRouting = TMS_AUDIO_OUTPUT_PRIVATE; + + //TODO: EUnit fails to initialize ProfileEngine in RT in eshell mode + TRAP_IGNORE(InitRingTonePlayerL()); + + // We need it running for global volume change updates + StartRoutingNotifierL(); TRACE_PRN_FN_EXT; } @@ -341,7 +346,7 @@ // void TMSServer::CancelRoutingNotifier() { - if (--iTarHandlerCount <= 0) + if (--iTarHandlerCount < 1) { delete iTarHandler; iTarHandler = NULL; @@ -670,7 +675,8 @@ while (serverSession != NULL) { serverSession->HandleGlobalEffectChange( - TMS_EVENT_EFFECT_VOL_CHANGED); + TMS_EVENT_EFFECT_VOL_CHANGED, level, EFalse, + iCurrentRouting); serverSession = static_cast (iSessionIter++); } @@ -745,7 +751,7 @@ while (serverSession != NULL) { serverSession->HandleGlobalEffectChange( - TMS_EVENT_EFFECT_GAIN_CHANGED); + TMS_EVENT_EFFECT_GAIN_CHANGED, level); serverSession = static_cast (iSessionIter++); } } @@ -864,19 +870,37 @@ { TRACE_PRN_FN_ENT; + TInt vol; iCurrentRouting = routingpckg().iOutput; + if (iCurrentRouting == TMS_AUDIO_OUTPUT_PUBLIC || + iCurrentRouting == TMS_AUDIO_OUTPUT_LOUDSPEAKER) + { + iEffectSettings->GetLoudSpkrVolume(vol); + } + else + { + iEffectSettings->GetEarPieceVolume(vol); + } + + TInt status = SendMessageToCallServ(TMS_EFFECT_GLOBAL_VOL_SET, vol); + iSessionIter.SetToFirst(); TMSServerSession* serverSession = static_cast (iSessionIter++); - while (serverSession != NULL) { - serverSession->HandleRoutingChange(routingpckg); + // Send only if there is a subscriber to TMS routing notifications. + if (iTarHandlerCount > 1) + { + serverSession->HandleRoutingChange(routingpckg); + } + serverSession->HandleGlobalEffectChange(TMS_EVENT_EFFECT_VOL_CHANGED, + vol, ETrue, iCurrentRouting); serverSession = static_cast (iSessionIter++); } TRACE_PRN_FN_EXT; - return TMS_RESULT_SUCCESS; + return status; } // ----------------------------------------------------------------------------- diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsserver/src/tmsserversession.cpp --- a/mmserv/tms/tmsserver/src/tmsserversession.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsserver/src/tmsserversession.cpp Mon May 03 12:59:52 2010 +0300 @@ -306,10 +306,14 @@ // TMSServerSession::HandleGlobalEffectChange // ----------------------------------------------------------------------------- // -void TMSServerSession::HandleGlobalEffectChange(TInt globalevent) +void TMSServerSession::HandleGlobalEffectChange(TInt globalevent, TInt level, + TBool output_change, TMSAudioOutput output) { TRACE_PRN_FN_ENT; iMsgBuffer.iInt = globalevent; + iMsgBuffer.iUint = (guint)level; + iMsgBuffer.iInt2 = (gint)output; + iMsgBuffer.iBool = output_change; NotifyClient(ECmdGlobalEffectChange); TRACE_PRN_FN_EXT; } @@ -363,7 +367,7 @@ codecsCount = codecs->Count(); } - if (codecsCount <= 0) + if (codecs && codecsCount <= 0) { delete iDevSound; iDevSound = NULL; diff -r 5a06f39ad45b -r 80975da52420 mmserv/tms/tmsutility/src/tmsutility.cpp --- a/mmserv/tms/tmsutility/src/tmsutility.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/tms/tmsutility/src/tmsutility.cpp Mon May 03 12:59:52 2010 +0300 @@ -141,7 +141,6 @@ case KErrEtelCallNotActive: //-2007 result = TMS_REASON_CALL_NOT_ACTIVE;//add TMS_RESULT_CALL_NOT_ACTIVE break; - /**********************************/ //case KErrEtelCoreBase: //-2000 case KErrEtelNotCallOwner: //-2000 case KErrEtelDuplicatePhoneName: //-2001 diff -r 5a06f39ad45b -r 80975da52420 mmserv/voipaudioservices/VoIPServer/src/VoIPDownlinkThread.cpp --- a/mmserv/voipaudioservices/VoIPServer/src/VoIPDownlinkThread.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/voipaudioservices/VoIPServer/src/VoIPDownlinkThread.cpp Mon May 03 12:59:52 2010 +0300 @@ -123,6 +123,7 @@ if (!cleanupStack) { + shared.iMutex.Signal(); return KErrNoMemory; } @@ -130,6 +131,7 @@ TRAPD(err, thread = CVoIPDownlinkThread::NewL(shared)); if (err != KErrNone) { + shared.iMutex.Signal(); return err; } diff -r 5a06f39ad45b -r 80975da52420 mmserv/voipaudioservices/VoIPServer/src/VoIPServerSession.cpp --- a/mmserv/voipaudioservices/VoIPServer/src/VoIPServerSession.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/voipaudioservices/VoIPServer/src/VoIPServerSession.cpp Mon May 03 12:59:52 2010 +0300 @@ -127,8 +127,8 @@ iShared.iMainThreadID = tID; iAO = new (ELeave) CVoIPServerAO(this, tID); iShared.iMnThreadStatus = &(this->iAO->iStatus); + iShared.iCodecSettings.iG711FrameRate = TVoIPCodecSettings::E20MS; iShared.iMutex.Signal(); - iShared.iCodecSettings.iG711FrameRate = TVoIPCodecSettings::E20MS; iAO->Request(); iSessionType = ENone; diff -r 5a06f39ad45b -r 80975da52420 mmserv/voipaudioservices/VoIPServer/src/VoIPUplinkThread.cpp --- a/mmserv/voipaudioservices/VoIPServer/src/VoIPUplinkThread.cpp Fri Apr 16 15:29:42 2010 +0300 +++ b/mmserv/voipaudioservices/VoIPServer/src/VoIPUplinkThread.cpp Mon May 03 12:59:52 2010 +0300 @@ -115,6 +115,7 @@ if (!cleanupStack) { + shared.iMutex.Signal(); return KErrNoMemory; } @@ -122,6 +123,7 @@ TRAPD(err, thread = CVoIPUplinkThread::NewL(shared)); if (err != KErrNone) { + shared.iMutex.Signal(); return err; } diff -r 5a06f39ad45b -r 80975da52420 package_definition.xml --- a/package_definition.xml Fri Apr 16 15:29:42 2010 +0300 +++ b/package_definition.xml Mon May 03 12:59:52 2010 +0300 @@ -1,7 +1,12 @@ - + + + + + + @@ -40,6 +45,9 @@ + + +