Revision: 201011
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 16 Apr 2010 15:29:42 +0300
changeset 12 5a06f39ad45b
parent 0 71ca22bcf22a
child 14 80975da52420
Revision: 201011 Kit: 201015
group/bld.inf
inc/EAacPlusUtil.h
khronosfws/group/bld.inf
khronosfws/openmax_al/bwins/openmaxalu.def
khronosfws/openmax_al/data/create_openmax_al_stub_sis.bat
khronosfws/openmax_al/data/openmax_al_stub.pkg
khronosfws/openmax_al/data/openmax_al_stub.sis
khronosfws/openmax_al/eabi/openmaxalu.def
khronosfws/openmax_al/group/bld.inf
khronosfws/openmax_al/group/openmaxal.mmp
khronosfws/openmax_al/inc/openmaxalwrapper.h
khronosfws/openmax_al/rom/openmax_al.iby
khronosfws/openmax_al/sis/openmax_al.pkg
khronosfws/openmax_al/sis/openmax_al_urel.pkg
khronosfws/openmax_al/src/adaptation/xaadaptation.h
khronosfws/openmax_al/src/adaptation/xaadaptationcontextbase.c
khronosfws/openmax_al/src/adaptation/xaadaptationcontextbase.h
khronosfws/openmax_al/src/adaptation/xaaudioencoderitfadaptation.c
khronosfws/openmax_al/src/adaptation/xaaudioencoderitfadaptation.h
khronosfws/openmax_al/src/adaptation/xacameraadaptctx.c
khronosfws/openmax_al/src/adaptation/xacameraadaptctx.h
khronosfws/openmax_al/src/adaptation/xacameraitfadaptation.c
khronosfws/openmax_al/src/adaptation/xacameraitfadaptation.h
khronosfws/openmax_al/src/adaptation/xadevicevolumeitfadaptation.c
khronosfws/openmax_al/src/adaptation/xadevicevolumeitfadaptation.h
khronosfws/openmax_al/src/adaptation/xadynamicsourceitfadaptation.c
khronosfws/openmax_al/src/adaptation/xadynamicsourceitfadaptation.h
khronosfws/openmax_al/src/adaptation/xaengineadaptctx.c
khronosfws/openmax_al/src/adaptation/xaengineadaptctx.h
khronosfws/openmax_al/src/adaptation/xaequalizeritfadaptation.c
khronosfws/openmax_al/src/adaptation/xaequalizeritfadaptation.h
khronosfws/openmax_al/src/adaptation/xaimagecontrolsitfadaptation.c
khronosfws/openmax_al/src/adaptation/xaimagecontrolsitfadaptation.h
khronosfws/openmax_al/src/adaptation/xaimageeffectsitfadaptation.c
khronosfws/openmax_al/src/adaptation/xaimageeffectsitfadaptation.h
khronosfws/openmax_al/src/adaptation/xaimageencoderitfadaptation.c
khronosfws/openmax_al/src/adaptation/xaimageencoderitfadaptation.h
khronosfws/openmax_al/src/adaptation/xaledarrayadaptctx.c
khronosfws/openmax_al/src/adaptation/xaledarrayadaptctx.h
khronosfws/openmax_al/src/adaptation/xaledarrayitfadaptation.c
khronosfws/openmax_al/src/adaptation/xaledarrayitfadaptation.h
khronosfws/openmax_al/src/adaptation/xamediaplayeradaptctx.c
khronosfws/openmax_al/src/adaptation/xamediaplayeradaptctx.h
khronosfws/openmax_al/src/adaptation/xamediarecorderadaptctx.c
khronosfws/openmax_al/src/adaptation/xamediarecorderadaptctx.h
khronosfws/openmax_al/src/adaptation/xametadataadaptation.c
khronosfws/openmax_al/src/adaptation/xametadataadaptation.h
khronosfws/openmax_al/src/adaptation/xametadataadaptctx.c
khronosfws/openmax_al/src/adaptation/xametadataadaptctx.h
khronosfws/openmax_al/src/adaptation/xangavideosink.cpp
khronosfws/openmax_al/src/adaptation/xangavideosink.h
khronosfws/openmax_al/src/adaptation/xaoutputmixadaptctx.c
khronosfws/openmax_al/src/adaptation/xaoutputmixadaptctx.h
khronosfws/openmax_al/src/adaptation/xaoutputmixitfadaptation.c
khronosfws/openmax_al/src/adaptation/xaoutputmixitfadaptation.h
khronosfws/openmax_al/src/adaptation/xaplaybackrateitfadaptation.c
khronosfws/openmax_al/src/adaptation/xaplaybackrateitfadaptation.h
khronosfws/openmax_al/src/adaptation/xaplayitfadaptation.c
khronosfws/openmax_al/src/adaptation/xaplayitfadaptation.h
khronosfws/openmax_al/src/adaptation/xaradioadaptctx.c
khronosfws/openmax_al/src/adaptation/xaradioadaptctx.h
khronosfws/openmax_al/src/adaptation/xaradioitfadaptation.c
khronosfws/openmax_al/src/adaptation/xaradioitfadaptation.h
khronosfws/openmax_al/src/adaptation/xardsitfadaptation.c
khronosfws/openmax_al/src/adaptation/xardsitfadaptation.h
khronosfws/openmax_al/src/adaptation/xarecorditfadaptation.c
khronosfws/openmax_al/src/adaptation/xarecorditfadaptation.h
khronosfws/openmax_al/src/adaptation/xaseekitfadaptation.c
khronosfws/openmax_al/src/adaptation/xaseekitfadaptation.h
khronosfws/openmax_al/src/adaptation/xasnapshotitfadaptation.c
khronosfws/openmax_al/src/adaptation/xasnapshotitfadaptation.h
khronosfws/openmax_al/src/adaptation/xastaticcameracapsadaptation.c
khronosfws/openmax_al/src/adaptation/xastaticcameracapsadaptation.h
khronosfws/openmax_al/src/adaptation/xastaticcapsadaptation.c
khronosfws/openmax_al/src/adaptation/xastaticcapsadaptation.h
khronosfws/openmax_al/src/adaptation/xavibraadaptctx.c
khronosfws/openmax_al/src/adaptation/xavibraadaptctx.h
khronosfws/openmax_al/src/adaptation/xavibraitfadaptation.c
khronosfws/openmax_al/src/adaptation/xavibraitfadaptation.h
khronosfws/openmax_al/src/adaptation/xavideoencoderitfadaptation.c
khronosfws/openmax_al/src/adaptation/xavideoencoderitfadaptation.h
khronosfws/openmax_al/src/adaptation/xavideopostprosessingitfadaptation.c
khronosfws/openmax_al/src/adaptation/xavideopostprosessingitfadaptation.h
khronosfws/openmax_al/src/adaptation/xavolumeitfadaptation.c
khronosfws/openmax_al/src/adaptation/xavolumeitfadaptation.h
khronosfws/openmax_al/src/camera/xacameradevice.c
khronosfws/openmax_al/src/camera/xacameradevice.h
khronosfws/openmax_al/src/camera/xacameraitf.c
khronosfws/openmax_al/src/camera/xacameraitf.h
khronosfws/openmax_al/src/common/openmaxal.c
khronosfws/openmax_al/src/common/xacommon.c
khronosfws/openmax_al/src/common/xaconfigextensionsitf.c
khronosfws/openmax_al/src/common/xaconfigextensionsitf.h
khronosfws/openmax_al/src/common/xadebug.h
khronosfws/openmax_al/src/common/xadynamicsourceitf.c
khronosfws/openmax_al/src/common/xadynamicsourceitf.h
khronosfws/openmax_al/src/common/xadynintmgmtitf.c
khronosfws/openmax_al/src/common/xadynintmgmtitf.h
khronosfws/openmax_al/src/common/xaequalizeritf.c
khronosfws/openmax_al/src/common/xaequalizeritf.h
khronosfws/openmax_al/src/common/xaglobals.h
khronosfws/openmax_al/src/common/xaimagecontrolsitf.c
khronosfws/openmax_al/src/common/xaimagecontrolsitf.h
khronosfws/openmax_al/src/common/xaimageeffectsitf.c
khronosfws/openmax_al/src/common/xaimageeffectsitf.h
khronosfws/openmax_al/src/common/xametadataextractionitf.c
khronosfws/openmax_al/src/common/xametadataextractionitf.h
khronosfws/openmax_al/src/common/xametadatatraversalitf.c
khronosfws/openmax_al/src/common/xametadatatraversalitf.h
khronosfws/openmax_al/src/common/xaobjectitf.c
khronosfws/openmax_al/src/common/xaobjectitf.h
khronosfws/openmax_al/src/common/xaplatform.c
khronosfws/openmax_al/src/common/xaplatform.h
khronosfws/openmax_al/src/common/xathreadsafety.c
khronosfws/openmax_al/src/common/xathreadsafety.h
khronosfws/openmax_al/src/common/xavideopostprocessingitf.c
khronosfws/openmax_al/src/common/xavideopostprocessingitf.h
khronosfws/openmax_al/src/common/xavolumeitf.c
khronosfws/openmax_al/src/common/xavolumeitf.h
khronosfws/openmax_al/src/engine/xaaudiodecodercapabilitiesitf.c
khronosfws/openmax_al/src/engine/xaaudiodecodercapabilitiesitf.h
khronosfws/openmax_al/src/engine/xaaudioencodercapabilitiesitf.c
khronosfws/openmax_al/src/engine/xaaudioencodercapabilitiesitf.h
khronosfws/openmax_al/src/engine/xaaudioiodevicecapabilitiesitf.c
khronosfws/openmax_al/src/engine/xaaudioiodevicecapabilitiesitf.h
khronosfws/openmax_al/src/engine/xacameracapabilitiesitf.c
khronosfws/openmax_al/src/engine/xacameracapabilitiesitf.h
khronosfws/openmax_al/src/engine/xadevicevolumeitf.c
khronosfws/openmax_al/src/engine/xadevicevolumeitf.h
khronosfws/openmax_al/src/engine/xaengine.c
khronosfws/openmax_al/src/engine/xaengine.h
khronosfws/openmax_al/src/engine/xaengineitf.c
khronosfws/openmax_al/src/engine/xaengineitf.h
khronosfws/openmax_al/src/engine/xaimagedecodercapabilitiesitf.c
khronosfws/openmax_al/src/engine/xaimagedecodercapabilitiesitf.h
khronosfws/openmax_al/src/engine/xaimageencodercapabilitiesitf.c
khronosfws/openmax_al/src/engine/xaimageencodercapabilitiesitf.h
khronosfws/openmax_al/src/engine/xathreadsyncitf.c
khronosfws/openmax_al/src/engine/xathreadsyncitf.h
khronosfws/openmax_al/src/engine/xavideodecodercapabilitiesitf.c
khronosfws/openmax_al/src/engine/xavideodecodercapabilitiesitf.h
khronosfws/openmax_al/src/engine/xavideoencodercapabilitiesitf.c
khronosfws/openmax_al/src/engine/xavideoencodercapabilitiesitf.h
khronosfws/openmax_al/src/khronos/openmaxal_iid.c
khronosfws/openmax_al/src/ledarray/xaledarraydevice.c
khronosfws/openmax_al/src/ledarray/xaledarraydevice.h
khronosfws/openmax_al/src/ledarray/xaledarrayitf.c
khronosfws/openmax_al/src/ledarray/xaledarrayitf.h
khronosfws/openmax_al/src/mediaplayer/xamediaplayer.c
khronosfws/openmax_al/src/mediaplayer/xamediaplayer.h
khronosfws/openmax_al/src/mediaplayer/xaplaybackrateitf.c
khronosfws/openmax_al/src/mediaplayer/xaplaybackrateitf.h
khronosfws/openmax_al/src/mediaplayer/xaplayitf.c
khronosfws/openmax_al/src/mediaplayer/xaplayitf.h
khronosfws/openmax_al/src/mediaplayer/xaprefetchstatusitf.c
khronosfws/openmax_al/src/mediaplayer/xaprefetchstatusitf.h
khronosfws/openmax_al/src/mediaplayer/xaseekitf.c
khronosfws/openmax_al/src/mediaplayer/xaseekitf.h
khronosfws/openmax_al/src/mediarecorder/xaaudioencoderitf.c
khronosfws/openmax_al/src/mediarecorder/xaaudioencoderitf.h
khronosfws/openmax_al/src/mediarecorder/xaimageencoderitf.c
khronosfws/openmax_al/src/mediarecorder/xaimageencoderitf.h
khronosfws/openmax_al/src/mediarecorder/xamediarecorder.c
khronosfws/openmax_al/src/mediarecorder/xamediarecorder.h
khronosfws/openmax_al/src/mediarecorder/xametadatainsertionitf.c
khronosfws/openmax_al/src/mediarecorder/xametadatainsertionitf.h
khronosfws/openmax_al/src/mediarecorder/xarecorditf.c
khronosfws/openmax_al/src/mediarecorder/xarecorditf.h
khronosfws/openmax_al/src/mediarecorder/xasnapshotitf.c
khronosfws/openmax_al/src/mediarecorder/xasnapshotitf.h
khronosfws/openmax_al/src/mediarecorder/xavideoencoderitf.c
khronosfws/openmax_al/src/mediarecorder/xavideoencoderitf.h
khronosfws/openmax_al/src/metadataextractor/xametadataextractor.c
khronosfws/openmax_al/src/metadataextractor/xametadataextractor.h
khronosfws/openmax_al/src/mmf_adaptation/cmmfbackendengine.cpp
khronosfws/openmax_al/src/mmf_adaptation/cmmfbackendengine.h
khronosfws/openmax_al/src/mmf_adaptation/sfmrlocaltimer.cpp
khronosfws/openmax_al/src/mmf_adaptation/sfmrlocaltimer.h
khronosfws/openmax_al/src/mmf_adaptation/xaadaptationcontextbasemmf.c
khronosfws/openmax_al/src/mmf_adaptation/xaadaptationcontextbasemmf.h
khronosfws/openmax_al/src/mmf_adaptation/xaadaptationmmf.h
khronosfws/openmax_al/src/mmf_adaptation/xaengineadaptctxmmf.c
khronosfws/openmax_al/src/mmf_adaptation/xaengineadaptctxmmf.h
khronosfws/openmax_al/src/mmf_adaptation/xamediaplayeradaptctxmmf.c
khronosfws/openmax_al/src/mmf_adaptation/xamediaplayeradaptctxmmf.h
khronosfws/openmax_al/src/mmf_adaptation/xamediarecorderadaptctxmmf.c
khronosfws/openmax_al/src/mmf_adaptation/xamediarecorderadaptctxmmf.h
khronosfws/openmax_al/src/mmf_adaptation/xangavideosink.cpp
khronosfws/openmax_al/src/mmf_adaptation/xangavideosink.h
khronosfws/openmax_al/src/mmf_adaptation/xaplayitfadaptationmmf.c
khronosfws/openmax_al/src/mmf_adaptation/xaplayitfadaptationmmf.h
khronosfws/openmax_al/src/mmf_adaptation/xarecorditfadaptationmmf.c
khronosfws/openmax_al/src/mmf_adaptation/xarecorditfadaptationmmf.h
khronosfws/openmax_al/src/outputmix/xaoutputmix.c
khronosfws/openmax_al/src/outputmix/xaoutputmix.h
khronosfws/openmax_al/src/outputmix/xaoutputmixitf.c
khronosfws/openmax_al/src/outputmix/xaoutputmixitf.h
khronosfws/openmax_al/src/radio/xaradiodevice.c
khronosfws/openmax_al/src/radio/xaradiodevice.h
khronosfws/openmax_al/src/radio/xaradioitf.c
khronosfws/openmax_al/src/radio/xaradioitf.h
khronosfws/openmax_al/src/radio/xardsitf.c
khronosfws/openmax_al/src/radio/xardsitf.h
khronosfws/openmax_al/src/vibra/xavibradevice.c
khronosfws/openmax_al/src/vibra/xavibradevice.h
khronosfws/openmax_al/src/vibra/xavibraitf.c
khronosfws/openmax_al/src/vibra/xavibraitf.h
layers.sysdef.xml
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpDataSourceAdapter/EABI/3gpDataSourceAdapteru.def
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpDataSourceAdapter/Src/3gpDataSourceAdapter.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudioplaycontroller/Data/3GPAudioPlayControllerResource.rss
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudioplaycontroller/Src/3GPAudioPlayControllerPlugin.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudiorecordcontroller/Data/3GPAudioRecordControllerResource.rss
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudiorecordcontroller/Src/3GPAudioRecordControllerPlugin.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/EABI/AdvancedAudioControllerU.DEF
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Inc/AdvancedAudioController.h
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Inc/AdvancedAudioResource.h
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Inc/AdvancedAudioResource.rh
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioDecoder.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioPlayController.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioResource.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DataSourceAdapter/Bwins/DataSourceAdapteru.def
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DataSourceAdapter/EABI/DataSourceAdapteru.def
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DataSourceAdapter/Inc/DataSourceAdapter.h
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DataSourceAdapter/Src/DataSourceAdapter.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DevSoundAudioOutput/Src/DevSoundAudioOutput.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Data/AACAudioPlayControllerResource.rss
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Src/AACAudioPlayControllerHwDecoder.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Src/AACAudioPlayControllerPlugin.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Data/AMRAudioPlayControllerResource.rss
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Src/AMRAudioPlayControllerHwDecoder.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Src/AMRAudioPlayControllerPlugin.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudiorecordcontroller/Data/AMRAudioRecordControllerResource.rss
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudiorecordcontroller/Src/AMRAudioRecordControllerPlugin.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Data/AWBAudioPlayControllerResource.rss
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Src/AWBAudioPlayControllerHwDecoder.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Src/AWBAudioPlayControllerPlugin.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Data/MP3AudioPlayControllerResource.rss
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Src/MP3AudioPlayControllerHwDecoder.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Src/MP3AudioPlayControllerPlugin.cpp
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/10kbps 11khz cbr mono.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/128kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/12kbps 8khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/160kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/192kbps 48khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/256kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/320kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/96kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/VBR Q98 44Khz stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/conf/AudioPlaybackTestModule.cfg
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/10kbps 11khz cbr mono.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/128kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/12kbps 8khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/160kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/192kbps 48khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/256kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/320kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/96kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/VBR Q98 44Khz stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/src/MmfTsPlay_core.cpp
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/src/SimpleSoundPlayer.cpp
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/conf/AudioRecorderTestModule.cfg
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/10kbps 11khz cbr mono.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/128kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/12kbps 8khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/160kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/192kbps 48khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/256kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/320kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/96kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/VBR Q98 44Khz stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/inc/RecordOpen.h
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/inc/RecordingBase.h
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/AudioLoadingProgress.cpp
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/MetaDataEntry.cpp
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/RecordingBase.cpp
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/10kbps 11khz cbr mono.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/128kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/12kbps 8khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/160kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/192kbps 48khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/256kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/320kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/96kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/VBR Q98 44Khz stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/10kbps 11khz cbr mono.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/128kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/12kbps 8khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/160kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/192kbps 48khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/256kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/320kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/96kbps 44khz cbr stereo.wma
mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/VBR Q98 44Khz stereo.wma
mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientStreamControl.cpp
mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientStreamControl.h
mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientUtility.cpp
mmfenh/enhancedmediaclient/Plugins/DescriptorSource/group/ABLD.BAT
mmmw_info/mmmw_metadata/mmmw_metadata.mrp
mmmw_plat/call_audio_control_api/tsrc/data/mmc/alarm 1.aac
mmmw_plat/equalizer_ui_api/inc/EqualizerPresetsDialog.h
mmmw_plat/group/bld.inf
mmmw_plat/mtp_keys_api/group/bld.inf
mmmw_plat/mtp_keys_api/inc/MtpPrivateCRKeys.h
mmmw_plat/mtp_keys_api/inc/MtpPrivatePSKeys.h
mmmw_plat/mtp_keys_api/mtp_keys_api.metaxml
mmmw_plat/mtp_wmdrm_api/group/bld.inf
mmmw_plat/mtp_wmdrm_api/inc/MMtpJanusDrmIf.h
mmmw_plat/mtp_wmdrm_api/mtp_wmdrm_api.metaxml
mmmw_plat/openmax_al_api/group/bld.inf
mmmw_plat/openmax_al_api/inc/OpenMAXAL.h
mmmw_plat/openmax_al_api/inc/OpenMAXAL_Platform.h
mmmw_plat/openmax_al_api/openmax_al_api.metaxml
mmmw_plat/openmax_al_api/readme.txt
mmmw_plat/radio_preset_utilities_api/group/bld.inf
mmmw_plat/radio_preset_utilities_api/inc/RadioFmPresetUtility.h
mmmw_plat/radio_preset_utilities_api/inc/RadioPresetUtility.h
mmmw_plat/radio_preset_utilities_api/inc/preset.h
mmmw_plat/radio_preset_utilities_api/inc/presetutility.h
mmmw_plat/radio_preset_utilities_api/inc/presetutilityobserver.h
mmmw_plat/radio_preset_utilities_api/radio_preset_utilities_api.metaxml
mmmw_plat/telephony_multimedia_service_api/group/bld.inf
mmmw_plat/telephony_multimedia_service_api/inc/tms.h
mmmw_plat/telephony_multimedia_service_api/inc/tmsdtmf.h
mmmw_plat/telephony_multimedia_service_api/inc/tmsdtmfobsrvr.h
mmmw_plat/telephony_multimedia_service_api/inc/tmsfactory.h
mmmw_plat/telephony_multimedia_service_api/inc/tmsinbandtone.h
mmmw_plat/telephony_multimedia_service_api/inc/tmsinbandtoneobsrvr.h
mmmw_plat/telephony_multimedia_service_api/inc/tmsringtone.h
mmmw_plat/telephony_multimedia_service_api/inc/tmsringtoneobsrvr.h
mmmw_plat/telephony_multimedia_service_api/tsrc/Conf/TMSAudioServicesTestClass.cfg
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/group/TmsAudioServicesTestClass.mmp
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/group/TmsAudioServicesTestClass.pkg
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/inc/TMSAudioServicesTestClass.h
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/RD.crt
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/RD.key
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/TmsAudioServicesTestClass.pkg
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/create_sis.bat
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TimeoutController.cpp
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocks.cpp
mmmw_plat/voip_audio_services_api/inc/voipaudiocommon.h
mmmw_plat/voip_audio_services_api/inc/voipdatabuffer.h
mmmw_plat/voip_audio_services_api/inc/voipdownlinkstream.h
mmmw_plat/voip_audio_services_api/inc/voipdtmftoneplayer.h
mmmw_plat/voip_audio_services_api/inc/voipformatintfc.h
mmmw_plat/voip_audio_services_api/inc/voipg711decoderintfc.h
mmmw_plat/voip_audio_services_api/inc/voipg711encoderintfc.h
mmmw_plat/voip_audio_services_api/inc/voipg729decoderintfc.h
mmmw_plat/voip_audio_services_api/inc/voipilbcdecoderintfc.h
mmmw_plat/voip_audio_services_api/inc/voipilbcencoderintfc.h
mmmw_plat/voip_audio_services_api/inc/voipjitterbufferintfc.h
mmmw_plat/voip_audio_services_api/inc/voipringtonefactory.h
mmmw_plat/voip_audio_services_api/inc/voipringtoneplayer.h
mmmw_plat/voip_audio_services_api/inc/voipuplinkstream.h
mmmw_plat/voip_audio_services_api/inc/voiputilityfactory.h
mmmw_plat/voip_audio_services_api/tsrc/Group/bld.inf
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/SignedVoIPTestClass_wClose.SIS
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/SignedVoIPTestClass_woClose.SIS
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/VoIPAudioServicesTestClass.mmp
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/VoIPAudioServicesTestClass.pkg
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/VoIPAudioServicesTestClass.sis
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/VoIPAudioServicesTestClass.sisx
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/rd-key.pem
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/rd.cer
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/inc/VoIPAudioServicesTestClass.h
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/sis/VoIPAudioServicesTestClass.pkg
mmmw_plat/voip_audio_services_api/tsrc/data/mmc/alarm 1.aac
mmmw_plat/voip_audio_services_api/tsrc/init/TestFramework.ini
mmmw_plat/voip_audio_services_api/tsrc/init/VoIPAudioServicesTestClass.ini
mmserv/callaudiocontrol/group/CallAudioControl.mmp
mmserv/callaudiocontrol/group/bld.inf
mmserv/callaudiocontrol/inc/CallAudioControlImpl.h
mmserv/radioutility/fmpresetutility/BWINS/FmPresetUtilityU.DEF
mmserv/radioutility/fmpresetutility/Conf/fmpresetutility.confml
mmserv/radioutility/fmpresetutility/Conf/fmpresetutility_10207B87.crml
mmserv/radioutility/fmpresetutility/EABI/FmPresetUtilityU.DEF
mmserv/radioutility/fmpresetutility/cenrep/keys_fmpresetutility.xls
mmserv/radioutility/fmpresetutility/group/FmPresetUtility.mmp
mmserv/radioutility/fmpresetutility/group/backup_registration.xml
mmserv/radioutility/fmpresetutility/group/bld.inf
mmserv/radioutility/fmpresetutility/rom/FmPresetUtility.iby
mmserv/radioutility/fmpresetutility/src/RadioFmPresetCRKeys.h
mmserv/radioutility/fmpresetutility/src/RadioFmPresetCentralRepositoryHandler.cpp
mmserv/radioutility/fmpresetutility/src/RadioFmPresetCentralRepositoryHandler.h
mmserv/radioutility/fmpresetutility/src/RadioFmPresetChannel.cpp
mmserv/radioutility/fmpresetutility/src/RadioFmPresetChannel.h
mmserv/radioutility/fmpresetutility/src/RadioFmPresetRadioSettings.cpp
mmserv/radioutility/fmpresetutility/src/RadioFmPresetRadioSettings.h
mmserv/radioutility/fmpresetutility/src/RadioFmPresetUtility.cpp
mmserv/radioutility/fmpresetutility/src/RadioFmPresetUtilityBody.cpp
mmserv/radioutility/fmpresetutility/src/RadioFmPresetUtilityBody.h
mmserv/radioutility/fmpresetutility/src/debug.h
mmserv/radioutility/group/bld.inf
mmserv/radioutility/inc/RadioSession.h
mmserv/radioutility/radio_utility/src/RadioFmTunerUtilityBody.h
mmserv/radioutility/radio_utility/src/RadioMonitorBody.h
mmserv/radioutility/radio_utility/src/RadioPlayerUtilityBody.cpp
mmserv/radioutility/radio_utility/src/RadioPlayerUtilityBody.h
mmserv/radioutility/radio_utility/src/RadioRdsUtilityBody.h
mmserv/radioutility/radio_utility/src/RadioUtility.cpp
mmserv/radioutility/radioserver/Server/Src/RadioServer.cpp
mmserv/radioutility/radioserver/Server/Src/RadioServer.h
mmserv/radioutility/radioserver/Server/Src/RadioServerFMTuner.cpp
mmserv/radioutility/radioserver/Server/Src/RadioServerSession.cpp
mmserv/radioutility/radioserver/Server/Src/RadioServerSession.h
mmserv/thumbnailengine/Group/HXTNEEngine.mmp
mmserv/thumbnailengine/Group/bld.inf
mmserv/thumbnailengine/ImaamiSrc/DCDigitalZoom.cpp
mmserv/thumbnailengine/TneAPIInc/HXTneclientservercommon.h
mmserv/tms/inc/tmsamrformatimpl.h
mmserv/tms/inc/tmsbufferimpl.h
mmserv/tms/inc/tmscallimpl.h
mmserv/tms/inc/tmscallserverstartparam.h
mmserv/tms/inc/tmsclientserver.h
mmserv/tms/inc/tmsclientsinkimpl.h
mmserv/tms/inc/tmsclientsourceimpl.h
mmserv/tms/inc/tmsdtmfbody.h
mmserv/tms/inc/tmsdtmfimpl.h
mmserv/tms/inc/tmseffectimpl.h
mmserv/tms/inc/tmsformatimpl.h
mmserv/tms/inc/tmsg711formatimpl.h
mmserv/tms/inc/tmsg729formatimpl.h
mmserv/tms/inc/tmsgaineffectimpl.h
mmserv/tms/inc/tmsglobalgaineffectimpl.h
mmserv/tms/inc/tmsglobalroutingimpl.h
mmserv/tms/inc/tmsglobalvoleffectimpl.h
mmserv/tms/inc/tmsilbcformatimpl.h
mmserv/tms/inc/tmsinbandtonebody.h
mmserv/tms/inc/tmsinbandtoneimpl.h
mmserv/tms/inc/tmsmembuffer.h
mmserv/tms/inc/tmsmicsourceimpl.h
mmserv/tms/inc/tmsmodemsinkimpl.h
mmserv/tms/inc/tmsmodemsourceimpl.h
mmserv/tms/inc/tmspcmformatimpl.h
mmserv/tms/inc/tmsproxy.h
mmserv/tms/inc/tmsqueuehandler.h
mmserv/tms/inc/tmsringtonebody.h
mmserv/tms/inc/tmsringtoneimpl.h
mmserv/tms/inc/tmsshared.h
mmserv/tms/inc/tmssinkimpl.h
mmserv/tms/inc/tmssourceimpl.h
mmserv/tms/inc/tmsspeakersinkimpl.h
mmserv/tms/inc/tmsstreamimpl.h
mmserv/tms/inc/tmsutility.h
mmserv/tms/inc/tmsvolumeeffectimpl.h
mmserv/tms/sis/10207C80.cre
mmserv/tms/sis/tms_cenrep.pkg
mmserv/tms/tmsapi/bwins/tmsapi.def
mmserv/tms/tmsapi/eabi/tmsapi.def
mmserv/tms/tmsapi/group/tmsapi.mmp
mmserv/tms/tmsapi/src/tmsdtmf.cpp
mmserv/tms/tmsapi/src/tmsinbandtone.cpp
mmserv/tms/tmsapi/src/tmsringtone.cpp
mmserv/tms/tmscallproxy/group/tmscallproxy.mmp
mmserv/tms/tmscallproxy/src/tmscallproxy.cpp
mmserv/tms/tmscallserver/eabi/tmscallserver.def
mmserv/tms/tmscallserver/group/tmscallserver.mmp
mmserv/tms/tmscallserver/inc/calladpt.h
mmserv/tms/tmscallserver/inc/callcsadpt.h
mmserv/tms/tmscallserver/inc/callipadpt.h
mmserv/tms/tmscallserver/inc/cpeaudiodtmftoneplayer.h
mmserv/tms/tmscallserver/inc/csdownlink.h
mmserv/tms/tmscallserver/inc/cspdevsound.h
mmserv/tms/tmscallserver/inc/cspdtmfprovider.h
mmserv/tms/tmscallserver/inc/cspeteldtmfmonitor.h
mmserv/tms/tmscallserver/inc/cspeteldtmfstopmonitor.h
mmserv/tms/tmscallserver/inc/csuplink.h
mmserv/tms/tmscallserver/inc/dtmfnotifier.h
mmserv/tms/tmscallserver/inc/dtmftoneplayerobserver.h
mmserv/tms/tmscallserver/inc/ipcallstream.h
mmserv/tms/tmscallserver/inc/mccpdtmfobserver.h
mmserv/tms/tmscallserver/inc/mcspdevsoundobserver.h
mmserv/tms/tmscallserver/inc/tarsettings.h
mmserv/tms/tmscallserver/inc/tmscallsession.h
mmserv/tms/tmscallserver/src/calladpt.cpp
mmserv/tms/tmscallserver/src/callcsadpt.cpp
mmserv/tms/tmscallserver/src/callipadpt.cpp
mmserv/tms/tmscallserver/src/cpeaudiodtmftoneplayer.cpp
mmserv/tms/tmscallserver/src/csdownlink.cpp
mmserv/tms/tmscallserver/src/cspdevsound.cpp
mmserv/tms/tmscallserver/src/cspdtmfprovider.cpp
mmserv/tms/tmscallserver/src/cspeteldtmfmonitor.cpp
mmserv/tms/tmscallserver/src/cspeteldtmfstopmonitor.cpp
mmserv/tms/tmscallserver/src/csuplink.cpp
mmserv/tms/tmscallserver/src/delaytimer.cpp
mmserv/tms/tmscallserver/src/dtmfnotifier.cpp
mmserv/tms/tmscallserver/src/ipcalldownlink.cpp
mmserv/tms/tmscallserver/src/ipcalldownlinkds.cpp
mmserv/tms/tmscallserver/src/ipcallstreambase.cpp
mmserv/tms/tmscallserver/src/ipcalluplink.cpp
mmserv/tms/tmscallserver/src/ipcalluplinkds.cpp
mmserv/tms/tmscallserver/src/tarsettings.cpp
mmserv/tms/tmscallserver/src/tmscallsession.cpp
mmserv/tms/tmsfactory/bwins/tmsfactory.def
mmserv/tms/tmsfactory/eabi/tmsfactory.def
mmserv/tms/tmsfactory/group/tmsfactory.mmp
mmserv/tms/tmsfactory/inc/tmsfactoryimpl.h
mmserv/tms/tmsfactory/src/tmsfactory.cpp
mmserv/tms/tmsfactory/src/tmsfactoryimpl.cpp
mmserv/tms/tmsimpl/bwins/tmsimpl.def
mmserv/tms/tmsimpl/eabi/tmsimpl.def
mmserv/tms/tmsimpl/group/tmsimpl.mmp
mmserv/tms/tmsimpl/inc/tmsdtmfbodyimpl.h
mmserv/tms/tmsimpl/inc/tmsformatbodyimpl.h
mmserv/tms/tmsimpl/inc/tmsgaineffectbodyimpl.h
mmserv/tms/tmsimpl/inc/tmsglobalgaineffectbodyimpl.h
mmserv/tms/tmsimpl/inc/tmsglobalroutingbodyimpl.h
mmserv/tms/tmsimpl/inc/tmsglobalvoleffectbodyimpl.h
mmserv/tms/tmsimpl/inc/tmsinbandtonebodyimpl.h
mmserv/tms/tmsimpl/inc/tmsringtonebodyimpl.h
mmserv/tms/tmsimpl/inc/tmsstreambodyimpl.h
mmserv/tms/tmsimpl/inc/tmsvolumeeffectbodyimpl.h
mmserv/tms/tmsimpl/src/tmsamrbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsamrimpl.cpp
mmserv/tms/tmsimpl/src/tmsbufferimpl.cpp
mmserv/tms/tmsimpl/src/tmscallimpl.cpp
mmserv/tms/tmsimpl/src/tmsclientsinkbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsclientsinkimpl.cpp
mmserv/tms/tmsimpl/src/tmsclientsourcebodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsclientsourceimpl.cpp
mmserv/tms/tmsimpl/src/tmscscallbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsdtmfbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsdtmfimpl.cpp
mmserv/tms/tmsimpl/src/tmseffectimpl.cpp
mmserv/tms/tmsimpl/src/tmsformatbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsformatimpl.cpp
mmserv/tms/tmsimpl/src/tmsg711bodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsg711impl.cpp
mmserv/tms/tmsimpl/src/tmsg729bodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsg729impl.cpp
mmserv/tms/tmsimpl/src/tmsgaineffectbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsgaineffectimpl.cpp
mmserv/tms/tmsimpl/src/tmsglobalgaineffectbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsglobalgaineffectimpl.cpp
mmserv/tms/tmsimpl/src/tmsglobalroutingbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsglobalroutingimpl.cpp
mmserv/tms/tmsimpl/src/tmsglobalvoleffectbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsglobalvoleffectimpl.cpp
mmserv/tms/tmsimpl/src/tmsilbcbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsilbcimpl.cpp
mmserv/tms/tmsimpl/src/tmsinbandtonebodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsinbandtoneimpl.cpp
mmserv/tms/tmsimpl/src/tmsipcallbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsmicsourcebodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsmicsourceimpl.cpp
mmserv/tms/tmsimpl/src/tmsmodemsinkbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsmodemsinkimpl.cpp
mmserv/tms/tmsimpl/src/tmsmodemsourcebodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsmodemsourceimpl.cpp
mmserv/tms/tmsimpl/src/tmspcmbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmspcmimpl.cpp
mmserv/tms/tmsimpl/src/tmsqueuehandler.cpp
mmserv/tms/tmsimpl/src/tmsringtonebodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsringtoneimpl.cpp
mmserv/tms/tmsimpl/src/tmssinkimpl.cpp
mmserv/tms/tmsimpl/src/tmssourceimpl.cpp
mmserv/tms/tmsimpl/src/tmsspeakersinkbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsspeakersinkimpl.cpp
mmserv/tms/tmsimpl/src/tmsstreambodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsstreamimpl.cpp
mmserv/tms/tmsimpl/src/tmsvolumeeffectbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsvolumeeffectimpl.cpp
mmserv/tms/tmsproxy/bwins/tmsproxy.def
mmserv/tms/tmsproxy/eabi/tmsproxy.def
mmserv/tms/tmsproxy/group/tmsproxy.mmp
mmserv/tms/tmsproxy/src/tmsproxy.cpp
mmserv/tms/tmsproxy/src/tmsqueuehandler.cpp
mmserv/tms/tmsserver/conf/tmseffectscenrep.confml
mmserv/tms/tmsserver/conf/tmseffectscenrep_10207c80.crml
mmserv/tms/tmsserver/group/tmsserver.mmp
mmserv/tms/tmsserver/inc/cspaudiohandler.h
mmserv/tms/tmsserver/inc/cspcenreplistener.h
mmserv/tms/tmsserver/inc/globaleffectssettings.h
mmserv/tms/tmsserver/inc/mcspcenrepobserver.h
mmserv/tms/tmsserver/inc/tareventhandler.h
mmserv/tms/tmsserver/inc/tmsasyncreqao.h
mmserv/tms/tmsserver/inc/tmsasyncreqobsrv.h
mmserv/tms/tmsserver/inc/tmsaudioinbandtoneplayer.h
mmserv/tms/tmsserver/inc/tmsaudiotoneutility.h
mmserv/tms/tmsserver/inc/tmsaudiotoneutilityimpl.h
mmserv/tms/tmsserver/inc/tmscenrepaudiohandler.h
mmserv/tms/tmsserver/inc/tmscenreplistener.h
mmserv/tms/tmsserver/inc/tmscenrepobserver.h
mmserv/tms/tmsserver/inc/tmsdtmfeventhandler.h
mmserv/tms/tmsserver/inc/tmsglobaleffectssettings.h
mmserv/tms/tmsserver/inc/tmspubsublistener.h
mmserv/tms/tmsserver/inc/tmspubsubobserver.h
mmserv/tms/tmsserver/inc/tmsrtaudiohdlr.h
mmserv/tms/tmsserver/inc/tmsrtaudiohdlrobsrv.h
mmserv/tms/tmsserver/inc/tmsrtcontainer.h
mmserv/tms/tmsserver/inc/tmsrtparam.h
mmserv/tms/tmsserver/inc/tmsrtplayer.h
mmserv/tms/tmsserver/inc/tmsrtplayerobsrv.h
mmserv/tms/tmsserver/inc/tmsserver.h
mmserv/tms/tmsserver/inc/tmsserversession.h
mmserv/tms/tmsserver/inc/tmstareventhandler.h
mmserv/tms/tmsserver/inc/tmstelephonycenrep.h
mmserv/tms/tmsserver/inc/tmstimer.h
mmserv/tms/tmsserver/src/cspaudiohandler.cpp
mmserv/tms/tmsserver/src/cspcenreplistener.cpp
mmserv/tms/tmsserver/src/globaleffectssettings.cpp
mmserv/tms/tmsserver/src/tareventhandler.cpp
mmserv/tms/tmsserver/src/tmsasyncreqao.cpp
mmserv/tms/tmsserver/src/tmsaudioinbandtoneplayer.cpp
mmserv/tms/tmsserver/src/tmsaudiotoneutilityimpl.cpp
mmserv/tms/tmsserver/src/tmscenrepaudiohandler.cpp
mmserv/tms/tmsserver/src/tmscenreplistener.cpp
mmserv/tms/tmsserver/src/tmsdtmfeventhandler.cpp
mmserv/tms/tmsserver/src/tmsglobaleffectssettings.cpp
mmserv/tms/tmsserver/src/tmspubsublistener.cpp
mmserv/tms/tmsserver/src/tmsrtaudiohdlr.cpp
mmserv/tms/tmsserver/src/tmsrtcontainer.cpp
mmserv/tms/tmsserver/src/tmsrtplayer.cpp
mmserv/tms/tmsserver/src/tmsserver.cpp
mmserv/tms/tmsserver/src/tmsserversession.cpp
mmserv/tms/tmsserver/src/tmsservershutdown.cpp
mmserv/tms/tmsserver/src/tmstareventhandler.cpp
mmserv/tms/tmsserver/src/tmstimer.cpp
mmserv/tms/tmsutility/bwins/tmsutility.def
mmserv/tms/tmsutility/eabi/tmsutility.def
mmserv/tms/tmsutility/group/tmsutility.mmp
mmserv/tms/tmsutility/src/tmsutility.cpp
mmserv/voipaudioservices/JitterBufferUtility/group/JitterBuffer.mmp
mmserv/voipaudioservices/JitterBufferUtility/src/JitterBuffer.cpp
mmserv/voipaudioservices/VoIPIntfc/src/VoIPQueueHandler.cpp
mmserv/voipaudioservices/VoIPServer/group/VoIPAudioServer.mmp
mmserv/voipaudioservices/VoIPServer/inc/VoIPECallEventHandler.h
mmserv/voipaudioservices/VoIPServer/src/VoIPECallEventHandler.cpp
mmserv/voipaudioservices/VoIPServer/src/VoIPQueueHandlerSrv.cpp
mmserv/voipaudioservices/VoIPServer/src/VoIPServerAO.cpp
mmserv/voipaudioservices/VoIPServer/src/VoIPServerShutdown.cpp
package_definition.xml
--- a/group/bld.inf	Tue Feb 02 01:08:46 2010 +0200
+++ b/group/bld.inf	Fri Apr 16 15:29:42 2010 +0300
@@ -28,8 +28,7 @@
 #include "../mmmw_plat/group/bld.inf"
 #include "../mmfenh/group/bld.inf"
 #include "../mmserv/group/bld.inf"
-
-//#include "../mmfw/group/bld.inf"  //Uncomment when OpenAX AL or other stuffs are ready under mmfw
+#include "../khronosfws/group/bld.inf"
 
 
 //  End of File  
--- a/inc/EAacPlusUtil.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/inc/EAacPlusUtil.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,8 +1,8 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
+* 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".
 *
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/group/bld.inf	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2006 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 <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+
+PRJ_MMPFILES
+#include "../openmax_al/group/bld.inf"
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/bwins/openmaxalu.def	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,45 @@
+EXPORTS
+	xaCreateEngine @ 1 NONAME
+	xaQueryNumSupportedEngineInterfaces @ 2 NONAME
+	xaQuerySupportedEngineInterfaces @ 3 NONAME
+	XA_IID_AUDIODECODERCAPABILITIES @ 4 NONAME
+	XA_IID_AUDIOENCODER @ 5 NONAME
+	XA_IID_AUDIOENCODERCAPABILITIES @ 6 NONAME
+	XA_IID_AUDIOIODEVICECAPABILITIES @ 7 NONAME
+	XA_IID_CAMERA @ 8 NONAME
+	XA_IID_CAMERACAPABILITIES @ 9 NONAME
+	XA_IID_CONFIGEXTENSION @ 10 NONAME
+	XA_IID_DEVICEVOLUME @ 11 NONAME
+	XA_IID_DYNAMICINTERFACEMANAGEMENT @ 12 NONAME
+	XA_IID_DYNAMICSOURCE @ 13 NONAME
+	XA_IID_ENGINE @ 14 NONAME
+	XA_IID_EQUALIZER @ 15 NONAME
+	XA_IID_IMAGECONTROLS @ 16 NONAME
+	XA_IID_IMAGEDECODERCAPABILITIES @ 17 NONAME
+	XA_IID_IMAGEEFFECTS @ 18 NONAME
+	XA_IID_IMAGEENCODER @ 19 NONAME
+	XA_IID_IMAGEENCODERCAPABILITIES @ 20 NONAME
+	XA_IID_LED @ 21 NONAME
+	XA_IID_METADATAEXTRACTION @ 22 NONAME
+	XA_IID_METADATAINSERTION @ 23 NONAME
+	XA_IID_METADATATRAVERSAL @ 24 NONAME
+	XA_IID_NULL @ 25 NONAME
+	XA_IID_OBJECT @ 26 NONAME
+	XA_IID_OUTPUTMIX @ 27 NONAME
+	XA_IID_PLAY @ 28 NONAME
+	XA_IID_PLAYBACKRATE @ 29 NONAME
+	XA_IID_PREFETCHSTATUS @ 30 NONAME
+	XA_IID_RADIO @ 31 NONAME
+	XA_IID_RDS @ 32 NONAME
+	XA_IID_RECORD @ 33 NONAME
+	XA_IID_SEEK @ 34 NONAME
+	XA_IID_SNAPSHOT @ 35 NONAME
+	XA_IID_STREAMINFORMATION @ 36 NONAME
+	XA_IID_THREADSYNC @ 37 NONAME
+	XA_IID_VIBRA @ 38 NONAME
+	XA_IID_VIDEODECODERCAPABILITIES @ 39 NONAME
+	XA_IID_VIDEOENCODER @ 40 NONAME
+	XA_IID_VIDEOENCODERCAPABILITIES @ 41 NONAME
+	XA_IID_VIDEOPOSTPROCESSING @ 42 NONAME
+	XA_IID_VOLUME @ 43 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/data/create_openmax_al_stub_sis.bat	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,17 @@
+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: PKG for Telephony Media Services (TMS)
+rem
+
+makesis -s openmax_al_stub.pkg openmax_al_stub.sis
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/data/openmax_al_stub.pkg	Fri Apr 16 15:29:42 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: OpenMAXAL Stub SIS (openmaxal)
+;
+;File: openmax_al_stub.pkg
+
+;Languages
+&EN
+
+;Header
+#{"OpenMAXAL"},(0x10207CAE),1,0,0, TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
Binary file khronosfws/openmax_al/data/openmax_al_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/eabi/openmaxalu.def	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,45 @@
+EXPORTS
+	xaCreateEngine @ 1 NONAME
+	xaQueryNumSupportedEngineInterfaces @ 2 NONAME
+	xaQuerySupportedEngineInterfaces @ 3 NONAME
+	XA_IID_AUDIODECODERCAPABILITIES @ 4 NONAME DATA 4
+	XA_IID_AUDIOENCODER @ 5 NONAME DATA 4
+	XA_IID_AUDIOENCODERCAPABILITIES @ 6 NONAME DATA 4
+	XA_IID_AUDIOIODEVICECAPABILITIES @ 7 NONAME DATA 4
+	XA_IID_CAMERA @ 8 NONAME DATA 4
+	XA_IID_CAMERACAPABILITIES @ 9 NONAME DATA 4
+	XA_IID_CONFIGEXTENSION @ 10 NONAME DATA 4
+	XA_IID_DEVICEVOLUME @ 11 NONAME DATA 4
+	XA_IID_DYNAMICINTERFACEMANAGEMENT @ 12 NONAME DATA 4
+	XA_IID_DYNAMICSOURCE @ 13 NONAME DATA 4
+	XA_IID_ENGINE @ 14 NONAME DATA 4
+	XA_IID_EQUALIZER @ 15 NONAME DATA 4
+	XA_IID_IMAGECONTROLS @ 16 NONAME DATA 4
+	XA_IID_IMAGEDECODERCAPABILITIES @ 17 NONAME DATA 4
+	XA_IID_IMAGEEFFECTS @ 18 NONAME DATA 4
+	XA_IID_IMAGEENCODER @ 19 NONAME DATA 4
+	XA_IID_IMAGEENCODERCAPABILITIES @ 20 NONAME DATA 4
+	XA_IID_LED @ 21 NONAME DATA 4
+	XA_IID_METADATAEXTRACTION @ 22 NONAME DATA 4
+	XA_IID_METADATAINSERTION @ 23 NONAME DATA 4
+	XA_IID_METADATATRAVERSAL @ 24 NONAME DATA 4
+	XA_IID_NULL @ 25 NONAME DATA 4
+	XA_IID_OBJECT @ 26 NONAME DATA 4
+	XA_IID_OUTPUTMIX @ 27 NONAME DATA 4
+	XA_IID_PLAY @ 28 NONAME DATA 4
+	XA_IID_PLAYBACKRATE @ 29 NONAME DATA 4
+	XA_IID_PREFETCHSTATUS @ 30 NONAME DATA 4
+	XA_IID_RADIO @ 31 NONAME DATA 4
+	XA_IID_RDS @ 32 NONAME DATA 4
+	XA_IID_RECORD @ 33 NONAME DATA 4
+	XA_IID_SEEK @ 34 NONAME DATA 4
+	XA_IID_SNAPSHOT @ 35 NONAME DATA 4
+	XA_IID_STREAMINFORMATION @ 36 NONAME DATA 4
+	XA_IID_THREADSYNC @ 37 NONAME DATA 4
+	XA_IID_VIBRA @ 38 NONAME DATA 4
+	XA_IID_VIDEODECODERCAPABILITIES @ 39 NONAME DATA 4
+	XA_IID_VIDEOENCODER @ 40 NONAME DATA 4
+	XA_IID_VIDEOENCODERCAPABILITIES @ 41 NONAME DATA 4
+	XA_IID_VIDEOPOSTPROCESSING @ 42 NONAME DATA 4
+	XA_IID_VOLUME @ 43 NONAME DATA 4
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/group/bld.inf	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* 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 OpenMaxAL
+*
+*/
+
+
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+#ifdef FF_OPENMAX_AL
+../data/openmax_al_stub.sis /epoc32/data/z/system/install/openmax_al_stub.sis
+../rom/openmax_al.iby       CORE_MW_LAYER_IBY_EXPORT_PATH(openmax_al.iby)
+#endif
+
+PRJ_MMPFILES
+#ifdef FF_OPENMAX_AL
+openmaxal.mmp
+#endif
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/group/openmaxal.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,213 @@
+/*
+* 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 file for openmaxal
+*
+*/
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET		openmaxal.dll
+TARGETTYPE	DLL
+UID		    0x1000008D 0x10207CA3
+VENDORID	VID_DEFAULT
+
+VERSION 10.0
+#if !defined(__WINSCW__) && !defined(__WINS__)
+EpocAllowDllData
+#endif
+
+CAPABILITY ALL -TCB
+
+MACRO   USE_NGA_SURFACES
+//MACRO   _GSTREAMER_BACKEND_
+
+#ifdef _GSTREAMER_BACKEND_
+SOURCEPATH      ../Src/adaptation
+SOURCE	XAAdaptationContextBase.c
+SOURCE	XAAudioEncoderItfAdaptation.c
+SOURCE	XACameraAdaptCtx.c
+SOURCE	XACameraItfAdaptation.c
+SOURCE	XADeviceVolumeItfAdaptation.c
+SOURCE	XADynamicSourceItfAdaptation.c
+SOURCE	XAEngineAdaptCtx.c
+SOURCE	XAEqualizerItfAdaptation.c
+SOURCE	XAImageControlsItfAdaptation.c
+SOURCE	XAImageEffectsItfAdaptation.c
+SOURCE	XAImageEncoderItfAdaptation.c
+SOURCE	XALEDArrayAdaptCtx.c
+SOURCE	XALEDArrayItfAdaptation.c
+SOURCE	XAMediaPlayerAdaptCtx.c
+SOURCE	XAMediaRecorderAdaptCtx.c
+SOURCE	XAMetadataAdaptation.c
+SOURCE	XAMetadataAdaptCtx.c
+SOURCE	XAOutputMixAdaptCtx.c
+SOURCE	XAOutputMixItfAdaptation.c
+SOURCE	XAPlaybackRateItfAdaptation.c
+SOURCE	XAPlayItfAdaptation.c
+SOURCE	XARadioAdaptCtx.c
+SOURCE	XARadioItfAdaptation.c
+SOURCE	XARDSItfAdaptation.c
+SOURCE	XARecordItfAdaptation.c
+SOURCE	XASeekItfAdaptation.c
+SOURCE	XASnapShotItfAdaptation.c
+SOURCE	XAStaticCameraCapsAdaptation.c
+SOURCE	XAStaticCapsAdaptation.c
+SOURCE	XAVibraAdaptCtx.c
+SOURCE	XAVibraItfAdaptation.c
+SOURCE	XAVideoEncoderItfAdaptation.c
+SOURCE	XAVideoPostProsessingItfAdaptation.c
+SOURCE	XAVolumeItfAdaptation.c
+// 9.2 only (Exclude on other platforms)
+SOURCE  XANGAVideoSink.cpp
+#endif
+
+SOURCEPATH      ../src/camera
+SOURCE          xacameradevice.c
+SOURCE          xacameraitf.c
+
+SOURCEPATH      ../src/common
+SOURCE          openmaxal.c
+SOURCE          xacommon.c
+SOURCE          xaconfigextensionsitf.c
+SOURCE          xadynamicsourceitf.c
+SOURCE          xadynintmgmtitf.c
+SOURCE          xaequalizeritf.c
+SOURCE          xaimagecontrolsitf.c
+SOURCE          xaimageeffectsitf.c
+SOURCE          xametadataextractionitf.c
+SOURCE          xametadatatraversalitf.c
+SOURCE          xaobjectitf.c
+SOURCE          xaplatform.c
+SOURCE          xathreadsafety.c
+SOURCE          xavideopostprocessingitf.c
+SOURCE          xavolumeitf.c
+
+SOURCEPATH      ../src/engine
+SOURCE          xaaudiodecodercapabilitiesitf.c
+SOURCE          xaaudioencodercapabilitiesitf.c
+SOURCE          xaaudioiodevicecapabilitiesitf.c
+SOURCE          xacameracapabilitiesitf.c
+SOURCE          xadevicevolumeitf.c
+SOURCE          xaengine.c
+SOURCE          xaengineitf.c
+SOURCE          xaimagedecodercapabilitiesitf.c
+SOURCE          xaimageencodercapabilitiesitf.c
+SOURCE          xathreadsyncitf.c
+SOURCE          xavideodecodercapabilitiesitf.c
+SOURCE          xavideoencodercapabilitiesitf.c
+
+SOURCEPATH      ../src/ledarray
+SOURCE          xaledarraydevice.c
+SOURCE          xaledarrayitf.c
+
+SOURCEPATH      ../src/mediaplayer
+SOURCE          xamediaplayer.c
+SOURCE          xaplaybackrateitf.c
+SOURCE          xaplayitf.c
+SOURCE          xaprefetchstatusitf.c
+SOURCE          xaseekitf.c
+
+SOURCEPATH      ../src/mediarecorder
+SOURCE          xaaudioencoderitf.c
+SOURCE          xaimageencoderitf.c
+SOURCE          xamediarecorder.c
+SOURCE          xametadatainsertionitf.c
+SOURCE          xarecorditf.c
+SOURCE          xasnapshotitf.c
+SOURCE          xavideoencoderitf.c
+
+SOURCEPATH      ../src/metadataextractor
+SOURCE          xametadataextractor.c
+
+SOURCEPATH      ../src/outputmix
+SOURCE          xaoutputmix.c
+SOURCE		    xaoutputmixitf.c
+
+SOURCEPATH      ../src/radio
+SOURCE          xaradiodevice.c
+SOURCE		    xaradioitf.c
+SOURCE		    xardsitf.c
+
+SOURCEPATH      ../src/vibra
+SOURCE          xavibradevice.c
+SOURCE		    xavibraitf.c
+
+SOURCEPATH      ../src/mmf_adaptation
+SOURCE	xaengineadaptctxmmf.c
+SOURCE	xamediaplayeradaptctxmmf.c
+SOURCE	xaplayitfadaptationmmf.c
+SOURCE	xaadaptationcontextbasemmf.c
+SOURCE  cmmfbackendengine.cpp
+SOURCE  xamediarecorderadaptctxmmf.c
+SOURCE  xarecorditfadaptationmmf.c
+SOURCE 	sfmrlocaltimer.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../src
+USERINCLUDE     ../src/khronos
+USERINCLUDE     ../src/mmf_adaptation
+#ifdef _GSTREAMER_BACKEND_
+USERINCLUDE     ../Src/adaptation
+#endif
+USERINCLUDE     ../src/camera
+USERINCLUDE     ../src/common
+USERINCLUDE     ../src/engine
+USERINCLUDE     ../src/ledarray
+USERINCLUDE     ../src/mediaplayer
+USERINCLUDE     ../src/mediarecorder
+USERINCLUDE     ../src/outputmix
+USERINCLUDE     ../src/radio
+USERINCLUDE     ../src/vibra
+
+MW_LAYER_SYSTEMINCLUDE
+OS_LAYER_LIBC_SYSTEMINCLUDE
+OS_LAYER_GLIB_SYSTEMINCLUDE
+SYSTEMINCLUDE /epoc32/include/platform/mw/khronos 
+// 9.2
+#ifdef _GSTREAMER_BACKEND_
+SYSTEMINCLUDE  	/sf/mw/gstreamer/include/gstreamer
+SYSTEMINCLUDE  	/sf/mw/gstreamer/include/gstreamer/gst
+SYSTEMINCLUDE  	/sf/mw/gstreamer/include/gstreamer/gst/interfaces
+SYSTEMINCLUDE  	/sf/mw/gstreamer/include/gstreamer/gst/app
+SYSTEMINCLUDE  	/sf/mw/gstreamer/include/gstreamer/gst/video
+#endif
+
+LIBRARY         euser.lib
+LIBRARY         libc.lib
+LIBRARY         libglib.lib
+LIBRARY         libpthread.lib
+
+LIBRARY         mediaclientvideodisplay.lib
+LIBRARY         ws32.lib
+LIBRARY			inetprotutil.lib
+LIBRARY         mediaclientaudio.lib
+LIBRARY         MMFControllerFramework.lib
+LIBRARY         mediaclientvideo.lib
+
+#ifdef _GSTREAMER_BACKEND_
+LIBRARY         libgmodule.lib
+LIBRARY         libgobject.lib
+LIBRARY         libgstreamer.lib
+LIBRARY         libgstapp.lib
+LIBRARY		    libgstphotography.lib
+LIBRARY 	    libgstinterfaces.lib 
+LIBRARY		    libgstvideo.lib
+LIBRARY 	    libgstbase.lib
+LIBRARY 	    libgstcoreelements.lib
+LIBRARY		    libgstcoreindexers.lib
+#endif 
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/inc/openmaxalwrapper.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* 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: 
+*
+*/
+#ifndef _OPENMAXAL_WRAPPER_H_
+#define _OPENMAXAL_WRAPPER_H_
+
+#include <OpenMAXAL_Platform.h>
+#undef XA_API
+
+#define XA_API __declspec(dllexport)
+ 
+#include <OpenMAXAL.h>
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/rom/openmax_al.iby	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,37 @@
+/*
+* 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: OpenMAX AL
+*
+*/
+/*
+ * openmax_al.iby
+ *
+ */
+
+#ifndef OPENMAX_AL_IBY
+#define OPENMAX_AL_IBY
+
+#include <bldvariant.hrh>
+#ifdef FF_OPENMAX_AL
+
+file=ABI_DIR/BUILD_DIR/openmaxal.dll         SHARED_LIB_DIR/openmaxal.dll
+
+//OpenMAX_AL_Stub
+data=ZSYSTEM/install/openmax_al_stub.sis         System/Install/openmax_al_stub.sis
+
+#endif //FF_OPENMAX_AL
+
+#endif //OPENMAX_AL_IBY
+
+//End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/sis/openmax_al.pkg	Fri Apr 16 15:29:42 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: OpenMAX AL - UDEB build
+;
+;File: openmax_al.pkg
+
+;Languages
+&EN
+
+;Header
+#{"OpenMax_AL"},(0x10207CAF),1,0,0, TYPE=SA, RU
+
+;Series 60 v5.0
+[0x101F7961], 0,0,0, {"Series60ProductID"}
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files To Copy...<src> <destination>
+"/epoc32/release/armv5/udeb/openmaxal.dll"         -"!:/sys/bin/openmaxal.dll"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/sis/openmax_al_urel.pkg	Fri Apr 16 15:29:42 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: OpenMAX AL - UREL build
+;
+;File: openmax_al.pkg
+
+;Languages
+&EN
+
+;Header
+#{"OpenMax_AL"},(0x10207CAF),1,0,0, TYPE=SA, RU
+
+;Series 60 v5.0
+[0x101F7961], 0,0,0, {"Series60ProductID"}
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files To Copy...<src> <destination>
+"/epoc32/release/armv5/urel/openmaxal.dll"         -"!:/sys/bin/openmaxal.dll"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,490 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAADAPTATION_H_
+#define XAADAPTATION_H_
+
+#include <pthread.h>
+#include <semaphore.h>
+#include <string.h>
+#include <unistd.h>
+#include "openmaxalwrapper.h"
+#include "XAAdaptationContextBase.h"
+#include "XAGlobals.h"
+#include <gst.h>
+#include <gstappsrc.h>
+#include <gstappsink.h>
+#include <gstappbuffer.h>
+#include <photography.h>
+#include <OpenMAXAL_ContentPipe.h>
+#include "XAPlatform.h"
+#include "XAStaticCapsAdaptation.h"
+
+#ifdef XA_IMPL_MEASURE_GST_DELAY
+#include <time.h>
+#endif /* XA_IMPL_MEASURE_GST_DELAY */
+
+/* MACROS */
+#define FLIP_NONE               0
+#define FLIP_CLOCKWISE          1 /* Rotate clockwise 90 degrees */
+#define FLIP_ROTATE_180         2 /* Rotate 180 degrees */
+#define FLIP_COUNTERCLOCKWISE   3 /* Rotate counter-clockwise 90 degrees */
+#define FLIP_HORIZONTAL         4 /* Flip image horizontally */
+#define FLIP_VERTICAL           5 /* Flip image vertically */
+
+/* TYPEDEFS */
+typedef gboolean (*GstBusCb)( GstBus *bus, GstMessage *message, gpointer data );
+#define XA_IMPL_SUPPORTED_AUDIO_OUT_NUM 3
+#define XA_IMPL_OMIX_MAX_CONNECTED_MEDIAPLAYERS 10
+#define CONTENT_PIPE_BUFFER_SIZE 1000
+#define TEST_VIDEO_WIDTH     640
+#define TEST_VIDEO_HEIGHT    480
+
+typedef enum
+{
+    XA_AUDIO_WAVENC = 0,
+    XA_AUDIO_VORBISENC,
+    XA_AUDIO_PCM,
+    XA_NUM_OF_AUDIOENCODERS /* Do not move this line */
+} XAAudioEnc;
+
+typedef enum
+{
+    XA_VIDEO_JPEGENC = 0,
+    XA_VIDEO_THEORAENC,
+    XA_NUM_OF_VIDEOENCODERS /* Do not move this line */
+} XAVideoEnc;
+
+typedef enum CP_STATE
+{
+	CPStateNull =0,
+	CPStateInitialized,
+	CPStatePrerolling,
+	CPStateStarted,
+	CPStateRunning,
+	CPStatePaused,
+	CPStateStopped,
+	CPStateWaitForData,
+	CPStateEOS,
+	CPStateError
+}CP_STATE;
+
+typedef enum
+{
+    XA_IMAGE_JPEGENC = 0,
+    XA_IMAGE_RAW,
+    XA_NUM_OF_IMAGEENCODERS /* Do not move this line */
+} XAImageEnc;
+
+typedef enum
+{
+    XA_RADIO_IDLE,
+    XA_RADIO_SEEKING,
+    XA_RADIO_SETTING_FREQUENCY,
+    XA_RADIO_SETTING_FREQUENCY_RANGE
+} XARadioState;
+
+typedef enum
+{
+    XA_RADIO_RDS_IDLE,
+    XA_RADIO_RDS_GETTING_ODA_GROUP
+} XARadioRDSState;
+/* STRUCTURES */
+
+typedef struct XAAdaptEvtHdlr_
+{
+    xaAdaptEventHandler handlerfunc;    /* function handling the callback */
+    void               *handlercontext; /* context of handler */
+    XAuint32            eventtypes;     /* what kind of events this handles */
+} XAAdaptEvtHdlr;
+
+/* Structure for content pipe thread context */
+typedef struct XAAdaptCpThrCtx_
+{
+	XADataLocator_ContentPipe* pipe; 	/* pointer to content Pipe structure (Sink/Source) */
+	CPhandle	dataHandle; 			/* Handle to content pipe data */
+	CP_STATE	state;
+	XAConfigExtensionCpKey cpConfig; 	/* enum value for CP using e.g. ReadBuffer or WriteBuffer */
+	XAImplSemHandle stateSem;
+	XAImplSemHandle mpStateSem;
+	XAImplSemHandle mpPrerollStateSem;
+
+	GstAppSrc	*appSrc; 				/* Pointer to appSrc where data is read from. Not owned */
+	GstAppSink  *appSink; 				/* Pointer to AppSink where dats is fed. Not owned */
+}XAAdaptCpThrCtx;
+
+/* context to track buffer insufficient event */
+typedef struct recordItfCtx_{
+    XAImplSemHandle bufInsufficientSem;
+    XAboolean buffer_insufficient;
+}recodtItfCtx;
+
+/*
+ * Structure that holds all common variables for every
+ * Gst-Adaptation context structures.
+ */
+typedef struct XAAdaptationBaseCtx_
+{
+    /* Common Variables for all adaptation elements */
+    XAuint32        ctxId;
+    GstState        binWantedState;   /** requested gst-bin target state **/
+    GstElement      *bin;       /** Container for all gst elements **/
+
+    GstBus          *bus;       /** Gst-bus where gst sends messages **/
+    GMainLoop       *busloop;       /** Gst-bus listener loop **/
+    pthread_t       busloopThr;
+    GstBusCb        busCb;      /** Gst-Bus callback funtion*/
+
+    GArray*         evtHdlrs;    /* array of event handlers */
+
+    XAboolean       waitingasyncop;
+    sem_t           semAsyncWait;
+    guint           asynctimer;
+
+    XAConfigExtensionCpKey cpConfig; /* enum value for CP using e.g. ReadBuffer or WriteBuffer */
+
+	/* Content Pipe variables */
+	XAImplThreadHandle	pipeSrcThr, pipeSinkThr;
+	XAAdaptCpThrCtx		pipeSrcThrCtx, pipeSinkThrCtx;
+
+#ifdef XA_IMPL_MEASURE_GST_DELAY
+    clock_t     startTime;
+    clock_t     endTime;
+    double      diff;
+#endif /*XA_IMPL_MEASURE_GST_DELAY*/
+    // VASU MOD BEGINS
+    XAboolean thread_launched;
+    pthread_mutex_t ds_mutex;
+    pthread_cond_t ds_condition;
+    XAboolean cond_mutx_inited;
+    // VASU MOD ENDS
+    /* FUNCTIONS*/
+
+} XAAdaptationBaseCtx_;
+
+typedef struct XAEngineAdaptationCtx_
+{
+    /* Parent*/
+    XAAdaptationBaseCtx_    baseObj;
+
+} XAEngineAdaptationCtx_;
+
+typedef struct XAMetadataAdaptVars_
+{
+
+    XAuint32        childcount;
+    XAuint32        nodedepth;
+    XAuint32        traversemode;
+
+    GstTagList*     generaltags;
+    GstStructure*   audiotags;
+    GstStructure*   videotags;
+    GstStructure**   currentchild; /*points to one of previous 3*/
+
+} XAMetadataAdaptVars;
+
+
+/*
+ * Structure for Media Player specific gst-adaptation.
+ */
+typedef struct XAMediaPlayerAdaptationCtx_
+{
+    /* Parent*/
+    XAAdaptationBaseCtx_    baseObj;
+
+    /* OMX-AL Variables */
+    XADataSource            *xaSource, *xaBankSrc;
+    XADataSink              *xaAudioSink, *xaVideoSink, *xaLEDArray, *xaVibra;
+
+    /* GST elements */
+    GstElement              *source;
+    XAboolean               isobjsrc;    /*is source another XA object?*/
+    GstElement              *codecbin;
+    GstElement              *audioppbin;
+    GstElement              *videoppbin;
+    GstElement				*filter;
+    GstElement              *videoppBScrbin;
+    GstElement              *inputSelector;
+    GstPad                  *blackScrSrcPad;
+    GstPad                  *videoScrSrcPad;
+    GstPad                  *blackScrSinkPad;
+    GstPad                  *videoScrSinkPad;
+    GstElement              *audiosink;
+    XAboolean               isobjasink;   /*is audio sink another XA object?*/
+    GstElement              *videosink;
+    XAboolean               isobjvsink;   /*is video sink another XA object?*/
+
+    XAboolean               mute;
+    XAuint32                imageEffectID;
+    XAboolean               isStereoPosition;
+    XAmillidegree           curRotation;
+    XAuint32                curMirror;
+
+    XAint32                 buffering;
+
+    /* internals */
+    XAboolean               trackpositionenabled;
+    guint                   runpositiontimer;
+    GSourceFunc             positionCb;
+    gint64                  lastpos;
+
+    XAboolean               loopingenabled;
+    gint64                  loopstart;
+    gint64                  loopend;
+
+    gdouble                 playrate;
+    guint32                 rateprops;
+
+    XAboolean				cameraSinkSynced;
+
+    XAMetadataAdaptVars     *metadatavars;
+
+} XAMediaPlayerAdaptationCtx_;
+
+typedef struct XASnapshotItfVars_
+{
+
+    /*User variables*/
+    XAuint32        numpics;
+    XAuint32        fps;
+    XAboolean       freeze;
+    gchar*          fnametemplate;
+    XADataSink*     xaSink;
+
+    /* internal variables */
+    gboolean        waitforbuffer;
+    gboolean        parsenegotiated;
+    XAuint32        numpicstaken;
+
+    GstBus*         ssbus;
+    GstElement*     sspipeline;
+    GstElement*     ssbuffersrc;
+    GstElement*     ssparser;
+    GstElement*     ssscaler;
+    GstElement*     ssfilter;
+    GstElement*     ssencoder;
+    GstElement*     sstagger;
+    GstElement*     sssink;
+    gulong          sighandler;
+
+    GstBuffer*      snapshotbuffer;
+
+} XASnapshotItfVars;
+
+typedef struct XAMediaRecorderAdaptationCtx_
+{
+    /* Parent*/
+    XAAdaptationBaseCtx_ baseObj;
+
+    /* OMX-AL Variables */
+    XADataSource            *xaAudioSource, *xaVideoSource;
+    XADataSink              *xaSink;
+    XAuint8                 recModes;
+
+    /* GST elements */
+    GstElement              *datasink;
+    XAboolean               isobjsink;   /*is sink another XA object?*/
+    GstElement              *codecbin;
+    GstElement              *audioppbin;
+    GstElement              *audiofilter;
+    GstElement              *videoppbin;
+    GstElement              *videofilter;
+    GstElement              *videoextract;
+    GstElement              *audiosource;
+    GstElement              *audioqueue;
+    XAboolean               isobjasrc;    /*is audio source another XA object?*/
+    GstElement              *videosource;
+    GstState				vsrcOrigState;
+    GstElement              *videoqueue;
+    XAboolean               isobjvsrc;    /*is video source another XA object?*/
+    XAboolean               encodingchanged;
+
+    XAboolean               mute;
+    XAuint32                imageEffectID;
+    XAboolean               isStereoPosition;
+    XAuint32                xaRecordState;
+    XAmillidegree           curRotation;
+    XAuint32                curMirror;
+    XAboolean               isRecord;
+
+    /* internals */
+    XAboolean               trackpositionenabled;
+    gboolean                runpositiontimer;
+    GSourceFunc             positionCb;
+
+    XAImplThreadHandle      recordingEventThr;
+    recodtItfCtx            recThrCtx;
+
+
+    /* Variables for snapshot */
+    XASnapshotItfVars       snapshotVars;
+
+    XAMetadataAdaptVars     *metadatavars;
+
+    /* Variables for encoders */
+    XAAudioEncoderSettings  audioEncSettings;
+    XAVideoSettings         videoEncSettings;
+    XAImageSettings         imageEncSettings;
+
+    /*buffersink variable*/
+    guint64                 writepos;
+
+} XAMediaRecorderAdaptationCtx_;
+
+
+/*
+ * Structure for Camera specific gst-adaptation variables
+ */
+typedef struct XACameraAdaptationCtx_ {
+
+    /* Parent*/
+    XAAdaptationBaseCtx_ baseObj;
+
+    /* OMX-AL Variables */
+    XAuint32        deviceID;
+    XAuint32        imageEffectID;
+    XAmillidegree   curRotation;
+    XAuint32        curMirror;
+
+    /* GST Variables */
+    GstFocusStatus focusStatus;
+
+    /* Internals */
+    XAboolean		recording;
+    XAboolean		playing;
+    XAboolean		snapshotting;
+} XACameraAdaptationCtx_;
+
+/*
+ * Structure for Camera specific gst-adaptation variables
+ */
+typedef struct XARadioAdaptationCtx_ {
+
+    /* Parent*/
+    XAAdaptationBaseCtx_ baseObj;
+
+    /* OMX-AL Variables */
+    XAuint32 frequency;
+    XAuint8 range;
+
+    pthread_t emulationThread;
+    pthread_t rdsEmulationThread;
+    XARadioRDSState rdsState;
+    XARadioState state;
+
+    /* GST Variables */
+} XARadioAdaptationCtx_;
+
+
+typedef struct XAOMixAdaptConnObj_
+{
+    /*pointer to connected context*/
+    XAAdaptationBaseCtx* ctx;
+    /*pointer to sink currently used by connected ctx*/
+    GstElement* currentSink;
+} XAOMixAdaptConnObj;
+
+typedef struct XAOutputMixAdaptationCtx_
+{
+    /* Parent*/
+    XAAdaptationBaseCtx_ baseObj;
+    /* Internal variables */
+    XAboolean   isStereoPosition;
+    XAboolean	mute;
+
+    XAuint32    currentrouting;
+
+    GArray* 	availableDevices;
+    GArray*     connectedObjects;
+} XAOutputMixAdaptationCtx_;
+
+/*
+ * Structure for Ledarray specific gst-adaptation variables
+ */
+typedef struct XALEDArrayAdaptationCtx_ {
+
+    /* Parent*/
+    XAAdaptationBaseCtx_ baseObj;
+
+    /* OMX-AL Variables */
+    XAuint32    deviceID;
+
+    /* GST Variables */
+
+} XALedarrayAdaptationCtx_;
+
+/*
+ * Structure for Vibra specific gst-adaptation variables
+ */
+typedef struct XAVibraAdaptationCtx_ {
+
+    /* Parent*/
+    XAAdaptationBaseCtx_ baseObj;
+
+    /* OMX-AL Variables */
+    XAuint32    deviceID;
+
+    /* GST Variables */
+} XAVibraAdaptationCtx_;
+
+/* FUNCTIONS */
+/*
+ * gboolean XAAdaptationBase_GstBusCb( GstBus *bus, GstMessage *message, gpointer data );
+ * Default CallBack handler for gst-bus messages. This will be called if object specific callback is
+ * not implemented.
+ */
+gboolean XAAdaptationBase_GstBusCb( GstBus *bus, GstMessage *message, gpointer data );
+
+XAresult XAAdaptationBase_InitGstListener(XAAdaptationBaseCtx* ctx);
+void * XAAdaptationBase_LaunchGstListener(void* args);
+void XAAdaptationBase_StopGstListener(XAAdaptationBaseCtx* ctx);
+void XAAdaptationBase_SendAdaptEvents(XAAdaptationBaseCtx* ctx, XAAdaptEvent* event);
+
+void XAAdaptationBase_PrepareAsyncWait(XAAdaptationBaseCtx* ctx);
+void XAAdaptationBase_StartAsyncWait(XAAdaptationBaseCtx* ctx);
+gboolean XAAdaptationBase_CancelAsyncWait(gpointer ctx);
+void XAAdaptationBase_CompleteAsyncWait(XAAdaptationBaseCtx* ctx);
+
+GstElement* XAAdaptationBase_CreateGstSource( XADataSource* xaSrc, const char *name, XAboolean *isobj, XAboolean *isPCM, XAboolean *isRawImage );
+GstElement* XAAdaptationBase_CreateGstSink( XADataSink* xaSrc, const char *name, XAboolean *isobj );
+GstElement* XAAdaptationBase_CreateVideoPP( );
+
+GstElement* XAAdaptationBase_CreateVideoPPBlackScr( );
+GstElement* XAAdaptationBase_CreateInputSelector( );
+GstElement* XAAdaptationBase_CreateAudioPP( );
+void XAAdaptationBase_PadBlockCb(GstPad *pad, gboolean blocked, gpointer user_data);
+void XAAdaptationBase_SetAllCaps (GstCaps * caps, char *field, ...);
+
+XAresult XAMediaPlayerAdapt_UpdatePositionCbTimer(XAMediaPlayerAdaptationCtx_* mCtx);
+
+XAresult XAMediaRecorderAdapt_ChangeEncoders( XAMediaRecorderAdaptationCtx_* mCtx );
+XAresult XAMediaRecorderAdapt_CheckCodec( XAMediaRecorderAdaptationCtx_* mCtx, XACapsType encType, XAuint32 encoderId );
+
+XAresult XAMetadataAdapt_TryWriteTags(XAAdaptationBaseCtx* mCtx, GstBin* binToWriteTo);
+void XAMetadataAdapt_FreeVars(XAMetadataAdaptVars *vars);
+
+GstElement* XAOutputMixAdapt_GetSink(XAAdaptationBaseCtx* bCtx);
+
+
+XAresult XAOutputMixAdapt_ConnectObject(XAAdaptationBaseCtx* omCtx, XAAdaptationBaseCtx* bCtx, GstElement* usedMix);
+XAresult XAOutputMixAdapt_DisconnectObject(XAAdaptationBaseCtx* omCtx, XAAdaptationBaseCtx* bCtx);
+void* XAAdaptationBase_ContentPipeScrThrFunc( void* arg);
+void* XAAdaptationBase_ContentPipeSinkThrFunc( void* arg);
+CPresult XAAdaptationBase_ContentPipeSrcCb(CP_EVENTTYPE eEvent, CPuint iParam);
+CPresult XAAdaptationBase_ContentPipeSinkCb(CP_EVENTTYPE eEvent, CPuint iParam);
+
+#endif /* XAADAPTATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaadaptationcontextbase.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,1924 @@
+/*
+* 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 <assert.h>
+#include <string.h>
+#include "gst/gst.h"
+#include "gst/gstbuffer.h"
+#include "gst/app/gstappsrc.h"
+#include "XAAdaptationContextBase.h"
+#include "XAAdaptation.h"
+#include "XAObjectItf.h"
+#include "XACameraDevice.h"
+#include "XARadioDevice.h"
+#include "XAOutputMix.h"
+#include "XAStaticCapsAdaptation.h"
+#include "XAMediaPlayerAdaptCtx.h"
+
+extern XAboolean cameraRealized;
+extern XACameraAdaptationCtx_* cameraCtx;
+/*
+ * XAAdaptationBaseCtx* XAAdaptationBase_Create()
+ * 1st phase initialization function for Adaptation Base context structure.
+ * Reserves memory for base context and initializes GStreamer FW.
+ */
+XAresult XAAdaptationBase_Init( XAAdaptationBaseCtx* pSelf, XAuint32 ctxId )
+{
+    DEBUG_API("->XAAdaptationBase_Init");
+
+    if ( pSelf )
+    {
+        GError* gerror = 0;
+		pSelf->pipeSrcThr = NULL;
+		pSelf->pipeSinkThr = NULL;
+
+        /* Set context id */
+        pSelf->ctxId = ctxId;
+        /* Add default handler for Gst-bus messages */
+        pSelf->busCb = XAAdaptationBase_GstBusCb;
+
+        // VASU MOD BEGINS
+        pSelf->cond_mutx_inited = XA_BOOLEAN_FALSE;
+        // VASU MOD ENDS
+
+        pSelf->evtHdlrs = g_array_new (FALSE, FALSE, sizeof (XAAdaptEvtHdlr));
+
+        sem_init(&(pSelf->semAsyncWait),0,0);
+
+
+        if ( !gst_init_check( NULL, NULL, &gerror ) )
+        {
+            DEBUG_ERR("Gst Initalization failure.");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Invalid Adaptation Base Context.")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_API("<-XAAdaptationBase_Init");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAAdaptationBase_PostInit()
+ * 2nd phase initialization for Adaptation Base.
+ */
+XAresult XAAdaptationBase_PostInit( XAAdaptationBaseCtx* ctx )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAdaptationBase_PostInit");
+    // VASU MOD BEGINS
+    ctx->thread_launched = XA_BOOLEAN_FALSE;
+    pthread_mutex_init(&(ctx->ds_mutex), NULL);
+    pthread_cond_init(&(ctx->ds_condition), NULL);
+    ctx->cond_mutx_inited = XA_BOOLEAN_TRUE;
+    // VASU MOD ENDS
+    DEBUG_API("<-XAAdaptationBase_PostInit");
+    return ret;
+}
+
+/*
+ * void XAAdaptationBase_Free( XAAdaptationBaseCtx* ctx )
+ * Frees all Base context variables .
+ */
+void XAAdaptationBase_Free( XAAdaptationBaseCtx* ctx )
+{
+	GstElement* fakesink = NULL;
+    DEBUG_API("->XAAdaptationBase_Free");
+
+    if ( ctx->bin )
+    {
+    	fakesink = gst_bin_get_by_name(GST_BIN(ctx->bin), "fakesink");
+		if ( fakesink )
+		{
+			gst_element_set_state( GST_ELEMENT(fakesink), GST_STATE_NULL);
+			gst_object_unref(fakesink);
+		}
+
+        if ( gst_element_set_state(GST_ELEMENT(ctx->bin), GST_STATE_NULL )!=GST_STATE_CHANGE_SUCCESS )
+        {   /*not much we can do*/
+            DEBUG_ERR("WARNING: Failed to change to NULL state before deletion!!")
+        }
+    }
+
+    if(ctx->asynctimer)
+    {   /*cancel timer*/
+        g_source_remove(ctx->asynctimer);
+    }
+    sem_post(&(ctx->semAsyncWait));
+    sem_destroy(&(ctx->semAsyncWait));
+
+    XAAdaptationBase_StopGstListener(ctx);
+
+    if ( ctx->bin )
+    {
+        gst_object_unref(ctx->bin);
+    }
+
+    g_array_free(ctx->evtHdlrs, TRUE);
+    // VASU MOD BEGINS
+    if (ctx->cond_mutx_inited == XA_BOOLEAN_TRUE)
+        {
+        ctx->thread_launched = XA_BOOLEAN_FALSE;
+        pthread_mutex_destroy(&(ctx->ds_mutex));
+        pthread_cond_destroy(&(ctx->ds_condition));
+        ctx->cond_mutx_inited = XA_BOOLEAN_FALSE;
+        }
+    // VASU MOD ENDS
+
+    DEBUG_API("<-XAAdaptationBase_Free");
+}
+
+/*
+ * XAresult XAAdaptationBase_AddEventHandler
+ * Adds event handler for certain event types.
+ */
+XAresult XAAdaptationBase_AddEventHandler( XAAdaptationBaseCtx* ctx, xaAdaptEventHandler evtHandler,
+                                    XAuint32 evtTypes, void *pHandlerCtx )
+{
+    XAuint32 i;
+    XAAdaptEvtHdlr tmp;
+    DEBUG_API("->XAAdaptationBase_AddEventHandler");
+    if(!ctx)
+    {
+        DEBUG_ERR("no context");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    for(i=0; i<ctx->evtHdlrs->len; i++)
+    {
+        if( (g_array_index(ctx->evtHdlrs, XAAdaptEvtHdlr, i)).handlerfunc == evtHandler )
+        {
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+    }
+    tmp.handlerfunc = evtHandler;
+    tmp.handlercontext = pHandlerCtx;
+    tmp.eventtypes = evtTypes;
+    g_array_append_val(ctx->evtHdlrs, tmp);
+    DEBUG_API("<-XAAdaptationBase_AddEventHandler");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAAdaptationBase_RemoveEventHandler
+ * Removes event handler for certain event types.
+ */
+XAresult XAAdaptationBase_RemoveEventHandler( XAAdaptationBaseCtx* ctx, xaAdaptEventHandler evtHandler)
+{
+    XAuint32 i;
+    DEBUG_API("->XAAdaptationBase_RemoveEventHandler");
+    if(!ctx)
+    {
+        DEBUG_ERR("no context");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    for(i=0; i<ctx->evtHdlrs->len; i++)
+    {
+        if( (g_array_index(ctx->evtHdlrs, XAAdaptEvtHdlr, i)).handlerfunc == evtHandler )
+        {
+            g_array_remove_index(ctx->evtHdlrs, i);
+            return XA_RESULT_SUCCESS;
+        }
+    }
+    DEBUG_API("<-XAAdaptationBase_RemoveEventHandler");
+    /*did not find, return error*/
+    return XA_RESULT_PARAMETER_INVALID;
+}
+
+/*
+ * gboolean XAAdaptationBase_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+ * Default Gst-bus message handler (Callback)
+ */
+gboolean XAAdaptationBase_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+{
+    GError *error;
+    gchar *debug;
+    DEBUG_API("->XAAdaptationBase_GstBusCb");
+    DEBUG_INFO_A2("Received Gst callback \"%s\" from \"%s\"",
+                    GST_MESSAGE_TYPE_NAME(message),
+                    GST_OBJECT_NAME(GST_MESSAGE_SRC(message)));
+
+    switch( GST_MESSAGE_TYPE(message))
+    {
+        case GST_MESSAGE_ERROR:
+            gst_message_parse_error( message, &error, &debug );
+            DEBUG_INFO_A1("%s", debug);
+            break;
+        case GST_MESSAGE_EOS:
+            break;
+        case GST_MESSAGE_UNKNOWN:
+            break;
+        case GST_MESSAGE_WARNING:
+            break;
+        case GST_MESSAGE_INFO:
+            break;
+        case GST_MESSAGE_TAG:
+            break;
+        case GST_MESSAGE_BUFFERING:
+            break;
+        case GST_MESSAGE_STATE_CHANGED:
+            break;
+        case GST_MESSAGE_STATE_DIRTY:
+            break;
+        case GST_MESSAGE_STEP_DONE:
+            break;
+        case GST_MESSAGE_CLOCK_PROVIDE:
+            break;
+        case GST_MESSAGE_CLOCK_LOST:
+            break;
+        case GST_MESSAGE_NEW_CLOCK:
+            break;
+        case GST_MESSAGE_STRUCTURE_CHANGE:
+            break;
+        case GST_MESSAGE_STREAM_STATUS:
+            break;
+        case GST_MESSAGE_APPLICATION:
+            break;
+        case GST_MESSAGE_ELEMENT:
+            break;
+        case GST_MESSAGE_SEGMENT_START:
+            break;
+        case GST_MESSAGE_SEGMENT_DONE:
+            break;
+        case GST_MESSAGE_DURATION:
+            break;
+        case GST_MESSAGE_LATENCY:
+            break;
+        case GST_MESSAGE_ASYNC_START:
+            break;
+        case GST_MESSAGE_ASYNC_DONE:
+            break;
+        case GST_MESSAGE_ANY:
+            break;
+        default:
+            DEBUG_INFO("Unhandled Gst-Bus message");
+            break;
+    }
+    DEBUG_API("<-XAAdaptationBase_GstBusCb");
+    return TRUE;
+}
+
+XAresult XAAdaptationBase_InitGstListener(XAAdaptationBaseCtx* ctx)
+{
+    int ret;
+    DEBUG_API("->XAAdaptationBase_InitGstListener");
+    if ( ctx->bin )
+    {
+        ctx->bus = gst_pipeline_get_bus( GST_PIPELINE( ctx->bin ));
+    }
+    if( !ctx->bus )
+    {
+        DEBUG_ERR("could not get gst bus!")
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    ret = pthread_create(&(ctx->busloopThr), NULL, (XAAdaptationBase_LaunchGstListener),(void*)ctx);
+    // VASU MOD BEGINS
+    if ( ctx->thread_launched == XA_BOOLEAN_FALSE )
+    {
+        // Wait until the thread is created
+        pthread_mutex_lock(&(ctx->ds_mutex));
+        pthread_cond_wait(&(ctx->ds_condition), &(ctx->ds_mutex));
+        pthread_mutex_unlock(&(ctx->ds_mutex));
+        // VASU MOD ENDS
+    }
+    if(ret)
+    {
+        DEBUG_ERR_A1("could not create thread!! (%d)",ret)
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    DEBUG_API("<-XAAdaptationBase_InitGstListener");
+    return XA_RESULT_SUCCESS;
+}
+
+void * XAAdaptationBase_LaunchGstListener(void* args)
+{
+    XAAdaptationBaseCtx* ctx = (XAAdaptationBaseCtx*)args;
+    DEBUG_API("->XAAdaptationBase_LaunchGstListener");
+    // VASU MOD BEGINS
+    // Signal calling thread that this thread creation is completed
+    ctx->thread_launched = XA_BOOLEAN_TRUE;
+    pthread_mutex_lock(&(ctx->ds_mutex));
+    pthread_cond_signal(&(ctx->ds_condition));
+    pthread_mutex_unlock(&(ctx->ds_mutex));
+    // VASU MOD ENDS
+
+    ctx->busloop = g_main_loop_new( NULL, FALSE );
+    if ( !ctx->busloop )
+    {
+        DEBUG_ERR("Glib main loop failure.")
+        DEBUG_API("<-XAAdaptationBase_LaunchGstListener");
+        assert(0);
+    }
+    else
+    {
+        DEBUG_INFO("Start Glib main loop")
+        g_main_loop_run(ctx->busloop);
+        DEBUG_INFO("Glib main loop stopped - exiting thread")
+        DEBUG_API("<-XAAdaptationBase_LaunchGstListener");
+        pthread_exit(NULL);
+    }
+   
+}
+
+void XAAdaptationBase_StopGstListener(XAAdaptationBaseCtx* ctx)
+{
+    DEBUG_API("->XAAdaptationBase_StopGstListener");
+    if(ctx->busloop)
+    {
+        g_main_loop_quit (ctx->busloop);
+        g_main_loop_unref(ctx->busloop);
+    }
+    if(ctx->bus)
+    {
+        gst_object_unref(ctx->bus);
+        ctx->bus = NULL;
+    }
+    DEBUG_API("<-XAAdaptationBase_StopGstListener");
+}
+
+void XAAdaptationBase_SendAdaptEvents(XAAdaptationBaseCtx* ctx, XAAdaptEvent* event)
+{
+    XAuint32 i;
+    XAAdaptEvtHdlr* tmp;
+    for(i=0; i<ctx->evtHdlrs->len; i++)
+    {
+        tmp = &g_array_index(ctx->evtHdlrs, XAAdaptEvtHdlr, i);
+        if( tmp->eventtypes & event->eventtype )
+        {
+            (tmp->handlerfunc)(tmp->handlercontext, event);
+        }
+    }
+}
+
+/*
+ * ASynchronous operation managing
+ **/
+
+/* NOTE: This should NOT be called from gst callbacks - danger of deadlock!!
+ */
+void XAAdaptationBase_PrepareAsyncWait(XAAdaptationBaseCtx* ctx)
+{
+    DEBUG_API("->XAAdaptationBase_PrepareAsyncWait");
+
+    if( ctx->waitingasyncop )
+    {   /*wait previous async op*/
+        DEBUG_INFO("::WARNING:: previous asynch still ongoing!!!");
+        DEBUG_INFO(">>>>  WAIT PREVIOUS");
+        sem_wait(&(ctx->semAsyncWait));
+        DEBUG_INFO("<<<<  PREVIOUS COMPLETED");
+    }
+    sem_init(&(ctx->semAsyncWait),0,0);
+
+    ctx->waitingasyncop = XA_BOOLEAN_TRUE;
+    DEBUG_API("<-XAAdaptationBase_PrepareAsyncWait");
+}
+
+void XAAdaptationBase_StartAsyncWait(XAAdaptationBaseCtx* ctx)
+{
+    DEBUG_API("->XAAdaptationBase_StartAsyncWait");
+
+    /* timeout to try to avoid gst freeze in rollup */
+    ctx->asynctimer = g_timeout_add(XA_ADAPT_ASYNC_TIMEOUT,
+                                    XAAdaptationBase_CancelAsyncWait, ctx);
+    /* check flag once again if callback already happened before wait */
+    if(ctx->waitingasyncop)
+    {
+        DEBUG_INFO(">>>>  ASYNC STARTS");
+        sem_wait(&(ctx->semAsyncWait));
+        DEBUG_INFO("<<<<  ASYNC COMPLETED");
+    }
+    else
+    {
+        DEBUG_INFO("<> async completed already");
+    }
+    /*cancel timer*/
+    if(ctx->asynctimer)
+    {
+        g_source_remove(ctx->asynctimer);
+    }
+    ctx->waitingasyncop = XA_BOOLEAN_FALSE;
+
+    DEBUG_API("<-XAAdaptationBase_StartAsyncWait");
+}
+
+/* async operation timeout callback*/
+gboolean XAAdaptationBase_CancelAsyncWait(gpointer ctx)
+{
+    XAAdaptationBaseCtx* bCtx = (XAAdaptationBaseCtx*)ctx;
+    DEBUG_API("->XAAdaptationBase_CancelAsyncWait");
+    if( bCtx->waitingasyncop )
+    {
+        DEBUG_ERR_A3("ASYNC TIMED OUT : current %d, gsttarget %d, wanted %d",
+                      GST_STATE(bCtx->bin), GST_STATE_TARGET(bCtx->bin), bCtx->binWantedState);
+        bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
+        sem_post(&(bCtx->semAsyncWait));
+    }
+    DEBUG_API("<-XAAdaptationBase_CancelAsyncWait");
+    /* return false to remove timer */
+    return FALSE;
+}
+
+void XAAdaptationBase_CompleteAsyncWait(XAAdaptationBaseCtx* ctx)
+{
+    DEBUG_API("->XAAdaptationBase_CompleteAsyncWait");
+    if( ctx->waitingasyncop )
+    {
+        int i;
+        ctx->waitingasyncop = XA_BOOLEAN_FALSE;
+        sem_getvalue(&(ctx->semAsyncWait),&i);
+        DEBUG_INFO_A1("Asynch operation succeeded, sem value %d",i);
+        if(i<=0)
+        {   /* only post if locked */
+            sem_post(&(ctx->semAsyncWait));
+        }
+        else if(i>0)
+        {   /* should not be, reset semaphore */
+            sem_init(&(ctx->semAsyncWait),0,0);
+        }
+    }
+    DEBUG_API("<-XAAdaptationBase_CompleteAsyncWait");
+}
+
+XAresult XAAdaptationBase_SetCPConfiguration(XAAdaptationBaseCtx* ctx, XAConfigExtensionCpKey configValue)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("-> XAAdaptationBase_SetConfiguration");
+    if( ctx )
+    {
+		if ( configValue == XA_READ )
+		{
+			ctx->pipeSrcThrCtx.cpConfig = configValue;
+			res = XA_RESULT_SUCCESS;
+		}
+		else if ( configValue == XA_READBUFFER )
+		{
+		    ctx->pipeSrcThrCtx.cpConfig = configValue;
+			res = XA_RESULT_SUCCESS;
+		}
+		else if ( configValue == XA_WRITE )
+        {
+            ctx->pipeSinkThrCtx.cpConfig = configValue;
+            res = XA_RESULT_SUCCESS;
+        }
+		else if ( configValue == XA_WRITEBUFFER )
+        {
+            ctx->pipeSinkThrCtx.cpConfig = configValue;
+            res = XA_RESULT_SUCCESS;
+        }
+    }
+    else
+    {
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API("-> XAAdaptationBase_SetConfiguration");
+    return res;
+}
+
+/**
+ * GstElement* XAAdaptationBase_CreateGstSource( XADataSource* xaSrc, const XAchar *name )
+ * @param XADataSource* xaSnk - XADataSource defining gst source to create
+ * @param const XAchar *name - string for naming the gst element
+ * @param XAboolean *isobj - (out param) is source another XA object?
+ * @return GstElement* - return newly created gst source element
+ * Description: Create gst source element corresponding to XA source structure
+ */
+GstElement* XAAdaptationBase_CreateGstSource( XADataSource* xaSrc, const char *name, XAboolean *isobj, XAboolean *isPCM, XAboolean *isRawImage  )
+{
+    XAuint32 locType = 0;
+    GstElement* gstSrc = NULL;
+    char* fname=NULL;
+    XADataLocator_URI* uri = NULL;
+    XADataLocator_IODevice* ioDevice = NULL;
+    XACameraDeviceImpl* cameraDevice = NULL;
+    XARadioDeviceImpl* radioDevice = NULL;
+    XAObjectItfImpl* pObj = NULL;
+
+    DEBUG_API("->XAAdaptationBase_CreateGstSource");
+    if( !xaSrc || !xaSrc->pLocator || !isobj )
+    {
+        return NULL;
+    }
+    *isobj = XA_BOOLEAN_FALSE;
+    if( xaSrc && xaSrc->pFormat && *((XAuint32*)(xaSrc->pFormat))==XA_DATAFORMAT_PCM && isPCM )
+    {
+        *isPCM = XA_BOOLEAN_TRUE;
+    }
+    if( xaSrc && xaSrc->pFormat && *((XAuint32*)(xaSrc->pFormat))==XA_DATAFORMAT_RAWIMAGE && isRawImage )
+    {
+        *isRawImage = XA_BOOLEAN_TRUE;
+    }
+    locType = *((XAuint32*)(xaSrc->pLocator));
+    switch ( locType )
+    {
+        case XA_DATALOCATOR_URI:
+            DEBUG_INFO("XA_DATALOCATOR_URI");
+            uri = (XADataLocator_URI*)xaSrc->pLocator;
+            gstSrc = gst_element_factory_make("filesrc",name);
+            if ( uri->URI != NULL )
+            {
+                DEBUG_INFO_A1("URI: %s", uri->URI);
+                if(strncmp((char *)uri->URI, "file://", 7) == 0)
+                    {
+                    fname = (char *)&((uri->URI)[7]);
+                    }
+                else
+                    {
+                    fname = (char *)uri->URI;
+                    }
+                DEBUG_INFO_A1("->filesystem path %s", fname);
+                g_object_set( G_OBJECT(gstSrc), "location", fname, NULL );
+                /*check for pcm - decodebin does not know how to handle raw PCM files */
+                if( isPCM && strstr(fname, ".pcm") )
+                {
+                    DEBUG_INFO("PCM file detected");
+                    *isPCM=XA_BOOLEAN_TRUE;
+                }
+            }
+            else
+            {
+                DEBUG_ERR("No uri specified.");
+                return NULL;
+            }
+            break; /* XA_DATALOCATOR_URI */
+
+
+        case XA_DATALOCATOR_IODEVICE:
+            DEBUG_INFO("XA_DATALOCATOR_IODEVICE");
+            ioDevice = (XADataLocator_IODevice*)(xaSrc->pLocator);
+            switch ( ioDevice->deviceType )
+            {
+                case XA_IODEVICE_AUDIOINPUT:
+                {
+                    DEBUG_INFO("XA_IODEVICE_AUDIOINPUT");
+                    DEBUG_INFO_A1("ioDevice->deviceID: %x", ioDevice->deviceID);
+                    switch (ioDevice->deviceID )
+                    {
+                    //case XA_ADAPTID_ALSASRC: //Krishna
+                    case XA_ADAPTID_DEVSOUNDSRC:
+                        //DEBUG_INFO("alsasrc"); //Krishna
+                        DEBUG_INFO("devsoundsrc");
+                        gstSrc = gst_element_factory_make("devsoundsrc",name); //Krishna - changed to devsoundsrc
+                        g_object_set (G_OBJECT (gstSrc), "num-buffers", 80, NULL);
+                        break;
+                    case XA_ADAPTID_AUDIOTESTSRC:
+                        /*fall through*/
+                    default:
+                        DEBUG_INFO("audiotestsrc");
+                        gstSrc = gst_element_factory_make("audiotestsrc",name);
+                        break;
+                    }
+                    break;
+                }
+                case XA_IODEVICE_CAMERA:
+                {
+                    DEBUG_INFO("XA_IODEVICE_CAMERA");
+                    if ( ioDevice->device )
+                    {   /*source is camera object*/
+                        DEBUG_INFO("Use camerabin as source.");
+                        /* Get camerabin from source object */
+                        pObj = (XAObjectItfImpl*)(*ioDevice->device);
+                        cameraDevice = (XACameraDeviceImpl*)(pObj);
+                        gstSrc = GST_ELEMENT(cameraDevice->adaptationCtx->bin);
+                        /* refcount increase is needed to keep this not being deleted after use */
+                        gst_object_ref(GST_OBJECT(gstSrc));
+                        *isobj = XA_BOOLEAN_TRUE;
+                    }
+                    else
+                    {
+                        DEBUG_INFO_A1("ioDevice->deviceID: %x", ioDevice->deviceID);
+                        switch (ioDevice->deviceID )
+                        {
+                        case XA_ADAPTID_V4L2SRC:
+                            DEBUG_INFO("Camera deviceID: v4l2src ");
+ 
+                            break;
+                        case XA_ADAPTID_VIDEOTESTSRC:
+                            DEBUG_INFO("Camera deviceID: videotestsrc");
+ 
+                            break;
+                        default:
+                        case XA_DEFAULTDEVICEID_CAMERA:
+                            DEBUG_INFO("Camera deviceID:Default");
+                           
+                            break;
+                        }
+                        if ( cameraCtx )
+						{
+							gstSrc = GST_ELEMENT(cameraCtx->baseObj.bin);
+							gst_object_ref(GST_OBJECT(gstSrc));
+							*isobj = XA_BOOLEAN_TRUE;
+						}
+						else
+						{
+							DEBUG_ERR("No camera object created!");
+							return NULL;
+						}
+                    }
+                    break;
+                }
+                case XA_IODEVICE_RADIO:
+                    DEBUG_INFO("XA_IODEVICE_RADIO");
+                    if ( ioDevice->device )
+                    {
+                        DEBUG_INFO("Use radio pipeline as source.");
+                        /* Get radio_pipeline and set it to base context */
+                        radioDevice = (XARadioDeviceImpl*)(*ioDevice->device);
+                        /* radio does not have actual bin, only source element*/
+                        gstSrc = GST_ELEMENT(radioDevice->adaptationCtx->bin);
+                        /* refcount increase is needed to keep this not being deleted after use */
+                        gst_object_ref(GST_OBJECT(gstSrc));
+                        /**isobj = XA_BOOLEAN_TRUE;*/
+                    }
+                    break;
+                default:
+                {
+                    DEBUG_ERR("Unsupported IODevice.");
+                    return NULL;
+                    break;
+                }
+            }
+            break; /* XA_DATALOCATOR_IODEVICE */
+
+        case XA_DATALOCATOR_CONTENTPIPE:
+        {
+        	DEBUG_INFO("XA_DATALOCATOR_CONTENTPIPE");
+        	gstSrc = gst_element_factory_make("appsrc",name);
+            break;
+        }
+        case XA_DATALOCATOR_ADDRESS:
+            {
+                XADataLocator_Address* address = (XADataLocator_Address*)(xaSrc->pLocator);
+                gstSrc = gst_element_factory_make("appsrc", name);
+                /* init gst buffer from datalocator */
+                if( gstSrc )
+                {
+                    /* init GST buffer from XADataLocator*/
+                    GstBuffer* userBuf = gst_buffer_new();
+                    if( userBuf )
+                    {
+                        userBuf->size = address->length;
+                        userBuf->data = address->pAddress;
+                        /* push the whole buffer to appsrc so it is ready for preroll */
+                        DEBUG_INFO("Pushing buffer");
+                        gst_app_src_push_buffer( GST_APP_SRC(gstSrc), userBuf );
+                        DEBUG_INFO_A1("Sent buffer at 0x%x to appsrc", userBuf );
+                        gst_app_src_end_of_stream( GST_APP_SRC(gstSrc) );
+                    }
+                    else
+                    {
+                        DEBUG_ERR("Failure allocating buffer!");
+                    }
+                }
+                else
+                {
+                    DEBUG_ERR("Failure creating appsrc!");
+                }
+            }
+            break;
+
+        default:
+            DEBUG_ERR("Incorrect data locator for source.")
+            return NULL;
+            break;
+    }
+
+    if ( gstSrc )
+    {
+        DEBUG_INFO_A1("Created gstreamer source element at %x", gstSrc);
+    }
+
+    DEBUG_API("<-XAAdaptationBase_CreateGstSource");
+    return gstSrc;
+}
+
+
+/**
+ * GstElement* XAAdaptationBase_CreateGstSink( XADataSink* xaSnk, const XAchar *name )
+ * @param XADataSink* xaSnk - XADataSink defining gst sink to create
+ * @param const XAchar *name - string for naming the gst element
+ * @return GstElement* - return newly created gst sink element
+ * Description: Create gst sink element corresponding to XA sink structure
+ */
+GstElement* XAAdaptationBase_CreateGstSink( XADataSink* xaSnk, const char *name, XAboolean *isobj )
+{
+    XAuint32 locType = 0;
+    GstElement* gstSnk = NULL;
+    XADataLocator_URI* uri = NULL;
+    DEBUG_API("->XAAdaptationBase_CreateGstSink");
+    if(!xaSnk || !xaSnk->pLocator)
+    {
+        DEBUG_INFO("Warning! No sink specified, use fakesink");
+        gstSnk = gst_element_factory_make("fakesink",name);
+        if(!gstSnk)
+        {
+            DEBUG_ERR("Cannot create sink!");
+            return NULL;
+        }
+        g_object_set( G_OBJECT(gstSnk),"async", FALSE, NULL);
+    }
+    else
+    {
+        locType = *((XAuint32*)(xaSnk->pLocator));
+        switch ( locType )
+        {
+            case XA_DATALOCATOR_URI:
+                DEBUG_INFO("XA_DATALOCATOR_URI");
+                uri = (XADataLocator_URI*)xaSnk->pLocator;
+                gstSnk = gst_element_factory_make("filesink",name);
+                if(!gstSnk)
+                {
+                    DEBUG_ERR("Cannot create sink!");
+                    return NULL;
+                }
+                if ( uri->URI != NULL )
+                {
+                    XAchar *fname;
+                    DEBUG_INFO_A1("URI: %s", uri->URI);
+                    if(strncmp((char *)uri->URI, "file://", 7) == 0)
+                    {
+                        fname = &((uri->URI)[7]);
+                    }
+                    else
+                    {
+                        fname = uri->URI;
+                    }
+                    DEBUG_INFO_A1("->filesystem path %s", fname);
+                    g_object_set( G_OBJECT(gstSnk),"location", fname,
+                                                   "async", FALSE,
+                                                   "qos", FALSE,
+                                                   "max-lateness", (gint64)(-1),
+                                                   NULL);
+                }
+                else
+                {
+                    DEBUG_ERR("No recording output uri specified.");
+                    return NULL;
+                }
+                break;
+            case XA_DATALOCATOR_NATIVEDISPLAY:
+                DEBUG_INFO("Sink locator type - XA_DATALOCATOR_NATIVEDISPLAY");
+#ifdef USE_NGA_SURFACES
+                gstSnk = gst_element_factory_make("devvideosink","devvideosink");
+#else
+                gstSnk = gst_element_factory_make("ximagesink",name);
+#endif /*USE_NGA_SURFACES*/
+                if(!gstSnk)
+                {
+                    DEBUG_ERR("Cannot create sink!");
+                    return NULL;
+                }
+                g_object_set( G_OBJECT(gstSnk), "force-aspect-ratio", TRUE,
+												"async", FALSE,
+                                               "qos", FALSE,
+												"handle-events", TRUE,
+												"handle-expose", TRUE,
+                                               "max-lateness", (gint64)(-1),
+                                               NULL);
+                break;
+            case XA_DATALOCATOR_OUTPUTMIX:
+                DEBUG_INFO("Sink locator type - XA_DATALOCATOR_OUTPUTMIX");
+                {
+                    /* Get OutputMix adaptation from data locator */
+                    XADataLocator_OutputMix* omix = (XADataLocator_OutputMix*)(xaSnk->pLocator);
+                    if ( omix->outputMix )
+                    {
+                        XAOMixImpl* omixDevice = (XAOMixImpl*)(*omix->outputMix);
+
+                        if(omixDevice)
+                        {
+                            gstSnk = XAOutputMixAdapt_GetSink(omixDevice->adaptationCtx);
+                            if(!gstSnk)
+                            {
+                                DEBUG_ERR("Cannot create sink!");
+                                return NULL;
+                            }
+                            *isobj = XA_BOOLEAN_TRUE;
+                        }
+                        else
+                        {
+                            DEBUG_ERR("Warning - NULL outputmix object - default audio output used");
+                            gstSnk = gst_element_factory_make("alsasink",name);
+                        }
+                    }
+                    else
+                    {
+                        DEBUG_ERR("Warning - NULL outputmix object - default audio output used");
+                        gstSnk = gst_element_factory_make("alsasink",name);
+                    }
+
+                }
+                break;
+		 	case XA_DATALOCATOR_CONTENTPIPE:
+				DEBUG_INFO("XA_DATALOCATOR_CONTENTPIPE");
+				gstSnk = gst_element_factory_make("appsink",name);
+				break;
+            case XA_DATALOCATOR_ADDRESS:
+                {
+                    gstSnk = gst_element_factory_make("appsink", name);
+                    /* Not actually object sink, but attribute used to notify recorder
+                     * about appsink (no object sinks applicable in this use case)
+                     **/
+                    *isobj=TRUE;
+                }
+                break;
+            case XA_DATALOCATOR_IODEVICE:
+                /* when only valid IOdevice sinks vibra and LED sinks implemented
+                 * at adaptation level, add handling here (in this implementation,
+                 * no handling needed as only dummy implementations for those)
+                 **/
+            default:
+                DEBUG_ERR("Incorrect data locator for sink.")
+                return NULL;
+                break;
+        }
+    }
+    if (gstSnk )
+    {
+        DEBUG_INFO_A1("Created gstreamer sink element at %x", gstSnk);
+    }
+    DEBUG_API("<-XAAdaptationBase_CreateGstSink");
+    return gstSnk;
+}
+
+/**
+ * GstElement* XAAdaptationBase_CreateVideoPP( )
+ * @return GstElement* - return newly created gst pipeline element
+ * Description: Create video processing pipeline
+ */
+GstElement* XAAdaptationBase_CreateVideoPP( )
+{
+    GstElement *vpp;
+    DEBUG_API("->XAAdaptationBase_CreateVideoPP");
+    vpp = gst_pipeline_new("videopp");
+    if( vpp )
+    {
+        GstPad *ghostsink, *ghostsrc;
+        GstElement 	*col1,
+					*col2,
+					*rotate,
+					*mirror,
+					*box,
+					*crop,
+					*gamma,
+					*balance,
+					*scale,
+					*scale2,
+#ifdef USE_NGA_SURFACES
+					*identity,
+#endif /*USE_NGA_SURFACES*/
+					*queue;
+
+
+        /* Crete ffmpegcolorspace to convert stream to correct format */
+        col1 = gst_element_factory_make( "ffmpegcolorspace", "pp_colsp1");
+        if(col1)
+        {
+            DEBUG_INFO("Created ffmpegcolorspace element");
+            gst_bin_add(GST_BIN(vpp), col1);
+           /* make this bin link point*/
+            ghostsink = gst_element_get_static_pad(col1,"sink");
+            if(ghostsink)
+            {
+                gst_element_add_pad(vpp, gst_ghost_pad_new("videopp_sink",ghostsink));
+                gst_object_unref(GST_OBJECT(ghostsink));
+            }
+        }
+
+        /* create video crop, this will be sink for videoPP pipeline */
+        crop = gst_element_factory_make( "videocrop", "pp_crop");
+        if(crop)
+        {
+            DEBUG_INFO("Created crop element");
+            gst_bin_add(GST_BIN(vpp), crop);
+        }
+
+        /* create video rotate */
+        rotate = gst_element_factory_make( "videoflip", "pp_rotate");
+        if(rotate)
+        {
+            DEBUG_INFO("Created rotate element");
+            g_object_set(G_OBJECT(rotate), "method", FLIP_NONE, NULL);
+            gst_bin_add(GST_BIN(vpp), rotate);
+        }
+
+        /* create video mirror */
+        mirror = gst_element_factory_make( "videoflip", "pp_mirror");
+        if(mirror)
+        {
+            DEBUG_INFO("Created mirror element");
+            g_object_set(G_OBJECT(mirror), "method", FLIP_NONE, NULL);
+            gst_bin_add(GST_BIN(vpp), mirror);
+        }
+
+        /* create video box */
+        box = gst_element_factory_make( "videobox", "pp_box");
+        if(box)
+        {
+            DEBUG_INFO("Created videobox element");
+            gst_bin_add(GST_BIN(vpp), box);
+        }
+
+        /* create video balance */
+        balance = gst_element_factory_make( "videobalance", "pp_balance");
+        if(balance)
+        {
+            DEBUG_INFO("Created balance element");
+            gst_bin_add(GST_BIN(vpp), balance);
+        }
+
+        /* create video gamma */
+        gamma = gst_element_factory_make( "gamma", "pp_gamma");
+        if(gamma)
+        {
+            DEBUG_INFO("Created gamma element");
+            gst_bin_add(GST_BIN(vpp), gamma);
+        }
+
+        /* Create videoscale element to scale postprocessed output to correct size */
+        scale = gst_element_factory_make("videoscale", "pp_scale");
+        if ( scale )
+        {
+            DEBUG_INFO("Created videoscale element");
+            gst_bin_add(GST_BIN(vpp), scale);
+        }
+        scale2 = gst_element_factory_make("videoscale", "pp_scale2");
+		if ( scale2 )
+		{
+			GstPad *pad = NULL;
+			GstCaps *caps = NULL;
+			DEBUG_INFO("Created videoscale element");
+			pad = gst_element_get_static_pad(scale2,"src");
+			caps = gst_caps_new_simple("video/x-raw-yuv",
+					 "width", G_TYPE_INT,0,
+					 "height", G_TYPE_INT,0,
+					 NULL);
+			gst_pad_set_caps(pad, caps);
+			gst_bin_add(GST_BIN(vpp), scale2);
+		}
+
+        /* create video queue */
+        queue = gst_element_factory_make( "queue", "vpp_queue");
+        if(queue)
+        {
+            DEBUG_INFO("Created queue element");
+            gst_bin_add(GST_BIN(vpp), queue);
+#ifdef USE_NGA_SURFACES
+            /* make this bin link point*/
+            ghostsink = gst_element_get_static_pad(queue,"sink");
+            if(ghostsink)
+            {
+                gst_element_add_pad(vpp, gst_ghost_pad_new("videopp_src",ghostsink));
+                gst_object_unref(GST_OBJECT(ghostsink));
+            }            
+#endif /*USE_NGA_SURFACES*/
+        }
+
+
+        /* Crete ffmpegcolorspace to convert stream to correct format */
+        col2 = gst_element_factory_make( "ffmpegcolorspace", "pp_colsp2");
+        if(col2)
+        {
+            DEBUG_INFO("Created ffmpegcolorspace element");
+            gst_bin_add(GST_BIN(vpp), col2);
+            /* make this bin link point*/
+            ghostsrc = gst_element_get_static_pad(col2,"src");
+            if(ghostsrc)
+            {
+                gst_element_add_pad(vpp, gst_ghost_pad_new("videopp_src",ghostsrc));
+                gst_object_unref(GST_OBJECT(ghostsrc));
+            }
+        }
+
+#ifdef USE_NGA_SURFACES
+        //shyward
+        /* create identity element */
+        identity  = gst_element_factory_make( "identity", "identity" );
+        if(identity)
+        {
+           DEBUG_INFO("Created identity element");
+           gst_bin_add(GST_BIN(vpp), identity);   
+           /* make this bin link point*/
+           ghostsrc = gst_element_get_static_pad(identity,"src");
+           if(ghostsrc)
+           {
+               gst_element_add_pad(vpp, gst_ghost_pad_new("videopp_sink",ghostsrc));
+               gst_object_unref(GST_OBJECT(ghostsrc));
+           }                
+        }        
+        if( !(gst_element_link_many(queue,identity,NULL)) )
+#else
+        //shyward - thins code assumes all the elements will have been created, which is not true
+        if( !(gst_element_link_many(col1,
+									scale,
+									crop,
+									rotate,
+									mirror,
+									box,
+									balance,
+									gamma,
+									queue,
+									scale2,
+#ifdef USE_NGA_SURFACES
+                					identity,
+#endif /*USE_NGA_SURFACES*/
+									col2,
+									NULL)
+									) )
+#endif /*USE_NGA_SURFACES*/
+        {
+            DEBUG_ERR("Could not link videopp elements!!");
+            gst_object_unref(vpp);
+            vpp = NULL;
+        }
+    }
+    DEBUG_API("<-XAAdaptationBase_CreateVideoPP");
+    return vpp;
+}
+
+/**
+ * GstElement* XAAdaptationBase_CreateFixedSizeRecordVideoPP( )
+ * @return GstElement* - return newly created gst pipeline element
+ * Description: Create video processing pipeline with fixed output size to TEST_VIDEO_WIDTH x TEST_VIDEO_HEIGHT
+ *              experimental implementation for changing recorder output size
+ */
+GstElement* XAAdaptationBase_CreateFixedSizeVideoPP( )
+{
+    GstElement *vpp;
+    DEBUG_API("->XAAdaptationBase_CreateFixedSizeVideoPP");
+    vpp = gst_pipeline_new("videopp");
+    if( vpp )
+    {
+        GstPad *ghostsink, *ghostsrc;
+        GstElement  *col1,
+                    *col2,
+                    *rotate,
+                    *mirror,
+                    *box,
+                    *crop,
+                    *gamma,
+                    *balance,
+                    *scale,
+                    *scale2,
+                    *filter,
+                    *queue;
+
+
+        /* Crete ffmpegcolorspace to convert stream to correct format */
+        col1 = gst_element_factory_make( "ffmpegcolorspace", "pp_colsp1");
+        if(col1)
+        {
+            DEBUG_INFO("Created ffmpegcolorspace element");
+            gst_bin_add(GST_BIN(vpp), col1);
+           /* make this bin link point*/
+            ghostsink = gst_element_get_static_pad(col1,"sink");
+            if(ghostsink)
+            {
+                gst_element_add_pad(vpp, gst_ghost_pad_new("videopp_sink",ghostsink));
+                gst_object_unref(GST_OBJECT(ghostsink));
+            }
+        }
+
+        /* create video crop, this will be sink for videoPP pipeline */
+        crop = gst_element_factory_make( "videocrop", "pp_crop");
+        if(crop)
+        {
+            DEBUG_INFO("Created crop element");
+            gst_bin_add(GST_BIN(vpp), crop);
+        }
+
+        /* create video rotate */
+        rotate = gst_element_factory_make( "videoflip", "pp_rotate");
+        if(rotate)
+        {
+            DEBUG_INFO("Created rotate element");
+            g_object_set(G_OBJECT(rotate), "method", FLIP_NONE, NULL);
+            gst_bin_add(GST_BIN(vpp), rotate);
+        }
+
+        /* create video mirror */
+        mirror = gst_element_factory_make( "videoflip", "pp_mirror");
+        if(mirror)
+        {
+            DEBUG_INFO("Created mirror element");
+            g_object_set(G_OBJECT(mirror), "method", FLIP_NONE, NULL);
+            gst_bin_add(GST_BIN(vpp), mirror);
+        }
+
+        /* create video box */
+        box = gst_element_factory_make( "videobox", "pp_box");
+        if(box)
+        {
+            DEBUG_INFO("Created videobox element");
+            gst_bin_add(GST_BIN(vpp), box);
+        }
+
+        /* create video balance */
+        balance = gst_element_factory_make( "videobalance", "pp_balance");
+        if(balance)
+        {
+            DEBUG_INFO("Created balance element");
+            gst_bin_add(GST_BIN(vpp), balance);
+        }
+
+        /* create video gamma */
+        gamma = gst_element_factory_make( "gamma", "pp_gamma");
+        if(gamma)
+        {
+            DEBUG_INFO("Created gamma element");
+            gst_bin_add(GST_BIN(vpp), gamma);
+        }
+
+        /* Create videoscale element to scale postprocessed output to correct size */
+        scale = gst_element_factory_make("videoscale", "pp_scale");
+        if ( scale )
+        {
+            DEBUG_INFO("Created videoscale element");
+            gst_bin_add(GST_BIN(vpp), scale);
+        }
+        scale2 = gst_element_factory_make("videoscale", "pp_scale2");
+        if ( scale2 )
+        {
+            GstPad *pad = NULL;
+            GstCaps *caps = NULL;
+            DEBUG_INFO("Created videoscale element");
+            pad = gst_element_get_static_pad(scale2,"src");
+            caps = gst_caps_new_simple("video/x-raw-yuv",
+                     "width", G_TYPE_INT,0,
+                     "height", G_TYPE_INT,0,
+                     NULL);
+            gst_pad_set_caps(pad, caps);
+            gst_bin_add(GST_BIN(vpp), scale2);
+        }
+
+        /* create capsfilter for fixed video size */
+        filter = gst_element_factory_make("capsfilter", "pp_filter");
+        if ( filter )
+        {
+
+            g_object_set( G_OBJECT(filter), "caps",
+                            gst_caps_new_simple("video/x-raw-yuv",
+                                                "width", G_TYPE_INT, TEST_VIDEO_WIDTH,
+                                                "height", G_TYPE_INT, TEST_VIDEO_HEIGHT, NULL)
+                                                ,NULL );
+            gst_bin_add(GST_BIN(vpp), filter);
+        }
+
+        /* create video queue */
+        queue = gst_element_factory_make( "queue", "vpp_queue");
+        if(queue)
+        {
+            gst_bin_add(GST_BIN(vpp), queue);
+        }
+
+
+        /* Crete ffmpegcolorspace to convert stream to correct format */
+        col2 = gst_element_factory_make( "ffmpegcolorspace", "pp_colsp2");
+        if(col2)
+        {
+            DEBUG_INFO("Created ffmpegcolorspace element");
+            gst_bin_add(GST_BIN(vpp), col2);
+            /* make this bin link point*/
+            ghostsrc = gst_element_get_static_pad(col2,"src");
+            if(ghostsrc)
+            {
+                gst_element_add_pad(vpp, gst_ghost_pad_new("videopp_src",ghostsrc));
+                gst_object_unref(GST_OBJECT(ghostsrc));
+            }
+        }
+        if( !(gst_element_link_many(col1,
+                                    scale,
+                                    crop,
+                                    rotate,
+                                    mirror,
+                                    box,
+                                    balance,
+                                    gamma,
+                                    queue,
+                                    scale2,
+                                    filter,
+                                    col2,
+                                    NULL)
+                                    ) )
+        {
+            DEBUG_ERR("Could not link videopp elements!!");
+            gst_object_unref(vpp);
+            vpp = NULL;
+        }
+    }
+    DEBUG_API("<-XAAdaptationBase_CreateFixedSizeVideoPP");
+    return vpp;
+}
+
+
+
+/**
+ * GstElement* XAAdaptationBase_CreateVideoPPBlackScr( )
+ * @return GstElement* - return newly created gst pipeline element
+ * Description: Create video processing pipeline for black screen
+ */
+GstElement* XAAdaptationBase_CreateVideoPPBlackScr( )
+{
+    GstElement *vppBScr;
+    DEBUG_API("->XAAdaptationBase_CreateVideoPPBlackScr");
+    vppBScr = gst_pipeline_new("videoppBScr");
+    if( vppBScr )
+    {
+        GstPad *ghostsrc=NULL;
+        GstElement *testVideo=NULL, *scale=NULL;
+        GstElement *ffmpegcolorspace=NULL;
+
+        testVideo = gst_element_factory_make( "videotestsrc", "videotest");
+        if(testVideo)
+        {
+            DEBUG_INFO("Created videotestsrc element");
+
+            g_object_set(G_OBJECT(testVideo), "pattern", (gint)2, "num-buffers", (gint)1, NULL);
+            gst_bin_add(GST_BIN(vppBScr), testVideo);
+        }
+
+        scale = gst_element_factory_make("videoscale", "BSrc_scale");
+        if(scale)
+        {
+            DEBUG_INFO("Created videoscale element");
+            gst_bin_add(GST_BIN(vppBScr), scale);
+            /* make this bin link point*/
+            ghostsrc = gst_element_get_static_pad(scale,"src");
+            if(ghostsrc)
+            {
+                gst_element_add_pad(vppBScr, gst_ghost_pad_new("videoppBSrc_src",ghostsrc));
+                gst_object_unref(GST_OBJECT(ghostsrc));
+            }
+        }
+        ffmpegcolorspace = gst_element_factory_make("ffmpegcolorspace", "BlackScrFfmpeg");
+        gst_bin_add(GST_BIN(vppBScr), ffmpegcolorspace);
+        if( !(gst_element_link_many(testVideo, ffmpegcolorspace, scale, NULL)) )
+        {
+            DEBUG_ERR("Could not link videoppBSrc elements!!");
+            gst_object_unref(vppBScr);
+            vppBScr = NULL;
+        }
+    }
+    DEBUG_API("<-XAAdaptationBase_CreateVideoPPBlackScr");
+    return vppBScr;
+}
+
+/**
+ * GstElement* XAAdaptationBase_CreateInputSelector( )
+ * @return GstElement* - return newly created input selector
+ * Description: Create input selector to processing between black screen and video screen
+ */
+GstElement* XAAdaptationBase_CreateInputSelector( )
+{
+    GstElement *inputSelector;
+    DEBUG_API("->XAAdaptationBase_CreateInputSelector");
+    inputSelector = gst_element_factory_make("input-selector", "input-selector");
+    if( inputSelector )
+    {
+        g_object_set(G_OBJECT(inputSelector), "select-all", TRUE, NULL);
+    }
+    DEBUG_API("<-XAAdaptationBase_CreateInputSelector");
+    return inputSelector;
+}
+
+/**
+ * GstElement* XAAdaptationBase_CreateAudioPP( )
+ * @return GstElement* - return newly created gst pipeline element
+ * Description: Create video processing pipeline
+ */
+GstElement* XAAdaptationBase_CreateAudioPP( )
+{
+    GstElement *app;
+    gboolean ok = TRUE;
+    DEBUG_API("->XAAdaptationBase_CreateAudioPP");
+    app = gst_pipeline_new("audiopp");
+    if( app )
+    {
+        GstPad *ghostsink, *ghostsrc;
+        GstElement *ac,*vol,*eq,*queue,*pan, *ac2;
+
+        /* first and last elements should be audioconverts to match sink and encoder formats */
+        ac = gst_element_factory_make( "audioconvert", "pp_ac");
+        if (ac)
+        {
+            ok = gst_bin_add(GST_BIN(app), ac);
+            /* make this bin link point*/
+            if (ok)
+            {
+                ghostsink = gst_element_get_static_pad(ac,"sink");
+                ok = gst_element_add_pad(app, gst_ghost_pad_new("sink",ghostsink));
+                gst_object_unref(GST_OBJECT(ghostsink));
+            }
+        }
+        ac2 = gst_element_factory_make( "audioconvert", "pp_ac2");
+        if (ac2 && ok)
+        {
+            ok = gst_bin_add(GST_BIN(app), ac2);
+            /* make this bin link point*/
+            if (ok)
+            {
+                ghostsrc = gst_element_get_static_pad(ac2,"src");
+                ok = gst_element_add_pad(app, gst_ghost_pad_new("src",ghostsrc));
+                gst_object_unref(GST_OBJECT(ghostsrc));
+            }
+        }
+
+        vol = gst_element_factory_make( "volume", "pp_vol");
+        /* create volume controller */
+        if (vol && ok)
+        {
+            ok = gst_bin_add(GST_BIN(app), vol);
+            g_object_set( G_OBJECT(vol), "volume", (gdouble)1, NULL );
+        }
+        /* create 10-band equalizer */
+        eq = gst_element_factory_make( "equalizer-10bands", "pp_equ");
+        if (eq && ok)
+        {
+            ok = gst_bin_add(GST_BIN(app), eq);
+        }
+        /* create audio queue */
+        queue = gst_element_factory_make( "queue", "app_queue");
+        if(queue && ok)
+        {
+            ok = gst_bin_add(GST_BIN(app), queue);
+            g_object_set (G_OBJECT (queue), "max-size-buffers", 2, NULL);
+        }
+        /* create audio pan effect */
+        pan = gst_element_factory_make( "audiopanorama", "pp_pan");
+        if (pan && ok)
+        {
+            ok = gst_bin_add(GST_BIN(app), pan);
+        }
+
+        if (ac && ok)
+        {
+            if (queue)
+            {
+                ok = gst_element_link(ac, queue);
+            }
+            else if (vol)
+            {
+                ok = gst_element_link(ac, vol);
+            }
+            else if (pan)
+            {
+                ok = gst_element_link(ac, pan);
+            }
+            else if (eq)
+            {
+                ok = gst_element_link(ac, eq);
+            }
+            else if (ac2)
+            {
+                ok = gst_element_link(ac, ac2);
+            }
+        }
+        if (queue && ok)
+        {
+            if (vol)
+            {
+                ok = gst_element_link(queue, vol);
+            }
+            else if (pan)
+            {
+                ok = gst_element_link(queue, pan);
+            }
+            else if (eq)
+            {
+                ok = gst_element_link(queue, eq);
+            }
+            else if (ac2)
+            {
+                ok = gst_element_link(queue, ac2);
+            }
+        }
+        if (vol && ok)
+        {
+            if (pan)
+            {
+                ok = gst_element_link(vol, pan);
+            }
+            else if (eq)
+            {
+                ok = gst_element_link(vol, eq);
+            }
+            else if (ac2)
+            {
+                ok = gst_element_link(vol, ac2);
+            }
+        }
+        if (pan && ok)
+        {
+            if (eq)
+            {
+                ok = gst_element_link(pan, eq);
+            }
+            else if (ac2)
+            {
+                ok = gst_element_link(pan, ac2);
+            }
+        }
+        if (eq && ok)
+        {
+            if (ac2)
+            {
+                ok = gst_element_link(eq, ac2);
+            }
+        }
+        
+        if (ac)
+        {
+            // ghost sink above
+        }
+        else if (queue && ok)
+        {
+            /* make this bin link point*/
+            ghostsink = gst_element_get_static_pad(queue,"sink");
+            ok = gst_element_add_pad(app, gst_ghost_pad_new("sink",ghostsink));
+            gst_object_unref(GST_OBJECT(ghostsink));
+        }
+        else if (vol && ok)
+        {
+            /* make this bin link point*/
+            ghostsink = gst_element_get_static_pad(vol,"sink");
+            ok = gst_element_add_pad(app, gst_ghost_pad_new("sink",ghostsink));
+            gst_object_unref(GST_OBJECT(ghostsink));
+        }
+        else if (pan && ok)
+        {
+            /* make this bin link point*/
+            ghostsink = gst_element_get_static_pad(pan,"sink");
+            ok = gst_element_add_pad(app, gst_ghost_pad_new("sink",ghostsink));
+            gst_object_unref(GST_OBJECT(ghostsink));
+        }
+        else if (eq && ok)
+        {
+            /* make this bin link point*/
+            ghostsink = gst_element_get_static_pad(eq,"sink");
+            ok = gst_element_add_pad(app, gst_ghost_pad_new("sink",ghostsink));
+            gst_object_unref(GST_OBJECT(ghostsink));
+        }
+        else if (ac2 && ok)
+        {
+            /* make this bin link point*/
+            ghostsink = gst_element_get_static_pad(ac2,"sink");
+            ok = gst_element_add_pad(app, gst_ghost_pad_new("sink",ghostsink));
+            gst_object_unref(GST_OBJECT(ghostsink));
+        }
+        
+        if (ac2)
+        {
+            // ghost src above
+        }
+        else if (eq && ok)
+        {
+            /* make this bin link point*/
+            ghostsrc = gst_element_get_static_pad(eq,"src");
+            ok = gst_element_add_pad(app, gst_ghost_pad_new("src",ghostsrc));
+            gst_object_unref(GST_OBJECT(ghostsrc));
+        }
+        else if (pan && ok)
+        {
+            /* make this bin link point*/
+            ghostsrc = gst_element_get_static_pad(pan,"src");
+            ok = gst_element_add_pad(app, gst_ghost_pad_new("src",ghostsrc));
+            gst_object_unref(GST_OBJECT(ghostsrc));
+        }
+        else if (vol && ok)
+        {
+            /* make this bin link point*/
+            ghostsrc = gst_element_get_static_pad(vol,"src");
+            ok = gst_element_add_pad(app, gst_ghost_pad_new("src",ghostsrc));
+            gst_object_unref(GST_OBJECT(ghostsrc));
+        }
+        else if (queue && ok)
+        {
+            /* make this bin link point*/
+            ghostsrc = gst_element_get_static_pad(queue,"src");
+            ok = gst_element_add_pad(app, gst_ghost_pad_new("src",ghostsrc));
+            gst_object_unref(GST_OBJECT(ghostsrc));
+        }
+        else if (ac && ok)
+        {
+            /* make this bin link point*/
+            ghostsrc = gst_element_get_static_pad(ac,"src");
+            ok = gst_element_add_pad(app, gst_ghost_pad_new("src",ghostsrc));
+            gst_object_unref(GST_OBJECT(ghostsrc));
+        }
+            
+//        if( !(gst_element_link_many(ac, queue, vol, ac2, NULL)) )
+//        if( !(gst_element_link_many(ac, queue, vol, pan, eq, ac2, NULL)) )
+        if (!ok)
+        {
+            DEBUG_ERR("Could not link audiopp elements!!");
+            gst_object_unref(app);
+            app = NULL;
+        }
+    }
+
+    DEBUG_API("<-XAAdaptationBase_CreateAudioPP");
+    return app;
+}
+
+/* called when pad is actually blocking/ gets unblocked*/
+void XAAdaptationBase_PadBlockCb(GstPad *pad, gboolean blocked, gpointer user_data)
+{
+    DEBUG_API_A2("->XAAdaptationBase_PadBlockCb   pad \"%s\" of \"%s\" ",
+                        GST_OBJECT_NAME(pad),
+                        GST_OBJECT_NAME(gst_pad_get_parent_element(pad)) );
+    DEBUG_API_A1("<-XAAdaptationBase_PadBlockCb   blocked:%d",blocked);
+}
+
+/* utility to set same fields for all media types in caps */
+void XAAdaptationBase_SetAllCaps (GstCaps * caps, char *field, ...)
+{
+    GstStructure *structure;
+    va_list var_args;
+    int i;
+
+    for (i = 0; i < gst_caps_get_size (caps); i++)
+    {
+        structure = gst_caps_get_structure (caps, i);
+        va_start (var_args, field);
+        gst_structure_set_valist (structure, field, var_args);
+        va_end (var_args);
+    }
+}
+
+/*
+ * void* XAAdaptationBase_ContentPipeScrThrFunc( void* arg )
+ */
+void* XAAdaptationBase_ContentPipeScrThrFunc( void* arg )
+{
+	XAAdaptCpThrCtx* thrCtx = (XAAdaptCpThrCtx*)arg;
+	XAresult ret;
+	CPresult cpRet;
+	XAuint32 requestedBytes = CONTENT_PIPE_BUFFER_SIZE;
+	CP_CHECKBYTESRESULTTYPE eResult;
+
+	DEBUG_API("->XAAdaptationBase_ContentPipeScrThrFunc");
+
+
+	/* Wait until playstate is changed */
+	ret = XAImpl_WaitSemaphore( thrCtx->stateSem );
+	if ( ret != XA_RESULT_SUCCESS)
+	{
+	    DEBUG_ERR("Could not start semaphore");
+	}
+
+	thrCtx->state = CPStateRunning;
+
+	do
+	{
+	    GstBuffer  *buffer = NULL;            /* Gstreamer buffer */
+
+        if ( thrCtx->state == CPStatePaused )
+        {
+            /* Wait until playstate is changed */
+            ret = XAImpl_WaitSemaphore( thrCtx->stateSem );
+            if ( ret != XA_RESULT_SUCCESS)
+            {
+                DEBUG_ERR("Could not start semaphore");
+                thrCtx->state = CPStateError;
+                break;
+            }
+        }
+
+        if ( thrCtx->state == CPStateWaitForData )
+        {
+        }
+	    /* Check do we have enough bytes in pipe */
+	    cpRet = thrCtx->pipe->pContentPipe->CheckAvailableBytes(&(thrCtx->dataHandle), requestedBytes, &eResult);
+	    if ( cpRet != EXIT_SUCCESS )
+	    {
+	        thrCtx->state = CPStateError;
+	    }
+
+		if ( eResult == CP_CheckBytesOk)
+		{ /* We have enough bytes in content pipe */
+		    thrCtx->state = CPStateRunning;
+		    DEBUG_API("CP_CheckBytesOk");
+
+			if ( thrCtx->cpConfig == XA_READ )
+			{ /* OMX-AL implementation allocates buffers */
+
+			    /* Pointer to OMX-AL RI allocated data */
+			    gpointer cpBuffer = NULL;
+
+			    /* Allocate new buffer with preferred size */
+			    cpBuffer = g_malloc0(requestedBytes );
+			    cpRet = thrCtx->pipe->pContentPipe->Read( &(thrCtx->dataHandle), (CPbyte*)cpBuffer, requestedBytes );
+			    if ( cpRet != EXIT_SUCCESS )
+			    {
+			        DEBUG_ERR("Could not read data from content pipe!");
+			        thrCtx->state = CPStateError;
+                    break;
+			    }
+			    else
+			    {
+			        DEBUG_INFO_A1("Readed %u bytes", requestedBytes );
+                    /* Create gstBuffer, GStreamer frees data  */
+			        buffer = gst_app_buffer_new( (void*)cpBuffer, requestedBytes, g_free, cpBuffer );
+                    if ( !buffer )
+                    {
+                        DEBUG_ERR("Could not allocate buffer for content pipe source!");
+                        thrCtx->state = CPStateError;
+                        break;
+                    }
+			    }
+			}
+			else
+			{ /* Content pipe implementation allocates buffers */
+			    gpointer pipeBuffer = NULL;
+			    gpointer omxBuffer = NULL;
+
+			    cpRet = thrCtx->pipe->pContentPipe->ReadBuffer( &(thrCtx->dataHandle), (CPbyte**)&pipeBuffer, &requestedBytes, FALSE);
+                if ( cpRet != EXIT_SUCCESS )
+                {
+                    DEBUG_ERR("Could not read data from content pipe!");
+                    thrCtx->state = CPStateError;
+                    break;
+                }
+                else
+                {
+                    DEBUG_INFO_A1("Readed %u bytes", requestedBytes );
+                    /* Copy pipe allocated data into own buffer */
+                    omxBuffer = g_malloc0(requestedBytes );
+                    memcpy( omxBuffer, pipeBuffer, requestedBytes );
+
+                    /* Create gstBuffer, GStreamer frees data  */
+                    buffer = gst_app_buffer_new( omxBuffer, requestedBytes, g_free, omxBuffer );
+                    if ( !buffer )
+                    {
+                        DEBUG_ERR("Could not allocate buffer for content pipe source!");
+                        thrCtx->state = CPStateError;
+                        break;
+                    }
+                    /* Release readbuffer */
+                    cpRet = thrCtx->pipe->pContentPipe->ReleaseReadBuffer( &(thrCtx->dataHandle), (CPbyte*)pipeBuffer );
+                    if ( cpRet != EXIT_SUCCESS )
+                    {
+                        DEBUG_ERR("Could not release readbuffer!");
+                        thrCtx->state = CPStateError;
+                        break;
+                    }
+                    pipeBuffer = NULL;
+
+                }
+			}
+			if ( cpRet == EXIT_SUCCESS  )
+            {
+			    if( buffer )
+			    {
+			    DEBUG_INFO("Pushing buffer");
+                gst_app_src_push_buffer( GST_APP_SRC(thrCtx->appSrc), GST_BUFFER(buffer) );
+			    }
+            }
+		}
+		else if ( eResult == CP_CheckBytesNotReady )
+		{
+			DEBUG_API("CP_CheckBytesNotReady");
+			thrCtx->state = CPStateWaitForData;
+		}
+		else if ( eResult == CP_CheckBytesInsufficientBytes )
+		{
+			DEBUG_API("CP_CheckBytesInsufficientBytes");
+			if ( requestedBytes > 0 )
+			{
+				requestedBytes = requestedBytes - 1 ;
+			}
+			else
+			{
+				thrCtx->state = CPStateError;
+			}
+		}
+		else if ( eResult == CP_CheckBytesAtEndOfStream)
+		{
+			DEBUG_API("XAAdaptationBase_ContentPipeScrThrFunc-> CP_CheckBytesAtEndOfStream");
+		    thrCtx->state = CPStateEOS;
+		}
+	}while (thrCtx->state == CPStateRunning || thrCtx->state == CPStateWaitForData || thrCtx->state == CPStatePaused );
+
+	if ( thrCtx->state == CPStateError )
+	{
+	    /* If error goto beginning of content */
+	    cpRet = thrCtx->pipe->pContentPipe->SetPosition( &(thrCtx->dataHandle),0, CP_OriginBegin);
+	}
+	else if ( thrCtx->state == CPStateEOS )
+	{
+	    /* Send EOS to appSrc */
+	    gst_app_src_end_of_stream( GST_APP_SRC(thrCtx->appSrc) );
+	    /* Set position to beginning */
+	    cpRet = thrCtx->pipe->pContentPipe->SetPosition( &(thrCtx->dataHandle),0, CP_OriginBegin);
+	}
+	else if ( thrCtx->state == CPStateStopped )
+	{
+	    cpRet = thrCtx->pipe->pContentPipe->SetPosition( &(thrCtx->dataHandle),0, CP_OriginBegin);
+	}
+
+	thrCtx->state = CPStateInitialized;
+
+   DEBUG_API("<-XAAdaptationBase_ContentPipeScrThrFunc");
+   return NULL;
+}
+
+/*
+ * void* XAAdaptationBase_ContentPipeSinkThrFunc( void* arg )
+ */
+void* XAAdaptationBase_ContentPipeSinkThrFunc( void* arg )
+{
+    XAAdaptCpThrCtx* thrCtx = (XAAdaptCpThrCtx*)arg;
+    XAresult ret;
+    CPresult cpRet;
+    XAboolean paused;
+    XAuint32 position = 0;
+
+    DEBUG_API("->XAAdaptationBase_ContentPipeSinkThrFunc");
+
+    thrCtx->state = CPStateStarted;
+
+    /* Wait until recordstate is changed */
+    ret = XAImpl_WaitSemaphore( thrCtx->stateSem );
+    if ( ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR("Could not start semaphore");
+    }
+    thrCtx->state = CPStateRunning;
+
+    do
+    {
+        GstBuffer  *buffer;
+
+        if ( thrCtx->state == CPStatePaused )
+        {
+        	/*If paused get position from end of the file*/
+        	paused = XA_BOOLEAN_TRUE;
+        	DEBUG_API("Get New position");
+        	cpRet = thrCtx->pipe->pContentPipe->GetPosition(&(thrCtx->dataHandle), &position);
+        	cpRet = thrCtx->pipe->pContentPipe->SetPosition(&(thrCtx->dataHandle), (CPint)position, CP_OriginEnd);
+            /* Wait until playstate is changed */
+            ret = XAImpl_WaitSemaphore( thrCtx->stateSem );
+            if ( ret != XA_RESULT_SUCCESS)
+            {
+                DEBUG_ERR("Could not start waiting content pipe state semaphore");
+                thrCtx->state = CPStateError;
+                break;
+            }
+        }
+
+        buffer = gst_app_sink_pull_buffer(GST_APP_SINK(thrCtx->appSink) );
+        if ( !buffer )
+        {
+            DEBUG_INFO("No buffer in gstAppSink!")
+            if ( gst_app_sink_is_eos( thrCtx->appSink) )
+            {
+				DEBUG_API("XAAdaptationBase_ContentPipeSinkThrFunc-> CPStateEOS")
+                thrCtx->state = CPStateEOS;
+            }
+            continue;
+        }
+
+        if ( thrCtx->cpConfig == XA_WRITE )
+        { /* OMX-AL implementation allocates buffers */
+
+            /* Write data to content pipe */
+            cpRet = thrCtx->pipe->pContentPipe->Write( &(thrCtx->dataHandle), (CPbyte *)GST_BUFFER_DATA(buffer), GST_BUFFER_SIZE(buffer) );
+            if ( cpRet != EXIT_SUCCESS )
+            {
+                DEBUG_ERR("Could not write data to content pipe!");
+                thrCtx->state = CPStateError;
+                break;
+            }
+        }
+        else
+        { /* Use content pipe allocated buffers */
+
+            gpointer cpBuffer = NULL;
+
+            /* Request buffer from content pipe with gst-buffer size */
+            cpRet = thrCtx->pipe->pContentPipe->GetWriteBuffer( &(thrCtx->dataHandle), (CPbyte**)&cpBuffer, GST_BUFFER_SIZE(buffer) );
+            if ( cpRet != EXIT_SUCCESS )
+            {
+                DEBUG_ERR("Could not get write buffer from content pipe!");
+                thrCtx->state = CPStateError;
+                break;
+            }
+
+            /* Copy data from gst-buffer to content pipe buffer */
+            memcpy( cpBuffer,GST_BUFFER_DATA(buffer),GST_BUFFER_SIZE(buffer));
+
+            /* Write buffer to content pipe */
+            cpRet = thrCtx->pipe->pContentPipe->WriteBuffer( &(thrCtx->dataHandle), cpBuffer, GST_BUFFER_SIZE(buffer) );
+            if ( cpRet != EXIT_SUCCESS )
+            {
+                DEBUG_ERR("Could not write buffer to content pipe!");
+                thrCtx->state = CPStateError;
+                break;
+            }
+
+            g_free(cpBuffer);
+            cpBuffer = NULL;
+        }
+
+        if ( gst_app_sink_is_eos( thrCtx->appSink) )
+        {
+            thrCtx->state = CPStateEOS;
+        }
+
+    }while (thrCtx->state == CPStateRunning || thrCtx->state == CPStatePaused );
+
+    if ( thrCtx->state == CPStateError )
+    {
+        /* If error goto beginning of content */
+        cpRet = thrCtx->pipe->pContentPipe->SetPosition( &(thrCtx->dataHandle),0, CP_OriginBegin);
+    }
+    else if ( thrCtx->state == CPStateStopped )
+    {
+        cpRet = thrCtx->pipe->pContentPipe->SetPosition( &(thrCtx->dataHandle),0, CP_OriginBegin);
+    }
+
+    DEBUG_API("<-XAAdaptationBase_ContentPipeSinkThrFunc");
+    return NULL;
+}
+
+/*
+ * CPresult XAAdaptationBase_ContentPipeSrcCb(CP_EVENTTYPE eEvent, CPuint iParam)
+ * Description: Callback function for content pipe source
+ * @param: CP_EVENTTYPE eEvent - Callback event
+ * @param: CPuint iParam - Param related to event
+ *
+ *  No actual functionality can be handled in callback, since current
+ *  Content Pipe specification lacks methods of supplying client context and/or
+ *  reference to context pipe handle with CP callback.
+ *  Khronos group is in progress on proposals for extending this functionality.
+ *
+ */
+CPresult XAAdaptationBase_ContentPipeSrcCb(CP_EVENTTYPE eEvent, CPuint iParam)
+{
+	XAresult ret = XA_RESULT_SUCCESS;
+	switch (eEvent )
+	{
+	case CP_BytesAvailable:
+		/* Restart reading thread */
+		break;
+	case CP_Overflow:
+		/* Handle error */
+		break;
+	case CP_PipeDisconnected:
+		/* Reconnect pipe */
+	case CP_EventMax:
+		break;
+	default:
+		break;
+	}
+	return ret;
+}
+
+/*
+ * CPresult XAAdaptationBase_ContentPipeSinkCb(CP_EVENTTYPE eEvent, CPuint iParam)
+ * Description: Callback function for content pipe sink
+ * @param: CP_EVENTTYPE eEvent - Callback event
+ * @param: CPuint iParam - Param related to event
+ *
+ *  No actual functionality can be handled in callback, since current
+ *  Content Pipe specification lacks methods of supplying client context and/or
+ *  reference to context pipe handle with CP callback.
+ *  Khronos group is in progress on proposals for extending this functionality.
+ *
+ */
+CPresult XAAdaptationBase_ContentPipeSinkCb(CP_EVENTTYPE eEvent, CPuint iParam)
+{
+	XAresult ret = XA_RESULT_SUCCESS;
+	switch (eEvent )
+	{
+	case CP_BytesAvailable:
+		/*Restart write thread.*/
+		break;
+	case CP_Overflow:
+		/*Handle error */
+		break;
+	case CP_PipeDisconnected:
+		/*Reconnect pipe */
+	default:
+		break;
+	}
+	return ret;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaadaptationcontextbase.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,105 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAADAPTATIONCONTEXTBASE_H
+#define XAADAPTATIONCONTEXTBASE_H
+
+#include <stdlib.h>
+#include "XAGlobals.h"
+#include "openmaxalwrapper.h"
+#include "OpenMAXAL_ContentPipe.h"
+#include "XAPlatform.h"
+
+/* ENUMERATIONS */
+
+typedef enum {
+    XAMediaPlayerAdaptation = 0,
+    XAMediaRecorderAdaptation,
+    XARadioAdaptation,
+    XACameraAdaptation,
+    XAOutputMixAdaptation,
+    XAVibraAdaptation,
+    XALedArrayAdaptation,
+    XAMDAdaptation,
+    XAEngineAdaptation
+}AdaptationContextIDS;
+
+/**
+ * enumeration for different adaptation event types.
+ * add more types when needed, use single bit values.
+ **/
+typedef enum {
+    XA_GENERICEVENTS = 0x1,
+    XA_PLAYITFEVENTS = 0x2,
+    XA_RECORDITFEVENTS = 0x4,
+    XA_SNAPSHOTITFEVENTS = 0x8,
+    XA_OUTPUTMIXITFEVENTS = 0x10,
+    XA_CAMERAITFEVENTS = 0x20,
+    XA_PREFETCHITFEVENTS = 0x40,
+    XA_RADIOITFEVENTS = 0x80,
+    XA_RDSITFEVENTS = 0x100,
+    XA_METADATAEVENTS = 0x200,
+    XA_ADDMORETYPES  = 0x400
+}XAAdaptEventTypes;
+
+#define XA_ADAPT_PU_INTERVAL 50                     /* position update interval */
+#define XA_ADAPT_ASYNC_TIMEOUT 3000                 /* timeout to wait async events */
+#define XA_ADAPT_ASYNC_TIMEOUT_SHORT 1000           /* timeout to wait async events */
+#define XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC 1000000   /* timeout to wait async events */
+
+#define XA_ADAPT_POSITION_UPDATE_EVT 0xf0           /* position update event */
+#define XA_ADAPT_SNAPSHOT_TAKEN 0xf1                /* snapshot taken event */
+#define XA_ADAPT_SNAPSHOT_INITIATED 0xf2            /* snapshot intitiated event */
+#define XA_ADAPT_MDE_TAGS_AVAILABLE 0xf3            /* metadata taglist changed */
+#define XA_ADAPT_OMIX_DEVICESET_CHANGED 0xf4        /* Output mix device changed event */
+#define XA_ADAPT_RADIO_FREQUENCY_CHANGED 0xf6       /* Radio frequency changed event */
+#define XA_ADAPT_RADIO_FREQUENCY_RANGE_CHANGED 0xf7 /* Radio frequency range changed event */
+#define XA_ADAPT_RADIO_SEEK_COMPLETE 0xf8           /* Radio seek complete changed event */
+#define XA_ADAPT_RDS_GET_ODA_GROUP_DONE 0xf9        /* RDS get oda group done event */
+#define XA_ADAPT_BUFFERING 0xfa
+#define XA_ADAPT_MDE_TAGS_WRITTEN 0xfb
+/* TYPEDEFS */
+
+#define RADIO_DEFAULT_FREQ_RANGE XA_FREQRANGE_FMEUROAMERICA
+#define RADIO_DEFAULT_FREQ 88000000
+
+/* Adaptation event structure */
+typedef struct XAAdaptEvent_
+{
+    XAAdaptEventTypes  eventtype; /* what kind of event, e.g. playitf event  */
+    XAuint8            eventid;   /* eventtype-specific event, e.g. XA_PLAYEVENT macro */
+    XAuint32           datasize;  /* event data size */
+    void*              data;      /* event data if needed */
+} XAAdaptEvent;
+
+/* Adaptation event callback */
+typedef void (*xaAdaptEventHandler) ( void *pHandlerCtx, XAAdaptEvent* event );
+
+/* Forward declaration of adaptation basecontext */
+typedef struct XAAdaptationBaseCtx_ XAAdaptationBaseCtx;
+
+/* FUNCTIONS */
+XAresult XAAdaptationBase_Init( XAAdaptationBaseCtx* pSelf, XAuint32 ctxId );
+XAresult XAAdaptationBase_PostInit( XAAdaptationBaseCtx* ctx );
+XAresult XAAdaptationBase_AddEventHandler( XAAdaptationBaseCtx* ctx, xaAdaptEventHandler evtHandler,
+                                    XAuint32 evtTypes,void *pHandlerCtx );
+XAresult XAAdaptationBase_RemoveEventHandler( XAAdaptationBaseCtx* ctx, xaAdaptEventHandler evtHandler );
+void XAAdaptationBase_Free( XAAdaptationBaseCtx* ctx );
+XAresult XAAdaptationBase_SetCPConfiguration(XAAdaptationBaseCtx* ctx, XAConfigExtensionCpKey configValue);
+
+#endif /*XAADAPTATIONCONTEXTBASE_H*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaaudioencoderitfadaptation.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include <gst.h>
+#include "XAMediaRecorderAdaptCtx.h"
+#include "XAAudioEncoderItfAdaptation.h"
+#include "XAAdaptation.h"
+#include "XAStaticCapsAdaptation.h"
+
+/*
+ * XAresult XAAudioEncoderItfAdapt_SetEncoderSettings( XAAdaptationBaseCtx *ctx,
+ *                                                     XAAudioEncoderSettings *pSettings )
+ * @param XAAdaptationBaseCtx *ctx - pointer to Media Recorer adaptation contex
+ * @param XAAudioEncoderSettings *pSettings - Settings to be setted for encoder
+ * @return XAresult ret - return success value
+ * Description: Sets preferred encoder settings for pipeline.
+ */
+XAresult XAAudioEncoderItfAdapt_SetEncoderSettings( XAAdaptationBaseCtx *ctx,
+                                                    XAAudioEncoderSettings *pSettings )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+
+    DEBUG_API("->XAAudioEncoderItfAdapt_SetEncoderSettings");
+    if( !ctx || (ctx->ctxId != XAMediaRecorderAdaptation) || !pSettings )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaRecorderAdaptationCtx*) ctx;
+
+    ret = XAMediaRecorderAdapt_CheckCodec(mCtx,XACAP_AUDIO,pSettings->encoderId);
+    if(ret==XA_RESULT_SUCCESS)
+    {
+        /*change of settings - pipeline must be regenerated**/
+        mCtx->encodingchanged = XA_BOOLEAN_TRUE;
+        memcpy(&mCtx->audioEncSettings, pSettings, sizeof(XAAudioEncoderSettings));
+    }
+    DEBUG_API("<-XAAudioEncoderItfAdapt_SetEncoderSettings");
+    return ret;
+}
+
+XAresult XAAudioEncoderItfAdapt_GetEncoderSettings( XAAdaptationBaseCtx *bCtx,
+                                                 XAAudioEncoderSettings *pSettings )
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAAudioEncoderItfAdapt_GetEncoderSettings");
+    if( !bCtx || (bCtx->ctxId != XAMediaRecorderAdaptation) || !pSettings )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+    memcpy(pSettings, &(mCtx->audioEncSettings), sizeof(XAAudioEncoderSettings));
+    DEBUG_API("<-XAAudioEncoderItfAdapt_GetEncoderSettings");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaaudioencoderitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAAUDIOENCODERITFADAPTATION_H
+#define XAAUDIOENCODERITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+/* FUNCTIONS */
+XAresult XAAudioEncoderItfAdapt_SetEncoderSettings(XAAdaptationBaseCtx *ctx,
+                                                   XAAudioEncoderSettings *pSettings );
+XAresult XAAudioEncoderItfAdapt_GetEncoderSettings(XAAdaptationBaseCtx *ctx,
+                                                   XAAudioEncoderSettings *pSettings );
+
+#endif /* XAAUDIOENCODERITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xacameraadaptctx.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,283 @@
+/*
+* 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 <string.h>
+#include <gst.h>
+#include "XACameraAdaptCtx.h"
+#include "XAAdaptation.h"
+#include <photography.h>
+#include "XAStaticCapsAdaptation.h"
+
+
+XAboolean cameraRealized = XA_BOOLEAN_FALSE;
+XACameraAdaptationCtx_* cameraCtx = NULL;
+
+/*
+ * gboolean XACameraAdapt_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+ * MediaPlayer Gst-bus message handler (Callback)
+ */
+gboolean XACameraAdapt_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+{
+    XACameraAdaptationCtx* mCtx = (XACameraAdaptationCtx*)data;
+    XAAdaptEvent event = {XA_CAMERAITFEVENTS,XA_CAMERACBEVENT_FOCUSSTATUS,1,NULL};
+    XAuint32 status;
+
+    /* only listen to pipeline messages */
+    if(GST_MESSAGE_SRC(message)==(GstObject*)(mCtx->baseObj.bin) )
+    {
+        DEBUG_API_A2("->XACameraAdapt_GstBusCb:\"%s\" from object \"%s\"",
+                        GST_MESSAGE_TYPE_NAME(message), GST_OBJECT_NAME(GST_MESSAGE_SRC(message)));
+
+        if ( GST_MESSAGE_TYPE(message)== GST_MESSAGE_ASYNC_DONE )
+        {
+            /* some async sequence ended */
+            XAAdaptationBase_CompleteAsyncWait((&mCtx->baseObj));
+        }
+        else if (strncmp(GST_MESSAGE_TYPE_NAME(message), GST_PHOTOGRAPHY_AUTOFOCUS_DONE,
+                            strlen(GST_PHOTOGRAPHY_AUTOFOCUS_DONE))==0 )
+        {
+            DEBUG_INFO("Autofocus done!.")
+            status = XA_CAMERA_FOCUSMODESTATUS_REACHED;
+            event.data = &status;
+            XAAdaptationBase_SendAdaptEvents(&(mCtx->baseObj), &event );
+        }
+        else if ( strncmp(GST_MESSAGE_TYPE_NAME(message), GST_PHOTOGRAPHY_SHAKE_RISK,
+                            strlen(GST_PHOTOGRAPHY_SHAKE_RISK)) ==0 )
+        {
+            DEBUG_INFO("Camera shake risk!")
+        }
+        DEBUG_API("<-XACameraAdapt_GstBusCb");
+    }
+    return TRUE;
+}
+
+/*
+ * XAAdaptationBaseCtx* XACameraAdapt_Create()
+ * Allocates memory for Camera Adaptation Context and makes 1st phase initialization
+ * @returns XACameraAdaptationCtx* - Pointer to created context
+ */
+XAAdaptationBaseCtx* XACameraAdapt_Create(XAuint32 deviceID)
+{
+    XACameraAdaptationCtx *pSelf = calloc(1, sizeof(XACameraAdaptationCtx));
+    DEBUG_API("->XACameraAdapt_Create");
+    if ( pSelf)
+    {
+        if( XAAdaptationBase_Init(&(pSelf->baseObj),XACameraAdaptation)
+                    != XA_RESULT_SUCCESS )
+        {
+            DEBUG_ERR("Failed to init base context!!!");
+            free(pSelf);
+            pSelf = NULL;
+        }
+        else
+        {
+            pSelf->deviceID = deviceID;
+            pSelf->curMirror = XA_VIDEOMIRROR_NONE;
+            pSelf->curRotation = 0;
+            pSelf->recording = XA_BOOLEAN_FALSE;
+            pSelf->playing = XA_BOOLEAN_FALSE;
+            pSelf->snapshotting = XA_BOOLEAN_FALSE;
+            cameraCtx = pSelf; /* Store global pointer */
+            DEBUG_INFO_A1("Stored global camera ponter to %x", cameraCtx);
+            cameraRealized = XA_BOOLEAN_FALSE;
+        }
+    }
+
+    DEBUG_API("<-XACameraAdapt_Create");
+    return (XAAdaptationBaseCtx*)pSelf;
+}
+
+/*
+ * XAresult XACameraAdapt_PostInit()
+ * 2nd phase initialization of Camera Adaptation Context
+ */
+XAresult XACameraAdapt_PostInit(XAAdaptationBaseCtx* bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    XACameraAdaptationCtx* ctx = NULL;
+    DEBUG_API("->XACameraAdapt_PostInit");
+    if(bCtx == NULL || bCtx->ctxId != XACameraAdaptation)
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XACameraAdapt_PostInit");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    ctx = (XACameraAdaptationCtx*)bCtx;
+
+    if ( !ctx )
+    {
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    XAAdaptationBase_PostInit( &(ctx->baseObj) );
+
+    ctx->baseObj.bin = gst_element_factory_make( "camerabin", "camera");
+    if ( !ctx->baseObj.bin )
+    {
+        DEBUG_ERR("Failed to create CameraBin");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    /* Create Gst bus listener. */
+    ret = XAAdaptationBase_InitGstListener(&(ctx->baseObj));
+    if( ret!=XA_RESULT_SUCCESS )
+    {
+        DEBUG_ERR("Bus listener creation failed!!");
+        return ret;
+    }
+    /* Add Camera specific handler */
+    if(ctx->baseObj.bus)
+    {
+        ctx->baseObj.busCb = XACameraAdapt_GstBusCb;
+        gst_bus_add_signal_watch( ctx->baseObj.bus);
+        g_signal_connect(ctx->baseObj.bus, "message::autofocus-done", G_CALLBACK(ctx->baseObj.busCb), ctx );
+        g_signal_connect(ctx->baseObj.bus, "message::shake-risk", G_CALLBACK(ctx->baseObj.busCb), ctx );
+        g_signal_connect(ctx->baseObj.bus, "message::async-done", G_CALLBACK(ctx->baseObj.busCb), ctx );
+    }
+    else
+    {
+        DEBUG_ERR("Failed to create message bus");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+
+    /* SET UP CAMERABIN */
+
+    /* use test video source if set, camerabin default (v4l2src) otherwise */
+#ifdef XA_USE_TEST_PLUGINS
+    if(ctx->deviceID == XA_ADAPTID_VIDEOTESTSRC || ctx->deviceID == XA_DEFAULTDEVICEID_CAMERA )
+#else
+    if(ctx->deviceID == XA_ADAPTID_VIDEOTESTSRC )
+#endif
+    {
+        g_object_set( G_OBJECT(ctx->baseObj.bin), "videosrc", gst_element_factory_make("videotestsrc", "videotestsrc"), NULL );
+    }
+
+    /* set viewfinder element to be fake for the time of preroll.. if ghost pad added now,
+     * stupid camerabin makes circular linking...
+     */
+    g_object_set( G_OBJECT(ctx->baseObj.bin), "vfsink" ,gst_element_factory_make("fakesink", "fakevfsink"), NULL );
+
+    /* Setup camerabin to produce raw video */
+    g_object_set( G_OBJECT(ctx->baseObj.bin), "videomux",NULL, NULL );
+    g_object_set( G_OBJECT(ctx->baseObj.bin), "videoenc",NULL, NULL );
+    g_object_set( G_OBJECT(ctx->baseObj.bin), "mute", TRUE, NULL );
+    g_object_set( G_OBJECT(ctx->baseObj.bin), "async-handling", FALSE, NULL);
+	g_object_set( G_OBJECT(ctx->baseObj.bin), "mode",(gint)1, NULL);
+
+
+    /* drive camerabin to READY to create the elements inside bin */
+    gst_element_set_state( GST_ELEMENT(ctx->baseObj.bin), GST_STATE_READY);
+
+    if(ctx->deviceID == XA_ADAPTID_VIDEOTESTSRC)
+    {   /* set properties for videotestsrc */
+        GstElement *testsrc = gst_bin_get_by_name(GST_BIN(ctx->baseObj.bin), "videotestsrc");
+        g_object_set( G_OBJECT(testsrc),"is-live", TRUE, NULL);
+        g_object_set( G_OBJECT(testsrc),"do-timestamp", TRUE, NULL);
+        gst_object_unref(G_OBJECT(testsrc));
+    }
+
+    /* do some filter optimization */
+#ifdef XA_USE_TEST_PLUGINS
+    g_object_set( G_OBJECT(ctx->baseObj.bin), "filter-caps",
+                    gst_caps_new_simple("video/x-raw-yuv",
+                                        "format", GST_TYPE_FOURCC,GST_MAKE_FOURCC('I','4','2','0'),
+                                        "framerate",GST_TYPE_FRACTION_RANGE,0,1,30,1, NULL)
+                ,NULL );
+#else
+    g_object_set( G_OBJECT(ctx->baseObj.bin), "filter-caps",
+                    gst_caps_new_simple("video/x-raw-yuv",
+                                        "format", GST_TYPE_FOURCC,GST_MAKE_FOURCC('Y','U','Y','2'),
+                                        "framerate",GST_TYPE_FRACTION_RANGE,0,1,30,1, NULL)
+                ,NULL );
+#endif
+
+
+    /* now, unlink fake sink, create camera post processing pipeline and create ghost pad from it */
+    {
+        GstElement *fakesink = gst_bin_get_by_name(GST_BIN(ctx->baseObj.bin),"fakevfsink");
+        GstPad *fakepad = gst_element_get_static_pad(fakesink,"sink");
+        GstPad *linkedpad = gst_pad_get_peer(fakepad);
+        GstElement *linkedelement = gst_pad_get_parent_element(linkedpad);
+        GstElement * cameraPP = NULL;
+        GstElement * camfilter = NULL;
+        GstElement *tee = NULL;
+
+        /* Unlink fakesink */
+        gst_element_unlink(linkedelement,fakesink);
+        /* Create VideoPP pipeline for Camera object */
+        cameraPP = XAAdaptationBase_CreateVideoPP();
+        g_object_set( G_OBJECT(cameraPP),"name", "videopp_camera", NULL);
+        gst_bin_add( GST_BIN(ctx->baseObj.bin), cameraPP );
+        /*Link videoPP into camera bin last element */
+        gst_element_link( linkedelement, cameraPP );
+
+        /* Add extra filter for caps negotiable after post processing*/
+        camfilter = gst_element_factory_make("capsfilter", "camfilter");
+        gst_bin_add( GST_BIN(ctx->baseObj.bin), camfilter );
+        gst_element_link( cameraPP, camfilter );
+
+        /* Add tee element into camerabin */
+        tee = gst_element_factory_make( "tee", "CamTee");
+        gst_bin_add( GST_BIN(ctx->baseObj.bin), tee);
+        gst_element_link( camfilter, tee );
+
+		/* Unref */
+        gst_object_unref(linkedelement);
+        gst_object_unref(linkedpad);
+        gst_object_unref(fakepad);
+        gst_bin_remove(GST_BIN(ctx->baseObj.bin),fakesink);
+        gst_object_unparent(GST_OBJECT(fakesink));
+    }
+
+    if ( ret == XA_RESULT_SUCCESS )
+    {
+    	cameraRealized = XA_BOOLEAN_TRUE;
+    }
+
+    DEBUG_API("<-XACameraAdapt_PostInit");
+    return ret;
+}
+
+/*
+ * void XACameraAdapt_Destroy(XACameraAdaptationCtx* ctx)
+ * Destroys Camera Adaptation Context
+ * @param ctx - Camera Adaptation context to be destroyed
+ */
+void XACameraAdapt_Destroy(XAAdaptationBaseCtx* bCtx)
+{
+	XACameraAdaptationCtx* ctx = NULL;
+
+	DEBUG_API("->XACameraAdapt_Destroy");
+	if(bCtx == NULL || bCtx->ctxId != XACameraAdaptation )
+	{
+		DEBUG_ERR("Invalid parameter!!");
+		DEBUG_API("<-XACameraAdapt_Destroy");
+		return;
+	}
+	ctx = (XACameraAdaptationCtx*)bCtx;
+
+    XAAdaptationBase_Free(&(ctx->baseObj));
+
+    free(ctx);
+    ctx = NULL;
+    cameraCtx = NULL;
+    cameraRealized = XA_BOOLEAN_FALSE;
+    DEBUG_API("<-XACameraAdapt_Destroy");
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xacameraadaptctx.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XACAMERAADAPTCTX_H
+#define XACAMERAADAPTCTX_H
+
+#include "XAAdaptationContextBase.h"
+
+/* TYPEDEFS */
+
+typedef struct XACameraAdaptationCtx_ XACameraAdaptationCtx;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XACameraAdapt_Create(XAuint32 deviceID);
+XAresult XACameraAdapt_PostInit(XAAdaptationBaseCtx* bCtx);
+void XACameraAdapt_Destroy(XAAdaptationBaseCtx* bCtx);
+
+#endif /* XACAMERAADAPTCTX_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xacameraitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,429 @@
+/*
+* 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 <gst.h>
+#include <photography.h>
+#include "XACameraAdaptCtx.h"
+#include "XACameraItfAdaptation.h"
+#include "XAAdaptation.h"
+
+
+/*
+ * XAresult XACameraItfAdapt_SetFlashMode( XAAdaptationBaseCtx *bCtx, XAuint32 flashMode );
+ */
+XAresult XACameraItfAdapt_SetFlashMode( XAAdaptationBaseCtx *bCtx, XAuint32 flashMode )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAAdaptEvent event = {XA_CAMERAITFEVENTS,XA_CAMERACBEVENT_FLASHREADY,0,0};
+    gint gstFlashmode;
+
+    DEBUG_API_A1("->XACameraItfAdapt_SetFlashMode 0x%x",(int)flashMode);
+    if(!bCtx || bCtx->ctxId != XACameraAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    switch( flashMode )
+    {
+         case XA_CAMERA_FLASHMODE_OFF:
+             gstFlashmode = GST_PHOTOGRAPHY_FLASH_MODE_OFF;
+             break;
+         case XA_CAMERA_FLASHMODE_ON:
+             gstFlashmode = GST_PHOTOGRAPHY_FLASH_MODE_ON;
+             break;
+         case XA_CAMERA_FLASHMODE_AUTO:
+             gstFlashmode = GST_PHOTOGRAPHY_FLASH_MODE_AUTO;
+             break;
+         case XA_CAMERA_FLASHMODE_REDEYEREDUCTION:
+             gstFlashmode = GST_PHOTOGRAPHY_FLASH_MODE_RED_EYE;
+             break;
+         case XA_CAMERA_FLASHMODE_FILLIN:
+             gstFlashmode = GST_PHOTOGRAPHY_FLASH_MODE_FILL_IN;
+             break;
+         case XA_CAMERA_FLASHMODE_TORCH:
+         case XA_CAMERA_FLASHMODE_REDEYEREDUCTION_AUTO:
+         default:
+             DEBUG_INFO("Mode not supported in GstPhotography!");
+             return XA_RESULT_PARAMETER_INVALID;
+             break;
+    }
+
+    if(GST_IS_PHOTOGRAPHY(bCtx->bin))
+    {
+        if ( !gst_photography_set_flash_mode( GST_PHOTOGRAPHY(bCtx->bin), gstFlashmode ) )
+        {
+            ret = XA_RESULT_INTERNAL_ERROR;
+        }
+    }
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        /* no gst event, senc cb now */
+        XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+    }
+
+    DEBUG_API("<-XACameraItfAdapt_SetFlashMode");
+    return ret;
+}
+
+/*
+ * XAresult XACameraItfAdapt_SetFocusMode( XAAdaptationBaseCtx *bCtx, XAuint32 focusMode,
+ *                                              XAmillimeter manualSetting,
+ *                                              XAboolean macroEnabled )
+ */
+XAresult XACameraItfAdapt_SetFocusMode( XAAdaptationBaseCtx *bCtx, XAuint32 focusMode,
+                                        XAmillimeter manualSetting, XAboolean macroEnabled )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAAdaptEvent event = {XA_CAMERAITFEVENTS,XA_CAMERACBEVENT_FOCUSSTATUS,1,NULL};
+    XAuint32 status;
+
+    DEBUG_API_A3("->XACameraItfAdapt_SetFocusMode - focusMode:%d, manualSetting:%d, macroEnabled:%d",
+                (int)focusMode, (int)manualSetting, (int)macroEnabled);
+    if(!bCtx || bCtx->ctxId != XACameraAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(GST_IS_PHOTOGRAPHY(bCtx->bin))
+    {
+        if ( focusMode == XA_CAMERA_FOCUSMODE_AUTO )
+        {
+            gst_photography_set_autofocus( GST_PHOTOGRAPHY(bCtx->bin), TRUE );
+            status = XA_CAMERA_FOCUSMODESTATUS_REQUEST;
+            event.data = &status;
+        }
+        else
+        {
+            /* Only auto focus supported in GstPhotography, other modes sets auto focus off */
+            DEBUG_INFO("No support in GstPhotography");
+            gst_photography_set_autofocus( GST_PHOTOGRAPHY(bCtx->bin), FALSE );
+            status = XA_CAMERA_FOCUSMODESTATUS_OFF;
+            event.data = &status;
+            ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
+    }
+    else
+    {
+        status = XA_CAMERA_FOCUSMODESTATUS_OFF;
+        event.data = &status;
+    }
+
+    if(event.data)
+    {
+        XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+    }
+
+    DEBUG_API("<-XACameraItfAdapt_SetFocusMode");
+    return ret;
+}
+
+/*
+ * XAresult XACameraItfAdapt_SetFocusRegionPattern( XAAdaptationBaseCtx *bCtx,
+ *                                                  XAuint32 focusPattern,
+ *                                                  XAuint32 activePoints1,
+ *                                                  XAuint32 activePoints2 )
+ */
+XAresult XACameraItfAdapt_SetFocusRegionPattern( XAAdaptationBaseCtx *bCtx, XAuint32 focusPattern,
+                                                    XAuint32 activePoints1, XAuint32 activePoints2 )
+{
+    DEBUG_API_A3("->XACameraItfAdapt_SetFocusRegionPattern - focusPattern:%d, activePoints1:%d, activePoints2:%d",
+                (int)focusPattern,(int)activePoints1,(int)activePoints2);
+    DEBUG_INFO("No support for focus region pattern in GstPhotography ");
+    DEBUG_API("<-XACameraItfAdapt_SetFocusRegionPattern");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+}
+
+/* XAresult XACameraItfAdapt_GetFocusRegionPositions( XAAdaptationBaseCtx *bCtx, XAuint32 *pNumPositionEntries,
+ *                                                    XAFocusPointPosition *pFocusPosition )
+ */
+XAresult XACameraItfAdapt_GetFocusRegionPositions( XAAdaptationBaseCtx *bCtx, XAuint32 *pNumPositionEntries,
+                                                   XAFocusPointPosition *pFocusPosition )
+{
+    DEBUG_API("->XACameraItfAdapt_GetFocusRegionPositions");
+    DEBUG_INFO("No focus region support in GstPhotography");
+    DEBUG_API("<-XACameraItfAdapt_GetFocusRegionPositions");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+}
+
+/*
+ * XAresult XACameraItfAdapt_SetMeteringMode( XAAdaptationBaseCtx *bCtx, XAuint32 meteringMode )
+ */
+XAresult XACameraItfAdapt_SetMeteringMode( XAAdaptationBaseCtx *bCtx, XAuint32 meteringMode )
+{
+    DEBUG_API_A1("->XACameraItfAdapt_SetMeteringMode - meteringMode:%d",(int)meteringMode);
+    DEBUG_INFO("No metering modes support in GstPhotography");
+    DEBUG_API("<-XACameraItfAdapt_SetMeteringMode");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+}
+
+/*
+ * XAresult XACameraItfAdapt_SetExposureMode( XAAdaptationBaseCtx *bCtx, XAuint32 exposure, XAuint32 compensation )
+ */
+XAresult XACameraItfAdapt_SetExposureMode( XAAdaptationBaseCtx *bCtx, XAuint32 exposure, XAuint32 compensation )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAAdaptEvent event = {XA_CAMERAITFEVENTS,XA_CAMERACBEVENT_EXPOSURESTATUS,1,NULL};
+    GstSceneMode expmode;
+
+    DEBUG_API_A2("->XACameraItfAdapt_SetExposureMode - exposure:%d, compensation:%d",
+                (int)exposure, (int)compensation);
+    if(!bCtx || bCtx->ctxId != XACameraAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    switch(exposure)
+    {
+        case XA_CAMERA_EXPOSUREMODE_AUTO:
+            expmode = GST_PHOTOGRAPHY_SCENE_MODE_AUTO;
+            break;
+        case XA_CAMERA_EXPOSUREMODE_SPORTS:
+            expmode = GST_PHOTOGRAPHY_SCENE_MODE_SPORT;
+            break;
+        case XA_CAMERA_EXPOSUREMODE_PORTRAIT:
+            expmode = GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT;
+            break;
+        case XA_CAMERA_EXPOSUREMODE_NIGHT:
+            expmode = GST_PHOTOGRAPHY_SCENE_MODE_NIGHT;
+            break;
+        default:
+            DEBUG_INFO("GstPhotography doesn't support other than manual settings");
+            ret = XA_RESULT_FEATURE_UNSUPPORTED;
+            break;
+    }
+
+    if(GST_IS_PHOTOGRAPHY(bCtx->bin)&&ret==XA_RESULT_SUCCESS)
+    {
+        if (!gst_photography_set_scene_mode( GST_PHOTOGRAPHY(bCtx->bin), expmode) )
+        {
+            ret = XA_RESULT_INTERNAL_ERROR;
+        }
+        else if (exposure == XA_CAMERA_EXPOSUREMODE_AUTO)
+        {
+            if (!gst_photography_set_ev_compensation( GST_PHOTOGRAPHY(bCtx->bin), compensation) )
+            {
+                ret = XA_RESULT_INTERNAL_ERROR;
+            }
+        }
+    }
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        event.data = &exposure;
+        XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+    }
+
+    DEBUG_API("<-XACameraItfAdapt_SetExposureMode");
+    return ret;
+}
+
+/*
+ * XAresult XACameraItfAdapt_SetISOSensitivity( XAAdaptationBaseCtx *bCtx, XAuint32 isoSensitivity, XAuint32 manualSetting )
+ */
+XAresult XACameraItfAdapt_SetISOSensitivity( XAAdaptationBaseCtx *bCtx, XAuint32 isoSensitivity, XAuint32 manualSetting )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API_A2("->XACameraItfAdapt_SetISOSensitivity - isoSensitivity:%d, manualSetting:%d",
+                (int)isoSensitivity, (int)manualSetting);
+    if(!bCtx || bCtx->ctxId != XACameraAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if ( isoSensitivity ==  XA_CAMERA_ISOSENSITIVITYMODE_MANUAL)
+    {
+        if(GST_IS_PHOTOGRAPHY(bCtx->bin))
+        {
+            if ( !gst_photography_set_iso_speed (GST_PHOTOGRAPHY(bCtx->bin), manualSetting ) )
+            {
+                ret = XA_RESULT_INTERNAL_ERROR;
+            }
+        }
+    }
+    else
+    {
+        DEBUG_INFO("Iso sensitivity auto not supported in GstPhotography, stubbed value");
+        ret = XA_RESULT_SUCCESS;
+    }
+
+    DEBUG_API("<-XACameraItfAdapt_SetISOSensitivity");
+    return ret;
+}
+
+/*
+ * XAresult XACameraItfAdapt_SetAperture( XAAdaptationBaseCtx *bCtx, XAuint32 aperture, XAuint32 manualSetting )
+ */
+XAresult XACameraItfAdapt_SetAperture( XAAdaptationBaseCtx *bCtx, XAuint32 aperture, XAuint32 manualSetting )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API_A2("->XACameraItfAdapt_SetAperture - aperture:%d, manualSetting:%d",
+                (int)aperture, (int)manualSetting);
+    if(!bCtx || bCtx->ctxId != XACameraAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if ( aperture == XA_CAMERA_APERTUREMODE_MANUAL )
+    {
+        if(GST_IS_PHOTOGRAPHY(bCtx->bin))
+        {
+            if (!gst_photography_set_aperture ( GST_PHOTOGRAPHY(bCtx->bin), manualSetting) )
+            {
+                ret = XA_RESULT_INTERNAL_ERROR;
+            }
+        }
+    }
+    else
+    {
+        DEBUG_INFO("GstPhotography doesn't support auto aperture settings");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+    }
+
+    DEBUG_API("<-XACameraItfAdapt_SetAperture");
+    return ret;
+}
+
+/*
+ * XAresult XACameraItfAdapt_SetShutterSpeed( XAAdaptationBaseCtx *bCtx, XAuint32 shutterSpeed, XAmicrosecond manualSetting )
+ */
+XAresult XACameraItfAdapt_SetShutterSpeed( XAAdaptationBaseCtx *bCtx, XAuint32 shutterSpeed, XAmicrosecond manualSetting )
+{
+    DEBUG_API_A2("->XACameraItfAdapt_SetShutterSpeed - shutterSpeed:%d, manualSetting:%d",
+                (int)shutterSpeed, (int)manualSetting);
+    DEBUG_INFO("Shutter speed setting not supported in GstPhotography");
+    DEBUG_API("<-XACameraItfAdapt_SetShutterSpeed");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+}
+
+/*
+ * XAresult XACameraItfAdapt_SetWhiteBalance( XAAdaptationBaseCtx *bCtx, XAuint32 whiteBalance, XAuint32 manualSetting )
+ */
+XAresult XACameraItfAdapt_SetWhiteBalance( XAAdaptationBaseCtx *bCtx, XAuint32 whiteBalance, XAuint32 manualSetting )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    GstWhiteBalanceMode gstWbMode;
+
+    DEBUG_API_A2("->XACameraItfAdapt_SetWhiteBalance - whiteBalance:%d, manualSetting:%d",
+                (int)whiteBalance, (int)manualSetting);
+    if(!bCtx || bCtx->ctxId != XACameraAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    switch ( whiteBalance )
+    {
+    case XA_CAMERA_WHITEBALANCEMODE_AUTO:
+        gstWbMode = GST_PHOTOGRAPHY_WB_MODE_AUTO;
+        break;
+    case XA_CAMERA_WHITEBALANCEMODE_SUNLIGHT:
+        gstWbMode = GST_PHOTOGRAPHY_WB_MODE_DAYLIGHT;
+        break;
+    case XA_CAMERA_WHITEBALANCEMODE_CLOUDY:
+        gstWbMode = GST_PHOTOGRAPHY_WB_MODE_CLOUDY;
+        break;
+    case XA_CAMERA_WHITEBALANCEMODE_TUNGSTEN:
+        gstWbMode = GST_PHOTOGRAPHY_WB_MODE_TUNGSTEN;
+        break;
+    case XA_CAMERA_WHITEBALANCEMODE_FLUORESCENT:
+        gstWbMode = GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT;
+        break;
+    case XA_CAMERA_WHITEBALANCEMODE_SUNSET:
+        gstWbMode = GST_PHOTOGRAPHY_WB_MODE_SUNSET;
+        break;
+    case XA_CAMERA_WHITEBALANCEMODE_INCANDESCENT:
+    case XA_CAMERA_WHITEBALANCEMODE_FLASH:
+    case XA_CAMERA_WHITEBALANCEMODE_MANUAL:
+    case XA_CAMERA_WHITEBALANCEMODE_SHADE:
+        DEBUG_INFO("Wanted white balance mode not supported!");
+        return XA_RESULT_FEATURE_UNSUPPORTED;
+        break;
+    default:
+        break;
+    }
+
+    if(GST_IS_PHOTOGRAPHY(bCtx->bin))
+    {
+        if ( !gst_photography_set_white_balance_mode( GST_PHOTOGRAPHY(bCtx->bin), gstWbMode ) )
+        {
+            ret = XA_RESULT_INTERNAL_ERROR;
+        }
+    }
+
+    DEBUG_API("<-XACameraItfAdapt_SetWhiteBalance");
+    return ret;
+}
+
+/*
+ * XAresult XACameraItfAdapt_SetAutoLocks( XAAdaptationBaseCtx *bCtx, XAuint32 locks )
+ */
+XAresult XACameraItfAdapt_SetAutoLocks( XAAdaptationBaseCtx *bCtx, XAuint32 locks )
+{
+    DEBUG_API_A1("->XACameraItfAdapt_SetAutoLocks - locks:%d", (int)locks);
+    DEBUG_INFO("No autolocks support in GstPhotography")
+    DEBUG_API("<-XACameraItfAdapt_SetAutoLocks");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+}
+
+/*
+ * XAresult XACameraItfAdapt_SetZoom( XAAdaptationBaseCtx *bCtx, XAuint32 zoom, XAboolean digitalEnabled, XAuint32 speed, XAboolean async )
+ */
+XAresult XACameraItfAdapt_SetZoom( XAAdaptationBaseCtx *bCtx, XAuint32 zoom, XAboolean digitalEnabled, XAuint32 speed, XAboolean async )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAAdaptEvent event = {XA_CAMERAITFEVENTS,XA_CAMERACBEVENT_ZOOMSTATUS,1,NULL};
+    gint gstZoom;
+
+    DEBUG_API_A4("->XACameraItfAdapt_SetZoom - zoom:%d,digitalEnabled:%d,speed:%d,async:%d ",
+                    (int)zoom,(int)digitalEnabled,(int)speed,(int)async);
+    if(!bCtx || bCtx->ctxId != XACameraAdaptation || zoom < 1 )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if ( zoom > 10 )
+    {
+        gstZoom = MAX_ZOOM;
+    }
+    else
+    {
+        /* Gst Zoom range 100 - 1000, 100 = 1x, 200 = 2x, ...*/
+        gstZoom = zoom * 100;
+    }
+    if(GST_IS_PHOTOGRAPHY(bCtx->bin))
+    {
+        if ( !gst_photography_set_zoom( GST_PHOTOGRAPHY(bCtx->bin), gstZoom ) )
+        {
+            ret = XA_RESULT_INTERNAL_ERROR;
+        }
+    }
+    if( ret == XA_RESULT_SUCCESS && async )
+    {
+        /* no gst event, send cb now*/
+        event.data = &zoom;
+        XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+    }
+
+    DEBUG_API("<-XACameraItfAdapt_SetZoom");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xacameraitfadaptation.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XACAMERAITFADAPTATION_H_
+#define XACAMERAITFADAPTATION_H_
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+#define MAX_ZOOM 1000;
+
+/* FUNCTIONS */
+
+XAresult XACameraItfAdapt_SetFlashMode( XAAdaptationBaseCtx *bCtx, XAuint32 flashMode );
+XAresult XACameraItfAdapt_SetFocusMode( XAAdaptationBaseCtx *bCtx, XAuint32 focusMode, XAmillimeter manualSetting, XAboolean macroEnabled );
+XAresult XACameraItfAdapt_SetFocusRegionPattern( XAAdaptationBaseCtx *bCtx, XAuint32 focusPattern, XAuint32 activePoints1, XAuint32 activePoints2 );
+XAresult XACameraItfAdapt_GetFocusRegionPositions( XAAdaptationBaseCtx *bCtx, XAuint32 *pNumPositionEntries, XAFocusPointPosition *pFocusPosition );
+XAresult XACameraItfAdapt_SetMeteringMode( XAAdaptationBaseCtx *bCtx, XAuint32 meteringMode );
+XAresult XACameraItfAdapt_SetExposureMode( XAAdaptationBaseCtx *bCtx, XAuint32 exposure, XAuint32 compensation );
+XAresult XACameraItfAdapt_SetISOSensitivity( XAAdaptationBaseCtx *bCtx, XAuint32 isoSensitivity, XAuint32 manualSetting );
+XAresult XACameraItfAdapt_SetAperture( XAAdaptationBaseCtx *bCtx, XAuint32 aperture, XAuint32 manualSetting );
+XAresult XACameraItfAdapt_SetShutterSpeed( XAAdaptationBaseCtx *bCtx, XAuint32 shutterSpeed, XAmicrosecond manualSetting );
+XAresult XACameraItfAdapt_SetWhiteBalance( XAAdaptationBaseCtx *bCtx, XAuint32 whiteBalance, XAuint32 manualSetting );
+XAresult XACameraItfAdapt_SetAutoLocks( XAAdaptationBaseCtx *bCtx, XAuint32 locks );
+XAresult XACameraItfAdapt_SetZoom( XAAdaptationBaseCtx *bCtx, XAuint32 zoom, XAboolean digitalEnabled, XAuint32 speed, XAboolean async );
+
+#endif /* XACAMERAITFADAPTATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xadevicevolumeitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,144 @@
+/*
+* 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 <gst.h>
+#include <mixer.h>
+#include "XADeviceVolumeItfAdaptation.h"
+#include "XAEngineAdaptCtx.h"
+#include "XAAdaptation.h"
+#include "XAStaticCapsAdaptation.h"
+
+
+/* XAresult XADeviceVolumeItfAdapt_SetVolume
+ * Description: Sets the device's volume.
+ */
+XAresult XADeviceVolumeItfAdapt_SetVolume(XAAdaptationBaseCtx *bCtx, XAuint32 deviceID, XAint32 volume)
+{
+    XAEngineAdaptationCtx* ctx = NULL;
+    GstElement* amixer = NULL;
+    GstMixerTrack *mixerTrack = NULL;
+    const GList *gList = NULL;
+    gint volumeIdx = 0;
+
+    DEBUG_API("->XADeviceVolumeItfAdapt_SetVolume");
+
+    if(!bCtx )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XADeviceVolumeItfAdapt_SetVolume");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    ctx = (XAEngineAdaptationCtx*) bCtx;
+
+    amixer = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "alsamixer");
+    if( !amixer )
+    {
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("<-XADeviceVolumeItfAdapt_SetVolume");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    gList = gst_mixer_list_tracks( GST_MIXER(amixer) );
+    if( !gList )
+    {
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("<-XADeviceVolumeItfAdapt_SetVolume");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    while( gList )
+    {
+        mixerTrack = (GstMixerTrack*)gList->data;
+        if( !mixerTrack )
+        {
+            DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+            DEBUG_API("<-XADeviceVolumeItfAdapt_SetVolume");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+
+        if( ((mixerTrack->flags & GST_MIXER_TRACK_INPUT ) && deviceID == XA_DEFAULTDEVICEID_AUDIOINPUT) ||
+//            ((mixerTrack->flags & GST_MIXER_TRACK_INPUT ) && deviceID == XA_ADAPTID_ALSASRC) || //krishna
+                ((mixerTrack->flags & GST_MIXER_TRACK_INPUT ) && deviceID == XA_ADAPTID_DEVSOUNDSRC) ||
+            ((mixerTrack->flags & GST_MIXER_TRACK_INPUT ) && deviceID == XA_ADAPTID_AUDIOTESTSRC) ||
+            ((mixerTrack->flags & GST_MIXER_TRACK_OUTPUT ) && deviceID == XA_DEFAULTDEVICEID_AUDIOOUTPUT) ||
+            ((mixerTrack->flags & GST_MIXER_TRACK_OUTPUT ) && deviceID == XA_ADAPTID_JACKSINK) ||
+//            ((mixerTrack->flags & GST_MIXER_TRACK_OUTPUT ) && deviceID == XA_ADAPTID_ALSASINK) )
+            ((mixerTrack->flags & GST_MIXER_TRACK_OUTPUT ) && deviceID == XA_ADAPTID_DEVSOUNDSINK) )
+        {
+            gint *gVolume = calloc(mixerTrack->num_channels, sizeof(gint) );
+            if( !gVolume )
+            {
+                DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+                DEBUG_API("<-XADeviceVolumeItfAdapt_SetVolume");
+                return XA_RESULT_MEMORY_FAILURE;
+            }
+
+            for( volumeIdx = 0; volumeIdx < mixerTrack->num_channels; volumeIdx++ )
+            {
+                /* Set same volume level for all channels */
+                gVolume[volumeIdx] = (gint)volume;
+            }
+
+            /* found master track */
+            gst_mixer_set_volume( GST_MIXER(amixer), mixerTrack, gVolume );
+            free( gVolume );
+            gVolume = NULL;
+            break;
+        }
+        gList = g_list_next(gList);
+    }
+    if ( amixer )
+    {
+        gst_object_unref( GST_OBJECT(amixer));
+    }
+
+    DEBUG_API("<-XADeviceVolumeItfAdapt_SetVolume");
+    return XA_RESULT_SUCCESS;
+}
+
+/* XAresult XADeviceVolumeItfAdapt_IsDeviceIDSupported
+ * Description: Check is request device ID supported.
+ */
+XAresult XADeviceVolumeItfAdapt_IsDeviceIDSupported(XAAdaptationBaseCtx *bCtx, XAuint32 deviceID, XAboolean *isSupported)
+{
+    DEBUG_API("->XADeviceVolumeItfAdapt_IsDeviceIDSupported");
+
+    if(!bCtx || !isSupported )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XADeviceVolumeItfAdapt_IsDeviceIDSupported");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is device ID supported or not supported */
+//    if( deviceID == XA_DEFAULTDEVICEID_AUDIOINPUT || deviceID == XA_ADAPTID_ALSASRC ||
+    if( deviceID == XA_DEFAULTDEVICEID_AUDIOINPUT || deviceID == XA_ADAPTID_DEVSOUNDSRC ||
+        deviceID == XA_ADAPTID_AUDIOTESTSRC || deviceID == XA_DEFAULTDEVICEID_AUDIOOUTPUT ||
+//        deviceID == XA_ADAPTID_JACKSINK || deviceID == XA_ADAPTID_ALSASINK )
+        deviceID == XA_ADAPTID_JACKSINK || deviceID == XA_ADAPTID_DEVSOUNDSINK )
+    {
+        *isSupported = XA_BOOLEAN_TRUE;
+    }
+    else
+    {
+        *isSupported = XA_BOOLEAN_FALSE;
+    }
+
+    DEBUG_API("<-XADeviceVolumeItfAdapt_IsDeviceIDSupported");
+    return XA_RESULT_SUCCESS;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xadevicevolumeitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XADEVICEVOLUMEITFADAPTATION_H_
+#define XADEVICEVOLUMEITFADAPTATION_H_
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+
+/* FUNCTIONS */
+XAresult XADeviceVolumeItfAdapt_SetVolume( XAAdaptationBaseCtx *bCtx, XAuint32 deviceID, XAint32 volume);
+XAresult XADeviceVolumeItfAdapt_IsDeviceIDSupported(XAAdaptationBaseCtx *bCtx, XAuint32 deviceID, XAboolean *isSupported);
+#endif /* XADEVICEVOLUMEITFADAPTATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xadynamicsourceitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,103 @@
+/*
+* 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 <gst.h>
+#include "XAAdaptation.h"
+#include "XAMediaPlayerAdaptCtx.h"
+#include "XADynamicSourceItfAdaptation.h"
+
+/*
+ * XAresult XADynamicSourceItfAdapt_SetSource(XAAdaptationBaseCtx *bCtx, XADataSource *pDataSource)
+ * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID value
+ * @param XADataSource *pDataSource - new data source
+ * @return XAresult ret - Success value
+ */
+XAresult XADynamicSourceItfAdapt_SetSource(XAAdaptationBaseCtx *bCtx, XADataSource *pDataSource)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XADynamicSourceItfAdapt_SetSource");
+    if( !bCtx || !pDataSource || !pDataSource->pLocator )
+    {
+        DEBUG_ERR("Invalid NULL parameter");
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    else if(bCtx->ctxId == XAMediaPlayerAdaptation || bCtx->ctxId == XAMDAdaptation )
+    {
+        XAMediaPlayerAdaptationCtx* mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+        GstStateChangeReturn gret;
+        GstState origState;
+        GstElement* newSource = XAAdaptationBase_CreateGstSource( pDataSource, "datasrc", &(mCtx->isobjsrc), NULL, NULL);
+        if(!newSource)
+        {
+            DEBUG_ERR("Could not create data source!!!");
+            return XA_RESULT_CONTENT_NOT_FOUND;
+        }
+        DEBUG_INFO("Changing Playback Source");
+        /* store current state */
+        origState = GST_STATE(bCtx->bin);
+        /* unroll pipeline */
+        bCtx->binWantedState = GST_STATE_NULL;
+        XAAdaptationBase_PrepareAsyncWait(bCtx);
+        gret = gst_element_set_state( GST_ELEMENT(bCtx->bin), bCtx->binWantedState);
+        if( gret == GST_STATE_CHANGE_ASYNC )
+        {
+            DEBUG_INFO("Wait for unroll");
+            XAAdaptationBase_StartAsyncWait(bCtx);
+            DEBUG_INFO("Unroll ready");
+        }
+        else if( gret == GST_STATE_CHANGE_FAILURE )
+        {   /*not much we can do*/
+             DEBUG_ERR("WARNING: Failed to unroll pipeline!!")
+             return XA_RESULT_INTERNAL_ERROR;
+        }
+        bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
+
+        /* set new source */
+        gst_element_unlink(mCtx->source,mCtx->codecbin);
+        gst_bin_remove(GST_BIN(bCtx->bin), mCtx->source);
+        mCtx->source = newSource;
+        gst_bin_add(GST_BIN(bCtx->bin), mCtx->source);
+        gst_element_link(mCtx->source, mCtx->codecbin);
+        mCtx->xaSource = pDataSource;
+
+        /* restore pipeline state */
+        bCtx->binWantedState = origState;
+        DEBUG_INFO_A1("Changing pipeline back to state %s",gst_element_state_get_name(origState));
+        XAAdaptationBase_PrepareAsyncWait(bCtx);
+        gret = gst_element_set_state( GST_ELEMENT(bCtx->bin), bCtx->binWantedState);
+        if( gret == GST_STATE_CHANGE_ASYNC )
+        {
+            DEBUG_INFO("Wait for state change");
+            XAAdaptationBase_StartAsyncWait(bCtx);
+        }
+        else if( gret == GST_STATE_CHANGE_FAILURE )
+        {
+            DEBUG_ERR("State change FAILED");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+        bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
+        DEBUG_INFO_A1("Pipeline in state %s",gst_element_state_get_name(GST_STATE(bCtx->bin)));
+
+        if( GST_STATE(bCtx->bin) > GST_STATE_READY )
+        {   /* let (possible) extraction itf to know new tags  */
+            XAAdaptEvent event = {XA_METADATAEVENTS, XA_ADAPT_MDE_TAGS_AVAILABLE, 0, NULL };
+            XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+        }
+    }
+    DEBUG_API("<-XADynamicSourceItfAdapt_SetSource");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xadynamicsourceitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XADYNAMICSOURCEITFADAPTATION_H
+#define XADYNAMICSOURCEITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+/* FUNCTIONS */
+
+XAresult XADynamicSourceItfAdapt_SetSource(XAAdaptationBaseCtx *bCtx, XADataSource *pDataSource);
+
+#endif /* XADYNAMICSOURCEITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaengineadaptctx.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,178 @@
+/*
+* 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 <string.h>
+#include <gst.h>
+#include "XAEngineAdaptCtx.h"
+#include "XAAdaptation.h"
+
+/*
+ * gboolean XAEngineAdapt_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+ * MediaPlayer Gst-bus message handler (Callback)
+ */
+gboolean XAEngineAdapt_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+{
+    XAEngineAdaptationCtx* mCtx = (XAEngineAdaptationCtx*)data;
+    DEBUG_API("->XAEngineAdapt_GstBusCb");
+
+    /* only listen to pipeline messages */
+    if(GST_MESSAGE_SRC(message)==(GstObject*)(mCtx->baseObj.bin) )
+    {
+        DEBUG_API_A2("->XAEngineAdapt_GstBusCb:\"%s\" from object \"%s\"",
+                        GST_MESSAGE_TYPE_NAME(message), GST_OBJECT_NAME(GST_MESSAGE_SRC(message)));
+    }
+
+    DEBUG_API("<-XAEngineAdapt_GstBusCb");
+    return TRUE;
+}
+
+/*
+ * XAAdaptationBaseCtx* XAEngineAdapt_Create()
+ * Allocates memory for Engine Adaptation Context and makes 1st phase initialization
+ * @returns XAEngineAdaptationCtx* - Pointer to created context
+ */
+XAAdaptationBaseCtx* XAEngineAdapt_Create()
+{
+    XAEngineAdaptationCtx *pSelf = NULL;
+    DEBUG_API("->XAEngineAdapt_Create");
+
+    pSelf = calloc(1, sizeof(XAEngineAdaptationCtx));
+    if ( pSelf)
+    {
+        if( XAAdaptationBase_Init(&(pSelf->baseObj),XAEngineAdaptation)
+                    != XA_RESULT_SUCCESS )
+            {
+                DEBUG_ERR("Failed to init base context!!!");
+                free(pSelf);
+                pSelf = NULL;
+            }
+            else
+            {
+                /* Init internal variables */
+            }
+    }
+
+    DEBUG_API("<-XAEngineAdapt_Create");
+    return (XAAdaptationBaseCtx*)pSelf;
+}
+
+/*
+ * XAresult XAEngineAdapt_PostInit()
+ * 2nd phase initialization of engine Adaptation Context
+ */
+XAresult XAEngineAdapt_PostInit(XAAdaptationBaseCtx* bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    GstStateChangeReturn gret = GST_STATE_CHANGE_SUCCESS;
+    XAEngineAdaptationCtx* ctx = NULL;
+
+    DEBUG_API("->XAEngineAdapt_PostInit");
+    if( !bCtx || bCtx->ctxId != XAEngineAdaptation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEngineAdapt_PostInit");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    ctx = (XAEngineAdaptationCtx*)bCtx;
+
+    if ( !ctx )
+    {
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("<-XAEngineAdapt_PostInit");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    XAAdaptationBase_PostInit( &(ctx->baseObj) );
+
+    ctx->baseObj.bin = gst_pipeline_new("engine");
+   // gst_bin_add(GST_BIN(ctx->baseObj.bin), gst_element_factory_make( "alsamixer", "alsamixer"));
+
+    if ( !ctx->baseObj.bin )
+    {
+        DEBUG_ERR("Failed to create alsamixer");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("<-XAEngineAdapt_PostInit");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    /* Create Gst bus listener. */
+    ret = XAAdaptationBase_InitGstListener(&(ctx->baseObj));
+    if( ret!=XA_RESULT_SUCCESS )
+    {
+        DEBUG_ERR_A1("Bus listener creation failed!! - (%d)", ret);
+        DEBUG_API("<-XAEngineAdapt_PostInit");
+        return ret;
+    }
+
+    /* Add Engine specific handler */
+    if(ctx->baseObj.bus)
+    {
+        ctx->baseObj.busCb = XAEngineAdapt_GstBusCb;
+    }
+    else
+    {
+        DEBUG_ERR("Failed to create message bus");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("<-XAEngineAdapt_PostInit");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    /* roll up bin */
+    ctx->baseObj.binWantedState = GST_STATE_PAUSED;
+    XAAdaptationBase_PrepareAsyncWait(&(ctx->baseObj));
+    gret = gst_element_set_state( GST_ELEMENT(ctx->baseObj.bin), ctx->baseObj.binWantedState);
+    if( gret == GST_STATE_CHANGE_ASYNC )
+    {
+        DEBUG_INFO("Wait for preroll");
+        XAAdaptationBase_StartAsyncWait(&(ctx->baseObj));
+        DEBUG_INFO("Preroll ready");
+    }
+    ctx->baseObj.waitingasyncop = XA_BOOLEAN_FALSE;
+
+    ret = XAStaticCapsAdapt_InitCaps();
+
+    DEBUG_API("<-XAEngineAdapt_PostInit");
+    return ret;
+}
+
+/*
+ * void XAEngineAdapt_Destroy(XAEngineAdaptationCtx* ctx)
+ * Destroys Engine Adaptation Context
+ * @param ctx - Engine Adaptation context to be destroyed
+ */
+void XAEngineAdapt_Destroy(XAAdaptationBaseCtx* bCtx)
+{
+	XAEngineAdaptationCtx* ctx = NULL;
+
+	DEBUG_API("->XAEngineAdapt_Destroy");
+	if( !bCtx || bCtx->ctxId != XAEngineAdaptation )
+	{
+		DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+		DEBUG_API("<-XAEngineAdapt_Destroy");
+		return;
+	}
+	ctx = (XAEngineAdaptationCtx*)bCtx;
+
+    XAAdaptationBase_Free(&(ctx->baseObj));
+
+/*    gst_deinit(); */
+
+    free(ctx);
+    ctx = NULL;
+
+    DEBUG_API("<-XAEngineAdapt_Destroy");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaengineadaptctx.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAENGINEADAPTCTX_H_
+#define XAENGINEADAPTCTX_H_
+
+#include "XAAdaptationContextBase.h"
+#include "XAStaticCapsAdaptation.h"
+
+/* TYPEDEFS */
+
+typedef struct XAEngineAdaptationCtx_ XAEngineAdaptationCtx;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XAEngineAdapt_Create();
+XAresult XAEngineAdapt_PostInit(XAAdaptationBaseCtx* bCtx);
+void XAEngineAdapt_Destroy(XAAdaptationBaseCtx* bCtx);
+
+#endif /* XAENGINEADAPTCTX_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaequalizeritfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,336 @@
+/*
+* 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 <gst.h>
+#include "XAAdaptation.h"
+#include "XAMediaPlayerAdaptCtx.h"
+#include "XAMediaRecorderAdaptCtx.h"
+#include "XAOutputMixAdaptCtx.h"
+#include "XAEqualizerItfAdaptation.h"
+#include "XAStaticCapsAdaptation.h"
+
+static const XAmilliHertz centerFrequencies[EQUALIZER_NUM_OF_BANDS] = {
+        29000, 59000, 119000, 227000, 474000,
+        947000, 1889000, 3770000, 7523000, 15011000 };
+
+static const char* band_names[EQUALIZER_NUM_OF_BANDS] = {
+        "band0", "band1", "band2", "band3", "band4",
+        "band5", "band6", "band7", "band8", "band9" };
+
+static const XAmilliHertz bandFreqRangeMin = 0;
+static const XAmilliHertz bandFreqRangeMax = 0;
+static const XAmillibel bandLevelRangeMin = -2400;
+static const XAmillibel bandLevelRangeMax = 1200;
+
+
+/*
+ * XAresult XAEqualizerItfAdapt_GetBandLevelRange(XAAdaptationBaseCtx *bCtx,
+ *                                                XAmillibel *pMin,
+ *                                                XAmillibel *pMax)
+ */
+XAresult XAEqualizerItfAdapt_GetBandLevelRange(XAAdaptationBaseCtx *bCtx,
+                                               XAmillibel *pMin,
+                                               XAmillibel *pMax)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAEqualizerItfAdapt_GetBandLevelRange");
+
+    if( (!pMin && !pMax) ) /* other may be NULL */
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if (pMin)
+    {
+        *pMin = bandLevelRangeMin;
+    }
+    if (pMax)
+    {
+        *pMax = bandLevelRangeMax;
+    }
+
+    DEBUG_API("<-XAEqualizerItfAdapt_GetBandLevelRange");
+    return ret;
+}
+
+/*
+ * XAresult XAEqualizerItfAdapt_SetBandLevel(XAAdaptationBaseCtx *bCtx,
+ *                                           XAuint16 band,
+ *                                           XAmillibel level)
+ */
+XAresult XAEqualizerItfAdapt_SetBandLevel(XAAdaptationBaseCtx *bCtx,
+                                          XAuint16 band,
+                                          XAmillibel level)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    GstElement *equ=NULL, *audiopp=NULL;
+    DEBUG_API("->XAEqualizerItfAdapt_SetBandLevel");
+
+    if(!bCtx ||
+        band >= EQUALIZER_NUM_OF_BANDS  ||
+        level < bandLevelRangeMin ||
+        level > bandLevelRangeMax)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if( bCtx->ctxId == XAMediaPlayerAdaptation || bCtx->ctxId == XAMediaRecorderAdaptation )
+        {
+            audiopp = gst_bin_get_by_name( GST_BIN(bCtx->bin), "audiopp" );
+            equ = gst_bin_get_by_name( GST_BIN(audiopp), "pp_equ" );
+            if(equ)
+            {
+                g_object_set( G_OBJECT(equ), band_names[band], (gdouble)(level/1000), NULL );
+            }
+            else
+            {
+                DEBUG_ERR("Media object equalizer element not found!!");
+            }
+        }
+        else if( bCtx->ctxId == XAOutputMixAdaptation )
+        {
+    	    XAOutputMixAdaptationCtx* context = (XAOutputMixAdaptationCtx*) bCtx;
+    	    guint iterator;
+    	    for ( iterator = 0; iterator < context->connectedObjects->len; iterator++ )
+            {
+                GstBin* basebin = GST_BIN(g_array_index(context->connectedObjects,XAOMixAdaptConnObj,iterator).ctx->bin);
+                equ=NULL;
+                audiopp=NULL;
+                audiopp = gst_bin_get_by_name( basebin, "audiopp" );
+                if(audiopp)
+                {
+                    equ = gst_bin_get_by_name( GST_BIN(audiopp), "pp_equ" );
+                }
+                if(equ)
+                {
+                    g_object_set( G_OBJECT(equ), band_names[band], (gdouble)(level/1000), NULL );
+                }
+                else
+                {
+                    DEBUG_ERR_A1("Could not find equalizer for player %u!!", iterator);
+                }
+            }
+        }
+        else
+        {
+            DEBUG_ERR_A1("Not supported adaptation element: %d", bCtx->ctxId);
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+    }
+    if(equ)
+    {
+        gst_object_unref(equ);
+    }
+	if(audiopp)
+    {
+        gst_object_unref(audiopp);
+    }
+	
+    DEBUG_API("<-XAEqualizerItfAdapt_SetBandLevel");
+    return ret;
+}
+
+/*
+ * XAresult XAEqualizerItfAdapt_GetCenterFreq(XAAdaptationBaseCtx *bCtx,
+ *                                            XAuint16 band,
+ *                                            XAmilliHertz *pCenter)
+ */
+
+XAresult XAEqualizerItfAdapt_GetCenterFreq(XAAdaptationBaseCtx *bCtx,
+                                           XAuint16 band,
+                                           XAmilliHertz *pCenter)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAEqualizerItfAdapt_GetCenterFreq");
+
+    if(!pCenter || band >= EQUALIZER_NUM_OF_BANDS)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pCenter = centerFrequencies[band];
+
+    DEBUG_API("<-XAEqualizerItfAdapt_GetCenterFreq");
+    return ret;
+}
+
+/*
+ * XAresult XAEqualizerItfAdapt_GetBandFreqRange(XAAdaptationBaseCtx *bCtx,
+ *                                               XAuint16 band,
+ *                                               XAmilliHertz *pMin,
+ *                                               XAmilliHerts *pMax)
+ */
+XAresult XAEqualizerItfAdapt_GetBandFreqRange(XAAdaptationBaseCtx *bCtx,
+                                              XAuint16 band,
+                                              XAmilliHertz *pMin,
+                                              XAmilliHertz *pMax)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAEqualizerItfAdapt_GetBandFreqRange");
+
+    /* pMin or pMax may be NULL */
+    if((!pMin && !pMax)  || band >= EQUALIZER_NUM_OF_BANDS)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* in this implementation there are no ranges */
+    if (pMin)
+    {
+        *pMin = centerFrequencies[band];
+    }
+    if (pMax)
+    {
+        *pMax = centerFrequencies[band];
+    }
+
+    DEBUG_API("<-XAEqualizerItfAdapt_GetBandFreqRange");
+    return ret;
+}
+
+/*
+ * XAresult XAEqualizerItfAdapt_GetBand(XAAdaptationBaseCtx *bCtx,
+ *                                      XAmilliHertz frequency,
+ *                                      XAuint16 *pBand)
+ */
+XAresult XAEqualizerItfAdapt_GetBand(XAAdaptationBaseCtx *bCtx,
+                                     XAmilliHertz frequency,
+                                     XAuint16 *pBand)
+{
+    XAuint16 index=0;
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAEqualizerItfAdapt_GetBand");
+
+    if(!pBand)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pBand = XA_EQUALIZER_UNDEFINED;
+
+    /* as there are no ranges, it must match exactly */
+    for (index = 0; index < EQUALIZER_NUM_OF_BANDS; index++)
+    {
+        if (frequency == centerFrequencies[index])
+        {
+            *pBand = index;
+            break;
+        }
+    }
+
+    DEBUG_API("<-XAEqualizerItfAdapt_GetBand");
+    return ret;
+}
+
+/*
+ * XAresult XAEqualizerItfAdapt_GetDefaultBandLevel(XAAdaptationBaseCtx *bCtx,
+ *                                           XAuint16 band,
+ *                                           XAmillibel *pLevel)
+ */
+XAresult XAEqualizerItfAdapt_GetDefaultBandLevel(XAAdaptationBaseCtx *bCtx,
+                                                 XAuint16 band,
+                                                 XAmillibel *pLevel)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAEqualizerItfAdapt_GetDefaultBandLevel");
+
+    if(!pLevel)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    pLevel = EQUALIZER_DEFAULT_BAND_LEVEL;
+
+    DEBUG_API("<-XAEqualizerItfAdapt_GetDefaultBandLevel");
+    return ret;
+}
+/*
+ * XAresult XAEqualizerItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adapCtx)
+ * Description: Safety thread entry
+ */
+XAresult XAEqualizerItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adaptCtx)
+{
+    DEBUG_API("->XAEqualizerItfAdapt_ThreadEntry");
+    if((!adaptCtx ) ||( adaptCtx->ctxId != XAMediaPlayerAdaptation &&
+                        adaptCtx->ctxId != XAMediaRecorderAdaptation &&
+                        adaptCtx->ctxId != XAOutputMixAdaptation ))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfAdapt_ThreadEntry");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+
+    }
+
+    if ( adaptCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaPlayer);
+    }
+    else if( adaptCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+    }
+    else if (adaptCtx->ctxId == XAOutputMixAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSOutputMix);
+    }
+
+    DEBUG_API("<-XAEqualizerItfAdapt_ThreadEntry");
+    return XA_RESULT_SUCCESS;
+}
+/*
+ * XAresult XAEqualizerItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx)
+ * Description: Safety thread exit
+ */
+XAresult XAEqualizerItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx)
+{
+    DEBUG_API("->XAEqualizerItfAdapt_ThreadExit");
+    if((!adaptCtx ) ||( adaptCtx->ctxId != XAMediaPlayerAdaptation &&
+                        adaptCtx->ctxId != XAMediaRecorderAdaptation &&
+                        adaptCtx->ctxId != XAOutputMixAdaptation ))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfAdapt_ThreadExit");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+
+    }
+
+    if ( adaptCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+    }
+    else if( adaptCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    }
+    else if (adaptCtx->ctxId == XAOutputMixAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+    }
+
+
+    DEBUG_API("<-XAEqualizerItfAdapt_ThreadExit");
+    return XA_RESULT_SUCCESS;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaequalizeritfadaptation.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAEQUALIZERITFADAPTATION_H
+#define XAEQUALIZERITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+#include "XAThreadSafety.h"
+/* MACROS */
+#define EQUALIZER_NUM_OF_BANDS 10
+#define EQUALIZER_DEFAULT_BAND_LEVEL 0
+
+/* FUNCTIONS */
+XAresult XAEqualizerItfAdapt_GetBandLevelRange(XAAdaptationBaseCtx *bCtx,
+                                               XAmillibel *pMin,
+                                               XAmillibel *pMax);
+
+XAresult XAEqualizerItfAdapt_SetBandLevel(XAAdaptationBaseCtx *bCtx,
+                                          XAuint16 band,
+                                          XAmillibel level);
+
+XAresult XAEqualizerItfAdapt_GetCenterFreq(XAAdaptationBaseCtx *bCtx,
+                                           XAuint16 band,
+                                           XAmilliHertz *pCenter);
+
+XAresult XAEqualizerItfAdapt_GetBandFreqRange(XAAdaptationBaseCtx *bCtx,
+                                              XAuint16 band,
+                                              XAmilliHertz *pMin,
+                                              XAmilliHertz *pMax);
+
+XAresult XAEqualizerItfAdapt_GetBand(XAAdaptationBaseCtx *bCtx,
+                                     XAmilliHertz frequency,
+                                     XAuint16 *pBand);
+
+XAresult XAEqualizerItfAdapt_GetDefaultBandLevel(XAAdaptationBaseCtx *bCtx,
+                                                 XAuint16 index,
+                                                 XAint16 *pLevel);
+XAresult XAEqualizerItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adaptCtx);
+XAresult XAEqualizerItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx);
+#endif /* XAEQUALIZERITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaimagecontrolsitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,393 @@
+/*
+* 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 <gst.h>
+#include "XAAdaptation.h"
+#include "XAMediaPlayerAdaptCtx.h"
+#include "XAMediaRecorderAdaptCtx.h"
+#include "XACameraAdaptCtx.h"
+#include "XAImageControlsItfAdaptation.h"
+
+/*
+ * XAresult XAImageControlsItfAdapt_SetBrightness(XAAdaptationBaseCtx *bCtx,
+ *                                                XAuint32 brightness)
+ */
+XAresult XAImageControlsItfAdapt_SetBrightness(XAAdaptationBaseCtx *bCtx,
+                                               XAuint32 brightness)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    gdouble gstBrightness = 0;
+    XAint32 tempBrightness = 0;
+    GstElement *balanceElement = NULL;
+    DEBUG_API("->XAImageControlsItfAdapt_SetBrightness")
+
+    if(!bCtx || (bCtx->ctxId != XAMediaPlayerAdaptation && bCtx->ctxId != XAMediaRecorderAdaptation
+       && bCtx->ctxId != XACameraAdaptation))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageControlsItfAdapt_SetBrightness")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( bCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XAMediaRecorderAdaptationCtx* ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+        balanceElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_balance");
+    }
+    if( bCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XAMediaPlayerAdaptationCtx* ctx = (XAMediaPlayerAdaptationCtx*) bCtx;
+
+        balanceElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_balance");
+    }
+    if( bCtx->ctxId == XACameraAdaptation )
+    {
+        XACameraAdaptationCtx* ctx = (XACameraAdaptationCtx*) bCtx;
+
+        GstElement *videoPP = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "videopp_camera");
+        if ( !videoPP )
+        {
+            DEBUG_ERR("Could not receive videopp from camerabin!");
+        }
+        else
+        {
+            /* Get camera balance element */
+            balanceElement = gst_bin_get_by_name( GST_BIN(videoPP), "pp_balance");
+        }
+    }
+
+    /* count gstBrightness from XA contrast. Allowed values for gst is -1 to 1
+     * and allowed value for XA is 0 to 100 */
+    tempBrightness = brightness;
+
+    gstBrightness = ( ((gdouble)tempBrightness - SCALE_VALUE_BRIGHTNESS) / SCALE_VALUE_BRIGHTNESS );
+
+    if(balanceElement)
+    {
+        g_object_set(G_OBJECT(balanceElement), "brightness", gstBrightness, NULL);
+
+        if(bCtx->ctxId == XAMediaPlayerAdaptation)
+        {
+            ret = XAImageControlsItfAdapt_HandleImageType(bCtx);
+        }
+    }
+
+	if ( balanceElement )
+	{
+        gst_object_unref(balanceElement);
+	}
+
+    DEBUG_API("<-XAImageControlsItfAdapt_SetBrightness")
+    return ret;
+}
+
+/*
+ * XAresult XAImageControlsItfAdapt_SetContrast(XAAdaptationBaseCtx *bCtx,
+ *                                              XAuint32 contrast)
+ */
+XAresult XAImageControlsItfAdapt_SetContrast(XAAdaptationBaseCtx *bCtx,
+                                             XAint32 contrast)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    gdouble gstContrast = 1;
+    GstElement *balanceElement = NULL;
+    DEBUG_API("->XAImageControlsItfAdapt_SetContrast")
+
+    if(!bCtx || (bCtx->ctxId != XAMediaPlayerAdaptation && bCtx->ctxId != XAMediaRecorderAdaptation
+       && bCtx->ctxId != XACameraAdaptation))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageControlsItfAdapt_SetContrast")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( bCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XAMediaPlayerAdaptationCtx* ctx = (XAMediaPlayerAdaptationCtx*) bCtx;
+
+        balanceElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_balance");
+    }
+    if( bCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XAMediaRecorderAdaptationCtx* ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+        balanceElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_balance");
+    }
+    if( bCtx->ctxId == XACameraAdaptation )
+    {
+        XACameraAdaptationCtx* ctx = (XACameraAdaptationCtx*) bCtx;
+
+        GstElement *videoPP = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "videopp_camera");
+        if( !videoPP )
+        {
+            DEBUG_ERR("Could not receive videopp from camerabin!");
+        }
+        else
+        {
+            /* Get camera balance element */
+            balanceElement = gst_bin_get_by_name( GST_BIN(videoPP), "pp_balance");
+        }
+    }
+
+    /* count gstContrast from XA contrast. Allowed values for gst is 0 to 2
+     * and allowed value for XA is -100 to 100 */
+    gstContrast = (( (gdouble)contrast + SCALE_VALUE_CONTRAST ) / SCALE_VALUE_CONTRAST );
+
+    if(balanceElement)
+    {
+        g_object_set(G_OBJECT(balanceElement), "contrast", gstContrast, NULL);
+
+        if(bCtx->ctxId == XAMediaPlayerAdaptation)
+        {
+            ret = XAImageControlsItfAdapt_HandleImageType(bCtx);
+        }
+    }
+
+	if ( balanceElement )
+	{
+        gst_object_unref(balanceElement);
+	}
+
+    DEBUG_API("<-XAImageControlsItfAdapt_SetContrast")
+    return ret;
+}
+
+/*
+ * XAresult XAImageControlsItfAdapt_SetGamma(XAAdaptationBaseCtx *bCtx,
+ *                                           XApermille gamma)
+ */
+XAresult XAImageControlsItfAdapt_SetGamma(XAAdaptationBaseCtx *bCtx,
+                                          XApermille gamma)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    gdouble gstGamma=0;
+    GstElement *gammaElement = NULL;
+    DEBUG_API("->XAImageControlsItfAdapt_SetGamma")
+
+    if(!bCtx || (bCtx->ctxId != XAMediaPlayerAdaptation && bCtx->ctxId != XAMediaRecorderAdaptation
+       && bCtx->ctxId != XACameraAdaptation))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageControlsItfAdapt_SetGamma")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( bCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XAMediaPlayerAdaptationCtx* ctx = (XAMediaPlayerAdaptationCtx*) bCtx;
+
+        gammaElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_gamma");
+    }
+
+    if( bCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XAMediaRecorderAdaptationCtx* ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+        gammaElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_gamma");
+    }
+
+    if( bCtx->ctxId == XACameraAdaptation )
+    {
+        XACameraAdaptationCtx* ctx = (XACameraAdaptationCtx*) bCtx;
+
+        GstElement *videoPP = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "videopp_camera");
+        if( !videoPP )
+        {
+            DEBUG_ERR("Could not receive videopp from camerabin!");
+        }
+        else
+        {
+            /* Get camera gamma element */
+            gammaElement = gst_bin_get_by_name( GST_BIN(videoPP), "pp_gamma");
+        }
+    }
+
+    /* count gstGamma from XA gamma */
+    gstGamma = ( (gdouble)gamma / SCALE_VALUE_GAMMA );
+
+    if(gammaElement)
+    {
+        g_object_set(G_OBJECT(gammaElement), "gamma", gstGamma, NULL);
+
+        if(bCtx->ctxId == XAMediaPlayerAdaptation)
+        {
+            ret = XAImageControlsItfAdapt_HandleImageType(bCtx);
+        }
+    }
+
+	if ( gammaElement )
+	{
+        gst_object_unref(gammaElement);
+	}
+
+    DEBUG_API("<-XAImageControlsItfAdapt_SetGamma")
+    return ret;
+}
+
+/*
+ * XAresult XAImageControlsItfAdapt_GetSupportedGammaSettings(XAAdaptationBaseCtx *bCtx,
+ *                                                            XApermille *pMinValue,
+ *                                                            XApermille *pMaxValue,
+ *                                                            XAuint32 *pNumSettings,
+ *                                                            XApermille **ppSettings)
+ */
+XAresult XAImageControlsItfAdapt_GetSupportedGammaSettings(XAAdaptationBaseCtx *bCtx,
+                                                           XApermille *pMinValue,
+                                                           XApermille *pMaxValue,
+                                                           XAuint32 *pNumSettings,
+                                                           XApermille **ppSettings)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAImageControlsItfAdapt_GetSupportedGammaSettings")
+
+    if(!bCtx || (bCtx->ctxId != XAMediaPlayerAdaptation && bCtx->ctxId != XAMediaRecorderAdaptation
+       && bCtx->ctxId != XACameraAdaptation) || !pMinValue || !pMaxValue || !pNumSettings)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAImageControlsItfAdapt_GetSupportedGammaSettings")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pMinValue = MIN_GAMMA_VALUE;
+    *pMaxValue = MAX_GAMMA_VALUE;
+
+    /* manual settings is continuous from min to max then pNumSetting return 0. */
+    *pNumSettings = 0;
+
+    DEBUG_API("<-XAImageControlsItfAdapt_GetSupportedGammaSettings")
+    return ret;
+}
+/*
+ * XAresult XAImageControlsItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adapCtx)
+ * Description: Safety thread entry
+ */
+XAresult XAImageControlsItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adaptCtx)
+{
+    DEBUG_API("->XAImageControlsItfAdapt_ThreadEntry");
+    if((!adaptCtx ) ||( adaptCtx->ctxId != XAMediaPlayerAdaptation &&
+                        adaptCtx->ctxId != XAMediaRecorderAdaptation &&
+                        adaptCtx->ctxId != XACameraAdaptation ))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageControlsItfAdapt_ThreadEntry");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+
+    }
+
+    if ( adaptCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaPlayer);
+    }
+    else if( adaptCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+    }
+    else if (adaptCtx->ctxId == XACameraAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+    }
+
+    DEBUG_API("<-XAImageControlsItfAdapt_ThreadEntry");
+    return XA_RESULT_SUCCESS;
+}
+/*
+ * XAresult XAImageControlsItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx)
+ * Description: Safety thread exit
+ */
+XAresult XAImageControlsItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx)
+{
+    DEBUG_API("->XAImageControlsItfAdapt_ThreadExit");
+    if((!adaptCtx ) ||( adaptCtx->ctxId != XAMediaPlayerAdaptation &&
+                        adaptCtx->ctxId != XAMediaRecorderAdaptation &&
+                        adaptCtx->ctxId != XACameraAdaptation ))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageControlsItfAdapt_ThreadExit");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+
+    }
+
+    if ( adaptCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+    }
+    else if( adaptCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    }
+    else if (adaptCtx->ctxId == XACameraAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    }
+
+
+    DEBUG_API("<-XAImageControlsItfAdapt_ThreadExit");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAImageControlsItfAdapt_HandleImageType(XAAdaptationBaseCtx *bCtx)
+ * Description: this run gstreamer for image type
+ *
+ */
+XAresult XAImageControlsItfAdapt_HandleImageType(XAAdaptationBaseCtx *bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XADataSource *dataSrc = NULL;
+    GstStateChangeReturn gstRet = GST_STATE_CHANGE_SUCCESS;
+    GstState gstOrigState = GST_STATE_PLAYING;
+    GstState gstTmpState = GST_STATE_PLAYING;
+    XAMediaPlayerAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XAImageControlsItfAdapt_HandleImageType");
+
+    if( !bCtx || (bCtx->ctxId != XAMediaPlayerAdaptation) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageControlsItfAdapt_HandleImageType")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+
+    dataSrc = mCtx->xaSource;
+
+    if( dataSrc )
+    {
+        XAMediaType mediaType;
+        ret = XACommon_CheckDataSource(dataSrc, &mediaType);
+        if( ret == XA_RESULT_SUCCESS && mediaType == XA_MEDIATYPE_IMAGE )
+        {
+            gstOrigState = GST_STATE(bCtx->bin);
+
+            DEBUG_INFO_A1("Sending change state request to state %d", GST_STATE_READY);
+            gstRet = gst_element_set_state( GST_ELEMENT(bCtx->bin), GST_STATE_READY);
+            gstTmpState = GST_STATE(bCtx->bin);
+
+            DEBUG_INFO_A1("Sending change state request to state %d", gstOrigState);
+            gstRet = gst_element_set_state( GST_ELEMENT(bCtx->bin), gstOrigState);
+        }
+    }
+    DEBUG_API("<-XAImageControlsItfAdapt_HandleImageType");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaimagecontrolsitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAIMAGECONTROLSITFADAPTATION_H
+#define XAIMAGECONTROLSITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+#include "XAThreadSafety.h"
+/* MACROS */
+#define MIN_GAMMA_VALUE         10
+#define MAX_GAMMA_VALUE         10000
+#define SCALE_VALUE_BRIGHTNESS  50
+#define SCALE_VALUE_CONTRAST    100
+#define SCALE_VALUE_GAMMA       1000
+
+/* FUNCTIONS */
+XAresult XAImageControlsItfAdapt_SetBrightness(XAAdaptationBaseCtx *bCtx,
+                                               XAuint32 brightness);
+
+XAresult XAImageControlsItfAdapt_SetContrast(XAAdaptationBaseCtx *bCtx,
+                                             XAint32 contrast);
+
+XAresult XAImageControlsItfAdapt_SetGamma(XAAdaptationBaseCtx *bCtx,
+                                          XApermille gamma);
+
+XAresult XAImageControlsItfAdapt_GetSupportedGammaSettings(XAAdaptationBaseCtx *bCtx,
+                                                           XApermille *pMinValue,
+                                                           XApermille *pMaxValue,
+                                                           XAuint32 *pNumSettings,
+                                                           XApermille **ppSettings);
+XAresult XAImageControlsItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adaptCtx);
+XAresult XAImageControlsItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx);
+XAresult XAImageControlsItfAdapt_HandleImageType(XAAdaptationBaseCtx *bCtx);
+#endif /* XAIMAGECONTROLSITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaimageeffectsitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,729 @@
+/*
+* 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 <gst.h>
+#include <photography.h>
+#include "XAAdaptation.h"
+#include "XAMediaPlayerAdaptCtx.h"
+#include "XAMediaRecorderAdaptCtx.h"
+#include "XACameraAdaptCtx.h"
+#include "XAImageEffectsItfAdaptation.h"
+
+/*
+ * XAresult XAImageEffectsItfAdapt_QuerySupportedImageEffects(XAAdaptationBaseCtx *bCtx,
+ *                                                            XAuint32 index,
+ *                                                            XAuint32 *pImageEffectId)
+ */
+XAresult XAImageEffectsItfAdapt_QuerySupportedImageEffects(XAAdaptationBaseCtx *bCtx,
+                                                           XAuint32 index,
+                                                           XAuint32 *pImageEffectId)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAImageEffectsItfAdapt_QuerySupportedImageEffects")
+
+    if(!bCtx || (bCtx->ctxId != XAMediaPlayerAdaptation && bCtx->ctxId != XAMediaRecorderAdaptation
+       && bCtx->ctxId != XACameraAdaptation) || index > NUM_SUPPORTED_EFFECTS - 1 || !pImageEffectId)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageEffectsItfAdapt_QuerySupportedImageEffects")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check which effect is supported */
+    if(bCtx->ctxId == XAMediaPlayerAdaptation || bCtx->ctxId == XAMediaRecorderAdaptation)
+    {
+        switch( index )
+        {
+            case 0:
+                *pImageEffectId = XA_IMAGEEFFECT_MONOCHROME;
+                break;
+            case 1:
+                *pImageEffectId = XA_IMAGEEFFECT_NEGATIVE;
+                break;
+            case 2:
+                *pImageEffectId = XA_IMAGEEFFECT_SEPIA;
+                break;
+            case 3:
+                *pImageEffectId = XA_IMAGEEFFECT_EMBOSS;
+                break;
+            case 4:
+                *pImageEffectId = XA_IMAGEEFFECT_PAINTBRUSH;
+                break;
+            case 5:
+                *pImageEffectId = XA_IMAGEEFFECT_SOLARIZE;
+                break;
+            case 6:
+                *pImageEffectId = XA_IMAGEEFFECT_CARTOON;
+                break;
+            default:
+                ret = XA_RESULT_PARAMETER_INVALID;
+                break;
+        }
+    }
+    if(bCtx->ctxId == XACameraAdaptation)
+    {
+        XACameraAdaptationCtx* mCtx = (XACameraAdaptationCtx*) bCtx;
+
+        if(GST_IS_PHOTOGRAPHY(mCtx->baseObj.bin))
+        {
+            /* real image effects for camera  */
+            switch( index )
+            {
+                case 0:
+                    *pImageEffectId = XA_IMAGEEFFECT_NEGATIVE;
+                    break;
+                case 1:
+                    *pImageEffectId = XA_IMAGEEFFECT_SEPIA;
+                    break;
+                case 3:
+                    *pImageEffectId = XA_IMAGEEFFECT_SOLARIZE;
+                    break;
+                default:
+                    ret = XA_RESULT_PARAMETER_INVALID;
+                    break;
+            }
+        }
+        else
+        {
+            /* Stubbed image effects for camera */
+            switch( index )
+            {
+                case 0:
+                    *pImageEffectId = XA_IMAGEEFFECT_MONOCHROME;
+                    break;
+                case 1:
+                    *pImageEffectId = XA_IMAGEEFFECT_NEGATIVE;
+                    break;
+                case 2:
+                    *pImageEffectId = XA_IMAGEEFFECT_SEPIA;
+                    break;
+                case 3:
+                    *pImageEffectId = XA_IMAGEEFFECT_EMBOSS;
+                    break;
+                case 4:
+                    *pImageEffectId = XA_IMAGEEFFECT_PAINTBRUSH;
+                    break;
+                case 5:
+                    *pImageEffectId = XA_IMAGEEFFECT_SOLARIZE;
+                    break;
+                case 6:
+                    *pImageEffectId = XA_IMAGEEFFECT_CARTOON;
+                    break;
+                default:
+                    ret = XA_RESULT_PARAMETER_INVALID;
+                    break;
+            }
+        }
+    }
+
+    DEBUG_API("<-XAImageEffectsItfAdapt_QuerySupportedImageEffects")
+    return ret;
+}
+
+/*
+ * XAresult XAImageEffectsItfAdapt_EnableImageEffect(XAAdaptationBaseCtx *bCtx,
+ *                                                   XAuint32 imageEffectID)
+ */
+XAresult XAImageEffectsItfAdapt_EnableImageEffect(XAAdaptationBaseCtx *bCtx,
+                                                  XAuint32 imageEffectID)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    gdouble tempImageEffect = 0;
+    GstElement *balanceElement = NULL;
+    DEBUG_API("->XAImageEffectsItfAdapt_EnableImageEffect")
+
+    if(!bCtx || (bCtx->ctxId != XAMediaPlayerAdaptation && bCtx->ctxId != XAMediaRecorderAdaptation
+       && bCtx->ctxId != XACameraAdaptation))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageEffectsItfAdapt_EnableImageEffect")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check which effect is enabled (STUB for player and recorder - all effect are done
+     * via videobalance plugin. Used different saturations values). */
+    if(bCtx->ctxId == XAMediaPlayerAdaptation || bCtx->ctxId == XAMediaRecorderAdaptation)
+    {
+        switch( imageEffectID )
+        {
+            case XA_IMAGEEFFECT_MONOCHROME:
+                tempImageEffect = IMAGEEFFECT_MONOCHROME;
+                break;
+            case XA_IMAGEEFFECT_NEGATIVE:
+                tempImageEffect = IMAGEEFFECT_NEGATIVE;
+                break;
+            case XA_IMAGEEFFECT_SEPIA:
+                tempImageEffect = IMAGEEFFECT_SEPIA;
+                break;
+            case XA_IMAGEEFFECT_EMBOSS:
+                tempImageEffect = IMAGEEFFECT_EMBOSS;
+                break;
+            case XA_IMAGEEFFECT_PAINTBRUSH:
+                tempImageEffect = IMAGEEFFECT_PAINTBRUSH;
+                break;
+            case XA_IMAGEEFFECT_SOLARIZE:
+                tempImageEffect = IMAGEEFFECT_SOLARIZE;
+                break;
+            case XA_IMAGEEFFECT_CARTOON:
+                tempImageEffect = IMAGEEFFECT_CARTOON;
+                break;
+            default:
+            {
+                DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+                DEBUG_API("<-XAImageEffectsItfAdapt_EnableImageEffect")
+                return XA_RESULT_FEATURE_UNSUPPORTED;
+            }
+        }
+
+        if(bCtx->ctxId == XAMediaPlayerAdaptation)
+        {
+            XAMediaPlayerAdaptationCtx* mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+
+            balanceElement = gst_bin_get_by_name( GST_BIN(mCtx->baseObj.bin), "pp_balance");
+
+            if( balanceElement && (imageEffectID != mCtx->imageEffectID) )
+            {
+                g_object_set(G_OBJECT(balanceElement), "saturation", (gdouble)tempImageEffect, NULL);
+                mCtx->imageEffectID  = imageEffectID;
+                ret = XAImageEffectsItfAdapt_HandleImageType(bCtx);
+            }
+        }
+
+        if(bCtx->ctxId == XAMediaRecorderAdaptation)
+        {
+            XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+            balanceElement = gst_bin_get_by_name( GST_BIN(mCtx->baseObj.bin), "pp_balance");
+
+            if( balanceElement && (imageEffectID != mCtx->imageEffectID) )
+            {
+                g_object_set(G_OBJECT(balanceElement), "saturation", (gdouble)tempImageEffect, NULL);
+                mCtx->imageEffectID  = imageEffectID;
+            }
+        }
+    }
+
+    if(bCtx->ctxId == XACameraAdaptation )
+    {
+        XACameraAdaptationCtx* mCtx = (XACameraAdaptationCtx*) bCtx;
+        gint gstColorToneMode = GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NORMAL;
+
+        if(GST_IS_PHOTOGRAPHY(mCtx->baseObj.bin))
+        {
+            switch( imageEffectID )
+            {
+                case XA_IMAGEEFFECT_NEGATIVE:
+                {
+                    gstColorToneMode = GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NEGATIVE;
+                    break;
+                }
+                case XA_IMAGEEFFECT_SEPIA:
+                {
+                    gstColorToneMode = GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SEPIA;
+                    break;
+                }
+                case XA_IMAGEEFFECT_SOLARIZE:
+                {
+                    gstColorToneMode = GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SOLARIZE;
+                    break;
+                }
+                default:
+                {
+                    mCtx->imageEffectID = 0;
+                    DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+                    DEBUG_API("<-XAImageEffectsItfAdapt_EnableImageEffect")
+                    return XA_RESULT_FEATURE_UNSUPPORTED;
+                }
+            }
+
+            if( imageEffectID != mCtx->imageEffectID )
+            {
+                if( !gst_photography_set_colour_tone_mode( GST_PHOTOGRAPHY(mCtx->baseObj.bin), gstColorToneMode ) )
+                {
+                    DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+                    DEBUG_API("<-XAImageEffectsItfAdapt_EnableImageEffect")
+                    return XA_RESULT_INTERNAL_ERROR;
+                }
+                mCtx->imageEffectID = imageEffectID;
+            }
+        }
+        else
+        {
+            GstElement *videoPP = NULL;
+            /* Stubbed image effects for camera */
+            switch( imageEffectID )
+            {
+                case XA_IMAGEEFFECT_MONOCHROME:
+                    tempImageEffect = IMAGEEFFECT_MONOCHROME;
+                    break;
+                case XA_IMAGEEFFECT_NEGATIVE:
+                    tempImageEffect = IMAGEEFFECT_NEGATIVE;
+                    break;
+                case XA_IMAGEEFFECT_SEPIA:
+                    tempImageEffect = IMAGEEFFECT_SEPIA;
+                    break;
+                case XA_IMAGEEFFECT_EMBOSS:
+                    tempImageEffect = IMAGEEFFECT_EMBOSS;
+                    break;
+                case XA_IMAGEEFFECT_PAINTBRUSH:
+                    tempImageEffect = IMAGEEFFECT_PAINTBRUSH;
+                    break;
+                case XA_IMAGEEFFECT_SOLARIZE:
+                    tempImageEffect = IMAGEEFFECT_SOLARIZE;
+                    break;
+                case XA_IMAGEEFFECT_CARTOON:
+                    tempImageEffect = IMAGEEFFECT_CARTOON;
+                    break;
+                default:
+                {
+                    DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+                    DEBUG_API("<-XAImageEffectsItfAdapt_EnableImageEffect")
+                    return XA_RESULT_FEATURE_UNSUPPORTED;
+                }
+            }
+
+            videoPP = gst_bin_get_by_name( GST_BIN(mCtx->baseObj.bin), "videopp_camera");
+            if ( !videoPP )
+            {
+                DEBUG_ERR("Could not receive videopp from camerabin!");
+            }
+            else
+            {
+               /* Get camera balance element */
+               balanceElement = gst_bin_get_by_name( GST_BIN(videoPP), "pp_balance");
+
+               if( balanceElement && (imageEffectID != mCtx->imageEffectID) )
+               {
+                   g_object_set(G_OBJECT(balanceElement), "saturation", (gdouble)tempImageEffect, NULL);
+                   mCtx->imageEffectID  = imageEffectID;
+               }
+            }
+
+            if ( videoPP )
+            {
+            	gst_object_unref( videoPP );
+            }
+        }
+    }
+
+    if ( balanceElement )
+    {
+        gst_object_unref(balanceElement);
+    }
+
+    DEBUG_API("<-XAImageEffectsItfAdapt_EnableImageEffect")
+    return ret;
+}
+
+/*
+ * XAresult XAImageEffectsItfAdapt_DisableImageEffect(XAAdaptationBaseCtx *bCtx,
+ *                                                    XAuint32 imageEffectID)
+ */
+XAresult XAImageEffectsItfAdapt_DisableImageEffect(XAAdaptationBaseCtx *bCtx,
+                                                   XAuint32 imageEffectID)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 tempImageEffect = 0;
+    GstElement *balanceElement = NULL;
+    DEBUG_API("->XAImageEffectsItfAdapt_DisableImageEffect")
+
+    if(!bCtx || (bCtx->ctxId != XAMediaPlayerAdaptation && bCtx->ctxId != XAMediaRecorderAdaptation
+       && bCtx->ctxId != XACameraAdaptation))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageEffectsItfAdapt_DisableImageEffect")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check which effect is disabled (STUB for player and recorder - all effect are done
+     * via videobalance plugin. Used saturation default value to disabling effects). */
+    if(bCtx->ctxId == XAMediaPlayerAdaptation || bCtx->ctxId == XAMediaRecorderAdaptation)
+    {
+        switch( imageEffectID )
+        {
+            case XA_IMAGEEFFECT_MONOCHROME:
+            case XA_IMAGEEFFECT_NEGATIVE:
+            case XA_IMAGEEFFECT_SEPIA:
+            case XA_IMAGEEFFECT_EMBOSS:
+            case XA_IMAGEEFFECT_PAINTBRUSH:
+            case XA_IMAGEEFFECT_SOLARIZE:
+            case XA_IMAGEEFFECT_CARTOON:
+                tempImageEffect = NO_IMAGEEFFECT;
+                break;
+            default:
+            {
+                DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED")
+                DEBUG_API("<-XAImageEffectsItfAdapt_DisableImageEffect")
+                return XA_RESULT_FEATURE_UNSUPPORTED;
+            }
+        }
+
+        if(bCtx->ctxId == XAMediaPlayerAdaptation)
+        {
+            XAMediaPlayerAdaptationCtx* mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+
+            balanceElement = gst_bin_get_by_name( GST_BIN(mCtx->baseObj.bin), "pp_balance");
+
+            if( balanceElement )
+            {
+                g_object_set(G_OBJECT(balanceElement), "saturation", (gdouble)GST_NO_IMAGEEFFECT, NULL);
+                mCtx->imageEffectID = tempImageEffect;
+                ret = XAImageEffectsItfAdapt_HandleImageType(bCtx);
+            }
+        }
+
+        if(bCtx->ctxId == XAMediaRecorderAdaptation)
+        {
+            XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+            balanceElement = gst_bin_get_by_name( GST_BIN(mCtx->baseObj.bin), "pp_balance");
+
+            if( balanceElement )
+            {
+                g_object_set(G_OBJECT(balanceElement), "saturation", (gdouble)GST_NO_IMAGEEFFECT, NULL);
+                mCtx->imageEffectID = tempImageEffect;
+            }
+        }
+    }
+
+    if(bCtx->ctxId == XACameraAdaptation)
+    {
+        XACameraAdaptationCtx* mCtx = (XACameraAdaptationCtx*) bCtx;
+
+        if(GST_IS_PHOTOGRAPHY(mCtx->baseObj.bin))
+        {
+            switch( imageEffectID )
+            {
+                case XA_IMAGEEFFECT_NEGATIVE:
+                case XA_IMAGEEFFECT_SEPIA:
+                case XA_IMAGEEFFECT_SOLARIZE:
+                {
+                    /* Set color tone to normal */
+                    if( !gst_photography_set_colour_tone_mode( GST_PHOTOGRAPHY(mCtx->baseObj.bin),
+                        GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NORMAL ) )
+                    {
+                        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+                        DEBUG_API("<-XAImageEffectsItfAdapt_EnableImageEffect")
+                        return XA_RESULT_INTERNAL_ERROR;
+                    }
+                    mCtx->imageEffectID = NO_IMAGEEFFECT;
+                    break;
+                }
+                default:
+                {
+                    DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED")
+                    DEBUG_API("<-XAImageEffectsItfAdapt_DisableImageEffect")
+                    return XA_RESULT_FEATURE_UNSUPPORTED;
+                }
+            }
+        }
+        else
+        {
+            GstElement *videoPP = NULL;
+            /* stubbed camera values */
+            switch( imageEffectID )
+            {
+                case XA_IMAGEEFFECT_MONOCHROME:
+                case XA_IMAGEEFFECT_NEGATIVE:
+                case XA_IMAGEEFFECT_SEPIA:
+                case XA_IMAGEEFFECT_EMBOSS:
+                case XA_IMAGEEFFECT_PAINTBRUSH:
+                case XA_IMAGEEFFECT_SOLARIZE:
+                case XA_IMAGEEFFECT_CARTOON:
+                    mCtx->imageEffectID = NO_IMAGEEFFECT;
+                    break;
+                default:
+                {
+                    DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED")
+                    DEBUG_API("<-XAImageEffectsItfAdapt_DisableImageEffect")
+                    return XA_RESULT_FEATURE_UNSUPPORTED;
+                }
+            }
+
+            videoPP = gst_bin_get_by_name( GST_BIN(mCtx->baseObj.bin), "videopp_camera");
+            if ( !videoPP )
+            {
+                DEBUG_ERR("Could not receive videopp from camerabin!");
+            }
+            else
+            {
+               /* Get camera balance element */
+               balanceElement = gst_bin_get_by_name( GST_BIN(videoPP), "pp_balance");
+
+               if( balanceElement && (imageEffectID != mCtx->imageEffectID) )
+               {
+                   g_object_set(G_OBJECT(balanceElement), "saturation", (gdouble)GST_NO_IMAGEEFFECT, NULL);
+                   mCtx->imageEffectID = tempImageEffect;
+               }
+            }
+            if ( videoPP )
+            {
+                gst_object_unref(videoPP);
+            }
+        }
+    }
+
+    if ( balanceElement )
+    {
+        gst_object_unref(balanceElement);
+    }
+
+    DEBUG_API("<-XAImageEffectsItfAdapt_DisableImageEffect")
+    return ret;
+}
+
+/*
+ * XAresult XAImageEffectsItfAdapt_IsImageEffectEnabled(XAAdaptationBaseCtx *bCtx,
+ *                                                      XAuint32 imageEffectID,
+ *                                                      XAboolean *pEnabled)
+ */
+XAresult XAImageEffectsItfAdapt_IsImageEffectEnabled(XAAdaptationBaseCtx *bCtx,
+                                                     XAuint32 imageEffectID,
+                                                     XAboolean *pEnabled)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 tempImageEffect = 0;
+    DEBUG_API("->XAImageEffectsItfAdapt_IsImageEffectEnabled")
+
+    if(!bCtx || (bCtx->ctxId != XAMediaPlayerAdaptation && bCtx->ctxId != XAMediaRecorderAdaptation
+       && bCtx->ctxId != XACameraAdaptation) || !pEnabled)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageEffectsItfAdapt_IsImageEffectEnabled")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(bCtx->ctxId == XAMediaPlayerAdaptation)
+    {
+        XAMediaPlayerAdaptationCtx* mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+        tempImageEffect = mCtx->imageEffectID;
+    }
+
+    if(bCtx->ctxId == XAMediaRecorderAdaptation)
+    {
+        XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+        tempImageEffect = mCtx->imageEffectID;
+    }
+
+    /* check is effect enabled for player and recorder */
+    if(bCtx->ctxId == XAMediaPlayerAdaptation || bCtx->ctxId == XAMediaRecorderAdaptation)
+    {
+        switch( imageEffectID )
+        {
+            case XA_IMAGEEFFECT_MONOCHROME:
+            case XA_IMAGEEFFECT_NEGATIVE:
+            case XA_IMAGEEFFECT_SEPIA:
+            case XA_IMAGEEFFECT_EMBOSS:
+            case XA_IMAGEEFFECT_PAINTBRUSH:
+            case XA_IMAGEEFFECT_SOLARIZE:
+            case XA_IMAGEEFFECT_CARTOON:
+            {
+                /* Check is wanted effect currently enabled */
+                if( tempImageEffect == imageEffectID )
+                {
+                    *pEnabled = XA_BOOLEAN_TRUE;
+                }
+                else
+                {
+                    *pEnabled = XA_BOOLEAN_FALSE;
+                }
+                break;
+            }
+            default:
+                ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                break;
+        }
+    }
+
+    if(bCtx->ctxId == XACameraAdaptation)
+    {
+        XACameraAdaptationCtx* mCtx = (XACameraAdaptationCtx*) bCtx;
+
+        if(GST_IS_PHOTOGRAPHY(mCtx->baseObj.bin))
+        {
+            switch( imageEffectID )
+            {
+                case XA_IMAGEEFFECT_NEGATIVE:
+                case XA_IMAGEEFFECT_SEPIA:
+                case XA_IMAGEEFFECT_SOLARIZE:
+                {
+                    /* Check is wanted effect currently enabled */
+                    if( mCtx->imageEffectID == imageEffectID )
+                    {
+                        *pEnabled = XA_BOOLEAN_TRUE;
+                    }
+                    else
+                    {
+                        *pEnabled = XA_BOOLEAN_FALSE;
+                    }
+                    break;
+                }
+                default:
+                    ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                    break;
+            }
+        }
+        else
+        {
+            /* stubbed camera values */
+            switch( imageEffectID )
+            {
+                case XA_IMAGEEFFECT_MONOCHROME:
+                case XA_IMAGEEFFECT_NEGATIVE:
+                case XA_IMAGEEFFECT_SEPIA:
+                case XA_IMAGEEFFECT_EMBOSS:
+                case XA_IMAGEEFFECT_PAINTBRUSH:
+                case XA_IMAGEEFFECT_SOLARIZE:
+                case XA_IMAGEEFFECT_CARTOON:
+                {
+                    /* Check is wanted effect currently enabled */
+                    if( mCtx->imageEffectID == imageEffectID )
+                    {
+                        *pEnabled = XA_BOOLEAN_TRUE;
+                    }
+                    else
+                    {
+                        *pEnabled = XA_BOOLEAN_FALSE;
+                    }
+                    break;
+                }
+                default:
+                    ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                    break;
+            }
+        }
+    }
+
+    DEBUG_API("<-XAImageEffectsItfAdapt_IsImageEffectEnabled");
+    return ret;
+}
+/*
+ * XAresult XAImageEffectsItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adapCtx)
+ * Description: Safety thread entry
+ */
+XAresult XAImageEffectsItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adaptCtx)
+{
+    DEBUG_API("->XAImageEffectsItfAdapt_ThreadEntry");
+    if((!adaptCtx ) ||( adaptCtx->ctxId != XAMediaPlayerAdaptation &&
+                        adaptCtx->ctxId != XAMediaRecorderAdaptation &&
+                        adaptCtx->ctxId != XACameraAdaptation ))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageEffectsItfAdapt_ThreadEntry");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+
+    }
+
+    if ( adaptCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaPlayer);
+    }
+    else if( adaptCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+    }
+    else if (adaptCtx->ctxId == XACameraAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+    }
+
+    DEBUG_API("<-XAImageEffectsItfAdapt_ThreadEntry");
+    return XA_RESULT_SUCCESS;
+}
+/*
+ * XAresult XAImageEffectsItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx)
+ * Description: Safety thread exit
+ */
+XAresult XAImageEffectsItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx)
+{
+    DEBUG_API("->XAImageEffectsItfAdapt_ThreadExit");
+    if((!adaptCtx ) ||( adaptCtx->ctxId != XAMediaPlayerAdaptation &&
+                        adaptCtx->ctxId != XAMediaRecorderAdaptation &&
+                        adaptCtx->ctxId != XACameraAdaptation ))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageEffectsItfAdapt_ThreadExit");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+
+    }
+
+    if ( adaptCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+    }
+    else if( adaptCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    }
+    else if (adaptCtx->ctxId == XACameraAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    }
+
+
+    DEBUG_API("<-XAImageEffectsItfAdapt_ThreadExit");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAImageEffectsItfAdapt_HandleImageType(XAAdaptationBaseCtx *bCtx)
+ * Description: this run gstreamer for image type
+ *
+ */
+XAresult XAImageEffectsItfAdapt_HandleImageType(XAAdaptationBaseCtx *bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XADataSource *dataSrc = NULL;
+    GstStateChangeReturn gstRet = GST_STATE_CHANGE_SUCCESS;
+    GstState gstOrigState = GST_STATE_PLAYING;
+    GstState gstTmpState = GST_STATE_PLAYING;
+    XAMediaPlayerAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XAImageEffectsItfAdapt_HandleImageType");
+
+    if( !bCtx || (bCtx->ctxId != XAMediaPlayerAdaptation) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageEffectsItfAdapt_HandleImageType")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+
+    dataSrc = mCtx->xaSource;
+
+    if( dataSrc )
+    {
+        XAMediaType mediaType;
+        ret = XACommon_CheckDataSource(dataSrc, &mediaType);
+        if( ret == XA_RESULT_SUCCESS && mediaType == XA_MEDIATYPE_IMAGE )
+        {
+            gstOrigState = GST_STATE(bCtx->bin);
+
+            DEBUG_INFO_A1("Sending change state request to state %d", GST_STATE_READY);
+            gstRet = gst_element_set_state( GST_ELEMENT(bCtx->bin), GST_STATE_READY);
+            gstTmpState = GST_STATE(bCtx->bin);
+
+            DEBUG_INFO_A1("Sending change state request to state %d", gstOrigState);
+            gstRet = gst_element_set_state( GST_ELEMENT(bCtx->bin), gstOrigState);
+        }
+    }
+    DEBUG_API("<-XAImageEffectsItfAdapt_HandleImageType");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaimageeffectsitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAIMAGEEFFECTSITFADAPTATION_H
+#define XAIMAGEEFFECTSITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+#include "XAThreadSafety.h"
+
+/* MACROS */
+#define NUM_SUPPORTED_EFFECTS   7
+#define NO_IMAGEEFFECT          0
+#define GST_NO_IMAGEEFFECT      1
+#define IMAGEEFFECT_MONOCHROME  0
+#define IMAGEEFFECT_NEGATIVE    0.2
+#define IMAGEEFFECT_SEPIA       0.3
+#define IMAGEEFFECT_EMBOSS      1.4
+#define IMAGEEFFECT_PAINTBRUSH  1.5
+#define IMAGEEFFECT_SOLARIZE    1.6
+#define IMAGEEFFECT_CARTOON     2
+
+/* FUNCTIONS */
+XAresult XAImageEffectsItfAdapt_QuerySupportedImageEffects(XAAdaptationBaseCtx *bCtx,
+                                                           XAuint32 index,
+                                                           XAuint32 *pImageEffectId);
+
+XAresult XAImageEffectsItfAdapt_EnableImageEffect(XAAdaptationBaseCtx *bCtx,
+                                                  XAuint32 imageEffectID);
+
+XAresult XAImageEffectsItfAdapt_DisableImageEffect(XAAdaptationBaseCtx *bCtx,
+                                                   XAuint32 imageEffectID);
+
+XAresult XAImageEffectsItfAdapt_IsImageEffectEnabled(XAAdaptationBaseCtx *bCtx,
+                                                     XAuint32 imageEffectID,
+                                                     XAboolean *pEnabled);
+XAresult XAImageEffectsItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adaptCtx);
+XAresult XAImageEffectsItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx);
+XAresult XAImageEffectsItfAdapt_HandleImageType(XAAdaptationBaseCtx *bCtx);
+#endif /* XAIMAGEEFFECTSITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaimageencoderitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* 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 <gst.h>
+#include "XAMediaRecorderAdaptCtx.h"
+#include "XAImageEncoderItfAdaptation.h"
+#include "XAAdaptation.h"
+#include "XAStaticCapsAdaptation.h"
+
+/*
+ * XAresult XAImageEncoderItfAdapt_SetImageSettings( XAAdaptationBaseCtx *bCtx,
+ *                                                   XAImageSettings *pSettings )
+ * @param XAAdaptationBaseCtx *ctx - pointer to Media Recorer adaptation context
+ * @param XAImageSettings *pSettings - Settings for encoder
+ * @return XAresult ret - return success value
+ * Description: Sets preferred encoder settings for pipeline.
+ */
+XAresult XAImageEncoderItfAdapt_SetImageSettings( XAAdaptationBaseCtx *bCtx,
+                                                  const XAImageSettings *pSettings )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    XAStaticCapsData temp;
+
+    DEBUG_API("->XAImageEncoderAdapt_SetImageSettings");
+
+    if( !bCtx || (bCtx->ctxId != XAMediaRecorderAdaptation) || !pSettings )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+    if(XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_IMAGE, mCtx->imageEncSettings.encoderId, &temp) != XA_RESULT_SUCCESS)
+    {   /* no such codec */
+        return XA_RESULT_FEATURE_UNSUPPORTED;
+    }
+    /*Just copy - image settings are applied in InitiateSnapshot*/
+    memcpy(&mCtx->imageEncSettings, pSettings, sizeof(XAImageSettings));
+
+    DEBUG_API("<-XAImageEncoderAdapt_SetImageSettings");
+    return ret;
+}
+
+XAresult XAImageEncoderItfAdapt_GetImageSettings( XAAdaptationBaseCtx *bCtx,
+                                                  XAImageSettings *pSettings )
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAImageEncoderItfAdapt_GetImageSettings");
+    if( !bCtx || (bCtx->ctxId != XAMediaRecorderAdaptation) || !pSettings )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+    memcpy(pSettings, &(mCtx->imageEncSettings), sizeof(XAImageSettings));
+    DEBUG_API("<-XAImageEncoderItfAdapt_GetImageSettings");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaimageencoderitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAIMAGEENCODERITFADAPTATION_H
+#define XAIMAGEENCODERITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+
+/* FUNCTIONS */
+XAresult XAImageEncoderItfAdapt_SetImageSettings(XAAdaptationBaseCtx *bCtx,
+                                                 const XAImageSettings *pSettings);
+XAresult XAImageEncoderItfAdapt_GetImageSettings(XAAdaptationBaseCtx *bCtx,
+                                                 XAImageSettings *pSettings);
+#endif /* XAIMAGEENCODERITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaledarrayadaptctx.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include <string.h>
+#include "XALEDArrayAdaptCtx.h"
+#include "XAAdaptation.h"
+
+/*
+ * XALEDArrayAdaptationCtx* XALEDArrayAdapt_Create()
+ * Allocates memory for LEDArray Adaptation Context and makes 1st phase initialization
+ * @returns XALEDArrayAdaptationCtx* - Pointer to created context
+ */
+XAAdaptationBaseCtx* XALEDArrayAdapt_Create(XAuint32 deviceID)
+{
+    XALEDArrayAdaptationCtx *pSelf = calloc(1, sizeof(XALEDArrayAdaptationCtx));
+    DEBUG_API("->XALEDArrayAdapt_Create");
+
+    if ( pSelf)
+    {
+        if( XAAdaptationBase_Init(&(pSelf->baseObj),XALedArrayAdaptation)
+                    != XA_RESULT_SUCCESS )
+        {
+            DEBUG_ERR("Failed to init base context!!!");
+            free(pSelf);
+            pSelf = NULL;
+        }
+        else
+        {
+            pSelf->deviceID = deviceID;
+
+        }
+    }
+
+    DEBUG_API("<-XALEDArrayAdapt_Create");
+    return (XAAdaptationBaseCtx*)pSelf;
+}
+
+/*
+ * XAresult XALEDArrayAdapt_PostInit()
+ * 2nd phase initialization of LEDArray Adaptation Context
+ */
+XAresult XALEDArrayAdapt_PostInit(XAAdaptationBaseCtx* bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XALEDArrayAdaptationCtx* ctx = NULL;
+    DEBUG_API("->XALEDArrayAdapt_PostInit");
+    if(bCtx == NULL || bCtx->ctxId != XALedArrayAdaptation )
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XALEDArrayAdapt_PostInit");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    ctx = (XALEDArrayAdaptationCtx*)bCtx;
+    if ( !ctx )
+    {
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    XAAdaptationBase_PostInit( &(ctx->baseObj) );
+
+    DEBUG_API("<-XALEDArrayAdapt_PostInit");
+    return ret;
+}
+
+/*
+ * void XALEDArrayAdapt_Destroy(XALEDArrayAdaptationCtx* ctx)
+ * Destroys LEDArray Adaptation Context
+ * @param ctx - LEDArray Adaptation context to be destroyed
+ */
+void XALEDArrayAdapt_Destroy(XAAdaptationBaseCtx* bCtx)
+{
+    XALEDArrayAdaptationCtx* ctx = NULL;
+    DEBUG_API("->XALEDArrayAdapt_Destroy");
+    if(bCtx == NULL || bCtx->ctxId != XALedArrayAdaptation )
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XALEDArrayAdapt_Destroy");
+        return;
+    }
+    ctx = (XALEDArrayAdaptationCtx*)bCtx;
+    DEBUG_API("->XALEDArrayAdapt_Destroy");
+
+    XAAdaptationBase_Free(&(ctx->baseObj));
+
+
+    free(ctx);
+    ctx = NULL;
+
+    DEBUG_API("<-XALEDArrayAdapt_Destroy");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaledarrayadaptctx.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XALEDARRAYADAPTCTX_H
+#define XALEDARRAYADAPTCTX_H
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAAdaptationContextBase.h"
+#endif
+/* TYPEDEFS */
+
+typedef struct XALEDArrayAdaptationCtx_ XALEDArrayAdaptationCtx;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XALEDArrayAdapt_Create(XAuint32 deviceID);
+XAresult XALEDArrayAdapt_PostInit(XAAdaptationBaseCtx* bCtx);
+void XALEDArrayAdapt_Destroy(XAAdaptationBaseCtx* bCtx);
+
+#endif /* XALEDARRAYADAPTCTX_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaledarrayitfadaptation.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include "XALEDArrayAdaptCtx.h"
+#include "XALEDArrayItfAdaptation.h"
+#include "XAAdaptation.h"
+
+/*
+ * XAresult XALEDArrayItfAdapt_ActivateLEDArray ( XAAdaptationBaseCtx *bCtx, XAuint32 lightMask )
+ */
+XAresult XALEDArrayItfAdapt_ActivateLEDArray ( XAAdaptationBaseCtx *bCtx, XAuint32 lightMask )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API_A1("->XALEDArrayItfAdapt_ActivateLEDArray %ld", lightMask);
+
+    if(!bCtx || bCtx->ctxId != XALedArrayAdaptation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_INFO("No support > stubbed.");
+    DEBUG_API("<-XALEDArrayItfAdapt_ActivateLEDArray");
+    return ret;
+}
+/*
+ * XAresult XALEDArrayItfAdapt_SetColor ( XAAdaptationBaseCtx *bCtx, XAuint8 index, const XAHSL * pColor )
+ */
+XAresult XALEDArrayItfAdapt_SetColor ( XAAdaptationBaseCtx *bCtx, XAuint8 index, const XAHSL * pColor )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XALEDArrayItfAdapt_SetColor");
+
+    if(!bCtx || bCtx->ctxId != XALedArrayAdaptation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_INFO("No support > stubbed.");
+    DEBUG_API("<-XALEDArrayItfAdapt_SetColor");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaledarrayitfadaptation.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XALEDARRAYITFADAPTATION_H_
+#define XALEDARRAYITFADAPTATION_H_
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+
+
+/* FUNCTIONS */
+XAresult XALEDArrayItfAdapt_ActivateLEDArray ( XAAdaptationBaseCtx *bCtx, XAuint32 lightMask );
+XAresult XALEDArrayItfAdapt_SetColor ( XAAdaptationBaseCtx *bCtx, XAuint8 index, const XAHSL * pColor );
+#endif /* XALEDARRAYITFADAPTATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xamediaplayeradaptctx.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,1253 @@
+/*
+* 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 <assert.h>
+#include <stdlib.h>
+#include <gstappsrc.h>
+#include <gst.h>
+#include "XAMediaPlayerAdaptCtx.h"
+#include "XAMediaPlayerAdaptCtxMMF.h"
+#include "XAAdaptation.h"
+#include "XAObjectItf.h"
+#include "XACameraDevice.h"
+#include "XAOutputMix.h"
+#include "XAMetadataAdaptation.h"
+#include "XANGAVideoSink.h"
+
+static void need_data_for_prerolling (GstElement * pipeline, guint size, XAMediaPlayerAdaptationCtx* ctx );
+static void  push_data_for_prerolling (GstElement * pipeline, GstBuffer *buffer, XAMediaPlayerAdaptationCtx* ctx);
+static void  enough_data_for_prerolling (GstElement * pipeline, XAMediaPlayerAdaptationCtx* ctx);
+/* forward declarations */
+XAresult XAMediaPlayerAdapt_CreatePipeline( XAMediaPlayerAdaptationCtx* ctx );
+
+void* ngaVideoSinkPtr = NULL;
+
+
+extern XAboolean cameraRealized;
+extern XACameraAdaptationCtx_* cameraCtx;
+
+/*
+ * static void XAMediaPlayerAdapt_NewPadCb (GstElement *element, GstPad *pad,  gpointer data)
+ * Listen to codec bin dynamic pads
+ */
+static void XAMediaPlayerAdapt_NewPadCb (GstElement *element, GstPad *pad,  gpointer data)
+{
+  XAMediaPlayerAdaptationCtx* mCtx = (XAMediaPlayerAdaptationCtx*)data;
+  gchar *name = gst_pad_get_name (pad);
+  DEBUG_API_A1("->XAMediaPlayerAdapt_NewPadCb: A new pad %s was created", name);
+  /*try first newly created pad to video pipe*/
+  if( mCtx->videoppbin && !(gst_pad_is_linked(gst_element_get_static_pad(mCtx->videoppbin, "videopp_sink"))) )
+  {
+      if(gst_element_link_pads (mCtx->codecbin, name, mCtx->videoppbin, "videopp_sink"))
+      {
+          DEBUG_INFO_A1("Pads linked, codecbin:%s to videopp:sink", name);
+          g_free (name);
+          DEBUG_API("<-XAMediaPlayerAdapt_NewPadCb");
+          return;
+      }
+  }
+  /*..and then to audio pipe*/
+  if( mCtx->audioppbin && !(gst_pad_is_linked(gst_element_get_static_pad(mCtx->audioppbin, "sink"))) )
+  {
+      if(gst_element_link_pads (mCtx->codecbin, name, mCtx->audioppbin, "sink"))
+      {
+          DEBUG_INFO_A1("Pads linked, codecbin:%s to audiopp:sink", name);
+          g_free (name);
+          DEBUG_API("<-XAMediaPlayerAdapt_NewPadCb");
+          return;
+      }
+  }
+
+  g_free (name);
+  DEBUG_INFO("Warning: Could not find anything to link to new pad.");
+  DEBUG_API("<-XAMediaPlayerAdapt_NewPadCb");
+}
+
+/*
+ * void  push_data_for_prerolling (GstElement * pipeline, GstBuffer *buffer, XAMediaPlayerAdaptationCtx* ctx)
+ * Called when "push-buffer" signal is emitted
+ */
+void  push_data_for_prerolling (GstElement * pipeline, GstBuffer *buffer, XAMediaPlayerAdaptationCtx* ctx)
+{
+	DEBUG_API("->push_data_for_prerolling");
+	gst_app_src_push_buffer( GST_APP_SRC(ctx->source), GST_BUFFER(buffer) );
+	/*GstPad* prerollPad = NULL;
+	prerollPad = gst_element_get_static_pad(GST_ELEMENT(ctx->source),"src");
+	gst_pad_push (prerollPad, buffer);
+	gst_element_send_event(GST_ELEMENT(ctx->source),gst_event_new_flush_start());
+	gst_element_send_event(GST_ELEMENT(ctx->source),gst_event_new_flush_stop());*/
+	DEBUG_API("<-push_data_for_prerolling");
+}
+
+/*
+ * void  enough_data_for_prerolling (GstElement * pipeline, XAMediaPlayerAdaptationCtx* ctx)
+ * Called when appsrc has enough data
+ */
+void  enough_data_for_prerolling (GstElement * pipeline, XAMediaPlayerAdaptationCtx* ctx)
+{
+	DEBUG_API("->enough_data_for_prerolling");
+	/*No any functionality yet*/
+	DEBUG_API("<-enough_data_for_prerolling");
+}
+
+/*
+ * void need_data_for_prerolling (GstElement * pipeline, guint size, XAMediaPlayerAdaptationCtx* ctx )
+ * Called when the appsrc needs more data during prerolling
+ */
+void need_data_for_prerolling (GstElement * pipeline, guint size, XAMediaPlayerAdaptationCtx* ctx )
+{
+    CPresult cpRet;
+    XAuint32 requestedBytes = size;
+    guint readedBytes = 0;
+    CP_CHECKBYTESRESULTTYPE eResult;
+
+    DEBUG_API("->need_data_for_prerolling");
+
+    /*Start prerolling to contentpipe data*/
+	ctx->baseObj.pipeSrcThrCtx.state = CPStatePrerolling;
+
+	do
+	{
+		gpointer cpBuffer = NULL;
+		GstBuffer  *buffer = NULL;
+
+		cpRet = ctx->baseObj.pipeSrcThrCtx.pipe->pContentPipe->CheckAvailableBytes(&(ctx->baseObj.pipeSrcThrCtx.dataHandle), requestedBytes, &eResult);
+		if ( cpRet != EXIT_SUCCESS )
+		{
+			DEBUG_API("ERROR");
+			ctx->baseObj.pipeSrcThrCtx.state = CPStateError;
+		}
+
+		if ( eResult == CP_CheckBytesOk )
+		{
+			cpBuffer = g_malloc0(requestedBytes );
+			readedBytes =+ requestedBytes;
+			cpRet = ctx->baseObj.pipeSrcThrCtx.pipe->pContentPipe->Read( &(ctx->baseObj.pipeSrcThrCtx.dataHandle), (CPbyte*)cpBuffer, requestedBytes );
+			if ( cpRet != EXIT_SUCCESS )
+			{
+				DEBUG_ERR("Could not read data from content pipe!");
+				ctx->baseObj.pipeSrcThrCtx.state = CPStateError;
+			}
+			else
+			{
+				DEBUG_INFO_A1("Readed %u bytes", requestedBytes );
+				/* Create gstBuffer, GStreamer frees data  */
+				buffer = gst_app_buffer_new( (void*)cpBuffer, requestedBytes, g_free, cpBuffer );
+				if ( !buffer )
+				{
+					DEBUG_ERR("Could not allocate buffer for content pipe source!");
+					ctx->baseObj.pipeSrcThrCtx.state = CPStateError;
+				}
+			}
+
+			if ( cpRet == EXIT_SUCCESS  )
+			{
+				if( buffer )
+				{
+					DEBUG_INFO("Pushing preroll buffer");
+					/*CP code: causes some delay for appsrc but we use push-buffer signal at this point
+                    GstFlowReturn ret;
+					g_signal_emit_by_name (ctx->source, "push-buffer", GST_BUFFER(buffer), &ret);
+					if( ret != GST_FLOW_OK )
+					{
+						DEBUG_ERR("Some problem during preroll");
+						DEBUG_API("<-need_data_for_prerolling");
+					}*/
+					gst_element_send_event(GST_ELEMENT(ctx->source),gst_event_new_flush_start());
+					gst_app_src_push_buffer( GST_APP_SRC(ctx->source), GST_BUFFER(buffer) );
+					gst_element_send_event(GST_ELEMENT(ctx->source),gst_event_new_flush_stop());
+					break;
+				}
+			}
+		}
+		else if( eResult == CP_CheckBytesAtEndOfStream )
+		{
+			ctx->baseObj.pipeSrcThrCtx.state = CPStateEOS;
+			break;
+		}
+		else if( eResult == CP_CheckBytesInsufficientBytes )
+		{
+			ctx->baseObj.pipeSrcThrCtx.state = CPStateWaitForData;
+		}
+		else if( eResult == CP_CheckBytesVendorStartUnused )
+		{
+			/*We use this enumeration when client is started caching from the beginning again*/
+			DEBUG_API( "CP_CheckBytesVendorStartUnused from implementation");
+		}
+	}while ( ctx->baseObj.pipeSrcThrCtx.state == CPStatePrerolling || ctx->baseObj.pipeSrcThrCtx.state == CPStateWaitForData );
+
+	DEBUG_API("<-need_data_for_prerolling");
+}
+
+/*
+ * gboolean XAMediaPlayerAdapt_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+ * MediaPlayer Gst-bus message handler (Callback)
+ */
+gboolean XAMediaPlayerAdapt_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+{
+    XAAdaptationBaseCtx* bCtx = (XAAdaptationBaseCtx*)data;
+    /* only listen to bin messages */
+    if(GST_MESSAGE_SRC(message)==(GstObject*)(bCtx->bin))
+    {
+        XAMediaPlayerAdaptationCtx* mCtx = (XAMediaPlayerAdaptationCtx*)data;
+        DEBUG_API_A2("->XAMediaPlayerAdapt_GstBusCb:\"%s\" from object \"%s\"",
+                        GST_MESSAGE_TYPE_NAME(message), GST_OBJECT_NAME(GST_MESSAGE_SRC(message)));
+
+        switch( GST_MESSAGE_TYPE(message))
+        {
+            case GST_MESSAGE_EOS:
+            {
+                if( mCtx && mCtx->loopingenabled && mCtx->loopend == GST_CLOCK_TIME_NONE)
+                {
+                    DEBUG_INFO_A2("Restart loop from %"GST_TIME_FORMAT" to %"GST_TIME_FORMAT,
+                                  GST_TIME_ARGS(mCtx->loopstart), GST_TIME_ARGS(mCtx->loopend));
+                    gst_element_seek( bCtx->bin, mCtx->playrate, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_ACCURATE,
+                                      GST_SEEK_TYPE_SET, mCtx->loopstart,
+                                      GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE );
+                    gst_element_get_state(bCtx->bin,NULL,NULL,XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
+                    mCtx->lastpos = mCtx->loopstart;
+                    if( mCtx && mCtx->trackpositionenabled )
+                    {
+                        XAmillisecond posMsec = GST_TIME_AS_MSECONDS(mCtx->lastpos);/*Warning ok due to used API specification*/
+                        XAAdaptEvent event = {XA_PLAYITFEVENTS, XA_ADAPT_POSITION_UPDATE_EVT, 1, NULL};
+                        event.data = &posMsec;
+                        XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+                    }
+                }
+                else
+                {
+                /* stop position tracking */
+                if(mCtx->runpositiontimer > 0)
+                {
+                    g_source_remove(mCtx->runpositiontimer);
+                    mCtx->runpositiontimer=0;
+                }
+
+                /* complete any ongoing client async operations */
+                XAAdaptationBase_CompleteAsyncWait(bCtx);
+
+                /* send needed events */
+                {
+					XAMediaType mediatype;
+					if( mCtx->baseObj.pipeSrcThrCtx.pipe )
+					{
+						XACommon_CheckDataSource((XADataSource*)mCtx->xaAudioSink, &mediatype);
+					}
+					else
+					{
+						XACommon_CheckDataSource(mCtx->xaSource, &mediatype);
+					}
+					if(mediatype!=XA_MEDIATYPE_IMAGE)
+					{
+						XAAdaptEvent event = { XA_PLAYITFEVENTS, XA_PLAYEVENT_HEADATEND, 0, NULL };
+						XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+					}
+                }
+                if(mCtx->positionCb)
+                {
+                    mCtx->positionCb(bCtx);
+                }
+                bCtx->binWantedState = GST_STATE_PAUSED;
+                }
+                break;
+            }
+
+            case GST_MESSAGE_STATE_CHANGED:
+            {
+                GstState oldstate, newstate, pendingstate, gsttargetstate;
+                gst_message_parse_state_changed(message, &oldstate, &newstate, &pendingstate);
+                gsttargetstate = GST_STATE_TARGET(bCtx->bin);
+                DEBUG_INFO_A4("old %s -> new %s ( pending %s, gsttarget %s )",
+                               gst_element_state_get_name(oldstate),
+                               gst_element_state_get_name(newstate),
+                               gst_element_state_get_name(pendingstate),
+                               gst_element_state_get_name(gsttargetstate) );
+                if(gsttargetstate!=bCtx->binWantedState)
+                {
+                    DEBUG_ERR_A1("WARNING: Gst target is not wanted target [%s]!!!",
+                                    gst_element_state_get_name(bCtx->binWantedState));
+                }
+                /* print out some more info */
+                if( pendingstate == GST_STATE_VOID_PENDING )
+                {
+                    if( newstate != bCtx->binWantedState )
+                    {
+                        DEBUG_INFO_A2("Gst in intermediate state transition (curr %s, target %s)",
+                                        gst_element_state_get_name(newstate),
+                                        gst_element_state_get_name(bCtx->binWantedState));
+                       break; // TL: add to avoid extra event sent below in this case...                
+                    }
+                    else
+                    {
+                        DEBUG_INFO_A1("Gst in wanted target state (%s)",
+                                        gst_element_state_get_name(newstate));
+                    }
+                }
+                if( oldstate!=GST_STATE_PLAYING && newstate==GST_STATE_PLAYING )
+                {
+                    /* send needed events */
+                    XAAdaptEvent event = {XA_PLAYITFEVENTS, XA_PLAYEVENT_HEADMOVING, 0, NULL };
+                    XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+                    /* enable position tracking if needed */
+                    XAMediaPlayerAdapt_UpdatePositionCbTimer(mCtx);
+                }
+                if ( oldstate== GST_STATE_READY && newstate==GST_STATE_PAUSED)
+                {
+                    if ( mCtx->baseObj.pipeSinkThrCtx.dataHandle )
+                    {
+                        mCtx->baseObj.pipeSrcThrCtx.state = CPStateInitialized;
+                    }
+                }
+                break;
+            }
+
+            case GST_MESSAGE_ASYNC_DONE:
+            {
+                /* some async sequence ended */
+                XAAdaptationBase_CompleteAsyncWait(bCtx);
+                break;
+            }
+
+            case GST_MESSAGE_ERROR:
+            {
+                GError* error;
+                gchar* debug;
+                gst_message_parse_error(message, &error, &debug);
+                DEBUG_ERR_A1("Gst reports error \"%s\"", debug);
+                /* stop waiting any ongoing async operations */
+                XAAdaptationBase_CompleteAsyncWait(bCtx);
+                break;
+            }
+            case GST_MESSAGE_BUFFERING:
+            {
+                gint percent;
+                gst_message_parse_buffering(message, &percent);
+                DEBUG_INFO_A1("Gst message buffering %d", percent);
+                mCtx->buffering = percent;
+                {
+                    XAAdaptEvent event = {XA_PREFETCHITFEVENTS, XA_ADAPT_BUFFERING, 1, NULL };
+                    event.data = &mCtx->buffering;
+                XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+                }
+                break;
+            }
+            case GST_MESSAGE_ELEMENT:
+            {
+                DEBUG_INFO("GST_MESSAGE_ELEMENT");
+                if ((gst_structure_has_name(message->structure, "graphics-surface-created")) || 
+                    (gst_structure_has_name(message->structure, "graphics-surface-updated")))
+                {
+                     DEBUG_INFO("graphics-surface-created message recived");
+                }
+                break;
+            }
+            default:
+                break;
+        }
+    }
+    else //if (GST_MESSAGE_SRC(message)==(GstObject*)(bCtx->videosink))
+    {
+        switch( GST_MESSAGE_TYPE(message))
+        {
+            case GST_MESSAGE_ELEMENT:
+            {
+                DEBUG_INFO("GST_MESSAGE_ELEMENT");
+                if ((gst_structure_has_name(message->structure, "graphics-surface-created")) || 
+                    (gst_structure_has_name(message->structure, "graphics-surface-updated")))
+                {
+                     guint32 surfaceid0, surfaceid1, surfaceid2, surfaceid3;
+                     gint crop_rect_tl_x, crop_rect_tl_y, crop_rect_br_x, crop_rect_br_y;
+                     gint aspect_ratio_num, aspect_ratio_denom;
+                     
+                     GstObject *sink= GST_MESSAGE_SRC(message);
+     
+                     g_object_get(sink, "surfaceid0", &surfaceid0, NULL);
+                     g_object_get(sink, "surfaceid1", &surfaceid1,NULL);
+                     g_object_get(sink, "surfaceid2", &surfaceid2,NULL);
+                     g_object_get(sink, "surfaceid3", &surfaceid3,NULL);
+                     g_object_get(sink, "croprect_tl_x", &crop_rect_tl_x, NULL);
+                     g_object_get(sink, "croprect_tl_y", &crop_rect_tl_y, NULL);
+                     g_object_get(sink, "croprect_br_x", &crop_rect_br_x, NULL);
+                     g_object_get(sink, "croprect_br_y", &crop_rect_br_y, NULL);                
+                     g_object_get(sink, "aspectratio_num", &aspect_ratio_num, NULL);
+                     g_object_get(sink, "aspectratio_denom", &aspect_ratio_denom, NULL);                     
+                     surface_created(ngaVideoSinkPtr, surfaceid0,surfaceid1,surfaceid2,surfaceid3,crop_rect_tl_x,
+                     									crop_rect_tl_y,crop_rect_br_x,crop_rect_br_y,aspect_ratio_num,aspect_ratio_denom);                     
+                }
+                break;
+            }
+            default:
+                break;
+        }   
+    }
+    DEBUG_API("<-XAMediaPlayerAdapt_GstBusCb");    
+    return TRUE;
+}
+
+/*
+ * XAMediaPlayerAdaptationCtx* XAMediaPlayerAdapt_Create()
+ * Allocates memory for Media Player Adaptation Context and makes 1st phase initialization
+ * @param XADataSource *pDataSrc - pointer to OMX-AL data source
+ * @param XADataSource *pBankSrc - pointer to instrument bank structure in Mobile DLS, if NULL default will be used.
+ * @param XADataSink *pAudioSnk - pointer to OMX-AL audio sink definition
+ * @param XADataSink *pImageVideoSnk - pointer to OMX-AL image and video sink definition
+ * @returns XAMediaPlayerAdaptationCtx* - Pointer to created context, NULL if error occurs.
+ */
+XAAdaptationBaseCtx* XAMediaPlayerAdapt_Create(XADataSource *pDataSrc, XADataSource *pBankSrc,
+                                                      XADataSink *pAudioSnk, XADataSink *pImageVideoSnk,
+                                                      XADataSink *pVibra, XADataSink *pLEDArray)
+{
+    XAMediaPlayerAdaptationCtx *pSelf = NULL;
+    XAuint32 locType = 0;
+    XADataLocator_IODevice *ioDevice;
+    XAresult res = XA_RESULT_INTERNAL_ERROR;
+    DEBUG_API("->XAMediaPlayerAdapt_Create");
+    
+    //Create NGA Video Sink class
+    if(pImageVideoSnk)
+    {
+       ngaVideoSinkPtr = nga_video_sink_init();
+    }
+
+    pSelf = calloc(1, sizeof(XAMediaPlayerAdaptationCtx));
+    if ( pSelf)
+    {
+        if( XAAdaptationBase_Init(&(pSelf->baseObj),XAMediaPlayerAdaptation)
+            != XA_RESULT_SUCCESS )
+        {
+            DEBUG_ERR("Failed to init base context!!!");
+            free(pSelf);
+            pSelf = NULL;
+        }
+        else
+        {
+            pSelf->xaSource = pDataSrc;
+            pSelf->xaBankSrc = pBankSrc;
+            pSelf->xaAudioSink = pAudioSnk;
+            pSelf->xaVideoSink = pImageVideoSnk;
+            pSelf->xaLEDArray = pLEDArray;
+            pSelf->xaVibra = pVibra;
+            pSelf->loopstart = 0;
+            pSelf->loopend = GST_CLOCK_TIME_NONE;
+            pSelf->playrate = 1.0;
+            pSelf->baseObj.pipeSrcThrCtx.state = CPStateNull;
+            pSelf->baseObj.pipeSinkThrCtx.dataHandle = NULL;
+            pSelf->rateprops = (XA_RATEPROP_SMOOTHVIDEO | XA_RATEPROP_SILENTAUDIO);
+            pSelf->curMirror = XA_VIDEOMIRROR_NONE;
+            pSelf->curRotation = 0;
+            pSelf->isobjsrc = XA_BOOLEAN_FALSE;
+            pSelf->cameraSinkSynced = XA_BOOLEAN_FALSE;
+            /*pSelf->waitData = XA_BOOLEAN_FALSE;*/
+            if(ngaVideoSinkPtr)
+            {
+               setup_native_display(ngaVideoSinkPtr, pImageVideoSnk);
+            }
+        }
+
+        if ( pDataSrc )
+		{
+			locType = *((XAuint32*)(pDataSrc->pLocator));
+			if ( locType == XA_DATALOCATOR_IODEVICE  )
+			{
+				ioDevice = (XADataLocator_IODevice*)(pDataSrc->pLocator);
+				if ( ioDevice->deviceType == XA_IODEVICE_CAMERA && !cameraRealized )
+				{
+					DEBUG_ERR("Preconditions violated - Camera object not realized");
+					XAAdaptationBase_Free(&pSelf->baseObj);
+					free(pSelf);
+					pSelf = NULL;
+				}
+			}
+		}
+    }
+
+    DEBUG_API("<-XAMediaPlayerAdapt_Create");
+    return (XAAdaptationBaseCtx*)pSelf;
+}
+
+
+
+/*
+ * XAresult XAMediaPlayerAdapt_PostInit()
+ * 2nd phase initialization of Media Player Adaptation Context
+ * @param XAMediaPlayerAdaptationCtx* ctx - pointer to Media Player adaptation context
+ * @return XAresult - Success value
+ */
+XAresult XAMediaPlayerAdapt_PostInit( XAAdaptationBaseCtx* bCtx )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    GstStateChangeReturn gret;
+	XAuint32 locType = 0;
+	XAMediaPlayerAdaptationCtx* ctx = NULL;
+	GstElement *videotest=NULL;
+
+    DEBUG_API("->XAMediaPlayerAdapt_PostInit");
+    if(bCtx == NULL || bCtx->ctxId != XAMediaPlayerAdaptation )
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XAMediaPlayerAdapt_PostInit");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    ctx = (XAMediaPlayerAdaptationCtx*)bCtx;
+    assert(ctx);
+    ret = XAAdaptationBase_PostInit( bCtx );
+    if( ret!=XA_RESULT_SUCCESS )
+    {
+        DEBUG_ERR("Base context postinit failed!!");
+        return ret;
+    }
+
+    /* top level bin for media player */
+    ctx->baseObj.bin = gst_pipeline_new("media_player");
+    /* Create Gst bus listener. */
+    ret = XAAdaptationBase_InitGstListener(bCtx);
+    if( ret!=XA_RESULT_SUCCESS )
+    {
+        DEBUG_ERR("Bus listener creation failed!!");
+        return ret;
+    }
+    /* Add Media Player specific handler */
+    if(ctx->baseObj.bus)
+    {
+        ctx->baseObj.busCb = XAMediaPlayerAdapt_GstBusCb;
+        gst_bus_add_signal_watch( ctx->baseObj.bus );
+        gst_bus_enable_sync_message_emission( ctx->baseObj.bus );
+        g_signal_connect(ctx->baseObj.bus, "message::eos", G_CALLBACK(bCtx->busCb), ctx );
+        g_signal_connect(ctx->baseObj.bus, "message::error", G_CALLBACK(bCtx->busCb), ctx );
+        g_signal_connect(ctx->baseObj.bus, "message::warning", G_CALLBACK(bCtx->busCb), ctx );
+        g_signal_connect(ctx->baseObj.bus, "message::state-changed", G_CALLBACK(bCtx->busCb), ctx );
+        g_signal_connect(ctx->baseObj.bus, "message::segment-done", G_CALLBACK(bCtx->busCb), ctx );
+        g_signal_connect(ctx->baseObj.bus, "message::async-done", G_CALLBACK(bCtx->busCb), ctx );
+        g_signal_connect(ctx->baseObj.bus, "message::element", G_CALLBACK(bCtx->busCb), ctx );
+    }
+    else
+    {
+        DEBUG_ERR("Failed to create message bus");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    XAMetadataAdapt_PreInit(bCtx);
+
+    /* create pipeline */
+    ret = XAMediaPlayerAdapt_CreatePipeline(ctx);
+    if ( ret != XA_RESULT_SUCCESS )
+    {
+        DEBUG_ERR("Failed to create Media Player pipeline");
+        return ret;
+    }
+
+    /* Init content pipe if used*/
+	locType = *((XAuint32*)(ctx->xaSource->pLocator));
+	if ( locType == XA_DATALOCATOR_CONTENTPIPE)
+	{
+		XAMediaPlayerAdapt_InitContentPipeSrc(ctx);
+	}
+
+
+#ifdef XA_IMPL_MEASURE_GST_DELAY
+    ctx->baseObj.startTime = clock();
+#endif /* XA_IMPL_MEASURE_GST_DELAY */
+    /* roll up bin */
+    ctx->baseObj.binWantedState = GST_STATE_PAUSED;
+
+    XAAdaptationBase_PrepareAsyncWait(bCtx);
+    gret = gst_element_set_state( GST_ELEMENT(ctx->baseObj.bin), bCtx->binWantedState);
+    if( gret == GST_STATE_CHANGE_ASYNC )
+    {
+        DEBUG_INFO("Wait for preroll");
+        XAAdaptationBase_StartAsyncWait(bCtx);
+        DEBUG_INFO("Preroll ready");
+    }
+    else if( gret == GST_STATE_CHANGE_FAILURE )
+    {
+        DEBUG_ERR("Preroll FAILED");
+        ret = XA_RESULT_INTERNAL_ERROR;
+    }
+
+    bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
+
+    gret = gst_element_get_state( GST_ELEMENT(bCtx->bin), NULL, NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
+    if(GST_STATE(bCtx->bin)<GST_STATE_PAUSED)
+    {
+        DEBUG_INFO("Warning! Preroll not ready");
+        if( ctx->audioppbin && !(gst_pad_is_linked(gst_element_get_static_pad(ctx->audioppbin, "sink"))) )
+        {/*could not find suitable pad for audiopipeline - remove it*/
+            DEBUG_INFO("Warning! No suitable decodebin pad for audio pipeline!");
+            gst_element_set_state( GST_ELEMENT(ctx->audioppbin), GST_STATE_NULL);
+            gst_bin_remove(GST_BIN(bCtx->bin), ctx->audioppbin);
+            gst_element_set_state( GST_ELEMENT(ctx->audiosink), GST_STATE_NULL);
+            gst_bin_remove(GST_BIN(bCtx->bin), ctx->audiosink);
+        }
+        else if( ctx->videoppbin && !(gst_pad_is_linked(gst_element_get_static_pad(ctx->videoppbin, "videopp_sink"))) )
+        {/*could not find suitable pad for videopipeline - remove it*/
+            DEBUG_INFO("Warning! No suitable decodebin pad for video pipeline!");
+            gst_element_set_state( GST_ELEMENT(ctx->videoppbin), GST_STATE_NULL);
+            gst_bin_remove(GST_BIN(bCtx->bin), ctx->videoppbin);
+            gst_element_set_state( GST_ELEMENT(ctx->videosink), GST_STATE_NULL);
+            gst_bin_remove(GST_BIN(bCtx->bin), ctx->videosink);
+        }
+		gst_element_set_state( GST_ELEMENT(bCtx->bin), bCtx->binWantedState);
+		gst_element_get_state( GST_ELEMENT(bCtx->bin), NULL, NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
+		if(GST_STATE(bCtx->bin)==GST_STATE_PAUSED)
+		{
+			DEBUG_INFO("Retry preroll successful!")
+			ret = XA_RESULT_SUCCESS;
+		}
+    }
+    else
+    {
+        DEBUG_INFO("Preroll ready");
+    }
+    /*
+    CP code: Removed because appsrc does not call any "need-data" signal after that.
+    locType = *((XAuint32*)(ctx->xaSource->pLocator));
+	if( locType == XA_DATALOCATOR_CONTENTPIPE)
+	{
+		gboolean emit = gst_app_src_get_emit_signals( GST_APP_SRC( ctx->source));
+		if( emit )
+		{
+			gst_app_src_set_emit_signals( GST_APP_SRC( ctx->source), FALSE );
+		}
+	}*/
+#ifdef XA_IMPL_MEASURE_GST_DELAY
+    bCtx->endTime = clock();
+    double diff = bCtx->endTime - bCtx->startTime ;
+    diff = diff / CLOCKS_PER_SEC;
+    DEBUG_API_A1( "Starting up bin took %.4lf secs",diff);
+#endif /* XA_IMPL_MEASURE_GST_DELAY */
+    videotest = gst_bin_get_by_name(GST_BIN(bCtx->bin), "videotest");
+    if ( videotest && !ctx->isobjsrc )
+    {
+    	gst_element_set_state( GST_ELEMENT(videotest),GST_STATE_PLAYING);
+    }
+
+    XAMetadataAdapt_PostInit(bCtx);
+
+    if ( videotest )
+    {
+        gst_object_unref(videotest);
+    }
+
+    DEBUG_API("<-XAMediaPlayerAdapt_PostInit");
+    return ret;
+}
+
+/*
+ * void XAMediaPlayerAdapt_Destroy( XAMediaPlayerAdaptationCtx* ctx )
+ * Destroys Media Player Adaptation Context
+ * @param ctx - Media Player Adaptation context to be destroyed
+ */
+void XAMediaPlayerAdapt_Destroy( XAAdaptationBaseCtx* bCtx )
+{
+    XAMediaPlayerAdaptationCtx* ctx = NULL;
+
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAMediaPlayerAdapt_Destroy");
+    if(bCtx == NULL || bCtx->ctxId != XAMediaPlayerAdaptation )
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XAMediaPlayerAdapt_Destroy");
+        return;
+    }
+    ctx = (XAMediaPlayerAdaptationCtx*)bCtx;
+
+    if( ctx->isobjsrc )
+    {   /* external source, unlink and remove now */
+        /*gst_object_unparent( GST_OBJECT(ctx->source) );*/
+        gst_element_unlink( ctx->source, ctx->codecbin );
+        /*gst_bin_remove( GST_BIN(bCtx->bin), ctx->source );*/
+        GST_OBJECT_FLAG_SET(GST_OBJECT(ctx->source),GST_OBJECT_FLOATING);
+    }
+#if 0
+    if ( ctx->xaSource )
+    {
+    	XAuint32 locType = *(XAuint32*)(ctx->xaSource->pLocator);
+    	switch (locType )
+    	{
+		case XA_DATALOCATOR_IODEVICE:
+		{
+			XADataLocator_IODevice* ioDevice = (XADataLocator_IODevice*)(ctx->xaSource->pLocator);
+			if ( ioDevice->deviceType == XA_IODEVICE_RADIO )
+			{
+				gst_object_unparent( GST_OBJECT(ctx->source) );
+				gst_element_unlink( ctx->source, ctx->codecbin );
+				gst_bin_remove( GST_BIN(bCtx->bin), ctx->source );
+				GST_OBJECT_FLAG_SET(GST_OBJECT(ctx->source),GST_OBJECT_FLOATING);
+			}
+		}
+		default:
+			break;
+    	}
+    }
+#endif
+
+    if( ctx->baseObj.pipeSrcThrCtx.dataHandle )
+    {
+        XAuint32 locType = *(XAuint32*)(ctx->xaAudioSink->pLocator);
+		switch ( locType )
+		{
+		case XA_DATALOCATOR_CONTENTPIPE:
+			{
+				res  = ctx->baseObj.pipeSrcThrCtx.pipe->pContentPipe->Close(&(ctx->baseObj.pipeSrcThrCtx.dataHandle));
+				if( res != XA_RESULT_SUCCESS)
+				{
+					DEBUG_ERR("Cannot close contentpipe content");
+				}
+				break;
+			}
+			default:
+				break;
+		}
+    }
+
+    if( ctx->isobjasink && ctx->xaAudioSink && ctx->xaAudioSink->pLocator )
+    {
+        XAuint32 locType = *(XAuint32*)(ctx->xaAudioSink->pLocator);
+        switch ( locType )
+        {
+            case XA_DATALOCATOR_OUTPUTMIX:
+            {
+                XADataLocator_OutputMix* omix = (XADataLocator_OutputMix*)(ctx->xaAudioSink->pLocator);
+                XAOMixImpl* omixDevice = (XAOMixImpl*)(*omix->outputMix);
+                if(omixDevice)
+                {
+                    XAOutputMixAdapt_DisconnectObject(omixDevice->adaptationCtx, bCtx);
+                }
+                break;
+            }
+            default:
+                /* Vibra and LED need no handling */
+                break;
+        }
+
+    }
+
+    if( bCtx->bus )
+    {
+        gst_bus_remove_signal_watch( bCtx->bus );
+        gst_bus_disable_sync_message_emission ( bCtx->bus );
+    }
+    XAAdaptationBase_CancelAsyncWait(bCtx);
+
+    if( ctx->runpositiontimer )
+    {
+        g_source_remove(ctx->runpositiontimer);
+    }
+    XAMetadataAdapt_FreeVars(ctx->metadatavars);
+    XAAdaptationBase_Free( bCtx );
+    free(ctx);
+    ctx = NULL;
+
+    DEBUG_API("<-XAMediaPlayerAdapt_Destroy");
+}
+
+
+/*
+ * void XAMediaPlayerAdapt_CreatePipeline( XAMediaPlayerAdaptationCtx* ctx );
+ */
+XAresult XAMediaPlayerAdapt_CreatePipeline( XAMediaPlayerAdaptationCtx* ctx )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAboolean delayedlink = XA_BOOLEAN_FALSE;
+    XAboolean isPCM = XA_BOOLEAN_FALSE;
+    XAboolean isRawImage = XA_BOOLEAN_FALSE;
+    XAMediaType mediatype;
+    XAuint32 locType = 0;
+    GstCaps* encSrcCaps;
+    DEBUG_API("->XAMediaPlayerAdapt_CreatePipeline");
+
+    /* create and add data source */
+    XACommon_CheckDataSource(ctx->xaSource, &mediatype);
+    ctx->source = XAAdaptationBase_CreateGstSource( ctx->xaSource, "datasrc", &(ctx->isobjsrc), &isPCM, &isRawImage);
+    if( !(ctx->source) )
+    {
+        DEBUG_ERR("Could not create data source!!!");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    else
+    {
+        if(mediatype != XA_MEDIATYPE_AUDIO)
+        {
+          //temporary work around for video
+    	  encSrcCaps = gst_caps_new_simple ("video/h263-2000",
+                "framerate", GST_TYPE_FRACTION, 25, 1,
+                "pixel-aspect-ratio", GST_TYPE_FRACTION, 16, 9,
+                "width", G_TYPE_INT, 176,
+                "height", G_TYPE_INT, 144,
+                NULL);
+          g_object_set(G_OBJECT(ctx->source), "caps", encSrcCaps, NULL);
+        }
+
+        //boolRetVal = gst_bin_add(GST_BIN(pipeline), appsrc);
+    	
+    	
+    }
+
+    if ( !ctx->isobjsrc )
+    { /* Add other than camera source to media player bin */
+    	DEBUG_INFO("No camera source");
+    	gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->source);
+    }
+    else
+    {
+       GstCaps* encSrcCaps;
+       encSrcCaps = gst_caps_new_simple("video/x-raw-yuv",
+                   "format", GST_TYPE_FOURCC,GST_MAKE_FOURCC('I','4','2','0'),
+                   "framerate", GST_TYPE_FRACTION, 30, 1,
+                   NULL);
+       DEBUG_INFO_A1("new camera encoding filter: %s",gst_caps_to_string(encSrcCaps));
+       g_object_set( G_OBJECT(ctx->source), "filter-caps",encSrcCaps,NULL);
+       gst_caps_unref(encSrcCaps);
+    }
+
+    /* create and add codec bin */
+    if( !(ctx->isobjsrc || isPCM) )
+    {
+    	DEBUG_INFO("Create decodebin");
+        if(mediatype == XA_MEDIATYPE_AUDIO)
+        {
+           ctx->codecbin = gst_element_factory_make( "decodebin" , "mpcodecbin" );
+        }
+        else
+        {
+           ctx->codecbin = gst_element_factory_make( "identity" , "mpcodecbin" );
+        }
+    }
+    else if(ctx->isobjsrc )
+    { /* object sources produce framed raw data, decodebin only causes trouble */ //shyward
+    	DEBUG_INFO("Create identity")
+        ctx->codecbin = gst_element_factory_make( "identity" , "mpcodecbin" );
+    }
+    else if(isPCM)
+    { /* decodebin does not know how to handle PCM files */
+    	DEBUG_INFO("Create audioparse")
+        ctx->codecbin = gst_element_factory_make( "audioparse" , "mpcodecbin" );
+    }
+    else if ( isRawImage)
+    { /* decodebin does not know how to handle raw unframed video data */
+    	DEBUG_INFO("Create videoparse")
+        ctx->codecbin = gst_element_factory_make( "videoparse", "mpcodecbin" );
+    }
+
+    if( ctx->codecbin )
+    {
+        gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->codecbin);
+        if ( !ctx->isobjsrc )
+        {
+            if(mediatype == XA_MEDIATYPE_AUDIO)
+            {
+               if( !gst_element_link(ctx->source, ctx->codecbin) )
+               {
+                    DEBUG_ERR("Could not link source to decodebin!!");
+                    return XA_RESULT_INTERNAL_ERROR;
+               }
+            }
+            else
+            {
+			   if( !gst_element_link_filtered(ctx->source, ctx->codecbin, encSrcCaps ) )
+			   {
+			    	DEBUG_ERR("Could not link source to decodebin!!");
+				    return XA_RESULT_INTERNAL_ERROR;
+			   }
+            }
+        }
+        else
+        { /* Link camera source by using ghost-pads, because elements are in different bins */
+
+        	GstPad *cameraBinGhostPad=NULL;
+        	GstPad* ghost=NULL;
+        	GstElement *camTee=NULL;
+        	GstStateChangeReturn gret;
+        	GstPad *mpGhostSink=NULL;
+
+        	/* Set external camera source to ready for pipeline manipulation */
+        	DEBUG_INFO("Set ext-source PAUSED for pipeline manipulation");
+			gret = gst_element_set_state( GST_ELEMENT(ctx->source), GST_STATE_READY);
+			gret = gst_element_get_state( GST_ELEMENT(ctx->source), NULL,NULL,XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
+
+			/* Add new ghost-pad to external camera source */
+        	camTee = gst_bin_get_by_name( GST_BIN(ctx->source), "CamTee");
+        	if ( !camTee )
+        	{
+        		DEBUG_ERR("Could not get tee-element from camera");
+        	}
+        	cameraBinGhostPad = gst_element_get_request_pad( camTee, "src%d" );
+        	if ( !cameraBinGhostPad )
+        	{
+        		DEBUG_ERR("Could not get new src-pad from CamTee element");
+        	}
+			gst_element_add_pad(ctx->source, gst_ghost_pad_new("MPObjSrc",cameraBinGhostPad));
+			ghost = gst_element_get_static_pad( GST_ELEMENT(ctx->source), "MPObjSrc" );
+			DEBUG_INFO_A2("Setting element:%s pad:%s to blocking.",
+							gst_element_get_name(ctx->baseObj.bin),
+							gst_pad_get_name(ghost));
+			/* Set newly created pad to blocking */
+			gst_pad_set_blocked_async(ghost, TRUE, XAAdaptationBase_PadBlockCb, NULL);
+
+
+			/* Create new ghost-pad to media player pipeline where external camera is connected */
+        	mpGhostSink = gst_element_get_static_pad( GST_ELEMENT(ctx->codecbin), "sink");
+			gst_element_add_pad(ctx->baseObj.bin, gst_ghost_pad_new("MPObjSink",mpGhostSink));
+
+			if ( !gst_element_link_pads( GST_ELEMENT(ctx->source), "MPObjSrc",
+										GST_ELEMENT(ctx->baseObj.bin), "MPObjSink") )
+			{
+				DEBUG_ERR("Could not link camera:MPObjSrc to videofilter:MPObjSink");
+				return XA_RESULT_INTERNAL_ERROR;
+			}
+
+			if ( cameraBinGhostPad )
+			{
+				gst_object_unref( cameraBinGhostPad );
+			}
+			if ( ghost )
+			{
+				gst_object_unref( ghost );
+			}
+			if ( mpGhostSink )
+			{
+				gst_object_unref( mpGhostSink );
+			}
+			if ( camTee )
+			{
+				gst_object_unref( camTee );
+			}
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Could not create decoder bin!!!");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    /* create and add video stream pipeline */
+    if(!ctx->xaLEDArray && !ctx->xaVibra && mediatype!=XA_MEDIATYPE_AUDIO) /*no video for these*/
+    {
+        /* create video processing pipeline */
+        ctx->videoppbin = XAAdaptationBase_CreateVideoPP( );
+        if( ctx->videoppbin )
+        {
+            gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->videoppbin);
+            //shyward ---link filtered???
+            // boolRetVal = gst_element_link_filtered(appsrc, videosink, caps);
+			      //if(!gst_element_link(ctx->codecbin, ctx->videoppbin))
+            if(!gst_element_link_filtered(ctx->codecbin, ctx->videoppbin,encSrcCaps))
+            {
+                /* probably dynamic pads in codecbin */
+                DEBUG_INFO("Could not link codec to videopp, trying delayed link");
+                delayedlink = XA_BOOLEAN_TRUE;
+            }
+            ctx->videoScrSrcPad = gst_element_get_static_pad(ctx->videoppbin, "videopp_src");
+        }
+        else
+        {
+            DEBUG_ERR("Could not create video pp bin!!!!");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+        //shyward
+        /* Black screen pipeline not needed under Symbian. May need to revist for acceptance testing
+        ctx->videoppBScrbin = XAAdaptationBase_CreateVideoPPBlackScr( );
+        if( ctx->videoppBScrbin )
+        {
+            gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->videoppBScrbin);
+            ctx->blackScrSrcPad = gst_element_get_static_pad(ctx->videoppBScrbin, "videoppBSrc_src");
+        }
+        else
+        {
+            DEBUG_ERR("Could not create video pp bin for black screen!!!!");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+        */
+        ctx->inputSelector = XAAdaptationBase_CreateInputSelector( );
+        if( ctx->inputSelector )
+        {
+            gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->inputSelector);
+            ctx->videoScrSinkPad = gst_element_get_request_pad(ctx->inputSelector, "sink%d");
+            ctx->blackScrSinkPad = gst_element_get_request_pad(ctx->inputSelector, "sink%d");
+            gst_pad_link(ctx->blackScrSrcPad, ctx->blackScrSinkPad);
+            gst_pad_link(ctx->videoScrSrcPad, ctx->videoScrSinkPad);
+        }
+
+        //shyward - We have no video filter at this time
+        /*
+        ctx->filter = gst_element_factory_make("ffmpegcolorspace", "videofilter");
+        gst_bin_add( GST_BIN(ctx->baseObj.bin), ctx->filter);
+        if ( !gst_element_link( ctx->inputSelector, ctx->filter ) )
+        {
+		   DEBUG_ERR("Could not link ctx->filter <-> ctx->inputSelector");
+		   return XA_RESULT_INTERNAL_ERROR;
+	   }
+	   */
+        /* create video pipe sink */
+        ctx->videosink = XAAdaptationBase_CreateGstSink( ctx->xaVideoSink, "videosink", &(ctx->isobjvsink) );
+        /* NOTE: no valid object sinks for video output available */
+        if( ctx->videosink )
+        {
+            gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->videosink);
+
+            //shyward
+            //if(!gst_element_link(ctx->filter, ctx->videosink))
+            if(!gst_element_link_filtered(ctx->videoppbin, ctx->videosink,encSrcCaps))
+            {
+                DEBUG_ERR("Could not link videopp to videosink!!");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+            else
+            {
+            	gst_caps_unref(encSrcCaps);
+            }
+        }
+        else
+        {
+            DEBUG_ERR("Could not create video sink!!!!");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+    }
+    else
+    {
+        DEBUG_INFO("Media does not contain video!");
+    }
+
+    /* create and add audio stream pipeline */
+
+    if(!ctx->xaLEDArray && !ctx->xaVibra && mediatype!=XA_MEDIATYPE_IMAGE) /*no audio for these*/
+    {
+    /* create audio post processing pipeline */
+    ctx->audioppbin = XAAdaptationBase_CreateAudioPP( );
+    if( ctx->audioppbin )
+    {
+        gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->audioppbin);
+        if(!gst_element_link(ctx->codecbin, ctx->audioppbin))
+        {
+            DEBUG_INFO("Could not link codec to audiopp, trying delayed link");
+            delayedlink = XA_BOOLEAN_TRUE;
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Could not create audio pp bin!!!!");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    /* create audio pipe sink */
+    ctx->audiosink = XAAdaptationBase_CreateGstSink( ctx->xaAudioSink, "audiosink", &(ctx->isobjasink) );
+    if( ctx->audiosink )
+    {
+        if( ctx->isobjasink && ctx->xaAudioSink && ctx->xaAudioSink->pLocator )
+        {
+            locType = *(XAuint32*)(ctx->xaAudioSink->pLocator);
+            switch ( locType )
+            {
+                case XA_DATALOCATOR_OUTPUTMIX:
+                {
+                    XADataLocator_OutputMix* omix = (XADataLocator_OutputMix*)(ctx->xaAudioSink->pLocator);
+                    XAOMixImpl* omixDevice = (XAOMixImpl*)(*omix->outputMix);
+                    if(omixDevice)
+                    {
+                        XAOutputMixAdapt_ConnectObject(omixDevice->adaptationCtx, &(ctx->baseObj), ctx->audiosink);
+                    }
+                    break;
+                }
+                default:
+                    /* Vibra and LED need no handling */
+                    break;
+            }
+        }
+        gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->audiosink);
+        if(!gst_element_link(ctx->audioppbin, ctx->audiosink))
+        {
+            DEBUG_ERR("Could not link audiopp to audiosink!!");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Could not create audio sink!!!!");
+        return XA_RESULT_INTERNAL_ERROR;
+        }
+    }
+    else
+    {
+        DEBUG_INFO("Media does not contain audio!");
+    }
+
+    if(delayedlink)
+    {
+        /* listen for dynamically created pads */
+        g_signal_connect (ctx->codecbin, "pad-added", G_CALLBACK (XAMediaPlayerAdapt_NewPadCb), ctx);
+    }
+    locType = *((XAuint32*)(ctx->xaSource->pLocator));
+    if( locType == XA_DATALOCATOR_CONTENTPIPE)
+    {
+
+        g_signal_connect (ctx->source, "need-data", G_CALLBACK (need_data_for_prerolling), ctx);
+        g_signal_connect (ctx->source, "enough-data", G_CALLBACK (enough_data_for_prerolling), ctx);
+        g_signal_connect (ctx->source, "push-buffer", G_CALLBACK (push_data_for_prerolling), ctx);
+    }
+    DEBUG_API("<-XAMediaPlayerAdapt_CreatePipeline");
+    return ret;
+}
+
+/*
+ * gboolean XAMediaPlayerAdapt_PositionUpdate(gpointer ctx)
+ * callback.
+ * If position tracking enabled, periodic timer calls this method every XA_ADAPT_PU_INTERVAL msecs
+ * @return false to stop periodic calls
+ */
+gboolean XAMediaPlayerAdapt_PositionUpdate(gpointer ctx)
+{
+    XAAdaptationBaseCtx *bCtx = (XAAdaptationBaseCtx*) ctx;
+    XAMediaPlayerAdaptationCtx* mCtx = (XAMediaPlayerAdaptationCtx*) ctx;
+    gint64 position;
+    XAmillisecond posMsec;
+    GstFormat format = GST_FORMAT_TIME;
+    XAAdaptEvent event = {XA_PLAYITFEVENTS, XA_ADAPT_POSITION_UPDATE_EVT, 1, NULL};
+
+    DEBUG_API("->XAMediaPlayerAdapt_PositionUpdate");
+    if ( !gst_element_query_position( GST_ELEMENT(bCtx->bin), &format, &position ) )
+    {
+        DEBUG_ERR("Gst: Failed to get position");
+        return( mCtx->runpositiontimer );
+    }
+    DEBUG_INFO_A1("Current position %"GST_TIME_FORMAT, GST_TIME_ARGS(position));
+    if( mCtx && mCtx->trackpositionenabled )
+    {
+        posMsec = GST_TIME_AS_MSECONDS(position);/*Warning ok due to used API specification*/
+        DEBUG_INFO_A1("mCtx->trackpositionenabled sending update, position:&ld ", posMsec);
+        /* send needed events */
+        event.data=&posMsec;
+        XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+    }
+    if( mCtx && mCtx->loopingenabled)
+    {
+    	DEBUG_INFO_A2("mCtx->loopingenabled, current position:%lu, loopend:%lu ", position, mCtx->loopend);
+        if( (position >= mCtx->loopend) &&
+            (mCtx->lastpos < mCtx->loopend) )
+        {
+            DEBUG_INFO_A2("Restart loop from %"GST_TIME_FORMAT" to %"GST_TIME_FORMAT,
+                          GST_TIME_ARGS(mCtx->loopstart), GST_TIME_ARGS(mCtx->loopend));
+            gst_element_seek( bCtx->bin, mCtx->playrate, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_ACCURATE,
+                              GST_SEEK_TYPE_SET, mCtx->loopstart,
+                              GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE );
+            mCtx->lastpos = mCtx->loopstart;
+            if( mCtx && mCtx->trackpositionenabled )
+            {
+            	DEBUG_INFO_A1("mCtx->trackpositionenabled sending looping update, position:%&u ", posMsec);
+                posMsec = GST_TIME_AS_MSECONDS(mCtx->lastpos);/*Warning ok due to used API specification*/
+                /* send needed events */
+                event.data=&posMsec;
+                XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+            }
+        }
+        else
+        {
+            mCtx->lastpos = position;
+        }
+    }
+    DEBUG_API("<-XAMediaPlayerAdapt_PositionUpdate");
+    /* return false to stop timer */
+    return( mCtx->runpositiontimer );
+}
+
+/*
+ * XAresult XAMediaPlayerAdapt_UpdatePositionCbTimer
+ * Enable/disable periodic position tracking callback timer
+ */
+XAresult XAMediaPlayerAdapt_UpdatePositionCbTimer(XAMediaPlayerAdaptationCtx* mCtx)
+{
+    DEBUG_API_A2("->XAMediaPlayerAdapt_UpdatePositionCbTimer: trackposition %u, tracklooping %u",
+                mCtx->trackpositionenabled, mCtx->loopingenabled);
+
+    if(mCtx->runpositiontimer==0 && (mCtx->trackpositionenabled || mCtx->loopingenabled))
+    {
+        DEBUG_INFO("Start position tracking timer");
+        mCtx->positionCb = &XAMediaPlayerAdapt_PositionUpdate;
+        /* if play is already on, create a timer to track position of playback */
+        if( GST_STATE(mCtx->baseObj.bin) == GST_STATE_PLAYING )
+        {
+            mCtx->runpositiontimer = g_timeout_add(XA_ADAPT_PU_INTERVAL, mCtx->positionCb, mCtx);
+        }
+    }
+    else if (mCtx->runpositiontimer!=0 && !(mCtx->trackpositionenabled || mCtx->loopingenabled))
+    {
+        DEBUG_INFO("Stop position tracking timer");
+        mCtx->trackpositionenabled = XA_BOOLEAN_FALSE;
+        if(mCtx->runpositiontimer > 0)
+        {
+            g_source_remove(mCtx->runpositiontimer);
+            mCtx->runpositiontimer=0;
+        }
+    }
+    DEBUG_API("<-XAMediaPlayerAdapt_UpdatePositionCbTimer");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAMediaPlayerAdapt_InitContentPipeSrc(ctx)
+ * CP code: can be moved to context base
+ */
+XAresult XAMediaPlayerAdapt_InitContentPipeSrc(XAMediaPlayerAdaptationCtx* ctx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    CPresult res;
+    /*GstStateChangeReturn gstRet = GST_STATE_CHANGE_SUCCESS;*/
+    DEBUG_API("->XAMediaPlayerAdapt_InitContentPipeSrc");
+    ctx->baseObj.pipeSrcThrCtx.appSrc = GST_APP_SRC(ctx->source);
+    ctx->baseObj.pipeSrcThrCtx.pipe = (XADataLocator_ContentPipe*)(ctx->xaSource->pLocator);
+
+    /* Create thread for content pipe source*/
+    ret = XAImpl_CreateThreadHandle( &(ctx->baseObj.pipeSrcThr) );
+    if ( ret != XA_RESULT_SUCCESS )
+    {
+        DEBUG_ERR("Could not create thread for content pipe source!");
+        DEBUG_API("<-XAMediaPlayerAdapt_InitContentPipeSrc");
+        return ret;
+    }
+
+    /* Create semaphore for content pipe source */
+    ret = XAImpl_CreateSemaphore( &(ctx->baseObj.pipeSrcThrCtx.stateSem));
+    if ( ret != XA_RESULT_SUCCESS )
+    {
+        DEBUG_ERR("Could not create semaphore for content pipe source!");
+        DEBUG_API("<-XAMediaPlayerAdapt_InitContentPipeSrc");
+        return ret;
+    }
+
+    /* Open content pipe */
+    res = ctx->baseObj.pipeSrcThrCtx.pipe->pContentPipe->Open(&(ctx->baseObj.pipeSrcThrCtx.dataHandle),
+                                                (CPstring)(ctx->baseObj.pipeSrcThrCtx.pipe->URI),
+                                                CP_AccessRead );
+    if ( res ==  EXIT_FAILURE )
+    {
+        DEBUG_ERR("Could not open Content Pipe!")
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    res = ctx->baseObj.pipeSrcThrCtx.pipe->pContentPipe->RegisterCallback( &(ctx->baseObj.pipeSrcThrCtx.dataHandle), &XAAdaptationBase_ContentPipeSrcCb);
+    if ( res == EXIT_FAILURE )
+    {
+        DEBUG_ERR("Could not register content pipe callbacks!")
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    /*gstRet = gst_element_set_state( GST_ELEMENT(ctx->source), GST_STATE_PAUSED);
+    gst_element_sync_state_with_parent( GST_ELEMENT( ctx->source));*/
+
+    XAImpl_StartThread( &(ctx->baseObj.pipeSrcThr), NULL, &XAAdaptationBase_ContentPipeScrThrFunc, &(ctx->baseObj.pipeSrcThrCtx) );
+
+    DEBUG_API("<-XAMediaPlayerAdapt_InitContentPipeSrc");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xamediaplayeradaptctx.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAMEDIAPLAYERADAPTCTX_H
+#define XAMEDIAPLAYERADAPTCTX_H
+
+#include "XAAdaptationContextBase.h"
+
+/* TYPEDEFS */
+
+typedef struct XAMediaPlayerAdaptationCtx_ XAMediaPlayerAdaptationCtx;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XAMediaPlayerAdapt_Create( XADataSource *pDataSrc, XADataSource *pBankSrc,
+                                                       XADataSink *pAudioSnk, XADataSink *pImageVideoSnk,
+                                                       XADataSink *pVibra, XADataSink *pLEDArray);
+XAresult XAMediaPlayerAdapt_PostInit( XAAdaptationBaseCtx* bCtx );
+void XAMediaPlayerAdapt_Destroy( XAAdaptationBaseCtx* bCtx );
+
+XAresult XAMediaPlayerAdapt_InitContentPipeSrc(XAMediaPlayerAdaptationCtx* ctx);
+#endif /*XAMEDIAPLAYERADAPTCTX_H*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xamediarecorderadaptctx.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,1766 @@
+/*
+* 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 <string.h>
+#include <assert.h>
+#include <gst.h>
+#include <gstappsink.h>
+#include "XAMediaRecorderAdaptCtx.h"
+#include "XAAdaptation.h"
+#include "XAMetadataAdaptation.h"
+#include "XAStaticCapsAdaptation.h"
+
+#define XA_ADAPTID_UNINITED 0
+
+extern XAboolean cameraRealized;
+extern XACameraAdaptationCtx_* cameraCtx;
+
+/*forward declarations*/
+GstElement* XAMediaRecorderAdapt_CreateEncodeBin(
+        XAMediaRecorderAdaptationCtx* ctx);
+XAresult XAMediaRecorderAdapt_CreatePipeline(
+        XAMediaRecorderAdaptationCtx* ctx);
+XAresult XAMediaRecorderAdapt_CreatePipeline_New(
+        XAMediaRecorderAdaptationCtx* ctx);
+void XAMediaRecorderAdapt_BufferAvailable(GstElement* sink,
+        gpointer user_data);
+
+/*
+ * gboolean XAMediaRecorderAdapt_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+ * MediaPlayer Gst-bus message handler (Callback)
+ */
+gboolean XAMediaRecorderAdapt_GstBusCb(GstBus *bus, GstMessage *message,
+        gpointer data)
+    {
+    XAAdaptationBaseCtx* bCtx = (XAAdaptationBaseCtx*) data;
+    /* only listen to pipeline messages */
+    if (GST_MESSAGE_SRC(message)==GST_OBJECT(bCtx->bin))
+        {
+        XAMediaRecorderAdaptationCtx* mCtx = NULL;
+        DEBUG_API_A2("->XAMediaRecorderAdapt_GstBusCb:\"%s\" from object \"%s\"",
+                        GST_MESSAGE_TYPE_NAME(message), GST_OBJECT_NAME(GST_MESSAGE_SRC(message)));
+        mCtx = (XAMediaRecorderAdaptationCtx*)data;
+
+        switch( GST_MESSAGE_TYPE(message))
+        {
+            case GST_MESSAGE_EOS:
+            {
+                /* stop position tracking */
+                if(mCtx->runpositiontimer > 0)
+                {
+                    g_source_remove(mCtx->runpositiontimer);
+                    mCtx->runpositiontimer=0;
+                }
+
+                /* complete any ongoing client async operations */
+                XAAdaptationBase_CompleteAsyncWait(bCtx);
+
+                /* send needed events */
+                {
+                    XAAdaptEvent event = {XA_RECORDITFEVENTS, XA_RECORDEVENT_HEADATLIMIT, 0, NULL };
+                    XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+                }
+                if(mCtx->positionCb)
+                {
+                    mCtx->positionCb(bCtx);
+                }
+                bCtx->binWantedState = GST_STATE_PAUSED;
+                break;
+            }
+            case GST_MESSAGE_STATE_CHANGED:
+            {
+                GstState oldstate, newstate, pendingstate, gsttargetstate;
+                gst_message_parse_state_changed(message, &oldstate, &newstate, &pendingstate);
+                gsttargetstate = GST_STATE_TARGET(bCtx->bin);
+                DEBUG_INFO_A4("old %d -> new %d (-> pending %d -> gsttarget %d)",
+                               oldstate, newstate, pendingstate, gsttargetstate);
+                if(gsttargetstate!=bCtx->binWantedState)
+                {
+                    DEBUG_ERR_A1("WARNING: Gst target is not wanted target [%d]!!!", bCtx->binWantedState);
+                }
+                /* print out some more info */
+                if( pendingstate == GST_STATE_VOID_PENDING )
+                {
+                    if( newstate != bCtx->binWantedState )
+                    {
+                        DEBUG_INFO_A2("Gst in intermediate state transition (curr %d, target %d)",
+                                    newstate,bCtx->binWantedState);
+                    }
+                    else
+                    {
+                        DEBUG_INFO_A1("Gst in wanted target state (%d)",newstate);
+                    }
+                }
+                if( oldstate!=GST_STATE_PLAYING && newstate==GST_STATE_PLAYING )
+                {
+                    XAAdaptEvent event = {XA_RECORDITFEVENTS, XA_RECORDEVENT_HEADMOVING, 0, NULL };
+                    /* send needed events */
+                    XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+                    /* enable position tracking if needed */
+                    if( mCtx->runpositiontimer==0 && mCtx->trackpositionenabled && mCtx->positionCb )
+                    {
+                        mCtx->runpositiontimer = g_timeout_add(XA_ADAPT_PU_INTERVAL, mCtx->positionCb, mCtx);
+                    }
+                }
+                break;
+            }
+
+            case GST_MESSAGE_ASYNC_DONE:
+            {
+                /* some async sequence ended */
+                XAAdaptationBase_CompleteAsyncWait(bCtx);
+                break;
+            }
+
+            case GST_MESSAGE_ERROR:
+            {
+                GError* error;
+                gchar* debug;
+                gst_message_parse_error(message, &error, &debug);
+                DEBUG_ERR_A1("Gst reports error \"%s\"", debug);
+                /* stop waiting any ongoing async operations */
+                XAAdaptationBase_CompleteAsyncWait(bCtx);
+                break;
+            }
+
+            default:
+                break;
+        }
+    DEBUG_API("<-XAMediaRecorderAdapt_GstBusCb");
+    }
+    return TRUE;
+    }
+
+/*
+ * XAAdaptationBaseCtx* XAMediaRecorderAdapt_Create()
+ * Allocates memory for Media Recorder Adaptation Context and makes 1st phase initialization
+ * @param XADataSource *pAudioSrc - pointer to OMX-AL audio source
+ * @param XADataSource *pImageVideoSrc - pointer image/video source
+ * @param XADataSink *pDataSnk - pointer to OMX-AL sink
+ * @returns XAMediaRecorderAdaptationCtx* - Pointer to created context, NULL if error occurs.
+ */
+XAAdaptationBaseCtx* XAMediaRecorderAdapt_Create(XADataSource* pAudioSrc,
+        XADataSource* pImageVideoSrc, XADataSink* pDataSnk, XAuint8 recModes)
+    {
+    XAMediaRecorderAdaptationCtx *pSelf = NULL;
+    XAuint32 locType = 0;
+    XADataLocator_IODevice *ioDevice;
+    DEBUG_API("->XAMediaRecorderAdapt_Create");
+
+    pSelf = calloc(1, sizeof(XAMediaRecorderAdaptationCtx));
+    if (pSelf)
+        {
+        if (XAAdaptationBase_Init(&(pSelf->baseObj),
+                XAMediaRecorderAdaptation) != XA_RESULT_SUCCESS)
+            {
+            DEBUG_ERR("Failed to init base context!!!");
+            free(pSelf);
+            pSelf = NULL;
+            }
+        else
+            {
+            pSelf->xaAudioSource = pAudioSrc;
+            pSelf->xaVideoSource = pImageVideoSrc;
+            pSelf->xaSink = pDataSnk;
+            pSelf->baseObj.pipeSinkThrCtx.state = CPStateNull;
+            pSelf->xaRecordState = XA_RECORDSTATE_STOPPED;
+            pSelf->curMirror = XA_VIDEOMIRROR_NONE;
+            pSelf->curRotation = 0;
+            pSelf->recModes = recModes;
+            pSelf->isRecord = XA_BOOLEAN_FALSE;
+
+            /* defaults from API spec */
+            pSelf->imageEncSettings.width = 640;
+            pSelf->imageEncSettings.height = 480;
+            pSelf->imageEncSettings.compressionLevel = 0;
+            pSelf->imageEncSettings.encoderId = XA_IMAGECODEC_JPEG;
+            pSelf->imageEncSettings.colorFormat = XA_COLORFORMAT_UNUSED;
+            /* no specified defaults for rest, determined later from container type */
+            pSelf->videoEncSettings.encoderId = XA_ADAPTID_UNINITED;
+            pSelf->videoEncSettings.width = 640;
+            pSelf->videoEncSettings.height = 480;
+            pSelf->videoEncSettings.frameRate = 15;
+            pSelf->audioEncSettings.encoderId = XA_ADAPTID_UNINITED;
+            pSelf->audioEncSettings.channelsIn = 2;
+            pSelf->audioEncSettings.channelsOut = 2;
+            pSelf->audioEncSettings.bitsPerSample = 8;
+            pSelf->audioEncSettings.bitRate = 128;
+            pSelf->audioEncSettings.sampleRate = 44100;
+            }
+
+        if (pImageVideoSrc)
+            {
+            locType = *((XAuint32*) (pImageVideoSrc->pLocator));
+            if (locType == XA_DATALOCATOR_IODEVICE)
+                {
+                ioDevice
+                        = (XADataLocator_IODevice*) (pImageVideoSrc->pLocator);
+                if (ioDevice->deviceType == XA_IODEVICE_CAMERA
+                        && !cameraRealized)
+                    {
+                    DEBUG_ERR("Preconditions violated - Camera object not realized");
+                    XAAdaptationBase_Free(&pSelf->baseObj);
+                    free(pSelf);
+                    pSelf = NULL;
+                    }
+                }
+            }
+        }
+
+    DEBUG_API("<-XAMediaRecorderAdapt_Create");
+    return (XAAdaptationBaseCtx*) pSelf;
+    }
+
+/*
+ * XAresult XAMediaRecorderAdapt_PostInit()
+ * 2nd phase initialization of Media Recorder Adaptation Context
+ * @param XAAdaptationBaseCtx* ctx - pointer to Media Recorder adaptation context
+ * @return XAresult - Success value
+ */
+XAresult XAMediaRecorderAdapt_PostInit(XAAdaptationBaseCtx* bCtx)
+    {
+    GstStateChangeReturn gret;
+
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaRecorderAdaptationCtx* ctx = NULL;
+    DEBUG_API("->XAMediaRecorderAdapt_PostInit");
+    if (bCtx == NULL || bCtx->ctxId != XAMediaRecorderAdaptation)
+        {
+        DEBUG_ERR("Invalid parameter!!");DEBUG_API("<-XAMediaRecorderAdapt_PostInit");
+        return XA_RESULT_PARAMETER_INVALID;
+        }
+    ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+    ret = XAAdaptationBase_PostInit(bCtx);
+    if (ret != XA_RESULT_SUCCESS)
+        {
+        DEBUG_ERR("Base context postinit failed!!");
+        return ret;
+        }
+
+    /* top level bin for media recorder */
+    bCtx->bin = gst_pipeline_new("media_recorder");
+
+    /* Create Gst bus listener. */
+    ret = XAAdaptationBase_InitGstListener(bCtx);
+    if (ret != XA_RESULT_SUCCESS)
+        {
+        DEBUG_ERR("Bus listener creation failed!!");
+        return ret;
+        }
+    /* Add Media Recorder specific handler */
+    if (bCtx->bus)
+        {
+        bCtx->busCb = XAMediaRecorderAdapt_GstBusCb;
+        gst_bus_add_signal_watch(bCtx->bus);
+        g_signal_connect(bCtx->bus, "message::eos", G_CALLBACK(bCtx->busCb), ctx );
+        g_signal_connect(bCtx->bus, "message::error", G_CALLBACK(bCtx->busCb), ctx );
+        g_signal_connect(bCtx->bus, "message::warning", G_CALLBACK(bCtx->busCb), ctx );
+        g_signal_connect(bCtx->bus, "message::state-changed", G_CALLBACK(bCtx->busCb), ctx );
+        g_signal_connect(bCtx->bus, "message::segment-done", G_CALLBACK(bCtx->busCb), ctx );
+        g_signal_connect(bCtx->bus, "message::async-done", G_CALLBACK(bCtx->busCb), ctx );
+        }
+    else
+        {
+        DEBUG_ERR("Failed to create message bus");
+        return XA_RESULT_INTERNAL_ERROR;
+        }
+
+    XAMetadataAdapt_PreInit(bCtx);
+
+    /* create pipeline */
+    ret = XAMediaRecorderAdapt_CreatePipeline(ctx);
+    //ret = XAMediaRecorderAdapt_CreatePipeline_New(ctx);
+    if (ret != XA_RESULT_SUCCESS)
+        {
+        DEBUG_ERR("Failed to create recorder pipeline");
+        return XA_RESULT_INTERNAL_ERROR;
+        }
+
+    /* Init content pipe if used */
+    if (ctx->xaSink && ctx->xaSink->pLocator
+            && *(XAuint32*) (ctx->xaSink->pLocator)
+                    == XA_DATALOCATOR_CONTENTPIPE)
+        {
+        XAMediaRecorderAdapt_InitContentPipeSink(ctx);
+        }
+
+#ifdef XA_IMPL_MEASURE_GST_DELAY
+    bCtx->startTime = clock();
+#endif /* XA_IMPL_MEASURE_GST_DELAY */
+    /* roll up bin */
+    bCtx->binWantedState = GST_STATE_PAUSED;
+    XAAdaptationBase_PrepareAsyncWait(bCtx);
+    gret = gst_element_set_state(GST_ELEMENT(bCtx->bin), bCtx->binWantedState);
+    if (gret == GST_STATE_CHANGE_ASYNC)
+        {
+        DEBUG_INFO("Wait for preroll");
+        XAAdaptationBase_StartAsyncWait(bCtx);DEBUG_INFO("Preroll ready");
+        }
+    else if (gret == GST_STATE_CHANGE_FAILURE)
+        {
+        DEBUG_ERR("Preroll FAILED");
+        /*ret = XA_RESULT_INTERNAL_ERROR;*/
+        }
+#ifdef XA_IMPL_MEASURE_GST_DELAY
+    bCtx->endTime = clock();
+    double diff = bCtx->endTime - bCtx->startTime;
+    diff = diff / CLOCKS_PER_SEC;
+    DEBUG_API_A1( "Starting up bin took %.4lf secs",diff);
+#endif /* XA_IMPL_MEASURE_GST_DELAY */
+    XAMetadataAdapt_PostInit(bCtx);
+
+    bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
+
+    DEBUG_API("<-XAMediaRecorderAdapt_PostInit");
+    return ret;
+    }
+
+/*
+ * void XAMediaRecorderAdapt_Destroy( XAAdaptationBaseCtx* bCtx )
+ * Destroys Media Recorder Adaptation Context
+ * @param ctx - Media Recorder Adaptation context to be destroyed
+ */
+void XAMediaRecorderAdapt_Destroy(XAAdaptationBaseCtx* bCtx)
+    {
+    XAMediaRecorderAdaptationCtx* ctx = NULL;
+    char* fname = NULL;
+    DEBUG_API("->XAMediaRecorderAdapt_Destroy");
+
+    if (bCtx == NULL || bCtx->ctxId != XAMediaRecorderAdaptation)
+        {
+        DEBUG_ERR("Invalid parameter!!");DEBUG_API("<-XAMediaRecorderAdapt_Destroy");
+        return;
+        }
+    ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+    if (ctx->isRecord == XA_BOOLEAN_FALSE)
+        {
+        DEBUG_INFO("Removing unnecessary file.");
+
+        if (ctx->xaSink && *((XAuint32*) (ctx->xaSink->pLocator))
+                == XA_DATALOCATOR_URI)
+            {
+            if (strncmp(
+                    (char *) ((XADataLocator_URI*) (ctx->xaSink->pLocator))->URI,
+                    "file://", 7) == 0)
+                {
+                fname
+                        = (char *) &(((XADataLocator_URI*) (ctx->xaSink->pLocator))->URI[7]);
+                }
+            else
+                {
+                fname
+                        = (char *) ((XADataLocator_URI*) (ctx->xaSink->pLocator))->URI;
+                }
+
+            if (remove(fname) != 0)
+                {
+                DEBUG_ERR_A1("Cannot remove file %s", fname);
+                }
+            }
+        }
+
+    if (ctx->isobjvsrc && ctx->videosource)
+        { /* external source, unlink now */
+        gst_element_unlink(ctx->videosource, ctx->codecbin);
+        GST_OBJECT_FLAG_SET(GST_OBJECT(ctx->videosource),GST_OBJECT_FLOATING);
+        }
+    if (bCtx->bus)
+        {
+        gst_bus_remove_signal_watch(bCtx->bus);
+        }
+    XAAdaptationBase_CancelAsyncWait(bCtx);
+
+    if (ctx->runpositiontimer)
+        {
+        g_source_remove(ctx->runpositiontimer);
+        }
+    XAAdaptationBase_Free(bCtx);
+
+    free(ctx);
+    ctx = NULL;
+
+    DEBUG_API("<-XAMediaRecorderAdapt_Destroy");
+    }
+
+/***************** INTERNAL FUNCTIONS *******************************/
+
+XAresult XAMediaRecorderAdapt_CreatePipeline_New(
+        XAMediaRecorderAdaptationCtx* ctx)
+    {
+    XADataLocator_URI* uri;
+    GstCaps* caps;
+    gboolean ok;
+
+    //Create gst source
+    ctx->audiosource
+            = gst_element_factory_make("devsoundsrc", "record_audio");
+    if (!ctx->audiosource)
+        {
+        g_print("could not create \"record\" element!");
+        return XA_RESULT_INTERNAL_ERROR;
+        }
+
+    ctx->datasink = gst_element_factory_make("filesink", "filesink");
+    if (!ctx->datasink)
+        {
+        g_print("could not create \"filesink\" element!");
+        return XA_RESULT_INTERNAL_ERROR;
+        }
+
+    ctx->codecbin = gst_element_factory_make("wavenc", "wavencoder");
+    if (!ctx->codecbin)
+        {
+        g_print("could not create \"wavenc\" element!");
+        return XA_RESULT_INTERNAL_ERROR;
+        }
+    uri = (XADataLocator_URI*) ctx->xaSink->pLocator;
+
+    if (uri->URI != NULL)
+        {
+        XAchar *fname;
+        DEBUG_INFO_A1("URI: %s", uri->URI);
+        if (strncmp((char *) uri->URI, "file://", 7) == 0)
+            {
+            fname = &((uri->URI)[7]);
+            }
+        else
+            {
+            fname = uri->URI;
+            }DEBUG_INFO_A1("->filesystem path %s", fname);
+        g_object_set( G_OBJECT(ctx->datasink),"location", fname,
+         "async", FALSE,
+         "qos", FALSE,
+         "max-lateness", (gint64)(-1),
+         NULL);
+        
+        //g_object_set(G_OBJECT(ctx->datasink), "location", fname, NULL);
+        }
+    
+   // ctx->audioppbin = XAAdaptationBase_CreateAudioPP( );
+    //gst_bin_add_many(GST_BIN (ctx->baseObj.bin), ctx->audiosource,  ctx->audioppbin, ctx->codecbin,ctx->datasink, NULL);
+    
+    gst_bin_add_many(GST_BIN (ctx->baseObj.bin), ctx->audiosource, ctx->codecbin,ctx->datasink, NULL);
+    
+    caps = gst_caps_new_simple ("audio/x-raw-int",
+              "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, 16000,
+              "channels", G_TYPE_INT, 1, NULL);
+    
+    ok = gst_element_link_filtered (ctx->audiosource, ctx->codecbin, caps);
+    if(!ok)
+        {
+        DEBUG_ERR("Could not link audiosrc to codecbin!!");
+        }
+    ok = gst_element_link (ctx->codecbin, ctx->datasink);
+    if(!ok)
+        {
+        DEBUG_ERR("Could not link codecbin to datasink!!");
+        }
+    gst_caps_unref (caps);
+    
+    return XA_RESULT_SUCCESS;
+    }
+    /*
+     * void XAMediaRecorderAdapt_CreatePipeline( XAMediaRecorderAdaptationCtx* ctx );
+     */
+    XAresult XAMediaRecorderAdapt_CreatePipeline(
+            XAMediaRecorderAdaptationCtx* ctx)
+        {
+        XAresult ret = XA_RESULT_SUCCESS;
+        GstCaps* encSrcCaps = NULL;
+        DEBUG_API("->XAMediaRecorderAdapt_CreatePipeline");
+
+        /* create and add video pipeline */
+        ctx->codecbin = XAMediaRecorderAdapt_CreateEncodeBin(ctx);
+        if (ctx->codecbin)
+            {
+            if (gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->codecbin))
+                {
+                DEBUG_API("->XAMediaRecorderAdapt_CreatePipeline: gst_bin_add success");
+                }
+            else
+                {
+                DEBUG_ERR("Could not add codec bin");
+                return XA_RESULT_INTERNAL_ERROR;
+                }
+            }
+        else
+            {
+            DEBUG_ERR("Could not create encoding bin!!!");
+            return XA_RESULT_INTERNAL_ERROR;
+            }
+
+        /* create and add video pipeline if video source available and codec supports video */
+        if (ctx->xaVideoSource
+                && gst_element_get_pad(ctx->codecbin, "v_sink"))
+            {
+            /* create video pipe source */
+            ctx->videosource = XAAdaptationBase_CreateGstSource(
+                    ctx->xaVideoSource, "videosource", &(ctx->isobjvsrc),
+                    NULL, NULL );
+            if (!ctx->videosource)
+                {
+                DEBUG_ERR("Could not create video source!!!!");
+                return XA_RESULT_INTERNAL_ERROR;
+                }
+
+            if (!ctx->isobjvsrc)
+                { /* Add other than camera sources to media recorder bin */
+                gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->videosource);
+                }
+            else
+                { /* Don't add camera source to media recorder bin */
+                GstCaps * encSrcCaps;
+                encSrcCaps = gst_caps_new_simple( "video/x-raw-yuv", 
+                "format", GST_TYPE_FOURCC,GST_MAKE_FOURCC('I','4','2','0'),
+                "framerate", GST_TYPE_FRACTION, ctx->videoEncSettings.frameRate, 1,
+                        NULL);
+                DEBUG_INFO_A1("new camera encoding filter: %s",gst_caps_to_string(encSrcCaps));
+                g_object_set( G_OBJECT(ctx->videosource), "filter-caps",encSrcCaps,NULL);
+                gst_caps_unref(encSrcCaps);
+                }
+            /* create video filter for video encoder settings */
+            ctx->videofilter = gst_element_factory_make("capsfilter", "videofilter");
+            if( ctx->videofilter )
+                {
+                GstCaps* encSrcCaps;
+                gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->videofilter);
+                encSrcCaps = gst_caps_new_simple("video/x-raw-yuv",
+                        "width", G_TYPE_INT, ctx->videoEncSettings.width,
+                        "height", G_TYPE_INT, ctx->videoEncSettings.height,
+                        "framerate", GST_TYPE_FRACTION, ctx->videoEncSettings.frameRate, 1,
+                        NULL);
+                DEBUG_INFO_A1("video encoder config from settings: %s",gst_caps_to_string(encSrcCaps));
+                g_object_set( G_OBJECT(ctx->videofilter), "caps",encSrcCaps,NULL);
+                gst_caps_unref(encSrcCaps);
+                if ( ! ctx->isobjvsrc )
+                    {
+                    if(!gst_element_link(ctx->videosource, ctx->videofilter))
+                        {
+                        DEBUG_ERR("Could not link videopp to videofilter!!");
+                        return XA_RESULT_INTERNAL_ERROR;
+                        }
+                    }
+                else
+                    { /* For camera source used ghost-pads for linking, because elements are in different bins */
+                    GstStateChangeReturn gret;
+                    GstElement *camTee=NULL;
+                    GstPad *cameraBinGhostPad=NULL;
+                    GstPad *ghost=NULL;
+                    GstPad *mrGhostSink=NULL;
+
+                    DEBUG_INFO("Set ext-source PAUSED for pipeline manipulation");
+                    gret = gst_element_set_state( GST_ELEMENT(ctx->videosource), GST_STATE_READY);
+                    gret = gst_element_get_state( GST_ELEMENT(ctx->videosource), NULL,NULL,XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
+
+                    /* Add new ghost-pad to external camera source */
+                    camTee = gst_bin_get_by_name( GST_BIN(ctx->videosource), "CamTee");
+                    if ( !camTee )
+                        {
+                        DEBUG_ERR("Could not get tee-element from camera");
+                        }
+                    cameraBinGhostPad = gst_element_get_request_pad( camTee, "src%d" );
+                    if ( !cameraBinGhostPad )
+                        {
+                        DEBUG_ERR("Could not get new src-pad from CamTee element");
+                        }
+                    gst_element_add_pad(ctx->videosource, gst_ghost_pad_new("MRObjSrc",cameraBinGhostPad));
+                    ghost = gst_element_get_static_pad( GST_ELEMENT(ctx->videosource), "MRObjSrc" );
+                    DEBUG_INFO_A2("Setting element:%s pad:%s to blocking.",
+                            gst_element_get_name(ctx->baseObj.bin),
+                            gst_pad_get_name(ghost));
+                    /* Set newly created pad to blocking */
+                    gst_pad_set_blocked_async(ghost, TRUE, XAAdaptationBase_PadBlockCb, NULL);
+
+                    mrGhostSink = gst_element_get_static_pad( GST_ELEMENT(ctx->videofilter), "sink");
+                    gst_element_add_pad(ctx->baseObj.bin, gst_ghost_pad_new("MRObjSink",mrGhostSink));
+                    if ( !gst_element_link_pads( GST_ELEMENT(ctx->videosource), "MRObjSrc",
+                                    GST_ELEMENT(ctx->baseObj.bin), "MRObjSink") )
+                        {
+                        DEBUG_ERR("Could not link camera:MRObjSrc to videofilter:MRObjSink");
+                        return XA_RESULT_INTERNAL_ERROR;
+                        }
+
+                    if ( cameraBinGhostPad )
+                        {
+                        gst_object_unref( cameraBinGhostPad );
+                        }
+                    if ( ghost )
+                        {
+                        gst_object_unref( ghost );
+                        }
+                    if ( mrGhostSink )
+                        {
+                        gst_object_unref( mrGhostSink );
+                        }
+                    if ( camTee )
+                        {
+                        gst_object_unref( camTee );
+                        }
+                    }
+                }
+            /* create video processing pipeline */
+#ifdef XA_IMPL_FIXED_VIDEO_SIZE
+            ctx->videoppbin = XAAdaptationBase_CreateFixedSizeVideoPP( );
+#else
+            ctx->videoppbin = XAAdaptationBase_CreateVideoPP( );
+#endif
+            if( ctx->videoppbin )
+                {
+                gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->videoppbin);
+                if(!gst_element_link(ctx->videofilter, ctx->videoppbin))
+                    {
+                    DEBUG_ERR("Could not link videofilter to videopp!!");
+                    return XA_RESULT_INTERNAL_ERROR;
+                    }
+                }
+            else
+                {
+                DEBUG_ERR("Could not create video pp bin!!!!");
+                return XA_RESULT_INTERNAL_ERROR;
+                }
+            /* create identity to extract buffers from */
+            ctx->videoextract = gst_element_factory_make("identity", "videoextract");
+            if( ctx->videoextract )
+                {
+                gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->videoextract);
+                if(!gst_element_link(ctx->videoppbin, ctx->videoextract))
+                    {
+                    DEBUG_ERR("Could not link videopp to videoextract!!");
+                    return XA_RESULT_INTERNAL_ERROR;
+                    }
+                }
+            else
+                {
+                DEBUG_ERR("Could not create videoextract!!!!");
+                return XA_RESULT_INTERNAL_ERROR;
+                }
+            if( ctx->videoextract )
+                {
+                if( !gst_element_link_pads(ctx->videoextract, "src", ctx->codecbin, "v_sink") )
+                    {
+                    DEBUG_INFO("Warning: could not link videoextract to codec!!");
+                    }
+                }
+            }
+        else
+            {
+            DEBUG_INFO("No video input");
+            }
+
+        /* create and add audio pipeline */
+        if ( ctx->xaAudioSource && gst_element_get_pad(ctx->codecbin, "sink") )
+            {
+            /* create audio pipe source */
+            ctx->audiosource = XAAdaptationBase_CreateGstSource( ctx->xaAudioSource, "audiosource",
+                    &(ctx->isobjasrc), NULL, NULL );
+            if( ctx->audiosource )
+                {
+                if (gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->audiosource))
+                    {
+                    DEBUG_INFO("Added audiosource to bin");
+                    }
+                else
+                    {
+                    DEBUG_ERR("Could not add audiosource to bin");
+                    return XA_RESULT_INTERNAL_ERROR;
+                    }
+                }
+            else
+                {
+                DEBUG_ERR("Could not create audio source!!!!");
+                return XA_RESULT_INTERNAL_ERROR;
+                }
+            /* create audio processing pipeline */
+            ctx->audioppbin = XAAdaptationBase_CreateAudioPP( );
+            if( ctx->audioppbin )
+                {
+                if (gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->audioppbin))
+                    {
+                    DEBUG_INFO("Added audioppbin to bin");
+                    }
+                else
+                    {
+                    DEBUG_ERR("Could not add audioppbin to bin");
+                    return XA_RESULT_INTERNAL_ERROR;
+                    }
+/*                if(!gst_element_link(ctx->audiosource, ctx->audioppbin))
+                    {
+                    DEBUG_ERR("Could not link audiofilter to audiopp!!");
+                    return XA_RESULT_INTERNAL_ERROR;
+                    }
+*/                    
+                    
+                }
+            else
+                {
+                DEBUG_ERR("Could not create audio pp bin!!!!");
+                return XA_RESULT_INTERNAL_ERROR;
+                }
+            /* create audio filter for audio encoder settings */
+            ctx->audiofilter = gst_element_factory_make("capsfilter", "audiofilter");
+            if( ctx->audiofilter )
+                {
+                //   GstCaps* encSrcCaps; TL
+                if (gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->audiofilter))
+                    {
+                    DEBUG_INFO("Added audiofilter to bin");
+                    }
+                else
+                    {
+                    DEBUG_ERR("Could not add audio filter to bin");
+                    return XA_RESULT_INTERNAL_ERROR;
+                    }
+                encSrcCaps = gst_caps_new_full(
+                        gst_structure_new("audio/x-raw-int",
+                                "width", G_TYPE_INT, 16,
+                                "depth", G_TYPE_INT, 16,
+                                "signed",G_TYPE_BOOLEAN, 1,
+                                "endianness",G_TYPE_INT, 1234,
+                                "rate", G_TYPE_INT, 16000,
+                                "bitrate", G_TYPE_INT, ctx->audioEncSettings.bitRate,
+                                "channels", G_TYPE_INT, 1, NULL),
+                        /*gst_structure_new("audio/x-raw-int",
+                         "channels", G_TYPE_INT, ctx->audioEncSettings.channelsOut,
+                         "rate", G_TYPE_INT, ctx->audioEncSettings.sampleRate,
+                         "bitrate", G_TYPE_INT, ctx->audioEncSettings.bitRate,
+                         NULL),*/
+                        gst_structure_new("audio/x-raw-float",
+                                "channels", G_TYPE_INT, ctx->audioEncSettings.channelsOut,
+                                "width", G_TYPE_INT, ctx->audioEncSettings.bitsPerSample,
+                                "rate", G_TYPE_INT, ctx->audioEncSettings.sampleRate,
+                                "bitrate", G_TYPE_INT, ctx->audioEncSettings.bitRate,
+                                NULL),
+                        NULL);
+                DEBUG_INFO_A1("audio encoder config from settings: %s",gst_caps_to_string(encSrcCaps));
+                g_object_set( G_OBJECT(ctx->audiofilter), "caps",encSrcCaps,NULL);
+
+                if(!gst_element_link(ctx->audiosource, ctx->audiofilter))
+                    {
+                    DEBUG_ERR("Could not link audiosource to audiofilter!!");
+                    return XA_RESULT_INTERNAL_ERROR;
+                    }
+                    
+                }
+/*            if( !gst_element_link_pads_filtered(ctx->audiofilter, "src", ctx->codecbin, "sink", encSrcCaps) )
+                {
+                DEBUG_INFO("Warning: could not link audiopp to codec!!");
+                return XA_RESULT_INTERNAL_ERROR;
+                }
+*/
+                if (!gst_element_link_filtered( ctx->audiofilter , ctx->audioppbin ,encSrcCaps))
+                    {
+                    DEBUG_INFO("Warning: could not link audiosource to audiopp!!");
+                    return XA_RESULT_INTERNAL_ERROR;
+                    }
+                if(!gst_element_link(ctx->audioppbin, ctx->codecbin))
+                    {
+                    DEBUG_INFO("Warning: could not link audioppbin to codecbin!!");
+                    return XA_RESULT_INTERNAL_ERROR;
+                    }
+            }
+        else
+            {
+            DEBUG_INFO("No audio input");
+            }
+        gst_caps_unref(encSrcCaps);
+
+        /* create and add data sink */
+        ctx->datasink = XAAdaptationBase_CreateGstSink( ctx->xaSink, "datasink", &(ctx->isobjsink) );
+        if( ctx->datasink )
+            {
+            if ( GST_IS_APP_SINK(ctx->datasink) )
+                {
+                gst_app_sink_set_emit_signals( GST_APP_SINK(ctx->datasink), TRUE );
+                }
+            if (gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->datasink))
+                {
+                DEBUG_INFO("Added datasink to bin");
+                }
+            else
+                {
+                DEBUG_ERR("Could not add datasink to bin");
+                return XA_RESULT_INTERNAL_ERROR;
+                }
+            if(!gst_element_link(ctx->codecbin, ctx->datasink))
+                {
+                DEBUG_ERR("Could not link codec to sink!!");
+                return XA_RESULT_INTERNAL_ERROR;
+                }
+            /* NOTE: no actual object sinks applicable, variable used to imply appsrc (recording to memory)*/
+            if(ctx->isobjsink)
+                {
+                g_signal_connect(ctx->datasink, "new-buffer",
+                        G_CALLBACK (XAMediaRecorderAdapt_BufferAvailable),ctx);
+
+                ret = XAImpl_CreateSemaphore( &(ctx->recThrCtx.bufInsufficientSem));
+                if ( ret != XA_RESULT_SUCCESS )
+                    {
+                    DEBUG_ERR("WARN: Could not create semaphore for recorder event handler!");
+                    }
+                XAImpl_CreateThreadHandle( &(ctx->recordingEventThr) );
+                }
+            }
+        else
+            {
+            DEBUG_ERR("Could not create data sink!!!");
+            return XA_RESULT_INTERNAL_ERROR;
+            }
+        DEBUG_API("<-XAMediaRecorderAdapt_CreatePipeline");
+        return ret;
+        }
+
+    /*
+     * XAresult XAMediaRecorderAdapt_CheckCodec( XAMediaRecorderAdaptationCtx_* mCtx );
+     * Check codec compatibility and support with initiated datasink content
+     */
+    XAresult XAMediaRecorderAdapt_CheckCodec( XAMediaRecorderAdaptationCtx_* mCtx, XACapsType encType, XAuint32 encoderId )
+        {
+        XAresult ret = XA_RESULT_SUCCESS;
+        XAuint32 format;
+        XAStaticCapsData temp;
+
+        DEBUG_API("->XAMediaRecorderAdapt_CheckCodec");
+
+        /*first, check if codec supported at all*/
+        ret = XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|encType, encoderId, &temp);
+
+        if( ret==XA_RESULT_SUCCESS )
+            {
+            if(encType & (XACAP_VIDEO|XACAP_AUDIO))
+                {
+                if(mCtx->xaSink && mCtx->xaSink->pFormat)
+                    {
+                    format = *(XAuint32*)(mCtx->xaSink->pFormat);
+                    }
+                else
+                    {
+                    ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                    }
+                }
+            else
+                {
+                if(mCtx->snapshotVars.xaSink && mCtx->snapshotVars.xaSink->pFormat)
+                    {
+                    format = *(XAuint32*)(mCtx->snapshotVars.xaSink->pFormat);
+                    }
+                else
+                    {
+                    ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                    }
+                }
+            if(ret==XA_RESULT_SUCCESS) switch ( format )
+                {
+                case XA_DATAFORMAT_PCM:
+                if ( (encType == XACAP_AUDIO) && (encoderId == XA_AUDIOCODEC_PCM) )
+                    {
+                    ret=XA_RESULT_SUCCESS;
+                    }
+                else
+                    {
+                    ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                    }
+                break;
+
+                case XA_DATAFORMAT_RAWIMAGE:
+                if ( (encType == XACAP_IMAGE) && (encoderId == XA_IMAGECODEC_RAW) )
+                    {
+                    ret=XA_RESULT_SUCCESS;
+                    }
+                else
+                    {
+                    ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                    }
+                break;
+
+                case XA_DATAFORMAT_MIME:
+                DEBUG_INFO("XA_DATAFORMAT_MIME ");
+                    {
+                    XADataFormat_MIME* mime = ((XADataFormat_MIME*)mCtx->xaSink->pFormat);
+                    DEBUG_INFO_A1("mime->containerType:%u",(int)mime->containerType);
+                    DEBUG_INFO_A1("mime->mimeType:%s",mime->mimeType);
+                    switch ( mime->containerType )
+                        {
+                        case XA_CONTAINERTYPE_RAW:
+                        if( ((encType == XACAP_AUDIO) && (encoderId == XA_AUDIOCODEC_PCM)) ||
+                                ((encType == XACAP_VIDEO) && (encoderId == XA_ADAPTID_RAWVIDEO)) ||
+                                ((encType == XACAP_IMAGE) && (encoderId == XA_IMAGECODEC_RAW)) )
+                            {
+                            ret=XA_RESULT_SUCCESS;
+                            }
+                        else
+                            {
+                            ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                            }
+                        break;
+
+                        case XA_CONTAINERTYPE_AVI:
+                        if(encType == XACAP_VIDEO)
+                            {
+                            switch(encoderId)
+                                {
+                                case XA_ADAPTID_MOTIONJPEG:
+                                case XA_ADAPTID_RAWVIDEO:
+                                ret=XA_RESULT_SUCCESS;
+                                break;
+                                default:
+                                ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                                break;
+                                }
+                            }
+                        else if(encType == XACAP_AUDIO)
+                            {
+                            switch(encoderId)
+                                {
+                                case XA_AUDIOCODEC_PCM:
+                                ret=XA_RESULT_SUCCESS;
+                                break;
+                                default:
+                                ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                                break;
+                                }
+                            }
+                        else
+                            {
+                            ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                            }
+                        break;
+
+                        case XA_CONTAINERTYPE_WAV:
+                        if(encType == XACAP_AUDIO)
+                            {
+                            switch(encoderId)
+                                {
+                                case XA_AUDIOCODEC_PCM:
+                                ret=XA_RESULT_SUCCESS;
+                                break;
+                                default:
+                                ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                                break;
+                                }
+                            }
+                        else
+                            {
+                            ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                            }
+                        break;
+
+                        case XA_CONTAINERTYPE_JPG:
+                        if(encType == XACAP_VIDEO)
+                            {
+                            switch(encoderId)
+                                {
+                                case XA_ADAPTID_MOTIONJPEG:
+                                ret=XA_RESULT_SUCCESS;
+                                break;
+                                default:
+                                ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                                break;
+                                }
+                            }
+                        else if(encType == XACAP_IMAGE)
+                            {
+                            switch(encoderId)
+                                {
+                                case XA_IMAGECODEC_JPEG:
+                                ret=XA_RESULT_SUCCESS;
+                                break;
+                                default:
+                                ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                                break;
+                                }
+                            }
+                        else
+                            {
+                            ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                            }
+                        break;
+
+                        case XA_CONTAINERTYPE_UNSPECIFIED:
+                        if(strstr( (char *) mime->mimeType, "/ogg") != 0)
+                            {
+                            if(encType == XACAP_VIDEO)
+                                {
+                                switch(encoderId)
+                                    {
+                                    case XA_ADAPTID_THEORA:
+                                    ret=XA_RESULT_SUCCESS;
+                                    break;
+                                    default:
+                                    ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                                    break;
+                                    }
+                                }
+                            else if(encType == XACAP_AUDIO)
+                                {
+                                switch(encoderId)
+                                    {
+                                    case XA_ADAPTID_VORBIS:
+                                    ret=XA_RESULT_SUCCESS;
+                                    break;
+                                    default:
+                                    ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                                    break;
+                                    }
+                                }
+                            else
+                                {
+                                ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                                }
+                            }
+                        else
+                            {
+                            ret=XA_RESULT_FEATURE_UNSUPPORTED;
+                            }
+                        break;
+
+                        default: /*switch (containertype)*/
+                        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                        break;
+                        }
+                    break;
+                    }
+                default: /*switch (format)*/
+                ret = XA_RESULT_CONTENT_UNSUPPORTED;
+                break;
+                }
+            }
+        if( ret!=XA_RESULT_SUCCESS )
+            {
+            DEBUG_ERR("cannot accommodate given codec & datasink pair!!!");
+            }
+        DEBUG_API("<-XAMediaRecorderAdapt_CheckCodec");
+        return ret;
+        }
+    /*
+     * XAresult XAMediaRecorderAdapt_ChangeEncoders( XAMediaRecorderAdaptationCtx* mCtx );
+     * re-create encodebin based on new encoder settings
+     */
+    XAresult XAMediaRecorderAdapt_ChangeEncoders( XAMediaRecorderAdaptationCtx* mCtx )
+        {
+        XAresult ret = XA_RESULT_SUCCESS;
+        XAAdaptationBaseCtx* bCtx = &(mCtx->baseObj);
+
+        DEBUG_API("->XAMediaRecorderAdapt_ChangeEncoders");
+        /* check state */
+        if(GST_STATE(mCtx->baseObj.bin)<GST_STATE_PLAYING)
+            {
+            GstElement* newBin = XAMediaRecorderAdapt_CreateEncodeBin(mCtx);
+            if(newBin)
+                { /* replace old bin with new */
+                GstStateChangeReturn gret;
+                GstPad *asink=NULL, *linkedasrc=NULL;
+                GstPad *vsink=NULL, *linkedvsrc=NULL;
+                GstPad *src=NULL, *linkedsink=NULL;
+                GstPad *moSrc=NULL, *moSink=NULL;
+                GstCaps* encSrcCaps = NULL;
+
+                /* pipeline must be unrolled for renegotiation */
+                DEBUG_INFO("Unroll pipeline");
+                bCtx->binWantedState = GST_STATE_READY;
+                gret = gst_element_set_state( GST_ELEMENT(bCtx->bin), bCtx->binWantedState);
+                gret = gst_element_get_state( GST_ELEMENT(bCtx->bin), NULL, NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
+
+                /*set new stream settings*/
+                if( mCtx->videofilter )
+                    {
+                    encSrcCaps = gst_caps_new_simple("video/x-raw-yuv",
+                            "format", GST_TYPE_FOURCC,GST_MAKE_FOURCC('I','4','2','0'),
+                            "width", G_TYPE_INT, mCtx->videoEncSettings.width,
+                            "height", G_TYPE_INT, mCtx->videoEncSettings.height,
+                            "framerate", GST_TYPE_FRACTION, mCtx->videoEncSettings.frameRate, 1,
+                            NULL);
+                    DEBUG_INFO_A1("new video encoder config from settings: %s",gst_caps_to_string(encSrcCaps));
+                    g_object_set( G_OBJECT(mCtx->videofilter), "caps",encSrcCaps,NULL);
+                    gst_caps_unref(encSrcCaps);
+                    }
+                if( mCtx->audiofilter )
+                    {
+                    encSrcCaps = gst_caps_new_full(
+                            gst_structure_new("audio/x-raw-int",
+                                    "channels", G_TYPE_INT, mCtx->audioEncSettings.channelsOut,
+                                    "rate", G_TYPE_INT, mCtx->audioEncSettings.sampleRate,
+                                    "bitrate", G_TYPE_INT, mCtx->audioEncSettings.bitRate,
+                                    NULL),
+                            gst_structure_new("audio/x-raw-float",
+                                    "channels", G_TYPE_INT, mCtx->audioEncSettings.channelsOut,
+                                    "width", G_TYPE_INT, mCtx->audioEncSettings.bitsPerSample,
+                                    "rate", G_TYPE_INT, mCtx->audioEncSettings.sampleRate,
+                                    "bitrate", G_TYPE_INT, mCtx->audioEncSettings.bitRate,
+                                    NULL),
+                            NULL);
+                    DEBUG_INFO_A1("new audio encoder config from settings: %s",gst_caps_to_string(encSrcCaps));
+                    g_object_set( G_OBJECT(mCtx->audiofilter), "caps",encSrcCaps,NULL);
+                    gst_caps_unref(encSrcCaps);
+                    }
+
+                if(mCtx->isobjvsrc)
+                    {
+                    moSrc = gst_element_get_static_pad(mCtx->videosource,"MRObjSrc");
+                    moSink = gst_pad_get_peer(moSrc);
+                    if(moSink)
+                        {
+                        gst_pad_unlink(moSrc,moSink);
+                        }
+                    moSrc = gst_element_get_static_pad(mCtx->videosource,"mediaobjectsrc");
+                    encSrcCaps = gst_caps_new_simple("video/x-raw-yuv",
+                            "format", GST_TYPE_FOURCC,GST_MAKE_FOURCC('I','4','2','0'),
+                            "framerate", GST_TYPE_FRACTION, mCtx->videoEncSettings.frameRate, 1,
+                            NULL);
+                    DEBUG_INFO_A1("new camera encoding filter: %s",gst_caps_to_string(encSrcCaps));
+                    g_object_set( G_OBJECT(mCtx->videosource), "filter-caps",encSrcCaps,NULL);
+                    gst_caps_unref(encSrcCaps);
+                    }
+
+                DEBUG_INFO("Unlink and remove old encodebin");
+                asink = gst_element_get_static_pad(mCtx->codecbin,"sink");
+                if(asink)
+                    {
+                    linkedasrc = gst_pad_get_peer(asink);
+                    if(linkedasrc)
+                        {
+                        gst_pad_unlink(linkedasrc,asink);
+                        }
+                    }
+                vsink = gst_element_get_static_pad(mCtx->codecbin,"v_sink");
+                if(vsink)
+                    {
+                    linkedvsrc = gst_pad_get_peer(vsink);
+                    if(linkedvsrc)
+                        {
+                        gst_pad_unlink(linkedvsrc,vsink);
+                        }
+                    }
+                src = gst_element_get_static_pad(mCtx->codecbin,"src");
+                if(src)
+                    {
+                    linkedsink = gst_pad_get_peer(src);
+                    if(linkedsink)
+                        {
+                        gst_pad_unlink(src,linkedsink);
+                        }
+                    }
+
+                gst_element_set_state( GST_ELEMENT(mCtx->codecbin), GST_STATE_NULL );
+                gst_element_get_state( GST_ELEMENT(mCtx->codecbin),NULL,NULL,1000 );
+                gst_bin_remove( GST_BIN(bCtx->bin), mCtx->codecbin );
+                /*reset filesink too*/
+                gst_element_set_state(GST_ELEMENT(mCtx->datasink),GST_STATE_NULL);
+                gst_element_sync_state_with_parent(mCtx->datasink);
+                gst_element_get_state(mCtx->datasink,NULL,NULL,XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
+
+                DEBUG_INFO("Link new encodebin");
+                mCtx->codecbin = newBin;
+                gst_bin_add(GST_BIN(bCtx->bin), mCtx->codecbin);
+                asink = gst_element_get_static_pad(mCtx->codecbin,"sink");
+                if(asink && linkedasrc)
+                    {
+                    gst_pad_link(linkedasrc,asink);
+                    }
+                vsink = gst_element_get_static_pad(mCtx->codecbin,"v_sink");
+                if(vsink && linkedvsrc)
+                    {
+                    gst_pad_link(linkedvsrc,vsink);
+                    }
+                src = gst_element_get_static_pad(mCtx->codecbin,"src");
+                if(src && linkedsink)
+                    {
+                    gst_pad_link(src,linkedsink);
+                    }
+
+                if(mCtx->isobjvsrc)
+                    {
+                    moSrc = gst_element_get_static_pad(mCtx->videosource,"MRObjSrc");
+                    if(moSink&&moSrc)
+                        {
+                        gst_pad_link(moSrc,moSink);
+                        }
+                    }
+
+                /*re-roll*/
+                DEBUG_INFO("Reroll pipeline");
+                bCtx->binWantedState = GST_STATE_PAUSED;
+                gret = gst_element_set_state( GST_ELEMENT(bCtx->bin), bCtx->binWantedState);
+                if( gret == GST_STATE_CHANGE_ASYNC )
+                    {
+                    DEBUG_INFO("Wait for reroll");
+                    XAAdaptationBase_StartAsyncWait(bCtx);
+                    }
+                else if( gret == GST_STATE_CHANGE_FAILURE )
+                    {
+                    DEBUG_ERR("reroll FAILED");
+                    ret = XA_RESULT_INTERNAL_ERROR;
+                    }
+                bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
+                DEBUG_INFO_A1("Pipeline in state %s",gst_element_state_get_name(GST_STATE(bCtx->bin)));
+                }
+            else
+                {
+                /* could not support wanted encoders */
+                DEBUG_ERR("Failed to create encodebin with new settings, using old one!");
+                ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                }
+            }
+        else
+            { /* n/a while playing */
+            DEBUG_ERR("Cannot change encoder when recording ongoing!");
+            ret = XA_RESULT_PRECONDITIONS_VIOLATED;
+            }
+        DEBUG_API("<-XAMediaRecorderAdapt_ChangeEncoders");
+        return ret;
+        }
+
+    /**
+     * GstElement* XAMediaRecorderAdapt_CreateEncodeBin( XAMediaRecorderAdaptationCtx* ctx )
+     * @return GstElement* - pointer to created bin element
+     * Decription: Create encoder/muxer element based on given format and encoder settings
+     */
+    GstElement* XAMediaRecorderAdapt_CreateEncodeBin( XAMediaRecorderAdaptationCtx* ctx )
+        {
+        XAresult ret = XA_RESULT_SUCCESS;
+        GstElement *audioenc = NULL, *videoenc=NULL, *mux=NULL;
+        GstElement *codecbin = gst_bin_new( "mrcodecbin" );
+        GstPad *ghostsrc = NULL, *ghostaudiosink = NULL, *ghostvideosink = NULL;
+        XAuint32 format;
+        XAStaticCapsData temp;
+
+        DEBUG_API("->XAMediaRecorderAdapt_CreateEncodeBin");
+        if(ctx->recModes & XA_RECMODE_STREAM)
+            {
+            if(ctx->xaSink && ctx->xaSink->pFormat)
+                {
+                format = *(XAuint32*)(ctx->xaSink->pFormat);
+                switch ( format )
+                    {
+                    case XA_DATAFORMAT_PCM:
+                    DEBUG_INFO("XA_DATAFORMAT_PCM");
+                        {
+                        XADataFormat_PCM* pcm = ((XADataFormat_PCM*)ctx->xaSink->pFormat);
+                        if(!ctx->xaAudioSource)
+                            {
+                            DEBUG_ERR("Unsupported dataformat for given data sources");
+                            return NULL;
+                            }
+                        /* no need for codec, just pass data on */
+                        mux = gst_element_factory_make("identity", "mux");
+                        gst_bin_add(GST_BIN(codecbin), mux);
+                        ghostsrc = gst_element_get_static_pad(mux,"src");
+                        ghostaudiosink = gst_element_get_static_pad(mux,"sink");
+                        /*set usable audio settings from the sink structure*/
+                        ctx->audioEncSettings.encoderId = XA_AUDIOCODEC_PCM;
+                        ctx->audioEncSettings.channelsOut = pcm->numChannels;
+                        ctx->audioEncSettings.bitsPerSample = pcm->bitsPerSample;
+                        }
+                    break;
+
+                    case XA_DATAFORMAT_RAWIMAGE:
+                    DEBUG_INFO("XA_DATAFORMAT_RAWIMAGE");
+                        {
+                        XADataFormat_RawImage* img = ((XADataFormat_RawImage*)ctx->xaSink->pFormat);
+                        if(!ctx->xaVideoSource)
+                            {
+                            DEBUG_ERR("Unsupported dataformat for given data sources");
+                            return NULL;
+                            }
+                        /* no need for codec, just pass data on */
+                        mux = gst_element_factory_make("identity", "mux");
+                        gst_bin_add(GST_BIN(codecbin), mux);
+                        ghostsrc = gst_element_get_static_pad(mux,"src");
+                        ghostvideosink = gst_element_get_static_pad(mux,"sink");
+                        /*set needed image settings from the sink structure*/
+                        ctx->imageEncSettings.encoderId = XA_IMAGECODEC_RAW;
+                        ctx->imageEncSettings.width = img->width;
+                        ctx->imageEncSettings.height = img->height;
+                        ctx->imageEncSettings.colorFormat = img->colorFormat;
+                        }
+                    break;
+
+                    case XA_DATAFORMAT_MIME:
+                    DEBUG_INFO("XA_DATAFORMAT_MIME ");
+                        {
+                        XADataFormat_MIME* mime = ((XADataFormat_MIME*)ctx->xaSink->pFormat);
+                        DEBUG_INFO_A1("mime->containerType:%u",(int)mime->containerType);
+                        DEBUG_INFO_A1("mime->mimeType:%s",mime->mimeType);
+                        switch ( mime->containerType )
+                            {
+                            case XA_CONTAINERTYPE_AVI:
+                            DEBUG_INFO("XA_CONTAINERTYPE_AVI");
+                            mux = gst_element_factory_make("avimux", "mux");
+                            if(mux)
+                                {
+                                if (gst_bin_add(GST_BIN(codecbin), mux))
+                                    {
+                                    DEBUG_INFO("Added mux to codecbin");
+                                    }
+                                else
+                                    {
+                                    DEBUG_ERR("Could not add mux to codecbin");
+                                    return NULL;
+                                    }
+                                /*use this as linkpoint*/
+                                ghostsrc = gst_element_get_static_pad(mux,"src");
+                                }
+                            /* Add and link audio/video codecs */
+                            /*set video defaults*/
+                            if(ctx->videoEncSettings.encoderId == XA_ADAPTID_UNINITED)
+                            ctx->videoEncSettings.encoderId = XA_ADAPTID_MOTIONJPEG;
+                            if(ctx->xaVideoSource)
+                                {
+                                if(XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_VIDEO, ctx->videoEncSettings.encoderId, &temp) == XA_RESULT_SUCCESS)
+                                    {
+                                    if(temp.adaptId)
+                                        {
+                                        videoenc = gst_element_factory_make((char*)temp.adaptId, "videoenc");
+                                        }
+                                    }
+                                if(videoenc)
+                                    {
+                                    gst_bin_add(GST_BIN(codecbin), videoenc);
+                                    if(!gst_element_link(videoenc, mux))
+                                        {
+                                        DEBUG_ERR("Could not link videoenc to mux!!");
+                                        DEBUG_API("<-XAMediaRecorderAdapt_CreateEncodeBin");
+                                        return NULL;
+                                        }
+                                    ghostvideosink = gst_element_get_static_pad(videoenc,"sink");
+                                    }
+                                else
+                                    {
+                                    /*no video codec but video source = raw video case, request video pad directly from mux*/
+                                    ghostvideosink = gst_element_get_request_pad(mux,"video_%d");
+                                    }
+                                }
+                            /*set audio defaults*/
+                            if(ctx->audioEncSettings.encoderId == XA_ADAPTID_UNINITED)
+                            ctx->audioEncSettings.encoderId = XA_AUDIOCODEC_PCM;
+                            if(ctx->xaAudioSource)
+                                {
+                                if(XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_AUDIO, ctx->audioEncSettings.encoderId, &temp) == XA_RESULT_SUCCESS)
+                                    {
+                                    if(temp.adaptId)
+                                        {
+                                        audioenc = gst_element_factory_make((char*)temp.adaptId, "audioenc");
+                                        }
+                                    }
+                                if(audioenc)
+                                    {
+                                    gst_bin_add(GST_BIN(codecbin), audioenc);
+                                    if(!gst_element_link(audioenc, mux))
+                                        {
+                                        DEBUG_ERR("Could not link audioenc to mux!!");
+                                        DEBUG_API("<-XAMediaRecorderAdapt_CreateEncodeBin");
+                                        return NULL;
+                                        }
+                                    ghostaudiosink = gst_element_get_static_pad(audioenc,"sink");
+                                    }
+                                else
+                                    {
+                                    /*no audio codec but audio source = PCM case, explicity request audio pad*/
+                                    ghostaudiosink = gst_element_get_request_pad(mux,"audio_%d");
+                                    }
+                                }
+                            break;
+
+                            case XA_CONTAINERTYPE_WAV:
+                            DEBUG_INFO("XA_CONTAINERTYPE_WAV");
+                            audioenc = gst_element_factory_make("wavenc", "audioenc");
+                            if(audioenc)
+                                {
+                                if (gst_bin_add(GST_BIN(codecbin), audioenc))
+                                    {
+                                    DEBUG_INFO("added audioenc to codecbin");
+                                    }
+                                else
+                                    {
+                                    DEBUG_ERR("Could not add audioenc to codecbin");
+                                    return NULL;
+                                    }
+                                /*use this as linkpoint*/
+                                ghostsrc = gst_element_get_static_pad(audioenc,"src");
+                                ghostaudiosink = gst_element_get_static_pad(audioenc,"sink");
+                                if ( ghostsrc == NULL || ghostaudiosink == NULL)
+                                    {
+                                    DEBUG_ERR("Could not get src or sink ghoset element(s)");
+                                    return NULL;
+                                    }
+                                }
+                            /* no other codecs needed */
+                            break;
+                            case XA_CONTAINERTYPE_JPG:
+                            /*motion jpeg*/
+                            DEBUG_INFO("XA_CONTAINERTYPE_JPG");
+                            /*set defaults*/
+                            if(ctx->videoEncSettings.encoderId == XA_ADAPTID_UNINITED)
+                            ctx->videoEncSettings.encoderId = XA_ADAPTID_MOTIONJPEG;
+                            if(XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_VIDEO, ctx->videoEncSettings.encoderId, &temp) == XA_RESULT_SUCCESS)
+                                {
+                                videoenc = gst_element_factory_make((char*)temp.adaptId, "videoenc");
+                                }
+                            if(videoenc)
+                                {
+                                gst_bin_add(GST_BIN(codecbin), videoenc);
+                                /*use this as linkpoint*/
+                                ghostsrc = gst_element_get_static_pad(videoenc,"src");
+                                ghostvideosink = gst_element_get_static_pad(videoenc,"sink");
+                                }
+                            /* no other codecs needed */
+                            break;
+                            case XA_CONTAINERTYPE_RAW:
+                            DEBUG_INFO("XA_CONTAINERTYPE_RAW");
+                            /* no need for codec, just pass data on */
+                            if(strncmp((char *)mime->mimeType, "video", 5) == 0 && ctx->xaVideoSource)
+                                {
+                                mux = gst_element_factory_make("identity", "mux");
+                                gst_bin_add(GST_BIN(codecbin), mux);
+                                ghostvideosink = gst_element_get_static_pad(mux,"sink");
+                                }
+                            else if (strncmp((char *)mime->mimeType, "audio", 5) == 0 && ctx->xaAudioSource)
+                                {
+                                mux = gst_element_factory_make("identity", "mux");
+                                gst_bin_add(GST_BIN(codecbin), mux);
+                                ghostaudiosink = gst_element_get_static_pad(mux,"sink");
+                                }
+                            else
+                                {
+                                ret = XA_RESULT_CONTENT_UNSUPPORTED;
+                                DEBUG_ERR("Content mismatch with given sources!!!")
+                                }
+                            ghostsrc = gst_element_get_static_pad(mux,"src");
+                            break;
+                            case XA_CONTAINERTYPE_UNSPECIFIED:
+                            DEBUG_INFO("No support for requested encoder...try to select encoder from mime string");
+                            if(strstr( (char *) mime->mimeType, "/ogg") != 0)
+                                {
+                                DEBUG_INFO("XA_CONTAINERTYPE_UNSPECIFIED - mimetype ogg detected");
+                                mux = gst_element_factory_make("oggmux", "mux");
+                                if(mux)
+                                    {
+                                    gst_bin_add(GST_BIN(codecbin), mux);
+                                    /*use this as linkpoint*/
+                                    ghostsrc = gst_element_get_static_pad(mux,"src");
+                                    /*set defaults*/
+                                    if(ctx->audioEncSettings.encoderId == XA_ADAPTID_UNINITED)
+                                        {
+                                        ctx->audioEncSettings.encoderId = XA_ADAPTID_VORBIS;
+                                        ctx->audioEncSettings.bitsPerSample=32;
+                                        }
+                                    if(ctx->videoEncSettings.encoderId == XA_ADAPTID_UNINITED)
+                                        {
+                                        ctx->videoEncSettings.encoderId = XA_ADAPTID_THEORA;
+                                        }
+                                    if(ctx->xaAudioSource)
+                                        {
+                                        if(XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_AUDIO, ctx->audioEncSettings.encoderId, &temp) == XA_RESULT_SUCCESS)
+                                            {
+                                            audioenc = gst_element_factory_make((char*)temp.adaptId, "audioenc");
+                                            }
+                                        if(audioenc)
+                                            {
+                                            gst_bin_add(GST_BIN(codecbin), audioenc);
+                                            gst_element_link(audioenc, mux);
+                                            ghostaudiosink = gst_element_get_static_pad(audioenc,"sink");
+                                            }
+                                        }
+                                    if(strncmp((char *)mime->mimeType, "video", 5) == 0 && ctx->xaVideoSource)
+                                        {
+                                        if(XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_VIDEO, ctx->videoEncSettings.encoderId, &temp) == XA_RESULT_SUCCESS)
+                                            {
+                                            videoenc = gst_element_factory_make((char*)temp.adaptId, "videoenc");
+                                            }
+                                        if(videoenc)
+                                            {
+                                            gst_bin_add(GST_BIN(codecbin), videoenc);
+                                            gst_element_link(videoenc, mux);
+                                            ghostvideosink = gst_element_get_static_pad(videoenc,"sink");
+                                            }
+                                        }
+                                    }
+                                }
+                            else
+                                {
+                                DEBUG_INFO("No support for requested mime/container type.");
+                                ret = XA_RESULT_CONTENT_UNSUPPORTED;
+                                }
+                            break;
+                            case XA_CONTAINERTYPE_MOBILE_DLS:
+                            case XA_CONTAINERTYPE_MP4:
+                            case XA_CONTAINERTYPE_AMR:
+                            case XA_CONTAINERTYPE_3GPP:
+                            case XA_CONTAINERTYPE_BMP:
+                            case XA_CONTAINERTYPE_ASF:
+                            case XA_CONTAINERTYPE_M4A:
+                            case XA_CONTAINERTYPE_MP3:
+                            case XA_CONTAINERTYPE_JPG2000:
+                            case XA_CONTAINERTYPE_MPEG_ES:
+                            case XA_CONTAINERTYPE_MPEG_PS:
+                            case XA_CONTAINERTYPE_MPEG_TS:
+                            case XA_CONTAINERTYPE_QT:
+                            case XA_CONTAINERTYPE_XMF_0:
+                            case XA_CONTAINERTYPE_XMF_1:
+                            case XA_CONTAINERTYPE_XMF_2:
+                            case XA_CONTAINERTYPE_XMF_3:
+                            case XA_CONTAINERTYPE_XMF_GENERIC:
+                            case XA_CONTAINERTYPE_AAC:
+                            case XA_CONTAINERTYPE_3GA:
+                            case XA_CONTAINERTYPE_RM:
+                            case XA_CONTAINERTYPE_DMF:
+                            default:
+                            DEBUG_INFO("No support for requested container type.");
+                            ret = XA_RESULT_CONTENT_UNSUPPORTED;
+                            break;
+                            }
+                        break;
+                        }
+                    default:
+                    DEBUG_ERR("Incorrect data format type.");
+                    ret = XA_RESULT_PARAMETER_INVALID;
+                    break;
+                    }
+                }
+            else
+                {
+                DEBUG_ERR("Invalid data sink for stream recording!!");
+                ret = XA_RESULT_PARAMETER_INVALID;
+                }
+            }
+        else
+            {/* stream recording not requested, datasink ignored, use uncoded recordstream*/
+            mux = gst_element_factory_make("identity", "mux");
+            gst_bin_add(GST_BIN(codecbin), mux);
+            ghostsrc = gst_element_get_static_pad(mux,"src");
+            ghostvideosink = gst_element_get_static_pad(mux,"sink");
+            }
+
+        /*set default codecs for unrecognized*/
+        if(ctx->audioEncSettings.encoderId == XA_ADAPTID_UNINITED)
+        ctx->audioEncSettings.encoderId = XA_AUDIOCODEC_PCM;
+        if(ctx->imageEncSettings.encoderId == XA_ADAPTID_UNINITED)
+        ctx->imageEncSettings.encoderId = XA_IMAGECODEC_RAW;
+        if(ctx->videoEncSettings.encoderId == XA_ADAPTID_UNINITED)
+        ctx->videoEncSettings.encoderId = XA_ADAPTID_RAWVIDEO;
+
+        if ( ret != XA_RESULT_SUCCESS )
+            {
+            gst_object_unref(codecbin);
+            codecbin=NULL;
+            }
+        else
+            {
+            /*add ghost pad(s) to link to*/
+            if(ghostsrc)
+                {
+                gst_element_add_pad(codecbin, gst_ghost_pad_new("src",ghostsrc));
+                gst_object_unref(GST_OBJECT(ghostsrc));
+                }
+            if(ghostaudiosink)
+                {
+                gst_element_add_pad(codecbin, gst_ghost_pad_new("sink",ghostaudiosink));
+                gst_object_unref(GST_OBJECT(ghostaudiosink));
+                }
+            if(ghostvideosink)
+                {
+                gst_element_add_pad(codecbin, gst_ghost_pad_new("v_sink",ghostvideosink));
+                gst_object_unref(GST_OBJECT(ghostvideosink));
+                }
+            DEBUG_INFO_A1("Created encoder bin at %x", (int)codecbin);
+            }
+
+        DEBUG_API("<-XAMediaRecorderAdapt_CreateEncodeBin");
+        return codecbin;
+
+        }
+
+    /*
+     * void XAMediaRecorderAdapt_BufferAvailable(GstElement* sink, gpointer user_data)
+     * called when new buffer is available at appsink
+     */
+    void XAMediaRecorderAdapt_BufferAvailable(GstElement* sink, gpointer user_data)
+        {
+        GstBuffer *buffer=NULL;
+        XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*)user_data;
+        DEBUG_API("->XAMediaRecorderAdapt_BufferAvailable");
+        if(!mCtx || !mCtx->xaSink)
+            {
+            DEBUG_ERR("Invalid context")
+            return;
+            }
+        /* get the buffer */
+        buffer = gst_app_sink_pull_buffer(GST_APP_SINK(sink));
+        if(buffer)
+            {
+            guint size;
+            XADataLocator_Address* address;
+            size = GST_BUFFER_SIZE(buffer);
+            DEBUG_INFO_A1("Pulled new buffer of size %d", size);
+            address = (XADataLocator_Address*)(mCtx->xaSink->pLocator);
+            if( !address || *(XAuint32*)address != XA_DATALOCATOR_ADDRESS )
+                {
+                DEBUG_ERR("Invalid address datalocator")
+                return;
+                }
+
+            if(mCtx->writepos + size < address->length )
+                { /*enough room in buffer*/
+                memcpy(((char*)(address->pAddress) + mCtx->writepos),
+                        GST_BUFFER_DATA (buffer), size);
+                mCtx->writepos+=size;
+                }
+            else
+                { /*not enough room in buffer*/
+                XAAdaptEvent event =
+                    {XA_RECORDITFEVENTS, XA_RECORDEVENT_BUFFER_FULL, 0, NULL};
+
+                size = address->length - mCtx->writepos;
+                memcpy(((char*)(address->pAddress) + mCtx->writepos),
+                        GST_BUFFER_DATA (buffer), size);
+                DEBUG_INFO_A1("Buffer insufficient, wrote %d bytes", size);
+                /* send event */
+                XAAdaptationBase_SendAdaptEvents(&(mCtx->baseObj), &event);
+                /* "recordhead to start" i.e. reset write position */
+                mCtx->writepos=0;
+                mCtx->recThrCtx.buffer_insufficient = XA_BOOLEAN_TRUE;
+                if ( XAImpl_PostSemaphore( mCtx->recThrCtx.bufInsufficientSem ) != XA_RESULT_SUCCESS)
+                    {
+                    DEBUG_ERR("Posting buffer-insufficien semaphore FAILED!");
+                    }
+                }
+            gst_buffer_unref (buffer);
+            }
+        else
+            {
+            DEBUG_ERR("Could not pull buffer from appsink!");
+            }
+        DEBUG_API("<-XAMediaRecorderAdapt_BufferAvailable");
+        }
+
+    /*
+     * XAresult XAMediaRecorderAdapt_InitContentPipeSink(ctx);
+     */
+    XAresult XAMediaRecorderAdapt_InitContentPipeSink(XAMediaRecorderAdaptationCtx* ctx)
+        {
+        XAresult ret = XA_RESULT_SUCCESS;
+        CPresult res;
+        GstStateChangeReturn gstRet = GST_STATE_CHANGE_SUCCESS;
+        DEBUG_API("->XAMediaRecorderAdapt_InitContentPipeSink");
+        ctx->baseObj.pipeSinkThrCtx.appSink = GST_APP_SINK(ctx->datasink);
+        ctx->baseObj.pipeSinkThrCtx.pipe = (XADataLocator_ContentPipe*)(ctx->xaSink->pLocator);
+
+        /* Create thread for content pipe source */
+        ret = XAImpl_CreateThreadHandle( &(ctx->baseObj.pipeSinkThr) );
+        if ( ret != XA_RESULT_SUCCESS )
+            {
+            DEBUG_ERR("Could not create thread for content pipe sink!");
+            DEBUG_API("<-XAMediaRecorderAdapt_InitContentPipeSink");
+            return ret;
+            }
+
+        /* Create semaphore for content pipe source */
+        ret = XAImpl_CreateSemaphore( &(ctx->baseObj.pipeSinkThrCtx.stateSem));
+        if ( ret != XA_RESULT_SUCCESS )
+            {
+            DEBUG_ERR("Could not create semaphore for content pipe source!");
+            DEBUG_API("<-XAMediaRecorderAdapt_InitContentPipeSink");
+            return ret;
+            }
+
+        /* Open content pipe */
+        res = ctx->baseObj.pipeSinkThrCtx.pipe->pContentPipe->Open(&(ctx->baseObj.pipeSinkThrCtx.dataHandle),
+                (CPstring)(ctx->baseObj.pipeSinkThrCtx.pipe->URI),
+                CP_AccessWrite );
+        if ( res == EXIT_FAILURE )
+            { /* Could not open content pipe data handle, try to create new one */
+            res = ctx->baseObj.pipeSinkThrCtx.pipe->pContentPipe->Create(&(ctx->baseObj.pipeSinkThrCtx.dataHandle),
+                    (CPstring)(ctx->baseObj.pipeSinkThrCtx.pipe->URI));
+            if ( res == EXIT_FAILURE)
+                {
+                DEBUG_ERR("Could not create Content Pipe data handle!")
+                return XA_RESULT_INTERNAL_ERROR;
+                }
+            res = ctx->baseObj.pipeSinkThrCtx.pipe->pContentPipe->Open(&(ctx->baseObj.pipeSinkThrCtx.dataHandle),
+                    (CPstring)(ctx->baseObj.pipeSinkThrCtx.pipe->URI),
+                    CP_AccessWrite );
+            if ( res == EXIT_FAILURE)
+                {
+                DEBUG_ERR("Could not open newly created Content Pipe data handle!")
+                return XA_RESULT_INTERNAL_ERROR;
+                }
+            }
+
+        res = ctx->baseObj.pipeSinkThrCtx.pipe->pContentPipe->RegisterCallback( &(ctx->baseObj.pipeSinkThrCtx.dataHandle), &XAAdaptationBase_ContentPipeSinkCb);
+        if ( res == EXIT_FAILURE )
+            {
+            DEBUG_ERR("Could not register content pipe callbacks!")
+            return XA_RESULT_INTERNAL_ERROR;
+            }
+
+        gstRet = gst_element_set_state( GST_ELEMENT(ctx->datasink), GST_STATE_PAUSED);
+
+        ctx->baseObj.pipeSinkThrCtx.state = CPStateStarted;
+        XAImpl_StartThread( &(ctx->baseObj.pipeSrcThr), NULL, &XAAdaptationBase_ContentPipeSinkThrFunc, &(ctx->baseObj.pipeSinkThrCtx) );
+
+        DEBUG_API("<-XAMediaRecorderAdapt_InitContentPipeSink");
+        return ret;
+        }
+
+    /*
+     * void* XAMediaRecorderAdapt_RecordEventThr( void* ctx )
+     */
+    void* XAMediaRecorderAdapt_RecordEventThr( void* ctx )
+        {
+        XAMediaRecorderAdaptationCtx* mrCtx = (XAMediaRecorderAdaptationCtx*)ctx;
+        GstStateChangeReturn gret;
+        XAresult ret;
+        DEBUG_API("->XAMediaRecorderAdapt_RecordEventThr");
+
+        /* Wait semaphore here */
+        ret = XAImpl_WaitSemaphore( mrCtx->recThrCtx.bufInsufficientSem );
+        if ( ret != XA_RESULT_SUCCESS)
+            {
+            DEBUG_ERR("Could not start semaphore");
+            }
+
+        if(mrCtx->recThrCtx.buffer_insufficient)
+            {
+            mrCtx->baseObj.binWantedState = GST_STATE_PAUSED;
+            XAAdaptationBase_PrepareAsyncWait(&(mrCtx->baseObj));
+            gret = gst_element_set_state( GST_ELEMENT(mrCtx->baseObj.bin), mrCtx->baseObj.binWantedState);
+            if( gret == GST_STATE_CHANGE_ASYNC )
+                {
+                DEBUG_INFO("Start to wait recoder state change.");
+                XAAdaptationBase_StartAsyncWait(&(mrCtx->baseObj));
+                DEBUG_INFO("Recorder state change async. SUCCESFULL.");
+                }
+            else if( gret == GST_STATE_CHANGE_FAILURE )
+                {
+                DEBUG_INFO("Recorder state change FAILED");
+                /*ret = XA_RESULT_INTERNAL_ERROR;*/
+                }
+            else
+                {
+                DEBUG_INFO("Recorder state change SUCCESFULL")
+                }
+
+            mrCtx->baseObj.waitingasyncop= XA_BOOLEAN_FALSE;
+            }
+        DEBUG_API("<-XAMediaRecorderAdapt_RecordEventThr");
+        return NULL;
+        }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xamediarecorderadaptctx.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,37 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAMEDIARECORDERADAPTCTX_H_
+#define XAMEDIARECORDERADAPTCTX_H_
+
+#include "XAAdaptationContextBase.h"
+
+
+/* TYPEDEFS */
+#define XA_RECMODE_STREAM 1
+#define XA_RECMODE_STILL 2
+
+typedef struct XAMediaRecorderAdaptationCtx_ XAMediaRecorderAdaptationCtx;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XAMediaRecorderAdapt_Create(  XADataSource* pAudioSrc, XADataSource* pImageVideoSrc, XADataSink* pDataSnk, XAuint8 recModes );
+XAresult XAMediaRecorderAdapt_PostInit( XAAdaptationBaseCtx* bCtx );
+void XAMediaRecorderAdapt_Destroy( XAAdaptationBaseCtx* bCtx );
+XAresult XAMediaRecorderAdapt_InitContentPipeSink(XAMediaRecorderAdaptationCtx* ctx);
+void*  XAMediaRecorderAdapt_RecordEventThr(void* ctx);
+
+#endif /* XAMEDIARECORDERADAPTCTX_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xametadataadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,1202 @@
+/*
+* 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 <string.h>
+#include <gst.h>
+#include "XAAdaptation.h"
+#include "XAMetadataAdaptCtx.h"
+#include "XAMediaPlayerAdaptCtx.h"
+#include "XAMediaRecorderAdaptCtx.h"
+#include "XAMetadataAdaptation.h"
+
+/* forward declarations of internal methods */
+XAMetadataAdaptVars* XAMetadataAdapt_GetMetadataVars(XAAdaptationBaseCtx *bCtx);
+GstStructure* XAMetadataAdapt_GetChildStructure(XAMetadataAdaptVars* mdv, XAuint32 index);
+gboolean XAMetadataAdapt_CountTags(GQuark gkey, const GValue *gvalue, gpointer counter);
+void XAMetadataAdapt_ParseTag(const GstTagList* list, const gchar* tag, gpointer listptr);
+gboolean XAMetadataAdapt_ParseItem(GQuark field_id, const GValue * value, gpointer listptr);
+gboolean XAMetadataAdapt_GstTagCb( GstBus *bus, GstMessage *message, gpointer data );
+
+/*NOTE: no way to query these dynamically?*/
+/*supported keys for metadata insertion*/
+static char* xaMetadataAdaptSupportedKeys[] = {
+    KHRONOS_TITLE,
+    KHRONOS_ALBUM,
+    KHRONOS_TRACK_NUMBER,
+    KHRONOS_ARTIST,
+    KHRONOS_GENRE,
+    KHRONOS_COMMENT,
+    KHRONOS_COPYRIGHT,
+    GST_TAG_TITLE,
+    GST_TAG_TITLE_SORTNAME,
+    GST_TAG_ARTIST,
+    GST_TAG_ARTIST_SORTNAME,
+    GST_TAG_ALBUM,
+    GST_TAG_ALBUM_SORTNAME,
+    GST_TAG_COMPOSER,
+    GST_TAG_DATE,
+    GST_TAG_GENRE,
+    GST_TAG_COMMENT,
+    GST_TAG_EXTENDED_COMMENT,
+    GST_TAG_TRACK_NUMBER,
+    GST_TAG_TRACK_COUNT,
+    GST_TAG_ALBUM_VOLUME_NUMBER,
+    GST_TAG_ALBUM_VOLUME_COUNT,
+    GST_TAG_LOCATION,
+    GST_TAG_DESCRIPTION,
+    GST_TAG_VERSION,
+    GST_TAG_ISRC,
+    GST_TAG_ORGANIZATION,
+    GST_TAG_COPYRIGHT,
+    GST_TAG_COPYRIGHT_URI,
+    GST_TAG_CONTACT,
+    GST_TAG_LICENSE,
+    GST_TAG_LICENSE_URI,
+    GST_TAG_PERFORMER,
+    NULL
+};
+
+/******************************************************************************
+ * COMMONS
+ ******************************************************************************/
+
+
+/* const char* XAMetadataAdapt_ParseKhronosKey(const char* pKKey)
+ * Translates Khronos key string to adaptation-specific key string
+ * @return Translated key string
+ */
+const XAchar* XAMetadataAdapt_ParseKhronosKey(const XAchar* pKKey)
+{
+    const XAchar* newKey;
+    DEBUG_API_A1("->XAMetadataAdapt_ParseKhronosKey: \"%s\"", (char*)pKKey);
+    if( strcmp((char*)pKKey,KHRONOS_TITLE) ==0 ) newKey = (XAchar*)GST_TAG_TITLE;
+    else if( strcmp((char*)pKKey,KHRONOS_ALBUM) ==0 ) newKey = (XAchar*)GST_TAG_ALBUM;
+    else if( strcmp((char*)pKKey,KHRONOS_TRACK_NUMBER) ==0 ) newKey = (XAchar*)GST_TAG_TRACK_NUMBER;
+    else if( strcmp((char*)pKKey,KHRONOS_ARTIST) ==0 ) newKey = (XAchar*)GST_TAG_ARTIST;
+    else if( strcmp((char*)pKKey,KHRONOS_GENRE) ==0 ) newKey = (XAchar*)GST_TAG_GENRE;
+    else if( strcmp((char*)pKKey,KHRONOS_COMMENT) ==0 ) newKey = (XAchar*)GST_TAG_COMMENT;
+    else if( strcmp((char*)pKKey,KHRONOS_COPYRIGHT) ==0 ) newKey = (XAchar*)GST_TAG_COPYRIGHT;
+    else newKey = pKKey;
+/* No Gst keys for following:
+    else if( strcmp(pKKey,KHRONOS_YEAR) ==0 ) newKey = ;
+    else if( strcmp(pKKey,KHRONOS_ARTIST_URL) ==0 ) newKey = ;
+    else if( strcmp(pKKey,KHRONOS_CONTENT_URL) ==0 ) newKey = ;
+    else if( strcmp(pKKey,KHRONOS_RATING) ==0 ) newKey = ;
+    else if( strcmp(pKKey,KHRONOS_ALBUM_ART) ==0 ) newKey = ;
+ */
+    DEBUG_API_A1("<-XAMetadataAdapt_ParseKhronosKey: => \"%s\"", (char*)newKey);
+    return newKey;
+}
+
+/* XAresult XAMetadataAdapt_PreInit(XAAdaptationBaseCtx *bCtx)
+ * Initialize values needed before preroll
+ * @return XAresult ret - Success value
+ */
+XAresult XAMetadataAdapt_PreInit(XAAdaptationBaseCtx *bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMetadataAdaptVars* mdv;
+    DEBUG_API("->XAMetadataAdapt_PreInit");
+    if( bCtx->ctxId == XAMDAdaptation ||
+        bCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        mdv = calloc(1, sizeof(XAMetadataAdaptVars));
+        mdv->currentchild = &(mdv->generaltags);
+        mdv->traversemode=XA_METADATATRAVERSALMODE_NODE;
+        ((XAMediaPlayerAdaptationCtx*)bCtx)->metadatavars = mdv;
+
+    }
+    else if ( bCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        mdv = calloc(1, sizeof(XAMetadataAdaptVars));
+        mdv->currentchild = &(mdv->generaltags);
+        mdv->traversemode=XA_METADATATRAVERSALMODE_NODE;
+        ((XAMediaRecorderAdaptationCtx*)bCtx)->metadatavars = mdv;
+    }
+    else
+    {
+        DEBUG_ERR("Unsupported metadata context!!");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+    }
+
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        if(bCtx->bus)
+        {
+            g_signal_connect(bCtx->bus, "message::tag", G_CALLBACK(XAMetadataAdapt_GstTagCb), bCtx );
+        }
+        else
+        {
+            DEBUG_ERR("No bus in context!!");
+            ret = XA_RESULT_PRECONDITIONS_VIOLATED;
+        }
+    }
+    DEBUG_API_A1("<-XAMetadataAdapt_PreInit (%d)", (int)ret);
+    return ret;
+}
+/* XAresult XAMetadataAdapt_PostInit(XAAdaptationBaseCtx *bCtx)
+ * Initialize values after preroll
+ * @return XAresult ret - Success value
+ */
+XAresult XAMetadataAdapt_PostInit(XAAdaptationBaseCtx *bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMetadataAdaptVars* mdv=NULL;
+    XAMediaPlayerAdaptationCtx* mCtx=NULL;
+    GstPad* tmppad=NULL;
+    GstCaps* tmpcaps=NULL;
+    GstElement* tmpelement=NULL;
+    XAAdaptEvent event = {XA_METADATAEVENTS, XA_ADAPT_MDE_TAGS_AVAILABLE, 0, NULL };
+
+    DEBUG_API("->XAMetadataAdapt_PostInit");
+    if( bCtx->ctxId == XAMDAdaptation ||
+        bCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        mdv = XAMetadataAdapt_GetMetadataVars(bCtx);
+        if( mdv )
+        {
+            mdv->childcount = 0;
+            /* try to dig out audio and video pads from decodebin for stream info tags */
+            /* NOTE: currently no good deterministic way to dig out undecoded pads
+             * from decodebin's internal demuxer, this is just ugly way to try to cope
+             * with most demuxers.
+             */
+            mCtx = ((XAMediaPlayerAdaptationCtx*)bCtx);
+            if(GST_IS_BIN(mCtx->codecbin))
+            {
+                tmpelement=gst_bin_get_by_name(GST_BIN(mCtx->codecbin),"typefind");
+                if(tmpelement)
+                {
+                    tmppad = gst_element_get_static_pad(GST_ELEMENT(tmpelement),"src");
+                    tmpelement=NULL;
+                    if(tmppad)
+                    {
+                        tmppad = gst_pad_get_peer(tmppad);
+                        if(tmppad)
+                        {
+                            tmpelement = gst_pad_get_parent_element(tmppad);
+                        }
+                    }
+                    /* now we have demuxer, if existing */
+                    if(tmpelement)
+                    {
+                        tmppad = gst_element_get_pad( tmpelement, "audio_00");
+                        if(tmppad)
+                        {
+                            tmpcaps = gst_pad_get_negotiated_caps( GST_PAD(tmppad) );
+                            if(tmpcaps==NULL || gst_caps_is_any(tmpcaps) || gst_caps_is_empty(tmpcaps))
+                            {
+                                mdv->audiotags = NULL;
+                                DEBUG_INFO("no usable audio properties found from pad !");
+                            }
+                            else
+                            {
+                                mdv->audiotags = gst_caps_get_structure(tmpcaps,0);
+                                mdv->childcount++;
+                                DEBUG_INFO_A1("found audio node: %s",gst_caps_to_string(tmpcaps));
+                            }
+                        }
+                        tmppad = gst_element_get_pad( tmpelement, "video_00");
+                        if(tmppad)
+                        {
+                            tmpcaps = gst_pad_get_negotiated_caps( GST_PAD(tmppad) );
+                            if(tmpcaps==NULL || gst_caps_is_any(tmpcaps) || gst_caps_is_empty(tmpcaps))
+                            {
+                                mdv->videotags = NULL;
+                                DEBUG_INFO("no usable video properties found from pad !");
+                            }
+                            else
+                            {
+                                mdv->videotags = gst_caps_get_structure(tmpcaps,0);
+                                mdv->childcount++;
+                                DEBUG_INFO_A1("found video node: %s",gst_caps_to_string(tmpcaps));
+                            }
+                        }
+                    }
+                }
+            }
+            XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+        }
+    }
+
+    if ( tmpelement )
+    {
+    	gst_object_unref( tmpelement );
+    }
+    if ( tmppad )
+    {
+    	gst_object_unref( tmppad );
+    }
+    if ( tmpcaps )
+    {
+    	gst_object_unref( tmpcaps );
+    }
+
+    DEBUG_API_A1("<-XAMetadataAdapt_PostInit (%d)", (int)ret);
+    return ret;
+}
+
+/*
+ * void XAMetadataAdapt_FreeImplTagList(XAMetadataImplTagList *list, XAboolean freeItems)
+ * deallocate elements inside taglist
+ */
+void XAMetadataAdapt_FreeImplTagList(XAMetadataImplTagList *list, XAboolean freeItems)
+{
+    XAuint16 i;
+    DEBUG_API("->XAMetadataExtractionItfAdapt_FreeTagList");
+    if(list->mdeKeys)
+    {
+        for(i=0;i<list->itemcount;i++)
+        {
+            if(list->mdeKeys[i])
+            {
+                if(freeItems)
+                    free(list->mdeKeys[i]);
+                list->mdeKeys[i]=NULL;
+            }
+        }
+        free(list->mdeKeys);
+        list->mdeKeys = NULL;
+    }
+    if(list->mdeValues)
+    {
+        for(i=0;i<list->itemcount;i++)
+        {
+            if(list->mdeValues[i])
+            {
+                if(freeItems)
+                    free(list->mdeValues[i]);
+                list->mdeValues[i]=NULL;
+            }
+        }
+        free(list->mdeValues);
+        list->mdeValues = NULL;
+    }
+    list->itemcount = 0;
+    DEBUG_API("<-XAMetadataExtractionItfAdapt_FreeTagList");
+}
+
+/*
+ * void XAMetadataAdapt_FreeVars(XAMetadataAdaptVars *vars)
+ * deallocate XAMetadataAdaptVars
+ */
+void XAMetadataAdapt_FreeVars(XAMetadataAdaptVars *vars)
+{
+    DEBUG_API("->XAMetadataAdapt_FreeVars");
+    if(vars)
+    {
+        if( vars->generaltags )
+        {
+            gst_tag_list_free(vars->generaltags);
+        }
+        if( vars->audiotags )
+        {
+            gst_structure_set_parent_refcount(vars->audiotags,NULL);
+            gst_structure_free(vars->audiotags);
+        }
+        if( vars->videotags )
+        {
+            gst_structure_set_parent_refcount(vars->videotags,NULL);
+            gst_structure_free(vars->videotags);
+        }
+        free(vars);
+    }
+    DEBUG_API("<-XAMetadataAdapt_FreeVars");
+}
+
+/******************************************************************************
+ * EXTRACTION
+ ******************************************************************************/
+
+/*
+ * XAresult XAMetadataExtractionItfAdapt_FillTagList()
+ * @param tagList - contains pointer to tag list to be updated
+ * @return XAresult ret - Success value
+ */
+XAresult XAMetadataExtractionItfAdapt_FillTagList(XAAdaptationBaseCtx *bCtx,
+                                                  XAMetadataImplTagList* tagList)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMetadataAdaptVars* mdv;
+    XAuint32 newcount = 0;
+    DEBUG_API("->XAMetadataExtractionItfAdapt_FillTagList");
+
+    mdv = XAMetadataAdapt_GetMetadataVars(bCtx);
+    if( mdv )
+    {
+        XAMetadataAdapt_FreeImplTagList(tagList, XA_BOOLEAN_TRUE);
+        /* get number of tags and allocate memory for them */
+        if(mdv->traversemode==XA_METADATATRAVERSALMODE_ALL)
+        {
+            if(mdv->generaltags)
+                gst_structure_foreach(mdv->generaltags, XAMetadataAdapt_CountTags, &newcount);
+            if(mdv->audiotags)
+                gst_structure_foreach(mdv->audiotags, XAMetadataAdapt_CountTags, &newcount);
+            if(mdv->videotags)
+                gst_structure_foreach(mdv->videotags, XAMetadataAdapt_CountTags, &newcount);
+        }
+        else
+        {
+            if(mdv->currentchild && *(mdv->currentchild))
+                gst_structure_foreach(*(mdv->currentchild), XAMetadataAdapt_CountTags, &newcount);
+        }
+        DEBUG_INFO_A1("tag count = %d",(int)newcount)
+        tagList->mdeKeys = calloc(newcount,sizeof(XAMetadataInfo*));
+        tagList->mdeValues = calloc(newcount,sizeof(XAMetadataInfo*));
+
+        /* fill in given tag list */
+        tagList->itemcount = 0;
+        if(mdv->traversemode==XA_METADATATRAVERSALMODE_ALL)
+        {
+            if(mdv->generaltags)
+                gst_tag_list_foreach(mdv->generaltags, XAMetadataAdapt_ParseTag, tagList);
+            if(mdv->audiotags)
+                gst_structure_foreach(mdv->audiotags, XAMetadataAdapt_ParseItem, tagList);
+            if(mdv->videotags)
+                gst_structure_foreach(mdv->videotags, XAMetadataAdapt_ParseItem, tagList);
+        }
+        else
+        {
+            if(mdv->currentchild && *(mdv->currentchild))
+            {
+                if(GST_IS_TAG_LIST(*(mdv->currentchild)))
+                {
+                    gst_tag_list_foreach(*(mdv->currentchild), XAMetadataAdapt_ParseTag, tagList);
+                }
+                else
+                {
+                    gst_structure_foreach(*(mdv->currentchild), XAMetadataAdapt_ParseItem, tagList);
+                }
+            }
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Metadata variables not found!!");
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_API_A1("<-XAMetadataExtractionItfAdapt_FillTagList (%d)", (int)ret);
+    return ret;
+}
+
+/******************************************************************************
+ * TRAVERSAL
+ *****************************************************************************/
+
+/*
+ * XAresult XAMetadataTraversalItfAdapt_SetMode(XAAdaptationBaseCtx *bCtx, XAuint32 mode)
+ */
+XAresult XAMetadataTraversalItfAdapt_SetMode(XAAdaptationBaseCtx *bCtx, XAuint32 mode)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMetadataAdaptVars* mdv=NULL;
+    XAAdaptEvent event = {XA_METADATAEVENTS, XA_ADAPT_MDE_TAGS_AVAILABLE, 0, NULL };
+
+    DEBUG_API("->XAMetadataTraversalItfAdapt_SetMode");
+    mdv = XAMetadataAdapt_GetMetadataVars(bCtx);
+    if( mdv )
+    {
+        mdv->traversemode = mode;
+        /* inform extractor to update tag list */
+        XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+        if(mdv->traversemode==XA_METADATATRAVERSALMODE_ALL)
+        {
+            mdv->nodedepth = 0;
+            mdv->currentchild = &(mdv->generaltags);
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Metadata variables not found!!");
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_API("<-XAMetadataTraversalItfAdapt_SetMode");
+    return ret;
+}
+
+/*
+ * XAresult XAMetadataTraversalItfAdapt_GetChildCount(XAAdaptationBaseCtx *bCtx, XAuint32 *pCount)
+ */
+XAresult XAMetadataTraversalItfAdapt_GetChildCount(XAAdaptationBaseCtx *bCtx, XAuint32 *pCount)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMetadataAdaptVars* mdv=NULL;
+
+    DEBUG_API("->XAMetadataTraversalItfAdapt_GetChildCount");
+    mdv = XAMetadataAdapt_GetMetadataVars(bCtx);
+    if( mdv )
+    {
+        /* only depth of 1 is supported */
+        if( mdv->nodedepth == 0 )
+        {
+            *pCount=mdv->childcount;
+        }
+        else
+        {
+            *pCount=0;
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Metadata variables not found!!");
+        ret = XA_RESULT_PARAMETER_INVALID;
+        *pCount=0;
+    }
+    DEBUG_API_A2("<-XAMetadataTraversalItfAdapt_GetChildCount(%d) count=%d", (int)ret, (int)*pCount);
+    return ret;
+}
+
+/*
+ * XAresult XAMetadataTraversalItfAdapt_GetChildMIMETypeSize(XAAdaptationBaseCtx *bCtx,
+ *                                                         XAuint32 index,
+ *                                                         XAuint32 *pSize)
+ */
+XAresult XAMetadataTraversalItfAdapt_GetChildMIMETypeSize(XAAdaptationBaseCtx *bCtx,
+                                                          XAuint32 index,
+                                                          XAuint32 *pSize)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMetadataAdaptVars* mdv=NULL;
+
+    DEBUG_API("->XAMetadataTraversalItfAdapt_GetChildMIMETypeSize");
+    mdv = XAMetadataAdapt_GetMetadataVars(bCtx);
+    if( mdv )
+    {
+        GstStructure* child = XAMetadataAdapt_GetChildStructure(mdv,index);
+        if(child)
+        {
+            *pSize = strlen(gst_structure_get_name(child));
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Metadata variables not found!!");
+        ret = XA_RESULT_PARAMETER_INVALID;
+        *pSize=0;
+    }
+    DEBUG_API("<-XAMetadataTraversalItfAdapt_GetChildMIMETypeSize");
+    return ret;
+}
+
+/*
+ * XAresult XAMetadataTraversalItfAdapt_GetChildInfo(XAAdaptationBaseCtx *bCtx,
+ *                                                  XAuint32 index,
+ *                                                 XAint32 *pNodeID,
+ *                                                 XAuint32 *pType,
+ *                                                 XAuint32 size,
+ *                                                 XAchar *pMimeType)
+ */
+XAresult XAMetadataTraversalItfAdapt_GetChildInfo(XAAdaptationBaseCtx *bCtx,
+                                                  XAuint32 index,
+                                                  XAint32 *pNodeID,
+                                                  XAuint32 *pType,
+                                                  XAuint32 size,
+                                                  XAchar *pMimeType)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMetadataAdaptVars* mdv=NULL;
+    const gchar* mime;
+    GstStructure* child;
+
+    DEBUG_API("->XAMetadataTraversalItfAdapt_GetChildInfo");
+    mdv = XAMetadataAdapt_GetMetadataVars(bCtx);
+    if( mdv )
+    {
+        child = XAMetadataAdapt_GetChildStructure(mdv,index);
+        if(child)
+        {
+            *pNodeID = (XAint32)child;
+            mime = gst_structure_get_name(child);
+            if(strncmp(mime,"audio",5)==0)
+            {
+                *pType = XA_NODETYPE_AUDIO;
+            }
+            if(strncmp(mime,"video",5)==0)
+            {
+                *pType = XA_NODETYPE_VIDEO;
+            }
+            if(strncmp(mime,"image",5)==0)
+            {
+                *pType = XA_NODETYPE_IMAGE;
+            }
+            else
+            {
+                *pType = XA_NODETYPE_UNSPECIFIED;
+            }
+            strncpy((char*)pMimeType,mime,size);
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Metadata variables not found!!");
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API("<-XAMetadataTraversalItfAdapt_GetChildInfo");
+    return ret;
+}
+
+/*
+ * XAresult XAMetadataTraversalItfAdapt_SetActiveNode(XAAdaptationBaseCtx *bCtx,
+ *                                                  XAuint32 index)
+ */
+XAresult XAMetadataTraversalItfAdapt_SetActiveNode(XAAdaptationBaseCtx *bCtx,
+                                                   XAuint32 index)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMetadataAdaptVars* mdv=NULL;
+    GstStructure* child;
+
+    DEBUG_API("->XAMetadataTraversalItfAdapt_SetActiveNode");
+    mdv = XAMetadataAdapt_GetMetadataVars(bCtx);
+    if( mdv )
+    {
+        child = XAMetadataAdapt_GetChildStructure(mdv,index);
+        if(child)
+        {
+            mdv->currentchild = &child;
+            if(index==XA_NODE_PARENT) mdv->nodedepth--;
+            else mdv->nodedepth++;
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Metadata variables not found!!");
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API("<-XAMetadataTraversalItfAdapt_SetActiveNode");
+    return ret;
+}
+
+/*****************************************************************************
+ * INSERTION
+ *****************************************************************************/
+
+/*
+ * XAresult XAMetadataInsertionItfAdapt_CreateChildNode(XAAdaptationBaseCtx *bCtx,
+ *                                                   XAint32 parentNodeID,
+ *                                                   XAuint32 type,
+ *                                                   XAchar *mimeType,
+ *                                                   XAint32 *pChildNodeID)
+ */
+XAresult XAMetadataInsertionItfAdapt_CreateChildNode(XAAdaptationBaseCtx *bCtx,
+                                                    XAint32 parentNodeID,
+                                                    XAuint32 type,
+                                                    XAchar *mimeType,
+                                                    XAint32 *pChildNodeID)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMetadataAdaptVars* mdv=NULL;
+    XAMediaRecorderAdaptationCtx* mCtx;
+
+    DEBUG_API("->XAMetadataInsertionItfAdapt_CreateChildNode");
+    if(bCtx && bCtx->ctxId == XAMediaRecorderAdaptation)
+    {
+        /* no support for more than 1 levels of childs*/
+        if(parentNodeID==XA_ROOT_NODE_ID)
+        {
+            XAMediaType mediaType;
+            mCtx = (XAMediaRecorderAdaptationCtx*)bCtx;
+
+            /* first check sink type */
+            XACommon_CheckDataSource((XADataSource*)(mCtx->xaSink),&mediaType);
+            if( ((mediaType==XA_MEDIATYPE_AUDIO||mediaType==XA_MEDIATYPE_VIDEO) && type==XA_NODETYPE_IMAGE) ||
+                (mediaType==XA_MEDIATYPE_IMAGE && (type==XA_NODETYPE_AUDIO || type==XA_NODETYPE_VIDEO)) )
+            {
+                DEBUG_ERR("Nodetype not supported!");
+                ret = XA_RESULT_CONTENT_UNSUPPORTED;
+                DEBUG_API_A1("<-XAMetadataInsertionItfAdapt_CreateChildNode (%d)", (int)ret);
+                return ret;            }
+
+            mdv = mCtx->metadatavars;
+            if(!mdv)
+            {
+                DEBUG_ERR("Metadata variables not initialized!");
+                ret = XA_RESULT_PRECONDITIONS_VIOLATED;
+            }
+            switch(type)
+            {
+            case XA_NODETYPE_IMAGE:
+                /*fall-through to use video pipe tags for image*/
+            case XA_NODETYPE_VIDEO:
+                if(!mCtx->videosource)
+                {
+                    DEBUG_ERR("Nodetype not found!");
+                    ret = XA_RESULT_CONTENT_UNSUPPORTED;
+                }
+                else
+                {
+                    if(!mdv->videotags)
+                    {
+                        if(strlen((char*)mimeType)==0)
+                        {
+                            mdv->videotags = gst_structure_empty_new("video/unknown");
+                        }
+                        else
+                        {
+                            mdv->videotags = gst_structure_empty_new((gchar*)mimeType);
+                        }
+                    }
+                    *pChildNodeID = (XAint32)mdv->videotags;
+                }
+                break;
+            case XA_NODETYPE_AUDIO:
+                if(!mCtx->audiosource)
+                {
+                    DEBUG_ERR("Nodetype not found!");
+                    ret = XA_RESULT_CONTENT_UNSUPPORTED;
+                }
+                else
+                {
+                    if(!mdv->audiotags)
+                    {
+                        if(strlen((char*)mimeType)==0)
+                        {
+                            mdv->audiotags = gst_structure_empty_new("audio/unknown");
+                        }
+                        else
+                        {
+                            mdv->audiotags = gst_structure_empty_new((gchar*)mimeType);
+                        }
+                    }
+                    *pChildNodeID = (XAint32)mdv->audiotags;
+                }
+                break;
+            default:
+                DEBUG_ERR("Nodetype not found!");
+                ret = XA_RESULT_CONTENT_UNSUPPORTED;
+                break;
+            }
+        }
+        else
+        {
+            DEBUG_ERR("Only root childs supported!!");
+            ret = XA_RESULT_CONTENT_UNSUPPORTED;
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Unsupported metadata insertion context!!");
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API_A1("<-XAMetadataInsertionItfAdapt_CreateChildNode (%d)", (int)ret);
+    return ret;
+}
+
+/*
+ * XAresult XAMetadataInsertionItfAdapt_GetSupportedKeysCount(XAAdaptationBaseCtx *bCtx,
+ *                                                         XAint32 nodeID,
+ *                                                         XAboolean *pFreeKeys,
+ *                                                         XAuint32 *pKeyCount,
+ *                                                         XAuint32 *pEncodingCount)
+ */
+XAresult XAMetadataInsertionItfAdapt_GetSupportedKeysCount(XAAdaptationBaseCtx *bCtx,
+                                                          XAint32 nodeID,
+                                                          XAboolean *pFreeKeys,
+                                                          XAuint32 *pKeyCount,
+                                                          XAuint32 *pEncodingCount)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaRecorderAdaptationCtx* mCtx;
+
+    DEBUG_API("->XAMetadataInsertionItfAdapt_GetSupportedKeysCount");
+    if(bCtx && bCtx->ctxId == XAMediaRecorderAdaptation)
+    {
+        mCtx = (XAMediaRecorderAdaptationCtx*)bCtx;
+        *pKeyCount = 0;
+        *pFreeKeys = XA_BOOLEAN_FALSE;
+        while(xaMetadataAdaptSupportedKeys[*pKeyCount])
+        {
+            (*pKeyCount)++;
+        }
+        *pEncodingCount = 1;
+    }
+    else
+    {
+        DEBUG_ERR("Unsupported metadata insertion context!!");
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API("<-XAMetadataInsertionItfAdapt_GetSupportedKeysCount");
+    return ret;
+}
+
+/*
+ * XAresult XAMetadataInsertionItfAdapt_GetKeySize(XAAdaptationBaseCtx *bCtx,
+ *                                              XAint32 nodeID,
+ *                                              XAuint32 keyIndex,
+ *                                              XAuint32 *pKeySize)
+ */
+XAresult XAMetadataInsertionItfAdapt_GetKeySize(XAAdaptationBaseCtx *bCtx,
+                                               XAint32 nodeID,
+                                               XAuint32 keyIndex,
+                                               XAuint32 *pKeySize)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataInsertionItfAdapt_GetKeySize");
+    if(bCtx && bCtx->ctxId == XAMediaRecorderAdaptation)
+    {
+        if(xaMetadataAdaptSupportedKeys[keyIndex])
+        {
+            *pKeySize = sizeof(XAMetadataInfo)+strlen(xaMetadataAdaptSupportedKeys[keyIndex]);
+        }
+        else
+        {
+            ret = XA_RESULT_PARAMETER_INVALID;
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Unsupported metadata insertion context!!");
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API("<-XAMetadataInsertionItfAdapt_GetKeySize");
+    return ret;
+}
+
+/*
+ * XAresult XAMetadataInsertionItfAdapt_GetKey(XAAdaptationBaseCtx *bCtx,
+ *                                          XAint32 nodeID,
+ *                                          XAuint32 keyIndex,
+ *                                          XAuint32 keySize,
+ *                                          XAMetadataInfo *pKey)
+ */
+XAresult XAMetadataInsertionItfAdapt_GetKey(XAAdaptationBaseCtx *bCtx,
+                                           XAint32 nodeID,
+                                           XAuint32 keyIndex,
+                                           XAuint32 keySize,
+                                           XAMetadataInfo *pKey)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 datasize, neededsize;
+
+    DEBUG_API("->XAMetadataInsertionItfAdapt_GetKey");
+    if(bCtx && bCtx->ctxId == XAMediaRecorderAdaptation)
+    {
+        memset(pKey,0,keySize);
+        if(xaMetadataAdaptSupportedKeys[keyIndex])
+        {
+            neededsize = strlen(xaMetadataAdaptSupportedKeys[keyIndex])+1;
+            datasize = keySize-sizeof(XAMetadataInfo)+1;
+            if(neededsize>datasize)
+            {
+                strncpy((char*)pKey->data,xaMetadataAdaptSupportedKeys[keyIndex],datasize);
+                pKey->size=datasize;
+                ret=XA_RESULT_BUFFER_INSUFFICIENT;
+            }
+            else
+            {
+                strncpy((char*)pKey->data,xaMetadataAdaptSupportedKeys[keyIndex],neededsize);
+                pKey->size=neededsize;
+            }
+            pKey->encoding = XA_CHARACTERENCODING_ASCII;
+            strcpy((char*)(pKey->langCountry),"en");
+        }
+        else
+        {
+            ret = XA_RESULT_PARAMETER_INVALID;
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Unsupported metadata insertion context!!");
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API("<-XAMetadataInsertionItfAdapt_GetKey");
+    return ret;
+}
+
+/*
+ * XAresult XAMetadataInsertionItfAdapt_GetFreeKeysEncoding(XAAdaptationBaseCtx *bCtx,
+ *                                                       XAint32 nodeID,
+ *                                                       XAuint32 encodingIndex,
+ *                                                       XAuint32 *pEncoding)
+ */
+XAresult XAMetadataInsertionItfAdapt_GetFreeKeysEncoding(XAAdaptationBaseCtx *bCtx,
+                                                        XAint32 nodeID,
+                                                        XAuint32 encodingIndex,
+                                                        XAuint32 *pEncoding)
+{
+    DEBUG_API("->XAMetadataInsertionItfAdapt_GetFreeKeysEncoding");
+    DEBUG_API("<-XAMetadataInsertionItfAdapt_GetFreeKeysEncoding");
+    /* no free keys*/
+    return XA_RESULT_PRECONDITIONS_VIOLATED;
+}
+
+/*
+ * XAresult XAMetadataInsertionItfAdapt_InsertMetadataItem(XAAdaptationBaseCtx *bCtx,
+ *                                                      XAint32 nodeID,
+ *                                                      XAMetadataInfo *pKey,
+ *                                                      XAMetadataInfo *pValue,
+ *                                                      XAboolean overwrite)
+ */
+XAresult XAMetadataInsertionItfAdapt_InsertMetadataItem(XAAdaptationBaseCtx *bCtx,
+                                                       XAint32 nodeID,
+                                                       XAMetadataInfo *pKey,
+                                                       XAMetadataInfo *pValue,
+                                                       XAboolean overwrite)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMetadataAdaptVars* mdv=NULL;
+    XAMediaRecorderAdaptationCtx* mCtx;
+    GstTagMergeMode mode = (overwrite?GST_TAG_MERGE_REPLACE:GST_TAG_MERGE_KEEP);
+    gchar* parsedKey = (gchar*)XAMetadataAdapt_ParseKhronosKey((XAchar*)pKey->data);
+    DEBUG_API("->XAMetadataInsertionItfAdapt_InsertMetadataItem");
+    if(bCtx && bCtx->ctxId == XAMediaRecorderAdaptation)
+    {
+        mCtx = (XAMediaRecorderAdaptationCtx*)bCtx;
+        mdv = mCtx->metadatavars;
+        if(mdv)
+        {
+            if( nodeID==XA_ROOT_NODE_ID )
+            {
+                if(!mdv->generaltags)
+                {
+                    mdv->generaltags = gst_tag_list_new();
+                }
+                if (gst_tag_get_type (parsedKey) == G_TYPE_STRING)
+                {
+                    gst_tag_list_add(mdv->generaltags, mode, parsedKey, (gchar*)pValue->data, NULL );
+                }
+                else
+                {
+                    gst_tag_list_add(mdv->generaltags, mode, parsedKey, atoi((gchar*)pValue->data), NULL );
+                }
+            }
+            else
+            {
+                if(nodeID == (XAint32)mdv->audiotags || nodeID == (XAint32)mdv->videotags)
+                {
+                    if (gst_tag_get_type (parsedKey) == G_TYPE_STRING)
+                    {
+                        gst_structure_set((GstStructure*)nodeID, parsedKey, G_TYPE_STRING, g_strdup((gchar*)pValue->data), NULL );
+                    }
+                    else
+                    {
+                        gst_structure_set((GstStructure*)nodeID, parsedKey, gst_tag_get_type (parsedKey), atoi((gchar*)pValue->data), NULL );
+                    }
+                }
+                else
+                {
+                    DEBUG_ERR("Unknown node!!");
+                    ret = XA_RESULT_PARAMETER_INVALID;
+                }
+            }
+            if( ret == XA_RESULT_SUCCESS )
+            {   /* let (possible) extraction itf to know new tags  */
+                XAAdaptEvent event = {XA_METADATAEVENTS, XA_ADAPT_MDE_TAGS_AVAILABLE, 0, NULL };
+                XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+            }
+        }
+        else
+        {
+            DEBUG_ERR("Metadata not initialized!!");
+            ret = XA_RESULT_PARAMETER_INVALID;
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Unsupported metadata insertion context!!");
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API("<-XAMetadataInsertionItfAdapt_InsertMetadataItem");
+    return ret;
+}
+
+/*****************************************************************************
+ * INTERNALS
+ *****************************************************************************/
+
+
+/*
+ * GstStructure* XAMetadataAdapt_GetChildStructure(XAMetadataAdaptVars* mdv, XAuint32 index)
+ * helper to get gst structure corresponding to child index
+ */
+GstStructure* XAMetadataAdapt_GetChildStructure(XAMetadataAdaptVars* mdv, XAuint32 index)
+{
+    if(mdv->nodedepth == 0)
+    {   /*root childs, if existent, the order is 1)video 2)audio*/
+        if (index==0)
+        {
+            if(mdv->videotags) return mdv->videotags;
+            else if (mdv->audiotags) return mdv->audiotags;
+        }
+        else if (index==1)
+        {
+            if (mdv->audiotags) return mdv->audiotags;
+        }
+    }
+    else
+    {
+        if(index==XA_NODE_PARENT)
+        {
+            return GST_STRUCTURE(mdv->generaltags);
+        }
+    }
+    /*else*/
+    return NULL;
+}
+
+/*
+ * XAMetadataAdaptVars* XAMetadataAdapt_GetMetadataVars(XAAdaptationBaseCtx *bCtx)
+ * Return metadata variables from different types of context
+ */
+XAMetadataAdaptVars* XAMetadataAdapt_GetMetadataVars(XAAdaptationBaseCtx *bCtx)
+{
+    if( bCtx->ctxId == XAMDAdaptation ||
+        bCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        return ((XAMediaPlayerAdaptationCtx*)bCtx)->metadatavars;
+    }
+    else if( bCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        return ((XAMediaRecorderAdaptationCtx*)bCtx)->metadatavars;
+    }
+    else
+    {
+        DEBUG_ERR("Invalid context for metadata");
+        return NULL;
+    }
+}
+
+/*
+ * gboolean XAMetadataAdapt_CountTags(GQuark field_id, const GValue* value, gpointer counter)
+ * GstStructureForeachFunc to count number of items inside list
+ */
+gboolean XAMetadataAdapt_CountTags(GQuark field_id, const GValue* value, gpointer counter)
+{
+    XAuint32* cnt = (XAuint32*)counter;
+    (*cnt)++;
+    return TRUE;
+}
+
+/*
+ * void XAMetadataAdapt_ParseTag(const GstTagList* list, const gchar* tag, gpointer listptr)
+ * GstTaglistForeachFunc to parse items inside gsttaglist
+ */
+void XAMetadataAdapt_ParseTag(const GstTagList* list, const gchar* tag, gpointer listptr)
+{
+    XAMetadataImplTagList* tagList = (XAMetadataImplTagList*)listptr;
+    const gchar *key;
+    gchar *value;
+    guint32 keylen, valuelen;
+
+    DEBUG_API("->XAMetadataAdapt_ParseTag");
+    key = gst_tag_get_nick(tag);
+    /*include null-terminator*/
+    keylen = strlen(key)+1;
+    tagList->mdeKeys[tagList->itemcount] = calloc(1,keylen+sizeof(XAMetadataInfo));
+    tagList->mdeKeys[tagList->itemcount]->size = keylen;
+    strncpy((char*)tagList->mdeKeys[tagList->itemcount]->data,key,keylen-1);
+
+    if (gst_tag_get_type (tag) == G_TYPE_STRING)
+    {
+        gst_tag_list_get_string_index(list, tag, 0, &value);
+    }
+    else
+    {
+        value = g_strdup_value_contents (gst_tag_list_get_value_index (list, tag, 0));
+    }
+    /*include null-terminator*/
+    valuelen = strlen(value)+1;
+    tagList->mdeValues[tagList->itemcount] = calloc(1,valuelen+sizeof(XAMetadataInfo));
+    tagList->mdeValues[tagList->itemcount]->size = valuelen;
+    strncpy((char*)tagList->mdeValues[tagList->itemcount]->data,value,valuelen-1);
+
+    /* NOTE: for now, encoding and language fixed */
+    tagList->mdeKeys[tagList->itemcount]->encoding = XA_CHARACTERENCODING_ASCII;
+    tagList->mdeValues[tagList->itemcount]->encoding = XA_CHARACTERENCODING_ASCII;
+    strcpy((char*)tagList->mdeKeys[tagList->itemcount]->langCountry,"en");
+    strcpy((char*)tagList->mdeValues[tagList->itemcount]->langCountry,"en");
+    tagList->itemcount++;
+    DEBUG_API_A2("<-XAMetadataAdapt_ParseTag: added %s : %s",
+                 tagList->mdeKeys[tagList->itemcount-1]->data,
+                 tagList->mdeValues[tagList->itemcount-1]->data);
+}
+
+/*
+ * gboolean XAMetadataAdapt_ParseItem(GQuark gkey,
+ *                                const GValue* gvalue,
+ *                                gpointer listptr)
+ * GstStructureForeachFunc to parse items inside caps structure
+ */
+gboolean XAMetadataAdapt_ParseItem(GQuark gkey,
+                                 const GValue* gvalue,
+                                 gpointer listptr)
+{
+    XAMetadataImplTagList* tagList = (XAMetadataImplTagList*)listptr;
+    const gchar *key;
+    gchar *value;
+    guint32 keylen, valuelen;
+
+    DEBUG_API("->XAMetadataAdapt_ParseItem");
+    key = g_quark_to_string(gkey);
+    /*include null-terminator*/
+    keylen = strlen(key)+1;
+    tagList->mdeKeys[tagList->itemcount] = calloc(1,keylen+sizeof(XAMetadataInfo));
+    tagList->mdeKeys[tagList->itemcount]->size = keylen;
+    strncpy((char*)tagList->mdeKeys[tagList->itemcount]->data,key,keylen-1);
+
+    value = gst_value_serialize(gvalue);
+    /*include null-terminator*/
+    valuelen = strlen(value)+1;
+    tagList->mdeValues[tagList->itemcount] = calloc(1,valuelen+sizeof(XAMetadataInfo));
+    tagList->mdeValues[tagList->itemcount]->size = valuelen;
+    strncpy((char*)tagList->mdeValues[tagList->itemcount]->data,value,valuelen-1);
+
+    /* for Gst, encoding and language fixed */
+    tagList->mdeKeys[tagList->itemcount]->encoding = XA_CHARACTERENCODING_ASCII;
+    tagList->mdeValues[tagList->itemcount]->encoding = XA_CHARACTERENCODING_ASCII;
+    strcpy((char*)tagList->mdeKeys[tagList->itemcount]->langCountry,"en");
+    strcpy((char*)tagList->mdeValues[tagList->itemcount]->langCountry,"en");
+    tagList->itemcount++;
+    DEBUG_API_A2("<-XAMetadataAdapt_ParseItem: added %15s : %s",
+                 tagList->mdeKeys[tagList->itemcount-1]->data,
+                 tagList->mdeValues[tagList->itemcount-1]->data);
+    return TRUE;
+}
+
+/*
+ * gboolean XAMetadataAdapt_GstTagCb( GstBus *bus, GstMessage *message, gpointer data )
+ * Metadata callback - called when new tags found from stream
+ */
+gboolean XAMetadataAdapt_GstTagCb( GstBus *bus, GstMessage *message, gpointer data )
+{
+    GstTagList *new_tags;
+    GstTagList **old_tags = NULL;
+    XAAdaptationBaseCtx* bCtx;
+    GstTagMergeMode mode;
+
+    bCtx = (XAAdaptationBaseCtx*)data;
+    if(GST_MESSAGE_TAG==GST_MESSAGE_TYPE(message))
+    {
+        DEBUG_API_A2("->XAMetadataAdapt_GstTagCb:\"%s\" from object \"%s\"",
+                        GST_MESSAGE_TYPE_NAME(message), GST_OBJECT_NAME(GST_MESSAGE_SRC(message)));
+        gst_message_parse_tag (message, &new_tags);
+        /* NOTE: only general tags received this way (not child nodes)*/
+        if( bCtx->ctxId == XAMDAdaptation ||
+            bCtx->ctxId == XAMediaPlayerAdaptation )
+        {
+            old_tags = &((XAMediaPlayerAdaptationCtx*)bCtx)->metadatavars->generaltags;
+            mode = GST_TAG_MERGE_REPLACE;
+        }
+        else if( bCtx->ctxId == XAMediaRecorderAdaptation )
+        {
+            old_tags = &((XAMediaRecorderAdaptationCtx*)bCtx)->metadatavars->generaltags;
+            /* keep user's tags */
+            mode = GST_TAG_MERGE_KEEP;
+        }
+        else
+        {   /*context not applicable*/
+            return TRUE;
+        }
+
+        if( *old_tags )
+            *old_tags = gst_tag_list_merge (*old_tags, new_tags, mode);
+        else
+            *old_tags = new_tags;
+
+        if( GST_STATE(bCtx->bin)==GST_STATE_PLAYING )
+        {   /* send event only for live stream, otherwise wait for preroll to complete */
+            XAAdaptEvent event = {XA_METADATAEVENTS, XA_ADAPT_MDE_TAGS_AVAILABLE, 0, NULL };
+            XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+        }
+        DEBUG_API("<-XAMetadataAdapt_GstTagCb");
+    }
+    return TRUE;
+}
+
+/*
+ * void XAMetadataAdapt_TryWriteTag(const GstTagList* list, const gchar* tag, gpointer taggerptr)
+ * GstTaglistForeachFunc to write single tag entries to stream
+ */
+void XAMetadataAdapt_TryWriteTag(const GstTagList* list, const gchar* tag, gpointer taggerptr)
+{
+    GstTagSetter* tagger = (GstTagSetter*)taggerptr;
+    const gchar *key;
+    gchar *value;
+
+    DEBUG_API("->XAMetadataAdapt_ParseTag");
+    key = gst_tag_get_nick(tag);
+    if (gst_tag_get_type (tag) == G_TYPE_STRING)
+    {
+        gst_tag_list_get_string_index(list, tag, 0, &value);
+    }
+    else
+    {
+        value = g_strdup_value_contents (gst_tag_list_get_value_index (list, tag, 0));
+    }
+    gst_tag_setter_add_tags(tagger, GST_TAG_MERGE_REPLACE, key, value, NULL);
+}
+
+/*
+ * XAresult XAMetadataAdapt_TryWriteTags(XAAdaptationBaseCtx* bCtx, GstBin* binToWriteTo)
+ */
+XAresult XAMetadataAdapt_TryWriteTags(XAAdaptationBaseCtx* bCtx, GstBin* binToWriteTo)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    GstTagSetter *tagger=NULL;
+    /* Find metadata tagger from bin (if any) */
+    GstIterator *iter = gst_bin_iterate_all_by_interface( binToWriteTo, GST_TYPE_TAG_SETTER );
+    gboolean done = FALSE;
+    XAMediaRecorderAdaptationCtx* mCtx;
+    XAAdaptEvent mdevent = {XA_METADATAEVENTS, XA_ADAPT_MDE_TAGS_WRITTEN, 0, NULL };
+
+    DEBUG_API("->XAMetadataAdapt_TryWriteTags");
+
+    if( bCtx->ctxId != XAMediaRecorderAdaptation )
+    {
+        return XA_RESULT_FEATURE_UNSUPPORTED;
+    }
+    mCtx = ((XAMediaRecorderAdaptationCtx*)bCtx);
+    while (!done)
+    {
+        switch (gst_iterator_next(iter, (gpointer)&tagger))
+        {
+        case GST_ITERATOR_OK:
+            if(mCtx->metadatavars)
+            {
+                if(mCtx->metadatavars->generaltags)
+                {
+                    gst_tag_setter_merge_tags(tagger, mCtx->metadatavars->generaltags, GST_TAG_MERGE_REPLACE);
+                }
+            }
+            done = TRUE;
+        break;
+        case GST_ITERATOR_ERROR:
+            done = TRUE;
+            DEBUG_ERR("Pipeline does not support tag setting");
+            ret = XA_RESULT_CONTENT_UNSUPPORTED;
+        break;
+        case GST_ITERATOR_DONE:
+            done = TRUE;
+            DEBUG_ERR("Pipeline does not support tag setting");
+            ret = XA_RESULT_CONTENT_UNSUPPORTED;
+        break;
+        case GST_ITERATOR_RESYNC:
+            gst_iterator_resync(iter);
+        break;
+        }
+    }
+    /*here datasize field is used for return value*/
+    mdevent.datasize = ret;
+    XAAdaptationBase_SendAdaptEvents(bCtx, &mdevent );
+    gst_iterator_free (iter);
+    DEBUG_API("<-XAMetadataAdapt_TryWriteTags");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xametadataadaptation.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAMETADATAADAPTATION_H
+#define XAMETADATAADAPTATION_H
+
+#include "XADebug.h"
+#include "XAAdaptationContextBase.h"
+#include "XAMediaRecorderAdaptCtx.h"
+
+/* FUNCTIONS */
+typedef struct XAMetadataImplTagList
+{
+    XAuint32         itemcount; /* number of items in all three following arrays */
+    XAMetadataInfo** mdeKeys;   /* array of tag keys */
+    XAMetadataInfo** mdeValues; /* array of tag values */
+} XAMetadataImplTagList;
+
+XAresult XAMetadataAdapt_PreInit(XAAdaptationBaseCtx *bCtx);
+XAresult XAMetadataAdapt_PostInit(XAAdaptationBaseCtx *bCtx);
+const XAchar* XAMetadataAdapt_ParseKhronosKey(const XAchar* KKey);
+void XAMetadataAdapt_FreeImplTagList(XAMetadataImplTagList *list, XAboolean freeItems);
+
+XAresult XAMetadataExtractionItfAdapt_FillTagList(XAAdaptationBaseCtx *bCtx,
+                                                  XAMetadataImplTagList* tagList);
+
+
+XAresult XAMetadataTraversalItfAdapt_SetMode(XAAdaptationBaseCtx *bCtx, XAuint32 mode);
+XAresult XAMetadataTraversalItfAdapt_GetChildCount(XAAdaptationBaseCtx *bCtx, XAuint32 *pCount);
+XAresult XAMetadataTraversalItfAdapt_GetChildMIMETypeSize(XAAdaptationBaseCtx *bCtx,
+                                                          XAuint32 index,
+                                                          XAuint32 *pSize);
+XAresult XAMetadataTraversalItfAdapt_GetChildInfo(XAAdaptationBaseCtx *bCtx,
+                                                  XAuint32 index,
+                                                  XAint32 *pNodeID,
+                                                  XAuint32 *pType,
+                                                  XAuint32 size,
+                                                  XAchar *pMimeType);
+XAresult XAMetadataTraversalItfAdapt_SetActiveNode(XAAdaptationBaseCtx *bCtx,
+                                                   XAuint32 index);
+
+XAresult XAMetadataInsertionItfAdapt_CreateChildNode(XAAdaptationBaseCtx *bCtx,
+                                                    XAint32 parentNodeID,
+                                                    XAuint32 type,
+                                                    XAchar *mimeType,
+                                                    XAint32 *pChildNodeID);
+XAresult XAMetadataInsertionItfAdapt_GetSupportedKeysCount(XAAdaptationBaseCtx *bCtx,
+                                                          XAint32 nodeID,
+                                                          XAboolean *pFreeKeys,
+                                                          XAuint32 *pKeyCount,
+                                                          XAuint32 *pEncodingCount);
+XAresult XAMetadataInsertionItfAdapt_GetKeySize(XAAdaptationBaseCtx *bCtx,
+                                               XAint32 nodeID,
+                                               XAuint32 keyIndex,
+                                               XAuint32 *pKeySize);
+XAresult XAMetadataInsertionItfAdapt_GetKey(XAAdaptationBaseCtx *bCtx,
+                                           XAint32 nodeID,
+                                           XAuint32 keyIndex,
+                                           XAuint32 keySize,
+                                           XAMetadataInfo *pKey);
+XAresult XAMetadataInsertionItfAdapt_GetFreeKeysEncoding(XAAdaptationBaseCtx *bCtx,
+                                                        XAint32 nodeID,
+                                                        XAuint32 encodingIndex,
+                                                        XAuint32 *pEncoding);
+XAresult XAMetadataInsertionItfAdapt_InsertMetadataItem(XAAdaptationBaseCtx *bCtx,
+                                                       XAint32 nodeID,
+                                                       XAMetadataInfo *pKey,
+                                                       XAMetadataInfo *pValue,
+                                                       XAboolean overwrite);
+#endif /* XAMETADATAADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xametadataadaptctx.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include <string.h>
+#include "XAMetadataAdaptCtx.h"
+#include "XAAdaptation.h"
+
+/*
+ * XAAdaptationBaseCtx* XAMetadataAdapt_Create()
+ * Allocates memory for Metadata Adaptation Context and makes 1st phase initialization
+ * @returns XAMetadataAdaptationCtx* - Pointer to created context
+ */
+XAAdaptationBaseCtx* XAMetadataAdaptCtx_Create(XADataSource* pDataSrc)
+{
+    /* use media player context with NULL sinks
+     * (no specific MDE context needed, because in GStreamer,
+     *  playback resources are needed for getting stream tags)
+     **/
+    return XAMediaPlayerAdapt_Create(pDataSrc,NULL,NULL,NULL,NULL,NULL);
+}
+
+/*
+ * XAresult XAMetadataAdapt_PostInit()
+ * 2nd phase initialization of Metadata Adaptation Context
+ */
+XAresult XAMetadataAdaptCtx_PostInit(XAAdaptationBaseCtx* bCtx)
+{
+    /* pipe to media player adaptation */
+    return XAMediaPlayerAdapt_PostInit(bCtx);
+}
+
+/*
+ * void XAMetadataAdapt_Destroy(XAMetadataAdaptationCtx* ctx)
+ * Destroys Metadata Adaptation Context
+ * @param ctx - Metadata Adaptation context to be destroyed
+ */
+void XAMetadataAdaptCtx_Destroy(XAAdaptationBaseCtx* bCtx)
+{
+    /* pipe to media player adaptation */
+    XAMediaPlayerAdapt_Destroy(bCtx);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xametadataadaptctx.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAMETADATAADAPTCTX_H
+#define XAMETADATAADAPTCTX_H
+
+#include "XAMediaPlayerAdaptCtx.h"
+/* TYPEDEFS */
+
+/* use media player context with NULL sinks
+ * (no specific MDE context needed, because in GStreamer,
+ *  playback resources are needed for getting stream tags)
+ */
+typedef struct XAMediaPlayerAdaptationCtx_ XAMetadataAdaptationCtx;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XAMetadataAdaptCtx_Create(XADataSource* pDataSource);
+XAresult XAMetadataAdaptCtx_PostInit(XAAdaptationBaseCtx* bCtx);
+void XAMetadataAdaptCtx_Destroy(XAAdaptationBaseCtx* bCtx);
+
+#endif /* XAMETADATAADAPTCTX_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xangavideosink.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,160 @@
+/*
+* 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: 
+*
+*/
+/*
+Media Helper Class for handling surface events
+
+Shy Ward
+*/
+
+#include "XANGAVideoSink.h"
+#include "openmaxalwrapper.h"
+
+
+CNgaVideoSink* CNgaVideoSink::NewL()
+{
+	CNgaVideoSink* self = new CNgaVideoSink();
+	self->ConstructL();
+	return self;
+}
+
+CNgaVideoSink::~CNgaVideoSink()
+{
+	iMediaClientVideoDisplay->RemoveDisplayWindow(*m_pWindow);
+	delete iMediaClientVideoDisplay;
+  if(IsActive())
+  {
+     Cancel();
+  }	
+}
+    
+CNgaVideoSink::CNgaVideoSink()
+                  :CActive(EPriorityStandard)
+{
+	iMediaClientVideoDisplay = NULL;
+  CActiveScheduler::Add(this);
+  m_ThreadHandle.Duplicate(RThread());
+  m_MediaHelperInitialized = EInitializedReady;
+  m_rotation = EVideoRotationNone;
+  m_scaleWidth = (100.0f);
+  m_scaleHeight = (100.0f);
+  m_horizPos = (EHorizontalAlignCenter);
+  m_vertPos = (EVerticalAlignCenter);      
+}
+
+void CNgaVideoSink::RunL()
+{
+	  iMediaClientVideoDisplay->SurfaceCreated(m_surfaceId,m_cropRect,m_pixelAspectRatio,m_cropRegion);	
+}
+
+void CNgaVideoSink::Activate()
+{
+    if(!IsActive())
+    {
+        iStatus = KRequestPending;
+        SetActive();
+    }
+}
+
+void CNgaVideoSink::DoCancel()
+{
+      if(iStatus.Int() == KRequestPending)
+      {
+          TRequestStatus* pStatus = &iStatus;
+          m_ThreadHandle.RequestComplete(pStatus, KErrCancel);
+    }
+}
+
+void CNgaVideoSink::CompleteRequest(TInt status)
+{
+    // Checking for IsActive alone results in this block getting executed 
+    // from other thread more thanone time. Hence the chk for iStatus
+    if(IsActive() && iStatus == KRequestPending)
+    {
+        TRequestStatus* pStatus = &iStatus;
+        m_ThreadHandle.RequestComplete(pStatus, status);
+    }
+}
+
+void CNgaVideoSink::SurfaceCreated(int surfaceid0,int surfaceid1,int surfaceid2,int surfaceid3,int crop_rect_tl_x,
+                     									 int crop_rect_tl_y,int crop_rect_br_x,int crop_rect_br_y,int aspect_ratio_num,int aspect_ratio_denom)
+{
+   
+   m_surfaceId.iInternal[0] = surfaceid0;
+   m_surfaceId.iInternal[1] = surfaceid1;
+   m_surfaceId.iInternal[2] = surfaceid2;
+   m_surfaceId.iInternal[3] = surfaceid3;
+   m_cropRect.iTl.iX = crop_rect_tl_x;
+   m_cropRect.iTl.iY = crop_rect_tl_y;
+   m_cropRect.iBr.iX = crop_rect_br_x;
+   m_cropRect.iBr.iY = crop_rect_br_y;
+   m_pixelAspectRatio.iNumerator = aspect_ratio_num;
+   m_pixelAspectRatio.iDenominator = aspect_ratio_denom;  
+   
+   Activate();
+   CompleteRequest(KErrNone);
+   	
+}
+
+void CNgaVideoSink::ConstructL()
+{
+	iMediaClientVideoDisplay = CMediaClientVideoDisplay::NewL(0);
+	Activate();
+} 
+
+void CNgaVideoSink::SetNativeDisplayInformation(void* display_info)
+{
+	//display_info is of type XADataSink
+	//display_info.pLocator is of type XADataLocator_NativeDisplay
+	XADataLocator_NativeDisplay* nativeDisplay;
+	XADataSink* videoSink = (XADataSink*)display_info;
+	
+	nativeDisplay = (XADataLocator_NativeDisplay*) (videoSink->pLocator);
+	//TODO: scrDevice is not been passed Properly
+  // Add the display window
+  m_cropRegion = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+  m_videoExtent = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+  m_cropRect = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+  m_clipRect = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+  m_cropRegion = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+  m_pWindow = ((RWindow*)(nativeDisplay->hWindow));
+  
+
+  iMediaClientVideoDisplay->AddDisplayWindowL(m_pWindow, m_clipRect, m_cropRegion, m_videoExtent, m_scaleWidth, m_scaleHeight,
+                                               m_rotation, EAutoScaleBestFit, m_horizPos, m_vertPos, m_pWindow);  
+
+}
+
+extern "C" {
+
+    void* nga_video_sink_init()
+    { 
+          return CNgaVideoSink::NewL();
+    }
+        
+    void surface_created(void* context,int surfaceid0,int surfaceid1,int surfaceid2,int surfaceid3,int crop_rect_tl_x,
+                         									int crop_rect_tl_y,int crop_rect_br_x,int crop_rect_br_y,int aspect_ratio_num,int aspect_ratio_denom)
+    {
+            ((CNgaVideoSink*)(context))->SurfaceCreated(surfaceid0,surfaceid1,surfaceid2,surfaceid3,crop_rect_tl_x,
+                         									                  crop_rect_tl_y,crop_rect_br_x,crop_rect_br_y,aspect_ratio_num,aspect_ratio_denom);
+    }
+        
+    void  setup_native_display(void* context, void* display_info)
+    {
+            ((CNgaVideoSink*)(context))->SetNativeDisplayInformation(display_info);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xangavideosink.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,100 @@
+/*
+* 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: 
+*
+*/
+/*
+Media Helper Class for handling surface events
+
+Shy Ward
+*/
+
+#ifndef XA_CNGAVIDEOSINK_H
+#define XA_CNGAVIDEOSINK_H
+
+#define ENABLE_GRAPHICS_SURFACE_INTEGRATION
+
+
+#ifdef __cplusplus
+
+#include <e32base.h>
+#ifdef ENABLE_GRAPHICS_SURFACE_INTEGRATION
+#include <graphics/surface.h> //TSurfaceId
+#include <mmf/common/mmfvideo.h> //TVideoAspectRatio
+#include <mediaclientvideodisplay.h>
+#endif
+
+class CNgaVideoSink : public CBase,
+                      public CActive
+    {
+public:
+
+    static CNgaVideoSink* NewL();
+    ~CNgaVideoSink();
+    void SurfaceCreated(int surfaceid0,int surfaceid1,int surfaceid2,int surfaceid3,int crop_rect_tl_x,
+         							 int crop_rect_tl_y,int crop_rect_br_x,int crop_rect_br_y,int aspect_ratio_num,int aspect_ratio_denom);    
+    void SetNativeDisplayInformation(void* display_info);
+    
+    // CActive methods
+    virtual void RunL();
+    virtual void DoCancel();
+    void Activate();
+
+    void CompleteRequest(TInt status = KErrNone);    
+    
+private:
+    CNgaVideoSink();
+    void ConstructL();
+    
+    RThread     m_ThreadHandle;
+    
+    enum InitializeState
+    {
+        EInitializedReady = 0,
+        EInitializedSuccess,
+        EInitializedFailed,
+    };
+    
+#ifdef ENABLE_GRAPHICS_SURFACE_INTEGRATION
+    CMediaClientVideoDisplay* iMediaClientVideoDisplay;
+    TSurfaceId surfaceId;
+    TRect m_clipRect;
+    TRect m_videoExtent;    
+    TRect m_cropRegion;
+    TVideoAspectRatio m_pixelAspectRatio;
+    RWindow* m_pWindow;
+    TRect m_cropRect;
+    TSurfaceId m_surfaceId;
+    InitializeState     m_MediaHelperInitialized;    
+    TVideoRotation m_rotation;
+    TReal32 m_scaleWidth;
+    TReal32 m_scaleHeight;
+    TInt m_horizPos;
+    TInt m_vertPos;    
+
+#endif /*ENABLE_GRAPHICS_SURFACE_INTEGRATION*/    
+    };
+#else  /* __cplusplus */
+
+
+extern void* nga_video_sink_init();
+
+extern void  surface_created(void* context,int surfaceid0,int surfaceid1,int surfaceid2,int surfaceid3,int crop_rect_tl_x,
+                     									int crop_rect_tl_y,int crop_rect_br_x,int crop_rect_br_y,int aspect_ratio_num,int aspect_ratio_denom);
+extern void  setup_native_display(void* context, void* display_info);
+
+
+#endif /* __cplusplus */
+
+#endif /* XA_CNGAVIDEOSINK_H */
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaoutputmixadaptctx.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,229 @@
+/*
+* 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 <gst.h>
+#include "XAOutputMixAdaptCtx.h"
+#include "XAAdaptation.h"
+#include "XAStaticCapsAdaptation.h"
+
+
+/*
+ * XAAdaptationBaseCtx* XAOutputMixAdapt_Create()
+ * @returns XAOutputMixAdaptationCtx* - Pointer to created context
+ * Description: Allocates memory for Output Mix Adaptation Context and makes 1st phase initialization
+ */
+XAAdaptationBaseCtx* XAOutputMixAdapt_Create()
+{
+    XAOutputMixAdaptationCtx *pSelf = calloc(1, sizeof(XAOutputMixAdaptationCtx));
+
+    DEBUG_API("->XAOutputMixAdapt_Create");
+    if ( pSelf)
+    {
+        if( XAAdaptationBase_Init(&(pSelf->baseObj),XAOutputMixAdaptation)
+                    != XA_RESULT_SUCCESS )
+        {
+            DEBUG_ERR("Failed to init base context!!!");
+            free(pSelf);
+            pSelf = NULL;
+        }
+        else
+        {
+            XAuint32 devId;
+            pSelf->connectedObjects = g_array_new (FALSE, TRUE, sizeof (XAOMixAdaptConnObj));
+            pSelf->availableDevices = g_array_new (FALSE, TRUE, sizeof (XAuint32));
+            /*initially, only alsasink available*/
+//            devId = XA_ADAPTID_ALSASINK;
+            devId = XA_ADAPTID_DEVSOUNDSINK;
+            g_array_append_val(pSelf->availableDevices, devId);
+            pSelf->currentrouting = devId;
+        }
+    }
+    DEBUG_API("<-XAOutputMixAdapt_Create");
+    return (XAAdaptationBaseCtx* )pSelf;
+}
+
+/*
+ * XAresult XAOutputMixAdapt_PostInit(XAAdaptationBaseCtx* bCtx)
+ * 2nd phase initialization of Output Mix Adaptation Context
+ */
+XAresult XAOutputMixAdapt_PostInit(XAAdaptationBaseCtx* bCtx)
+{
+    XAOutputMixAdaptationCtx* ctx = NULL;
+
+    DEBUG_API("->XAOutputMixAdapt_PostInit");
+    if(bCtx == NULL || bCtx->ctxId != XAOutputMixAdaptation )
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XAOutputMixAdapt_PostInit");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    ctx = (XAOutputMixAdaptationCtx*)bCtx;
+
+    /* check and add devices to pSelf->availableDevices if such detection can be done */
+    DEBUG_API("<-XAOutputMixAdapt_PostInit");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * void XAOutputMixAdapt_Destroy(XAAdaptationBaseCtx* bCtx)
+ * Destroys Output Mix Adaptation Context
+ * @param ctx - Output Mix Adaptation context to be destroyed
+ */
+void XAOutputMixAdapt_Destroy(XAAdaptationBaseCtx* bCtx)
+{
+    XAOutputMixAdaptationCtx* ctx = NULL;
+    DEBUG_API("->XAOutputMixAdapt_Destroy");
+    if(bCtx == NULL || bCtx->ctxId != XAOutputMixAdaptation )
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XAOutputMixAdapt_Destroy");
+        return;
+    }
+    ctx = (XAOutputMixAdaptationCtx*)bCtx;
+    g_array_free(ctx->connectedObjects, TRUE);
+    g_array_free(ctx->availableDevices, TRUE);
+
+    XAAdaptationBase_Free( &(ctx->baseObj) );
+    free(ctx);
+    DEBUG_API("<-XAOutputMixAdapt_Destroy");
+}
+
+/*
+ * GstElement* XAOutputMixAdapt_GetSink(XAAdaptationBaseCtx* bCtx)
+ */
+GstElement* XAOutputMixAdapt_GetSink(XAAdaptationBaseCtx* bCtx)
+{
+    XAOutputMixAdaptationCtx* mixCtx = NULL;
+    /* create sink for current routing */
+    GstElement* newsink=NULL;
+    XAStaticCapsData temp;
+
+    DEBUG_API("->XAOutputMixAdapt_GetSink");
+    if(bCtx == NULL || bCtx->ctxId != XAOutputMixAdaptation )
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XAOutputMixAdapt_GetSink");
+        return NULL;
+    }
+    mixCtx = (XAOutputMixAdaptationCtx*)bCtx;
+
+    if(!mixCtx)
+    {
+        DEBUG_ERR("NULL context!");
+        return NULL;
+    }
+
+    if( XA_RESULT_SUCCESS ==
+        XAStaticCapsAdapt_GetCapsById(XACAP_DEVSNK|XACAP_AUDIO, mixCtx->currentrouting, &temp) )
+    {
+        newsink = gst_element_factory_make((char*)temp.adaptId,(char*)temp.adaptId);
+        if(!newsink)
+        {
+            DEBUG_ERR_A1("Could not create sink \"%s\"!", (char*)temp.adaptId);
+        }
+    }
+    else
+    {
+        DEBUG_ERR_A1("Could not find audio device by id 0x%x", (int)mixCtx->currentrouting);
+    }
+    DEBUG_API("<-XAOutputMixAdapt_GetSink");
+    return newsink;
+
+}
+
+/*
+ * XAresult XAOutputMixAdapt_ConnectObject(XAAdaptationBaseCtx* omCtx, XAAdaptationBaseCtx* bCtx, GstElement* usedMix)
+ */
+XAresult XAOutputMixAdapt_ConnectObject(XAAdaptationBaseCtx* omCtx, XAAdaptationBaseCtx* bCtx, GstElement* usedMix)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 i=0;
+    XAOutputMixAdaptationCtx* mixCtx =NULL;
+    DEBUG_API("->XAOutputMixAdapt_ConnectObject");
+    if( !omCtx || omCtx->ctxId!=XAOutputMixAdaptation || !bCtx || !usedMix )
+    {
+        DEBUG_ERR("Invalid attribute!!");
+        DEBUG_API("<-XAOutputMixAdapt_ConnectObject");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mixCtx = (XAOutputMixAdaptationCtx*)omCtx;
+    if( !mixCtx || !bCtx || !usedMix )
+    {
+        DEBUG_ERR("Invalid attribute!!");
+        DEBUG_API("<-XAOutputMixAdapt_DisconnectObject");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    for(i=0; i<mixCtx->connectedObjects->len; i++)
+    {
+        if( (g_array_index(mixCtx->connectedObjects, XAOMixAdaptConnObj, i)).ctx == bCtx )
+        {
+            /*item found already*/
+            ret = XA_RESULT_PARAMETER_INVALID;
+            break;
+        }
+    }
+    if(i==mixCtx->connectedObjects->len)
+    {
+        XAOMixAdaptConnObj tmp;
+        tmp.ctx= bCtx;
+        tmp.currentSink = usedMix;
+        g_array_append_val(mixCtx->connectedObjects, tmp);
+    }
+
+    DEBUG_API("<-XAOutputMixAdapt_ConnectObject");
+    return ret;
+}
+
+/*
+ * XAresult XAOutputMixAdapt_DisconnectObject(XAAdaptationBaseCtx* omCtx, XAAdaptationBaseCtx* bCtx)
+ */
+XAresult XAOutputMixAdapt_DisconnectObject(XAAdaptationBaseCtx* omCtx, XAAdaptationBaseCtx* bCtx)
+{
+    XAuint32 i=0;
+    XAOutputMixAdaptationCtx* mixCtx =NULL;
+    DEBUG_API("->XAOutputMixAdapt_DisconnectObject");
+
+    if( !omCtx || omCtx->ctxId!=XAOutputMixAdaptation || !bCtx )
+    {
+        DEBUG_ERR("Invalid attribute!!");
+        DEBUG_API("<-XAOutputMixAdapt_DisconnectObject");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mixCtx = (XAOutputMixAdaptationCtx*)omCtx;
+
+    if( !mixCtx || !bCtx )
+    {
+        DEBUG_ERR("Invalid attribute!!");
+        DEBUG_API("<-XAOutputMixAdapt_DisconnectObject");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    for(i=0; i<mixCtx->connectedObjects->len; i++)
+    {
+        XAOMixAdaptConnObj* tmp = &(g_array_index(mixCtx->connectedObjects, XAOMixAdaptConnObj, i));
+        if( tmp->ctx == bCtx  )
+        {
+            g_array_remove_index(mixCtx->connectedObjects, i);
+            DEBUG_API("<-XAOutputMixAdapt_DisconnectObject");
+            return XA_RESULT_SUCCESS;
+        }
+    }
+    /*did not find, return error*/
+    DEBUG_ERR("Object not found!");
+    DEBUG_API("<-XAOutputMixAdapt_DisconnectObject");
+    return XA_RESULT_PARAMETER_INVALID;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaoutputmixadaptctx.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAOUTPUTMIXADAPTCTX_H
+#define XAOUTPUTMIXADAPTCTX_H
+
+#include "XAAdaptationContextBase.h"
+
+/* TYPEDEFS */
+
+typedef struct XAOutputMixAdaptationCtx_ XAOutputMixAdaptationCtx;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XAOutputMixAdapt_Create();
+XAresult XAOutputMixAdapt_PostInit(XAAdaptationBaseCtx* bCtx);
+void XAOutputMixAdapt_Destroy(XAAdaptationBaseCtx* bCtx);
+
+#endif /* XAOUTPUTMIXADAPTCTX_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaoutputmixitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,203 @@
+/*
+* 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 <string.h>
+#include <gst.h>
+#include "XAOutputMixAdaptCtx.h"
+#include "XAOutputMixItfAdaptation.h"
+#include "XAAdaptation.h"
+#include "XAStaticCapsAdaptation.h"
+
+/*
+ * XAresult XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs( XAAdaptationBaseCtx *bCtx,
+ *                                                              XAint32 * pNumDevices,
+ *                                                              XAuint32 * pDeviceIDs )
+ * @param XAAdaptationBaseCtx *bCtx - Pointer to OutputMix adaptation context
+ * @param XAint32 * pNumDevices - [in] Length of pDeviceIDs array
+ *                                [out] number of destination devices
+ * @param XAuint32 * pDeviceIDs - List of DeviceIDs
+ * @return XAresult success value
+ * Description: Returns audio output deviceIDs that are currently connected
+ */
+XAresult XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs( XAAdaptationBaseCtx *bCtx, XAint32 * pNumDevices, XAuint32 * pDeviceIDs )
+{
+    XAOutputMixAdaptationCtx* mCtx = NULL;
+    XAint32 iterator = 0;
+    DEBUG_API_A1("->XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs pNumDevices:%ld",*pNumDevices);
+    if(!bCtx || bCtx->ctxId != XAOutputMixAdaptation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAOutputMixAdaptationCtx*) bCtx;
+    if(!mCtx)
+    {
+        DEBUG_ERR("NULL context!");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if ( pNumDevices )
+    {
+        *pNumDevices = mCtx->availableDevices->len;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(pDeviceIDs)
+    {   /*query devices*/
+        if ( *pNumDevices < mCtx->availableDevices->len )
+        {    /* Lenght of pDeviceIDs is insufficient for all connected audio devices */
+            DEBUG_ERR("XA_RESULT_BUFFER_INSUFFICIENT");
+            DEBUG_API("<-XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs");
+            return XA_RESULT_BUFFER_INSUFFICIENT;
+        }
+
+        for ( iterator = 0; iterator <  mCtx->availableDevices->len; iterator++ )
+        {
+            pDeviceIDs[iterator] = g_array_index(mCtx->availableDevices,XAuint32,iterator);
+        }
+    }
+
+    DEBUG_API("<-XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs");
+    return XA_RESULT_SUCCESS;
+}
+
+
+/*
+ * XAresult XAOutputMixItfAdapt_ReRoute( XAAdaptationBaseCtx *bCtx,
+ *                                       XAint32 numOutputDevices,
+ *                                       XAuint32 * pOutputDeviceIDs)
+ * @param XAAdaptationBaseCtx *bCtx - Ponter to OutputMix adaptation context
+ * @param XAint32 numOutputDevices - Length of pOutputDeviceIDs
+ * @param XAuint32 * pOutputDeviceIDs - List of requested audio output device IDs
+ * @return XAresult success value
+ * Description: Reroutes audio output to requested destination devices
+ */
+XAresult XAOutputMixItfAdapt_ReRoute( XAAdaptationBaseCtx *bCtx, XAint32 numOutputDevices, XAuint32 * pOutputDeviceIDs)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    gint32 idx = 0;
+    XAOutputMixAdaptationCtx* mCtx = NULL;
+    XAuint32 devId=0;
+    GstElement* newsink = NULL;
+    GstElement* current = NULL;
+    gchar* currentname= NULL;
+    XAStaticCapsData temp;
+
+    DEBUG_API_A1("->XAOutputMixItfAdapt_ReRoute numOutputDevices:%ld",numOutputDevices);
+    if(!bCtx ||
+        bCtx->ctxId != XAOutputMixAdaptation ||
+        !pOutputDeviceIDs )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XAOutputMixAdaptationCtx*) bCtx;
+
+    if( numOutputDevices > 1 )
+    {
+        /* currently, only routing to single output at time supported */
+        return XA_RESULT_FEATURE_UNSUPPORTED;
+    }
+    devId = pOutputDeviceIDs[0];
+
+    for ( idx = 0; idx < mCtx->connectedObjects->len; idx++ )
+    {
+        /*find wanted output plugin name*/
+        if( XA_RESULT_SUCCESS ==
+            XAStaticCapsAdapt_GetCapsById(XACAP_DEVSNK|XACAP_AUDIO, devId, &temp) )
+        {
+            XAAdaptationBaseCtx* ctx = g_array_index(mCtx->connectedObjects,XAOMixAdaptConnObj,idx).ctx;
+            if(!ctx)
+            {
+                DEBUG_ERR_A1("Context in connected objects array (index %u) is NULL!", idx);
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+            /*check current output plugin name*/
+            current = g_array_index(mCtx->connectedObjects,XAOMixAdaptConnObj,idx).currentSink;
+            currentname = gst_element_get_name(current);
+            DEBUG_INFO_A2("OMix pl%d - current output: \"%s\"", (int)idx, (char*)currentname);
+            DEBUG_INFO_A3("OMix pl%d -  wanted output: \"%s\" (id 0x%x)", (int)idx, (char*)temp.adaptId, (int)devId);
+            if(strcmp(currentname,(char*)temp.adaptId)!=0)
+            {
+                if(ret==XA_RESULT_SUCCESS)
+                {
+                    mCtx->currentrouting = devId;
+                    g_array_index(mCtx->connectedObjects,XAOMixAdaptConnObj,idx).currentSink = newsink;
+                }
+                newsink = gst_bin_get_by_name(GST_BIN(ctx->bin), (char*)temp.adaptId);
+                if(!newsink)
+                {   /*not existing yet, create*/
+                    newsink = gst_element_factory_make((char*)temp.adaptId,(char*)temp.adaptId);
+                    gst_bin_add(GST_BIN(ctx->bin), newsink);
+                }
+                if(!newsink)
+                {
+                    DEBUG_ERR_A1("Could not create wanted sink \"%s\"!", (char*)temp.adaptId);
+                    ret = XA_RESULT_PARAMETER_INVALID;
+                }
+                else
+                {
+                    /* switch routing: pause, block, unlink old, link new, unblock pipe, play*/
+                    GstPad *sinkpad=NULL, *blockpad=NULL;
+                    sinkpad = gst_element_get_static_pad(current,"sink");
+                    if(sinkpad)
+                    {
+                        blockpad = gst_pad_get_peer(sinkpad);
+                    }
+                    if(blockpad && gst_pad_is_active(blockpad))
+                    {
+                        DEBUG_INFO("block pad");
+                        gst_pad_set_blocked_async(blockpad,TRUE,XAAdaptationBase_PadBlockCb,NULL);
+                    }
+                    gst_pad_unlink(blockpad, sinkpad);
+                    sinkpad = gst_element_get_static_pad(newsink,"sink");
+                    gst_pad_link(blockpad, sinkpad);
+                    if(gst_pad_is_blocked(blockpad))
+                    {
+                        DEBUG_INFO("unblock pad");
+                        gst_pad_set_blocked_async(blockpad,FALSE,XAAdaptationBase_PadBlockCb,NULL);
+                    }
+                    /*set sink to same state as the mp bin*/
+                    gst_element_sync_state_with_parent(newsink);
+                    mCtx->currentrouting = devId;
+                    g_array_index(mCtx->connectedObjects,XAOMixAdaptConnObj,idx).currentSink = newsink;
+                }
+            }
+            else
+            {
+                DEBUG_INFO("No routing switch needed");
+            }
+        }
+        else
+        {
+            DEBUG_ERR_A1("Could not find audio device by id 0x%x", (int)devId);
+            ret = XA_RESULT_PARAMETER_INVALID;
+        }
+    }
+
+    DEBUG_API("<-XAOutputMixItfAdapt_ReRoute");
+    return ret;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaoutputmixitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef OUTPUTMIXITFADAPTATION_H_
+#define OUTPUTMIXITFADAPTATION_H_
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+XAresult XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs( XAAdaptationBaseCtx *bCtx, XAint32 * pNumDevices, XAuint32 * pDeviceIDs );
+XAresult XAOutputMixItfAdapt_ReRoute( XAAdaptationBaseCtx *bCtx, XAint32 numOutputDevices, XAuint32 * pOutputDeviceIDs);
+
+#endif /* OUTPUTMIXITFADAPTATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaplaybackrateitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,209 @@
+/*
+* 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 <gst.h>
+#include "XAAdaptation.h"
+#include "XAMediaPlayerAdaptCtx.h"
+#include "XAPlaybackRateItfAdaptation.h"
+#include "XAPlayItfAdaptation.h"
+
+/*XA_RATEPROP_STAGGEREDVIDEO,XA_RATEPROP_SMOOTHVIDEO,XA_RATEPROP_SILENTAUDIO,
+  XA_RATEPROP_STAGGEREDAUDIO,XA_RATEPROP_NOPITCHCORAUDIO,XA_RATEPROP_PITCHCORAUDIO*/
+#define SUPPORTEDPROPS (XA_RATEPROP_SMOOTHVIDEO | XA_RATEPROP_SILENTAUDIO)
+/* NOTE: currently rewind rates do not seem to work */
+#define MINRATE (100)
+#define MAXRATE 8000
+/*
+ * XAresult XAPlaybackRateItfAdapt_SetRate(XAAdaptationBaseCtx *bCtx, XApermille rate)
+ * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID value
+ * @param XApermille rate - new playback rate in permilles of original speed
+ * @return XAresult ret - Success value
+ */
+XAresult XAPlaybackRateItfAdapt_SetRate(XAAdaptationBaseCtx *bCtx, XApermille rate)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationCtx* mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+    DEBUG_API_A1("->XAPlaybackRateItfAdapt_SetRate %d permilles", rate);
+
+    if( !bCtx || bCtx->ctxId != XAMediaPlayerAdaptation )
+    {
+        DEBUG_ERR("Invalid context!");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    if( rate<MINRATE || rate>MAXRATE )
+    {
+        DEBUG_ERR("Invalid rate!");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    if(rate != 0)
+    {
+        mCtx->playrate = ((gdouble)rate)/1000;
+        if( GST_STATE(bCtx->bin) < GST_STATE_PAUSED )
+        {   /* This should not happen */
+            DEBUG_ERR("WARNING: Gst not prerolled yet!");
+        }
+        else
+        {
+            /* apply immediately */
+            XAAdaptationBase_PrepareAsyncWait(bCtx);
+            DEBUG_INFO_A1("Apply new playrate %f.", mCtx->playrate);
+            if(!gst_element_seek( bCtx->bin, mCtx->playrate, GST_FORMAT_TIME,
+                                GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE,
+                                GST_SEEK_TYPE_NONE, 0,
+                                GST_SEEK_TYPE_NONE, -1))
+            {
+                DEBUG_ERR("WARN: gst reports seek not handled");
+            }
+            /* flushed seeks always asynchronous */
+            XAAdaptationBase_StartAsyncWait(bCtx);
+            DEBUG_INFO("New playrate handled.")
+            bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
+        }
+    }
+    else
+    {  /* Gst do not accept rate of 0, pause instead */
+        mCtx->playrate = 1.0;
+        if( GST_STATE(bCtx->bin) > GST_STATE_PAUSED )
+        {
+            DEBUG_ERR("Pause playback");
+            XAPlayItfAdapt_SetPlayState(bCtx, XA_PLAYSTATE_PAUSED);
+        }
+
+    }
+
+    DEBUG_API("<-XAPlaybackRateItfAdapt_SetRate");
+    return ret;
+}
+
+/*
+ * XAresult XAPlaybackRateItfAdapt_SetPropertyConstraints(XAAdaptationBaseCtx *bCtx,
+ *                                                       XAuint32 constraints)
+ */
+XAresult XAPlaybackRateItfAdapt_SetPropertyConstraints(XAAdaptationBaseCtx *bCtx,
+                                                       XAuint32 constraints)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XAPlaybackRateItfAdapt_SetPropertyConstraints");
+
+    if( !bCtx || bCtx->ctxId != XAMediaPlayerAdaptation )
+    {
+        DEBUG_ERR("Invalid context!");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+    if( (constraints & SUPPORTEDPROPS ) == 0 )
+    {
+        DEBUG_ERR("constraints cannot be satisfied!!");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+    }
+    else
+    {
+        mCtx->rateprops = SUPPORTEDPROPS & constraints;
+    }
+    DEBUG_API("<-XAPlaybackRateItfAdapt_SetPropertyConstraints");
+    return ret;
+}
+
+/*
+ * XAresult XAPlaybackRateItfAdapt_GetProperties(XAAdaptationBaseCtx *bCtx,
+ *                                              XAuint32 *pProperties)
+ */
+XAresult XAPlaybackRateItfAdapt_GetProperties(XAAdaptationBaseCtx *bCtx,
+                                               XAuint32 *pProperties)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XAPlaybackRateItfAdapt_GetProperties");
+
+    if( !bCtx || bCtx->ctxId != XAMediaPlayerAdaptation )
+    {
+        DEBUG_ERR("Invalid context!");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+    *pProperties = mCtx->rateprops;
+
+    DEBUG_API("<-XAPlaybackRateItfAdapt_GetProperties");
+    return ret;
+}
+
+
+XAresult XAPlaybackRateItfAdapt_GetCapabilitiesOfRate(XAAdaptationBaseCtx *bCtx,
+                                                       XApermille rate,
+                                                       XAuint32 *pCapabilities)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XAPlaybackRateItfAdapt_GetCapabilitiesOfRate");
+    if( !bCtx || bCtx->ctxId != XAMediaPlayerAdaptation )
+    {
+        DEBUG_ERR("Invalid context!");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+    if( rate<MINRATE || rate>MAXRATE )
+    {
+        DEBUG_ERR("Invalid rate!");
+        *pCapabilities = 0;
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        *pCapabilities = SUPPORTEDPROPS;
+    }
+
+    DEBUG_API("<-XAPlaybackRateItfAdapt_GetCapabilitiesOfRate");
+    return ret;
+}
+
+
+XAresult XAPlaybackRateItfAdapt_GetRateRange(XAAdaptationBaseCtx *bCtx,
+                                             XAuint8 index,
+                                             XApermille *pMinRate,
+                                             XApermille *pMaxRate,
+                                             XApermille *pStepSize,
+                                             XAuint32 *pCapabilities)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XAPlaybackRateItfAdapt_GetRateRange");
+
+    if( !bCtx || bCtx->ctxId != XAMediaPlayerAdaptation )
+    {
+        DEBUG_ERR("Invalid context!");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+    /* NOTE: hardcoded values, cannot be queried from gst */
+    /* only one range supported */
+    if( index>0 )
+    {
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        *pMinRate = MINRATE;
+        *pMaxRate = MAXRATE;
+        *pStepSize = 0; /* continuous range */
+        *pCapabilities = SUPPORTEDPROPS;
+    }
+
+    DEBUG_API("<-XAPlaybackRateItfAdapt_GetRateRange");
+    return ret;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaplaybackrateitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XADYNAMICSOURCEITFADAPTATION_H
+#define XADYNAMICSOURCEITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+/* FUNCTIONS */
+
+XAresult XAPlaybackRateItfAdapt_SetRate(XAAdaptationBaseCtx *bCtx, XApermille rate);
+
+XAresult XAPlaybackRateItfAdapt_SetPropertyConstraints(XAAdaptationBaseCtx *bCtx,
+                                                        XAuint32 constraints);
+
+XAresult XAPlaybackRateItfAdapt_GetProperties(XAAdaptationBaseCtx *bCtx,
+                                               XAuint32 *pProperties);
+
+XAresult XAPlaybackRateItfAdapt_GetCapabilitiesOfRate(XAAdaptationBaseCtx *bCtx,
+                                                       XApermille rate,
+                                                       XAuint32 *pCapabilities);
+
+XAresult XAPlaybackRateItfAdapt_GetRateRange(XAAdaptationBaseCtx *bCtx,
+                                              XAuint8 index,
+                                              XApermille *pMinRate,
+                                              XApermille *pMaxRate,
+                                              XApermille *pStepSize,
+                                              XAuint32 *pCapabilities);
+
+#endif /* XADYNAMICSOURCEITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaplayitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,495 @@
+/*
+* 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 <gst.h>
+#include "unistd.h"
+#include <pthread.h>
+#include "XAMediaPlayerAdaptCtx.h"
+#include "XAPlayItfAdaptation.h"
+#include "XAAdaptation.h"
+
+extern XAboolean cameraRealized;
+extern XACameraAdaptationCtx_* cameraCtx;
+
+/*forward declaration of position updater callback*/
+gboolean XAPlayItfAdapt_PositionUpdate(gpointer ctx);
+
+/*
+ * XAresult XAPlayItfAdapt_SetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 state)
+ * Sets play state to GStreamer.
+ * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID
+ * XAuint32 state - Play state to be set
+ * @return XAresult ret - Success value
+ */
+XAresult XAPlayItfAdapt_SetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 state)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAboolean requestStateChange = XA_BOOLEAN_FALSE;
+    GstStateChangeReturn gstRet = GST_STATE_CHANGE_SUCCESS;
+    XAMediaPlayerAdaptationCtx* mCtx = NULL;
+    XAuint32 locType = 0;
+    GstState gstOrigState = GST_STATE_PLAYING;
+    GstState gstTmpState = GST_STATE_PLAYING;
+    XADataLocator_Address *address = NULL;
+    XAboolean playing = XA_BOOLEAN_FALSE;
+    DEBUG_API_A1("->XAPlayItfAdapt_SetPlayState %s",PLAYSTATENAME(state));
+
+    if(!bCtx || bCtx->ctxId != XAMediaPlayerAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+    switch ( state )
+    {
+        case XA_PLAYSTATE_STOPPED:
+        {
+           	if ( cameraCtx && cameraRealized && mCtx->isobjsrc && mCtx->source  )
+			{
+				cameraCtx->playing = XA_BOOLEAN_FALSE;
+				if(!cameraCtx->recording && !cameraCtx->snapshotting)
+				{
+					/* Future improvement: We could block MPObjSrc pad from tee-eleement here, when
+					 * tee-element supports sending stream to one pad when others are blocked */
+
+					/* Neither view finder or recorder is running -> pause camera */
+					if ( GST_STATE( GST_ELEMENT(mCtx->source)) == GST_STATE_PLAYING )
+					{
+						GstStateChangeReturn gret;
+						DEBUG_INFO("Stop camera source");
+						gret = gst_element_set_state( GST_ELEMENT(mCtx->source), GST_STATE_PAUSED );
+						gret = gst_element_get_state( GST_ELEMENT(mCtx->source), NULL,NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC );
+					}
+				}
+			}
+
+            gstOrigState = GST_STATE(bCtx->bin);
+            if ( gstOrigState != GST_STATE_READY )
+            {
+                DEBUG_INFO("Set gst-bin to GST_STATE_READY");
+                bCtx->binWantedState = GST_STATE_READY;
+                XAAdaptationBase_PrepareAsyncWait(bCtx);
+                gstRet = gst_element_set_state( GST_ELEMENT(bCtx->bin), GST_STATE_READY);
+                switch ( gstRet )
+                {
+                    case GST_STATE_CHANGE_FAILURE:
+                        DEBUG_ERR_A1("FAILED to change state (target %s)",
+                                      gst_element_state_get_name(bCtx->binWantedState));
+                        bCtx->binWantedState = GST_STATE(bCtx->bin);
+                        ret = XA_RESULT_INTERNAL_ERROR;
+                        break;
+                    case GST_STATE_CHANGE_ASYNC:
+                        DEBUG_INFO_A1("Change state will happen asyncronously (target %s)",
+                                       gst_element_state_get_name(bCtx->binWantedState));
+                        XAAdaptationBase_StartAsyncWait(bCtx);
+                        ret = XA_RESULT_SUCCESS;
+                        break;
+                    case GST_STATE_CHANGE_SUCCESS:
+                        DEBUG_INFO_A1("Successfully changed state (target %s)",
+                                       gst_element_state_get_name(bCtx->binWantedState));
+                        break;
+                    default:
+                        DEBUG_ERR_A1("Unhandled error (%d)",gstRet);
+                        break;
+                }
+                bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
+                gstTmpState = GST_STATE(bCtx->bin);
+                DEBUG_INFO_A1("Setted gst-bin to state %s", gst_element_state_get_name(gstTmpState));
+
+                DEBUG_INFO_A1("Restoring gst-bin state to state %s", gst_element_state_get_name(gstOrigState));
+                bCtx->binWantedState = gstOrigState;
+                XAAdaptationBase_PrepareAsyncWait(bCtx);
+                gstRet = gst_element_set_state( GST_ELEMENT(bCtx->bin), gstOrigState);
+                switch ( gstRet )
+                {
+                    case GST_STATE_CHANGE_FAILURE:
+                        DEBUG_ERR_A1("FAILED to change state (target %s)",
+                                      gst_element_state_get_name(bCtx->binWantedState));
+                        bCtx->binWantedState = GST_STATE(bCtx->bin);
+                        ret = XA_RESULT_INTERNAL_ERROR;
+                        break;
+                    case GST_STATE_CHANGE_ASYNC:
+                        DEBUG_INFO_A1("Change state will happen asyncronously (target %s)",
+                                       gst_element_state_get_name(bCtx->binWantedState));
+                        XAAdaptationBase_StartAsyncWait(bCtx);
+                        ret = XA_RESULT_SUCCESS;
+                        break;
+                    case GST_STATE_CHANGE_SUCCESS:
+                        DEBUG_INFO_A1("Successfully changed state (target %s)",
+                                       gst_element_state_get_name(bCtx->binWantedState));
+                        break;
+                    default:
+                        DEBUG_ERR_A1("Unhandled error (%d)",gstRet);
+                        break;
+                }
+                bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
+                gstOrigState = GST_STATE(bCtx->bin);
+                DEBUG_INFO_A1("Restored gst-bin to state %s", gst_element_state_get_name(gstOrigState));
+            }
+
+
+        	if( bCtx->pipeSrcThrCtx.dataHandle )
+        	{
+        		XAresult retVal = XA_RESULT_SUCCESS;
+				if ( bCtx->pipeSrcThrCtx.state != CPStateNull )
+				{
+					bCtx->pipeSrcThrCtx.state = CPStateStopped;
+				}
+
+				retVal = XAImpl_PostSemaphore( bCtx->pipeSrcThrCtx.stateSem );
+				if ( retVal != XA_RESULT_SUCCESS )
+				{
+					DEBUG_ERR("Could not post content pipe semaphore!");
+				}
+
+        	}
+            /* stop head and drive head to beginning */
+            bCtx->binWantedState = GST_STATE_PAUSED;
+            if(mCtx->runpositiontimer > 0)
+            {
+                g_source_remove(mCtx->runpositiontimer);
+                mCtx->runpositiontimer=0;
+            }
+
+            gst_element_send_event(bCtx->bin,gst_event_new_flush_start());
+            gst_element_send_event(bCtx->bin,gst_event_new_flush_stop());
+
+            locType = *((XAuint32*)( mCtx->xaSource->pLocator ));
+            if( locType == XA_DATALOCATOR_ADDRESS )
+            {
+                address = (XADataLocator_Address*)(mCtx->xaSource->pLocator);
+
+                /* init gst buffer from datalocator */
+                if( mCtx->source )
+                {
+                    GstBuffer* userBuf = NULL;
+
+                    /* init GST buffer from XADataLocator*/
+                    userBuf = gst_buffer_new();
+                    if( userBuf )
+                    {
+                        userBuf->size = address->length;
+                        userBuf->data = address->pAddress;
+                        /* push the whole buffer to appsrc so it is ready for preroll */
+                        DEBUG_INFO("Pushing buffer");
+                        gst_app_src_push_buffer( GST_APP_SRC(mCtx->source), userBuf );
+                        DEBUG_INFO_A1("Sent buffer at 0x%x to appsrc", userBuf );
+                        gst_app_src_end_of_stream( GST_APP_SRC(mCtx->source) );
+                    }
+                    else
+                    {
+                        DEBUG_ERR("Failure allocating buffer!");
+                    }
+                }
+            }
+            break;
+        }
+        case XA_PLAYSTATE_PAUSED:
+
+           	if ( cameraCtx && cameraRealized && mCtx->isobjsrc && mCtx->source  )
+			{
+				cameraCtx->playing = XA_BOOLEAN_FALSE;
+
+				/* Future improvement: We could block MPObjSrc pad from tee-eleement here, when
+				 * tee-element supports sending stream to one pad when others are blocked */
+
+				if(!cameraCtx->recording && !cameraCtx->snapshotting)
+				{
+					/* Neither view finder or recorder is running -> pause camera */
+					if ( GST_STATE( GST_ELEMENT(mCtx->source)) == GST_STATE_PLAYING )
+					{
+						GstStateChangeReturn gret;
+						DEBUG_INFO("Stop camera source");
+						gret = gst_element_set_state( GST_ELEMENT(mCtx->source), GST_STATE_PAUSED );
+						gret = gst_element_get_state( GST_ELEMENT(mCtx->source), NULL,NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC );
+					}
+				}
+			}
+
+            if ( bCtx->pipeSrcThrCtx.state != CPStateNull )
+            {
+                bCtx->pipeSrcThrCtx.state = CPStatePaused;
+            }
+            bCtx->binWantedState = GST_STATE_PAUSED;
+            if(mCtx->runpositiontimer > 0)
+            {
+                g_source_remove(mCtx->runpositiontimer);
+                mCtx->runpositiontimer=0;
+            }
+            break;
+        case XA_PLAYSTATE_PLAYING:
+        {
+        	if ( cameraCtx && mCtx->isobjsrc )
+        	{
+        		cameraCtx->playing = XA_BOOLEAN_TRUE;
+        	}
+
+        	if ( mCtx->videoppBScrbin )
+        	{
+        		gst_element_set_state( GST_ELEMENT(mCtx->videoppBScrbin), GST_STATE_PAUSED);
+        	}
+        	if  (mCtx->isobjsrc && !mCtx->cameraSinkSynced && cameraCtx )
+        	{ /* create videosink now */
+				mCtx->cameraSinkSynced = XA_BOOLEAN_TRUE;
+				if ( mCtx->videosink )
+				{
+					gst_element_unlink( mCtx->filter,mCtx->videosink );
+					gst_element_set_state( GST_ELEMENT(mCtx->videosink), GST_STATE_NULL);
+					gst_bin_remove( GST_BIN(mCtx->baseObj.bin), mCtx->videosink);
+					mCtx->videosink = XAAdaptationBase_CreateGstSink( mCtx->xaVideoSink, "videosink", &(mCtx->isobjvsink) );
+					gst_bin_add(GST_BIN(mCtx->baseObj.bin), mCtx->videosink);
+					gst_element_link(mCtx->filter, mCtx->videosink);
+				}
+        	}
+
+            if ( bCtx->pipeSrcThrCtx.state != CPStateNull )
+            {
+                XAresult retVal = XA_RESULT_SUCCESS;
+
+                if ( bCtx->pipeSrcThrCtx.state == CPStateInitialized )
+                { /* Start thread if it's not running */
+                    retVal = XAImpl_StartThread( &(bCtx->pipeSrcThr), NULL, &XAAdaptationBase_ContentPipeScrThrFunc, &(bCtx->pipeSrcThrCtx) );
+                    if ( retVal != XA_RESULT_SUCCESS )
+                    {
+                        DEBUG_ERR("Could not start content pipe thread!");
+                    }
+                }
+                if ( bCtx->pipeSrcThrCtx.state == CPStatePaused ||
+                     bCtx->pipeSrcThrCtx.state == CPStateInitialized ||
+                     bCtx->pipeSrcThrCtx.state == CPStateStarted )
+                retVal = XAImpl_PostSemaphore( bCtx->pipeSrcThrCtx.stateSem );
+                if ( retVal != XA_RESULT_SUCCESS )
+                {
+                    DEBUG_ERR("Could not post content pipe semaphore!");
+                }
+            }
+
+            bCtx->binWantedState = GST_STATE_PLAYING;
+            if(mCtx->playrate!=1 && !mCtx->isobjsrc)
+            { /*set seek element for ff, rew and slow*/
+                XAAdaptationBase_PrepareAsyncWait(bCtx);
+                DEBUG_INFO_A1("Apply new playrate %f.", mCtx->playrate);
+                if(!gst_element_seek( bCtx->bin, mCtx->playrate, GST_FORMAT_TIME,
+                                    GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_ACCURATE,
+                                    GST_SEEK_TYPE_NONE, 0,
+                                    GST_SEEK_TYPE_NONE, -1))
+                {
+                    DEBUG_ERR("WARN: gst reports seek not handled");
+                }
+                /* flushed seeks always asynchronous */
+                XAAdaptationBase_StartAsyncWait(bCtx);
+                DEBUG_INFO("New playrate handled.");
+                bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
+            }
+
+            playing = XA_BOOLEAN_TRUE;
+            break;
+        }
+        default:
+            ret = XA_RESULT_PARAMETER_INVALID;
+            break;
+    }
+    /* launch Gstreamer state change only if necessary */
+    if( GST_STATE_TARGET(bCtx->bin) == bCtx->binWantedState )
+    {
+        DEBUG_INFO("Gst already in or transitioning to wanted state");
+        requestStateChange = XA_BOOLEAN_FALSE;
+    }
+    else
+    {
+        if( (GST_STATE(bCtx->bin) == bCtx->binWantedState) &&
+            (GST_STATE_PENDING(bCtx->bin) == GST_STATE_VOID_PENDING) )
+        {
+            DEBUG_ERR_A3("WARNING : gststate %d == wanted %d != gsttarget %d and no statechange pending",
+                          GST_STATE(bCtx->bin), bCtx->binWantedState, GST_STATE_TARGET(bCtx->bin));
+        }
+        requestStateChange = XA_BOOLEAN_TRUE;
+    }
+
+    if( requestStateChange )
+    {
+        XAAdaptationBase_PrepareAsyncWait(bCtx);
+        DEBUG_INFO_A1("Sending change state request to state %d", bCtx->binWantedState);
+        gstRet = gst_element_set_state( GST_ELEMENT(bCtx->bin), bCtx->binWantedState);
+        switch ( gstRet )
+        {
+            case GST_STATE_CHANGE_FAILURE:
+                DEBUG_ERR_A1("FAILED to change state (target %s)",
+                              gst_element_state_get_name(bCtx->binWantedState));
+                bCtx->binWantedState = GST_STATE(bCtx->bin);
+                ret = XA_RESULT_INTERNAL_ERROR;
+                break;
+            case GST_STATE_CHANGE_ASYNC:
+                DEBUG_INFO_A1("Change state will happen asyncronously (target %s)",
+                               gst_element_state_get_name(bCtx->binWantedState));
+                XAAdaptationBase_StartAsyncWait(bCtx);
+                ret = XA_RESULT_SUCCESS;
+                break;
+            case GST_STATE_CHANGE_NO_PREROLL:
+                DEBUG_INFO("GST_STATE_CHANGE_NO_PREROLL");
+                /* deliberate fall-through */
+            case GST_STATE_CHANGE_SUCCESS:
+                DEBUG_INFO_A1("Successfully changed state (target %s)",
+                               gst_element_state_get_name(bCtx->binWantedState));
+                ret = XA_RESULT_SUCCESS;
+                break;
+            default:
+                DEBUG_ERR_A1("Unhandled error (%d)",gstRet);
+                ret = XA_RESULT_UNKNOWN_ERROR;
+                break;
+        }
+        bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
+    }
+
+    if (playing && mCtx->isobjsrc && cameraCtx )
+    {
+    	GstPad* moSrc=NULL ;
+
+    	playing = XA_BOOLEAN_FALSE;
+    	moSrc = gst_element_get_static_pad( mCtx->source, "MPObjSrc");
+		if( moSrc && gst_pad_is_linked(moSrc) )
+		{
+			DEBUG_INFO_A2("unblock element:%s pad:%s",
+					gst_element_get_name( mCtx->source),
+					gst_pad_get_name(moSrc));
+			gst_pad_set_blocked_async(moSrc, FALSE, XAAdaptationBase_PadBlockCb, NULL);
+		}
+
+		if ( GST_STATE( GST_ELEMENT(mCtx->source)) != GST_STATE_PLAYING )
+		{
+			GstStateChangeReturn gret;
+			DEBUG_INFO("Start camera source");
+			gret = gst_element_set_state( GST_ELEMENT(mCtx->source), GST_STATE_PLAYING );
+			gret = gst_element_get_state( GST_ELEMENT(mCtx->source), NULL,NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC );
+		}
+    }
+    DEBUG_API("<-XAPlayItfAdapt_SetPlayState");
+    return ret;
+}
+
+/*
+ * XAresult XAPlayItfAdapt_GetDuration(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec)
+ * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID
+ * XAmillisecond *pMsec - Pointer where to store duration of stream.
+ * @return XAresult ret - Success value
+ */
+XAresult XAPlayItfAdapt_GetDuration(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationCtx* mCtx = NULL;
+    GstFormat format = GST_FORMAT_TIME;
+    gint64 duration;
+    DEBUG_API("->XAPlayItfAdapt_GetDuration");
+
+    if(!bCtx || bCtx->ctxId != XAMediaPlayerAdaptation || !pMsec)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+
+    if( gst_element_query_duration( GST_ELEMENT(bCtx->bin), &format, &duration ) )
+    {
+        DEBUG_INFO_A1("Duration: %"GST_TIME_FORMAT, GST_TIME_ARGS(duration));
+        ret = XA_RESULT_SUCCESS;
+        *pMsec = GST_TIME_AS_MSECONDS(duration);/*Warning ok due to used API specification*/
+    }
+    else
+    {
+        DEBUG_ERR("WARNING: Gst: could not get duration");
+        *pMsec = XA_TIME_UNKNOWN;
+        ret = XA_RESULT_SUCCESS;
+    }
+
+    DEBUG_API("<-XAPlayItfAdapt_GetDuration");
+    return ret;
+}
+
+/*
+ * XAresult XAPlayItfAdapt_GetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec)
+ * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID value
+ * XAmillisecond *pMsec - Pointer where to store current position in stream.
+ * @return XAresult ret - Success value
+ */
+XAresult XAPlayItfAdapt_GetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationCtx* mCtx = NULL;
+    gint64 position;
+    GstFormat format = GST_FORMAT_TIME;
+    DEBUG_API("->XAPlayItfAdapt_GetPosition");
+
+    if(!bCtx || bCtx->ctxId != XAMediaPlayerAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+
+    if ( gst_element_query_position( GST_ELEMENT(bCtx->bin), &format, &position  ) )
+    {
+        DEBUG_INFO_A1("Current position %"GST_TIME_FORMAT, GST_TIME_ARGS(position));
+        ret = XA_RESULT_SUCCESS;
+        *pMsec = GST_TIME_AS_MSECONDS(position);/*Warning ok due to used API specification*/
+    }
+    else
+    {
+        DEBUG_ERR("WARNING: Gst: could not get position");
+        /* probably not fully prerolled - safe assumption for position = 0 */
+        *pMsec = 0;
+        ret = XA_RESULT_SUCCESS;
+    }
+
+    DEBUG_API("<-XAPlayItfAdapt_GetPosition");
+    return ret;
+}
+
+/*
+ * XAresult XAPlayItfAdapt_EnablePositionTracking
+ * Enable/disable periodic position tracking callbacks
+ */
+XAresult XAPlayItfAdapt_EnablePositionTracking(XAAdaptationBaseCtx *bCtx, XAboolean enable)
+{
+    XAMediaPlayerAdaptationCtx* mCtx;
+
+    DEBUG_API_A1("->XAPlayItfAdapt_EnablePositionTracking (enable: %d)", (int)enable);
+    if(!bCtx || bCtx->ctxId != XAMediaPlayerAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+    if(enable && !(mCtx->trackpositionenabled))
+    {
+        mCtx->trackpositionenabled = XA_BOOLEAN_TRUE;
+        XAMediaPlayerAdapt_UpdatePositionCbTimer(mCtx);
+    }
+    else if (!enable && (mCtx->trackpositionenabled))
+    {
+        mCtx->trackpositionenabled = XA_BOOLEAN_FALSE;
+        XAMediaPlayerAdapt_UpdatePositionCbTimer(mCtx);
+    }
+
+    DEBUG_API("<-XAPlayItfAdapt_EnablePositionTracking");
+    return XA_RESULT_SUCCESS;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaplayitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAPLAYITFADAPTATION_H
+#define XAPLAYITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+#ifdef _DEBUG
+/*parse state names for debug prints*/
+static const char* playstatenames[3] =
+{
+    "XA_PLAYSTATE_STOPPED",
+    "XA_PLAYSTATE_PAUSED",
+    "XA_PLAYSTATE_PLAYING"
+};
+#define PLAYSTATENAME(i) (const char*)((i>0&&i<4)?playstatenames[i-1]:"INVALID")
+#endif /*_DEBUG*/
+
+
+/* FUNCTIONS */
+
+XAresult XAPlayItfAdapt_SetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 state);
+XAresult XAPlayItfAdapt_GetDuration(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec);
+XAresult XAPlayItfAdapt_GetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec);
+XAresult XAPlayItfAdapt_EnablePositionTracking(XAAdaptationBaseCtx *bCtx, XAboolean enable);
+
+
+#endif /* XAPLAYITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaradioadaptctx.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,120 @@
+/*
+* 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 <gst.h>
+#include "XARadioAdaptCtx.h"
+#include "XAAdaptation.h"
+#include "assert.h"
+
+
+/*
+ * XAAdaptationBaseCtx* XARadioAdapt_Create()
+ * Allocates memory for Radio Adaptation Context and makes 1st phase initialization
+ * @returns XARadioAdaptationCtx* - Pointer to created context
+ */
+XAAdaptationBaseCtx* XARadioAdapt_Create()
+{
+    XARadioAdaptationCtx *pSelf = calloc(1, sizeof(XARadioAdaptationCtx));
+    DEBUG_API("->XARadioAdapt_Create");
+
+    if ( pSelf)
+    {
+        if( XAAdaptationBase_Init(&(pSelf->baseObj),XARadioAdaptation)
+                    != XA_RESULT_SUCCESS )
+                {
+                    DEBUG_ERR("Failed to init base context!!!");
+                    free(pSelf);
+                    pSelf = NULL;
+                }
+                else
+                {
+                    pSelf->state = XA_RADIO_IDLE;
+                    pSelf->range = RADIO_DEFAULT_FREQ_RANGE;
+                    pSelf->frequency = RADIO_DEFAULT_FREQ;
+
+                    pSelf->rdsEmulationThread = 0;
+                    pSelf->emulationThread = 0;
+                }
+    }
+
+    DEBUG_API("<-XARadioAdapt_Create");
+    return (XAAdaptationBaseCtx*)pSelf;
+}
+
+/*
+ * XAresult XARadioAdapt_PostInit()
+ * 2nd phase initialization of Radio Adaptation Context
+ */
+XAresult XARadioAdapt_PostInit(XAAdaptationBaseCtx* bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioAdaptationCtx* ctx = NULL;
+    DEBUG_API("->XARadioAdapt_PostInit");
+    if(bCtx == NULL || bCtx->ctxId != XARadioAdaptation )
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XARadioAdapt_PostInit");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    ctx = (XARadioAdaptationCtx*)bCtx;
+
+    assert(ctx);
+
+    ret = XAAdaptationBase_PostInit( &ctx->baseObj );
+    if( ret!=XA_RESULT_SUCCESS )
+    {
+        DEBUG_ERR("Base context postinit failed!!");
+        DEBUG_API("<-XARadioAdapt_PostInit");
+        return ret;
+    }
+
+    ctx->baseObj.bin = gst_element_factory_make( "audiotestsrc", "audiosrc");
+    if ( !ctx->baseObj.bin )
+    {
+        DEBUG_ERR("Unable to create test audio source!");
+        DEBUG_API("<-XARadioAdapt_PostInit");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    g_object_set( G_OBJECT(ctx->baseObj.bin), "wave", 0x5, NULL );
+
+    DEBUG_API("<-XARadioAdapt_PostInit");
+    return ret;
+}
+
+/*
+ * void XARadioAdapt_Destroy(XAAdaptationBaseCtx* bCtx)
+ * Destroys Radio Adaptation Context
+ * @param ctx - Radio Adaptation context to be destroyed
+ */
+void XARadioAdapt_Destroy(XAAdaptationBaseCtx* bCtx)
+{
+    XARadioAdaptationCtx* ctx = NULL;
+    DEBUG_API("->XARadioAdapt_Destroy");
+
+    if(bCtx == NULL || bCtx->ctxId != XARadioAdaptation )
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XARadioAdapt_Destroy");
+        return;
+    }
+    ctx = (XARadioAdaptationCtx*)bCtx;
+    XAAdaptationBase_Free(&(ctx->baseObj));
+
+    free(ctx);
+
+    DEBUG_API("<-XARadioAdapt_Destroy");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaradioadaptctx.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XARADIOADAPTCTX_H
+#define XARADIOADAPTCTX_H
+
+#include "XAAdaptationContextBase.h"
+
+typedef enum {
+  GST_AUDIO_TEST_SRC_WAVE_SINE,
+  GST_AUDIO_TEST_SRC_WAVE_SQUARE,
+  GST_AUDIO_TEST_SRC_WAVE_SAW,
+  GST_AUDIO_TEST_SRC_WAVE_TRIANGLE,
+  GST_AUDIO_TEST_SRC_WAVE_SILENCE,
+  GST_AUDIO_TEST_SRC_WAVE_WHITE_NOISE,
+  GST_AUDIO_TEST_SRC_WAVE_PINK_NOISE,
+  GST_AUDIO_TEST_SRC_WAVE_SINE_TAB,
+  GST_AUDIO_TEST_SRC_WAVE_TICKS
+} GstAudioTestSrcWave;
+
+#define RADIO_DEFAULT_FREQ_RANGE XA_FREQRANGE_FMEUROAMERICA
+#define RADIO_DEFAULT_FREQ 88000000
+
+/* TYPEDEFS */
+typedef struct XARadioAdaptationCtx_ XARadioAdaptationCtx;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XARadioAdapt_Create();
+
+XAresult XARadioAdapt_PostInit(XAAdaptationBaseCtx* bCtx);
+void XARadioAdapt_Destroy(XAAdaptationBaseCtx* bCtx);
+
+#endif /* XARADIOADAPTCTX_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaradioitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,796 @@
+/*
+* 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 <unistd.h>
+#include <gst.h>
+#include "XAAdaptation.h"
+#include "XARadioItfAdaptation.h"
+#include "XARadioAdaptCtx.h"
+
+#define NUM_OF_SUPPORTED_RANGES 2
+#define NUM_OF_CHANNELS 2
+const char* RadioPresetDefaultName = "Default";
+
+/* emulated frequency range data */
+typedef struct FreqRange_
+{
+    XAuint8     id;
+    XAuint32    minFreq;
+    XAuint32    maxFreq;
+    XAuint32    freqInterval;
+    XAuint32    stereoMode;
+} FreqRange;
+
+/* emulated radio channel data */
+typedef struct Channel_
+{
+    XAuint32    freq;
+    XAuint32    strength;
+} Channel;
+
+/* emulated radio state */
+typedef enum
+{
+    RADIO_STATE_ON_CHANNEL,
+    RADIO_STATE_OFF_CHANNEL
+} RadioState;
+
+/* data structure to pass onto async functions */
+typedef struct
+{
+    XAAdaptationBaseCtx *bCtx;
+    XAuint32             value;
+} ThreadArgs;
+
+/* emulation variables and constraints */
+static const FreqRange supportedFreqRanges[NUM_OF_SUPPORTED_RANGES] = {
+        { XA_FREQRANGE_FMEUROAMERICA, 87500000, 108000000, 100000, XA_STEREOMODE_MONO },
+        {XA_FREQRANGE_FMJAPAN, 76000000, 90000000, 100000, XA_STEREOMODE_STEREO }};
+
+static const Channel channels[NUM_OF_CHANNELS] = { {88500000, 80},
+                                    {89300000, 60 }};
+
+static XAuint8 freqRangeIndex = 0;
+static XAboolean squelchMode = XA_BOOLEAN_FALSE;
+static XAint32 currentChannel = -1;
+static RadioState radioState = RADIO_STATE_OFF_CHANNEL;
+
+static void* asyncdata = NULL;
+
+/* FORWARD DECLARATIONS */
+void * XARadioItfAdapt_AsyncSetFrequencyRange(void* args);
+XAresult XARadioItfAdapt_SyncSetFrequencyRange(XAAdaptationBaseCtx *bCtx, XAuint8 range);
+void * XARadioItfAdapt_AsyncSetFrequency(void* args);
+XAresult XARadioItfAdapt_SyncSetFrequency(XAAdaptationBaseCtx *bCtx, XAuint32 freq);
+void * XARadioItfAdapt_AsyncSeek(void* args);
+
+/*
+ * XAresult XARadioItfAdapt_SetFreqRange(XAAdaptationBaseCtx *bCtx, XAuint8 range)
+ */
+XAresult XARadioItfAdapt_SetFreqRange(XAAdaptationBaseCtx *bCtx, XAuint8 range)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint16 index=0;
+    XARadioAdaptationCtx* mCtx = (XARadioAdaptationCtx*) bCtx;
+    int pt_ret=0;
+    DEBUG_API("->XARadioItfAdapt_SetFreqRange");
+
+    if(!bCtx || range < XA_FREQRANGE_FMEUROAMERICA || range > XA_FREQRANGE_AMSW)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_SetFreqRange");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    for (index = 0; index < NUM_OF_SUPPORTED_RANGES; index++)
+    {
+        if (supportedFreqRanges[index].id == range)
+        {
+            if (mCtx->range != range)
+            {
+                if (mCtx->state != XA_RADIO_IDLE)
+                {
+                  //  pthread_cancel(mCtx->emulationThread);
+                    if (asyncdata)
+                    {
+                        free(asyncdata);
+                        asyncdata = NULL;
+                    }
+                    mCtx->state = XA_RADIO_IDLE;
+                }
+                {
+                    ThreadArgs* args = calloc(1, sizeof(ThreadArgs));
+                    if (!args)
+                    {
+                        DEBUG_ERR("Calloc failed")
+                        DEBUG_API("<-XARadioItfAdapt_SetFreqRange");
+                        return XA_RESULT_INTERNAL_ERROR;
+                    }
+                    args->bCtx = bCtx;
+                    args->value = range;
+                    mCtx->state = XA_RADIO_SETTING_FREQUENCY_RANGE;
+                    pt_ret = pthread_create(&(mCtx->emulationThread), NULL, (XARadioItfAdapt_AsyncSetFrequencyRange),(void*)args);
+
+                    if(pt_ret)
+                    {
+                        DEBUG_ERR_A1("could not create thread!! (%d)",ret)
+                        DEBUG_API("<-XARadioItfAdapt_SetFreqRange");
+                        return XA_RESULT_INTERNAL_ERROR;
+                    }
+                }
+            }
+            break;
+        }
+    }
+
+    DEBUG_API("<-XARadioItfAdapt_SetFreqRange");
+    return ret;
+}
+
+/*
+ * void * XARadioItfAdapt_AsyncSetFrequencyRange(void* args)
+ */
+void * XARadioItfAdapt_AsyncSetFrequencyRange(void* args)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    ThreadArgs* tArgs = NULL;
+    XARadioAdaptationCtx* mCtx = NULL;
+
+    DEBUG_API("->XARadioItfAdapt_AsyncSetFrequencyRange");
+    asyncdata = args;
+    tArgs = args;
+
+    mCtx = (XARadioAdaptationCtx*) tArgs->bCtx;
+
+    DEBUG_INFO("Setting frequency async")
+    usleep(100000); /* 1/10 seconds */
+
+    ret = XARadioItfAdapt_SyncSetFrequencyRange(tArgs->bCtx, tArgs->value);
+    if (ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR("XARadioItfAdapt_SyncSetFrequencyRange FAILED");
+    }
+
+    /* Send event to RadioItf */
+    {
+        XAAdaptEvent event = {XA_RADIOITFEVENTS, XA_ADAPT_RADIO_FREQUENCY_RANGE_CHANGED, 0, NULL};
+        XAAdaptationBase_SendAdaptEvents(tArgs->bCtx, &event );
+    }
+    mCtx->state = XA_RADIO_IDLE;
+
+    free(args);
+    asyncdata = NULL;
+    DEBUG_API("<-XARadioItfAdapt_AsyncSetFrequencyRange");
+    pthread_exit(NULL);
+}
+
+/*
+ * XAresult XARadioItfAdapt_SyncSetFrequencyRange(XAAdaptationBaseCtx *bCtx, XAuint8 range)
+ */
+XAresult XARadioItfAdapt_SyncSetFrequencyRange(XAAdaptationBaseCtx *bCtx, XAuint8 range)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioAdaptationCtx* mCtx=NULL;
+    XAuint8 index=0;
+    DEBUG_API("->XARadioItfAdapt_SyncSetFrequencyRange");
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_SyncSetFrequencyRange");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    if (range != mCtx->range)
+    {
+        DEBUG_INFO("Frequency range changed!")
+
+        mCtx->range = range;
+        for(index = 0; index < NUM_OF_SUPPORTED_RANGES; index++)
+        {
+            if (supportedFreqRanges[index].id == mCtx->range)
+            {
+                freqRangeIndex = index;
+            }
+        }
+
+        ret = XARadioItfAdapt_SyncSetFrequency( bCtx, RADIO_DEFAULT_FREQ );
+    }
+
+    DEBUG_API("<-XARadioItfAdapt_SyncSetFrequencyRange");
+    return ret;
+}
+
+/*
+ * XAresult XARadioItfAdapt_GetFreqRange(XAAdaptationBaseCtx *bCtx,
+ *                                       XAuint8 * pFreqRange)
+ */
+XAresult XARadioItfAdapt_GetFreqRange(XAAdaptationBaseCtx *bCtx,
+                                      XAuint8 * pFreqRange)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioAdaptationCtx* mCtx=NULL;
+    DEBUG_API("->XARadioItfAdapt_GetFreqRange");
+
+    if(!bCtx || !pFreqRange)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_GetFreqRange");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    *pFreqRange = mCtx->range;
+
+    DEBUG_API("<-XARadioItfAdapt_GetFreqRange");
+    return ret;
+}
+
+
+
+/*
+ *  XAresult XARadioItfAdapt_IsFreqRangeSupported(XAAdaptationBaseCtx *bCtx,
+ *                                                XAuint8 range,
+ *                                                XAboolean * pSupported)
+ */
+XAresult XARadioItfAdapt_IsFreqRangeSupported(XAAdaptationBaseCtx *bCtx,
+                                             XAuint8 range,
+                                             XAboolean * pSupported)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint16 index=0;
+    DEBUG_API("->XARadioItfAdapt_IsFreqRangeSupported");
+
+    if(!bCtx || !pSupported || range < XA_FREQRANGE_FMEUROAMERICA || range > XA_FREQRANGE_AMSW)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_IsFreqRangeSupported");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pSupported = XA_BOOLEAN_FALSE;
+    for (index = 0; index < NUM_OF_SUPPORTED_RANGES; index++)
+    {
+        if (supportedFreqRanges[index].id == range)
+        {
+            *pSupported = XA_BOOLEAN_TRUE;
+            break;
+        }
+    }
+
+    DEBUG_API("<-XARadioItfAdapt_IsFreqRangeSupported");
+    return ret;
+}
+
+/*
+ * XAresult XARadioItfAdapt_GetFreqRangeProperties(XAAdaptationBaseCtx *bCtx,
+ *                                                 XAuint8 range,
+ *                                                 XAuint32 * pMinFreq,
+ *                                                 XAuint32 * pMaxFreq,
+ *                                                 XAuint32 * pFreqInterval)
+ */
+XAresult XARadioItfAdapt_GetFreqRangeProperties(XAAdaptationBaseCtx *bCtx,
+                                               XAuint8 range,
+                                               XAuint32 * pMinFreq,
+                                               XAuint32 * pMaxFreq,
+                                               XAuint32 * pFreqInterval)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioAdaptationCtx* mCtx=NULL;
+    XAuint16 index=0;
+    DEBUG_API("->XARadioItfAdapt_GetFreqRangeProperties");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_GetFreqRangeProperties");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    for (index = 0; index < NUM_OF_SUPPORTED_RANGES; index++)
+    {
+        if (supportedFreqRanges[index].id == range)
+        {
+            *pMinFreq = supportedFreqRanges[index].minFreq;
+            *pMaxFreq = supportedFreqRanges[index].maxFreq;
+            *pFreqInterval = supportedFreqRanges[index].freqInterval;
+            break;
+        }
+    }
+
+    DEBUG_API("<-XARadioItfAdapt_GetFreqRangeProperties");
+    return ret;
+}
+
+/*
+ * XAresult XARadioItfAdapt_SetFrequency(XAAdaptationBaseCtx *bCtx, XAuint32 freq)
+ */
+XAresult XARadioItfAdapt_SetFrequency(XAAdaptationBaseCtx *bCtx, XAuint32 freq)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    int pt_ret=0;
+    XARadioAdaptationCtx* mCtx=NULL;
+    DEBUG_API("->XARadioItfAdapt_SetFrequency");
+
+    if(!bCtx || freq < supportedFreqRanges[freqRangeIndex].minFreq
+            || freq > supportedFreqRanges[freqRangeIndex].maxFreq
+            || ((freq - supportedFreqRanges[freqRangeIndex].minFreq)
+                    % supportedFreqRanges[freqRangeIndex].freqInterval) != 0)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_SetFrequency");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    if (freq != mCtx->frequency)
+    {
+        if (mCtx->state != XA_RADIO_IDLE)
+        {
+           // pthread_cancel(mCtx->emulationThread);
+            if (asyncdata)
+            {
+                free(asyncdata);
+                asyncdata = NULL;
+            }
+        }
+
+        {
+            ThreadArgs* args = calloc(1, sizeof(ThreadArgs));
+            if (!args)
+            {
+                DEBUG_ERR("Calloc failed")
+                DEBUG_API("<-XARadioItfAdapt_SetFrequency");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+            args->bCtx = bCtx;
+            args->value = freq;
+            mCtx->state = XA_RADIO_SETTING_FREQUENCY;
+            pt_ret = pthread_create(&(mCtx->emulationThread), NULL, (XARadioItfAdapt_AsyncSetFrequency),(void*)args);
+
+            if(pt_ret)
+            {
+                DEBUG_ERR_A1("could not create thread!! (%d)",ret)
+                DEBUG_API("<-XARadioItfAdapt_SetFrequency");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+        }
+    } /* else do nothing freq was same */
+
+    DEBUG_API("<-XARadioItfAdapt_SetFrequency");
+    return ret;
+}
+
+/*
+ * void * XARadioItfAdapt_AsyncSetFrequency(void* args)
+ */
+void * XARadioItfAdapt_AsyncSetFrequency(void* args)
+{
+    ThreadArgs* tArgs = NULL;
+    XARadioAdaptationCtx* mCtx = NULL;
+    asyncdata = args;
+    tArgs = args;
+
+    mCtx = (XARadioAdaptationCtx*) tArgs->bCtx;
+    DEBUG_API("->XARadioItfAdapt_AsyncSetFrequency");
+    DEBUG_INFO("Setting frequency async")
+    usleep(100000); /* 1/10 seconds */
+
+    XARadioItfAdapt_SyncSetFrequency(tArgs->bCtx, tArgs->value);
+
+    /* Send event to RadioItf */
+    {
+        XAAdaptEvent event = {XA_RADIOITFEVENTS, XA_ADAPT_RADIO_FREQUENCY_CHANGED, 0, NULL };
+        XAAdaptationBase_SendAdaptEvents(tArgs->bCtx, &event );
+    }
+    mCtx->state = XA_RADIO_IDLE;
+
+    free(args);
+    asyncdata = NULL;
+    DEBUG_API("<-XARadioItfAdapt_AsyncSetFrequency");
+    pthread_exit(NULL);
+}
+
+/*
+ * XAresult XARadioItfAdapt_SyncSetFrequency(XAAdaptationBaseCtx *bCtx, XAuint32 freq)
+ */
+XAresult XARadioItfAdapt_SyncSetFrequency(XAAdaptationBaseCtx *bCtx, XAuint32 freq)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint8 index=0;
+    XAboolean channelFound = XA_BOOLEAN_FALSE;
+    XARadioAdaptationCtx* mCtx=NULL;
+
+    DEBUG_API("->XARadioItfAdapt_SyncSetFrequency");
+
+    if(!bCtx || freq < supportedFreqRanges[freqRangeIndex].minFreq
+            || freq > supportedFreqRanges[freqRangeIndex].maxFreq
+            || ((freq - supportedFreqRanges[freqRangeIndex].minFreq)
+                    % supportedFreqRanges[freqRangeIndex].freqInterval) != 0)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_SyncSetFrequency");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    if (freq != mCtx->frequency)
+    {
+        for (index = 0; index < NUM_OF_CHANNELS; index++)
+        {
+            if (channels[index].freq == freq)
+            {
+                currentChannel = index;
+                channelFound = XA_BOOLEAN_TRUE;
+                break;
+            }
+        }
+        if ( channelFound == XA_BOOLEAN_FALSE && radioState == RADIO_STATE_ON_CHANNEL)
+        {
+            if (squelchMode == XA_BOOLEAN_FALSE)
+            {
+                DEBUG_API("Channel not found, squelch mode off, set radio to white noise");
+                g_object_set( G_OBJECT(bCtx->bin), "wave", GST_AUDIO_TEST_SRC_WAVE_WHITE_NOISE, NULL );
+            }
+            else
+            {
+                DEBUG_API("Channel not found, squelch mode off, set radio to silence");
+                g_object_set( G_OBJECT(bCtx->bin), "wave", GST_AUDIO_TEST_SRC_WAVE_SILENCE, NULL );
+            }
+            radioState = RADIO_STATE_OFF_CHANNEL;
+        }
+        else if ( channelFound == XA_BOOLEAN_TRUE && radioState == RADIO_STATE_OFF_CHANNEL )
+        {
+            DEBUG_API("Channel found, set radio to sine wave");
+            g_object_set( G_OBJECT(bCtx->bin), "wave", GST_AUDIO_TEST_SRC_WAVE_SINE, NULL );
+            radioState = RADIO_STATE_ON_CHANNEL;
+        }
+        else
+        {
+            /* do nothing */
+        }
+
+        DEBUG_INFO("Frequency changed!")
+
+        mCtx->frequency = freq;
+    } /* else frequency not changed do nothing */
+
+    DEBUG_API("<-XARadioItfAdapt_SyncSetFrequency");
+    return ret;
+}
+
+/*
+ * XAresult XARadioItfAdapt_GetFrequency(XAAdaptationBaseCtx *bCtx,
+ *                                       XAuint32 * pFrequency)
+ */
+XAresult XARadioItfAdapt_GetFrequency(XAAdaptationBaseCtx *bCtx,
+                                      XAuint32 * pFrequency)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioAdaptationCtx* mCtx=NULL;
+    DEBUG_API("->XARadioItfAdapt_GetFrequency");
+
+    if(!bCtx || !pFrequency)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_GetFrequency");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    *pFrequency = mCtx->frequency;
+
+    DEBUG_API("<-XARadioItfAdapt_GetFrequency");
+    return ret;
+}
+
+
+/*
+ * XAresult XARadioItfAdapt_CancelSetFrequency(XAAdaptationBaseCtx *bCtx)
+ */
+XAresult XARadioItfAdapt_CancelSetFrequency(XAAdaptationBaseCtx *bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioAdaptationCtx* mCtx=NULL;
+    DEBUG_API("->XARadioItfAdapt_CancelSetFrequency");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_CancelSetFrequency");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XARadioAdaptationCtx*) bCtx;
+
+
+    if (mCtx->state == XA_RADIO_SEEKING)
+    {
+      //  pthread_cancel(mCtx->emulationThread);
+        mCtx->state = XA_RADIO_IDLE;
+    }
+
+    DEBUG_API("<-XARadioItfAdapt_CancelSetFrequency");
+    return ret;
+}
+
+/*
+ * XAresult XARadioItfAdapt_SetSquelch(XAAdaptationBaseCtx *bCtx, XAboolean squelch)
+ */
+XAresult XARadioItfAdapt_SetSquelch(XAAdaptationBaseCtx *bCtx, XAboolean squelch)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XARadioItfAdapt_SetSquelch");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_SetSquelch");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if (squelch != squelchMode)
+    {
+        if (radioState == RADIO_STATE_OFF_CHANNEL)
+        {
+            if (squelch == XA_BOOLEAN_FALSE)
+            {
+                DEBUG_API("Squelch untoggled, no channel, set radio to white noise")
+                g_object_set( G_OBJECT(bCtx->bin), "wave", GST_AUDIO_TEST_SRC_WAVE_WHITE_NOISE, NULL );
+            }
+            else
+            {
+                DEBUG_API("Squelch toggled, no channel, set radio to silence")
+                g_object_set( G_OBJECT(bCtx->bin), "wave", GST_AUDIO_TEST_SRC_WAVE_SILENCE, NULL );
+            }
+        }
+        else
+        {
+            DEBUG_API("Squelch toggled, radio on channel, radio not changed")
+        }
+        squelchMode = squelch;
+    } /* else do nothing as mode not changed */
+
+    DEBUG_API("<-XARadioItfAdapt_SetSquelch");
+    return ret;
+}
+
+/*
+ * XAresult XARadioItfAdapt_SetStereoMode(XAAdaptationBaseCtx *bCtx, XAuint32 mode)
+ */
+XAresult XARadioItfAdapt_SetStereoMode(XAAdaptationBaseCtx *bCtx, XAuint32 mode)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XARadioItfAdapt_SetStereoMode");
+
+    if(!bCtx || mode < XA_STEREOMODE_MONO || mode > XA_STEREOMODE_AUTO )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_SetStereoMode");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    switch ( mode )
+    {
+        case XA_STEREOMODE_MONO:
+            /* always works */
+            break;
+        case XA_STEREOMODE_STEREO:
+            if ( supportedFreqRanges[freqRangeIndex].stereoMode == XA_STEREOMODE_MONO )
+            {
+                DEBUG_ERR("StereoMode stereo unsupported");
+                ret = XA_RESULT_FEATURE_UNSUPPORTED;
+            }
+            break;
+        case XA_STEREOMODE_AUTO:
+            if ( supportedFreqRanges[freqRangeIndex].stereoMode != XA_STEREOMODE_AUTO )
+            {
+                DEBUG_ERR("StereoMode auto unsupported");
+                ret = XA_RESULT_FEATURE_UNSUPPORTED;
+            }
+            break;
+        default :
+            DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+            ret = XA_RESULT_INTERNAL_ERROR; /* shouldn't come here */
+            break;
+    }
+
+    DEBUG_API("<-XARadioItfAdapt_SetStereoMode");
+    return ret;
+}
+
+/*
+ * XAresult XARadioItfAdapt_GetSignalStrength(XAAdaptationBaseCtx *bCtx, XAuint32 * pStrength)
+ */
+XAresult XARadioItfAdapt_GetSignalStrength(XAAdaptationBaseCtx *bCtx, XAuint32 * pStrength)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XARadioItfAdapt_GetSignalStrength");
+
+    if(!bCtx || !pStrength)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_GetSignalStrength");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if (currentChannel != -1)
+    {
+        *pStrength = channels[currentChannel].strength;
+    }
+    else
+    {
+        *pStrength = 0;
+    }
+
+    DEBUG_API("<-XARadioItfAdapt_GetSignalStrength");
+    return ret;
+}
+
+/*
+ * XAresult XARadioItfAdapt_Seek(XAAdaptationBaseCtx *bCtx, XAboolean upwards)
+ */
+XAresult XARadioItfAdapt_Seek(XAAdaptationBaseCtx *bCtx, XAboolean upwards)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioAdaptationCtx* mCtx = NULL;
+    int pt_ret=0;
+    DEBUG_API("->XARadioItfAdapt_Seek");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_Seek");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    if (mCtx->state != XA_RADIO_IDLE)
+    {
+       // pthread_cancel(mCtx->emulationThread);
+        if (asyncdata)
+        {
+            free(asyncdata);
+            asyncdata = NULL;
+        }
+        mCtx->state = XA_RADIO_IDLE;
+    }
+
+    mCtx->state = XA_RADIO_SEEKING;
+    pt_ret = pthread_create(&(mCtx->emulationThread), NULL, (XARadioItfAdapt_AsyncSeek),(void*)bCtx);
+
+    if(pt_ret)
+    {
+        DEBUG_ERR_A1("could not create thread!! (%d)",ret)
+        DEBUG_API("<-XARadioItfAdapt_Seek");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    DEBUG_API("<-XARadioItfAdapt_Seek");
+    return ret;
+}
+
+/*
+ * void * XARadioItfAdapt_AsyncSeek(void* args)
+ */
+void * XARadioItfAdapt_AsyncSeek(void* args)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    XAAdaptationBaseCtx *bCtx = (XAAdaptationBaseCtx*)args;
+
+    XARadioAdaptationCtx* mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    XAuint8 index=0;
+    XAint8 currentChannel = 0;
+    XAuint32 freq=0;
+    mCtx->state = XA_RADIO_SEEKING;
+    usleep(100000); /* 1/10 seconds */
+
+    DEBUG_INFO("Seek done!")
+
+    for( index = 0; index < NUM_OF_CHANNELS; index++)
+    {
+        if (channels[index].freq == mCtx->frequency)
+        {
+            currentChannel = index;
+            break;
+        }
+    }
+
+    freq = channels[(currentChannel + 1)%NUM_OF_CHANNELS].freq;
+
+    ret = XARadioItfAdapt_SyncSetFrequency( bCtx, freq );
+    if (ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR("XARadioItfAdapt_SyncSetFrequency failed")
+    }
+
+    /* Send event to RadioItf */
+    {
+        XAAdaptEvent event = {XA_RADIOITFEVENTS, XA_ADAPT_RADIO_SEEK_COMPLETE, 0, NULL };
+        XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+    }
+    mCtx->state = XA_RADIO_IDLE;
+
+    pthread_exit(NULL);
+}
+
+/*
+ * XAresult XARadioItfAdapt_StopSeeking(XAAdaptationBaseCtx *bCtx)
+ */
+XAresult XARadioItfAdapt_StopSeeking(XAAdaptationBaseCtx *bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XARadioItfAdapt_StopSeeking");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_StopSeeking");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    if (mCtx->state == XA_RADIO_SEEKING)
+    {
+        mCtx->state = XA_RADIO_IDLE;
+      //  pthread_cancel(mCtx->emulationThread);
+
+        /* just put some random non-channel freq */
+        ret = XARadioItfAdapt_SyncSetFrequency( bCtx, channels[0].freq+supportedFreqRanges[freqRangeIndex].freqInterval);
+        if (ret != XA_RESULT_SUCCESS)
+        {
+            ret = XA_RESULT_INTERNAL_ERROR;
+        }
+    }
+
+    DEBUG_API("<-XARadioItfAdapt_StopSeeking");
+    return ret;
+}
+
+/*
+ * void XARadioItfAdapt_Free(XAAdaptationBaseCtx *bCtx)
+ */
+void XARadioItfAdapt_Free(XAAdaptationBaseCtx *bCtx)
+{
+    XARadioAdaptationCtx* mCtx = (XARadioAdaptationCtx*) bCtx;
+    DEBUG_API("->XARadioItfAdapt_Free");
+
+    if (mCtx->state != XA_RADIO_IDLE)
+    {
+       // pthread_cancel(mCtx->emulationThread);
+        if (asyncdata)
+        {
+            free(asyncdata);
+            asyncdata = NULL;
+        }
+        mCtx->state = XA_RADIO_IDLE;
+    }
+
+    DEBUG_API("<-XARadioItfAdapt_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaradioitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,65 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XARADIOITFFADAPTATION_H
+#define XARADIOITFFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+/* MACROS */
+#define RADIO_DEFAULT_STEREO_MODE XA_STEREOMODE_AUTO
+#define RADIO_NUM_OF_PRESETS 10
+
+extern const char* RadioPresetDefaultName;
+
+/* FUNCTIONS */
+XAresult XARadioItfAdapt_SetFreqRange(XAAdaptationBaseCtx *bCtx, XAuint8 range);
+
+XAresult XARadioItfAdapt_GetFreqRange(XAAdaptationBaseCtx *bCtx,
+                                      XAuint8 * pFreqRange);
+
+XAresult XARadioItfAdapt_IsFreqRangeSupported(XAAdaptationBaseCtx *bCtx,
+                                             XAuint8 range,
+                                             XAboolean * pSupported);
+
+XAresult XARadioItfAdapt_GetFreqRangeProperties(XAAdaptationBaseCtx *bCtx,
+                                               XAuint8 range,
+                                               XAuint32 * pMinFreq,
+                                               XAuint32 * pMaxFreq,
+                                               XAuint32 * pFreqInterval);
+
+XAresult XARadioItfAdapt_SetFrequency(XAAdaptationBaseCtx *bCtx, XAuint32 freq);
+
+XAresult XARadioItfAdapt_GetFrequency(XAAdaptationBaseCtx *bCtx,
+                                      XAuint32 * pFrequency);
+
+XAresult XARadioItfAdapt_CancelSetFrequency(XAAdaptationBaseCtx *bCtx);
+
+XAresult XARadioItfAdapt_SetSquelch(XAAdaptationBaseCtx *bCtx, XAboolean squelch);
+
+XAresult XARadioItfAdapt_SetStereoMode(XAAdaptationBaseCtx *bCtx, XAuint32 mode);
+
+XAresult XARadioItfAdapt_GetSignalStrength(XAAdaptationBaseCtx *bCtx, XAuint32 * pStrength);
+
+XAresult XARadioItfAdapt_Seek(XAAdaptationBaseCtx *bCtx, XAboolean upwards);
+
+XAresult XARadioItfAdapt_StopSeeking(XAAdaptationBaseCtx *bCtx);
+
+void XARadioItfAdapt_Free(XAAdaptationBaseCtx *bCtx);
+
+#endif /* XARADIOITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xardsitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,875 @@
+/*
+* 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 <unistd.h>
+#include <time.h>
+#include <string.h>
+
+#include "XAAdaptation.h"
+#include "XARadioAdaptCtx.h"
+#include "XARDSItfAdaptation.h"
+#include "XARadioItfAdaptation.h"
+
+/* emulated device data and constraints */
+
+#define NUM_OF_CHANNELS 2
+#define MAX_PS_STRING_LENGHT 17
+#define MAX_RT_STRING_LENGHT 129
+#define MAX_ODA_GROUP_SUBSCRIPTIONS 100
+#define MAX_PTY_STRING_SHORT_LENGHT 17
+#define MAX_PTY_STRING_LONG_LENGHT 33
+#define NONE_STRING_LENGHT 4
+
+/* emulated rds data structure */
+typedef struct
+{
+    XAuint32 frequency;
+    XAchar *progServiceName;
+    XAchar *radioText;
+    XAuint32 programmeType;
+    XAchar *ptyStringShort;
+    XAchar *ptyStringLong;
+    XAint16 programmeID;
+    XAboolean trafficAnnouncement;
+    XAboolean trafficProgramme;
+} RDSData;
+
+#define TRAFFIC_PROGRAMME_CHANNEL 0
+#define TRAFFIC_ANNOUNCEMENT_CHANNEL 0
+#define POPMUSIC_CHANNEL 1
+
+/* emulated rds data from channels */
+static const RDSData rdsData[NUM_OF_CHANNELS] = {
+        {88500000, (XAchar *)"Traffic", (XAchar *)"All your traffic needs", XA_RDSPROGRAMMETYPE_RDSPTY_NONE,
+            (XAchar *)"None", (XAchar *)"None", 0x0001, XA_BOOLEAN_TRUE, XA_BOOLEAN_TRUE },
+        {89300000, (XAchar *)"Popular", (XAchar *)"For the populous", XA_RDSPROGRAMMETYPE_RDSPTY_POPMUSIC,
+            (XAchar *)"Pop music", (XAchar *)"Pop music for the masses", 0x0002, XA_BOOLEAN_FALSE, XA_BOOLEAN_FALSE }
+};
+
+static const XAchar* noneString = (XAchar *)"None";
+
+static XAint16 subscribedODAGroups[MAX_ODA_GROUP_SUBSCRIPTIONS];
+static XAuint16 subscribedODAGroupCount = 0;
+
+static XAuint32 freqSetAfterSeek;
+
+const RDSData* GetCurrentRdsData( XAAdaptationBaseCtx *bCtx );
+void * XARDSItfAdapt_AsyncSeek(void* args);
+void * XARDSItfAdapt_AsyncGetODAGroup(void* args);
+
+/* exposing radio itf adaptation internal function here */
+XAresult XARadioItfAdapt_SyncSetFrequency(XAAdaptationBaseCtx *bCtx, XAuint32 freq);
+
+
+/*
+ * XAresult XARDSItfAdapt_QueryRDSSignal(XAAdaptationBaseCtx *bCtx, XAboolean * isSignal)
+ */
+XAresult XARDSItfAdapt_QueryRDSSignal(XAAdaptationBaseCtx *bCtx, XAboolean * isSignal)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XARDSItfAdapt_QueryRDSSignal");
+
+    if(!bCtx || !isSignal)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_QueryRDSSignal");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if (GetCurrentRdsData(bCtx))
+    {
+        *isSignal = XA_BOOLEAN_TRUE;
+    }
+    else
+    {
+        *isSignal = XA_BOOLEAN_FALSE;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_QueryRDSSignal");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_GetProgrammeServiceName(XAAdaptationBaseCtx *bCtx, XAchar * ps)
+ */
+XAresult XARDSItfAdapt_GetProgrammeServiceName(XAAdaptationBaseCtx *bCtx, XAchar * ps)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    const RDSData* data;
+    DEBUG_API("->XARDSItfAdapt_GetProgrammeServiceName");
+
+
+    if(!bCtx || !ps)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_GetProgrammeServiceName");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    data = GetCurrentRdsData( bCtx );
+
+    if (data)
+    {
+        strncpy( (char *)ps, (char *)data->progServiceName, MAX_PS_STRING_LENGHT );
+    }
+    else
+    {
+        *ps = 0;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_GetProgrammeServiceName");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_GetRadioText(XAAdaptationBaseCtx *bCtx, XAchar * rt)
+ */
+XAresult XARDSItfAdapt_GetRadioText(XAAdaptationBaseCtx *bCtx, XAchar * rt)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    const RDSData* data;
+    DEBUG_API("->XARDSItfAdapt_GetRadioText");
+
+    if(!bCtx || !rt)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_GetRadioText");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    data = GetCurrentRdsData( bCtx );
+
+    if (data)
+    {
+        strncpy( (char *)rt, (char *)data->radioText, MAX_RT_STRING_LENGHT );
+    }
+    else
+    {
+        *rt = 0;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_GetRadioText");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_GetRadioTextPlus(XAAdaptationBaseCtx *bCtx,
+ *                                         XAuint8 contentType,
+ *                                         XAchar * informationElement,
+ *                                         XAchar * descriptor,
+ *                                         XAuint8 * descriptorContentType)
+ */
+XAresult XARDSItfAdapt_GetRadioTextPlus(XAAdaptationBaseCtx *bCtx,
+                                        XAuint8 contentType,
+                                        XAchar * informationElement,
+                                        XAchar * descriptor,
+                                        XAuint8 * descriptorContentType)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XARDSItfAdapt_GetRadioTextPlus");
+
+    if(!bCtx || contentType < XA_RDSRTPLUS_ITEMTITLE || contentType > XA_RDSRTPLUS_GETDATA
+            || !informationElement || !descriptor || !descriptorContentType)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_GetRadioTextPlus");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *informationElement = 0;
+    *descriptorContentType = 0;
+
+    DEBUG_API("<-XARDSItfAdapt_GetRadioTextPlus");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_GetProgrammeType(XAAdaptationBaseCtx *bCtx, XAuint32 * pty)
+ */
+XAresult XARDSItfAdapt_GetProgrammeType(XAAdaptationBaseCtx *bCtx, XAuint32 * pty)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    const RDSData* data;
+    DEBUG_API("->XARDSItfAdapt_GetProgrammeType");
+
+    if(!bCtx || !pty)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_GetProgrammeType");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    data = GetCurrentRdsData( bCtx );
+
+    if (data)
+    {
+        *pty = data->programmeType;
+    }
+    else
+    {
+        *pty = 0;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_GetProgrammeType");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_GetProgrammeTypeString(XAAdaptationBaseCtx *bCtx,
+ *                                               XAboolean isLengthMax16,
+ *                                               XAchar * pty)
+ *
+ */
+XAresult XARDSItfAdapt_GetProgrammeTypeString(XAAdaptationBaseCtx *bCtx,
+                                             XAboolean isLengthMax16,
+                                             XAchar * pty)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    const RDSData* data;
+    DEBUG_API("->XARDSItfAdapt_GetProgrammeTypeString");
+
+    if(!bCtx || !pty)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_GetProgrammeTypeString");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    data = GetCurrentRdsData( bCtx );
+
+    if (data)
+    {
+        if (isLengthMax16)
+        {
+            DEBUG_API_A1("Programme type string %s", data->ptyStringLong);
+            strncpy( (char *)pty, (char *)data->ptyStringLong, MAX_PTY_STRING_LONG_LENGHT );
+        }
+        else
+        {
+            DEBUG_API_A1("Programme type string %s", data->ptyStringShort);
+            strncpy( (char *)pty, (char *)data->ptyStringShort, MAX_PTY_STRING_SHORT_LENGHT );
+        }
+    }
+    else
+    {
+        DEBUG_API_A1("Programme type string %s", noneString);
+        strncpy( (char *)pty, (char *)noneString, NONE_STRING_LENGHT );
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_GetProgrammeTypeString");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_GetProgrammeIdentificationCode(XAAdaptationBaseCtx *bCtx, XAint16 * pi)
+ */
+XAresult XARDSItfAdapt_GetProgrammeIdentificationCode(XAAdaptationBaseCtx *bCtx, XAint16 * pi)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    const RDSData* data;
+    DEBUG_API("->XARDSItfAdapt_GetProgrammeIdentificationCode");
+
+    if(!bCtx || !pi)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_GetProgrammeIdentificationCode");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    data = GetCurrentRdsData( bCtx );
+
+    if (data)
+    {
+        *pi = data->programmeID;
+    }
+    else
+    {
+        *pi = 0;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_GetProgrammeIdentificationCode");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_GetClockTime(XAAdaptationBaseCtx *bCtx, XAtime * dateAndTime)
+ */
+XAresult XARDSItfAdapt_GetClockTime(XAAdaptationBaseCtx *bCtx, XAtime * dateAndTime)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    time_t timeRet=0;
+    DEBUG_API("->XARDSItfAdapt_GetClockTime");
+
+    if(!bCtx || !dateAndTime)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_GetClockTime");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    timeRet = time(NULL);
+
+    if (timeRet == -1) /* could not get time for some reason */
+    {
+        ret = XA_RESULT_INTERNAL_ERROR;
+    }
+    else
+    {
+        *dateAndTime = timeRet;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_GetClockTime");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_GetTrafficAnnouncement(XAAdaptationBaseCtx *bCtx, XAboolean * ta)
+ */
+XAresult XARDSItfAdapt_GetTrafficAnnouncement(XAAdaptationBaseCtx *bCtx, XAboolean * ta)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    const RDSData* data;
+    DEBUG_API("->XARDSItfAdapt_GetTrafficAnnouncement");
+
+    if(!bCtx || !ta)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_GetTrafficAnnouncement");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    data = GetCurrentRdsData( bCtx );
+
+    if (data)
+    {
+        *ta = data->trafficAnnouncement;
+    }
+    else
+    {
+        *ta = XA_BOOLEAN_FALSE;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_GetTrafficAnnouncement");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_GetTrafficProgramme(XAAdaptationBaseCtx *bCtx, XAboolean * tp)
+ */
+XAresult XARDSItfAdapt_GetTrafficProgramme(XAAdaptationBaseCtx *bCtx, XAboolean * tp)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    const RDSData* data;
+    DEBUG_API("->XARDSItfAdapt_GetTrafficProgramme");
+
+    if(!bCtx || !tp)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_GetTrafficProgramme");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    data = GetCurrentRdsData( bCtx );
+
+    if (data)
+    {
+        *tp = data->trafficProgramme;
+    }
+    else
+    {
+        *tp = XA_BOOLEAN_FALSE;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_GetTrafficProgramme");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_SeekByProgrammeType(XAAdaptationBaseCtx *bCtx,
+ *                                            XAuint32 pty,
+ *                                            XAboolean upwards)
+ */
+XAresult XARDSItfAdapt_SeekByProgrammeType(XAAdaptationBaseCtx *bCtx,
+                                           XAuint32 pty,
+                                           XAboolean upwards)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    int pt_ret=0;
+    XARadioAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XARDSItfAdapt_SeekByProgrammeType");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_SeekByProgrammeType");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    if (mCtx->state != XA_RADIO_IDLE)
+    {
+      //  pthread_cancel(mCtx->emulationThread);
+        mCtx->state = XA_RADIO_IDLE;
+    }
+
+    if (pty == XA_RDSPROGRAMMETYPE_RDSPTY_POPMUSIC)
+    {
+        freqSetAfterSeek = rdsData[POPMUSIC_CHANNEL].frequency;
+    }
+    else
+    {
+        freqSetAfterSeek = mCtx->frequency;
+    }
+
+    mCtx->state = XA_RADIO_SEEKING;
+    pt_ret = pthread_create(&(mCtx->emulationThread), NULL, (XARDSItfAdapt_AsyncSeek),(void*)bCtx);
+
+    if(pt_ret)
+    {
+        DEBUG_ERR_A1("could not create thread!! (%d)",ret);
+        DEBUG_API("<-XARDSItfAdapt_SeekByProgrammeType");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_SeekByProgrammeType");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_SeekTrafficAnnouncement(XAAdaptationBaseCtx *bCtx, XAboolean upwards)
+ */
+XAresult XARDSItfAdapt_SeekTrafficAnnouncement(XAAdaptationBaseCtx *bCtx, XAboolean upwards)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    int pt_ret=0;
+    XARadioAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XARDSItfAdapt_SeekTrafficAnnouncement");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_SeekTrafficAnnouncement");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    if (mCtx->state != XA_RADIO_IDLE)
+    {
+     //   pthread_cancel(mCtx->emulationThread);
+        mCtx->state = XA_RADIO_IDLE;
+    }
+
+    freqSetAfterSeek = rdsData[TRAFFIC_ANNOUNCEMENT_CHANNEL].frequency;
+
+    mCtx->state = XA_RADIO_SEEKING;
+    pt_ret = pthread_create(&(mCtx->emulationThread), NULL, (XARDSItfAdapt_AsyncSeek),(void*)bCtx);
+
+    if(pt_ret)
+    {
+        DEBUG_ERR_A1("could not create thread!! (%d)",ret);
+        DEBUG_API("<-XARDSItfAdapt_SeekTrafficAnnouncement");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_SeekTrafficAnnouncement");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_SeekTrafficProgramme(XAAdaptationBaseCtx *bCtx, XAboolean upwards)
+ */
+XAresult XARDSItfAdapt_SeekTrafficProgramme(XAAdaptationBaseCtx *bCtx, XAboolean upwards)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    int pt_ret=0;
+    XARadioAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XARDSItfAdapt_SeekTrafficProgramme");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_SeekTrafficProgramme");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    if (mCtx->state != XA_RADIO_IDLE)
+    {
+      //  pthread_cancel(mCtx->emulationThread);
+        mCtx->state = XA_RADIO_IDLE;
+    }
+
+    freqSetAfterSeek = rdsData[TRAFFIC_PROGRAMME_CHANNEL].frequency;
+
+    mCtx->state = XA_RADIO_SEEKING;
+    pt_ret = pthread_create(&(mCtx->emulationThread), NULL, (XARDSItfAdapt_AsyncSeek),(void*)bCtx);
+
+    if(pt_ret)
+    {
+        DEBUG_ERR_A1("could not create thread!! (%d)",ret);
+        DEBUG_API("<-XARDSItfAdapt_SeekTrafficProgramme");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_SeekTrafficProgramme");
+    return ret;
+}
+
+/*
+ * void * XARadioItfAdapt_AsyncSeek(void* args)
+ */
+void * XARDSItfAdapt_AsyncSeek(void* args)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAAdaptationBaseCtx *bCtx = (XAAdaptationBaseCtx*)args;
+
+    XARadioAdaptationCtx* mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    DEBUG_API("->XARDSItfAdapt_AsyncSeek");
+
+    usleep(100000); /* 1/10 seconds */
+
+    DEBUG_INFO("Seek done!");
+
+    ret = XARadioItfAdapt_SyncSetFrequency( bCtx, freqSetAfterSeek );
+    if (ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR("XARadioItfAdapt_SyncSetFrequency FAILED");
+    }
+
+    /* Send event to RadioItf */
+    {
+        XAAdaptEvent event = {XA_RADIOITFEVENTS, XA_ADAPT_RADIO_SEEK_COMPLETE, 0, NULL };
+        XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+    }
+    mCtx->state = XA_RADIO_IDLE;
+
+    DEBUG_API("<-XARDSItfAdapt_AsyncSeek");
+    pthread_exit(NULL);
+}
+
+/*
+ * XAresult XARDSItfAdapt_SetAutomaticSwitching(XAAdaptationBaseCtx *bCtx, XAboolean automatic)
+ */
+XAresult XARDSItfAdapt_SetAutomaticSwitching(XAAdaptationBaseCtx *bCtx, XAboolean automatic)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XARDSItfAdapt_SetAutomaticSwitching");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_SetAutomaticSwitching");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    ret = XA_RESULT_FEATURE_UNSUPPORTED;
+
+    DEBUG_API("<-XARDSItfAdapt_SetAutomaticSwitching");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_GetAutomaticSwitching(XAAdaptationBaseCtx *bCtx, XAboolean * automatic)
+ */
+XAresult XARDSItfAdapt_GetAutomaticSwitching(XAAdaptationBaseCtx *bCtx, XAboolean * automatic)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XARDSItfAdapt_GetAutomaticSwitching");
+
+    if(!bCtx || !automatic)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_GetAutomaticSwitching");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* Feature not supported */
+    *automatic = XA_BOOLEAN_FALSE;
+
+    DEBUG_API("<-XARDSItfAdapt_GetAutomaticSwitching");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_SetAutomaticTrafficAnnouncement(XAAdaptationBaseCtx *bCtx, XAboolean automatic)
+ */
+XAresult XARDSItfAdapt_SetAutomaticTrafficAnnouncement(XAAdaptationBaseCtx *bCtx, XAboolean automatic)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XARDSItfAdapt_SetAutomaticTrafficAnnouncement");
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_SetAutomaticTrafficAnnouncement");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    ret = XA_RESULT_FEATURE_UNSUPPORTED;
+
+    DEBUG_API("<-XARDSItfAdapt_SetAutomaticTrafficAnnouncement");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_GetAutomaticTrafficAnnouncement(XAAdaptationBaseCtx *bCtx, XAboolean * automatic)
+ */
+XAresult XARDSItfAdapt_GetAutomaticTrafficAnnouncement(XAAdaptationBaseCtx *bCtx, XAboolean * automatic)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XARDSItfAdapt_GetAutomaticTrafficAnnouncement");
+
+    if(!bCtx || !automatic)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_GetAutomaticTrafficAnnouncement");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *automatic = XA_BOOLEAN_FALSE;
+
+    DEBUG_API("<-XARDSItfAdapt_GetAutomaticTrafficAnnouncement");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_GetODAGroup(XAAdaptationBaseCtx *bCtx,
+ *                                    XAint16 AID)
+ */
+XAresult XARDSItfAdapt_GetODAGroup(XAAdaptationBaseCtx *bCtx, XAint16 AID)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    int pt_ret=0;
+    XARadioAdaptationCtx* mCtx=NULL;
+    DEBUG_API("->XARDSItfAdapt_GetODAGroup");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_GetODAGroup");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    if (mCtx->rdsState != XA_RADIO_RDS_IDLE)
+    {
+      //  pthread_cancel(mCtx->rdsEmulationThread);
+        mCtx->rdsState = XA_RADIO_RDS_IDLE;
+        DEBUG_INFO("Previous getodagroup async call cancelled")
+    }
+
+    pt_ret = pthread_create(&(mCtx->rdsEmulationThread), NULL, (XARDSItfAdapt_AsyncGetODAGroup),(void*)bCtx);
+
+    if(pt_ret)
+    {
+        DEBUG_ERR_A1("could not create thread!! (%d)",ret);
+        DEBUG_API("<-XARDSItfAdapt_GetODAGroup");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_GetODAGroup");
+    return ret;
+}
+
+/*
+ * void * XARDSItfAdapt_AsyncGetODAGroup(void* args)
+ */
+void * XARDSItfAdapt_AsyncGetODAGroup(void* args)
+{
+    XARadioAdaptationCtx* mCtx = (XARadioAdaptationCtx*)args;
+
+    DEBUG_API("->XARDSItfAdapt_AsyncGetODAGroup");
+    mCtx->rdsState = XA_RADIO_RDS_GETTING_ODA_GROUP;
+
+    DEBUG_INFO("Get oda group async wait")
+    usleep(100000); /* 1/10 seconds */
+
+    /* Send event */
+    {
+        XAAdaptEvent event = {XA_RDSITFEVENTS, XA_ADAPT_RDS_GET_ODA_GROUP_DONE, 0, NULL };
+        XAAdaptationBase_SendAdaptEvents(args, &event );
+    }
+    mCtx->rdsState = XA_RADIO_RDS_IDLE;
+    DEBUG_API("<-XARDSItfAdapt_AsyncGetODAGroup");
+    pthread_exit(NULL);
+}
+
+/*
+ * XAresult XARDSItfAdapt_SubscribeODAGroup(XAAdaptationBaseCtx *bCtx,
+ *                                          XAint16 group,
+ *                                          XAboolean useErrorCorrection)
+ */
+XAresult XARDSItfAdapt_SubscribeODAGroup(XAAdaptationBaseCtx *bCtx,
+                                        XAint16 group,
+                                        XAboolean useErrorCorrection)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint8 index=0;
+    XAboolean groupFound = XA_BOOLEAN_FALSE;
+    DEBUG_API("->XARDSItfAdapt_SubscribeODAGroup");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_SubscribeODAGroup");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* Look for group in list, if not there add it */
+    if (subscribedODAGroupCount < MAX_ODA_GROUP_SUBSCRIPTIONS)
+    {
+        for (index = 0; index < subscribedODAGroupCount; index++)
+        {
+            if (subscribedODAGroups[index] == group)
+            {
+                groupFound = XA_BOOLEAN_TRUE;
+            }
+        }
+        if (!groupFound)
+        {
+            subscribedODAGroups[subscribedODAGroupCount] = group;
+            subscribedODAGroupCount++;
+        }
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("<-XARDSItfAdapt_SubscribeODAGroup");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_SubscribeODAGroup");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_UnsubscribeODAGroup(XAAdaptationBaseCtx *bCtx, XAint16 group)
+ */
+XAresult XARDSItfAdapt_UnsubscribeODAGroup(XAAdaptationBaseCtx *bCtx, XAint16 group)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint8 index=0;
+    DEBUG_API("->XARDSItfAdapt_UnsubscribeODAGroup");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_UnsubscribeODAGroup");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* Look for group in list, if found, remove it */
+    for (index = 0; index < subscribedODAGroupCount; index++)
+    {
+        if (subscribedODAGroups[index] == group)
+        {
+            subscribedODAGroups[index] = subscribedODAGroups[subscribedODAGroupCount-1];
+            subscribedODAGroupCount--;
+        }
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_UnsubscribeODAGroup");
+    return ret;
+}
+
+/*
+ * XAresult XARDSItfAdapt_ListODAGroupSubscriptions(XAAdaptationBaseCtx *bCtx,
+ *                                                  XAint16* pGroups,
+ *                                                  XAuint32* pLength)
+ */
+XAresult XARDSItfAdapt_ListODAGroupSubscriptions(XAAdaptationBaseCtx *bCtx,
+                                                XAint16* pGroups,
+                                                XAuint32* pLength)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint8 index=0;
+    DEBUG_API("->XARDSItfAdapt_ListODAGroupSubscriptions");
+
+    if(!bCtx || !pLength)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARDSItfAdapt_ListODAGroupSubscriptions");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if (!pGroups)
+    {
+        *pLength = subscribedODAGroupCount;
+    }
+    else
+    {
+        if (*pLength < subscribedODAGroupCount)
+        {
+            ret = XA_RESULT_BUFFER_INSUFFICIENT;
+        }
+        for (index = 0; index < *pLength; index++)
+        {
+            pGroups[index] = subscribedODAGroups[index];
+        }
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_ListODAGroupSubscriptions");
+    return ret;
+}
+
+/*
+ * const RDSData* GetCurrentRdsData( XAAdaptationBaseCtx *bCtx )
+ */
+const RDSData* GetCurrentRdsData( XAAdaptationBaseCtx *bCtx )
+{
+    XAuint8 index=0;
+    XARadioAdaptationCtx* mCtx = (XARadioAdaptationCtx*) bCtx;
+
+    for (index = 0; index < NUM_OF_CHANNELS; index++ )
+    {
+        if (rdsData[index].frequency == mCtx->frequency)
+        {
+            DEBUG_API("<-GetCurrentRdsData");
+            return &(rdsData[index]);
+        }
+    }
+    DEBUG_API("<-GetCurrentRdsData");
+    return NULL;
+}
+
+
+/*
+ * void XARDSItfAdapt_Free(XAAdaptationBaseCtx *bCtx)
+ */
+void XARDSItfAdapt_Free(XAAdaptationBaseCtx *bCtx)
+{
+    XARadioAdaptationCtx* mCtx = (XARadioAdaptationCtx*) bCtx;
+    DEBUG_API("->XARDSItfAdapt_Free");
+
+    if (mCtx->state != XA_RADIO_IDLE)
+    {
+       // pthread_cancel(mCtx->emulationThread);
+        mCtx->state = XA_RADIO_IDLE;
+    }
+
+    if (mCtx->rdsState != XA_RADIO_RDS_IDLE)
+    {
+      //  pthread_cancel(mCtx->rdsEmulationThread);
+        mCtx->rdsState = XA_RADIO_RDS_IDLE;
+    }
+
+    DEBUG_API("<-XARDSItfAdapt_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xardsitfadaptation.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XARDSITFFADAPTATION_H
+#define XARDSOITFFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+/* MACROS */
+
+/* FUNCTIONS */
+
+XAresult XARDSItfAdapt_QueryRDSSignal(XAAdaptationBaseCtx *bCtx, XAboolean * isSignal);
+
+XAresult XARDSItfAdapt_GetProgrammeServiceName(XAAdaptationBaseCtx *bCtx, XAchar * ps);
+
+XAresult XARDSItfAdapt_GetRadioText(XAAdaptationBaseCtx *bCtx, XAchar * rt);
+
+XAresult XARDSItfAdapt_GetRadioTextPlus(XAAdaptationBaseCtx *bCtx,
+                                       XAuint8 contentType,
+                                       XAchar * informationElement,
+                                       XAchar * descriptor,
+                                       XAuint8 * descriptorContentType);
+
+XAresult XARDSItfAdapt_GetProgrammeType(XAAdaptationBaseCtx *bCtx, XAuint32 * pty);
+
+XAresult XARDSItfAdapt_GetProgrammeTypeString(XAAdaptationBaseCtx *bCtx,
+                                             XAboolean isLengthMax16,
+                                             XAchar * pty);
+
+XAresult XARDSItfAdapt_GetProgrammeIdentificationCode(XAAdaptationBaseCtx *bCtx, XAint16 * pi);
+
+XAresult XARDSItfAdapt_GetClockTime(XAAdaptationBaseCtx *bCtx, XAtime * dateAndTime);
+
+XAresult XARDSItfAdapt_GetTrafficAnnouncement(XAAdaptationBaseCtx *bCtx, XAboolean * ta);
+
+XAresult XARDSItfAdapt_GetTrafficProgramme(XAAdaptationBaseCtx *bCtx, XAboolean * tp);
+
+XAresult XARDSItfAdapt_SeekByProgrammeType(XAAdaptationBaseCtx *bCtx,
+                                          XAuint32 pty,
+                                          XAboolean upwards);
+
+XAresult XARDSItfAdapt_SeekTrafficAnnouncement(XAAdaptationBaseCtx *bCtx, XAboolean upwards);
+
+XAresult XARDSItfAdapt_SeekTrafficProgramme(XAAdaptationBaseCtx *bCtx, XAboolean upwards);
+
+XAresult XARDSItfAdapt_SetAutomaticSwitching(XAAdaptationBaseCtx *bCtx, XAboolean automatic);
+
+XAresult XARDSItfAdapt_GetAutomaticSwitching(XAAdaptationBaseCtx *bCtx, XAboolean * automatic);
+
+XAresult XARDSItfAdapt_SetAutomaticTrafficAnnouncement(XAAdaptationBaseCtx *bCtx, XAboolean automatic);
+
+XAresult XARDSItfAdapt_GetAutomaticTrafficAnnouncement(XAAdaptationBaseCtx *bCtx, XAboolean * automatic);
+
+XAresult XARDSItfAdapt_GetODAGroup(XAAdaptationBaseCtx *bCtx, XAint16 AID);
+
+XAresult XARDSItfAdapt_SubscribeODAGroup(XAAdaptationBaseCtx *bCtx,
+                                        XAint16 group,
+                                        XAboolean useErrorCorrection);
+
+XAresult XARDSItfAdapt_UnsubscribeODAGroup(XAAdaptationBaseCtx *bCtx, XAint16 group);
+
+XAresult XARDSItfAdapt_ListODAGroupSubscriptions(XAAdaptationBaseCtx *bCtx,
+                                                XAint16* pGroups,
+                                                XAuint32* pLength);
+
+void XARDSItfAdapt_Free(XAAdaptationBaseCtx *bCtx);
+
+#endif /* XARDSITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xarecorditfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,418 @@
+/*
+* 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 <pthread.h>
+#include <gst.h>
+#include "XAMediaRecorderAdaptCtx.h"
+#include "XARecordItfAdaptation.h"
+#include "XAAdaptation.h"
+
+/*forward declaration of position updater callback*/
+gboolean XARecordItfAdapt_PositionUpdate(gpointer ctx);
+
+extern XAboolean cameraRealized;
+extern XACameraAdaptationCtx_* cameraCtx;
+
+/*
+ * XAresult XARecordItfAdapt_SetRecordState(XAAdaptationBaseCtx *ctx, XAuint32 state)
+ * Sets record state to GStreamer.
+ * @param XAAdaptationBaseCtx *ctx - Adaptation context
+ * XAuint32 state - Record state to be set
+ * @return XAresult ret - Success value
+ */
+XAresult XARecordItfAdapt_SetRecordState(XAAdaptationBaseCtx *bCtx, XAuint32 state)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAboolean closeSink = XA_BOOLEAN_FALSE;
+    XAboolean requestStateChange = XA_BOOLEAN_FALSE;
+    GstStateChangeReturn gstRet = GST_STATE_CHANGE_SUCCESS;
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    XAboolean recording = XA_BOOLEAN_FALSE;
+    DEBUG_API_A1("->XARecordItfAdapt_SetRecordState %s",RECORDSTATENAME(state));
+    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfAdapt_SetRecordState");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+    mCtx->isRecord = XA_BOOLEAN_TRUE;
+
+    switch ( state )
+    {
+        case XA_RECORDSTATE_STOPPED:
+        {
+        	if ( cameraCtx && cameraRealized && mCtx->isobjvsrc && mCtx->videosource  )
+			{
+				cameraCtx->recording = XA_BOOLEAN_FALSE;
+
+	            if(!cameraCtx->playing && !cameraCtx->snapshotting)
+	            {
+	            	/* Neither view finder or recorder is running -> pause camera */
+	            	if ( GST_STATE( GST_ELEMENT(mCtx->videosource)) == GST_STATE_PLAYING )
+	            	{
+	            		GstStateChangeReturn gret;
+	        			DEBUG_INFO("Stop camera source");
+	        			gret = gst_element_set_state( GST_ELEMENT(mCtx->videosource), GST_STATE_PAUSED );
+	        			gret = gst_element_get_state( GST_ELEMENT(mCtx->videosource), NULL,NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC );
+	            	}
+	            }
+			}
+
+            if ( bCtx->pipeSinkThrCtx.state != CPStateNull )
+            {
+                bCtx->pipeSinkThrCtx.state = CPStateStopped;
+            }
+            bCtx->binWantedState = GST_STATE_PAUSED;
+            closeSink = XA_BOOLEAN_TRUE;
+            if(mCtx->runpositiontimer > 0)
+            {
+                g_source_remove(mCtx->runpositiontimer);
+                mCtx->runpositiontimer=0;
+            }
+
+            if ( mCtx->recThrCtx.bufInsufficientSem )
+            {
+                DEBUG_INFO("No buffer-insufficient received, posting record thr semaphore.");
+                if ( XAImpl_PostSemaphore( mCtx->recThrCtx.bufInsufficientSem ) != XA_RESULT_SUCCESS)
+                {
+                    DEBUG_ERR("Posting buffer-insufficient semaphore FAILED!");
+                }
+            }
+
+            break;
+        }
+        case XA_RECORDSTATE_PAUSED:
+        {
+        	if ( cameraCtx && cameraRealized && mCtx->isobjvsrc && mCtx->videosource  )
+			{
+				cameraCtx->recording = XA_BOOLEAN_FALSE;
+				if(!cameraCtx->playing && !cameraCtx->snapshotting)
+				{
+					/* Neither view finder or recorder is running -> pause camera */
+					if ( GST_STATE( GST_ELEMENT(mCtx->videosource)) == GST_STATE_PLAYING )
+					{
+						GstStateChangeReturn gret;
+						DEBUG_INFO("Stop camera source");
+						gret = gst_element_set_state( GST_ELEMENT(mCtx->videosource), GST_STATE_PAUSED );
+						gret = gst_element_get_state( GST_ELEMENT(mCtx->videosource), NULL,NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC );
+					}
+				}
+			}
+
+            if ( bCtx->pipeSinkThrCtx.state != CPStateNull )
+            {
+                bCtx->pipeSinkThrCtx.state = CPStatePaused;
+            }
+            if(mCtx->xaRecordState==XA_RECORDSTATE_STOPPED && mCtx->encodingchanged)
+            {
+                XAMediaRecorderAdapt_ChangeEncoders( mCtx );
+                mCtx->encodingchanged = XA_BOOLEAN_FALSE;
+            }
+            bCtx->binWantedState = GST_STATE_PAUSED;
+            if(mCtx->runpositiontimer > 0)
+            {
+                g_source_remove(mCtx->runpositiontimer);
+                mCtx->runpositiontimer=0;
+            }
+            break;
+        }
+        case XA_RECORDSTATE_RECORDING:
+        {
+        	if ( cameraCtx && mCtx->isobjvsrc )
+			{
+				cameraCtx->recording = XA_BOOLEAN_TRUE;
+			}
+
+        	if( bCtx->pipeSinkThrCtx.pipe )
+        	{
+            if ( bCtx->pipeSinkThrCtx.state != CPStateNull )
+            {
+                XAresult retVal = XA_RESULT_SUCCESS;
+
+                if ( bCtx->pipeSinkThrCtx.state == CPStateInitialized )
+                { /* Start thread if it's not running */
+                    retVal = XAImpl_StartThread( &(bCtx->pipeSinkThr), NULL, &XAAdaptationBase_ContentPipeSinkThrFunc, &(bCtx->pipeSinkThrCtx) );
+                    if ( retVal != XA_RESULT_SUCCESS )
+                    {
+                        DEBUG_ERR("Could not start content pipe thread!");
+                    }
+                }
+                if ( bCtx->pipeSinkThrCtx.state == CPStatePaused ||
+                     bCtx->pipeSinkThrCtx.state == CPStateInitialized ||
+                     bCtx->pipeSinkThrCtx.state == CPStateStarted )
+                retVal = XAImpl_PostSemaphore( bCtx->pipeSinkThrCtx.stateSem );
+                if ( retVal != XA_RESULT_SUCCESS )
+                {
+                    DEBUG_ERR("Could not post content pipe semaphore!");
+                }
+            }
+        	}
+            if(mCtx->xaRecordState==XA_RECORDSTATE_STOPPED && (mCtx->encodingchanged))
+            {
+                XAMediaRecorderAdapt_ChangeEncoders( mCtx );
+                mCtx->encodingchanged = XA_BOOLEAN_FALSE;
+            }
+            /*Causes segmentation fault during contentpipe, so we must ignore
+            contentpipe at this point*/
+            if( ! bCtx->pipeSinkThrCtx.pipe )
+            {
+            	XAMetadataAdapt_TryWriteTags(bCtx, GST_BIN(mCtx->codecbin));
+            }
+            if ( mCtx->recThrCtx.bufInsufficientSem )
+            {
+                /* Recording to address and recording thread semaphora is created */
+                XAImpl_StartThread(&(mCtx->recordingEventThr),NULL, &XAMediaRecorderAdapt_RecordEventThr, (void*)mCtx );
+            }
+
+            bCtx->binWantedState = GST_STATE_PLAYING;
+            recording = XA_BOOLEAN_TRUE;
+            break;
+        }
+        default:
+            DEBUG_ERR("Unhandled state");
+            ret = XA_RESULT_PARAMETER_INVALID;
+            break;
+    }
+
+    if( ret == XA_RESULT_SUCCESS )
+    {
+        mCtx->xaRecordState = state;
+    }
+
+    /* launch Gstreamer state change only if necessary */
+    if( GST_STATE_TARGET(bCtx->bin) == bCtx->binWantedState )
+    {
+        DEBUG_INFO("Gst already transitioning to wanted state!!");
+        requestStateChange = XA_BOOLEAN_FALSE;
+    }
+    else
+    {
+        if( (GST_STATE(bCtx->bin) == bCtx->binWantedState) &&
+            (GST_STATE_PENDING(bCtx->bin) == GST_STATE_VOID_PENDING) )
+        {
+            DEBUG_ERR_A3("WARNING : gststate %d == wanted %d != gsttarget %d and no statechange pending",
+                          GST_STATE(bCtx->bin), bCtx->binWantedState, GST_STATE_TARGET(bCtx->bin));
+        }
+        requestStateChange = XA_BOOLEAN_TRUE;
+    }
+
+    if( requestStateChange )
+    {
+        XAAdaptationBase_PrepareAsyncWait(bCtx);
+        DEBUG_INFO_A1("Sending change state request to state %d", bCtx->binWantedState);
+        gstRet = gst_element_set_state( GST_ELEMENT(bCtx->bin), bCtx->binWantedState);
+        switch ( gstRet )
+        {
+            case GST_STATE_CHANGE_FAILURE:
+                DEBUG_ERR_A1("FAILED to change state (target %d)",bCtx->binWantedState);
+                bCtx->binWantedState = GST_STATE(bCtx->bin);
+                ret = XA_RESULT_INTERNAL_ERROR;
+                break;
+            case GST_STATE_CHANGE_ASYNC:
+                DEBUG_INFO_A1("Change state will happen asyncronously (target %d)",bCtx->binWantedState);
+                XAAdaptationBase_StartAsyncWait(bCtx);
+                ret = XA_RESULT_SUCCESS;
+                break;
+            case GST_STATE_CHANGE_NO_PREROLL:
+                DEBUG_INFO("GST_STATE_CHANGE_NO_PREROLL");
+                /* deliberate fall-through */
+            case GST_STATE_CHANGE_SUCCESS:
+                DEBUG_INFO_A1("Successfully changed state (target %d)",bCtx->binWantedState);
+                ret = XA_RESULT_SUCCESS;
+                break;
+            default:
+                DEBUG_ERR_A1("Unhandled error (%d)",gstRet);
+                ret = XA_RESULT_UNKNOWN_ERROR;
+                break;
+        }
+        bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
+    }
+    if( (GST_STATE(bCtx->bin) > GST_STATE_READY) && closeSink )
+    {   /* close the sink*/
+        gst_element_send_event(bCtx->bin,gst_event_new_flush_start());
+        gst_element_send_event(bCtx->bin,gst_event_new_flush_stop());
+    }
+
+    if ( recording && mCtx->isobjvsrc && mCtx->videosource )
+    {
+    	GstPad *pad = gst_element_get_static_pad( GST_ELEMENT(mCtx->videosource), "MRObjSrc");
+		if( pad && gst_pad_is_linked(pad) )
+		{
+			DEBUG_INFO_A2("unblock element:%s pad:%s",
+					gst_element_get_name(mCtx->videosource),
+					gst_pad_get_name(pad));
+			gst_pad_set_blocked_async(pad, FALSE, XAAdaptationBase_PadBlockCb, NULL);
+		}
+
+		if ( GST_STATE( GST_ELEMENT(mCtx->videosource)) != GST_STATE_PLAYING )
+		{
+			GstStateChangeReturn gret = GST_STATE_CHANGE_SUCCESS;
+			DEBUG_INFO("Start camera source");
+			gret = gst_element_set_state( GST_ELEMENT(mCtx->videosource), GST_STATE_PLAYING );
+			gret = gst_element_get_state( GST_ELEMENT(mCtx->videosource), NULL,NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC );
+		}
+    }
+    DEBUG_API("<-XARecordItfAdapt_SetRecordState");
+    return ret;
+}
+
+/*
+ * XAresult XARecordItfAdapt_GetRecordState(XAAdaptationBaseCtx *bCtx, XAuint32 *state)
+ * Description: Return record state
+ */
+XAresult XARecordItfAdapt_GetRecordState(XAAdaptationBaseCtx *bCtx, XAuint32 *state)
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XARecordItfAdapt_GetRecordState");
+
+    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfAdapt_GetRecordState");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+    *state = mCtx->xaRecordState;
+
+    DEBUG_API("<-XARecordItfAdapt_GetRecordState");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XARecordItfAdapt_GetPosition(XAAdaptationBaseCtx *ctx, AdaptationContextIDS ctxIDs, XAmillisecond *pMsec)
+ * @param XAAdaptationBaseCtx *ctx - Adaptation context, this will be casted to correct type regarding to contextID value given as 2nd parameter
+ * XAmillisecond *pMsec - Pointer where to store current position in stream.
+ * @return XAresult ret - Success value
+ */
+XAresult XARecordItfAdapt_GetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    gint64 position=0;
+    GstFormat format = GST_FORMAT_TIME;
+    DEBUG_API("->XARecordItfAdapt_GetPosition");
+
+    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfAdapt_GetPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+    if ( gst_element_query_position( GST_ELEMENT(bCtx->bin), &format, &position  ) )
+    {
+        ret = XA_RESULT_SUCCESS;
+        *pMsec = GST_TIME_AS_MSECONDS(position); /*Warning ok due to used API specification*/
+        DEBUG_INFO_A1("Gst: Position in microseconds : %u", *pMsec );
+    }
+    else
+    {
+        DEBUG_ERR("WARNING: Gst: could not get position");
+        /* probably not fully prerolled - safe assumption for position = 0 */
+        *pMsec = 0;
+        ret = XA_RESULT_SUCCESS;
+    }
+
+    DEBUG_API("<-XARecordItfAdapt_GetPosition");
+    return ret;
+}
+
+
+/*
+ * gboolean XARecordItfAdapt_PositionUpdate(gpointer ctx)
+ * callback.
+ * If position tracking enabled, periodic timer calls this method every XA_ADAPT_PU_INTERVAL msecs
+ * @return false to stop periodic calls
+ */
+gboolean XARecordItfAdapt_PositionUpdate(gpointer ctx)
+{
+    XAAdaptationBaseCtx *bCtx = (XAAdaptationBaseCtx*) ctx;
+    XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*) ctx;
+    DEBUG_API("->XARecordItfAdapt_PositionUpdate");
+
+    if( mCtx && mCtx->trackpositionenabled )
+    {
+        GstFormat format = GST_FORMAT_TIME;
+        gint64 position = 0;
+        if ( gst_element_query_position( GST_ELEMENT(bCtx->bin), &format, &position ) )
+        {
+            XAuint32 posMsec = GST_TIME_AS_MSECONDS(position);/*Warning ok due to used API specification*/
+            XAAdaptEvent event = {XA_RECORDITFEVENTS, XA_ADAPT_POSITION_UPDATE_EVT, 1, NULL};
+            event.data = &posMsec;
+            DEBUG_API_A1("XARecordItfAdapt_PositionUpdate: pos %lu ms", posMsec);
+            /* send needed events */
+            XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+        }
+        else
+        {
+            DEBUG_ERR("Gst: Failed to get position");
+        }
+    }
+    DEBUG_API_A1("<-XARecordItfAdapt_PositionUpdate: %d", mCtx->runpositiontimer);
+    /* return false to stop timer */
+    return( mCtx->runpositiontimer );
+}
+
+/*
+ * XAresult XARecordItfAdapt_EnablePositionTracking
+ * Enable/disable periodic position tracking callbacks
+ */
+XAresult XARecordItfAdapt_EnablePositionTracking(XAAdaptationBaseCtx *bCtx, XAboolean enable)
+{
+    XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+    DEBUG_API_A1("->XARecordItfAdapt_EnablePositionTracking (enable: %lu)", enable);
+
+    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfAdapt_EnablePositionTracking");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+
+    /* create a timer to track position of playback */
+    if(enable && !(mCtx->trackpositionenabled))
+    {
+        mCtx->trackpositionenabled = XA_BOOLEAN_TRUE;
+        mCtx->positionCb = &XARecordItfAdapt_PositionUpdate;
+        /* if recording is already on, create a timer to track position of recording */
+        if( GST_STATE(bCtx->bin) == GST_STATE_PLAYING )
+        {
+            mCtx->runpositiontimer = g_timeout_add(XA_ADAPT_PU_INTERVAL, mCtx->positionCb, mCtx);
+        }
+    }
+    else if (!enable && (mCtx->trackpositionenabled))
+    {
+        mCtx->trackpositionenabled = XA_BOOLEAN_FALSE;
+        if(mCtx->runpositiontimer > 0)
+        {
+            g_source_remove(mCtx->runpositiontimer);
+            mCtx->runpositiontimer=0;
+        }
+    }
+
+    DEBUG_API("<-XARecordItfAdapt_EnablePositionTracking");
+    return XA_RESULT_SUCCESS;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xarecorditfadaptation.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XARECORDITFADAPTATION_H
+#define XARECORDITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+#ifdef _DEBUG
+/*parse state names for debug prints*/
+static const char* recordstatenames[3] =
+{
+    "XA_RECORDSTATE_STOPPED",
+    "XA_RECORDSTATE_PAUSED",
+    "XA_RECORDSTATE_RECORDING",
+};
+#define RECORDSTATENAME(i) ((i>0&&i<4)?recordstatenames[i-1]:"INVALID")
+#endif /*_DEBUG*/
+
+/* FUNCTIONS */
+
+XAresult XARecordItfAdapt_SetRecordState(XAAdaptationBaseCtx *ctx, XAuint32 state );
+XAresult XARecordItfAdapt_SetDurationLimit( XAAdaptationBaseCtx *ctx, XAmillisecond msec );
+XAresult XARecordItfAdapt_GetPosition( XAAdaptationBaseCtx *ctx, XAmillisecond *pMsec );
+XAresult XARecordItfAdapt_EnablePositionTracking(XAAdaptationBaseCtx *ctx, XAboolean enable);
+XAresult XARecordItfAdapt_GetRecordState(XAAdaptationBaseCtx *bCtx, XAuint32 *state);
+
+#endif /* XARECORDITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaseekitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,153 @@
+/*
+* 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 <gst.h>
+#include "XAAdaptation.h"
+#include "XAMediaPlayerAdaptCtx.h"
+#include "XASeekItfAdaptation.h"
+
+/*
+ * XAresult XASeekItfAdapt_SetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond pos, XAuint32 seekMode)
+ * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID value
+ * XAmillisecond pos - Position to be set in Milliseconds
+ * XAuint32 seekMode - Preferred seek mode
+ * @return XAresult ret - Success value
+ */
+XAresult XASeekItfAdapt_SetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond pos, XAuint32 seekMode)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationCtx* mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+    gint64 gstSeekPos = pos * GST_MSECOND;
+    XAmillisecond newPosMs=0;
+    GstFormat format = GST_FORMAT_TIME;
+    GstSeekFlags seekFlags = GST_SEEK_FLAG_FLUSH;
+    DEBUG_API_A2("->XASeekItfAdapt_SetPosition (pos %ld ms, mode=%d)", pos, (int)seekMode);
+    if(!bCtx || bCtx->ctxId != XAMediaPlayerAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASeekItfAdapt_SetPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( GST_STATE(bCtx->bin) < GST_STATE_PAUSED )
+    {   /* This should not happen */
+        DEBUG_ERR("Gst not prerolled - can not seek!!");
+        DEBUG_API("<-XASeekItfAdapt_SetPosition");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    if ( seekMode == XA_SEEKMODE_FAST )
+    {
+        seekFlags |= GST_SEEK_FLAG_KEY_UNIT;
+    }
+    else
+    {
+        seekFlags |= GST_SEEK_FLAG_ACCURATE;
+    }
+
+    XAAdaptationBase_PrepareAsyncWait(bCtx);
+    DEBUG_INFO("Send gst_element_seek");
+    mCtx->lastpos = gstSeekPos;
+    if ( !gst_element_seek( bCtx->bin, mCtx->playrate, GST_FORMAT_TIME,  seekFlags,
+                            GST_SEEK_TYPE_SET, gstSeekPos,
+                            GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE ) )
+    {
+        DEBUG_ERR("WARN: gst reports seek not handled");
+    }
+    /* flushed seeks always asynchronous */
+    XAAdaptationBase_StartAsyncWait(bCtx);
+    DEBUG_INFO("Seek handled.")
+    bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
+    /* update new position to playitf */
+    {
+        XAAdaptEvent event = {XA_PLAYITFEVENTS, XA_ADAPT_POSITION_UPDATE_EVT, 1, NULL};
+        if ( !gst_element_query_position( GST_ELEMENT(bCtx->bin), &format, &mCtx->lastpos  ) )
+        {
+            DEBUG_ERR("WARNING: could not get position from GST")
+        }
+        DEBUG_INFO_A1("Current position %"GST_TIME_FORMAT, GST_TIME_ARGS(mCtx->lastpos));
+        newPosMs = GST_TIME_AS_MSECONDS(mCtx->lastpos);
+        event.data = &newPosMs;
+        XAAdaptationBase_SendAdaptEvents(bCtx, &event );
+    }
+
+    ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("<-XASeekItfAdapt_SetPosition");
+    return ret;
+}
+
+/*
+ * XAresult XASeekItfAdapt_SetLoop(void *bCtx, AdaptationContextIDS ctxIDs, XAboolean loopEnable, XAmillisecond startPos,
+ *                                 XAmillisecond endPos)
+ * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID value
+ * XAboolean loopEnable - Enable/Disable looping
+ * XAmillisecond startPos - Loop start position in milliseconds
+ * XAmillisecond endPos - Loop end position in milliseconds
+ * @return XAresult ret - Success value
+ */
+XAresult XASeekItfAdapt_SetLoop(XAAdaptationBaseCtx *bCtx, XAboolean loopEnable, XAmillisecond startPos,
+                                XAmillisecond endPos)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationCtx* mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+    GstFormat format = GST_FORMAT_TIME;
+
+    DEBUG_API_A3("->XASeekItfAdapt_SetLoop (enable=%d, start=%ld, stop=%ld)", (int)loopEnable, startPos, endPos);
+    if(!bCtx || bCtx->ctxId != XAMediaPlayerAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASeekItfAdapt_SetLoop");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( loopEnable )
+    {
+        if(endPos==XA_TIME_UNKNOWN)
+        {
+            mCtx->loopend = GST_CLOCK_TIME_NONE;
+        }
+        else
+        {
+            mCtx->loopend = (endPos*GST_MSECOND);
+            DEBUG_INFO_A1("Set looping to %ld", mCtx->loopend);
+        }
+        DEBUG_INFO_A2("Enable looping from %"GST_TIME_FORMAT" to %"GST_TIME_FORMAT,
+                      GST_TIME_ARGS(mCtx->loopstart), GST_TIME_ARGS(mCtx->loopend));
+        mCtx->loopstart = (startPos*GST_MSECOND);
+        if ( !gst_element_query_position( GST_ELEMENT(bCtx->bin), &format, &(mCtx->lastpos) ) )
+        {
+            DEBUG_ERR("WARNING: could not get position from GST")
+        }
+        DEBUG_INFO_A1("current head position %"GST_TIME_FORMAT"",GST_TIME_ARGS(mCtx->lastpos));
+        mCtx->loopingenabled = XA_BOOLEAN_TRUE;
+        XAMediaPlayerAdapt_UpdatePositionCbTimer(mCtx);
+    }
+    else
+    {
+        DEBUG_INFO("Disable looping");
+        mCtx->loopstart = 0;
+        mCtx->loopend = GST_CLOCK_TIME_NONE;
+        mCtx->loopingenabled = XA_BOOLEAN_FALSE;
+        XAMediaPlayerAdapt_UpdatePositionCbTimer(mCtx);
+    }
+
+    DEBUG_API("<-XASeekItfAdapt_SetLoop");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xaseekitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XASEEKITFADAPTATION_H
+#define XASEEKITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+/* FUNCTIONS */
+
+XAresult XASeekItfAdapt_SetPosition(XAAdaptationBaseCtx *ctx, XAmillisecond pos,
+                                        XAuint32 seekMode);
+
+XAresult XASeekItfAdapt_SetLoop(XAAdaptationBaseCtx *ctx, XAboolean loopEnable,
+                                XAmillisecond startPos, XAmillisecond endPos);
+#endif /* XASEEKITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xasnapshotitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,890 @@
+/*
+* 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 <string.h>
+#include <gst.h>
+#include <gstappsrc.h>
+#include <gstappsink.h>
+#include "XAAdaptation.h"
+#include "XASnapShotItfAdaptation.h"
+#include "XAMediaRecorderAdaptCtx.h"
+#include "XAMetadataAdaptation.h"
+#include "XAStaticCapsAdaptation.h"
+
+#define SSMAXPIC 30
+#define SSMAXFPS 30 /*technically, same as FPS of video stream*/
+#define SSMINFPS 1
+
+extern XAboolean cameraRealized;
+extern XACameraAdaptationCtx_* cameraCtx;
+
+/* Forward declarations for internal methods */
+XAresult XASnapshotItfAdaptation_CreateSnapshotPipeline(XAAdaptationBaseCtx* bCtx);
+XAresult XASnapshotItfAdaptation_FreeSnapshot();
+const char* XASnapshotItfAdaptation_GetFileSuffix(XADataFormat_MIME* format);
+void XASnapshotItfAdaptation_AllocNextFilename(char** fname, const char* template);
+void XASnapshotItfAdaptation_StopSnapshotting(XAAdaptationBaseCtx* bCtx);
+
+/* callbacks */
+gboolean XASnapshotItfAdaptation_SnapshotBusCb( GstBus *bus, GstMessage *message, gpointer data );
+void XASnapshotItfAdaptation_BufferHandoffCb( GstElement *extract, GstBuffer *buffer, gpointer data);
+
+/*********************************
+ * SnapshotItf adaptation methods
+ *********************************/
+
+/*
+ * XAresult XASnapshotItfAdaptation_InitiateSnapshot(XAAdaptationBaseCtx* bCtx,
+ *                                                 XAuint32 numberOfPictures,
+ *                                                 XAuint32 fps,
+ *                                                 XAboolean freezeViewFinder,
+ *                                                 XADataSink* sink)
+ */
+XAresult XASnapshotItfAdaptation_InitiateSnapshot(XAAdaptationBaseCtx* bCtx,
+                                                  XAuint32 numberOfPictures,
+                                                  XAuint32 fps,
+                                                  XAboolean freezeViewFinder,
+                                                  XADataSink* sink)
+{
+    XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*)bCtx;
+    XADataLocator_URI* uri=NULL;
+
+    DEBUG_API("->XASnapshotItfAdaptation_InitiateSnapshot");
+    /* Store initialization variables */
+    mCtx->snapshotVars.numpics = numberOfPictures;
+    mCtx->snapshotVars.fps = fps;
+    mCtx->snapshotVars.freeze =freezeViewFinder;
+    mCtx->snapshotVars.parsenegotiated = FALSE;
+    mCtx->snapshotVars.snapshotbuffer = NULL;
+
+    if( sink )
+    {   /* parse file sink name*/
+        if( sink->pLocator && *((XAuint32*)(sink->pLocator)) == XA_DATALOCATOR_URI )
+        {
+            uri = (XADataLocator_URI*)sink->pLocator;
+            if ( uri->URI != NULL )
+            {
+                /* parse filename template: <prefix><nnnn><suffix> */
+                mCtx->snapshotVars.fnametemplate = calloc(1,strlen((char*)uri->URI)+10);
+                DEBUG_INFO_A1("URI: %s", uri->URI);
+                if(strncmp((char*)uri->URI, "file://", 7) == 0)
+                {
+                    strcat(mCtx->snapshotVars.fnametemplate, (char*)&((uri->URI)[7]));
+                }
+                else
+                {
+                    strcat(mCtx->snapshotVars.fnametemplate, (char*)uri->URI);
+                }
+                strcat(mCtx->snapshotVars.fnametemplate, "%04d.");
+                strcat(mCtx->snapshotVars.fnametemplate,
+                        XASnapshotItfAdaptation_GetFileSuffix(sink->pFormat));
+                DEBUG_INFO_A1("->template name %s", mCtx->snapshotVars.fnametemplate);
+            }
+            else
+            {
+                DEBUG_ERR("No uri specified.");
+                return XA_RESULT_PARAMETER_INVALID;
+            }
+        }
+        else
+        { /* take snapshot to memory buffer */
+            if( mCtx->snapshotVars.fnametemplate )
+            {
+                free( mCtx->snapshotVars.fnametemplate );
+            }
+            mCtx->snapshotVars.fnametemplate = NULL;
+        }
+        if( sink->pFormat && *((XAuint32*)(sink->pFormat)) == XA_DATAFORMAT_RAWIMAGE )
+        {
+            XADataFormat_RawImage* img = ((XADataFormat_RawImage*)sink->pFormat);
+            /*set needed image settings from the sink structure*/
+            mCtx->imageEncSettings.encoderId = XA_IMAGECODEC_RAW;
+            mCtx->imageEncSettings.width = img->width;
+            mCtx->imageEncSettings.height = img->height;
+            mCtx->imageEncSettings.colorFormat = img->colorFormat;
+        }
+    }
+    else
+    {
+        DEBUG_ERR("XASnapshotItfAdaptation_InitiateSnapshot, invalid data sink!");
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASnapshotItfAdaptation_InitiateSnapshot");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+
+    if( mCtx->snapshotVars.sspipeline )
+    {
+        XASnapshotItfAdaptation_FreeSnapshot(bCtx);
+    }
+    if( XASnapshotItfAdaptation_CreateSnapshotPipeline(bCtx) != XA_RESULT_SUCCESS )
+    {
+        DEBUG_ERR("Failed to create pipeline!!");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("<-XASnapshotItfAdaptation_InitiateSnapshot");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    DEBUG_API("<-XASnapshotItfAdaptation_InitiateSnapshot");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XASnapshotItfAdaptation_TakeSnapshot(XAAdaptationBaseCtx* bCtx)
+ */
+XAresult XASnapshotItfAdaptation_TakeSnapshot(XAAdaptationBaseCtx* bCtx)
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+
+    DEBUG_API("->XASnapshotItfAdaptation_TakeSnapshot");
+    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASnapshotItfAdaptation_TakeSnapshot");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaRecorderAdaptationCtx*)bCtx;
+    /*to get buffer, base pipeline must be playing...*/
+    if( GST_STATE(mCtx->baseObj.bin) != GST_STATE_PLAYING )
+    {
+        DEBUG_INFO_A1("Parent bin in state %d, set to PLAYING", GST_STATE(mCtx->baseObj.bin));
+        gst_element_set_state( GST_ELEMENT(mCtx->baseObj.bin), GST_STATE_PLAYING );
+        gst_element_get_state( GST_ELEMENT(mCtx->baseObj.bin), NULL,NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
+    }
+    if ( mCtx->isobjvsrc && mCtx->videosource && cameraCtx && cameraRealized )
+    {
+    	GstPad *pad=NULL;
+    	GstPad *pad1=NULL;
+
+    	cameraCtx->snapshotting = XA_BOOLEAN_TRUE;
+    	pad = gst_element_get_static_pad( GST_ELEMENT(cameraCtx->baseObj.bin), "MRObjSrc");
+		if( pad && gst_pad_is_linked(pad) )
+		{
+			DEBUG_INFO_A2("unblock element:%s pad:%s",
+					gst_element_get_name(cameraCtx->baseObj.bin),
+					gst_pad_get_name(pad));
+			gst_pad_set_blocked_async(pad, FALSE, XAAdaptationBase_PadBlockCb, NULL);
+		}
+
+    	pad1 = gst_element_get_static_pad( GST_ELEMENT(cameraCtx->baseObj.bin), "MPObjSrc");
+		if( pad1 && gst_pad_is_linked(pad1) )
+		{
+			DEBUG_INFO_A2("unblock element:%s pad:%s",
+					gst_element_get_name(cameraCtx->baseObj.bin),
+					gst_pad_get_name(pad1));
+			gst_pad_set_blocked_async(pad, FALSE, XAAdaptationBase_PadBlockCb, NULL);
+		}
+
+    	DEBUG_INFO_A1("Using camera from global pointer %x", cameraCtx);
+    	if ( GST_STATE( GST_ELEMENT(cameraCtx->baseObj.bin)) != GST_STATE_PLAYING )
+		{
+			cameraCtx->baseObj.binWantedState = GST_STATE(cameraCtx->baseObj.bin);
+			DEBUG_INFO_A1("Camerabin state %d, set to PLAYING", GST_STATE(GST_ELEMENT(cameraCtx->baseObj.bin)));
+			gst_element_set_state( GST_ELEMENT(cameraCtx->baseObj.bin), GST_STATE_PLAYING );
+			gst_element_get_state( GST_ELEMENT(cameraCtx->baseObj.bin), NULL,NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
+		}
+	}
+
+    /* Connect signal for getting current buffer from video pipeline*/
+    mCtx->snapshotVars.numpicstaken = 0;
+    mCtx->snapshotVars.waitforbuffer = TRUE;
+    if(mCtx->videoextract)
+    {
+        mCtx->snapshotVars.sighandler = g_signal_connect(mCtx->videoextract, "handoff",
+                                G_CALLBACK (XASnapshotItfAdaptation_BufferHandoffCb),mCtx);
+    }
+    if( mCtx->snapshotVars.sighandler==0 )
+    {
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("<-XASnapshotItfAdaptation_TakeSnapshot");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    DEBUG_API("<-XASnapshotItfAdaptation_TakeSnapshot");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XASnapshotItfAdaptation_CancelSnapshot(XAAdaptationBaseCtx* bCtx)
+ */
+XAresult XASnapshotItfAdaptation_CancelSnapshot(XAAdaptationBaseCtx* bCtx)
+{
+    DEBUG_API("->XASnapshotItfAdaptation_CancelSnapshot");
+    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASnapshotItfAdaptation_CancelSnapshot");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    XASnapshotItfAdaptation_FreeSnapshot(bCtx);
+
+    DEBUG_API("<-XASnapshotItfAdaptation_CancelSnapshot");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XASnapshotItfAdaptation_GetMaxPicsPerBurst(XAAdaptationBaseCtx* bCtx,
+ *                                              XAuint32 *maxNumberOfPictures)
+ */
+XAresult XASnapshotItfAdaptation_GetMaxPicsPerBurst(XAAdaptationBaseCtx* bCtx,
+                                              XAuint32 *maxNumberOfPictures)
+{
+    DEBUG_API("->XASnapshotItfAdaptation_GetMaxPicsPerBurst");
+    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASnapshotItfAdaptation_GetMaxPicsPerBurst");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    *maxNumberOfPictures = SSMAXPIC;
+    DEBUG_API("<-XASnapshotItfAdaptation_GetMaxPicsPerBurst");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XASnapshotItfAdaptation_GetBurstFPSRange(XAAdaptationBaseCtx* bCtx,
+ *                                            XAuint32 *minFPS,
+ *                                           XAuint32 *maxFPS)
+ */
+XAresult XASnapshotItfAdaptation_GetBurstFPSRange(XAAdaptationBaseCtx* bCtx,
+                                            XAuint32 *minFPS,
+                                            XAuint32 *maxFPS)
+{
+    DEBUG_API("->XASnapshotItfAdaptation_GetBurstFPSRange");
+    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptation )
+        {
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("<-XASnapshotItfAdaptation_GetBurstFPSRange");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+    *minFPS = SSMINFPS;
+    *maxFPS = SSMAXFPS;
+
+    DEBUG_API("<-XASnapshotItfAdaptation_GetBurstFPSRange");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XASnapshotItfAdaptation_SetShutterFeedback(XAAdaptationBaseCtx* bCtx,
+ *                                              XAboolean enabled)
+ */
+XAresult XASnapshotItfAdaptation_SetShutterFeedback(XAAdaptationBaseCtx* bCtx,
+                                              XAboolean enabled)
+{
+    DEBUG_API("->XASnapshotItfAdaptation_SetShutterFeedback");
+    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASnapshotItfAdaptation_SetShutterFeedback");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    /* stubbed, no implementation */
+    DEBUG_API("<-XASnapshotItfAdaptation_SetShutterFeedback");
+    return XA_RESULT_SUCCESS;
+}
+
+/********************
+ * Internal methods
+ ********************/
+
+/*
+ * void XASnapshotItfAdaptation_StopSnapshotting(XAAdaptationBaseCtx* bCtx)
+ */
+void XASnapshotItfAdaptation_StopSnapshotting(XAAdaptationBaseCtx* bCtx)
+{
+    XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+    DEBUG_API("->XASnapshotItfAdaptation_StopSnapshotting");
+    mCtx->snapshotVars.waitforbuffer = FALSE;
+    mCtx->snapshotVars.snapshotbuffer = NULL;
+    if(mCtx->snapshotVars.sighandler)
+    {
+        if(mCtx->videoextract)
+        {
+            g_signal_handler_disconnect(mCtx->videoextract,mCtx->snapshotVars.sighandler);
+        }
+        mCtx->snapshotVars.sighandler = 0;
+    }
+    /* did we change the state of parent pipeline?*/
+    if( mCtx->baseObj.bin && (GST_STATE(mCtx->baseObj.bin) != mCtx->baseObj.binWantedState) )
+    {
+        gst_element_set_state( GST_ELEMENT(mCtx->baseObj.bin), mCtx->baseObj.binWantedState );
+    }
+
+    if ( cameraCtx && (GST_STATE(cameraCtx->baseObj.bin) != cameraCtx->baseObj.binWantedState) )
+	{
+    	cameraCtx->snapshotting = XA_BOOLEAN_FALSE;
+		DEBUG_INFO_A2("Camerabin state %d, restored to %d", GST_STATE(cameraCtx->baseObj.bin), cameraCtx->baseObj.binWantedState );
+		gst_element_set_state( GST_ELEMENT(cameraCtx->baseObj.bin), cameraCtx->baseObj.binWantedState );
+		gst_element_get_state( GST_ELEMENT(cameraCtx->baseObj.bin), NULL,NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
+	}
+    DEBUG_API("<-XASnapshotItfAdaptation_StopSnapshotting");
+}
+
+/*
+ * XAresult XASnapshotItfAdaptation_FreeSnapshot(XAAdaptationBaseCtx* bCtx)
+ */
+XAresult XASnapshotItfAdaptation_FreeSnapshot(XAAdaptationBaseCtx* bCtx)
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XASnapshotItfAdaptation_FreeSnapshot");
+    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASnapshotItfAdaptation_FreeSnapshot");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+    XASnapshotItfAdaptation_StopSnapshotting(bCtx);
+    /* Clean up pipeline and set current pipeline state to null*/
+    if( mCtx->snapshotVars.sspipeline )
+    {
+        gst_element_set_state( GST_ELEMENT(mCtx->snapshotVars.sspipeline), GST_STATE_NULL );
+        gst_object_unref( GST_OBJECT(mCtx->snapshotVars.sspipeline) );
+        mCtx->snapshotVars.sspipeline = NULL;
+    }
+    if( mCtx->snapshotVars.ssbus )
+    {
+        gst_object_unref( GST_OBJECT(mCtx->snapshotVars.ssbus) );
+        mCtx->snapshotVars.ssbus = NULL;
+    }
+    if( mCtx->snapshotVars.fnametemplate )
+    {
+        free(mCtx->snapshotVars.fnametemplate);
+        mCtx->snapshotVars.fnametemplate=NULL;
+    }
+    DEBUG_API("<-XASnapshotItfAdaptation_FreeSnapshot");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XASnapshotItfAdaptation_CreateSnapshotPipeline(XAAdaptationBaseCtx* bCtx)
+ */
+XAresult XASnapshotItfAdaptation_CreateSnapshotPipeline(XAAdaptationBaseCtx* bCtx)
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    GstStateChangeReturn gstRet = GST_STATE_CHANGE_SUCCESS;
+    XAStaticCapsData temp;
+    GstCaps *imageCaps=NULL;
+
+    DEBUG_API("->XASnapshotItfAdaptation_CreateSnapshotPipeline");
+    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+    /*Create snapshotpipeline*/
+    mCtx->snapshotVars.sspipeline = gst_pipeline_new ("sspipeline");
+    if( mCtx->snapshotVars.sspipeline  )
+    {
+        /*add listener*/
+        mCtx->snapshotVars.ssbus = gst_pipeline_get_bus(GST_PIPELINE( mCtx->snapshotVars.sspipeline ) );
+        if( ! mCtx->snapshotVars.ssbus )
+        {
+            DEBUG_API("Cannot create snapshotbus");
+            DEBUG_API("<-XASnapshotItfAdaptation_CreateSnapshotPipeline - XA_RESULT_INTERNAL_ERROR");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+        gst_bus_add_signal_watch( mCtx->snapshotVars.ssbus );
+        g_signal_connect(mCtx->snapshotVars.ssbus, "message::eos",
+                G_CALLBACK(XASnapshotItfAdaptation_SnapshotBusCb), bCtx );
+        g_signal_connect(mCtx->snapshotVars.ssbus, "message::state-changed",
+                G_CALLBACK(XASnapshotItfAdaptation_SnapshotBusCb), bCtx );
+        g_signal_connect(mCtx->snapshotVars.ssbus, "message::async-done",
+                G_CALLBACK(XASnapshotItfAdaptation_SnapshotBusCb), bCtx );
+
+        /*Create snapshotsource element*/
+        mCtx->snapshotVars.ssbuffersrc = gst_element_factory_make("appsrc", "ssbuffersrc");
+        if( !mCtx->snapshotVars.ssbuffersrc )
+        {
+            DEBUG_ERR("Cannot create ssbuffersrc!");
+            DEBUG_API("<-XASnapshotItfAdaptation_CreateSnapshotPipeline - XA_RESULT_INTERNAL_ERROR");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+        /*Frame parser*/
+        mCtx->snapshotVars.ssparser =
+            gst_element_factory_make("videoparse","ssparser");
+        if( !mCtx->snapshotVars.ssparser )
+        {
+            DEBUG_ERR("Could not create snapshotparse");
+            DEBUG_API("<-XASnapshotItfAdaptation_CreateSnapshotPipeline - XA_RESULT_INTERNAL_ERROR");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+
+        /*Scaler and filter for XAImageSettings width&height*/
+        mCtx->snapshotVars.ssscaler =
+            gst_element_factory_make("videoscale","ssscaler");
+        if( !mCtx->snapshotVars.ssscaler )
+        {
+            DEBUG_ERR("Could not create ssscaler");
+            DEBUG_API("<-XASnapshotItfAdaptation_CreateSnapshotPipeline - XA_RESULT_INTERNAL_ERROR");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+        mCtx->snapshotVars.ssfilter =
+            gst_element_factory_make("capsfilter","ssfilter");
+        if( !mCtx->snapshotVars.ssfilter )
+        {
+            DEBUG_ERR("Could not create ssfilter");
+            DEBUG_API("<-XASnapshotItfAdaptation_CreateSnapshotPipeline - XA_RESULT_INTERNAL_ERROR");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+
+        /*Create imageencoder */
+        if(XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_IMAGE, mCtx->imageEncSettings.encoderId, &temp) == XA_RESULT_SUCCESS)
+        {
+            if(temp.adaptId!=NULL)
+            {
+                mCtx->snapshotVars.ssencoder = gst_element_factory_make((char*)temp.adaptId, "ssencoder");
+            }
+            else if(mCtx->imageEncSettings.encoderId == XA_IMAGECODEC_RAW)
+            {
+                /* raw frames are internal format, so no codec needed. just insert identity for linking*/
+               mCtx->snapshotVars.ssencoder = gst_element_factory_make("identity", "ssencoder");
+            }
+        }
+        if( !mCtx->snapshotVars.ssencoder )
+        {
+            DEBUG_API("Cannot create image encoder");
+            DEBUG_API("<-XASnapshotItfAdaptation_CreateSnapshotPipeline - XA_RESULT_INTERNAL_ERROR");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+
+        /* Create also tag setter for JPG */
+        if(mCtx->imageEncSettings.encoderId == XA_IMAGECODEC_JPEG)
+        {
+            mCtx->snapshotVars.sstagger = gst_element_factory_make("metadatamux", "sstagger");
+            if( !mCtx->snapshotVars.sstagger || !gst_bin_add(GST_BIN(mCtx->snapshotVars.sspipeline),mCtx->snapshotVars.sstagger))
+            {
+                DEBUG_API("Cannot create metadatamux");
+                DEBUG_API("<-XASnapshotItfAdaptation_CreateSnapshotPipeline - XA_RESULT_INTERNAL_ERROR");
+            }
+            g_object_set( G_OBJECT(mCtx->snapshotVars.sstagger), "xmp", TRUE, "exif", TRUE, "iptc", TRUE, NULL );
+        }
+
+        /*Create sink*/
+        if(mCtx->snapshotVars.fnametemplate)
+        {
+            DEBUG_INFO("RECORD SNAPSHOT TO FILE");
+            mCtx->snapshotVars.sssink = gst_element_factory_make("filesink","ssfilesink");
+            g_object_set( G_OBJECT(mCtx->snapshotVars.sssink), "location", "temp",
+                                                                "async", FALSE,
+                                                                "qos", FALSE,
+                                                                "max-lateness", (gint64)(-1),
+                                                                "buffer-mode", 2,
+                                                                NULL );
+        }
+        else
+        {
+            DEBUG_INFO("RECORD SNAPSHOT TO MEMORY");
+            mCtx->snapshotVars.sssink = gst_element_factory_make("appsink","ssbuffersink");
+        }
+        if( !mCtx->snapshotVars.sssink )
+        {
+            DEBUG_ERR("Could not create sssink!!");
+            DEBUG_API("<-XASnapshotItfAdaptation_CreateSnapshotPipeline - XA_RESULT_INTERNAL_ERROR");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+        g_object_set( G_OBJECT(mCtx->snapshotVars.sssink), "async", FALSE, NULL );
+
+        /*Add elements to bin*/
+        gst_bin_add_many (GST_BIN (mCtx->snapshotVars.sspipeline),
+                mCtx->snapshotVars.ssbuffersrc,
+                mCtx->snapshotVars.ssparser,
+                mCtx->snapshotVars.ssscaler,
+                mCtx->snapshotVars.ssfilter,
+                mCtx->snapshotVars.ssencoder,
+                mCtx->snapshotVars.sssink,
+                NULL);
+
+        /* set needed XAImageSettings properties*/
+        /* set caps from imagesettings */
+        imageCaps = gst_caps_new_simple("video/x-raw-yuv",
+                                        "width", G_TYPE_INT, mCtx->imageEncSettings.width,
+                                        "height", G_TYPE_INT, mCtx->imageEncSettings.height, NULL);
+        g_object_set( G_OBJECT(mCtx->snapshotVars.ssfilter), "caps", imageCaps, NULL );
+        DEBUG_INFO_A1("new caps: %s",gst_caps_to_string(imageCaps));
+        gst_caps_unref(imageCaps);
+
+        /* set compression level */
+        if(mCtx->imageEncSettings.encoderId == XA_IMAGECODEC_JPEG)
+        {
+            g_object_set( G_OBJECT(mCtx->snapshotVars.ssencoder), "quality", (gint)(1000 - mCtx->imageEncSettings.compressionLevel)/10, NULL );
+        }
+
+        /*Chain elements together*/
+        if(mCtx->snapshotVars.sstagger)
+        {
+            if( !gst_element_link_many(
+                    mCtx->snapshotVars.ssbuffersrc,
+                    mCtx->snapshotVars.ssparser,
+                    mCtx->snapshotVars.ssscaler,
+                    mCtx->snapshotVars.ssfilter,
+                    mCtx->snapshotVars.ssencoder,
+                    mCtx->snapshotVars.sstagger,
+                    mCtx->snapshotVars.sssink,
+                    NULL) )
+            {
+                DEBUG_ERR("Could not link pipeline")
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+        }
+        else
+        {
+            if( !gst_element_link_many(
+                    mCtx->snapshotVars.ssbuffersrc,
+                    mCtx->snapshotVars.ssparser,
+                    mCtx->snapshotVars.ssscaler,
+                    mCtx->snapshotVars.ssfilter,
+                    mCtx->snapshotVars.ssencoder,
+                    mCtx->snapshotVars.sssink,
+                    NULL) )
+            {
+                DEBUG_ERR("Could not link pipeline")
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+        }
+        gstRet = gst_element_set_state(GST_ELEMENT(mCtx->snapshotVars.sspipeline), GST_STATE_READY);
+        DEBUG_API("<-XASnapshotItfAdaptation_CreateSnapshotPipeline");
+        return XA_RESULT_SUCCESS;
+
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+        DEBUG_API("<-XASnapshotItfAdaptation_CreateSnapshotPipeline");
+        return  XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+}
+
+/*
+ * gboolean XASnapshotItfAdaptation_SnapshotBusCb( GstBus *bus, GstMessage *message, gpointer data )
+ */
+gboolean XASnapshotItfAdaptation_SnapshotBusCb( GstBus *bus, GstMessage *message, gpointer data )
+{
+    XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*)data;
+
+    GstState oldstate = GST_STATE_NULL , newstate = GST_STATE_NULL , pendingstate = GST_STATE_NULL;
+
+    /* only interested in messages from snapshot pipeline */
+    if( GST_MESSAGE_SRC(message) == GST_OBJECT(mCtx->snapshotVars.sspipeline) )
+    {
+        DEBUG_API_A2("->XASnapshotItfAdaptation_SnapshotBusCb:\"%s\" from object \"%s\"",
+                GST_MESSAGE_TYPE_NAME(message), GST_OBJECT_NAME(GST_MESSAGE_SRC(message)));
+
+        switch( GST_MESSAGE_TYPE(message))
+        {
+            case GST_MESSAGE_EOS:
+            {
+                if( gst_element_set_state(GST_ELEMENT(mCtx->snapshotVars.sspipeline), GST_STATE_READY)
+                        == GST_STATE_CHANGE_FAILURE )
+                {
+                    DEBUG_ERR("Error stopping snapshot pipeline!!!");
+                }
+                gst_element_get_state(mCtx->snapshotVars.sspipeline, NULL, NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
+
+                DEBUG_INFO_A2("Requested %lu snapshots, taked %lu",mCtx->snapshotVars.numpics,mCtx->snapshotVars.numpicstaken+1);
+                if( ++mCtx->snapshotVars.numpicstaken >= mCtx->snapshotVars.numpics )
+                {
+                    XAAdaptEvent takenevent = {XA_SNAPSHOTITFEVENTS, XA_ADAPT_SNAPSHOT_TAKEN, 0, NULL };
+                    DEBUG_INFO("Snapshot burst finished");
+                    XASnapshotItfAdaptation_StopSnapshotting(&(mCtx->baseObj));
+                    if( mCtx->snapshotVars.fnametemplate == NULL )
+                    {   /* non-datasink snapshot, return buffer */
+                        GstBuffer* pullBuffer = NULL;
+                        XADataSink* pullSink = NULL;
+                        XADataLocator_Address* pullSinkLoc = NULL;
+                        DEBUG_INFO("Get buffer from appsink");
+                        pullBuffer = gst_app_sink_pull_preroll( GST_APP_SINK(mCtx->snapshotVars.sssink) );
+                        /* allocate XADataSink, client should release this later*/
+                        pullSink = calloc(1, sizeof(XADataSink));
+                        pullSinkLoc = calloc(1, sizeof(XADataLocator_Address));
+                        pullSinkLoc->length = pullBuffer->size;
+                        pullSinkLoc->pAddress = calloc(1, pullBuffer->size);
+                        memcpy(pullSinkLoc->pAddress, pullBuffer->data, pullBuffer->size);
+                        pullSinkLoc->locatorType = XA_DATALOCATOR_ADDRESS;
+                        pullSink->pLocator = pullSinkLoc;
+                        pullSink->pFormat = NULL;
+                        takenevent.data = pullSink;
+                    }
+                    /* send needed events */
+                    takenevent.datasize = mCtx->snapshotVars.numpicstaken;
+                    XAAdaptationBase_SendAdaptEvents(&(mCtx->baseObj), &takenevent );
+                }
+                else
+                {
+                    /* videoparse element can not handle renegotiation of stream for new buffer
+                     * after EOS, so recreate it */
+                    gst_element_unlink_many(
+                            mCtx->snapshotVars.ssbuffersrc,
+                            mCtx->snapshotVars.ssparser,
+                            mCtx->snapshotVars.ssscaler,
+                            NULL);
+                    gst_element_set_state(GST_ELEMENT(mCtx->snapshotVars.ssparser), GST_STATE_NULL);
+                    gst_bin_remove(GST_BIN (mCtx->snapshotVars.sspipeline),mCtx->snapshotVars.ssparser);
+                    mCtx->snapshotVars.ssparser = gst_element_factory_make("videoparse", "ssparser");
+                    if( !mCtx->snapshotVars.ssparser )
+                    {
+                        DEBUG_ERR("Cannot create ssparser!");
+                        DEBUG_API("<-XASnapshotItfAdaptation_CreateSnapshotPipeline - XA_RESULT_INTERNAL_ERROR");
+                        return XA_RESULT_INTERNAL_ERROR;
+                    }
+                    gst_bin_add(GST_BIN (mCtx->snapshotVars.sspipeline),mCtx->snapshotVars.ssparser);
+                    if( !gst_element_link_many(
+                            mCtx->snapshotVars.ssbuffersrc,
+                            mCtx->snapshotVars.ssparser,
+                            mCtx->snapshotVars.ssscaler,
+                            NULL) )
+                    {
+                        DEBUG_ERR("Could not link pipeline")
+                        return XA_RESULT_INTERNAL_ERROR;
+                    }
+                    mCtx->snapshotVars.parsenegotiated = FALSE;
+
+                    /*now, wait for new buffer to arrive*/
+                    DEBUG_INFO("Wait for more pictures");
+                    mCtx->snapshotVars.waitforbuffer = TRUE;
+                    mCtx->snapshotVars.sighandler = g_signal_connect(mCtx->videoextract, "handoff",
+                                            G_CALLBACK (XASnapshotItfAdaptation_BufferHandoffCb),mCtx);
+                }
+                break;
+            }
+            case GST_MESSAGE_STATE_CHANGED:
+            {
+                gst_message_parse_state_changed(message, &oldstate, &newstate, &pendingstate);
+                DEBUG_INFO_A4("old %s -> new %s ( pending %s, gsttarget %s )",
+                        gst_element_state_get_name(oldstate),
+                        gst_element_state_get_name(newstate),
+                        gst_element_state_get_name(pendingstate),
+                        gst_element_state_get_name(GST_STATE_TARGET(mCtx->snapshotVars.sspipeline)) );
+                if( newstate==GST_STATE_READY && oldstate==GST_STATE_NULL )
+                {
+                    XAAdaptEvent initevent = {XA_SNAPSHOTITFEVENTS, XA_ADAPT_SNAPSHOT_INITIATED,0, NULL };
+                    DEBUG_INFO("Init complete");
+                    /* send needed events */
+                    XAAdaptationBase_SendAdaptEvents( &(mCtx->baseObj), &initevent);
+                }
+                else if( newstate==GST_STATE_PLAYING && oldstate==GST_STATE_PAUSED && mCtx->snapshotVars.snapshotbuffer )
+                {
+                    DEBUG_INFO("Pushing buffer");
+                    gst_app_src_push_buffer( GST_APP_SRC(mCtx->snapshotVars.ssbuffersrc),
+                                             mCtx->snapshotVars.snapshotbuffer );
+                    DEBUG_INFO_A1("Sent buffer at 0x%x to  ssbuffersrc", (int)mCtx->snapshotVars.snapshotbuffer );
+                    gst_app_src_end_of_stream( GST_APP_SRC(mCtx->snapshotVars.ssbuffersrc) );
+                    mCtx->snapshotVars.snapshotbuffer = NULL;
+                    DEBUG_INFO("Sent EOS ssbuffersrc");
+                }
+
+                break;
+            }
+            default:
+                break;
+        }
+        DEBUG_API("<-XASnapshotItfAdaptation_SnapshotBusCb");
+    }
+    return TRUE;
+}
+
+/*
+ * void XASnapshotItfAdaptation_BufferHandoffCb( GstElement *extract, GstBuffer  *buffer, gpointer data )
+ */
+void XASnapshotItfAdaptation_BufferHandoffCb( GstElement *extract, GstBuffer  *buffer, gpointer data )
+{
+    XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*)data;
+    gint32 width=0, height=0;
+    guint32  fourcc=0, formatnum=0;
+    GstPad* srcPad=NULL;
+    GstCaps* srcPadCaps=NULL;
+    GstStructure* capS=NULL;
+    XAAdaptEvent event = {XA_SNAPSHOTITFEVENTS, XA_ADAPT_SNAPSHOT_TAKEN, 0, NULL };
+    char* fname=NULL;
+
+    DEBUG_API("->XASnapshotItfAdaptation_BufferHandoffCb");
+    if( !mCtx->snapshotVars.waitforbuffer ||
+        !GST_IS_BUFFER(buffer) )
+    {   /* pass on... */
+        DEBUG_API("<-XASnapshotItfAdaptation_BufferHandoffCb");
+        return;
+    }
+
+    if(mCtx->snapshotVars.snapshotbuffer)
+    {
+        DEBUG_INFO("WARNING: snapshotbuffer already exists!!");
+        gst_buffer_unref(GST_BUFFER(mCtx->snapshotVars.snapshotbuffer));
+    }
+    DEBUG_INFO("Receiced snapshotbuffer");
+    mCtx->snapshotVars.snapshotbuffer = gst_buffer_copy(buffer);
+    mCtx->snapshotVars.waitforbuffer = FALSE;
+    g_signal_handler_disconnect(mCtx->videoextract,mCtx->snapshotVars.sighandler);
+    mCtx->snapshotVars.sighandler = 0;
+
+    if( GST_STATE(mCtx->snapshotVars.sspipeline)==GST_STATE_READY )
+    {
+        if( !(mCtx->snapshotVars.parsenegotiated) )
+        {
+            /*read relevant caps of extraction source and set them to videoparse*/
+            srcPad = gst_element_get_pad( GST_ELEMENT(extract), "src");
+            srcPadCaps = gst_pad_get_negotiated_caps( GST_PAD(srcPad) );
+            capS = gst_caps_get_structure(srcPadCaps,0);
+            DEBUG_INFO_A1("buffer caps from extraction source: %s",gst_caps_to_string(srcPadCaps));
+            if( !gst_structure_get_int(capS,"width",&width) ||
+                !gst_structure_get_int(capS,"height",&height) ||
+                !gst_structure_get_fourcc(capS,"format",&fourcc) )
+            {
+                DEBUG_ERR("ERROR! Missing crucial capabilities for buffer!!");
+                DEBUG_API("<-XASnapshotItfAdaptation_BufferHandoffCb");
+                return;
+            }
+            /* convert fourcc to videoparse enumeration */
+            switch(fourcc)
+            {
+                case GST_MAKE_FOURCC('I','4','2','0'):
+                    formatnum = 0;
+                    break;
+                case GST_MAKE_FOURCC('Y','V','1','2'):
+                    formatnum = 1;
+                    break;
+                case GST_MAKE_FOURCC('Y','U','Y','2'):
+                    formatnum = 2;
+                    break;
+                case GST_MAKE_FOURCC('U','Y','V','Y'):
+                    formatnum = 3;
+                    break;
+                case GST_MAKE_FOURCC('R','G','B',' '):
+                    formatnum = 10;
+                    break;
+                case GST_MAKE_FOURCC('G','R','A','Y'):
+                    formatnum = 11;
+                    break;
+                default:
+                    formatnum = 0;
+                    break;
+            }
+            /* set source width and height for parser */
+            g_object_set(mCtx->snapshotVars.ssparser,"width",width,"height",height,"format",formatnum,NULL);
+            mCtx->snapshotVars.parsenegotiated = TRUE;
+        }
+        if(mCtx->snapshotVars.fnametemplate)
+        {   /* get actual filename from template */
+            XASnapshotItfAdaptation_AllocNextFilename(&fname, mCtx->snapshotVars.fnametemplate);
+            DEBUG_INFO_A1("start taking snapshot (%s)", fname);
+            gst_element_set_state(GST_ELEMENT(mCtx->snapshotVars.sssink), GST_STATE_NULL);
+            g_object_set( G_OBJECT(mCtx->snapshotVars.sssink), "location", fname,
+                                                                "async", FALSE,
+                                                                "qos", FALSE,
+                                                                "max-lateness", (gint64)(-1),
+                                                                NULL );
+            gst_element_sync_state_with_parent(mCtx->snapshotVars.sssink);
+            gst_element_get_state(mCtx->snapshotVars.sssink, NULL, NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
+            free(fname);
+        }
+        else
+        {   /* take snapshot to buffer */
+            DEBUG_INFO("start taking snapshot (memory buffer used)");
+        }
+        /* write metadata, if any */
+        XAMetadataAdapt_TryWriteTags(&(mCtx->baseObj), GST_BIN(mCtx->snapshotVars.sspipeline));
+        /* start buffering */
+        if( gst_element_set_state(GST_ELEMENT(mCtx->snapshotVars.sspipeline), GST_STATE_PLAYING )
+                == GST_STATE_CHANGE_FAILURE )
+        {
+            DEBUG_ERR("Error taking picture!!!");
+            /* NOTE: no event for errors in snapshotitf!!! */
+            event.datasize = mCtx->snapshotVars.numpicstaken;
+            XAAdaptationBase_SendAdaptEvents(&(mCtx->baseObj), &event );
+        }
+    }
+    else
+    {
+        DEBUG_INFO_A1("warning: sspipeline in wrong state (%d)",
+                        GST_STATE(mCtx->snapshotVars.sspipeline));
+    }
+    DEBUG_API("<-XASnapshotItfAdaptation_BufferHandoffCb");
+}
+
+/*
+ * const char* XASnapshotItfAdaptation_GetFileSuffix(XADataFormat_MIME* format)
+ */
+const char* XASnapshotItfAdaptation_GetFileSuffix(XADataFormat_MIME* format)
+{
+    const char* ret=NULL;
+    if( format )
+    {
+        if( *(XAuint32*)format == XA_DATAFORMAT_MIME )
+        {
+            switch (format->containerType)
+            {
+                case XA_CONTAINERTYPE_JPG:
+                    ret = "jpg";
+                    break;
+                case XA_CONTAINERTYPE_RAW:
+                    ret = "raw";
+                    break;
+                case XA_CONTAINERTYPE_BMP:
+                    ret = "bmp";
+                    break;
+                default:
+                    break;
+            }
+            if(!ret)
+            { /*parse from mimetype*/
+                if(format->mimeType)
+                {
+                    ret = strrchr((char*)format->mimeType,'/');
+                    if (ret)
+                    {
+                        ret++;
+                    }
+                }
+            }
+        }
+        else if( *(XAuint32*)format == XA_DATAFORMAT_RAWIMAGE )
+        {
+            ret = "raw";
+        }
+    }
+    if(!ret)
+    {
+        ret="jpg"; /*default*/
+    }
+    return ret;
+}
+
+/*
+ * void XASnapshotItfAdaptation_AllocNextFilename(char** fname, const char* template)
+ */
+void XASnapshotItfAdaptation_AllocNextFilename(char** fname, const char* template)
+{
+    XAuint32 idx=0;
+    XAboolean found=XA_BOOLEAN_FALSE;
+    FILE* file=NULL;
+    *fname = calloc(1,strlen(template)+10);
+    while(!found)
+    {
+        sprintf(*fname, template, idx++ );
+        strcat(*fname, "\0");
+        file = fopen(*fname, "r");
+        if(file==NULL)
+        {
+            found = XA_BOOLEAN_TRUE;
+            break;
+        }
+        fclose(file);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xasnapshotitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XSNAPSHOTITFADAPTATION_H
+#define XSNAPSHOTITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+/* DEFINES*/
+
+/* MACROS */
+
+/* FUNCTIONS */
+
+XAresult XASnapshotItfAdaptation_InitiateSnapshot(XAAdaptationBaseCtx* ctx,
+                                            XAuint32 numberOfPictures,
+                                            XAuint32 fps,
+                                            XAboolean freezeViewFinder,
+                                            XADataSink* sink);
+
+XAresult XASnapshotItfAdaptation_TakeSnapshot(XAAdaptationBaseCtx* ctx);
+
+XAresult XASnapshotItfAdaptation_CancelSnapshot(XAAdaptationBaseCtx* ctx);
+
+XAresult XASnapshotItfAdaptation_GetMaxPicsPerBurst(XAAdaptationBaseCtx* ctx,
+                                              XAuint32 *maxNumberOfPictures);
+
+XAresult XASnapshotItfAdaptation_GetBurstFPSRange(XAAdaptationBaseCtx* ctx,
+                                            XAuint32 *minFPS,
+                                            XAuint32 *maxFPS);
+
+XAresult XASnapshotItfAdaptation_SetShutterFeedback(XAAdaptationBaseCtx* ctx,
+                                              XAboolean enabled);
+#endif /* XSNAPSHOTITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xastaticcameracapsadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,562 @@
+/*
+* 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 <stdio.h>
+#include <string.h>
+#include <gst.h>
+#include <photography.h>
+#include "XAGlobals.h"
+#include "XAStaticCameraCapsAdaptation.h"
+#include "XAStaticCapsAdaptation.h"
+
+#define XACAMERAIMPL_DEFAULT_MAX_ZOOM 16000 /* 16x */
+#define XACAMERAIMPL_DEFAULT_MAX_ISO 1600
+#define XACAMERAIMPL_DEFAULT_MIN_ISO 200
+#define XACAMERAIMPL_DEFAULT_MAX_APERTURE 3200 /* f/32 */
+#define XACAMERAIMPL_DEFAULT_MIN_APERTURE 75   /* f/0.75 */
+
+static XAStaticCameraCapsData allCameraCaps[] =
+{
+#ifdef XA_USE_TEST_PLUGINS
+        { XA_ADAPTID_VIDEOTESTSRC, { (XAchar*)"videotestsrc", 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
+#else
+        { XA_ADAPTID_V4L2SRC, { (XAchar*)"v4l2src", 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
+#endif
+};
+
+/*forward declaration*/
+XAuint32 XAStaticCameraCaps_IdxFromId(XAuint32 cameraDeviceID);
+
+/*
+ * void XAStaticCameraCaps_Init()
+ */
+void XAStaticCameraCaps_Init()
+{
+    GstElement* element=NULL;
+    GstPhotoCaps photoCaps = GST_PHOTOGRAPHY_CAPS_NONE;
+    GError* gerror=NULL;
+    guint32 i=0;
+    guint32 numDevices = sizeof(allCameraCaps)/sizeof(XAStaticCameraCapsData);
+    gboolean detected = FALSE;
+
+
+    if ( !gst_init_check( NULL, NULL, &gerror ) )
+    {
+        DEBUG_ERR("Gst Initalization failure.");
+        return;
+    }
+    for(i=0;i<numDevices;i++)
+    {
+        /*init values*/
+        allCameraCaps[i].XAcaps.orientation = XA_ORIENTATION_UNKNOWN;
+        allCameraCaps[i].XAcaps.featuresSupported = 0;
+        allCameraCaps[i].XAcaps.exposureModesSupported = 0;
+        allCameraCaps[i].XAcaps.flashModesSupported = 0;
+        allCameraCaps[i].XAcaps.focusModesSupported = 0;
+        allCameraCaps[i].XAcaps.meteringModesSupported = 0;
+        allCameraCaps[i].XAcaps.whiteBalanceModesSupported = 0;
+        allCameraCaps[i].XAcaps.maxWidth = 0;
+        allCameraCaps[i].XAcaps.maxHeight = 0;
+
+        element = gst_element_factory_make((char*)allCameraCaps[i].XAcaps.name,NULL);
+        if(element)
+        {
+            GstPad* srcPad = gst_element_get_static_pad( element, "src");
+            if (srcPad)
+            {
+                guint32 j = 0, cnt = 0, width = 0, height = 0;
+                GstCaps* srcCaps = gst_pad_get_caps( srcPad );
+
+                /* search caps for absolute maximum values */
+                if(srcCaps)
+                {
+                    cnt = gst_caps_get_size( srcCaps );
+                    for( j = 0; j < cnt; j++ )
+                    {
+                        G_CONST_RETURN GValue* value = NULL;
+                        GstStructure* capsStruct = gst_caps_get_structure( srcCaps, j );
+
+                        if(capsStruct)
+                        {
+                            value = gst_structure_get_value( capsStruct, "width" );
+                            if (GST_VALUE_HOLDS_INT_RANGE(value))
+                            {
+                                detected = TRUE;
+                                width = gst_value_get_int_range_max( value );
+                                if(width > allCameraCaps[i].XAcaps.maxWidth)
+                                {
+                                    allCameraCaps[i].XAcaps.maxWidth = width;
+                                }
+                            }
+
+                            value = gst_structure_get_value( capsStruct, "height" );
+                            if (GST_VALUE_HOLDS_INT_RANGE(value))
+                            {
+                                detected = TRUE;
+                                height = gst_value_get_int_range_max( value );
+                                if(height > allCameraCaps[i].XAcaps.maxHeight)
+                                {
+                                    allCameraCaps[i].XAcaps.maxHeight = height;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            if(!detected)
+            {
+                DEBUG_ERR("Warn: could not get maxWidth and maxHeight from GST!!");
+                allCameraCaps[i].XAcaps.maxWidth = 0x7FFFFFFF;
+                allCameraCaps[i].XAcaps.maxHeight =  0x7FFFFFFF;
+            }
+
+            if(GST_IS_PHOTOGRAPHY(element))
+            {
+                photoCaps = gst_photography_get_capabilities(GST_PHOTOGRAPHY(element));
+                if( photoCaps & GST_PHOTOGRAPHY_CAPS_FLASH )
+                {
+                    allCameraCaps[i].XAcaps.featuresSupported |= XA_CAMERACAP_FLASH;
+                    allCameraCaps[i].XAcaps.flashModesSupported = XA_CAMERA_FLASHMODE_OFF |
+                                                       XA_CAMERA_FLASHMODE_ON |
+                                                       XA_CAMERA_FLASHMODE_AUTO |
+                                                       XA_CAMERA_FLASHMODE_REDEYEREDUCTION |
+                                                       XA_CAMERA_FLASHMODE_FILLIN;
+                }
+                if( photoCaps & GST_PHOTOGRAPHY_CAPS_FOCUS )
+                {
+                    allCameraCaps[i].XAcaps.featuresSupported |= XA_CAMERACAP_AUTOFOCUS;
+                    allCameraCaps[i].XAcaps.focusModesSupported = XA_CAMERA_FOCUSMODE_AUTO;
+                }
+                if( photoCaps & GST_PHOTOGRAPHY_CAPS_EXPOSURE )
+                {
+                    allCameraCaps[i].XAcaps.featuresSupported |= XA_CAMERACAP_MANUALEXPOSURE;
+                    allCameraCaps[i].XAcaps.exposureModesSupported = XA_CAMERA_EXPOSUREMODE_AUTO |
+                                                          XA_CAMERA_EXPOSUREMODE_PORTRAIT |
+                                                          XA_CAMERA_EXPOSUREMODE_SPORTS |
+                                                          XA_CAMERA_EXPOSUREMODE_NIGHT;
+                }
+
+                if( photoCaps & GST_PHOTOGRAPHY_CAPS_ISO_SPEED )
+                {
+                    allCameraCaps[i].XAcaps.featuresSupported |= XA_CAMERACAP_MANUALISOSENSITIVITY;
+                }
+                if( photoCaps & GST_PHOTOGRAPHY_CAPS_APERTURE )
+                {
+                    allCameraCaps[i].XAcaps.featuresSupported |= XA_CAMERACAP_MANUALAPERTURE;
+                }
+                if( photoCaps & GST_PHOTOGRAPHY_CAPS_WB_MODE )
+                {
+                    allCameraCaps[i].XAcaps.featuresSupported |= XA_CAMERACAP_AUTOWHITEBALANCE;
+                    allCameraCaps[i].XAcaps.whiteBalanceModesSupported = XA_CAMERA_WHITEBALANCEMODE_AUTO |
+                                                              XA_CAMERA_WHITEBALANCEMODE_SUNLIGHT |
+                                                              XA_CAMERA_WHITEBALANCEMODE_CLOUDY |
+                                                              XA_CAMERA_WHITEBALANCEMODE_TUNGSTEN |
+                                                              XA_CAMERA_WHITEBALANCEMODE_FLUORESCENT |
+                                                              XA_CAMERA_WHITEBALANCEMODE_SUNSET;
+                }
+                if( photoCaps & GST_PHOTOGRAPHY_CAPS_ZOOM )
+                {
+                    allCameraCaps[i].XAcaps.featuresSupported |= XA_CAMERACAP_DIGITALZOOM;
+                }
+            }
+        }
+    }
+}
+
+/*
+ * XAresult XAStaticCameraCaps_GetCameraCapabilities(
+ *                       XAuint32* pIndex,
+ *                       XAuint32* pCameraDeviceID,
+ *                       XACameraDescriptor* pDescriptor)
+ *
+ */
+XAresult XAStaticCameraCaps_GetCameraCapabilities(
+                        XAuint32* pIndex,
+                        XAuint32* pCameraDeviceID,
+                        XACameraDescriptor* pDescriptor)
+{
+    guint32 idx = 0;
+    guint32 numDevices = sizeof(allCameraCaps)/sizeof(XAStaticCameraCapsData);
+
+    if(!pDescriptor)
+    {
+        if(pIndex) /* query number of devices */
+        {
+            *pIndex = numDevices;
+            DEBUG_API("<-XAStaticCameraCaps_GetCameraCapabilities");
+            return XA_RESULT_SUCCESS;
+        }
+        else
+        {
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("<-XAStaticCameraCaps_GetCameraCapabilities");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+    }
+
+    if( !pIndex && pCameraDeviceID )
+    {
+        /* get index from ID */
+        idx = XAStaticCameraCaps_IdxFromId(*pCameraDeviceID);
+    }
+    else if( pIndex && pCameraDeviceID )
+    {
+        idx = *pIndex;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAStaticCameraCaps_GetCameraCapabilities");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( idx >= numDevices )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAStaticCameraCaps_GetCameraCapabilities");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        /*fill capabilities*/
+        memcpy(pDescriptor, &allCameraCaps[idx].XAcaps, sizeof(XACameraDescriptor) );
+        *pCameraDeviceID = allCameraCaps[idx].deviceID;
+    }
+
+    DEBUG_API("<-XAStaticCameraCaps_GetCameraCapabilities");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAStaticCameraCaps_QueryFocusRegionPatterns(
+ *                       XAuint32 cameraDeviceID,
+ *                       XAuint32* pPatternID,
+ *                       XAuint32* pFocusPattern,
+ *                       XAuint32* pCustomPoints1,
+ *                       XAuint32* pCustomPoints2)
+ */
+XAresult XAStaticCameraCaps_QueryFocusRegionPatterns(
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pPatternID,
+                        XAuint32* pFocusPattern,
+                        XAuint32* pCustomPoints1,
+                        XAuint32* pCustomPoints2)
+{
+    DEBUG_API("->XAStaticCameraCaps_QueryFocusRegionPatterns");
+    if( !pFocusPattern )
+    {   /* return number of focus patterns */
+        if(!pPatternID)
+        {
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("<-XAStaticCameraCaps_QueryFocusRegionPatterns");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+        /* no support in GST */
+        DEBUG_INFO("No support in gst");
+        *pPatternID = 0;
+    }
+    else
+    {
+        if( !(pFocusPattern&&pCustomPoints1&&pCustomPoints2) )
+        {
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("<-XAStaticCameraCaps_QueryFocusRegionPatterns");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+        DEBUG_INFO("No support in gst");
+        *pFocusPattern = 0;
+        *pCustomPoints1 = 0;
+        *pCustomPoints2 = 0;
+        /*no focus patterns, index always out of range*/
+        DEBUG_API("<-XAStaticCameraCaps_QueryFocusRegionPatterns");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_API("<-XAStaticCameraCaps_QueryFocusRegionPatterns");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAStaticCameraCaps_GetSupportedAutoLocks(
+ *                       XAuint32 cameraDeviceID,
+ *                       XAuint32* pNumCombinations,
+ *                       XAuint32** ppLocks)
+ */
+XAresult XAStaticCameraCaps_GetSupportedAutoLocks(
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pNumCombinations,
+                        XAuint32** ppLocks)
+{
+    DEBUG_API("->XAStaticCameraCaps_GetSupportedAutoLocks");
+    /* No support in gst.
+     * Spec: "If no settings are supported,
+     *        this method returns XA_RESULT_FEATURE_UNSUPPORTED."
+     **/
+    DEBUG_INFO("No support in gst");
+    if(pNumCombinations)
+    {
+        *pNumCombinations = 0;
+    }
+    DEBUG_API("<-XAStaticCameraCaps_GetSupportedAutoLocks");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+}
+
+/*
+ * XAresult XAStaticCameraCaps_GetSupportedFocusManualSettings(
+ *                       XAuint32 cameraDeviceID,
+ *                       XAboolean macroEnabled,
+ *                       XAmillimeter* pMinValue,
+ *                       XAmillimeter* pMaxValue,
+ *                       XAuint32* pNumSettings,
+ *                       XAmillimeter** ppSettings)
+ */
+XAresult XAStaticCameraCaps_GetSupportedFocusManualSettings(
+                        XAuint32 cameraDeviceID,
+                        XAboolean macroEnabled,
+                        XAmillimeter* pMinValue,
+                        XAmillimeter* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAmillimeter** ppSettings)
+{
+    DEBUG_API("->XAStaticCameraCaps_GetSupportedFocusManualSettings");
+    /* No support in gst.
+     * Spec: "If no settings are supported,
+     *        this method returns XA_RESULT_FEATURE_UNSUPPORTED."
+     **/
+    DEBUG_INFO("No support in gst");
+    if(pNumSettings)
+    {
+        *pNumSettings = 0;
+    }
+    DEBUG_API("<-XAStaticCameraCaps_GetSupportedFocusManualSettings");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+}
+
+/*
+ * XAresult XAStaticCameraCaps_GetSupportedISOSensitivitySettings(
+ *                       XAuint32 cameraDeviceID,
+ *                       XAuint32* pMinValue,
+ *                       XAuint32* pMaxValue,
+ *                       XAuint32* pNumSettings,
+ *                       XAuint32** ppSettings)
+ */
+XAresult XAStaticCameraCaps_GetSupportedISOSensitivitySettings(
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pMinValue,
+                        XAuint32* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAuint32** ppSettings)
+{
+    DEBUG_API("->XAStaticCameraCaps_GetSupportedISOSensitivitySettings");
+    if( !pNumSettings )
+    {
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    if( !ppSettings )
+    {
+        /* no items in ppSettings array*/
+        *pNumSettings = 0;
+    }
+    else
+    {
+        if( !(pMinValue && pMaxValue) )
+        {
+            DEBUG_API("<-XAStaticCameraCaps_GetSupportedISOSensitivitySettings");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+        /* continuous range */
+        *pNumSettings = 0;
+        /* NOTE: no way to query actual values from gstreamer, use hardcoded default values */
+        *pMinValue = XACAMERAIMPL_DEFAULT_MIN_ISO;
+        *pMaxValue = XACAMERAIMPL_DEFAULT_MAX_ISO;
+    }
+    DEBUG_API("<-XAStaticCameraCaps_GetSupportedISOSensitivitySettings");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAStaticCameraCaps_GetSupportedApertureManualSettings(
+ *                       XAuint32 cameraDeviceID,
+ *                       XAuint32* pMinValue,
+ *                       XAuint32* pMaxValue,
+ *                       XAuint32* pNumSettings,
+ *                       XAuint32** ppSettings)
+ */
+XAresult XAStaticCameraCaps_GetSupportedApertureManualSettings(
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pMinValue,
+                        XAuint32* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAuint32** ppSettings)
+{
+    DEBUG_API("->XAStaticCameraCaps_GetSupportedApertureManualSettings");
+    if( !pNumSettings )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAStaticCameraCaps_GetSupportedApertureManualSettings");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    if( !ppSettings )
+    {
+        /* no items in ppSettings array*/
+        *pNumSettings = 0;
+    }
+    else
+    {
+        /* continuous range */
+        *pNumSettings = 0;
+        /* NOTE: no way to query actual values from gstreamer, use hardcoded default values */
+        *pMinValue = XACAMERAIMPL_DEFAULT_MIN_APERTURE;
+        *pMaxValue = XACAMERAIMPL_DEFAULT_MAX_APERTURE;
+    }
+    DEBUG_API("<-XAStaticCameraCaps_GetSupportedApertureManualSettings");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAStaticCameraCaps_GetSupportedShutterSpeedManualSettings(
+ *                        XAuint32 cameraDeviceID,
+ *                       XAmicrosecond* pMinValue,
+ *                       XAmicrosecond* pMaxValue,
+ *                       XAuint32* pNumSettings,
+ *                       XAmicrosecond** ppSettings)
+ */
+XAresult XAStaticCameraCaps_GetSupportedShutterSpeedManualSettings(
+                        XAuint32 cameraDeviceID,
+                        XAmicrosecond* pMinValue,
+                        XAmicrosecond* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAmicrosecond** ppSettings)
+{
+    DEBUG_API("->XAStaticCameraCaps_GetSupportedShutterSpeedManualSettings");
+    /* No support in gst.
+     * Spec: "If no settings are supported,
+     *        this method returns XA_RESULT_FEATURE_UNSUPPORTED."
+     **/
+    DEBUG_INFO("No support in gst");
+    if(pNumSettings)
+    {
+        *pNumSettings = 0;
+    }
+    DEBUG_API("<-XAStaticCameraCaps_GetSupportedShutterSpeedManualSettings");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+}
+
+/*
+ * XAresult XAStaticCameraCaps_GetSupportedWhiteBalanceManualSettings(
+ *                       XAuint32 cameraDeviceID,
+ *                       XAuint32* pMinValue,
+ *                       XAuint32* pMaxValue,
+ *                       XAuint32* pNumSettings,
+ *                       XAuint32** ppSettings)
+ */
+XAresult XAStaticCameraCaps_GetSupportedWhiteBalanceManualSettings(
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pMinValue,
+                        XAuint32* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAuint32** ppSettings)
+{
+    DEBUG_API("->XAStaticCameraCaps_GetSupportedWhiteBalanceManualSettings");
+    /* No support in gst.
+     * Spec: "If no settings are supported,
+     *        this method returns XA_RESULT_FEATURE_UNSUPPORTED."
+     **/
+    DEBUG_INFO("No support in gst");
+    if(pNumSettings)
+    {
+        *pNumSettings = 0;
+    }
+    DEBUG_API("<-XAStaticCameraCaps_GetSupportedWhiteBalanceManualSettings");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+}
+
+/*
+ * XAresult XAStaticCameraCaps_GetSupportedZoomSettings(
+ *                       XAuint32 cameraDeviceID,
+ *                       XAboolean digitalEnabled,
+ *                       XAboolean macroEnabled,
+ *                       XApermille* pMaxValue,
+ *                       XAuint32* pNumSettings,
+ *                       XApermille** ppSettings,
+ *                       XAboolean* pSpeedSupported)
+ */
+XAresult XAStaticCameraCaps_GetSupportedZoomSettings(
+                        XAuint32 cameraDeviceID,
+                        XAboolean digitalEnabled,
+                        XAboolean macroEnabled,
+                        XApermille* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XApermille** ppSettings,
+                        XAboolean* pSpeedSupported)
+{
+    DEBUG_API("->XAStaticCameraCaps_GetSupportedZoomSettings");
+    if( !ppSettings )
+    {
+        if( !pNumSettings )
+        {
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("<-XAStaticCameraCaps_GetSupportedZoomSettings");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+        *pNumSettings = 0;
+    }
+    else
+    {
+        if( !(pMaxValue && pSpeedSupported) )
+        {
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("<-XAStaticCameraCaps_GetSupportedZoomSettings");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+        /*NOTE: no way to query actual max value*/
+        *pMaxValue = XACAMERAIMPL_DEFAULT_MAX_ZOOM;
+        /*no gst support for speed settings*/
+        *pSpeedSupported = XA_BOOLEAN_FALSE;
+        *pNumSettings = 0;
+    }
+    DEBUG_API("<-XAStaticCameraCaps_GetSupportedZoomSettings");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAuint32 XAStaticCameraCaps_IdxFromId(XAuint32 cameraDeviceID)
+ */
+XAuint32 XAStaticCameraCaps_IdxFromId(XAuint32 cameraDeviceID)
+{
+    XAuint32 devId = 0;
+    XAuint32 idx = 0;
+    guint32 numDevices = sizeof(allCameraCaps)/sizeof(XAStaticCameraCapsData);
+
+    if(cameraDeviceID == XA_DEFAULTDEVICEID_CAMERA)
+    {
+        devId = XACAMERAIMPL_DEFAULT_DEVICE;
+    }
+    else
+    {
+        devId = cameraDeviceID;
+    }
+
+    /* query capas with id -> find index*/
+    for(idx=0; idx<numDevices; idx++)
+    {
+        if( devId==allCameraCaps[idx].deviceID )
+            break;
+    }
+    return idx;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xastaticcameracapsadaptation.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XASTATICCAMERACAPSADAPTATION_H
+#define XASTATICCAMERACAPSADAPTATION_H
+
+#include "openmaxalwrapper.h"
+#include "XAGlobals.h"
+
+#ifdef XA_USE_TEST_PLUGINS
+#define XACAMERAIMPL_DEFAULT_DEVICE XA_ADAPTID_VIDEOTESTSRC
+#else
+#define XACAMERAIMPL_DEFAULT_DEVICE XA_ADAPTID_V4L2SRC
+#endif
+
+/* Structure to hold commonly used capabilities of codec/device.
+ */
+typedef struct XAStaticCameraCapsData_
+{
+    XAuint32              deviceID;
+    XACameraDescriptor    XAcaps;
+} XAStaticCameraCapsData;
+
+void XAStaticCameraCaps_Init();
+
+XAresult XAStaticCameraCaps_GetCameraCapabilities(
+                        XAuint32* pIndex,
+                        XAuint32* pCameraDeviceID,
+                        XACameraDescriptor* pDescriptor);
+
+XAresult XAStaticCameraCaps_QueryFocusRegionPatterns(
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pPatternID,
+                        XAuint32* pFocusPattern,
+                        XAuint32* pCustomPoints1,
+                        XAuint32* pCustomPoints2);
+
+XAresult XAStaticCameraCaps_GetSupportedAutoLocks(
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pNumCombinations,
+                        XAuint32** ppLocks);
+
+XAresult XAStaticCameraCaps_GetSupportedFocusManualSettings(
+                        XAuint32 cameraDeviceID,
+                        XAboolean macroEnabled,
+                        XAmillimeter* pMinValue,
+                        XAmillimeter* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAmillimeter** ppSettings);
+
+XAresult XAStaticCameraCaps_GetSupportedISOSensitivitySettings(
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pMinValue,
+                        XAuint32* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAuint32** ppSettings);
+
+XAresult XAStaticCameraCaps_GetSupportedApertureManualSettings(
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pMinValue,
+                        XAuint32* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAuint32** ppSettings);
+
+XAresult XAStaticCameraCaps_GetSupportedShutterSpeedManualSettings(
+                        XAuint32 cameraDeviceID,
+                        XAmicrosecond* pMinValue,
+                        XAmicrosecond* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAmicrosecond** ppSettings);
+
+XAresult XAStaticCameraCaps_GetSupportedWhiteBalanceManualSettings(
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pMinValue,
+                        XAuint32* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAuint32** ppSettings);
+
+XAresult XAStaticCameraCaps_GetSupportedZoomSettings(
+                        XAuint32 cameraDeviceID,
+                        XAboolean digitalEnabled,
+                        XAboolean macroEnabled,
+                        XApermille* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XApermille** ppSettings,
+                        XAboolean* pSpeedSupported);
+
+#endif /* XASTATICCAMERACAPSADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xastaticcapsadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,769 @@
+/*
+* 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 <gst.h>
+#include <string.h>
+#include <gstparamspecs.h>
+#include "XAStaticCapsAdaptation.h"
+
+#define AUD_D (XACAP_DECODER|XACAP_AUDIO)
+#define AUD_E (XACAP_ENCODER|XACAP_AUDIO)
+#define VID_D (XACAP_DECODER|XACAP_VIDEO)
+#define VID_E (XACAP_ENCODER|XACAP_VIDEO)
+#define IMG_D (XACAP_DECODER|XACAP_IMAGE)
+#define IMG_E (XACAP_ENCODER|XACAP_IMAGE)
+#define AUD_O (XACAP_DEVSNK|XACAP_AUDIO)
+#define AUD_I (XACAP_DEVSRC|XACAP_AUDIO)
+#define VID_O (XACAP_DEVSNK|XACAP_VIDEO)
+#define VID_I (XACAP_DEVSRC|XACAP_VIDEO)
+#define ANY 0x7FFFFFFF
+
+
+/* initially contains default "any"values, later filled in by querying GStreamer plugins */
+static XAStaticCapsData allCaps[] =
+    {/* { type,  id,                        adaptId,            maxCh, minBPS, maxBPS, minSR, maxSR, minBR, maxBR, maxFR, maxW, maxH, extra }, */
+     //   { AUD_D, XA_AUDIOCODEC_PCM,         (XAchar *)"audioparse",       0,0,0,0,0,0,0,0,0,0,0,0 },
+        { AUD_E, XA_AUDIOCODEC_PCM,         NULL,                         0,0,0,0,0,0,0,0,0,0,0,0 },
+     //   { AUD_D, XA_ADAPTID_VORBIS,         (XAchar *)"vorbisdec",        0,0,0,0,0,0,0,0,0,0,0,0 },
+     //   { AUD_E, XA_ADAPTID_VORBIS,         (XAchar *)"vorbisenc",        0,0,0,0,0,0,0,0,0,0,0,0 },
+     //   { VID_D, XA_ADAPTID_MOTIONJPEG,     (XAchar *)"jpegdec",          0,0,0,0,0,0,0,0,0,0,0,0 },
+     //   { VID_E, XA_ADAPTID_MOTIONJPEG,     (XAchar *)"jpegenc",          0,0,0,0,0,0,0,0,0,0,0,0 },
+     //   { VID_D, XA_ADAPTID_THEORA,         (XAchar *)"theoradec",        0,0,0,0,0,0,0,0,0,0,0,0 },
+     //  { VID_E, XA_ADAPTID_THEORA,         (XAchar *)"theoraenc",        0,0,0,0,0,0,0,0,0,0,0,0 },
+     //   { VID_D, XA_ADAPTID_RAWVIDEO,       (XAchar *)"videoparse",       0,0,0,0,0,0,0,0,0,0,0,0 },
+        { VID_E, XA_ADAPTID_RAWVIDEO,       NULL,                         0,0,0,0,0,0,0,0,0,0,0,0 },
+     //   { IMG_D, XA_IMAGECODEC_JPEG,        (XAchar *)"jpegdec",          0,0,0,0,0,0,0,0,0,0,0,0 },
+     //   { IMG_E, XA_IMAGECODEC_JPEG,        (XAchar *)"jpegenc",          0,0,0,0,0,0,0,0,0,0,0,0 },
+     //   { IMG_D, XA_IMAGECODEC_RAW,         (XAchar *)"videoparse",       0,0,0,0,0,0,0,0,0,0,0,0 },
+        { IMG_E, XA_IMAGECODEC_RAW,         NULL,                         0,0,0,0,0,0,0,0,0,0,0,0 },
+        { AUD_O, XA_ADAPTID_DEVSOUNDSINK,       (XAchar *)"devsoundsink",     0,0,0,0,0,0,0,0,0,0,0,0 },
+        { AUD_I, XA_ADAPTID_DEVSOUNDSRC,        (XAchar *)"devsoundsrc",          0,0,0,0,0,0,0,0,0,0,0,0 },
+      //  { AUD_O, XA_ADAPTID_ALSASINK,       (XAchar *)"alsasink",         0,0,0,0,0,0,0,0,0,0,0,0 },
+      //  { AUD_I, XA_ADAPTID_ALSASRC,        (XAchar *)"alsasrc",          0,0,0,0,0,0,0,0,0,0,0,0 }
+//#ifdef XA_USE_TEST_PLUGINS
+//        ,{ AUD_I, XA_ADAPTID_AUDIOTESTSRC,   (XAchar *)"audiotestsrc",     0,0,0,0,0,0,0,0,0,0,0,0 }
+//#endif
+    };
+
+/*
+ * XAresult XAStaticCapsAdapt_ReadImageCaps(GstCaps* caps, XAStaticCapsData* data)
+ */
+XAresult XAStaticCapsAdapt_ReadImageCaps(GstCaps* caps, XAStaticCapsData* data)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+
+    XAuint32 widthMax = 0;
+    XAuint32 heightMax = 0;
+    gint capsCount = 0;
+    gint iterator = 0;
+    GstStructure *capsStruct = NULL;
+    G_CONST_RETURN GValue* value = NULL;
+
+    DEBUG_API("->XAStaticCapsAdapt_ReadImageCaps");
+    capsCount = gst_caps_get_size( caps );
+    for( iterator = 0; iterator < capsCount; iterator++ )
+    {
+        capsStruct = gst_caps_get_structure( caps, iterator );
+
+        DEBUG_INFO_A1("Caps from gst: %s", gst_structure_to_string(capsStruct));
+
+        if (gst_structure_n_fields( capsStruct ) > 0) /* Any check*/
+        {
+            value = gst_structure_get_value( capsStruct, "width" );
+            if (GST_VALUE_HOLDS_INT_RANGE(value))
+            {
+                widthMax = gst_value_get_int_range_max( value );
+                DEBUG_INFO_A1("widthMax:%d",(int)widthMax);
+            }
+            else
+            {
+                DEBUG_ERR("Cannot get width from capabilities struct");
+                DEBUG_API("<-XAStaticCapsAdapt_ReadImageCaps - XA_RESULT_INTERNAL_ERROR");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            value = gst_structure_get_value( capsStruct, "height" );
+            if (GST_VALUE_HOLDS_INT_RANGE(value))
+            {
+                heightMax = gst_value_get_int_range_max( value );
+                DEBUG_INFO_A1("heightMax:%d",(int)heightMax);
+            }
+            else
+            {
+                DEBUG_ERR("Cannot get height from capabilities struct");
+                DEBUG_API("<-XAStaticCapsAdapt_ReadImageCaps - XA_RESULT_INTERNAL_ERROR");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            if (heightMax < data->maxH)
+            {
+                data->maxH = heightMax;
+            }
+            if (widthMax < data->maxW)
+            {
+                data->maxW = widthMax;
+            }
+        }
+    }
+    DEBUG_API("<-XAStaticCapsAdapt_ReadImageCaps");
+    return res;
+}
+
+/*
+ * XAresult XAStaticCapsAdapt_ReadAudioCaps(GstCaps* caps, XAStaticCapsData* data, GstElement* element)
+ */
+XAresult XAStaticCapsAdapt_ReadAudioCaps(GstCaps* caps, XAStaticCapsData* data, GstElement* element)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+
+    XAuint32 channelsMax = ANY;
+    XAuint32 minRate = 0;
+    XAuint32 maxRate = ANY;
+    XAuint32 minBPS = 0;
+    XAuint32 maxBPS = ANY;
+    XAuint32 minBR = 0;
+    XAuint32 maxBR = ANY;
+    XAboolean intCapsUsed = XA_BOOLEAN_FALSE;
+
+    gint capsCount = 0;
+    gint iterator = 0;
+    GstStructure *capsStruct = NULL;
+    G_CONST_RETURN GValue* value = NULL;
+    const char* capsName = NULL;
+
+    DEBUG_API("->XAStaticCapsAdapt_ReadAudioCaps");
+    capsCount = gst_caps_get_size( caps );
+    for( iterator = 0; iterator < capsCount; iterator++ )
+    {
+        capsStruct = gst_caps_get_structure( caps, iterator );
+
+        DEBUG_INFO_A1("Caps from gst: %s", gst_structure_to_string(capsStruct));
+        capsName = gst_structure_get_name(capsStruct);
+
+        if (intCapsUsed == XA_BOOLEAN_TRUE)
+        {
+            break; // preferred caps used 
+        }
+        else if (!strcmp( capsName,"audio/x-raw-int"))
+        {
+            intCapsUsed = XA_BOOLEAN_TRUE;
+        }
+
+        if (gst_structure_n_fields( capsStruct ) > 0) // Any check
+        {
+            value = gst_structure_get_value( capsStruct, "channels" );
+            if (GST_VALUE_HOLDS_INT_RANGE(value))
+            {
+                channelsMax = gst_value_get_int_range_max( value );
+                DEBUG_INFO_A1("channelsMax:%d",(int)channelsMax);
+            }
+            else if (G_VALUE_HOLDS_INT(value))
+            {
+                channelsMax = g_value_get_int( value );
+                DEBUG_INFO_A1("channelsMax:%d",(int)channelsMax);
+            }
+            else
+            {
+                DEBUG_ERR("Cannot get channels from capabilities struct");
+                DEBUG_API("<-XAStaticCapsAdapt_ReadAudioCaps - XA_RESULT_INTERNAL_ERROR");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            value = gst_structure_get_value( capsStruct, "rate" );
+            if (GST_VALUE_HOLDS_INT_RANGE(value))
+            {
+                minRate = gst_value_get_int_range_min( value );
+                maxRate = gst_value_get_int_range_max( value );
+                DEBUG_INFO_A2("minRate:%d maxRate:%d",(int)minRate,(int)maxRate);
+            }
+            else
+            {
+                DEBUG_ERR("Cannot get rates from capabilities struct");
+                DEBUG_API("<-XAStaticCapsAdapt_ReadAudioCaps - XA_RESULT_INTERNAL_ERROR");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            value = gst_structure_get_value( capsStruct, "width" );
+            if (GST_VALUE_HOLDS_LIST(value))
+            {
+                XAuint32 count = 0;
+                XAuint32 i = 0;
+                XAuint32 bps = 0;
+                count = gst_value_list_get_size(value);
+                for (i = 0; i < count; i++  )
+                {
+                    G_CONST_RETURN GValue* v = gst_value_list_get_value(value, i);
+                    bps =  g_value_get_int(v);
+                    if (bps < minBPS || i == 0)
+                    {
+                        minBPS = bps;
+                    }
+                    if (bps > maxBPS || i == 0)
+                    {
+                        maxBPS = bps;
+                    }
+                    DEBUG_INFO_A2("minBPS:%d maxBPS:%d",(int)minBPS,(int)maxBPS);
+                }
+            }
+            else if (G_VALUE_HOLDS_INT(value))
+            {
+                minBPS = g_value_get_int(value);
+                maxBPS = g_value_get_int(value);
+                DEBUG_INFO_A2("minBPS:%d maxBPS:%d",(int)minBPS,(int)maxBPS);
+            }
+            else
+            {
+                // if not there read from depth 
+                value = gst_structure_get_value( capsStruct, "depth" );
+                if (GST_VALUE_HOLDS_INT_RANGE(value))
+                {
+                    minBPS = gst_value_get_int_range_min( value );
+                    maxBPS = gst_value_get_int_range_max( value );
+                    DEBUG_INFO_A2("minBPS:%d maxBPS:%d",(int)minBPS,(int)maxBPS);
+                }
+                else
+                {
+                    DEBUG_ERR("Cannot get width from capabilities struct");
+                    DEBUG_API("<-XAStaticCapsAdapt_ReadAudioCaps - XA_RESULT_INTERNAL_ERROR");
+                    return XA_RESULT_INTERNAL_ERROR;
+                }
+            }
+
+            value = gst_structure_get_value( capsStruct, "bitrate" );
+            if( value && GST_VALUE_HOLDS_INT_RANGE(value) )
+            {
+                minBR = gst_value_get_int_range_min( value );
+                maxBR = gst_value_get_int_range_max( value );
+                DEBUG_INFO_A2("minBR:%d maxBR:%d",(int)minBR,(int)maxBR);
+            }
+            else
+            {
+            	// TL: Replaced this code...
+              /*  GParamSpec* param = g_object_class_find_property(G_OBJECT_GET_CLASS(element), "bitrate");
+                if(param && G_IS_PARAM_SPEC_INT(param))
+                {
+                    GParamSpecInt *pint = G_PARAM_SPEC_INT (param);
+                    if(pint->minimum>0) minBR = pint->minimum;
+                    else minBR = 1;
+                    maxBR = pint->maximum;
+                }
+                */
+                
+                // ...with this:
+                // GstBitRate *bitRate; // This object doesn't exist yet
+                // GObject *minBitRate = G_OBJECT(bitRate->minBitRate);
+                // GObject *maxBitRate = G_OBJECT(bitRate->maxBitRate);
+                //if (g_object_class_find_property(G_OBJECT_GET_CLASS(minBitRate), "bitrate"))
+                //{
+                //	if (minBitRate > 0)
+                //		minBR = minBitRate;
+                //	else
+                //		minBR = 1;
+              	//}
+              	//else
+              	//	minBR = 0;
+                //if (g_object_class_find_property(G_OBJECT_GET_CLASS(maxBitRate), "bitrate"))             		
+                //	maxBR = maxBitRate;
+                // else
+                // maxBR = 0;
+            }
+
+            if (channelsMax < data->maxCh)
+            {
+                data->maxCh = channelsMax;
+            }
+            if (minRate > data->minSR)
+            {
+                data->minSR = minRate;
+            }
+            if (maxRate < data->maxSR)
+            {
+                data->maxSR = maxRate;
+            }
+            if (minBPS > data->minBPS)
+            {
+                data->minBPS = minBPS;
+            }
+            if (maxBPS < data->maxBPS)
+            {
+                data->maxBPS = maxBPS;
+            }
+            if (minBR > data->minBR)
+            {
+                data->minBR = minBR;
+            }
+            if (maxBR < data->maxBR)
+            {
+                data->maxBR = maxBR;
+            }
+        }
+    }
+    
+    DEBUG_API("<-XAStaticCapsAdapt_ReadAudioCaps");
+    return res;
+}
+
+/*
+ * XAresult XAStaticCapsAdapt_ReadVideoCaps(GstCaps* caps, XAStaticCapsData* data)
+ */
+XAresult XAStaticCapsAdapt_ReadVideoCaps(GstCaps* caps, XAStaticCapsData* data)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+
+    XAuint32 widthMax = ANY;
+    XAuint32 heightMax = ANY;
+    XAuint32 frMax = ANY;
+    const GValue* framerate = NULL;
+
+    gint capsCount = 0;
+    gint iterator = 0;
+    GstStructure *capsStruct = NULL;
+    G_CONST_RETURN GValue* value = NULL;
+
+    DEBUG_API("->XAStaticCapsAdapt_ReadVideoCaps");
+    capsCount = gst_caps_get_size( caps );
+    for( iterator = 0; iterator < capsCount; iterator++ )
+    {
+        capsStruct = gst_caps_get_structure( caps, iterator );
+
+        DEBUG_INFO_A1("Caps from gst: %s", gst_structure_to_string(capsStruct));
+
+        if (gst_structure_n_fields( capsStruct ) > 0) /* Any check*/
+        {
+            value = gst_structure_get_value( capsStruct, "width" );
+            if (GST_VALUE_HOLDS_INT_RANGE(value))
+            {
+              widthMax = gst_value_get_int_range_max( value );
+              DEBUG_INFO_A1("widthMax:%d",(int)widthMax);
+            }
+            else
+            {
+              DEBUG_ERR("Cannot get width from capabilities struct");
+              DEBUG_API("<-XAStaticCapsAdapt_ReadVideoCaps - XA_RESULT_INTERNAL_ERROR");
+              return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            value = gst_structure_get_value( capsStruct, "height" );
+            if (GST_VALUE_HOLDS_INT_RANGE(value))
+            {
+              heightMax = gst_value_get_int_range_max( value );
+              DEBUG_INFO_A1("heightMax:%d",(int)heightMax);
+            }
+            else
+            {
+              DEBUG_ERR("Cannot get height from capabilities struct");
+              DEBUG_API("<-XAStaticCapsAdapt_ReadVideoCaps - XA_RESULT_INTERNAL_ERROR");
+              return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            value = gst_structure_get_value( capsStruct, "framerate" );
+            if (GST_VALUE_HOLDS_FRACTION_RANGE(value))
+            {
+              framerate = gst_value_get_fraction_range_max( value );
+              frMax = gst_value_get_fraction_numerator( framerate );
+              DEBUG_INFO_A1("frMax:%d",(int)frMax);
+            }
+            else
+            {
+              DEBUG_ERR("Cannot get height from capabilities struct");
+              DEBUG_API("<-XAStaticCapsAdapt_ReadVideoCaps - XA_RESULT_INTERNAL_ERROR");
+              return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            if (heightMax < data->maxH)
+            {
+              data->maxH = heightMax;
+            }
+            if (widthMax < data->maxW)
+            {
+              data->maxW = widthMax;
+            }
+            if (frMax < data->maxFR)
+            {
+              data->maxFR = frMax;
+            }
+        }
+    }
+
+    DEBUG_API("<-XAStaticCapsAdapt_ReadVideoCaps");
+    return res;
+}
+
+/*
+ * XAresult XAStaticCapsAdapt_ReadAudioIOCaps(GstCaps* caps, XAStaticCapsData* data)
+ */
+XAresult XAStaticCapsAdapt_ReadAudioIOCaps(GstCaps* caps, XAStaticCapsData* data)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+
+    XAuint32 minSR = 0;
+    XAuint32 maxSR = ANY;
+    gint capsCount = 0;
+    gint iterator = 0;
+    GstStructure *capsStruct = NULL;
+
+    const char* capsName = NULL;
+    XAuint32 depth = 0;
+
+    DEBUG_API("->XAStaticCapsAdapt_ReadAudioIOCaps");
+    capsCount = gst_caps_get_size( caps );
+    for( iterator = 0; iterator < capsCount; iterator++ )
+    {
+        capsStruct = gst_caps_get_structure( caps, iterator );
+
+        DEBUG_INFO_A1("Caps from gst: %s", gst_structure_to_string(capsStruct));
+
+        capsName = gst_structure_get_name(capsStruct);
+        if (!strcmp(capsName, "audio/x-raw-int"))
+        {
+            if (gst_structure_get_int( capsStruct, "depth", (gint*)&depth))
+            {
+                DEBUG_INFO_A1("depth:%d",(int)depth);
+            }
+            else
+            {
+                DEBUG_ERR("Cannot get depth from capabilities struct");
+                DEBUG_API("<-XAStaticCapsAdapt_ReadAudioIOCaps - XA_RESULT_INTERNAL_ERROR");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+            if (minSR == 0 && maxSR == 0)
+            {
+                minSR = depth;
+                maxSR = depth;
+            }
+            else
+            {
+                if (depth < minSR)
+                {
+                    minSR = depth;
+                }
+                if (depth > maxSR)
+                {
+                    maxSR = depth;
+                }
+            }
+            switch (depth)
+            {
+            case XA_PCMSAMPLEFORMAT_FIXED_8:
+                data->pcmProfilesSupported |= XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_8;
+                break;
+            case XA_PCMSAMPLEFORMAT_FIXED_16:
+                data->pcmProfilesSupported |= XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_16;
+                break;
+            case XA_PCMSAMPLEFORMAT_FIXED_20:
+                data->pcmProfilesSupported |= XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_20;
+                break;
+            case XA_PCMSAMPLEFORMAT_FIXED_24:
+                data->pcmProfilesSupported |= XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_24;
+                break;
+            case XA_PCMSAMPLEFORMAT_FIXED_28:
+                data->pcmProfilesSupported |= XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_28;
+                break;
+            case XA_PCMSAMPLEFORMAT_FIXED_32:
+                data->pcmProfilesSupported |= XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_32;
+                break;
+            default:
+                DEBUG_ERR("Invalid depth");
+                DEBUG_API("<-XAStaticCapsAdapt_ReadAudioIOCaps - XA_RESULT_INTERNAL_ERROR");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+        }
+    }
+    data->minSR = minSR;
+    data->maxSR = maxSR;
+
+
+    DEBUG_API("<-XAStaticCapsAdapt_ReadAudioIOCaps");
+    return res;
+}
+
+/*
+ * XAresult XAStaticCapsAdapt_GetCapsFromGst(XAStaticCapsData* data)
+ */
+XAresult XAStaticCapsAdapt_GetCapsFromGst(XAStaticCapsData* data)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    GstCaps* caps = NULL;
+    GstPad* pad = NULL;
+    GstPad* pads[2] = {NULL, NULL};
+    GstElement* element = NULL;
+    XAuint32 padCount = 2; /* default src/sink */
+    XAuint32 padLoop = 0;
+
+    DEBUG_API("->XAStaticCapsAdapt_GetCapsFromGst");
+
+    /* by default no constraints */
+    data->maxCh = ANY;
+    data->minBPS = 0;
+    data->maxBPS = ANY;
+    data->minSR = 0;
+    data->maxSR = ANY;
+    data->minBR = 0;
+    data->maxBR = ANY;
+    data->maxFR = ANY;
+    data->maxW = ANY;
+    data->maxH = ANY;
+    data->extra = 0;
+    data->pcmProfilesSupported = 0;
+    data->numBitrates = 0;
+
+    if (data->xaid == XA_AUDIOCODEC_PCM)
+    {
+        data->extra = XA_AUDIOPROFILE_PCM;
+    }
+
+    if (data->adaptId != NULL)
+    {
+        element =  gst_element_factory_make( (char *)data->adaptId, (char *)data->adaptId);
+        if (!element)
+        {
+            DEBUG_ERR("Cannot make gst element!");
+            DEBUG_API("<-XAStaticCapsAdapt_GetelementCaps - XA_RESULT_INTERNAL_ERROR");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+
+        if (data->captype == AUD_I || data->captype == AUD_O)
+        {
+            padCount = 1;
+            if (data->captype == AUD_I)
+            {
+                pads[0] = gst_element_get_static_pad( element, "src");
+            }
+            else
+            {
+                pads[0] = gst_element_get_static_pad( element, "sink");
+            }
+        }
+        else
+        {
+            padCount = 2;
+            pads[0] = gst_element_get_static_pad( element, "sink");
+            pads[1] = gst_element_get_static_pad( element, "src");
+        }
+
+        if (!pads[0] || (!pads[1] && padCount == 2))
+        {
+            DEBUG_ERR("Cannot get pad!");
+            DEBUG_API("<-XAStaticCapsAdapt_GetCapsFromGst - XA_RESULT_INTERNAL_ERROR");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+
+        for (padLoop = 0; padLoop < padCount; padLoop++)
+        {
+            pad = pads[padLoop];
+
+            caps = gst_pad_get_caps( pad );
+            if( !caps )
+            {
+                DEBUG_ERR("Cannot receive caps from pad!");
+                DEBUG_API("<-XAStaticCapsAdapt_GetCapsFromGst - XA_RESULT_INTERNAL_ERROR");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            if (data->captype & XACAP_IMAGE)
+            {
+                res = XAStaticCapsAdapt_ReadImageCaps(caps, data);
+            }
+            else if(data->captype & XACAP_AUDIO)
+            {
+                res = XAStaticCapsAdapt_ReadAudioCaps(caps, data, element);
+            }
+            else if(data->captype & XACAP_VIDEO)
+            {
+                res = XAStaticCapsAdapt_ReadVideoCaps(caps, data);
+            }
+            if (data->captype == AUD_I || data->captype == AUD_O)
+            {
+                res = XAStaticCapsAdapt_ReadAudioIOCaps(caps, data);
+            }
+        }
+    }
+
+    DEBUG_API("<-XAStaticCapsAdapt_GetCapsFromGst");
+    return res;
+}
+
+/*
+ * XAresult XAStaticCapsAdapt_InitCaps()
+ */
+XAresult XAStaticCapsAdapt_InitCaps()
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XAuint32 i = 0;
+    XAuint32 capCount = (sizeof(allCaps)/sizeof(XAStaticCapsData));
+    DEBUG_API("->XAStaticCapsAdapt_InitCaps");
+
+    for( i = 0; i < capCount; i++)
+    {
+        res = XAStaticCapsAdapt_GetCapsFromGst(&allCaps[i]);
+        if (res != XA_RESULT_SUCCESS)
+        {
+            DEBUG_API("<-XAStaticCapsAdapt_InitCaps");
+            return res;
+        }
+    }
+
+    DEBUG_API("<-XAStaticCapsAdapt_InitCaps");
+    return res;
+}
+
+/* XAresult XAStaticCapsAdapt_GetCapsCount
+ * Description: Count capabilities of certain type. Filter is specified by
+ *              bitmasking XACapsType values.
+ */
+XAresult XAStaticCapsAdapt_GetCapsCount(XACapsType filter, XAuint32 *count)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XAuint32 capCount = (sizeof(allCaps)/sizeof(XAStaticCapsData));
+    DEBUG_API("->XAStaticCapsAdapt_GetCapsCount");
+    if(!count)
+    {
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        XAuint32 i = 0;
+        (*count)=0;
+        for( i=0; i<capCount; i++ )
+        {
+            if ( (allCaps[i].captype & filter) == filter )
+            {
+                (*count)++;
+            }
+        }
+    }
+    DEBUG_API("<-XAStaticCapsAdapt_GetCapsCount");
+    return res;
+}
+
+/* XAresult XAStaticCapsAdapt_GetCapsById
+ * Description: Get capabilities of type XACapsType and matching id
+ */
+XAresult XAStaticCapsAdapt_GetCapsById(XACapsType filter, XAuint32 maxId, XAStaticCapsData* data)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XAuint32 capCount = (sizeof(allCaps)/sizeof(XAStaticCapsData));
+    DEBUG_API("->XAStaticCapsAdapt_GetCapsById");
+    if(!data)
+    {
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        XAuint32 i = 0;
+        XAboolean found = XA_BOOLEAN_FALSE;
+        for( i=0; i<capCount; i++ )
+        {
+            if ( ((allCaps[i].captype & filter) == filter) && (maxId==allCaps[i].xaid) )
+            {
+                memcpy(data, &allCaps[i], sizeof(XAStaticCapsData));
+                found = XA_BOOLEAN_TRUE;
+                break;
+            }
+        }
+        if(!found)
+        {
+           res = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
+    }
+    DEBUG_API("<-XAStaticCapsAdapt_GetCapsById");
+    return res;
+}
+
+/* XAresult XAStaticCapsAdapt_GetCapsByIdx
+ * Description: Get n'th capabilities of type XACapsType
+ */
+XAresult XAStaticCapsAdapt_GetCapsByIdx(XACapsType filter, XAuint32 idx, XAStaticCapsData* data)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XAuint32 capCount = (sizeof(allCaps)/sizeof(XAStaticCapsData));
+    DEBUG_API("->XAStaticCapsAdapt_GetCapsByIdx");
+    if(!data)
+    {
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        XAuint32 i = 0,j=0;
+        XAboolean found = XA_BOOLEAN_FALSE;
+        for( i=0; i<capCount; i++ )
+        {
+            if ( (allCaps[i].captype & filter) == filter )
+            {
+                if( idx == j++ )
+                {
+                    memcpy(data, &allCaps[i], sizeof(XAStaticCapsData));
+                    found = XA_BOOLEAN_TRUE;
+                    break;
+                }
+            }
+        }
+        if(!found)
+        {
+           res = XA_RESULT_PARAMETER_INVALID;
+        }
+    }
+    DEBUG_API("<-XAStaticCapsAdapt_GetCapsByIdx");
+    return res;
+}
+
+/* XAresult XAStaticCapsAdapt_QueryColorFormats
+ * Description: Get color formats associated with the XA_IMAGECODEC_RAW codec.
+ */
+XAresult XAStaticCapsAdapt_QueryColorFormats(XAuint32* pIndex, XAuint32* pColorFormats)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAStaticCapsAdapt_QueryColorFormats");
+
+    if( !pIndex )
+    {
+        DEBUG_ERR("illegal NULL parameter");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        XAStaticCapsData temp;
+        res = XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_IMAGE, XA_IMAGECODEC_RAW, &temp);
+        if( res == XA_RESULT_SUCCESS )
+        {
+            if( !pColorFormats )
+            {   /* query number of color formats */
+                *pIndex = 1; /* one used by camera context */
+            }
+            else
+            {   /* query color format */
+                if( *pIndex >= 1 ) /* one used by camera context */
+                {
+                    DEBUG_ERR("index parameter invalid");
+                    res = XA_RESULT_PARAMETER_INVALID;
+                }
+                else
+                {   /* internal format used by pipeline, look camera context for details  */
+                    *pColorFormats = XA_COLORFORMAT_YUV420PLANAR;
+                }
+            }
+        }
+        else
+        {
+            *pIndex = 0;
+        }
+    }
+
+    DEBUG_API("<-XAStaticCapsAdapt_QueryColorFormats");
+    return res;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xastaticcapsadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,111 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XASTATICCAPSADAPTATION_H
+#define XASTATICCAPSADAPTATION_H
+
+#include "XAGlobals.h"
+#include "XADebug.h"
+
+/* Adaptation device IDs */
+//#define XA_ADAPTID_ALSASRC          0xAD7E5001  //Krishna commented
+#define XA_ADAPTID_DEVSOUNDSRC          0xAD7E5001
+//#define XA_ADAPTID_ALSASINK         0xAD7E5002
+#define XA_ADAPTID_DEVSOUNDSINK     0xAD7E5002
+#define XA_ADAPTID_AUTOAUDIOSINK    0xAD7E5003
+#define XA_ADAPTID_AUDIOTESTSRC     0xAD7E5004
+#define XA_ADAPTID_AUTOVIDEOSINK    0xAD7E5005
+#define XA_ADAPTID_VIDEOTESTSRC     0xAD7E5006
+#define XA_ADAPTID_V4L2SRC          0xAD7E5007
+#define XA_ADAPTID_JACKSINK         0xAD7E5008
+#define XA_ADAPTID_MOTIONJPEG       0xAD7E5009
+#define XA_ADAPTID_THEORA           0xAD7E500A
+#define XA_ADAPTID_VORBIS           0xAD7E500B
+
+#define XA_ADAPTID_VIBRA            0xAD7E500C
+#define XA_ADAPTID_LEDARRAY         0xAD7E500D
+
+#define XA_ADAPTID_RAWVIDEO         0xAD7E500E
+
+//#define XA_ADAPT_DEFAULTAUDIOOUTPUT XA_ADAPTID_ALSASINK
+#define XA_ADAPT_DEFAULTAUDIOOUTPUT XA_ADAPTID_DEVSOUNDSINK
+
+#ifdef XA_USE_TEST_PLUGINS
+#define XA_ADAPT_DEFAULTAUDIOINPUT  XA_ADAPTID_AUDIOTESTSRC
+#else
+//#define XA_ADAPT_DEFAULTAUDIOINPUT  XA_ADAPTID_ALSASRC //Krishna commented
+#define XA_ADAPT_DEFAULTAUDIOINPUT  XA_ADAPTID_DEVSOUNDSRC
+#endif
+
+
+#define XA_ADAPT_OGGPROFILE_UNKNOWN 0x1
+
+#define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_8   0x1
+#define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_16  0x2
+#define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_20  0x4
+#define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_24  0x8
+#define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_28  0x10
+#define XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_32  0x20
+
+#define XA_ADAPT_MAX_BITRATE_COUNT 10
+
+typedef enum
+{
+    XACAP_DECODER  = 0x1,
+    XACAP_ENCODER  = 0x2,
+    XACAP_DEVSNK   = 0x4,
+    XACAP_DEVSRC   = 0x8,
+
+    XACAP_AUDIO    = 0x10,
+    XACAP_VIDEO    = 0x20,
+    XACAP_IMAGE    = 0x40
+}XACapsType;
+
+/* Structure to hold commonly used capabilities of codec/device.
+ */
+typedef struct XAStaticCapsData_
+{
+    XAuint32    captype;
+    XAuint32    xaid;       /* OpenMAX id (e.g. XA_VIDEOCODEC macro) */
+    XAchar*     adaptId;    /* e.g. plugin name */
+    XAuint32    maxCh;      /* channels */
+    XAuint32    minBPS;     /* bits per sample */
+    XAuint32    maxBPS;
+    XAuint32    minSR;      /* samplerate */
+    XAuint32    maxSR;
+    XAuint32    minBR;      /* bitrate */
+    XAuint32    maxBR;
+    XAuint32    maxFR;      /* framerate */
+    XAuint32    maxW;       /* width */
+    XAuint32    maxH;       /* height */
+    XAuint32    pcmProfilesSupported;
+    XAuint32    numBitrates;
+    XAuint32    bitratesSupported[XA_ADAPT_MAX_BITRATE_COUNT];
+
+    XAuint32    extra;      /* some type-specific extra info */
+    /*add if/when needed*/
+} XAStaticCapsData;
+
+
+XAresult XAStaticCapsAdapt_GetCapsCount(XACapsType filter, XAuint32 *count);
+
+XAresult XAStaticCapsAdapt_GetCapsById(XACapsType filter, XAuint32 maxId, XAStaticCapsData* data);
+
+XAresult XAStaticCapsAdapt_GetCapsByIdx(XACapsType filter, XAuint32 idx, XAStaticCapsData* data);
+XAresult XAStaticCapsAdapt_InitCaps();
+XAresult XAStaticCapsAdapt_QueryColorFormats(XAuint32* pIndex, XAuint32* pColorFormats);
+#endif /* XASTATICCAPSADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xavibraadaptctx.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* 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 <gst.h>
+#include "XAVibraAdaptCtx.h"
+#include "XAAdaptation.h"
+
+/*
+ * XAAdaptationBaseCtx* XAVibraAdapt_Create()
+ * Allocates memory for Vibra Adaptation Context and makes 1st phase initialization
+ * @returns XAVibraAdaptationCtx* - Pointer to created context
+ */
+XAAdaptationBaseCtx* XAVibraAdapt_Create(XAuint32 deviceID)
+{
+    XAVibraAdaptationCtx *pSelf = calloc(1, sizeof(XAVibraAdaptationCtx));
+    DEBUG_API("->XAVibraAdapt_Create");
+    if ( pSelf)
+    {
+        if( XAAdaptationBase_Init(&(pSelf->baseObj),XAVibraAdaptation)
+                    != XA_RESULT_SUCCESS )
+        {
+        DEBUG_ERR("Failed to init base context!!!");
+        free(pSelf);
+        pSelf = NULL;
+        }
+    }
+
+    DEBUG_API("<-XAVibraAdapt_Create");
+    return (XAAdaptationBaseCtx*)pSelf;
+}
+
+/*
+ * XAresult XAVibraAdapt_PostInit()
+ * 2nd phase initialization of Vibra Adaptation Context
+ */
+XAresult XAVibraAdapt_PostInit(XAAdaptationBaseCtx* bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVibraAdaptationCtx* ctx = NULL;
+
+    DEBUG_API("->XAVibraAdapt_PostInit");
+    if(bCtx == NULL || bCtx->ctxId != XAVibraAdaptation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraAdapt_PostInit");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    ctx = (XAVibraAdaptationCtx*)bCtx;
+
+    XAAdaptationBase_PostInit( &(ctx->baseObj) );
+
+    DEBUG_API("<-XAVibraAdapt_PostInit");
+    return ret;
+}
+
+/*
+ * void XAVibraAdapt_Destroy(XAVibraAdaptationCtx* ctx)
+ * Destroys Vibra Adaptation Context
+ * @param ctx - Vibra Adaptation context to be destroyed
+ */
+void XAVibraAdapt_Destroy(XAAdaptationBaseCtx* bCtx)
+{
+    XAVibraAdaptationCtx* ctx = NULL;
+    DEBUG_API("->XAVibraAdapt_Destroy");
+
+    if(bCtx == NULL || bCtx->ctxId != XAVibraAdaptation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraAdapt_Destroy");
+        return;
+    }
+    ctx = (XAVibraAdaptationCtx*)bCtx;
+    XAAdaptationBase_Free(&(ctx->baseObj));
+
+    free(ctx);
+    ctx = NULL;
+
+    DEBUG_API("<-XAVibraAdapt_Destroy");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xavibraadaptctx.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAVIBRAADAPTCTX_H
+#define XAVIBRAADAPTCTX_H
+
+#include "XAAdaptationContextBase.h"
+
+/* TYPEDEFS */
+
+typedef struct XAVibraAdaptationCtx_ XAVibraAdaptationCtx;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XAVibraAdapt_Create(XAuint32 deviceID);
+
+XAresult XAVibraAdapt_PostInit(XAAdaptationBaseCtx* bCtx);
+void XAVibraAdapt_Destroy(XAAdaptationBaseCtx* bCtx);
+
+#endif /* XAVIBRAADAPTCTX_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xavibraitfadaptation.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include "XAVibraAdaptCtx.h"
+#include "XAVibraItfAdaptation.h"
+#include "XAAdaptation.h"
+
+/*
+ * XAresult XAVibraItfAdapt_Vibrate( XAAdaptationBaseCtx *bCtx, XAboolean vibrate );
+ */
+XAresult XAVibraItfAdapt_Vibrate( XAAdaptationBaseCtx *bCtx, XAboolean vibrate )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    if(vibrate)
+    {
+        DEBUG_API("->XAVibraItfAdapt_Vibrate: ON");
+    }
+    else
+        DEBUG_API("->XAVibraItfAdapt_Vibrate: OFF");
+
+
+    if(!bCtx || bCtx->ctxId != XAVibraAdaptation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraItfAdapt_Vibrate");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_INFO("No support > stubbed.");
+    DEBUG_API("<-XAVibraItfAdapt_Vibrate");
+
+    return ret;
+}
+/*
+ * XAresult XAVibraItfAdapt_SetFrequency ( XAAdaptationBaseCtx *bCtx,   XAmilliHertz frequency );
+ */
+XAresult XAVibraItfAdapt_SetFrequency ( XAAdaptationBaseCtx *bCtx,  XAmilliHertz frequency )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API_A1("->XAVibraItfAdapt_SetFrequency %ld", frequency);
+
+    if(!bCtx || bCtx->ctxId != XAVibraAdaptation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraItfAdapt_SetFrequency");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_INFO("No support > stubbed.");
+    DEBUG_API("<-XAVibraItfAdapt_SetFrequency");
+    return ret;
+}
+/*
+ * XAresult XAVibraItfAdapt_SetIntensity ( XAAdaptationBaseCtx *bCtx,   XApermille intensity );
+ */
+XAresult XAVibraItfAdapt_SetIntensity ( XAAdaptationBaseCtx *bCtx,  XApermille intensity )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API_A1("->XAVibraItfAdapt_SetIntensity %d", intensity);
+
+    if(!bCtx || bCtx->ctxId != XAVibraAdaptation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraItfAdapt_SetIntensity");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_INFO("No support > stubbed.");
+    DEBUG_API("<-XAVibraItfAdapt_SetIntensity");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xavibraitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAVibraItfADAPTATION_H_
+#define XAVibraItfADAPTATION_H_
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+
+/* FUNCTIONS */
+XAresult XAVibraItfAdapt_Vibrate( XAAdaptationBaseCtx *bCtx, XAboolean vibrate );
+XAresult XAVibraItfAdapt_SetFrequency ( XAAdaptationBaseCtx *bCtx,  XAmilliHertz frequency );
+XAresult XAVibraItfAdapt_SetIntensity ( XAAdaptationBaseCtx *bCtx,  XApermille intensity );
+#endif /* XAVIBRAITFADAPTATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xavideoencoderitfadaptation.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include <gst.h>
+#include "XAMediaRecorderAdaptCtx.h"
+#include "XAVideoEncoderItfAdaptation.h"
+#include "XAAdaptation.h"
+#include "XAStaticCapsAdaptation.h"
+
+/*
+ * XAresult XAVideoEncoderITfAdapt_SetVideoSettings( XAAdaptationBaseCtx *bCtx,
+ *                                                   XAVideoSettings *pSettings )
+ * @param XAAdaptationBaseCtx *ctx - pointer to Media Recorer adaptation context
+ * @param XAVideoSettings *pSettings - Settings for encoder
+ * @return XAresult ret - return success value
+ * Description: Sets preferred encoder settings for pipeline.
+ */
+XAresult XAVideoEncoderItfAdapt_SetVideoSettings( XAAdaptationBaseCtx *bCtx,
+                                                  XAVideoSettings *pSettings )
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAVideoEncoderAdapt_SetVideoSettings");
+    if( !bCtx || (bCtx->ctxId != XAMediaRecorderAdaptation) || !pSettings )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoEncoderAdapt_SetVideoSettings");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+    ret = XAMediaRecorderAdapt_CheckCodec(mCtx,XACAP_VIDEO,pSettings->encoderId);
+    if(ret==XA_RESULT_SUCCESS)
+    {
+        /*change of settings - pipeline must be regenerated**/
+        mCtx->encodingchanged = XA_BOOLEAN_TRUE;
+        memcpy(&mCtx->videoEncSettings, pSettings, sizeof(XAVideoSettings));
+    }
+    DEBUG_API("<-XAVideoEncoderAdapt_SetVideoSettings");
+    return ret;
+}
+
+/*
+ * XAresult XAVideoEncoderItfAdapt_GetVideoSettings( XAAdaptationBaseCtx *bCtx, XAVideoSettings *pSettings )
+ */
+XAresult XAVideoEncoderItfAdapt_GetVideoSettings( XAAdaptationBaseCtx *bCtx,
+                                                  XAVideoSettings *pSettings )
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAVideoEncoderItfAdapt_GetVideoSettings");
+
+    if( !bCtx || (bCtx->ctxId != XAMediaRecorderAdaptation) || !pSettings )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoEncoderItfAdapt_GetVideoSettings");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+    memcpy(pSettings, &(mCtx->videoEncSettings), sizeof(XAVideoSettings));
+    DEBUG_API("<-XAVideoEncoderItfAdapt_GetVideoSettings");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xavideoencoderitfadaptation.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAVIDEOENCODERITFADAPTATION_H
+#define XAVIDEOENCODERITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+
+
+/* FUNCTIONS */
+XAresult XAVideoEncoderItfAdapt_SetVideoSettings(XAAdaptationBaseCtx *bCtx,
+                                                 XAVideoSettings *pSettings  );
+XAresult XAVideoEncoderItfAdapt_GetVideoSettings( XAAdaptationBaseCtx *bCtx,
+                                                  XAVideoSettings *pSettings );
+#endif /* XAVIDEOENCODERITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xavideopostprosessingitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,916 @@
+/*
+* 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 <gst.h>
+#include <video.h>
+#include "XAAdaptation.h"
+#include "XAMediaPlayerAdaptCtx.h"
+#include "XAMediaRecorderAdaptCtx.h"
+#include "XACameraAdaptCtx.h"
+#include "XAVideoPostProsessingItfAdaptation.h"
+#include "XAStaticCameraCapsAdaptation.h"
+
+/*
+ * XAresult XAVideoPostProcessingItfAdapt_IsArbitraryRotationSupported(XAAdaptationBaseCtx *bCtx,
+ *                                                                     XAboolean *pSupported)
+ */
+XAresult XAVideoPostProcessingItfAdapt_IsArbitraryRotationSupported(XAAdaptationBaseCtx *bCtx,
+                                                                    XAboolean *pSupported)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAVideoPostProcessingItfAdapt_IsArbitraryRotationSupported");
+
+    if(!bCtx || (bCtx->ctxId != XAMediaPlayerAdaptation && bCtx->ctxId != XAMediaRecorderAdaptation
+            && bCtx->ctxId != XACameraAdaptation) || !pSupported)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoPostProcessingItfAdapt_IsArbitraryRotationSupported");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* This feature is not supported, return boolean false */
+    *pSupported = XA_BOOLEAN_FALSE;
+
+    DEBUG_API("<-XAVideoPostProcessingItfAdapt_IsArbitraryRotationSupported");
+    return ret;
+}
+
+/*
+ * XAresult XAVideoPostProcessingItfAdapt_Commit(XAAdaptationBaseCtx *bCtx)
+ */
+XAresult XAVideoPostProcessingItfAdapt_Commit(XAAdaptationBaseCtx *bCtx,
+                                              XAmillidegree rotation,
+                                              XAuint32 scaleOptions,
+                                              XAuint32 backgroundColor,
+                                              XAuint32 renderingHints,
+                                              const XARectangle *pSrcRect,
+                                              const XARectangle *pDestRect,
+                                              XAuint32 mirror,
+                                              XAboolean isMirror,
+                                              XAboolean isRotate,
+                                              XAboolean isDestRect,
+                                              XAboolean isSrcRect,
+                                              XAboolean isScaleOptions
+                                              )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAmillidegree tempRotation = 0;
+    XAmillidegree newRotation = 0;
+    XAuint32 tempMirror = XA_VIDEOMIRROR_NONE;
+    XAuint32 newMirror = XA_VIDEOMIRROR_NONE;
+    XADataSource *dataSrc = NULL;
+    GstElement *cropElement = NULL;
+    GstElement *rotateElement = NULL;
+    GstElement *mirrorElement = NULL;
+    GstElement *boxElement = NULL;
+    GstElement *balanceElement = NULL;
+    GstElement *gammaElement = NULL;
+    GstElement *sink = NULL;
+    GstElement *col1 = NULL;
+    GstElement *scale = NULL;
+    gdouble     alphaValue = 1;
+    gint        videoBackgroundColor = 0,
+                cropscaleRight = 0, cropscaleBottom = 0,
+                cropscaleLeft = 0,
+                cropscaleTop = 0,
+                videoscaleHeight = 0;
+    GstStateChangeReturn gstRet = GST_STATE_CHANGE_SUCCESS;
+    GstState gstOrigState = GST_STATE_PLAYING;
+    GstState gstTmpState = GST_STATE_PLAYING;
+
+    DEBUG_API("->XAVideoPostProcessingItfAdapt_Commit");
+
+    if( !bCtx || (bCtx->ctxId != XAMediaPlayerAdaptation && bCtx->ctxId != XAMediaRecorderAdaptation
+        && bCtx->ctxId != XACameraAdaptation))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoPostProcessingItfAdapt_Commit");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( bCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XAMediaPlayerAdaptationCtx* ctx = (XAMediaPlayerAdaptationCtx*) bCtx;
+
+
+        /* Get video pp elements */
+        GstPad *pad = NULL;
+        GstCaps *caps = NULL;
+        col1 = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_colsp1");
+        cropElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_crop");
+        rotateElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_rotate");
+        mirrorElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_mirror");
+        boxElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_box");
+        balanceElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_balance");
+        gammaElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_gamma");
+        sink = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "videosink");
+        pad = gst_element_get_static_pad(GST_ELEMENT(sink),"sink");
+        caps = gst_caps_new_simple("video/x-raw-yuv",
+                 "width", G_TYPE_INT,0,
+                 "height", G_TYPE_INT,0,
+                 NULL);
+        gst_pad_set_caps(pad, caps);
+
+        /* get current mirror state and rotate value */
+        tempMirror = ctx->curMirror;
+        tempRotation = ctx->curRotation;
+        dataSrc = ctx->xaSource;
+    }
+
+    if( bCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XAMediaRecorderAdaptationCtx* ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+        /* Get video pp elements */
+        GstPad *pad = NULL;
+        GstCaps *caps = NULL;
+        scale = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_scale2");
+        col1 = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_colsp1");
+        cropElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_crop");
+        rotateElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_rotate");
+        mirrorElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_mirror");
+        boxElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_box");
+        balanceElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_balance");
+        gammaElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_gamma");
+        sink = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "datasink");
+        pad = gst_element_get_static_pad(GST_ELEMENT(sink),"sink");
+        caps = gst_caps_new_simple("video/x-raw-yuv",
+                 "width", G_TYPE_INT,0,
+                 "height", G_TYPE_INT,0,
+                 NULL);
+        gst_pad_set_caps(pad, caps);
+
+        /* get current mirror state and rotate value */
+        tempMirror = ctx->curMirror;
+        tempRotation = ctx->curRotation;
+    }
+
+    if( bCtx->ctxId == XACameraAdaptation )
+    {
+        XACameraAdaptationCtx* ctx = (XACameraAdaptationCtx*) bCtx;
+
+        GstElement *videoPP = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "videopp_camera");
+        if( !videoPP )
+        {
+            DEBUG_ERR("Could not receive videopp from camerabin!");
+        }
+        else
+        {
+            /* Get camera pp elements */
+            GstPad *pad = NULL;
+            GstCaps *caps = NULL;
+            rotateElement = gst_bin_get_by_name( GST_BIN(videoPP), "pp_rotate");
+            col1 = gst_bin_get_by_name( GST_BIN(videoPP), "pp_colsp1");
+            cropElement = gst_bin_get_by_name( GST_BIN(videoPP), "pp_crop");
+            mirrorElement = gst_bin_get_by_name( GST_BIN(videoPP), "pp_mirror");
+            boxElement = gst_bin_get_by_name( GST_BIN(videoPP), "pp_box");
+            balanceElement = gst_bin_get_by_name( GST_BIN(videoPP), "pp_balance");
+            gammaElement = gst_bin_get_by_name( GST_BIN(videoPP), "pp_gamma");
+            sink = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_crop");
+            pad = gst_element_get_static_pad(GST_ELEMENT(sink),"sink");
+            caps = gst_caps_new_simple("video/x-raw-yuv",
+                     "width", G_TYPE_INT,0,
+                     "height", G_TYPE_INT,0,
+                     NULL);
+            gst_pad_set_caps(pad, caps);
+
+            /* get current mirror state and rotate value */
+            tempMirror = ctx->curMirror;
+            tempRotation = ctx->curRotation;
+        }
+    }
+
+    /* Cropping */
+    if( isSrcRect && pSrcRect && cropElement && col1 )
+    {
+
+        gint        cropRight = 0;
+        gint        cropBottom = 0;
+        gint        cropLeft = 0;
+        gint        cropTop = 0;
+        GstPad      *videoPad = NULL;
+        gint        videoWidth = 0;
+        gint        videoHeight = 0;
+        DEBUG_INFO("Start cropping!");
+
+        DEBUG_INFO_A1("pSrcRect->left:%d",(int)pSrcRect->left);
+        DEBUG_INFO_A1("pSrcRect->top:%d",(int)pSrcRect->top);
+        DEBUG_INFO_A1("pSrcRect->width:%d",(int)pSrcRect->width);
+        DEBUG_INFO_A1("pSrcRect->height:%d", (int)pSrcRect->height);
+
+        if( bCtx->ctxId == XACameraAdaptation )
+        {
+            GstCaps *caps = NULL;
+            XACameraAdaptationCtx* ctx = (XACameraAdaptationCtx*) bCtx;
+            gint capsCount = 0;
+            gint iterator = 0;
+            GstStructure *capsStruct = NULL;
+
+            g_object_get( G_OBJECT(ctx->baseObj.bin), "filter-caps", &caps, NULL );
+
+            if( !caps )
+            {
+                DEBUG_ERR("Cannot receive caps (filter-caps) from camerabin!");
+                DEBUG_API("<-XAVideoPostProcessingItfAdapt_Commit - XA_RESULT_INTERNAL_ERROR");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            capsCount = gst_caps_get_size( caps );
+
+            for( iterator= 0; iterator < capsCount; iterator++ )
+            {
+                capsStruct = gst_caps_get_structure( caps, iterator );
+                if( capsStruct )
+                {
+                    if( !gst_structure_get_int( capsStruct, "width", &videoWidth ) )
+                    {
+                        DEBUG_ERR("Could not get width from filter-caps");
+                        videoWidth = TEST_VIDEO_WIDTH;
+                    }
+                    if( !gst_structure_get_int( capsStruct, "height", &videoHeight) )
+                    {
+                        DEBUG_ERR("Could not get height from filter-caps");
+                        videoHeight = TEST_VIDEO_HEIGHT;
+                    }
+                    DEBUG_INFO_A2("videoWidth:%d, videoHeight:%d",videoWidth,videoHeight);
+                }
+            }
+        }
+        else
+        {
+            GstCaps* negcapas=NULL;
+            videoPad = gst_element_get_pad( col1, "src" );
+            negcapas = gst_pad_get_negotiated_caps( GST_PAD(videoPad) );
+            if ( negcapas )
+            {
+                if( !gst_video_get_size( videoPad, &videoWidth, &videoHeight ) )
+                {
+                    DEBUG_ERR("WARN: Cannot receive video size, using defaults");
+                    videoWidth = TEST_VIDEO_WIDTH;
+                    videoHeight = TEST_VIDEO_HEIGHT;
+                }
+            }
+            else
+            {
+				videoWidth = TEST_VIDEO_WIDTH;
+				videoHeight = TEST_VIDEO_HEIGHT;
+            }
+        }
+
+        DEBUG_INFO_A2("Received video frame info, videoWidth:%d, videoHeight:%d",videoWidth,videoHeight);
+        cropLeft = (gint)pSrcRect->left;
+        cropTop = (gint)pSrcRect->top;
+        cropRight = videoWidth - ((gint)pSrcRect->left + (gint)pSrcRect->width);
+        cropBottom = videoHeight - ((gint)pSrcRect->top + (gint)pSrcRect->height);
+        DEBUG_INFO_A4("Crop values - cropLeft:%d ,cropTop:%d,cropRight:%d,cropBottom:%d", cropLeft,cropTop,cropRight,cropBottom);
+
+        if( cropBottom >= 0 && cropLeft >=0 && cropRight >= 0  && cropTop >= 0 )
+        {
+            g_object_set(G_OBJECT(cropElement), "bottom",cropBottom, NULL);
+            g_object_set(G_OBJECT(cropElement), "left", cropLeft, NULL);
+            g_object_set(G_OBJECT(cropElement), "right", cropRight, NULL);
+            g_object_set(G_OBJECT(cropElement), "top", cropTop, NULL);
+        }
+        else
+        {
+            if( cropLeft > videoWidth || cropLeft < 0 ||
+                cropRight > videoWidth || cropRight < 0 ||
+                cropBottom > videoHeight || cropBottom < 0 ||
+                cropTop > videoHeight || cropTop < 0)
+            {
+                DEBUG_INFO("Cropped params out of original frame.");
+            }
+        }
+    }
+
+    if(rotateElement && isRotate)
+    {
+        DEBUG_INFO("Start rotating!");
+
+        /* calculate rotation */
+        newRotation = tempRotation + rotation;
+
+        if( newRotation > ROTATION_RATIO || newRotation < ROTATION_RATIO_NEG )
+        {
+            newRotation = newRotation % ROTATION_RATIO;
+        }
+
+        /* Set rotation */
+        switch(newRotation)
+        {
+            case 0:
+            {
+                /* no rotation */
+                DEBUG_INFO("Set rotation FLIP_NONE");
+                g_object_set(G_OBJECT(rotateElement), "method", FLIP_NONE, NULL);
+                break;
+            }
+            case 90000:
+            case -270000:
+            {
+                /* rotation 90 degree */
+                DEBUG_INFO("Set rotation 90 degrees");
+                g_object_set(G_OBJECT(rotateElement), "method", FLIP_CLOCKWISE, NULL);
+                break;
+            }
+            case 180000:
+            case -180000:
+            {
+                /* rotation 180 degree */
+                DEBUG_INFO("Set rotation 180 degrees");
+                g_object_set(G_OBJECT(rotateElement), "method", FLIP_ROTATE_180, NULL);
+                break;
+            }
+            case 270000:
+            case -90000:
+            {
+                /* rotation 270 degree */
+                DEBUG_INFO("Set rotation 270 degrees");
+                g_object_set(G_OBJECT(rotateElement), "method", FLIP_COUNTERCLOCKWISE, NULL);
+                break;
+            }
+            case 360000:
+            case -360000:
+            {
+                /* rotation 360 degree */
+                DEBUG_INFO("Set rotation 360 degrees");
+                g_object_set(G_OBJECT(rotateElement), "method", FLIP_NONE, NULL);
+                break;
+            }
+            default:
+            {
+                /* no rotation */
+                DEBUG_INFO("Set rotation default (FLIP_NONE) degree");
+                g_object_set(G_OBJECT(rotateElement), "method", FLIP_NONE, NULL);
+                break;
+            }
+        }
+
+        /* Store current rotate value */
+        if( bCtx->ctxId == XAMediaPlayerAdaptation )
+        {
+            XAMediaPlayerAdaptationCtx* ctx = (XAMediaPlayerAdaptationCtx*) bCtx;
+            ctx->curRotation = newRotation;
+        }
+        if( bCtx->ctxId == XAMediaRecorderAdaptation )
+        {
+            XAMediaRecorderAdaptationCtx* ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+            ctx->curRotation = newRotation;
+        }
+        if( bCtx->ctxId == XACameraAdaptation )
+        {
+            XACameraAdaptationCtx* ctx = (XACameraAdaptationCtx*) bCtx;
+            ctx->curRotation = newRotation;
+        }
+    }
+
+    if(mirrorElement && isMirror)
+    {
+        /* solve new mirror state */
+        switch(mirror)
+        {
+            case XA_VIDEOMIRROR_NONE:
+            {
+                newMirror = tempMirror;
+                break;
+            }
+            case XA_VIDEOMIRROR_VERTICAL:
+            {
+                if( tempMirror == XA_VIDEOMIRROR_VERTICAL )
+                {
+                    newMirror = XA_VIDEOMIRROR_NONE;
+                }
+                else if( tempMirror == XA_VIDEOMIRROR_HORIZONTAL )
+                {
+                    newMirror = XA_VIDEOMIRROR_BOTH;
+                }
+                else if( tempMirror == XA_VIDEOMIRROR_BOTH )
+                {
+                    newMirror = XA_VIDEOMIRROR_HORIZONTAL;
+                }
+                else
+                {
+                    newMirror = XA_VIDEOMIRROR_VERTICAL;
+                }
+                break;
+            }
+            case XA_VIDEOMIRROR_HORIZONTAL:
+            {
+                if( tempMirror == XA_VIDEOMIRROR_VERTICAL )
+                {
+                    newMirror = XA_VIDEOMIRROR_BOTH;
+                }
+                else if( tempMirror == XA_VIDEOMIRROR_HORIZONTAL )
+                {
+                    newMirror = XA_VIDEOMIRROR_NONE;
+                }
+                else if( tempMirror == XA_VIDEOMIRROR_BOTH )
+                {
+                    newMirror = XA_VIDEOMIRROR_VERTICAL;
+                }
+                else
+                {
+                    newMirror = XA_VIDEOMIRROR_HORIZONTAL;
+                }
+                break;
+            }
+            case XA_VIDEOMIRROR_BOTH:
+            {
+                if( tempMirror == XA_VIDEOMIRROR_VERTICAL )
+                {
+                    newMirror = XA_VIDEOMIRROR_HORIZONTAL;
+                }
+                else if( tempMirror == XA_VIDEOMIRROR_HORIZONTAL )
+                {
+                    newMirror = XA_VIDEOMIRROR_VERTICAL;
+                }
+                else if( tempMirror == XA_VIDEOMIRROR_BOTH )
+                {
+                    newMirror = XA_VIDEOMIRROR_NONE;
+                }
+                else
+                {
+                    newMirror = XA_VIDEOMIRROR_BOTH;
+                }
+                break;
+            }
+            default:
+                break;
+        }
+
+
+        DEBUG_INFO("Start mirroring!");
+        /* Set mirror */
+        switch(newMirror)
+        {
+            case XA_VIDEOMIRROR_NONE:
+            {
+                /* none */
+                DEBUG_INFO("Set mirror none");
+                g_object_set(G_OBJECT(mirrorElement), "method", FLIP_NONE, NULL);
+                break;
+            }
+            case XA_VIDEOMIRROR_VERTICAL:
+            {
+                /* vertical mirror */
+                DEBUG_INFO("Set mirror vertical");
+                g_object_set(G_OBJECT(mirrorElement), "method", FLIP_VERTICAL, NULL);
+                break;
+            }
+            case XA_VIDEOMIRROR_HORIZONTAL:
+            {
+                /* horizontal mirror */
+                DEBUG_INFO("Set mirror horizontal");
+                g_object_set(G_OBJECT(mirrorElement), "method", FLIP_HORIZONTAL, NULL);
+                break;
+            }
+            case XA_VIDEOMIRROR_BOTH:
+            {
+                /* both mirror */
+                DEBUG_INFO("Set mirror vertical and horizontal");
+                g_object_set(G_OBJECT(mirrorElement), "method", FLIP_ROTATE_180, NULL);
+                break;
+            }
+            default:
+            {
+                /* Default no mirroring */
+                g_object_set(G_OBJECT(mirrorElement), "method", FLIP_NONE, NULL);
+                break;
+            }
+        }
+
+        /* Store current mirror state */
+        if( bCtx->ctxId == XAMediaPlayerAdaptation )
+        {
+            XAMediaPlayerAdaptationCtx* ctx = (XAMediaPlayerAdaptationCtx*) bCtx;
+            ctx->curMirror = newMirror;
+        }
+        if( bCtx->ctxId == XAMediaRecorderAdaptation )
+        {
+            XAMediaRecorderAdaptationCtx* ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+            ctx->curMirror = newMirror;
+        }
+        if( bCtx->ctxId == XACameraAdaptation )
+        {
+            XACameraAdaptationCtx* ctx = (XACameraAdaptationCtx*) bCtx;
+            ctx->curMirror = newMirror;
+        }
+    }
+
+    /* Set scale */
+    if ( isScaleOptions || isDestRect || isSrcRect )
+    {
+		switch( scaleOptions )
+		{
+
+			case XA_VIDEOSCALE_STRETCH:
+			{
+				DEBUG_INFO("XA_VIDEOSCALE_STRETCH");
+				/* The source and destination rectangle's width and height params are used to calculate
+				 * the scaling factors independently. Aspect ratio is ignored. */
+				if (pDestRect)
+				{
+					if (bCtx->ctxId != XAMediaRecorderAdaptation)
+					{
+						GstPad *pad = NULL;
+						GstCaps* simplecaps = NULL;
+						g_object_set ( G_OBJECT(sink), "force-aspect-ratio", FALSE, NULL);
+						simplecaps = gst_caps_new_simple("video/x-raw-rgb",
+											"width", G_TYPE_INT, pDestRect->width,
+											"height", G_TYPE_INT, pDestRect->height,
+											"framerate", GST_TYPE_FRACTION, 0,1,
+											NULL);
+						DEBUG_API_A1("caps: %s",gst_caps_to_string(simplecaps));
+						pad = gst_element_get_static_pad(GST_ELEMENT(sink),"sink");
+						if (!gst_pad_set_caps(pad, simplecaps))
+						{
+							DEBUG_INFO("Stubbed at this point");
+							DEBUG_INFO("Cannot set destrect size during XA_VIDEOSCALE_STRETCH!");
+							DEBUG_API("<-XAVideoPostProcessingItfAdapt_Commit - XA_VIDEOSCALE_STRETCH");
+							return XA_RESULT_SUCCESS;
+						}
+						DEBUG_API_A1("ret: %lu",ret);
+					}
+					else
+					{
+						GstCaps* simplecaps = NULL;
+						GstPad *pad = NULL;
+						if ( !scale )
+						{
+							DEBUG_ERR("Could not get scaling element from pipeline!");
+							DEBUG_API("<-XAVideoPostProcessingItfAdapt_Commit - XA_RESULT_INTERNAL_ERROR");
+							return XA_RESULT_INTERNAL_ERROR;
+						}
+						simplecaps = gst_caps_new_simple("video/x-raw-yuv",
+											"width", G_TYPE_INT, pDestRect->width,
+											"height", G_TYPE_INT, pDestRect->height,
+											"framerate", GST_TYPE_FRACTION, 0,1,
+											NULL);
+						DEBUG_API_A1("caps: %s",gst_caps_to_string(simplecaps));
+						pad = gst_element_get_static_pad(GST_ELEMENT(scale),"src");
+						if (!gst_pad_set_caps(pad, simplecaps))
+						{
+							DEBUG_INFO("Stubbed at this point");
+							DEBUG_INFO("Cannot set destrect size during XA_VIDEOSCALE_STRETCH!");
+							DEBUG_API("<-XAVideoPostProcessingItfAdapt_Commit - XA_VIDEOSCALE_STRETCH");
+							return XA_RESULT_SUCCESS;
+						}
+
+					}
+				}
+				DEBUG_INFO("XA_VIDEOSCALE_STRETCH Done");
+
+				break;
+			}
+			case XA_VIDEOSCALE_FIT:
+			{
+				DEBUG_INFO("XA_VIDEOSCALE_FIT");
+				/* The miminum scale factor between the destination rectangle's width over the
+				 * source rectangle's source rectangle's width and the destination rectangle's height over
+				 * the source rectangle's height is used. Aspect ratio is maintained. Frame is centered */
+				if (pDestRect)
+				{
+					if (bCtx->ctxId != XAMediaRecorderAdaptation)
+					{
+						GstPad *pad = NULL;
+						GstCaps* simplecaps = NULL;
+						g_object_set ( G_OBJECT(sink), "force-aspect-ratio", TRUE, NULL);
+						simplecaps = gst_caps_new_simple("video/x-raw-rgb",
+											"width", G_TYPE_INT, pDestRect->width,
+											"height", G_TYPE_INT, pDestRect->height,
+											"framerate", GST_TYPE_FRACTION, 0,1,
+											NULL);
+						DEBUG_API_A1("caps: %s",gst_caps_to_string(simplecaps));
+						pad = gst_element_get_static_pad(GST_ELEMENT(sink),"sink");
+						if (!gst_pad_set_caps(pad, simplecaps))
+						{
+							DEBUG_INFO("Stubbed at this point");
+							DEBUG_INFO("Cannot set destrect size during XA_VIDEOSCALE_FIT!");
+							DEBUG_API("<-XAVideoPostProcessingItfAdapt_Commit - XA_VIDEOSCALE_FIT");
+							return XA_RESULT_SUCCESS;
+						}
+					}
+					else
+					{
+						GstPad *videoScalePad = NULL;
+						GstCaps *negcaps = NULL;
+						gint videoScalePadHeight = 0, videoScalePadWidth = 0;
+						gfloat scaleFactorWidth = 0;
+						gfloat scaleFactorHeight = 0;
+						gfloat scaleFactor = 0;
+						videoScalePad = gst_element_get_pad( col1, "src" );
+						negcaps = gst_pad_get_negotiated_caps( GST_PAD(videoScalePad) );
+						if ( negcaps )
+						{
+							if( !gst_video_get_size( videoScalePad, &videoScalePadWidth, &videoScalePadHeight ) )
+							{
+								DEBUG_ERR("Cannot receive current cropscalevideo size!");
+								DEBUG_API("<-XAVideoPostProcessingItfAdapt_Commit - XA_RESULT_INTERNAL_ERROR");
+								return XA_RESULT_INTERNAL_ERROR;
+							}
+						}
+						else
+						{
+							DEBUG_ERR("No negotiated caps in col1:src!");
+							DEBUG_API("<-XAVideoPostProcessingItfAdapt_Commit");
+							return XA_RESULT_SUCCESS;
+						}
+						if (pSrcRect->width != 0 && pSrcRect->height != 0)
+						{
+							scaleFactorWidth = (gfloat)videoScalePadWidth / (gfloat)pSrcRect->width;
+							scaleFactorHeight = (gfloat)videoScalePadHeight / (gfloat)pSrcRect->height;
+							if (scaleFactorWidth < scaleFactorHeight)
+							{
+								scaleFactor = scaleFactorWidth;
+							}
+							else
+							{
+								scaleFactor = scaleFactorHeight;
+							}
+
+							cropscaleBottom = (gint)(pSrcRect->height*scaleFactor - videoScalePadHeight)/2;
+							cropscaleLeft = (gint)(pSrcRect->width*scaleFactor - videoScalePadWidth)/2;
+							if (cropscaleLeft > 0){
+								cropscaleLeft *= -1;
+							}
+							cropscaleRight = cropscaleLeft;
+							if (cropscaleBottom > 0){
+								cropscaleBottom *= -1;
+							}
+							cropscaleTop = cropscaleBottom;
+							g_object_set (G_OBJECT (boxElement), "bottom", cropscaleBottom , NULL);
+							g_object_set (G_OBJECT (boxElement), "right", cropscaleRight, NULL);
+							g_object_set (G_OBJECT (boxElement), "left", cropscaleLeft, NULL);
+							g_object_set (G_OBJECT (boxElement), "top", cropscaleTop, NULL);
+						}
+					}
+				}
+				DEBUG_INFO("XA_VIDEOSCALE_FIT done");
+
+				break;
+			}
+			case XA_VIDEOSCALE_CROP:
+			{
+				DEBUG_INFO("XA_VIDEOSCALE_CROP");
+				/* The maximum scale factor between the destination rectangle's width over the source
+				 * rectangle's width and destination rectangle's height over the source rectangle's
+				 * height is used. Aspect ratio is maintained. Frame is centered. */
+				if( pDestRect && pSrcRect )
+				{
+					GstPad *videoScalePad = NULL;
+					GstCaps *negcaps = NULL;
+					gint videoScalePadHeight = 0, videoScalePadWidth = 0;
+					videoScalePad = gst_element_get_pad( col1, "src" );
+					negcaps = gst_pad_get_negotiated_caps( GST_PAD(videoScalePad) );
+					if ( negcaps )
+					{
+						if( !gst_video_get_size( videoScalePad, &videoScalePadWidth, &videoScalePadHeight ) )
+						{
+							DEBUG_ERR("Cannot receive current cropscalevideo size!");
+							DEBUG_API("<-XAVideoPostProcessingItfAdapt_Commit - XA_RESULT_INTERNAL_ERROR");
+							return XA_RESULT_INTERNAL_ERROR;
+						}
+					}
+					else
+					{
+						DEBUG_ERR("No negotiated caps in col1:src!");
+						DEBUG_API("<-XAVideoPostProcessingItfAdapt_Commit");
+						return XA_RESULT_SUCCESS;
+					}
+
+					DEBUG_INFO_A2( "Received video scale frame info, videoScalePadWidth:%d, "
+									"videoScalePadHeight:%d",videoScalePadWidth,videoScalePadHeight);
+
+					if( pSrcRect->height > 0 && pSrcRect->width > 0 )
+					{
+						if( pSrcRect->height > pDestRect->height )
+						{
+							videoscaleHeight = pSrcRect->height;
+							if( pDestRect->top == 0)
+							{
+								cropscaleTop = ((videoscaleHeight - pDestRect->height)/2);
+								cropscaleBottom = ((videoscaleHeight - pDestRect->height)/2);
+							}
+							else
+							{
+								cropscaleTop = (pDestRect->top/2);
+								cropscaleBottom = (pDestRect->top/2);
+							}
+						}
+						else if( pDestRect->height > pSrcRect->height )
+						{
+							videoscaleHeight = pDestRect->height;
+							if( pDestRect->top == 0)
+							{
+								cropscaleTop = -((videoscaleHeight - pSrcRect->height)/2);
+								cropscaleBottom = -((videoscaleHeight - pSrcRect->height)/2);
+							}
+							else
+							{
+								cropscaleTop = -(pDestRect->top/2);
+								cropscaleBottom = -(pDestRect->top/2);
+							}
+						}
+						else if( pDestRect->height == pSrcRect->height )
+						{
+						}
+						else
+						{
+						}
+						if( pSrcRect->width > pDestRect->width )
+						{
+							if( pDestRect->left == 0 )
+							{
+								cropscaleLeft = ((gint)(pSrcRect->width -pDestRect->width)/2);
+								cropscaleRight = ((gint)(pSrcRect->width -pDestRect->width)/2);
+							}
+							else
+							{
+								cropscaleLeft = (pDestRect->left/2);
+								cropscaleRight = (pDestRect->left/2);
+							}
+						}
+						else if( pDestRect->width > pSrcRect->width )
+						{
+							if( pDestRect->left == 0 )
+							{
+								cropscaleLeft =-((gint)(pDestRect->width -pSrcRect->width)/2);
+								cropscaleRight =-((gint)(pDestRect->width -pSrcRect->width)/2);
+							}
+							else
+							{
+								cropscaleLeft = -(pDestRect->left/2);
+								cropscaleRight = -(pDestRect->left/2);
+							}
+						}
+						else if( pDestRect->width == pSrcRect->width )
+						{
+						}
+						else
+						{
+						}
+					}
+					else
+					{
+						DEBUG_ERR("Invalid rectangle values in source rectangles");
+						DEBUG_API("<-XAVideoPostProcessingItfAdapt_Commit, Exit with invalid source rectangle values");
+						return XA_RESULT_PARAMETER_INVALID;
+					}
+					if( pDestRect->width != pSrcRect->width && pDestRect->height != pSrcRect->height )
+					{
+						  DEBUG_INFO_A4("Crop values - cropscaleLeft:%d "
+										",cropscaleTop:%d,"
+										"cropscaleRight:%d,"
+										"cropscaleBottom:%d",
+										cropscaleLeft,
+										cropscaleTop,
+										cropscaleRight,
+										cropscaleBottom);
+						g_object_set (G_OBJECT (boxElement), "bottom",cropscaleBottom , NULL);
+						g_object_set (G_OBJECT (boxElement), "right", cropscaleRight, NULL);
+						g_object_set (G_OBJECT (boxElement), "left", cropscaleLeft, NULL);
+						g_object_set (G_OBJECT (boxElement), "top",cropscaleTop, NULL);
+					}
+				}
+				break;
+			}
+			default:
+				DEBUG_INFO("no scale options!");
+				break;
+		}
+    }
+
+    if(pDestRect && boxElement)
+    {
+        /* is background color black */
+        if((backgroundColor >> 8) & BLACK_BG_COLOR_MASK)
+        {
+            videoBackgroundColor = 0;
+        }
+        /* is background color green */
+        else if((backgroundColor >> 8) & GREEN_BG_COLOR_MASK)
+        {
+            videoBackgroundColor = 1;
+        }
+        /* is background color blue */
+        else if((backgroundColor >> 8) & BLUE_BG_COLOR_MASK)
+        {
+            videoBackgroundColor = 2;
+        }
+        else
+        {
+            /* by default black */
+            videoBackgroundColor = 0;
+        }
+
+        /* check alpha value. Gst support values 0 to 1 and XA 0 to 255 */
+        {
+            XAuint32 tempColor = 0;
+            tempColor = backgroundColor & ALPHA_VALUE_MASK;
+
+            alphaValue = (gdouble)(tempColor/ALPHA_VALUE_MASK);
+        }
+    }
+
+    if( dataSrc )
+    {
+        XAMediaType mediaType = XA_MEDIATYPE_UNKNOWN;
+        ret = XACommon_CheckDataSource(dataSrc, &mediaType);
+        if( ret == XA_RESULT_SUCCESS && mediaType == XA_MEDIATYPE_IMAGE )
+        {
+            gstOrigState = GST_STATE(bCtx->bin);
+
+            DEBUG_INFO_A1("Sending change state request to state %d", GST_STATE_READY);
+            gstRet = gst_element_set_state( GST_ELEMENT(bCtx->bin), GST_STATE_READY);
+            gstTmpState = GST_STATE(bCtx->bin);
+
+            DEBUG_INFO_A1("Sending change state request to state %d", gstOrigState);
+            gstRet = gst_element_set_state( GST_ELEMENT(bCtx->bin), gstOrigState);
+        }
+    }
+
+    DEBUG_API("<-XAVideoPostProcessingItfAdapt_Commit");
+    return ret;
+}
+/*
+ * XAresult XAVideoPostProcessingItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adapCtx)
+ * Description: Safety thread entry
+ */
+XAresult XAVideoPostProcessingItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adaptCtx)
+{
+    DEBUG_API("->XAVideoPostProcessingItfAdapt_ThreadEntry");
+    if((!adaptCtx ) ||( adaptCtx->ctxId != XAMediaPlayerAdaptation &&
+                        adaptCtx->ctxId != XAMediaRecorderAdaptation &&
+                        adaptCtx->ctxId != XACameraAdaptation ))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoPostProcessingItfAdapt_ThreadEntry");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+
+    }
+
+    if ( adaptCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaPlayer);
+    }
+    else if( adaptCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+    }
+    else if (adaptCtx->ctxId == XACameraAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+    }
+
+    DEBUG_API("<-XAVideoPostProcessingItfAdapt_ThreadEntry");
+    return XA_RESULT_SUCCESS;
+}
+/*
+ * XAresult XAVideoPostProcessingItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx)
+ * Description: Safety thread exit
+ */
+XAresult XAVideoPostProcessingItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx)
+{
+    DEBUG_API("->XAVideoPostProcessingItfAdapt_ThreadExit");
+    if((!adaptCtx ) ||( adaptCtx->ctxId != XAMediaPlayerAdaptation &&
+                        adaptCtx->ctxId != XAMediaRecorderAdaptation &&
+                        adaptCtx->ctxId != XACameraAdaptation ))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoPostProcessingItfAdapt_ThreadExit");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+
+    }
+
+    if ( adaptCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+    }
+    else if( adaptCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    }
+    else if (adaptCtx->ctxId == XACameraAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    }
+
+    DEBUG_API("<-XAVideoPostProcessingItfAdapt_ThreadExit");
+    return XA_RESULT_SUCCESS;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xavideopostprosessingitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAVIDEOPOSTPROSESSINGITFADAPTATION_H
+#define XAVIDEOPOSTPROSESSINGITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+#include "XAThreadSafety.h"
+/* MACROS */
+#define BLACK_BG_COLOR_MASK  0x00FFFFFF
+#define GREEN_BG_COLOR_MASK  0x0000FF00
+#define BLUE_BG_COLOR_MASK   0x000000FF
+#define ALPHA_VALUE_MASK     0x000000FF
+
+#define TEST_VIDEO_WIDTH     640
+#define TEST_VIDEO_HEIGHT    480
+
+#define ROTATION_RATIO       360000
+#define ROTATION_RATIO_NEG   -360000
+
+/* FUNCTIONS */
+XAresult XAVideoPostProcessingItfAdapt_IsArbitraryRotationSupported(XAAdaptationBaseCtx *bCtx,
+                                                                    XAboolean *pSupported);
+
+XAresult XAVideoPostProcessingItfAdapt_Commit(XAAdaptationBaseCtx *bCtx,
+                                              XAmillidegree rotation,
+                                              XAuint32 scaleOptions,
+                                              XAuint32 backgroundColor,
+                                              XAuint32 renderingHints,
+                                              const XARectangle *pSrcRect,
+                                              const XARectangle *pDestRect,
+                                              XAuint32 mirror,
+                                              XAboolean isMirror,
+                                              XAboolean isRotate,
+                                              XAboolean isDestRect,
+                                              XAboolean isSrcRect,
+                                              XAboolean isScaleOptions
+                                              );
+XAresult XAVideoPostProcessingItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adaptCtx);
+XAresult XAVideoPostProcessingItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx);
+#endif /* XAVIDEOPOSTPROSESSINGITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xavolumeitfadaptation.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,566 @@
+/*
+* 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 <gst.h>
+#include <mixer.h>
+#include "XAAdaptation.h"
+#include "XAVolumeItfAdaptation.h"
+#include "XAMediaPlayerAdaptCtx.h"
+#include "XAStaticCapsAdaptation.h"
+#include "XAOutputMixAdaptCtx.h"
+#include "XAMediaRecorderAdaptCtx.h"
+
+/*
+ * XAresult XAVolumeItfAdapt_FlushBin(XAAdaptationBaseCtx *ctx)
+ */
+XAresult XAVolumeItfAdapt_FlushBin(XAAdaptationBaseCtx *ctx)
+{
+    DEBUG_API("->XAVolumeItfAdapt_FlushBin");
+    if(!ctx || ( ctx->ctxId != XAMediaPlayerAdaptation ))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    if (GST_STATE(ctx->bin) != GST_STATE_PLAYING)
+    {
+        gint64 position = 0;
+        GstFormat format = GST_FORMAT_TIME;
+
+        gst_element_query_position( GST_ELEMENT(ctx->bin), &format, &position  ) ;
+
+        XAAdaptationBase_PrepareAsyncWait(ctx);
+        /* in effect seeks to current position and flushing the buffer, due to
+         * gstreamer implementation actual position might change, if stopped, seek to beginning
+         */
+        if(!gst_element_seek( ctx->bin, ((XAMediaPlayerAdaptationCtx*)ctx)->playrate, GST_FORMAT_TIME,
+                            GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_ACCURATE,
+                            GST_SEEK_TYPE_SET, position,
+                            GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
+        {
+            DEBUG_ERR("WARN: gst reports seek not handled");
+        }
+        /* flushed seeks always asynchronous */
+        XAAdaptationBase_StartAsyncWait(ctx);
+        DEBUG_INFO("Bin flushed.");
+        ctx->waitingasyncop = XA_BOOLEAN_FALSE;
+    }
+    DEBUG_API("<-XAVolumeItfAdapt_FlushBin");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAVolumeItfAdapt_SetVolumeLevel(void *ctx, AdaptationContextIDS ctx->ctxId,
+ *                                          XAmillibel level)
+ * @param void *ctx - Adaptation context, this will be casted to correct type regarding to contextID
+ * XAmillibel level - Requested volume level, in between XA_MILLIBEL_MIN and XA_MILLIBEL_MAX
+ * @return XAresult ret - Success value
+ */
+XAresult XAVolumeItfAdapt_SetVolumeLevel(XAAdaptationBaseCtx *ctx, XAmillibel level)
+{
+    GstElement *vol=NULL, *audiopp=NULL;
+    gdouble gstVolume = 0;
+    XAmillibel tempVolumeLevel = 0;
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API_A1("->XAVolumeItfAdapt_SetVolumeLevel (level %d)", level);
+    if(!ctx || ( ctx->ctxId != XAMediaPlayerAdaptation &&
+                 ctx->ctxId != XAMediaRecorderAdaptation &&
+                 ctx->ctxId != XAOutputMixAdaptation) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfAdapt_SetVolumeLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( level <= MIN_SUPPORT_VOLUME_LEVEL )
+    {
+        tempVolumeLevel = MIN_SUPPORT_VOLUME_LEVEL;
+    }
+    else if( level >= MAX_SUPPORT_VOLUME_LEVEL )
+    {
+        tempVolumeLevel = MAX_SUPPORT_VOLUME_LEVEL;
+    }
+    else
+    {
+        tempVolumeLevel = level;
+    }
+    gstVolume = ( ( (gdouble)(VOLUME_LEVEL_RATIO + tempVolumeLevel)/ VOLUME_LEVEL_RATIO) );
+
+    if ( ctx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XAMediaPlayerAdaptationCtx* context = (XAMediaPlayerAdaptationCtx*) ctx;
+        audiopp = gst_bin_get_by_name( GST_BIN(context->baseObj.bin), "audiopp" );
+        if(audiopp)
+        {
+            vol = gst_bin_get_by_name( GST_BIN(audiopp), "pp_vol" );
+        }
+        if(vol)
+        {
+            DEBUG_INFO_A1("Setting gst level to %f",gstVolume);
+            g_object_set( G_OBJECT(vol), "volume", (gdouble)gstVolume, NULL );
+
+            XAVolumeItfAdapt_FlushBin(ctx);
+        }
+        else
+        {
+            DEBUG_ERR("Could not find gst volume controller element!!");
+        }
+    }
+    else if ( ctx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XAMediaRecorderAdaptationCtx* context = (XAMediaRecorderAdaptationCtx*) ctx;
+        audiopp = gst_bin_get_by_name( GST_BIN(context->baseObj.bin), "audiopp" );
+        if(audiopp)
+        {
+            vol = gst_bin_get_by_name( GST_BIN(audiopp), "pp_vol" );
+        }
+        if(vol)
+        {
+            DEBUG_INFO_A1("Setting gst level to %f",gstVolume);
+            g_object_set( G_OBJECT(vol), "volume", (gdouble)gstVolume, NULL );
+        }
+        else
+        {
+            DEBUG_ERR("Could not find gst volume controller element!!");
+        }
+    }
+    else if (ctx->ctxId == XAOutputMixAdaptation )
+    {
+        XAOutputMixAdaptationCtx* context = (XAOutputMixAdaptationCtx*) ctx;
+        guint iterator = 0;
+        for ( iterator = 0; iterator < context->connectedObjects->len; iterator++ )
+        {
+            GstBin* basebin = NULL;
+            XAAdaptationBaseCtx* bCtx = g_array_index(context->connectedObjects,XAOMixAdaptConnObj,iterator).ctx;
+            if(!bCtx)
+            {
+                DEBUG_ERR_A1("Context in connected objects array (index %u) is NULL!", iterator);
+                DEBUG_API("<-XAVolumeItfAdapt_SetVolumeLevel");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            basebin = GST_BIN(bCtx->bin);
+            if(!basebin)
+            {
+                DEBUG_ERR_A1("Bin in connected objects context (index %u) is NULL!", iterator);
+                DEBUG_API("<-XAVolumeItfAdapt_SetVolumeLevel");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            audiopp = gst_bin_get_by_name( basebin, "audiopp" );
+            if(audiopp)
+            {
+                vol = gst_bin_get_by_name( GST_BIN(audiopp), "pp_vol" );
+            }
+            if(vol)
+            {
+                DEBUG_INFO_A1("Setting gst level to %f",gstVolume);
+                g_object_set( G_OBJECT(vol), "volume", (gdouble)gstVolume, NULL );
+
+                XAVolumeItfAdapt_FlushBin(bCtx);
+            }
+            else
+            {
+                DEBUG_ERR_A1("Could not find gst volume controller for player %u!!", iterator);
+            }
+        }
+    }
+    DEBUG_API("<-XAVolumeItfAdapt_SetVolumeLevel");
+    return res;
+}
+
+/*
+ * XAresult XAVolumeItfAdapt_GetMaxVolumeLevel(void *ctx, AdaptationContextIDS ctx->ctxId,
+                                            XAmillibel *pMaxLevel)
+ * @param void *ctx - Adaptation context, this will be casted to correct type regarding to contextID value given as 2nd parameter
+ * @param AdaptationContextIDS ctx->ctxId - Type specifier for context, this will be used to cast ctx pointer to correct type.
+ * XAmillibel *pMaxLevel - Maximum volume level
+ * @return XAresult ret - Success value
+ */
+XAresult XAVolumeItfAdapt_GetMaxVolumeLevel(XAAdaptationBaseCtx *ctx, XAmillibel *pMaxLevel)
+{
+    DEBUG_API("->XAVolumeItfAdapt_GetMaxVolumeLevel");
+
+    if(!ctx || ( ctx->ctxId != XAMediaPlayerAdaptation &&
+                 ctx->ctxId != XAMediaRecorderAdaptation &&
+                 ctx->ctxId != XAOutputMixAdaptation) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfAdapt_GetMaxVolumeLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pMaxLevel = MAX_SUPPORT_VOLUME_LEVEL;
+
+    DEBUG_API("<-XAVolumeItfAdapt_GetMaxVolumeLevel");
+
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAVolumeItfAdapt_SetMute(void *ctx, AdaptationContextIDS ctx->ctxId, XAboolean mute)
+ * @param void *ctx - Adaptation context, this will be casted to correct type regarding to contextID value given as 2nd parameter
+ * @param AdaptationContextIDS ctx->ctxId - Type specifier for context, this will be used to cast ctx pointer to correct type.
+ * @param XAboolean mute - status of mute value
+ * @return XAresult ret - Success value
+ */
+XAresult XAVolumeItfAdapt_SetMute(XAAdaptationBaseCtx *ctx, XAboolean mute)
+{
+    GstElement *vol=NULL, *audiopp=NULL;
+    gboolean gmute = 0;
+
+    DEBUG_API("->XAVolumeItfAdapt_SetMute");
+    if(!ctx || ( ctx->ctxId != XAMediaPlayerAdaptation &&
+                 ctx->ctxId != XAMediaRecorderAdaptation &&
+                 ctx->ctxId != XAOutputMixAdaptation ) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfAdapt_SetMute");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if ( ctx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XAMediaPlayerAdaptationCtx* context = (XAMediaPlayerAdaptationCtx*) ctx;
+        context->mute = mute;
+        audiopp = gst_bin_get_by_name( GST_BIN(context->baseObj.bin), "audiopp" );
+        if(audiopp)
+        {
+            vol = gst_bin_get_by_name( GST_BIN(audiopp), "pp_vol" );
+        }
+        if(vol)
+        {
+            if ( mute )
+            {
+                gmute = 1;
+            }
+            else
+            {
+                gmute = 0;
+            }
+            g_object_set( G_OBJECT(vol), "mute", gmute, NULL );
+        }
+        else
+        {
+            DEBUG_ERR("Could not find gst volume controller element!!");
+        }
+    }
+    else if ( ctx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XAMediaRecorderAdaptationCtx* context = (XAMediaRecorderAdaptationCtx*) ctx;
+        context->mute = mute;
+        audiopp = gst_bin_get_by_name( GST_BIN(context->baseObj.bin), "audiopp" );
+        if(audiopp)
+        {
+            vol = gst_bin_get_by_name( GST_BIN(audiopp), "pp_vol" );
+        }
+        if(vol)
+        {
+            if ( mute )
+            {
+                gmute = 1;
+            }
+            else
+            {
+                gmute = 0;
+            }
+            g_object_set( G_OBJECT(vol), "mute", gmute, NULL );
+        }
+        else
+        {
+            DEBUG_ERR("Could not find gst volume controller element!!");
+        }
+    }
+    else if ( ctx->ctxId == XAOutputMixAdaptation )
+    {
+        XAOutputMixAdaptationCtx* context = (XAOutputMixAdaptationCtx*) ctx;
+        guint iterator = 0;
+        context->mute = mute;
+        for ( iterator = 0; iterator < context->connectedObjects->len; iterator++ )
+        {
+            GstBin* basebin = NULL;
+            XAAdaptationBaseCtx* bCtx = g_array_index(context->connectedObjects,XAOMixAdaptConnObj,iterator).ctx;
+            if(!bCtx)
+            {
+                DEBUG_ERR_A1("Context in connected objects array (index %u) is NULL!", iterator);
+                DEBUG_API("<-XAVolumeItfAdapt_SetMute");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            basebin = GST_BIN(bCtx->bin);
+            if(!basebin)
+            {
+                DEBUG_ERR_A1("Bin in connected objects context (index %u) is NULL!", iterator);
+                DEBUG_API("<-XAVolumeItfAdapt_SetMute");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            audiopp = gst_bin_get_by_name( basebin, "audiopp" );
+            if(audiopp)
+            {
+                vol = gst_bin_get_by_name( GST_BIN(audiopp), "pp_vol" );
+            }
+            if(vol)
+            {
+                if ( mute )
+                {
+                    gmute = 1;
+                }
+                else
+                {
+                    gmute = 0;
+                }
+                g_object_set( G_OBJECT(vol), "mute", gmute, NULL );
+            }
+            else
+            {
+                DEBUG_ERR_A1("Could not find gst volume controller for player %u!!", iterator);
+            }
+        }
+    }
+    DEBUG_API("<-XAVolumeItfAdapt_SetMute");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAVolumeItfAdapt_EnableStereoPosition(XAAdaptationBaseCtx *ctx, XAboolean enable)
+ * @param XAAdaptationBaseCtx *ctx - Adaptation context
+ * @param XAboolean enable - Enable Stereo Position
+ * @return XAresult - Success value
+ */
+XAresult XAVolumeItfAdapt_EnableStereoPosition(XAAdaptationBaseCtx *ctx, XAboolean enable)
+{
+    DEBUG_API("->XAVolumeItfAdapt_EnableStereoPosition");
+
+    if(!ctx || ( ctx->ctxId != XAMediaPlayerAdaptation &&
+                 ctx->ctxId != XAMediaRecorderAdaptation &&
+                 ctx->ctxId != XAOutputMixAdaptation ) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfAdapt_EnableStereoPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if ( ctx->ctxId == XAMediaPlayerAdaptation  )
+    {
+        XAMediaPlayerAdaptationCtx* context = (XAMediaPlayerAdaptationCtx*) ctx;
+        context->isStereoPosition = enable;
+    }
+    else if ( ctx->ctxId == XAMediaRecorderAdaptation  )
+    {
+        XAMediaRecorderAdaptationCtx* context = (XAMediaRecorderAdaptationCtx*) ctx;
+        context->isStereoPosition = enable;
+    }
+    else if ( ctx->ctxId == XAOutputMixAdaptation  )
+    {
+        XAOutputMixAdaptationCtx* context = (XAOutputMixAdaptationCtx*) ctx;
+        context->isStereoPosition = enable;
+    }
+
+    DEBUG_API("<-XAVolumeItfAdapt_EnableStereoPosition");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAVolumeItfAdapt_SetStereoPosition(XAAdaptationBaseCtx *ctx, XApermille stereoPosition)
+ * @param XAAdaptationBaseCtx *ctx - Adaptation context
+ * @param XApermille stereoPosition - Stereo Position to be set
+ * @return XAresult - Success value
+ */
+XAresult XAVolumeItfAdapt_SetStereoPosition(XAAdaptationBaseCtx *ctx,
+                                            XApermille stereoPosition)
+{
+    GstElement *audiopp = NULL, *pan = NULL;
+    gfloat gstPosition = 0.0;
+
+    DEBUG_API("->XAVolumeItfAdapt_SetStereoPosition");
+    if(!ctx || ( ctx->ctxId != XAMediaPlayerAdaptation &&
+                 ctx->ctxId != XAMediaRecorderAdaptation &&
+                 ctx->ctxId != XAOutputMixAdaptation) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfAdapt_SetStereoPosition");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    gstPosition = ( (gfloat)stereoPosition / STEREO_POSITION_RATIO );
+
+    if ( ctx->ctxId == XAMediaPlayerAdaptation  )
+    {
+        XAMediaPlayerAdaptationCtx* context = (XAMediaPlayerAdaptationCtx*) ctx;
+
+        audiopp = gst_bin_get_by_name( GST_BIN(context->baseObj.bin), "audiopp");
+        if( !audiopp )
+        {
+            DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+            DEBUG_API("<-XAVolumeItfAdapt_SetStereoPosition");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+
+        pan = gst_bin_get_by_name( GST_BIN(audiopp), "pp_pan" );
+        if( !pan )
+        {
+            DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+            DEBUG_API("<-XAVolumeItfAdapt_SetStereoPosition");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+
+        g_object_set( G_OBJECT(pan), "panorama", gstPosition, NULL );
+
+        XAVolumeItfAdapt_FlushBin(ctx);
+    }
+    else if ( ctx->ctxId == XAMediaRecorderAdaptation  )
+    {
+        XAMediaRecorderAdaptationCtx* context = (XAMediaRecorderAdaptationCtx*) ctx;
+
+        audiopp = gst_bin_get_by_name( GST_BIN(context->baseObj.bin), "audiopp");
+        if( !audiopp )
+        {
+            DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+            DEBUG_API("<-XAVolumeItfAdapt_SetStereoPosition");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+
+        pan = gst_bin_get_by_name( GST_BIN(audiopp), "pp_pan" );
+        if( !pan )
+        {
+            DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+            DEBUG_API("<-XAVolumeItfAdapt_SetStereoPosition");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+
+        g_object_set( G_OBJECT(pan), "panorama", gstPosition, NULL );
+    }
+
+    else if ( ctx->ctxId == XAOutputMixAdaptation )
+    {
+        XAOutputMixAdaptationCtx* context = (XAOutputMixAdaptationCtx*) ctx;
+        guint iterator = 0;
+        for ( iterator = 0; iterator < context->connectedObjects->len; iterator++ )
+        {
+            GstBin* basebin = NULL;
+            XAAdaptationBaseCtx* bCtx = g_array_index(context->connectedObjects,XAOMixAdaptConnObj,iterator).ctx;
+            if(!bCtx)
+            {
+                DEBUG_ERR_A1("Context in connected objects array (index %u) is NULL!", iterator);
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            basebin = GST_BIN(bCtx->bin);
+            if(!basebin)
+            {
+                DEBUG_ERR_A1("Bin in connected objects context (index %u) is NULL!", iterator);
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+
+            audiopp = gst_bin_get_by_name( basebin, "audiopp" );
+            if( !audiopp )
+            {
+                DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+                DEBUG_API("<-XAVolumeItfAdapt_SetStereoPosition");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+            pan = gst_bin_get_by_name( GST_BIN(audiopp), "pp_pan" );
+            if( !pan )
+            {
+                DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+                DEBUG_API("<-XAVolumeItfAdapt_SetStereoPosition");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+            g_object_set( G_OBJECT(pan), "panorama", gstPosition, NULL );
+
+            XAVolumeItfAdapt_FlushBin(bCtx);
+        }
+    }
+
+    DEBUG_API("<-XAVolumeItfAdapt_SetStereoPosition");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAVolumeItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adapCtx)
+ * Description: Safety thread entry
+ */
+XAresult XAVolumeItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adaptCtx)
+{
+    DEBUG_API("->XAVolumeItfAdapt_ThreadEntry");
+    if((!adaptCtx ) ||( adaptCtx->ctxId != XAMediaPlayerAdaptation &&
+                        adaptCtx->ctxId != XAMediaRecorderAdaptation &&
+                        adaptCtx->ctxId != XAOutputMixAdaptation ))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfAdapt_ThreadEntry");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+
+    }
+
+    if ( adaptCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaPlayer);
+    }
+    else if( adaptCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+    }
+    else if (adaptCtx->ctxId == XAOutputMixAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_ENTRY(XATSOutputMix);
+    }
+
+    DEBUG_API("<-XAVolumeItfAdapt_ThreadEntry");
+    return XA_RESULT_SUCCESS;
+}
+/*
+ * XAresult XAVolumeItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx)
+ * Description: Safety thread exit
+ */
+XAresult XAVolumeItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx)
+{
+    DEBUG_API("->XAVolumeItfAdapt_ThreadExit");
+    if((!adaptCtx ) ||( adaptCtx->ctxId != XAMediaPlayerAdaptation &&
+                        adaptCtx->ctxId != XAMediaRecorderAdaptation &&
+                        adaptCtx->ctxId != XAOutputMixAdaptation ))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfAdapt_ThreadExit");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+
+    }
+
+    if ( adaptCtx->ctxId == XAMediaPlayerAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+    }
+    else if( adaptCtx->ctxId == XAMediaRecorderAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    }
+    else if (adaptCtx->ctxId == XAOutputMixAdaptation )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+    }
+
+    DEBUG_API("<-XAVolumeItfAdapt_ThreadExit");
+    return XA_RESULT_SUCCESS;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adaptation/xavolumeitfadaptation.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAVOLUMEITFADAPTATION_H
+#define XAVOLUMEITFADAPTATION_H
+
+#include "XAAdaptationContextBase.h"
+#include "XADebug.h"
+#include "XAThreadSafety.h"
+
+/* MACROS */
+#define STEREO_POSITION_RATIO    1000
+#define MAX_SUPPORT_VOLUME_LEVEL 9000
+#define MIN_SUPPORT_VOLUME_LEVEL -1000
+#define VOLUME_LEVEL_RATIO       1000
+
+/* FUNCTIONS */
+
+XAresult XAVolumeItfAdapt_SetVolumeLevel(XAAdaptationBaseCtx *ctx,
+                                         XAmillibel level);
+
+XAresult XAVolumeItfAdapt_GetMaxVolumeLevel(XAAdaptationBaseCtx *ctx,
+                                            XAmillibel *pMaxLevel);
+
+XAresult XAVolumeItfAdapt_SetMute(XAAdaptationBaseCtx *ctx,  XAboolean mute);
+
+XAresult XAVolumeItfAdapt_EnableStereoPosition(XAAdaptationBaseCtx *ctx,
+                                               XAboolean enable);
+
+XAresult XAVolumeItfAdapt_SetStereoPosition(XAAdaptationBaseCtx *ctx,
+                                            XApermille stereoPosition);
+
+XAresult XAVolumeItfAdapt_ThreadEntry(XAAdaptationBaseCtx *adaptCtx);
+XAresult XAVolumeItfAdapt_ThreadExit(XAAdaptationBaseCtx *adaptCtx);
+
+#endif /* XAVOLUMEITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/camera/xacameradevice.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,467 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xacameradevice.h"
+#include "xacameraitf.h"
+#include "xaconfigextensionsitf.h"
+#include "xadynintmgmtitf.h"
+#include "xaimagecontrolsitf.h"
+#include "xaimageeffectsitf.h"
+#include "xavideopostprocessingitf.h"
+#include "xathreadsafety.h"
+
+/* Static mapping of enumeration XACameraDeviceInterfaces to interface iids */
+static const XAInterfaceID* XACameraDeviceItfIIDs[CAMERA_ITFCOUNT]=
+{
+    &XA_IID_OBJECT,
+    &XA_IID_CAMERA,
+    &XA_IID_CONFIGEXTENSION,
+    &XA_IID_DYNAMICINTERFACEMANAGEMENT,
+    &XA_IID_IMAGECONTROLS,
+    &XA_IID_IMAGEEFFECTS,
+    &XA_IID_VIDEOPOSTPROCESSING
+};
+
+
+/*****************************************************************************
+ * Global methods
+ *****************************************************************************/
+
+/* XAResult XACameraDeviceImpl_Create
+ * Description: Create object
+ */
+XAresult XACameraDeviceImpl_CreateCameraDevice(XAObjectItf* pDevice,
+                                               XAuint32 deviceID,
+                                               XAuint32 numInterfaces,
+                                               const XAInterfaceID * pInterfaceIds,
+                                               const XAboolean * pInterfaceRequired)
+{
+    XACameraDeviceImpl* pImpl = NULL;
+    XAObjectItfImpl* pBaseObj = NULL;
+    XAuint8 itfIndex = 0;
+
+    DEBUG_API("->XACameraDeviceImpl_Create");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+
+    if( !pDevice )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraDeviceImpl_Create");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* instantiate object implementation */
+    pImpl = (XACameraDeviceImpl*)calloc(1,sizeof(XACameraDeviceImpl));
+    if( !pImpl )
+    {
+        /* memory allocation failed */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+        DEBUG_API("<-XACameraDeviceImpl_Create");
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+    pBaseObj = &pImpl->baseObj;
+
+    /* Initialize base object default implementation */
+    XAObjectItfImpl_Init(pBaseObj,
+                         CAMERA_ITFCOUNT,
+                         XACameraDeviceItfIIDs,
+                         XACameraDeviceImpl_DoRealize,
+                         XACameraDeviceImpl_DoResume,
+                         XACameraDeviceImpl_FreeResources);
+
+    /* Mark interfaces that need to be exposed */
+    /* Implicit and mandated interfaces */
+    pBaseObj->interfaceMap[CAMERA_CAMERAITF].required = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[CAMERA_DIMITF].required = XA_BOOLEAN_TRUE;
+
+    /* Explicit interfaces */
+    if( (numInterfaces != 0) && pInterfaceIds && pInterfaceRequired )
+    {
+        /* Check required interfaces */
+        for( itfIndex = 0; itfIndex < numInterfaces; itfIndex++ )
+        {
+            /* If mapEntry is null then required interface is not supported.*/
+            XAObjItfMapEntry *entry =
+                XAObjectItfImpl_GetItfEntry((XAObjectItf)&(pBaseObj), pInterfaceIds[itfIndex]);
+            if( !entry  )
+            {
+                if( pInterfaceRequired[itfIndex] )
+                {
+                    /* required interface cannot be accommodated - fail creation */
+                    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+                    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+                    DEBUG_ERR("Required interface not found - abort creation!");
+                    DEBUG_API("<-XACameraDeviceImpl_Create");
+                    return XA_RESULT_FEATURE_UNSUPPORTED;
+                }
+                else
+                {
+                    DEBUG_INFO("Requested (not required) interface not found - continue creation");
+                }
+            }
+            else
+            {
+                entry->required = XA_BOOLEAN_TRUE;
+            }
+        }
+    }
+
+    /* Mark interfaces that can be handled dynamically */
+    /* Mandated dynamic itfs */
+    pBaseObj->interfaceMap[CAMERA_IMAGEEFFECTSITF].isDynamic = XA_BOOLEAN_TRUE;
+
+
+    /* Initialize XACameraDeviceImpl variables */
+    pImpl->deviceID = deviceID;
+#ifdef _GSTREAMER_BACKEND_   
+    pImpl->adaptationCtx = XACameraAdapt_Create(pImpl->deviceID);
+#endif
+    
+    
+    /* This code is put here to return Feature Not Supported since adaptation is not present*/
+    /*************************************************/
+    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_ERR("Required interface not found - abort creation!");
+    DEBUG_API("<-XACameraDeviceImpl_Create");
+    return XA_RESULT_FEATURE_UNSUPPORTED;    
+    /*************************************************/
+
+    
+    
+    
+    /* Set ObjectItf to point to newly created object */
+/*
+    *pDevice = (XAObjectItf)&(pBaseObj->self);
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_API("<-XACameraDeviceImpl_Create");
+    return XA_RESULT_SUCCESS;
+*/
+}
+
+/* XAResult XACameraDeviceImpl_QueryNumSupportedInterfaces
+ * Description: Statically query number of supported interfaces
+ */
+XAresult XACameraDeviceImpl_QueryNumSupportedInterfaces( XAuint32 *pNumSupportedInterfaces )
+{
+    DEBUG_API("->XACameraDeviceImpl_QueryNumSupportedInterfaces");
+    if( pNumSupportedInterfaces )
+    {
+        *pNumSupportedInterfaces = CAMERA_ITFCOUNT;
+
+        DEBUG_API_A1("<-XACameraDeviceImpl_QueryNumSupportedInterfaces - %i", (int)(*pNumSupportedInterfaces) );
+        return XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraDeviceImpl_QueryNumSupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+}
+/* XAResult XACameraDeviceImpl_QuerySupportedInterfaces
+ * Description: Statically query supported interfaces
+ */
+XAresult XACameraDeviceImpl_QuerySupportedInterfaces( XAuint32 index,
+                                                      XAInterfaceID * pInterfaceId )
+{
+    DEBUG_API("->XACameraDeviceImpl_QuerySupportedInterfaces");
+
+    if( index >= CAMERA_ITFCOUNT || !pInterfaceId )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraDeviceImpl_QuerySupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        *pInterfaceId = *(XACameraDeviceItfIIDs[index]);
+
+        DEBUG_API("<-XACameraDeviceImpl_QuerySupportedInterfaces");
+        return XA_RESULT_SUCCESS;
+    }
+}
+
+
+/*****************************************************************************
+ * base object XAObjectItfImpl methods
+ *****************************************************************************/
+
+/* XAresult XACameraDeviceImpl_DoRealize( XAObjectItf self )
+ * Description: Realize all implicit and explicitly wanted interfaces.
+ * Create and initialize implementation-specific variables.
+ * Called from base object XAObjectItfImpl
+ */
+XAresult XACameraDeviceImpl_DoRealize( XAObjectItf self )
+{
+    XAuint8 itfIdx = 0;
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XACameraDeviceImpl* pObjImpl = (XACameraDeviceImpl*)(pObj);
+    XAresult ret = XA_RESULT_SUCCESS;
+
+
+    DEBUG_API("->XACameraDeviceImpl_DoRealize");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+
+    /* check casting from correct pointer type */
+    if( !pObjImpl || pObj != pObjImpl->baseObj.self )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraDeviceImpl_DoRealize");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_   
+    ret = XACameraAdapt_PostInit( pObjImpl->adaptationCtx );
+#endif
+    if( ret != XA_RESULT_SUCCESS )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR_A1("Camera adapt postinit - %d", ret);
+        DEBUG_API("<-XACameraDeviceImpl_DoRealize");
+        return ret;
+    }
+
+    /* Realize all implicit and explicitly wanted interfaces */
+    for( itfIdx = 0; itfIdx < CAMERA_ITFCOUNT; itfIdx++)
+    {
+        if( !(pObj->interfaceMap[itfIdx].pItf) &&
+            pObj->interfaceMap[itfIdx].required )
+        {
+            void *pItf = NULL;
+            switch( itfIdx )
+            {
+                case CAMERA_DIMITF:
+                    pItf = XADIMItfImpl_Create();
+                    if(pItf)
+                    {
+                        XADIMItfImpl_Init(pItf, self,
+                                XACameraDeviceImpl_DoAddItf,
+                                XACameraDeviceImpl_DoResumeItf,
+                                XACameraDeviceImpl_DoRemoveItf);
+                    }
+                    break;
+#ifdef _GSTREAMER_BACKEND_   
+                case CAMERA_CAMERAITF:
+                    pItf = XACameraItfImpl_Create( pObjImpl->adaptationCtx );
+                    break;
+                case CAMERA_CONFIGEXTENSIONITF:
+                    pItf = XAConfigExtensionsItfImpl_Create();
+                    break;
+                case CAMERA_IMAGECONTROLSITF:
+                   pItf = XAImageControlsItfImpl_Create( pObjImpl->adaptationCtx );
+                   break;
+                case CAMERA_IMAGEEFFECTSITF:
+                   pItf = XAImageEffectsItfImpl_Create( pObjImpl->adaptationCtx );
+                   break;
+                case CAMERA_VIDEOPOSTPROCESSINGITF:
+                     pItf = XAVideoPostProcessingItfImpl_Create( pObjImpl->adaptationCtx );
+                     break;
+#endif                     
+                default:
+                    break;
+            }
+            if( !pItf )
+            {
+                /* memory allocation failed */
+                XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+                DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+                DEBUG_API("<-XACameraDeviceImpl_DoRealize");
+                return XA_RESULT_MEMORY_FAILURE;
+            }
+            else
+            {
+                pObj->interfaceMap[itfIdx].pItf = pItf;
+            }
+        }
+    }
+
+    pObj->state = XA_OBJECT_STATE_REALIZED;
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_API("<-XACameraDeviceImpl_DoRealize");
+    return XA_RESULT_SUCCESS;
+}
+
+/* XAresult XACameraDeviceImpl_DoResume
+ * Description: Resume object from suspended state
+ */
+XAresult XACameraDeviceImpl_DoResume(XAObjectItf self)
+{
+    DEBUG_API("->XACameraDeviceImpl_DoResume");
+    DEBUG_API("<-XACameraDeviceImpl_DoResume");
+    /* This implementation does not support suspended state */
+    return XA_RESULT_PRECONDITIONS_VIOLATED;
+}
+
+/* void XACameraDeviceImpl_FreeResources
+ * Description: Free all resources reserved at XACameraDeviceImpl_DoRealize()
+ */
+void XACameraDeviceImpl_FreeResources(XAObjectItf self)
+{
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAuint8 itfIdx = 0;
+    DEBUG_API("->XACameraDeviceImpl_FreeResources");
+    XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS(XATSCamera);
+#ifdef _GSTREAMER_BACKEND_ 
+    XACameraDeviceImpl* pImpl = (XACameraDeviceImpl*)(*self);
+    assert( pObj && pImpl && pObj == pObj->self );
+#endif
+    
+
+    /* free all allocated interfaces */
+    for(itfIdx = 0; itfIdx < CAMERA_ITFCOUNT; itfIdx++)
+    {
+        void *pItf = pObj->interfaceMap[itfIdx].pItf;
+        if(pItf)
+        {
+            switch(itfIdx)
+            {
+                case CAMERA_CAMERAITF:
+                    XACameraItfImpl_Free( pItf );
+                    break;
+                case CAMERA_CONFIGEXTENSIONITF:
+                    XAConfigExtensionsItfImpl_Free( pItf );
+                    break;
+                case CAMERA_DIMITF:
+                    XADIMItfImpl_Free( pItf );
+                    break;
+                case CAMERA_IMAGECONTROLSITF:
+                    XAImageControlsItfImpl_Free( pItf );
+                    break;
+                case CAMERA_IMAGEEFFECTSITF:
+                    XAImageEffectsItfImpl_Free( pItf );
+                    break;
+                case CAMERA_VIDEOPOSTPROCESSINGITF:
+                    XAVideoPostProcessingItfImpl_Free( pItf );
+                    break;
+                default:
+                    break;
+            }
+            pObj->interfaceMap[itfIdx].pItf = NULL;
+        }
+    }
+#ifdef _GSTREAMER_BACKEND_   
+    if ( pImpl->adaptationCtx != NULL )
+    {
+        XACameraAdapt_Destroy( pImpl->adaptationCtx );
+        pImpl->adaptationCtx = NULL;
+    }
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS(XATSCamera);
+    DEBUG_API("<-XACameraDeviceImpl_FreeResources");
+    return;
+}
+
+/*****************************************************************************
+ * CameraDeviceImpl -specific methods
+ *****************************************************************************/
+
+/* XACameraDeviceImpl_DoAddItf
+ * Dynamically add an interface, object specific parts
+ */
+XAresult XACameraDeviceImpl_DoAddItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  )
+{
+#ifdef _GSTREAMER_BACKEND_
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XACameraDeviceImpl* pImpl = (XACameraDeviceImpl*)(pObj);
+#endif
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XACameraDeviceImpl_DoAddItf");
+    if(mapEntry)
+    {
+        switch( mapEntry->mapIdx )
+        {
+        case CAMERA_IMAGEEFFECTSITF:
+#ifdef _GSTREAMER_BACKEND_   
+            mapEntry->pItf = XAImageEffectsItfImpl_Create( pImpl->adaptationCtx );
+#endif
+            break;
+        default:
+            DEBUG_ERR("XACameraDeviceImpl_DoAddItf unknown id");
+            ret = XA_RESULT_FEATURE_UNSUPPORTED;
+            break;
+        }
+
+        if( !mapEntry->pItf && ret == XA_RESULT_SUCCESS)
+            {
+                DEBUG_ERR("XACameraDeviceImpl_DoAddItf itf creation failed");
+                ret = XA_RESULT_MEMORY_FAILURE;
+            }
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_API("<-XACameraDeviceImpl_DoAddItf");
+    return ret;
+}
+
+/* XACameraDeviceImpl_DoResumeItf
+ * Try to resume lost interface, object specific parts
+ */
+XAresult XACameraDeviceImpl_DoResumeItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XACameraDeviceImpl_DoResumeItf");
+    /* For now, no difference between suspended and unrealised itfs */
+    ret = XACameraDeviceImpl_DoAddItf(self,mapEntry);
+    DEBUG_API("<-XACameraDeviceImpl_DoResumeItf");
+    return ret;
+}
+
+/* XACameraDeviceImpl_DoRemoveItf
+ * Dynamically remove an interface, object specific parts
+ */
+XAresult XACameraDeviceImpl_DoRemoveItf(XAObjectItf self, XAObjItfMapEntry *mapEntry )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XACameraDeviceImpl_DoRemoveItf");
+    if(mapEntry)
+    {
+        switch( mapEntry->mapIdx )
+        {
+        case CAMERA_IMAGEEFFECTSITF:
+            XAImageEffectsItfImpl_Free( mapEntry->pItf );
+            break;
+        default:
+            DEBUG_ERR("XACameraDeviceImpl_DoRemoveItf unknown id");
+            ret = XA_RESULT_FEATURE_UNSUPPORTED;
+            break;
+        }
+        mapEntry->pItf = NULL;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_API("<-XACameraDeviceImpl_DoRemoveItf");
+    return ret;
+}
+/* END OF FILE */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/camera/xacameradevice.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XACAMERADEVICE_H
+#define XACAMERADEVICE_H
+
+#include "openmaxalwrapper.h"
+#include "xaobjectitf.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "../adaptation/XACameraAdaptCtx.h"
+#endif
+/** MACROS **/
+
+
+/** TYPES **/
+
+
+/** ENUMERATIONS **/
+/* Enumeration for interfaces that CameraDevice supports.  */
+typedef enum
+{
+    CAMERA_OBJECTITF,
+    CAMERA_CAMERAITF,
+    CAMERA_CONFIGEXTENSIONITF,
+    CAMERA_DIMITF,
+    CAMERA_IMAGECONTROLSITF,
+    CAMERA_IMAGEEFFECTSITF,
+    CAMERA_VIDEOPOSTPROCESSINGITF,
+    CAMERA_ITFCOUNT
+} XACameraDeviceInterfaces;
+
+/** STRUCTURES **/
+/* Specification for CameraDeviceImpl. */
+typedef struct XACameraDeviceImpl_
+{
+    /* Parent for XACameraDeviceImpl */
+    XAObjectItfImpl baseObj;
+
+    /* variables */
+    XAuint32 deviceID;
+#ifdef _GSTREAMER_BACKEND_
+    XAAdaptationBaseCtx* adaptationCtx;
+#endif    
+} XACameraDeviceImpl;
+
+
+/** METHODS **/
+
+/* base object XAObjectItfImpl methods */
+XAresult    XACameraDeviceImpl_DoRealize(XAObjectItf self);
+XAresult    XACameraDeviceImpl_DoResume(XAObjectItf self);
+void        XACameraDeviceImpl_FreeResources(XAObjectItf self);
+
+/* CameraDeviceImpl -specific methods*/
+/* DynamicInterfaceManagement object-specific methods */
+XAresult XACameraDeviceImpl_DoAddItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  );
+XAresult XACameraDeviceImpl_DoResumeItf(XAObjectItf self, XAObjItfMapEntry *mapEntry );
+XAresult XACameraDeviceImpl_DoRemoveItf(XAObjectItf self, XAObjItfMapEntry *mapEntry );
+
+
+
+#endif /* XACAMERADEVICE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/camera/xacameraitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,1073 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xacameraitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XACameraItfAdaptation.h"
+#endif
+#include "xathreadsafety.h"
+
+/* XACameraItfImpl* GetImpl(XACameraItf self)
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XACameraItfImpl* GetImpl(XACameraItf self)
+{
+    if( self )
+    {
+        XACameraItfImpl* impl = (XACameraItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/*****************************************************************************
+ * Base interface XACameraItf implementation
+ *****************************************************************************/
+
+/**
+ * XAresult XACameraItfImpl_RegisterCallback( XACameraItf self,
+ *                                            xaCameraCallback callback,
+ *                                            void *pContext )
+ * Description: Sets callback for camera event notification.
+ **/
+XAresult XACameraItfImpl_RegisterCallback( XACameraItf self,
+                                           xaCameraCallback callback,
+                                           void *pContext )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XACameraItfImpl_RegisterCallback");
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_RegisterCallback");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->callback = callback;
+    impl->context = pContext;
+    impl->cbPtrToSelf = self;
+
+    DEBUG_API("<-XACameraItfImpl_RegisterCallback");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_SetFlashMode( XACameraItf self, XAuint32 flashMode )
+ * Description: Sets the camera flash setting.
+ **/
+XAresult XACameraItfImpl_SetFlashMode( XACameraItf self, XAuint32 flashMode )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XACameraItfImpl_SetFlashMode");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+
+    if( !impl || flashMode > XA_CAMERA_FLASHMODE_TORCH || flashMode < XA_CAMERA_FLASHMODE_OFF )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_SetFlashMode");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is flash mode changed */
+    if( impl->flashMode != flashMode )
+    {
+#ifdef _GSTREAMER_BACKEND_    
+        ret = XACameraItfAdapt_SetFlashMode( impl->adapCtx, flashMode );
+#endif        
+        if ( ret == XA_RESULT_SUCCESS )
+        {
+            impl->flashMode = flashMode;
+        }
+        /* wait for adaptation */
+        impl->flashReady = XA_BOOLEAN_FALSE;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_API("<-XACameraItfImpl_SetFlashMode");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_GetFlashMode( XACameraItf self, XAuint32 *pFlashMode )
+ * Description: Gets the camera flash setting.
+ **/
+XAresult XACameraItfImpl_GetFlashMode( XACameraItf self, XAuint32 *pFlashMode )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XACameraItfImpl_GetFlashMode");
+    if( !impl || !pFlashMode )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_GetFlashMode");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pFlashMode = impl->flashMode;
+
+    DEBUG_API("<-XACameraItfImpl_GetFlashMode");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_IsFlashReady( XACameraItf self, XAboolean *pReady )
+ * Description: Queries whether the flash is ready for use.
+ **/
+XAresult XACameraItfImpl_IsFlashReady( XACameraItf self, XAboolean *pReady )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XACameraItfImpl_IsFlashReady");
+    if( !impl || !pReady )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_IsFlashReady");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    *pReady = impl->flashReady;
+
+    DEBUG_API("<-XACameraItfImpl_IsFlashReady");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_SetFocusMode( XACameraItf self, XAuint32 focusMode,
+ *                                        XAmillimeter manualSetting,
+ *                                        XAboolean macroEnabled )
+ * Description: Sets the camera focus mode.
+ **/
+XAresult XACameraItfImpl_SetFocusMode( XACameraItf self, XAuint32 focusMode,
+                                       XAmillimeter manualSetting,
+                                       XAboolean macroEnabled )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XACameraItfImpl_SetFocusMode");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+
+    if( !impl || focusMode < XA_CAMERA_FOCUSMODE_MANUAL || focusMode > XA_CAMERA_FOCUSMODE_CONTINUOUS_CENTROID )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_SetFocusMode");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is focus mode changed */
+    if( impl->focusMode != focusMode )
+    {
+#ifdef _GSTREAMER_BACKEND_       
+        ret = XACameraItfAdapt_SetFocusMode( impl->adapCtx, focusMode, manualSetting, macroEnabled  );
+#endif        
+        if ( ret == XA_RESULT_SUCCESS )
+        {
+            impl->focusMode = focusMode;
+            impl->focusManualSetting = manualSetting;
+            impl->macroEnabled = macroEnabled;
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_API("<-XACameraItfImpl_SetFocusMode");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_GetFocusMode( XACameraItf self,
+ *                                        XAuint32 *pFocusMode,
+ *                                        XAmillimeter *pManualSetting,
+ *                                        XAboolean *pMacroEnabled )
+ * Description: Gets the camera focus mode.
+ **/
+XAresult XACameraItfImpl_GetFocusMode( XACameraItf self,
+                                       XAuint32 *pFocusMode,
+                                       XAmillimeter *pManualSetting,
+                                       XAboolean *pMacroEnabled )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XACameraItfImpl_GetFocusMode");
+    if( !impl || !pFocusMode || !pManualSetting || !pMacroEnabled )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_GetFocusMode");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pFocusMode = impl->focusMode;
+    *pMacroEnabled = impl->macroEnabled;
+
+    if( impl->focusMode & XA_CAMERA_FOCUSMODE_MANUAL )
+    {
+        *pManualSetting = impl->focusManualSetting;
+    }
+
+    DEBUG_API("<-XACameraItfImpl_GetFocusMode");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_SetFocusRegionPattern( XACameraItf self,
+ *                                                 XAuint32 focusPattern,
+ *                                                 XAuint32 activePoints1,
+ *                                                 XAuint32 activePoints2 )
+ * Description: Set the camera focus region pattern.
+ **/
+XAresult XACameraItfImpl_SetFocusRegionPattern( XACameraItf self,
+                                                XAuint32 focusPattern,
+                                                XAuint32 activePoints1,
+                                                XAuint32 activePoints2 )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XACameraItfImpl_SetFocusRegionPattern");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+
+    if( !impl || focusPattern < XA_FOCUSPOINTS_ONE || focusPattern > XA_FOCUSPOINTS_CUSTOM )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_SetFocusRegionPattern");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is focus pattern changed */
+    if( focusPattern == impl->focusPattern )
+    {
+#ifdef _GSTREAMER_BACKEND_   
+        ret = XACameraItfAdapt_SetFocusRegionPattern( impl->adapCtx, focusPattern, activePoints1, activePoints2 );
+#endif
+        if (ret == XA_RESULT_SUCCESS)
+        {
+            impl->focusPattern = focusPattern;
+            if( !(impl->focusMode & XA_CAMERA_FOCUSMODE_MANUAL) )
+            {
+                impl->activePoints1 = activePoints1;
+                impl->activePoints2 = activePoints2;
+            }
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_API("<-XACameraItfImpl_SetFocusRegionPattern");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_GetFocusRegionPattern( XACameraItf self,
+ *                                                 XAuint32 *pFocusPattern,
+ *                                                 XAuint32 *pActivePoints1,
+ *                                                 XAuint32 *pActivePoints2 )
+ * Description: Gets the camera focus region pattern.
+ **/
+XAresult XACameraItfImpl_GetFocusRegionPattern( XACameraItf self,
+                                                XAuint32 *pFocusPattern,
+                                                XAuint32 *pActivePoints1,
+                                                XAuint32 *pActivePoints2 )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XACameraItfImpl_GetFocusRegionPattern");
+    if( !impl || !pFocusPattern || !pActivePoints1 || !pActivePoints2 )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_GetFocusRegionPattern");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pFocusPattern = impl->focusPattern;
+
+    if( !(impl->focusMode & XA_CAMERA_FOCUSMODE_MANUAL) &&
+        (impl->focusPattern == XA_FOCUSPOINTS_CUSTOM) )
+    {
+        *pActivePoints1 = impl->activePoints1;
+        *pActivePoints2 = impl->activePoints2;
+    }
+
+    DEBUG_API("<-XACameraItfImpl_GetFocusRegionPattern");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_GetFocusRegionPositions( XACameraItf self,
+ *                                                   XAuint32 *pNumPositionEntries,
+ *                                                   XAFocusPointPosition *pFocusPosition )
+ * Description: Get the camera focus region pattern's positioning and size for each
+ * point in the active focus pattern.
+ **/
+XAresult XACameraItfImpl_GetFocusRegionPositions( XACameraItf self,
+                                                  XAuint32 *pNumPositionEntries,
+                                                  XAFocusPointPosition *pFocusPosition )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XACameraItfImpl_GetFocusRegionPositions");
+    if( !impl || !pNumPositionEntries || !pFocusPosition )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_GetFocusRegionPositions");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_       
+    ret = XACameraItfAdapt_GetFocusRegionPositions( impl->adapCtx, pNumPositionEntries,
+                                                    pFocusPosition );
+#endif
+    DEBUG_API("<-XACameraItfImpl_GetFocusRegionPositions");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_GetFocusModeStatus( XACameraItf self,
+ *                                              XAuint32 *pFocusStatus,
+ *                                              XAuint32 *pRegionStatus1,
+ *                                              XAuint32 *pRegionStatus2 )
+ * Description: Gets the camera focus status.
+ **/
+XAresult XACameraItfImpl_GetFocusModeStatus( XACameraItf self,
+                                             XAuint32 *pFocusStatus,
+                                             XAuint32 *pRegionStatus1,
+                                             XAuint32 *pRegionStatus2 )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XACameraItfImpl_GetFocusModeStatus");
+    if( !impl || !*pFocusStatus )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_GetFocusModeStatus");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    *pFocusStatus = impl->focusStatus;
+
+    DEBUG_API("<-XACameraItfImpl_GetFocusModeStatus");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_SetMeteringMode( XACameraItf self, XAuint32 meteringMode )
+ * Description: Sets the camera metering mode for exposure.
+ **/
+XAresult XACameraItfImpl_SetMeteringMode( XACameraItf self, XAuint32 meteringMode )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XACameraItfImpl_SetMeteringMode");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+
+    if( !impl || meteringMode < XA_CAMERA_METERINGMODE_AVERAGE || meteringMode >XA_CAMERA_METERINGMODE_MATRIX )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_SetMeteringMode");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_   
+    ret = XACameraItfAdapt_SetMeteringMode( impl->adapCtx, meteringMode );
+#endif
+    if ( ret == XA_RESULT_SUCCESS )
+    {
+        impl->meteringMode = meteringMode;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_API("<-XACameraItfImpl_SetMeteringMode");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_GetMeteringMode( XACameraItf self, XAuint32 *pMeteringMode )
+ * Description: Gets the camera metering mode for exposure.
+ **/
+XAresult XACameraItfImpl_GetMeteringMode( XACameraItf self, XAuint32 *pMeteringMode )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XACameraItfImpl_GetMeteringMode");
+
+    if( !impl || !pMeteringMode )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_GetMeteringMode");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pMeteringMode = impl->meteringMode;
+
+    DEBUG_API("<-XACameraItfImpl_GetMeteringMode");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_SetExposureMode( XACameraItf self, XAuint32 exposure,
+ *                                           XAuint32 compensation )
+ * Description: Sets the camera exposure mode.
+ **/
+XAresult XACameraItfImpl_SetExposureMode( XACameraItf self, XAuint32 exposure,
+                                          XAuint32 compensation )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    DEBUG_API("->XACameraItfImpl_SetExposureMode");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+    impl = GetImpl(self);
+    if( !impl || exposure < XA_CAMERA_EXPOSUREMODE_MANUAL || exposure > XA_CAMERA_EXPOSUREMODE_NIGHTPORTRAIT )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_SetExposureMode");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is focus mode changed */
+    if( impl->exposureMode != exposure || impl->compensation != compensation )
+    {
+#ifdef _GSTREAMER_BACKEND_   
+    ret = XACameraItfAdapt_SetExposureMode( impl->adapCtx, exposure, exposure );
+#endif
+        if ( ret == XA_RESULT_SUCCESS )
+        {
+            impl->exposureMode = exposure;
+            impl->compensation = compensation;
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_API("<-XACameraItfImpl_SetExposureMode");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_GetExposureMode( XACameraItf self, XAuint32 *pExposure,
+ *                                           XAuint32 *pCompensation )
+ * Description: Gets the camera exposure mode.
+ **/
+XAresult XACameraItfImpl_GetExposureMode( XACameraItf self, XAuint32 *pExposure,
+                                          XAuint32 *pCompensation )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    DEBUG_API("->XACameraItfImpl_GetExposureMode");
+    impl = GetImpl(self);
+    if( !impl || !pExposure || !pCompensation )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_GetExposureMode");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pExposure = impl->exposureMode;
+    *pCompensation = impl->compensation;
+
+    DEBUG_API("<-XACameraItfImpl_GetExposureMode");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_SetISOSensitivity( XACameraItf self, XAuint32 isoSensitivity,
+ *                                             XAuint32 manualSetting )
+ * Description: Sets the camera ISO sensitivity.
+ **/
+XAresult XACameraItfImpl_SetISOSensitivity( XACameraItf self, XAuint32 isoSensitivity,
+                                            XAuint32 manualSetting )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    DEBUG_API("->XACameraItfImpl_SetISOSensitivity");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+    impl = GetImpl(self);
+    if( !impl || isoSensitivity<XA_CAMERA_ISOSENSITIVITYMODE_MANUAL || isoSensitivity>XA_CAMERA_ISOSENSITIVITYMODE_AUTO )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_SetISOSensitivity");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is focus mode changed */
+    if( impl->isoSensitivity != isoSensitivity || impl->isoManualSetting != manualSetting )
+    {
+#ifdef _GSTREAMER_BACKEND_   
+    ret = XACameraItfAdapt_SetISOSensitivity( impl->adapCtx, isoSensitivity, manualSetting );
+#endif
+        if ( ret == XA_RESULT_SUCCESS )
+        {
+            impl->isoSensitivity = isoSensitivity;
+            impl->isoManualSetting = manualSetting;
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_API("<-XACameraItfImpl_SetISOSensitivity");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_GetISOSensitivity( XACameraItf self, XAuint32 *pIsoSensitivity,
+ *                                             XAuint32 *pManualSetting )
+ * Description: Gets the camera ISO sensitivity.
+ **/
+XAresult XACameraItfImpl_GetISOSensitivity( XACameraItf self, XAuint32 *pIsoSensitivity,
+                                            XAuint32 *pManualSetting )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    DEBUG_API("->XACameraItfImpl_GetISOSensitivity");
+    impl = GetImpl(self);
+    if( !impl || !pIsoSensitivity || !pManualSetting )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_GetISOSensitivity");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pIsoSensitivity = impl->isoSensitivity;
+
+    if( impl->isoSensitivity == XA_CAMERA_ISOSENSITIVITYMODE_MANUAL )
+    {
+        *pManualSetting = impl->isoManualSetting;
+    }
+    if( impl->isoSensitivity == XA_CAMERA_ISOSENSITIVITYMODE_AUTO )
+    {
+        *pManualSetting = 0;
+    }
+
+    DEBUG_API("<-XACameraItfImpl_GetISOSensitivity");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_SetAperture( XACameraItf self, XAuint32 aperture,
+ *                                       XAuint32 manualSetting )
+ * Description: Sets the camera aperture.
+ **/
+XAresult XACameraItfImpl_SetAperture( XACameraItf self, XAuint32 aperture,
+                                      XAuint32 manualSetting )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    DEBUG_API("->XACameraItfImpl_SetAperture");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+    impl = GetImpl(self);
+    if( !impl || aperture<XA_CAMERA_APERTUREMODE_MANUAL || aperture>XA_CAMERA_APERTUREMODE_AUTO )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_SetAperture");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is aperture mode or value changed */
+    if( impl->aperture != aperture || impl->apertureManualSetting != manualSetting )
+    {
+#ifdef _GSTREAMER_BACKEND_   
+        ret = XACameraItfAdapt_SetAperture( impl->adapCtx, aperture, manualSetting );
+#endif
+        if ( ret == XA_RESULT_SUCCESS )
+        {
+            impl->aperture = aperture;
+            impl->apertureManualSetting = manualSetting;
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_API("<-XACameraItfImpl_SetAperture");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_GetAperture( XACameraItf self, XAuint32 *pAperture,
+ *                                       XAuint32 *pManualSetting )
+ * Description: Gets the camera aperture.
+ **/
+XAresult XACameraItfImpl_GetAperture( XACameraItf self, XAuint32 *pAperture,
+                                      XAuint32 *pManualSetting )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    DEBUG_API("->XACameraItfImpl_GetAperture");
+    impl = GetImpl(self);
+    if( !impl || !pAperture || !pManualSetting )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_GetAperture");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pAperture = impl->aperture;
+
+    if( impl->aperture == XA_CAMERA_APERTUREMODE_MANUAL )
+    {
+        *pManualSetting = impl->apertureManualSetting;
+    }
+    if( impl->aperture == XA_CAMERA_APERTUREMODE_AUTO )
+    {
+          *pManualSetting = 0;
+    }
+
+    DEBUG_API("<-XACameraItfImpl_GetAperture");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_SetShutterSpeed( XACameraItf self, XAuint32 shutterSpeed,
+ *                                           XAmicrosecond manualSetting )
+ * Description: Sets the camera shutter speed.
+ **/
+XAresult XACameraItfImpl_SetShutterSpeed( XACameraItf self, XAuint32 shutterSpeed,
+                                          XAmicrosecond manualSetting )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    DEBUG_API("->XACameraItfImpl_SetShutterSpeed");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+    impl = GetImpl(self);
+    if( !impl || shutterSpeed < XA_CAMERA_SHUTTERSPEEDMODE_MANUAL || shutterSpeed > XA_CAMERA_SHUTTERSPEEDMODE_AUTO )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_SetShutterSpeed");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_   
+    ret = XACameraItfAdapt_SetShutterSpeed( impl->adapCtx, shutterSpeed, manualSetting );
+#endif
+    if ( ret == XA_RESULT_SUCCESS )
+    {
+        impl->shutterManualSetting = manualSetting;
+        impl->shutterSpeed = shutterSpeed;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_API("<-XACameraItfImpl_SetShutterSpeed");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_GetShutterSpeed( XACameraItf self, XAuint32 *pShutterSpeed,
+ *                                           XAmicrosecond *pManualSetting )
+ * Description: Gets the camera shutter speed.
+ **/
+XAresult XACameraItfImpl_GetShutterSpeed( XACameraItf self, XAuint32 *pShutterSpeed,
+                                          XAmicrosecond *pManualSetting )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    DEBUG_API("->XACameraItfImpl_GetShutterSpeed");
+    impl = GetImpl(self);
+    if( !impl || !pShutterSpeed || !pManualSetting )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_GetShutterSpeed");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pShutterSpeed = impl->shutterSpeed;
+
+    if( impl->shutterSpeed == XA_CAMERA_SHUTTERSPEEDMODE_MANUAL )
+    {
+        *pManualSetting = impl->shutterManualSetting;
+    }
+    if( impl->shutterSpeed == XA_CAMERA_SHUTTERSPEEDMODE_AUTO )
+    {
+        *pManualSetting = 0;
+    }
+
+    DEBUG_API("<-XACameraItfImpl_GetShutterSpeed");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_SetWhiteBalance( XACameraItf self, XAuint32 whiteBalance,
+ *                                           XAuint32 manualSetting )
+ * Description: Sets the camera white balance.
+ **/
+XAresult XACameraItfImpl_SetWhiteBalance( XACameraItf self, XAuint32 whiteBalance,
+                                          XAuint32 manualSetting )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    DEBUG_API("->XACameraItfImpl_SetWhiteBalance");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+    impl = GetImpl(self);
+    if( !impl )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_SetWhiteBalance");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is whitebalance mode or value changed */
+    if( impl->whiteBalance != whiteBalance || impl->whiteBalManualSetting != manualSetting )
+    {
+#ifdef _GSTREAMER_BACKEND_   
+        ret = XACameraItfAdapt_SetWhiteBalance( impl->adapCtx, whiteBalance, manualSetting );
+#endif
+        if ( ret == XA_RESULT_SUCCESS )
+        {
+            impl->whiteBalance = whiteBalance;
+            impl->whiteBalManualSetting = manualSetting;
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_API("<-XACameraItfImpl_SetWhiteBalance");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_GetWhiteBalance( XACameraItf self, XAuint32 *pWhiteBalance,
+ *                                           XAuint32 *pManualSetting )
+ * Description: Gets the camera white balance.
+ **/
+XAresult XACameraItfImpl_GetWhiteBalance( XACameraItf self, XAuint32 *pWhiteBalance,
+                                          XAuint32 *pManualSetting )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    DEBUG_API("->XACameraItfImpl_GetWhiteBalance");
+    impl = GetImpl(self);
+    if( !impl || !pWhiteBalance || !pManualSetting )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_GetWhiteBalance");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pWhiteBalance = impl->whiteBalance;
+
+    if( impl->whiteBalance == XA_CAMERA_WHITEBALANCEMODE_MANUAL )
+    {
+        *pManualSetting = impl->whiteBalManualSetting;
+    }
+
+    DEBUG_API("<-XACameraItfImpl_GetWhiteBalance");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_SetAutoLocks( XACameraItf self, XAuint32 locks )
+ * Description: Locks the given automatic camera settings. This method is typically
+ * called when the camera trigger is half-pressed.
+ **/
+XAresult XACameraItfImpl_SetAutoLocks( XACameraItf self, XAuint32 locks )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+    DEBUG_API("->XACameraItfImpl_SetAutoLocks");
+    impl = GetImpl(self);
+    if( !impl || locks < XA_CAMERA_LOCK_AUTOFOCUS ||
+        (locks > (  XA_CAMERA_LOCK_AUTOFOCUS & XA_CAMERA_LOCK_AUTOEXPOSURE & XA_CAMERA_LOCK_AUTOWHITEBALANCE )))
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_SetAutoLocks");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_   
+    ret = XACameraItfAdapt_SetAutoLocks( impl->adapCtx, locks );
+#endif
+    if ( ret == XA_RESULT_SUCCESS )
+    {
+        impl->locks = locks;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_API("<-XACameraItfImpl_SetAutoLocks");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_GetAutoLocks( XACameraItf self, XAuint32 *locks )
+ * Description: Gets the current state of the automatic camera settings locks.
+ **/
+XAresult XACameraItfImpl_GetAutoLocks( XACameraItf self, XAuint32 *locks )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    DEBUG_API("->XACameraItfImpl_GetAutoLocks");
+    impl = GetImpl(self);
+    if( !impl || !locks )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_GetAutoLocks");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *locks = impl->locks;
+
+    DEBUG_API("<-XACameraItfImpl_GetAutoLocks");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_SetZoom( XACameraItf self, XAuint32 zoom,
+ *                                   XAboolean digitalEnabled, XAuint32 speed,
+ *                                   XAboolean async )
+ * Description: Sets the new zoom factor.
+ **/
+XAresult XACameraItfImpl_SetZoom( XACameraItf self, XApermille zoom,
+                                  XAboolean digitalEnabled, XAuint32 speed,
+                                  XAboolean async )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    DEBUG_API("->XACameraItfImpl_SetZoom");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+    impl = GetImpl(self);
+    if( !impl || !( speed == XA_CAMERA_ZOOM_FASTEST ||  speed == XA_CAMERA_ZOOM_FAST
+        || speed == XA_CAMERA_ZOOM_NORMAL || speed == XA_CAMERA_ZOOM_SLOW ) )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_SetZoom");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_   
+    ret = XACameraItfAdapt_SetZoom( impl->adapCtx, zoom, digitalEnabled, speed, async );
+#endif
+    if ( ret == XA_RESULT_SUCCESS )
+    {
+        impl->zoom = zoom;
+        impl->digitalEnabled = digitalEnabled;
+        impl->speed = speed;
+        impl->async = async;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+    DEBUG_API("<-XACameraItfImpl_SetZoom");
+    return ret;
+}
+
+/**
+ * XAresult XACameraItfImpl_GetZoom( XACameraItf self, XAuint32 *pZoom,
+ *                                   XAboolean *pDigital )
+ * Description: Gets the current zoom factor.
+ **/
+XAresult XACameraItfImpl_GetZoom( XACameraItf self, XApermille *pZoom,
+                                  XAboolean *pDigital )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraItfImpl* impl = NULL;
+
+    DEBUG_API("->XACameraItfImpl_GetZoom");
+    impl = GetImpl(self);
+    if( !impl || !pZoom || !pDigital )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraItfImpl_GetZoom");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pZoom = impl->zoom;
+    *pDigital = impl->digitalEnabled;
+
+    DEBUG_API("<-XACameraItfImpl_GetZoom");
+    return ret;
+}
+
+
+/*****************************************************************************
+ * XACameraItfImpl -specific methods
+ *****************************************************************************/
+
+/* XACameraItfImpl* XACameraItfImpl_Create()
+ * Description: Allocate and initialize CameraItfImpl
+ */
+#ifdef _GSTREAMER_BACKEND_   
+
+XACameraItfImpl* XACameraItfImpl_Create( XAAdaptationBaseCtx *adapCtx )
+{
+    XACameraItfImpl* self = (XACameraItfImpl*)
+        calloc(1,sizeof(XACameraItfImpl));
+    DEBUG_API("->XACameraItfImpl_Create");
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.RegisterCallback = XACameraItfImpl_RegisterCallback;
+        self->itf.SetFlashMode = XACameraItfImpl_SetFlashMode;
+        self->itf.GetFlashMode = XACameraItfImpl_GetFlashMode;
+        self->itf.IsFlashReady = XACameraItfImpl_IsFlashReady;
+        self->itf.SetFocusMode = XACameraItfImpl_SetFocusMode;
+        self->itf.GetFocusMode = XACameraItfImpl_GetFocusMode;
+        self->itf.SetFocusRegionPattern = XACameraItfImpl_SetFocusRegionPattern;
+        self->itf.GetFocusRegionPattern = XACameraItfImpl_GetFocusRegionPattern;
+        self->itf.GetFocusRegionPositions = XACameraItfImpl_GetFocusRegionPositions;
+        self->itf.GetFocusModeStatus = XACameraItfImpl_GetFocusModeStatus;
+        self->itf.SetMeteringMode = XACameraItfImpl_SetMeteringMode;
+        self->itf.GetMeteringMode = XACameraItfImpl_GetMeteringMode;
+        self->itf.SetExposureMode = XACameraItfImpl_SetExposureMode;
+        self->itf.GetExposureMode = XACameraItfImpl_GetExposureMode;
+        self->itf.SetISOSensitivity = XACameraItfImpl_SetISOSensitivity;
+        self->itf.GetISOSensitivity = XACameraItfImpl_GetISOSensitivity;
+        self->itf.SetAperture = XACameraItfImpl_SetAperture;
+        self->itf.GetAperture = XACameraItfImpl_GetAperture;
+        self->itf.SetShutterSpeed = XACameraItfImpl_SetShutterSpeed;
+        self->itf.GetShutterSpeed = XACameraItfImpl_GetShutterSpeed;
+        self->itf.SetWhiteBalance = XACameraItfImpl_SetWhiteBalance;
+        self->itf.GetWhiteBalance = XACameraItfImpl_GetWhiteBalance;
+        self->itf.SetAutoLocks = XACameraItfImpl_SetAutoLocks;
+        self->itf.GetAutoLocks = XACameraItfImpl_GetAutoLocks;
+        self->itf.SetZoom = XACameraItfImpl_SetZoom;
+        self->itf.GetZoom = XACameraItfImpl_GetZoom;
+
+
+        /* init variables */
+        self->flashReady = XA_BOOLEAN_TRUE;
+        self->adapCtx = adapCtx;
+        self->cbPtrToSelf = NULL;
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBase_AddEventHandler( adapCtx, &XACameraItfImp_AdaptCb, XA_CAMERAITFEVENTS, self );
+#endif
+        self->self = self;
+    }
+
+    DEBUG_API("<-XACameraItfImpl_Create");
+    return self;
+}
+
+#endif
+/* void XACameraItfImpl_Free(XACameraItfImpl* self)
+ * Description: Free all resources reserved at XACameraItfImpl_Create
+ */
+void XACameraItfImpl_Free(XACameraItfImpl* self)
+{
+    DEBUG_API("->XACameraItfImpl_Free");
+    assert( self==self->self );
+#ifdef _GSTREAMER_BACKEND_   
+    XAAdaptationBase_RemoveEventHandler( self->adapCtx, &XACameraItfImp_AdaptCb );
+#endif
+    free( self );
+    DEBUG_API("<-XACameraItfImpl_Free");
+}
+
+#ifdef _GSTREAMER_BACKEND_
+/* void XACameraItfAdapt_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+ * @param void *pHandlerCtx - pointer to cb context (XACameraItfImpl)
+ * @param XAAdaptEvent *event  - Event
+ * Description: Event handler for adaptation events
+ */
+void XACameraItfImp_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+{
+    XACameraItfImpl* impl =(XACameraItfImpl*)pHandlerCtx;
+    XAuint32 eventData=0;
+
+    DEBUG_API("->XACameraItfImp_AdaptCb");
+    if(!impl)
+    {
+        DEBUG_ERR("XACameraItfAdapt_AdaptCb, invalid context pointer!");
+        DEBUG_API("<-XACameraItfImp_AdaptCb");
+        return;
+    }
+    assert(event);
+
+    if( event->data )
+    {
+        eventData = *(XAuint32*)event->data;
+    }
+    switch( event->eventid )
+    {
+        case XA_CAMERACBEVENT_FOCUSSTATUS:
+            impl->focusStatus = eventData;
+            break;
+        case XA_CAMERACBEVENT_ZOOMSTATUS:
+            impl->zoom = eventData;
+            break;
+        case XA_CAMERACBEVENT_EXPOSURESTATUS:
+            impl->focusStatus = eventData;
+            break;
+        case XA_CAMERACBEVENT_FLASHREADY:
+            impl->flashReady = XA_BOOLEAN_TRUE;
+            break;
+        case XA_CAMERACBEVENT_WHITEBALANCELOCKED:
+        case XA_CAMERACBEVENT_ROTATION:
+        default:
+            break;
+    }
+
+    if( impl->callback )
+    {
+        impl->callback( impl->cbPtrToSelf, impl->context, event->eventid, eventData );
+    }
+    DEBUG_API("<-XACameraItfImp_AdaptCb");
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/camera/xacameraitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XACAMERAITF_H
+#define XACAMERAITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XACameraItf implementation */
+typedef struct XACameraItfImpl_
+{
+    /* parent interface */
+    struct XACameraItf_ itf;
+    /* pointer to self */
+    struct XACameraItfImpl_* self;
+
+    /* variables */
+    XAuint32            flashMode;
+    XAboolean           flashReady;
+    XAuint32            focusMode;
+    XAuint32            focusStatus;
+    XAmillimeter        focusManualSetting;
+    XAboolean           macroEnabled;
+    XAuint32            focusPattern;
+    XAuint32            activePoints1;
+    XAuint32            activePoints2;
+    XAuint32            meteringMode;
+    XAuint32            exposureMode;
+    XAuint32            compensation;
+    XAuint32            isoSensitivity;
+    XAuint32            isoManualSetting;
+    XAuint32            aperture;
+    XAuint32            apertureManualSetting;
+    XAuint32            shutterSpeed;
+    XAmicrosecond       shutterManualSetting;
+    XAuint32            whiteBalance;
+    XAuint32            whiteBalManualSetting;
+    XAuint32            locks;
+    XApermille          zoom;
+    XAboolean           digitalEnabled;
+    XAuint32            speed;
+    XAuint32            async;
+
+    xaCameraCallback    callback;
+    void                *context;
+    XACameraItf         cbPtrToSelf;
+
+#ifdef _GSTREAMER_BACKEND_
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+} XACameraItfImpl;
+
+/** METHODS **/
+
+/* Base interface XACameraItf implementation
+ *See API Specification for method documentation
+ */
+XAresult XACameraItfImpl_RegisterCallback( XACameraItf self,
+                                           xaCameraCallback callback,
+                                           void *pContext );
+
+XAresult XACameraItfImpl_SetFlashMode( XACameraItf self, XAuint32 flashMode );
+
+XAresult XACameraItfImpl_GetFlashMode( XACameraItf self, XAuint32 *pFlashMode );
+
+XAresult XACameraItfImpl_IsFlashReady( XACameraItf self, XAboolean *pReady );
+
+XAresult XACameraItfImpl_SetFocusMode( XACameraItf self, XAuint32 focusMode,
+                                       XAmillimeter manualSetting,
+                                       XAboolean macroEnabled );
+
+XAresult XACameraItfImpl_GetFocusMode( XACameraItf self,
+                                       XAuint32 *pFocusMode,
+                                       XAmillimeter *pManualSetting,
+                                       XAboolean *pMacroEnabled );
+
+XAresult XACameraItfImpl_SetFocusRegionPattern( XACameraItf self,
+                                                XAuint32 focusPattern,
+                                                XAuint32 activePoints1,
+                                                XAuint32 activePoints2 );
+
+XAresult XACameraItfImpl_GetFocusRegionPattern( XACameraItf self,
+                                                XAuint32 *pFocusPattern,
+                                                XAuint32 *pActivePoints1,
+                                                XAuint32 *pActivePoints2 );
+
+XAresult XACameraItfImpl_GetFocusRegionPositions( XACameraItf self,
+                                                  XAuint32 *pNumPositionEntries,
+                                                  XAFocusPointPosition *pFocusPosition );
+
+XAresult XACameraItfImpl_GetFocusModeStatus( XACameraItf self,
+                                             XAuint32 *pFocusStatus,
+                                             XAuint32 *pRegionStatus1,
+                                             XAuint32 *pRegionStatus2 );
+
+XAresult XACameraItfImpl_SetMeteringMode( XACameraItf self, XAuint32 meteringMode );
+
+XAresult XACameraItfImpl_GetMeteringMode( XACameraItf self, XAuint32 *pMeteringMode );
+
+XAresult XACameraItfImpl_SetExposureMode( XACameraItf self, XAuint32 exposure,
+                                          XAuint32 compensation );
+
+XAresult XACameraItfImpl_GetExposureMode( XACameraItf self, XAuint32 *pExposure,
+                                          XAuint32 *pCompensation );
+
+XAresult XACameraItfImpl_SetISOSensitivity( XACameraItf self, XAuint32 isoSensitivity,
+                                            XAuint32 manualSetting );
+
+XAresult XACameraItfImpl_GetISOSensitivity( XACameraItf self, XAuint32 *pIsoSensitivity,
+                                            XAuint32 *pManualSetting );
+
+XAresult XACameraItfImpl_SetAperture( XACameraItf self, XAuint32 aperture,
+                                      XAuint32 manualSetting );
+
+XAresult XACameraItfImpl_GetAperture( XACameraItf self, XAuint32 *pAperture,
+                                      XAuint32 *pManualSetting );
+
+XAresult XACameraItfImpl_SetShutterSpeed( XACameraItf self, XAuint32 shutterSpeed,
+                                          XAmicrosecond manualSetting );
+
+XAresult XACameraItfImpl_GetShutterSpeed( XACameraItf self, XAuint32 *pShutterSpeed,
+                                          XAmicrosecond *pManualSetting );
+
+XAresult XACameraItfImpl_SetWhiteBalance( XACameraItf self, XAuint32 whiteBalance,
+                                          XAuint32 manualSetting );
+
+XAresult XACameraItfImpl_GetWhiteBalance( XACameraItf self, XAuint32 *pWhiteBalance,
+                                          XAuint32 *pManualSetting );
+
+XAresult XACameraItfImpl_SetAutoLocks( XACameraItf self, XAuint32 locks );
+
+XAresult XACameraItfImpl_GetAutoLocks( XACameraItf self, XAuint32 *locks );
+
+XAresult XACameraItfImpl_SetZoom( XACameraItf self, XApermille zoom,
+                                  XAboolean digitalEnabled, XAuint32 speed,
+                                  XAboolean async );
+
+XAresult XACameraItfImpl_GetZoom( XACameraItf self, XApermille *pZoom,
+                                  XAboolean *pDigital );
+
+#ifdef _GSTREAMER_BACKEND_
+/* XACameraItfImpl -specific methods */
+XACameraItfImpl* XACameraItfImpl_Create( XAAdaptationBaseCtx *adapCtx );
+void XACameraItfImp_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
+#endif
+void XACameraItfImpl_Free(XACameraItfImpl* self);
+
+#endif /* XACAMERAITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/openmaxal.c	Fri Apr 16 15:29:42 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 <stdio.h>
+#include <stdlib.h>
+
+#include "openmaxalwrapper.h"
+#include "openmaxal_iid.c"
+#include "common/xaglobals.h"
+
+
+EXPORT_C XAresult XAAPIENTRY xaCreateEngine(XAObjectItf *pEngine, XAuint32 numOptions,
+                                   const XAEngineOption *pEngineOptions,
+                                   XAuint32 numInterfaces,
+                                   const XAInterfaceID *pInterfaceIds,
+                                   const XAboolean *pInterfaceRequired)
+{
+    XAresult ret;
+    DEBUG_API("->xaCreateEngine");
+    ret = XAEngineImpl_Create(pEngine, numOptions,
+                                       pEngineOptions,
+                                       numInterfaces,
+                                       pInterfaceIds,
+                                       pInterfaceRequired);
+    DEBUG_API_A1("<-xaCreateEngine: 0x%x",(int)ret);
+    return ret;
+}
+
+EXPORT_C XAresult XAAPIENTRY xaQueryNumSupportedEngineInterfaces(XAuint32 *pNumSupportedInterfaces)
+{
+    XAresult ret;
+    DEBUG_API("->xaQueryNumSupportedEngineInterfaces");
+    ret = XAEngineImpl_QueryNumSupportedInterfaces(pNumSupportedInterfaces);
+    DEBUG_API_A1("<-xaQueryNumSupportedEngineInterfaces: 0x%x",(int)ret);
+    return ret;
+}
+
+EXPORT_C XAresult XAAPIENTRY xaQuerySupportedEngineInterfaces(XAuint32 index,
+                                                     XAInterfaceID *pInterfaceId)
+{
+    XAresult ret;
+    DEBUG_API("->xaQuerySupportedEngineInterfaces");
+    ret = XAEngineImpl_QuerySupportedInterfaces(
+                                    index, pInterfaceId);
+    DEBUG_API_A1("<-xaQuerySupportedEngineInterfaces: 0x%x",(int)ret);
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xacommon.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,330 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <stdarg.h>
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#include "xaengine.h"
+/*
+ *  compare two XAInterfaceIDs, return true if same
+ */
+XAboolean XACommon_EqualIIds(XAInterfaceID idA, XAInterfaceID idB)
+{
+    XAboolean nodeOk;
+    XAuint16 nodeIdx;
+    if(idA==idB) return XA_BOOLEAN_TRUE;
+    if(!idA||!idB) return XA_BOOLEAN_FALSE;
+    if( idA->time_low == idB->time_low &&
+        idA->time_mid == idB->time_mid &&
+        idA->time_hi_and_version == idB->time_hi_and_version &&
+        idA->clock_seq == idB->clock_seq)
+        {
+            nodeOk = XA_BOOLEAN_TRUE;
+            for(nodeIdx = 0; nodeIdx < sizeof(idA->node); nodeIdx++ )
+            {
+                if(idA->node[nodeIdx] != idB->node[nodeIdx])
+                {
+                    nodeOk = XA_BOOLEAN_FALSE;
+                    break;
+                }
+            }
+            if(nodeOk)
+            {
+                return XA_BOOLEAN_TRUE;
+            }
+        }
+    return XA_BOOLEAN_FALSE;
+}
+
+/* Check source availability and content type. Return error only if we are sure
+ * content is not valid, otherwise let adaptation try to identify and use content.
+ * @param type: on return, contains content type, if known.
+ * @return Success code
+ */
+XAresult XACommon_CheckDataSource(XADataSource* source, XAMediaType* type)
+{
+    XAresult ret=XA_RESULT_SUCCESS;
+    XAchar* fname=NULL;
+    XAchar* mime=NULL;
+    XAboolean isLocal=XA_BOOLEAN_FALSE;
+
+
+    if(!source || !source->pLocator)
+    {
+        DEBUG_ERR("Invalid XADataSource structure!!");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check URI availability */
+    if( *(XAuint32*)(source->pLocator) == XA_DATALOCATOR_URI )
+    {
+        fname = (XAchar*)((XADataLocator_URI*)(source->pLocator))->URI;
+        /* check protocol prefix */
+        if(strstr((char*)fname,":///"))
+        {
+            if(strncmp((char*)fname, "file:///", 8) == 0)
+            {
+                isLocal=XA_BOOLEAN_TRUE;
+                fname += 8;
+            }
+            else
+            {   /* add support for other protocols if needed */
+                isLocal=XA_BOOLEAN_FALSE;
+            }
+        }
+        else
+        {
+            isLocal=XA_BOOLEAN_TRUE;
+        }
+        if(isLocal)
+        {
+            FILE* file=fopen((char*)fname, "r");
+            if(!file)
+            {
+                DEBUG_INFO_A1("%s not found from filesystem", fname);
+                ret = XA_RESULT_CONTENT_NOT_FOUND;
+            }
+            else
+            {
+                fclose(file);
+            }
+        }
+    }
+
+    /* check content type */
+    if( type )
+    {
+        if(source->pFormat)
+        {
+            switch( *(XAuint32*)source->pFormat )
+            {
+                case XA_DATAFORMAT_MIME:
+                {
+                    /* try to parse mimetype first */
+                    mime = ((XADataFormat_MIME*)(source->pFormat))->mimeType;
+                    if(strncmp((char*)mime,"audio",5)==0)
+                    {
+                        *type = XA_MEDIATYPE_AUDIO;
+                    }
+                    else if(strncmp((char*)mime,"video",5)==0)
+                    {
+                        *type = XA_MEDIATYPE_VIDEO;
+                    }
+                    else if(strncmp((char*)mime,"image",5)==0)
+                    {
+                        *type = XA_MEDIATYPE_IMAGE;
+                    }
+                    else
+                    {
+                        /* try to parse containertype next */
+                        switch( ((XADataFormat_MIME*)(source->pFormat))->containerType )
+                        {
+                            case XA_CONTAINERTYPE_M4A:
+                            case XA_CONTAINERTYPE_MP3:
+                            case XA_CONTAINERTYPE_WAV:
+                            case XA_CONTAINERTYPE_XMF_0:
+                            case XA_CONTAINERTYPE_XMF_1:
+                            case XA_CONTAINERTYPE_XMF_2:
+                            case XA_CONTAINERTYPE_XMF_3:
+                            case XA_CONTAINERTYPE_XMF_GENERIC:
+                            case XA_CONTAINERTYPE_AMR:
+                            case XA_CONTAINERTYPE_AAC:
+                            case XA_CONTAINERTYPE_3GA:
+                            case XA_CONTAINERTYPE_DMF:
+                            case XA_CONTAINERTYPE_SMF:
+                            case XA_CONTAINERTYPE_MOBILE_DLS:
+                                *type = XA_MEDIATYPE_AUDIO;
+                                break;
+
+                            case XA_CONTAINERTYPE_ASF:
+                            case XA_CONTAINERTYPE_AVI:
+                            case XA_CONTAINERTYPE_MP4:
+                            case XA_CONTAINERTYPE_MPEG_ES:
+                            case XA_CONTAINERTYPE_MPEG_PS:
+                            case XA_CONTAINERTYPE_MPEG_TS:
+                            case XA_CONTAINERTYPE_QT:
+                            case XA_CONTAINERTYPE_3GPP:
+                            case XA_CONTAINERTYPE_RM:
+                                *type = XA_MEDIATYPE_VIDEO;
+                                break;
+
+                            case XA_CONTAINERTYPE_BMP:
+                            case XA_CONTAINERTYPE_JPG:
+                            case XA_CONTAINERTYPE_JPG2000:
+                                *type = XA_MEDIATYPE_IMAGE;
+                                break;
+
+                            case XA_CONTAINERTYPE_RAW:
+                            case XA_CONTAINERTYPE_UNSPECIFIED:
+                            default:
+                                *type = XA_MEDIATYPE_UNKNOWN;
+                                break;
+                        }
+                    }
+                }
+                break;
+
+                case XA_DATAFORMAT_PCM:
+                    *type = XA_MEDIATYPE_AUDIO;
+                break;
+
+                case XA_DATAFORMAT_RAWIMAGE:
+                    *type = XA_MEDIATYPE_IMAGE;
+                break;
+
+                default:
+                    *type = XA_MEDIATYPE_UNKNOWN;
+                    DEBUG_INFO("Warning: unknown dataformat");
+                break;
+            }
+        }
+        else
+        {
+            DEBUG_ERR("Warning: no data format set");
+            *type = XA_MEDIATYPE_UNKNOWN;
+        }
+
+        /* Expand this list if add new supported media type */
+        /* If media type unknow check it from file extension */
+        if(*type == XA_MEDIATYPE_UNKNOWN && fname)
+        {
+            if( (strstr((char*)fname,".wav")) || (strstr((char*)fname,".mid"))
+                || (strstr((char*)fname,".amr")))
+            {
+                *type = XA_MEDIATYPE_AUDIO;
+            }
+            if( (strstr((char*)fname,".avi")) || (strstr((char*)fname,".ogg")) )
+            {
+
+            }
+            if(strstr((char*)fname,".jpg"))
+            {
+                *type = XA_MEDIATYPE_IMAGE;
+            }
+        }
+    }
+    return ret;
+}
+
+/* Validate XADataSink and XADataSrc object creation parameters.
+ * @return Success code
+ */
+XAresult XACommon_ValidateDataLocator(XAuint32 pCounter, void* pSnk, ... )
+{
+    va_list argptr;
+    XAuint32 counter = 0;
+    XADataLocator_URI* uri = NULL;
+    XADataLocator_NativeDisplay* display = NULL;
+    XADataLocator_OutputMix* omix = NULL;
+    XADataLocator_Address* address = NULL;
+    XADataLocator_IODevice* iodevice = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+    XADataSink* xaSnk = NULL;
+    DEBUG_API("->XACommon_ValidateDataLocator");
+
+    xaSnk = (XADataSink*)pSnk;
+
+    /* Initialize variable arguments. */
+    //va_start (argptr, xaSnk); TL: Replaced with:
+  	va_start (argptr, pSnk);    
+    while( counter < pCounter )
+    {
+        if( counter > 0)
+        {
+            /*XADataSink and XADataSrc are equivalent, use XADataSink for both*/
+            xaSnk = va_arg(argptr, XADataSink*);
+        }
+        if( !xaSnk )
+        {   /*NULL sinks/sources are possible, not checked here*/
+            counter++;
+            continue;
+        }
+        else if( !xaSnk->pLocator )
+        {
+            DEBUG_ERR_A1("NULL XADataLocator in parameter %d",(int)counter);
+            ret = XA_RESULT_PARAMETER_INVALID;
+            va_end(argptr);
+    				DEBUG_API("<-XACommon_ValidateDataLocator");
+    				return ret;
+        }
+        switch ( *(XAuint32*)(xaSnk->pLocator) )
+        {
+            case XA_DATALOCATOR_URI:
+                DEBUG_INFO("XA_DATALOCATOR_URI");
+                uri = (XADataLocator_URI*)xaSnk->pLocator;
+                if( !uri->URI && !xaSnk->pFormat )
+                {
+                    DEBUG_ERR("Invalid parameter set for uri ");
+                    ret = XA_RESULT_PARAMETER_INVALID;
+                }
+                break;
+            case XA_DATALOCATOR_NATIVEDISPLAY:
+                DEBUG_INFO("Sink locator type - XA_DATALOCATOR_NATIVEDISPLAY");
+                display = (XADataLocator_NativeDisplay*)(xaSnk->pLocator);
+                if( !display->hDisplay || !display->hWindow )
+                {
+                    /*No action at this time*/
+                    DEBUG_INFO("Warning - no display or window handle set");
+                }
+                break;
+            case XA_DATALOCATOR_OUTPUTMIX:
+                DEBUG_INFO("Sink locator type - XA_DATALOCATOR_OUTPUTMIX");
+                {
+                    omix = (XADataLocator_OutputMix*)(xaSnk->pLocator);
+                    if ( !omix->outputMix )
+                    {
+                        DEBUG_ERR("Invalid parameter set for outputmix");
+                        ret = XA_RESULT_PARAMETER_INVALID;
+                    }
+                }
+                break;
+            case XA_DATALOCATOR_ADDRESS:
+                DEBUG_INFO("XA_DATALOCATOR_ADDRESS");
+                address = (XADataLocator_Address*)(xaSnk->pLocator);
+                if( !address->pAddress && !xaSnk->pFormat )
+                {
+                    DEBUG_ERR("Invalid parameter set for address");
+                    ret = XA_RESULT_PARAMETER_INVALID;
+                }
+                break;
+            case XA_DATALOCATOR_IODEVICE:
+                DEBUG_INFO("XA_DATALOCATOR_IODEVICE");
+                iodevice = (XADataLocator_IODevice*)(xaSnk->pLocator);
+                if( iodevice->device )
+                {
+                    DEBUG_INFO("Media object as IODevice");
+                }
+                else
+                {
+                    DEBUG_INFO("Iodevice id used");
+                }
+                break;
+            default:
+                DEBUG_ERR("Incorrect data locator for sink.")
+                ret = XA_RESULT_PARAMETER_INVALID;
+                break;
+        }
+        counter ++;
+    }
+    va_end(argptr);
+    DEBUG_API("<-XACommon_ValidateDataLocator");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaconfigextensionsitf.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include "xaglobals.h"
+#include "xaconfigextensionsitf.h"
+
+static XAConfigExtensionsItfImpl* GetImpl(XAConfigExtensionsItf self)
+{
+    if( self )
+    {
+        XAConfigExtensionsItfImpl* impl = (XAConfigExtensionsItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAConfigExtensionsItf implementation
+ */
+XAresult XAConfigExtensionsItfImpl_SetConfiguration(
+                            XAConfigExtensionsItf self,
+                            const XAchar* configKey,
+                            XAuint32 valueSize,
+                            const void* pConfigValue)
+{
+    XAConfigExtensionsItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAConfigExtensionsItfImpl_SetConfiguration");
+    if( !impl || !configKey )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAConfigExtensionsItfImpl_SetConfiguration");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    if( strcmp((char *)configKey, CPCONFIGKEY) == 0
+        && pConfigValue )
+    {
+        XAuint8 numValue = *(XAuint8*)(pConfigValue);
+        impl->testbufferconf = numValue;
+        if( numValue>4 )
+        {   /* Conformance tester uses only reference-to-string values, try to parse string to integer
+             * First char is enough since legal values are 0 to 4
+             */
+            XAchar* chVal = *(XAchar**)(pConfigValue);
+            if(chVal)
+            {
+                impl->testbufferconf = *chVal;
+                numValue = (*chVal) - 48;
+            }
+            if( numValue>4 )
+            {
+                res = XA_RESULT_PARAMETER_INVALID;
+            }
+        }
+        DEBUG_INFO_A1("CP conf value %d", numValue);
+        if(res == XA_RESULT_SUCCESS)
+        {
+#ifdef _GSTREAMER_BACKEND_   
+            /*Inform adaptation*/
+            if( impl->ctx )
+            {
+                res = XAAdaptationBase_SetCPConfiguration(impl->ctx,impl->testbufferconf);
+            }
+#endif
+        }
+    }
+    else
+    {
+        DEBUG_ERR("Unknown key or invalid value pointer");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API("<-XAConfigExtensionsItfImpl_SetConfiguration");
+    return res;
+}
+
+XAresult XAConfigExtensionsItfImpl_GetConfiguration(
+                            XAConfigExtensionsItf self,
+                            const XAchar* configKey,
+                            XAuint32* pValueSize,
+                            void* pConfigValue)
+{
+    XAConfigExtensionsItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAConfigExtensionsItfImpl_GetConfiguration");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAConfigExtensionsItfImpl_SetConfiguration");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( strcmp((char *)configKey, CPCONFIGKEY) == 0
+            && pValueSize
+            && sizeof(XAuint8) <= *pValueSize
+            && pConfigValue )
+    {
+        memcpy(*(XAuint8**)pConfigValue, &(impl->testbufferconf),1);
+        *pValueSize = sizeof(XAuint8);
+        res = XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API("<-XAConfigExtensionsItfImpl_GetConfiguration");
+    return res;
+}
+
+#ifdef _GSTREAMER_BACKEND_   
+XAresult XAConfigExtensionsItfImpl_SetContext(XAConfigExtensionsItfImpl* self,XAAdaptationBaseCtx* adptctx)
+    {
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAConfigExtensionsItfImpl_SetContext");
+    if( adptctx && self)
+    {
+        self->ctx = adptctx;
+        res = XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API("<-XAConfigExtensionsItfImpl_SetContext");
+    return res;
+    }
+#endif
+/**
+ * XAConfigExtensionsItfImpl -specific methods
+ **/
+XAConfigExtensionsItfImpl* XAConfigExtensionsItfImpl_Create()
+{
+    XAConfigExtensionsItfImpl* self = (XAConfigExtensionsItfImpl*)
+        calloc(1,sizeof(XAConfigExtensionsItfImpl));
+    DEBUG_API("->XAConfigExtensionsItfImpl_Create");
+
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.GetConfiguration =
+            XAConfigExtensionsItfImpl_GetConfiguration;
+        self->itf.SetConfiguration =
+            XAConfigExtensionsItfImpl_SetConfiguration;
+        /* init variables */
+        self->self = self;
+    }
+    DEBUG_API("<-XAConfigExtensionsItfImpl_Create");
+    return self;
+}
+
+void XAConfigExtensionsItfImpl_Free(XAConfigExtensionsItfImpl* self)
+{
+    DEBUG_API("->XAConfigExtensionsItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAConfigExtensionsItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaconfigextensionsitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,68 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XACONFIGEXTENSIONSITF_H
+#define XACONFIGEXTENSIONSITF_H
+
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#endif
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAConfigExtensionsItf implementation */
+typedef struct XAConfigExtensionsItfImpl_
+{
+    /* parent interface */
+    struct XAConfigExtensionsItf_ itf;
+    /* pointer to self */
+    struct XAConfigExtensionsItfImpl_* self;
+    /* variables */
+    XAuint8 testbufferconf;
+#ifdef _GSTREAMER_BACKEND_    
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *ctx;
+#endif    
+} XAConfigExtensionsItfImpl;
+
+/* Base interface XAConfigExtensionsItf implementation */
+XAresult XAConfigExtensionsItfImpl_SetConfiguration(
+                            XAConfigExtensionsItf self,
+                            const XAchar* configKey,
+                            XAuint32 valueSize,
+                            const void* pConfigValue);
+
+XAresult XAConfigExtensionsItfImpl_GetConfiguration(
+                            XAConfigExtensionsItf self,
+                            const XAchar* configKey,
+                            XAuint32* pValueSize,
+                            void* pConfigValue);
+#ifdef _GSTREAMER_BACKEND_
+XAresult XAConfigExtensionsItfImpl_SetContext(XAConfigExtensionsItfImpl* self,XAAdaptationBaseCtx* ctx);
+#endif
+/* XAConfigExtensionsItfImpl -specific methods */
+XAConfigExtensionsItfImpl* XAConfigExtensionsItfImpl_Create(void);
+void XAConfigExtensionsItfImpl_Free(XAConfigExtensionsItfImpl* self);
+
+#endif /* XACONFIGEXTENSIONSITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xadebug.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+/* Define all debug macros here */
+
+#ifndef XADEBUG_H
+#define XADEBUG_H
+
+#define _DEBUG_API_     1
+#define _DEBUG_ERR_     2
+#define _DEBUG_INFO_    4
+
+/*
+ * Define wanted debug level via DEBUG_LEVEL macro:
+ * _DEPUG_API_ - prints entry/exit messages in the methods
+ * _DEBUG_ERR_ - prints error messages
+ * _DEBUG_INFO_ - prints info messages
+ *
+ * e.g. DEBUG_LEVEL ( _DEBUG_API_ | _DEBUG_ERR_ ) prints entry/exit and
+ * error messages.
+ */
+#define DEBUG_LEVEL 0
+
+
+/*********************************************************/
+/*
+ * Debug definitions do not touch
+ */
+#ifdef _DEBUG
+#include <stdio.h>
+    #if ( DEBUG_LEVEL & _DEBUG_API_ )
+        #define DEBUG_API(X) printf(X"\n");
+        #define DEBUG_API_A1(X,A1) printf(X"\n",A1);
+        #define DEBUG_API_A2(X,A1,A2) printf(X"\n",A1,A2);
+        #define DEBUG_API_A3(X,A1,A2,A3) printf(X"\n",A1,A2,A3);
+        #define DEBUG_API_A4(X,A1,A2,A3,A4) printf(X"\n",A1,A2,A3,A4);
+    #else // ( DEBUG_LEVEL & _DEBUG_API_ ) 
+        #define DEBUG_API(X);
+        #define DEBUG_API_A1(X,A1);
+        #define DEBUG_API_A2(X,A1,A2);
+        #define DEBUG_API_A3(X,A1,A2,A3);
+        #define DEBUG_API_A4(X,A1,A2,A3,A4);
+    #endif // ( DEBUG_LEVEL & _DEBUG_API_ ) 
+
+    #if ( DEBUG_LEVEL & _DEBUG_ERR_ )
+        #define DEBUG_ERR(X) printf("  ERR: "X"\n");
+        #define DEBUG_ERR_A1(X,A1) printf("  ERR: "X"\n",A1);
+        #define DEBUG_ERR_A2(X,A1,A2) printf("  ERR: "X"\n",A1,A2);
+        #define DEBUG_ERR_A3(X,A1,A2,A3) printf("  ERR: "X"\n",A1,A2,A3);
+    #else // ( DEBUG_LEVEL & _DEBUG_ERR_ ) 
+        #define DEBUG_ERR(X);
+        #define DEBUG_ERR_A1(X,A1);
+        #define DEBUG_ERR_A2(X,A1,A2);
+        #define DEBUG_ERR_A3(X,A1,A2,A3);
+    #endif // ( DEBUG_LEVEL & _DEBUG_ERR_ ) 
+
+    #if ( DEBUG_LEVEL & _DEBUG_INFO_ )
+        #define DEBUG_INFO(X) printf("  :"X"\n");
+        #define DEBUG_INFO_A1(X,A1) printf("  :"X"\n",A1);
+        #define DEBUG_INFO_A2(X,A1,A2) printf("  :"X"\n",A1,A2);
+        #define DEBUG_INFO_A3(X,A1,A2,A3) printf("  :"X"\n",A1,A2,A3);
+        #define DEBUG_INFO_A4(X,A1,A2,A3,A4) printf("  :"X"\n",A1,A2,A3,A4);
+    #else // ( DEBUG_LEVEL & _DEBUG_INFO_ ) 
+        #define DEBUG_INFO(X);
+        #define DEBUG_INFO_A1(X,A1);
+        #define DEBUG_INFO_A2(X,A1,A2);
+        #define DEBUG_INFO_A3(X,A1,A2,A3);
+        #define DEBUG_INFO_A4(X,A1,A2,A3,A4);
+    #endif // ( DEBUG_LEVEL & _DEBUG_INFO_ )
+
+#else 
+
+        #define DEBUG_API(X)
+        #define DEBUG_API_A1(X,A1)
+        #define DEBUG_API_A2(X,A1,A2)
+        #define DEBUG_API_A3(X,A1,A2,A3)
+        #define DEBUG_API_A4(X,A1,A2,A3,A4)
+
+        #define DEBUG_ERR(X)
+        #define DEBUG_ERR_A1(X,A1)
+        #define DEBUG_ERR_A2(X,A1,A2)
+        #define DEBUG_ERR_A3(X,A1,A2,A3)
+
+        #define DEBUG_INFO(X)
+        #define DEBUG_INFO_A1(X,A1)
+        #define DEBUG_INFO_A2(X,A1,A2)
+        #define DEBUG_INFO_A3(X,A1,A2,A3)
+        #define DEBUG_INFO_A4(X,A1,A2,A3,A4);
+#endif /* _DEBUG */
+
+#endif /* XADEBUG_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xadynamicsourceitf.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xadynamicsourceitf.h"
+#ifdef _GSTREAMER_BACKEND_   
+#include "XAAdaptationContextBase.h"
+#include "XADynamicSourceItfAdaptation.h"
+#endif
+
+/*****************************************************************************
+ * Base interface XADynamicSourceItf implementation
+ *****************************************************************************/
+
+/* XAResult XADynamicSourceItfImpl_SetSource
+ * Description: Sets the data source for the object.
+ */
+XAresult XADynamicSourceItfImpl_SetSource(XADynamicSourceItf self,
+                                          XADataSource *pDataSource)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XADynamicSourceItfImpl* impl = (XADynamicSourceItfImpl*)(*self);
+    DEBUG_API("->XADynamicSourceItfImpl_SetSource");
+    /* check casting */
+    if( !impl ||  impl != impl->self || !pDataSource )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XADynamicSourceItfImpl_SetSource");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_   
+    if( !impl->adaptCtx )
+    {
+        DEBUG_ERR("Adaptation not ready!!");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("<-XADynamicSourceItfImpl_SetSource");
+        res = XA_RESULT_INTERNAL_ERROR;
+    }
+    else
+    {
+        res = XACommon_CheckDataSource(pDataSource,NULL);
+        if(res==XA_RESULT_SUCCESS)
+        {
+            res = XADynamicSourceItfAdapt_SetSource(impl->adaptCtx, pDataSource );
+        }
+    }
+#endif
+    DEBUG_API("<-XADynamicSourceItfImpl_SetSource");
+    return res;
+}
+
+/*****************************************************************************
+ * XADynamicSourceItfImpl -specific methods
+ *****************************************************************************/
+#ifdef _GSTREAMER_BACKEND_   
+
+/* XADynamicSourceItfImpl* XADynamicSourceItfImpl_Create()
+ * Description: Allocate and initialize DynamicSourceItfImpl
+ */
+XADynamicSourceItfImpl* XADynamicSourceItfImpl_Create( XAAdaptationBaseCtx *adaptCtx )
+{
+    XADynamicSourceItfImpl* self = (XADynamicSourceItfImpl*)
+        calloc(1,sizeof(XADynamicSourceItfImpl));
+    DEBUG_API("->XADynamicSourceItfImpl_Create");
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.SetSource = XADynamicSourceItfImpl_SetSource;
+        /* init variables */
+        self->adaptCtx = adaptCtx;
+        self->self = self;
+    }
+    DEBUG_API("<-XADynamicSourceItfImpl_Create");
+    return self;
+}
+#endif
+/* void XADynamicSourceItfImpl_Free(XADynamicSourceItfImpl* self)
+ * Description: Free all resources reserved at XADynamicSourceItfImpl_Create
+ */
+void XADynamicSourceItfImpl_Free(XADynamicSourceItfImpl* self)
+{
+    DEBUG_API("->XADynamicSourceItfImpl_Free");
+    assert( self==self->self );
+    free( self );
+    DEBUG_API("<-XADynamicSourceItfImpl_Free");
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xadynamicsourceitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XADYNAMICSOURCEITF_H
+#define XADYNAMICSOURCEITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_   
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XADynamicSourceItf implementation */
+typedef struct XADynamicSourceItfImpl_
+{
+    /* parent interface */
+    struct XADynamicSourceItf_ itf;
+    /* pointer to self */
+    struct XADynamicSourceItfImpl_* self;
+#ifdef _GSTREAMER_BACKEND_   
+    /* variables */
+    XAAdaptationBaseCtx *adaptCtx;
+#endif
+} XADynamicSourceItfImpl;
+
+/** METHODS **/
+
+/* Base interface XADynamicSourceItf implementation
+ * See API Specification for method documentation
+ */
+XAresult XADynamicSourceItfImpl_SetSource(XADynamicSourceItf self,
+                                        XADataSource *pDataSource);
+
+#ifdef _GSTREAMER_BACKEND_   
+/* XADynamicSourceItfImpl -specific methods */
+XADynamicSourceItfImpl* XADynamicSourceItfImpl_Create(XAAdaptationBaseCtx *adaptCtx);
+#endif
+void XADynamicSourceItfImpl_Free(XADynamicSourceItfImpl* self);
+
+#endif /* XADYNAMICSOURCEITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xadynintmgmtitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,467 @@
+/*
+* 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 <stdlib.h>
+#include <assert.h>
+
+#include "openmaxalwrapper.h"
+#include "xadynintmgmtitf.h"
+#include "xadebug.h"
+
+/* XADIMItfImpl* GetImpl(XADIMItf self)
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XADIMItfImpl* GetImpl(XADynamicInterfaceManagementItf self)
+{
+    if( self )
+    {
+        XADIMItfImpl* impl = (XADIMItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base Interface XADynamicInterfaceManagementItf implementation
+ **/
+
+/* XAresult XADIMItfImpl_AddInterface
+ * Optionally asynchronous method for exposing an interface on an object.
+ */
+XAresult XADIMItfImpl_AddInterface(XADynamicInterfaceManagementItf self,
+                                   const XAInterfaceID iid,
+                                   XAboolean async)
+{
+    XADIMItfImpl* impl = GetImpl(self);
+    XAresult retval = XA_RESULT_SUCCESS;
+    DEBUG_API("->XADIMItfImpl_AddInterface");
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XADIMItfImpl_AddInterface");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( async )
+    {
+        /* invoke asynchronously */
+        /* check if another async operation is processed */
+        if(impl->asyncOngoing)
+        {
+            /* abort ongoing operation */
+            XAImpl_CancelThread(impl->asyncThr);
+        }
+        impl->asyncOngoing = XA_BOOLEAN_TRUE;
+        impl->asyncID = iid;
+        if(XAImpl_StartThread(impl->asyncThr, NULL,
+                &XADIMItfImpl_AsyncAddItf,(void*)(self)))
+        {
+            impl->asyncOngoing = XA_BOOLEAN_FALSE;
+            retval = XA_RESULT_RESOURCE_ERROR;
+        }
+        else
+        {
+            retval = XA_RESULT_SUCCESS;
+        }
+    }
+    else
+    {
+        /* invoke synchronously */
+        retval = XADIMItfImpl_DoAddItf(impl, iid);
+    }
+
+    DEBUG_API_A1("<-XADIMItfImpl_AddInterface %lu", retval);
+    return retval;
+}
+
+/* XAresult XADIMItfImpl_RemoveInterface
+ * Synchronous method for removing a dynamically exposed interface on an object.
+ */
+XAresult XADIMItfImpl_RemoveInterface(XADynamicInterfaceManagementItf self,
+                                          const XAInterfaceID iid)
+{
+    XADIMItfImpl* impl = GetImpl(self);
+    XAresult retval = XA_RESULT_SUCCESS;
+    DEBUG_API("->XADIMItfImpl_RemoveInterface");
+
+    if( impl )
+    {
+        XAObjItfMapEntry *mapEntry = NULL;
+        if(impl->parent)
+        {
+            mapEntry = XAObjectItfImpl_GetItfEntry(impl->parent, iid);
+        }
+        if( mapEntry && mapEntry->isDynamic )
+        {
+            if( (mapEntry->pItf) )
+            {
+                if( impl->DoRemoveItfImpl )
+                {
+                    retval = impl->DoRemoveItfImpl(impl->parent, mapEntry);
+                }
+                else
+                {
+                    DEBUG_ERR("XADIMItfImpl_RemoveInterface: Object has specified dynamic itfs but not implemented DoRemoveItfImpl!!!");
+                    retval = XA_RESULT_INTERNAL_ERROR;
+                }
+            }
+            else
+            {
+                DEBUG_ERR("XADIMItfImpl_RemoveInterface interface not exposed");
+                retval = XA_RESULT_PRECONDITIONS_VIOLATED;
+            }
+        }
+        else /*( mapEntry && mapEntry->isDynamic )*/
+        {   /* interface is not supported for dynamic management */
+            DEBUG_ERR("XADIMItfImpl_RemoveInterface interface not supported");
+            retval = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
+    }
+    else
+    {
+        retval = XA_RESULT_PARAMETER_INVALID;
+        DEBUG_ERR("XADIMItfImpl_RemoveInterface: INVALID args");
+    }
+
+    DEBUG_API_A1("<-XADIMItfImpl_RemoveInterface %lu", retval);
+    return retval;
+}
+
+/* XAresult XADIMItfImpl_ResumeInterface
+ * Optionally asynchronous method for resuming a dynamically exposed interface on the object.
+ */
+XAresult XADIMItfImpl_ResumeInterface(XADynamicInterfaceManagementItf self,
+                                      const XAInterfaceID iid,
+                                      XAboolean async)
+{
+    XADIMItfImpl* impl = GetImpl(self);
+    XAresult retval = XA_RESULT_SUCCESS;
+    DEBUG_API("->XADIMItfImpl_ResumeInterface");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XADIMItfImpl_ResumeInterface");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( async )
+    {
+        /* invoke asynchronously */
+        /* check if another async operation is processed */
+        if(impl->asyncOngoing)
+        {
+            /* abort ongoing operation */
+            XAImpl_CancelThread(impl->asyncThr);
+        }
+        impl->asyncOngoing = XA_BOOLEAN_TRUE;
+        impl->asyncID = iid;
+        if(XAImpl_StartThread(impl->asyncThr, NULL,
+                &XADIMItfImpl_AsyncResumeItf,(void*)(self)))
+        {
+            impl->asyncOngoing = XA_BOOLEAN_FALSE;
+            retval = XA_RESULT_RESOURCE_ERROR;
+        }
+        else
+        {
+            retval = XA_RESULT_SUCCESS;
+        }
+    }
+    else
+    {
+        /* invoke synchronously */
+        retval = XADIMItfImpl_DoResumeItf(impl, iid);
+    }
+
+    DEBUG_API_A1("<-XADIMItfImpl_ResumeInterface %lu", retval);
+    return retval;
+}
+
+/* XAresult XADIMItfImpl_RegisterCallback
+ * Registers a callback on the object
+ */
+XAresult XADIMItfImpl_RegisterCallback(XADynamicInterfaceManagementItf self,
+                                       xaDynamicInterfaceManagementCallback callback,
+                                       void * pContext)
+{
+    XADIMItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XADIMItfImpl_RegisterCallback");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XADIMItfImpl_RegisterCallback");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    impl->dimCb = callback;
+    impl->dimCbContext = pContext;
+    impl->dimCbPtrToSelf = self;
+
+    DEBUG_API("<-XADIMItfImpl_RegisterCallback");
+    return XA_RESULT_SUCCESS;
+}
+
+/**
+ * XADIMItfImpl -specific methods
+ **/
+
+/* XADIMItfImpl* XADIMItfImpl_Create()
+ * Description: Allocate and initialize DIMItfImpl
+ */
+XADIMItfImpl* XADIMItfImpl_Create()
+{
+    XADIMItfImpl *self = (XADIMItfImpl*)calloc(1,sizeof(XADIMItfImpl));
+    DEBUG_API("->XADIMItfImpl_Create");
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.AddInterface = XADIMItfImpl_AddInterface;
+        self->itf.RemoveInterface = XADIMItfImpl_RemoveInterface;
+        self->itf.ResumeInterface = XADIMItfImpl_ResumeInterface;
+        self->itf.RegisterCallback = XADIMItfImpl_RegisterCallback;
+
+        /* init variables */
+        self->asyncOngoing = XA_BOOLEAN_FALSE;
+        self->dimCbPtrToSelf = NULL;
+
+        self->self = self;
+        if( XAImpl_CreateThreadHandle(&(self->asyncThr)) != XA_RESULT_SUCCESS )
+        {
+            free(self);
+            self = NULL;
+        }
+    }
+    DEBUG_API("<-XADIMItfImpl_Create");
+    return self;
+}
+
+/* void XADIMItfImpl_Free(XADIMItfImpl* self)
+ * Description: Free all resources reserved at XADIMItfImpl_Create
+ */
+void XADIMItfImpl_Free(XADIMItfImpl* self)
+{
+    DEBUG_API("->XADIMItfImpl_Free");
+    assert(self==self->self);
+    XAImpl_DeleteThreadHandle(self->asyncThr);
+    free(self);
+    DEBUG_API("<-XADIMItfImpl_Free");
+}
+
+/* void XADIMItfImpl_Init
+ * Description: Initialize DIM interface. Mandatory to call if dynamic
+ * interfaces are supported by object.
+ */
+void XADIMItfImpl_Init( XADIMItfImpl* self,
+                           XAObjectItf parent,
+                           xaDoAddItfImpl doAdd,
+                           xaDoResumeItfImpl doResume,
+                           xaDoRemoveItfImpl doRemove)
+{
+    DEBUG_API("->XADIMItfImpl_Init");
+
+    assert(self==self->self && parent && doAdd && doResume && doRemove);
+    self->parent = parent;
+    self->DoAddItfImpl = doAdd;
+    self->DoResumeItfImpl = doResume;
+    self->DoRemoveItfImpl = doRemove;
+
+    DEBUG_API("<-XADIMItfImpl_Init");
+}
+
+/* void XADIMItfImpl_SendCbEvent
+ * Description: Object can use this method to send resource events
+ */
+void XADIMItfImpl_SendCbEvent( XADIMItfImpl* self,
+                                   XAuint32 event,
+                                   XAresult result,
+                                   const XAInterfaceID iid )
+{
+    DEBUG_API("->XADIMItfImpl_SendCbEvent");
+    if( self->dimCb )
+     {
+        self->dimCb((XADynamicInterfaceManagementItf)(self), self->dimCbContext,
+                      event, result, iid);
+     }
+    DEBUG_API("<-XADIMItfImpl_SendCbEvent");
+}
+
+/* void* XADIMItfImpl_AsyncAddItf
+ * Description: Launch AddItf from async thread.
+ */
+void* XADIMItfImpl_AsyncAddItf(void* args)
+{
+    XAresult retval = XA_RESULT_SUCCESS;
+    XADIMItfImpl* impl = GetImpl(args);
+    DEBUG_API("->XADIMItfImpl_AsyncAddItf");
+
+    if( impl )
+    {
+        retval = XADIMItfImpl_DoAddItf(impl, impl->asyncID);
+        if( impl->dimCb )
+        {
+            impl->dimCb((XADynamicInterfaceManagementItf)(args), impl->dimCbContext,
+                         XA_DYNAMIC_ITF_EVENT_ASYNC_TERMINATION, retval, impl->asyncID);
+        }
+        impl->asyncOngoing = XA_BOOLEAN_FALSE;
+        XAImpl_ExitThread(impl->asyncThr);
+    }
+    else
+    {
+        DEBUG_ERR("XADIMItfImpl_AsyncAddItf: INVALID args");
+    }
+    
+
+    DEBUG_API("<-XADIMItfImpl_AsyncAddItf");
+    return NULL;
+}
+
+/* XAresult XADIMItfImpl_DoAddItf
+ * Description: Handle Itf dynamic addition and call object-specific parts.
+ *              Launched either from async thread or directly.
+ */
+XAresult XADIMItfImpl_DoAddItf(XADIMItfImpl* impl,
+                                const XAInterfaceID iid)
+{
+    XAresult retval = XA_RESULT_SUCCESS;
+    DEBUG_API("->XADIMItfImpl_DoAddItf");
+
+    if( impl )
+    {
+        XAObjItfMapEntry *mapEntry = NULL;
+        if(impl->parent)
+        {
+            mapEntry = XAObjectItfImpl_GetItfEntry(impl->parent, iid);
+        }
+        if( mapEntry && mapEntry->isDynamic )
+        {
+            if( !(mapEntry->pItf) )
+            {
+                if( impl->DoAddItfImpl )
+                {
+                    retval = impl->DoAddItfImpl(impl->parent, mapEntry);
+                }
+                else
+                {
+                    DEBUG_ERR("XADIMItfImpl_DoAddItf: Object has specified dynamic itfs but not implemented DoAddItfImpl!!!");
+                    retval = XA_RESULT_INTERNAL_ERROR;
+                }
+            }
+            else
+            {
+                DEBUG_ERR("XADIMItfImpl_DoAddItf interface already exposed");
+                retval = XA_RESULT_PRECONDITIONS_VIOLATED;
+            }
+        }
+        else /*( mapEntry && mapEntry->isDynamic )*/
+        {   /* interface is not supported for dynamic management */
+            DEBUG_ERR("XADIMItfImpl_DoAddItf interface not supported");
+            retval = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
+    }
+    else
+    {
+        retval = XA_RESULT_INTERNAL_ERROR;
+        DEBUG_ERR("XADIMItfImpl_DoAddItf: INVALID args");
+    }
+
+    DEBUG_API("<-XADIMItfImpl_DoAddItf");
+    return retval;
+}
+
+/* void* XADIMItfImpl_AsyncResumeItf
+ * Description: Launch ResumeItf from async thread.
+ */
+void* XADIMItfImpl_AsyncResumeItf(void* args)
+{
+    XAresult retval = XA_RESULT_SUCCESS;
+    XADIMItfImpl* impl = GetImpl(args);
+    DEBUG_API("->XADIMItfImpl_AsyncResumeItf");
+
+    if( impl )
+    {
+        retval = XADIMItfImpl_DoResumeItf(impl, impl->asyncID);
+        if( impl->dimCb )
+        {
+            impl->dimCb((XADynamicInterfaceManagementItf)(args), impl->dimCbContext,
+                         XA_DYNAMIC_ITF_EVENT_ASYNC_TERMINATION, retval, impl->asyncID);
+        }
+        impl->asyncOngoing = XA_BOOLEAN_FALSE;
+        XAImpl_ExitThread(impl->asyncThr);
+    }
+    else
+    {
+        DEBUG_ERR("XADIMItfImpl_AsyncResumeItf: INVALID args");
+    }
+    
+
+    DEBUG_API("<-XADIMItfImpl_AsyncResumeItf");
+    return NULL;
+}
+
+/* void XADIMItfImpl_DoResumeItf
+ * Description: Handle Itf dynamic resuming and call object-specific parts.
+ *              Launched either from async thread or directly.
+ */
+XAresult XADIMItfImpl_DoResumeItf(XADIMItfImpl* impl,
+                                const XAInterfaceID iid)
+{
+    XAresult retval = XA_RESULT_SUCCESS;
+    DEBUG_API("->XADIMItfImpl_DoResumeItf");
+
+    if( impl )
+    {
+        XAObjItfMapEntry *mapEntry = XAObjectItfImpl_GetItfEntry(impl->parent, iid);
+        if( mapEntry && mapEntry->isDynamic )
+        {
+            if( (!mapEntry->pItf) )
+            {
+                if( impl->DoResumeItfImpl )
+                {
+                    retval = impl->DoResumeItfImpl(impl->parent, mapEntry);
+                }
+                else
+                {
+                    DEBUG_ERR("XADIMItfImpl_DoResumeItf: Object has specified dynamic itfs but not implemented DoResumeItfImpl!!!");
+                    retval = XA_RESULT_INTERNAL_ERROR;
+                }
+            }
+            else
+            {
+                DEBUG_ERR("XADIMItfImpl_DoResumeItf interface already exposed");
+                retval = XA_RESULT_PRECONDITIONS_VIOLATED;
+            }
+        }
+        else /*( mapEntry && mapEntry->isDynamic )*/
+        {   /* interface is not supported for dynamic management */
+            DEBUG_ERR("XADIMItfImpl_DoResumeItf interface not supported");
+            retval = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
+    }
+    else
+    {
+        retval = XA_RESULT_INTERNAL_ERROR;
+        DEBUG_ERR("XADIMItfImpl_DoResumeItf: INVALID args");
+    }
+
+    DEBUG_API("<-XADIMItfImpl_DoResumeItf");
+    return retval;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xadynintmgmtitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XADYNINTMGMTITF_H
+#define XADYNINTMGMTITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaobjectitf.h"
+#include "xaplatform.h"
+
+/** MACROS **/
+
+/** TYPES **/
+/* object implementation-specific DIM methods */
+typedef XAresult (*xaDoAddItfImpl)(XAObjectItf self, XAObjItfMapEntry *mapEntry );
+typedef XAresult (*xaDoResumeItfImpl)(XAObjectItf self, XAObjItfMapEntry *mapEntry );
+typedef XAresult (*xaDoRemoveItfImpl)(XAObjectItf self, XAObjItfMapEntry *mapEntry );
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XADynamicInterfaceManagementItf implementation */
+typedef struct XADIMItfImpl_
+{
+    /* parent interface */
+    struct XADynamicInterfaceManagementItf_ itf;
+    /* pointer to self */
+    struct XADIMItfImpl_* self;
+
+    /* variables */
+    /* pointer to parent object */
+    XAObjectItf parent;
+    /* pointers to implementation-specific methods */
+    xaDoAddItfImpl    DoAddItfImpl;
+    xaDoResumeItfImpl DoResumeItfImpl;
+    xaDoRemoveItfImpl DoRemoveItfImpl;
+
+    /* client callback */
+    XADynamicInterfaceManagementItf dimCbPtrToSelf;
+    xaDynamicInterfaceManagementCallback dimCb;
+    void* dimCbContext;
+    XAImplThreadHandle asyncThr;
+    XAboolean asyncOngoing;
+    XAInterfaceID asyncID;
+
+} XADIMItfImpl;
+
+/* Base interface XADynamicInterfaceManagementItf implementation */
+XAresult XADIMItfImpl_AddInterface(XADynamicInterfaceManagementItf self,
+                                   const XAInterfaceID iid, XAboolean async);
+
+XAresult XADIMItfImpl_RemoveInterface(XADynamicInterfaceManagementItf self,
+                                      const XAInterfaceID iid);
+
+XAresult XADIMItfImpl_ResumeInterface(XADynamicInterfaceManagementItf self,
+                                      const XAInterfaceID iid, XAboolean async);
+
+XAresult XADIMItfImpl_RegisterCallback(XADynamicInterfaceManagementItf self,
+                                       xaDynamicInterfaceManagementCallback callback,
+                                       void * pContext);
+
+/* XADIMItfImpl -specific methods */
+XADIMItfImpl* XADIMItfImpl_Create(void);
+void XADIMItfImpl_Free(XADIMItfImpl* self);
+
+void XADIMItfImpl_Init( XADIMItfImpl* self,
+                           XAObjectItf parent,
+                           xaDoAddItfImpl doAdd,
+                           xaDoResumeItfImpl doResume,
+                           xaDoRemoveItfImpl doRemove);
+
+void XADIMItfImpl_SendCbEvent( XADIMItfImpl* self,
+                                XAuint32 event,
+                                XAresult result,
+                                const XAInterfaceID iid );
+
+/* methods for asynchronous service */
+void* XADIMItfImpl_AsyncAddItf(void* args);
+XAresult XADIMItfImpl_DoAddItf(XADIMItfImpl* impl, const XAInterfaceID iid);
+void* XADIMItfImpl_AsyncResumeItf(void* args);
+XAresult XADIMItfImpl_DoResumeItf(XADIMItfImpl* impl, const XAInterfaceID iid);
+
+
+#endif /* XADYNINTMGMTITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaequalizeritf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,605 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xaequalizeritf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAEqualizerItfAdaptation.h"
+#endif
+static const XAuint16 equalizerNumOfPresets = 0;
+
+/**
+ * XAEqualizerItfImpl* GetImpl(XAEqualizerItf self)
+ * Description: Validated interface pointer and cast it to implementations pointer.
+ **/
+static XAEqualizerItfImpl* GetImpl(XAEqualizerItf self)
+{
+    if(self)
+    {
+        XAEqualizerItfImpl *impl = (XAEqualizerItfImpl*)(*self);
+        if(impl && impl == impl->self)
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAEqualizerItf implementation
+ */
+
+/**
+ * XAresult XAEqualizerItfImpl_SetEnabled(XAEqualizerItf self,XAboolean enabled)
+ * Description: Enables the effect.
+ **/
+XAresult XAEqualizerItfImpl_SetEnabled(XAEqualizerItf self,XAboolean enabled)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAEqualizerItfImpl* impl = GetImpl(self);
+    
+    DEBUG_API("->XAEqualizerItfImpl_SetEnabled");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_SetEnabled");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_
+    XAuint16 index = 0;
+    if(enabled && !(impl->enabled))
+    {
+        for(index = 0; index < EQUALIZER_NUM_OF_BANDS; index++)
+        {
+            if(impl->changeLevel[index])
+            {
+                ret = XAEqualizerItfAdapt_SetBandLevel(impl->adapCtx, index, impl->levels[index]);
+
+                if(XA_RESULT_SUCCESS == ret)
+                {
+                    impl->changeLevel[index] = XA_BOOLEAN_FALSE;
+                }
+            }
+        }
+    }
+    else if(!enabled && impl->enabled)
+    {
+        for(index = 0; index < EQUALIZER_NUM_OF_BANDS; index++)
+        {
+            ret = XAEqualizerItfAdapt_SetBandLevel(impl->adapCtx, index, EQUALIZER_DEFAULT_BAND_LEVEL);
+
+            if(XA_RESULT_SUCCESS == ret)
+            {
+                impl->changeLevel[index] = XA_BOOLEAN_FALSE;
+            }
+        }
+    }
+    else
+    {
+        /* do nothing */
+    }
+#endif
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        impl->enabled = enabled;
+    }
+
+    DEBUG_API("<-XAEqualizerItfImpl_SetEnabled");
+    return ret;
+}
+
+/**
+ * XAresult XAEqualizerItfImpl_IsEnabled(XAEqualizerItf self, XAboolean *pEnabled)
+ * Description: Gets the enabled status of the effect.
+ **/
+XAresult XAEqualizerItfImpl_IsEnabled(XAEqualizerItf self, XAboolean *pEnabled)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    XAEqualizerItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAEqualizerItfImpl_IsEnabled");
+
+    if(!impl || !pEnabled)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_IsEnabled");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pEnabled = impl->enabled;
+
+    DEBUG_API("<-XAEqualizerItfImpl_IsEnabled");
+    return ret;
+}
+
+/**
+ * XAresult XAEqualizerItfImpl_GetNumberOfBands(XAEqualizerItf self,
+ *                                              XAuint16 *pNumBands)
+ * Description: Gets the number of frequency bands that the equalizer supports.
+ * A valid equalizer must have at least two bands.
+ **/
+XAresult XAEqualizerItfImpl_GetNumberOfBands(XAEqualizerItf self,
+                                             XAuint16 *pNumBands)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    XAEqualizerItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAEqualizerItfImpl_GetNumberOfBands");
+
+    if(!impl || !pNumBands)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_GetNumberOfBands");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    *pNumBands = EQUALIZER_NUM_OF_BANDS;
+#endif
+    DEBUG_API("<-XAEqualizerItfImpl_GetNumberOfBands");
+    return ret;
+}
+
+/**
+ * XAresult XAEqualizerItfImpl_GetBandLevelRange(XAEqualizerItf self,
+ *                                               XAmillibel *pMin,
+ *                                               XAmillibel *pMax)
+ * Description: Returns the minimun and maximun band levels supported.
+ **/
+XAresult XAEqualizerItfImpl_GetBandLevelRange(XAEqualizerItf self,
+                                              XAmillibel *pMin,
+                                              XAmillibel *pMax)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAEqualizerItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAEqualizerItfImpl_GetBandLevelRange");
+
+    if(!impl || (!pMin && !pMax)) /* other may be NULL */
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_GetBandLevelRange");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAEqualizerItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAEqualizerItfImpl_GetBandLevelRange");
+        return ret;
+    }
+    ret = XAEqualizerItfAdapt_GetBandLevelRange(impl->adapCtx, pMin, pMax);
+    XAEqualizerItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAEqualizerItfImpl_GetBandLevelRange");
+    return ret;
+}
+
+/**
+ * XAresult XAEqualizerItfImpl_SetBandLevel(XAEqualizerItf self, XAuint16 band,
+ *                                          XAmillibel level)
+ * Description: Sets the given equalizer band to the given gain value.
+ **/
+XAresult XAEqualizerItfImpl_SetBandLevel(XAEqualizerItf self, XAuint16 band,
+                                         XAmillibel level)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint16 numOfBands = 0;
+    XAmillibel minLevel = 0;
+    XAmillibel maxLevel = 0;
+    XAEqualizerItfImpl* impl = NULL;
+
+    DEBUG_API("->XAEqualizerItfImpl_SetBandLevel");
+    impl = GetImpl(self);
+
+    /* Get number of bands */
+    if(XA_RESULT_SUCCESS != XAEqualizerItfImpl_GetNumberOfBands(self, &numOfBands))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_SetBandLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* Get minimum and maximum level */
+    if(XA_RESULT_SUCCESS != XAEqualizerItfImpl_GetBandLevelRange(self, &minLevel, &maxLevel))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_SetBandLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(!impl || band > (numOfBands-1) || level < minLevel || level > maxLevel)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_SetBandLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAEqualizerItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID  || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAEqualizerItfImpl_SetBandLevel");
+        return ret;
+    }
+
+    if(impl->enabled)
+    {
+        ret = XAEqualizerItfAdapt_SetBandLevel(impl->adapCtx, band, level);
+        if(XA_RESULT_SUCCESS == ret)
+        {
+            impl->levels[band] = level;
+        }
+    }
+    else
+    {
+        impl->changeLevel[band] = XA_BOOLEAN_TRUE;
+        impl->levels[band] = level;
+    }
+
+    XAEqualizerItfAdapt_ThreadExit(impl->adapCtx);
+#endif    
+    DEBUG_API("<-XAEqualizerItfImpl_SetBandLevel");
+    return ret;
+}
+
+/**
+ * XAresult XAEqualizerItfImpl_GetBandLevel(XAEqualizerItf self, XAuint16 band,
+ *                                          XAmillibel *pLevel)
+ * Description: Gets the gain set for the given equalizer band.
+ **/
+XAresult XAEqualizerItfImpl_GetBandLevel(XAEqualizerItf self, XAuint16 band,
+                                         XAmillibel *pLevel)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAEqualizerItfImpl_GetBandLevel");
+#ifdef _GSTREAMER_BACKEND_  
+    XAEqualizerItfImpl* impl = GetImpl(self);
+    if(!impl || !pLevel ||  band >= EQUALIZER_NUM_OF_BANDS)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_GetBandLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pLevel = impl->levels[band];
+#endif
+    DEBUG_API("<-XAEqualizerItfImpl_GetBandLevel");
+    return ret;
+}
+
+/**
+ * XAresult XAEqualizerItfImpl_GetCenterFreq(XAEqualizerItf self, XAuint16 band,
+ *                                           XAmilliHertz *pCenter)
+ * Description: Gets the center frequency of the given band.
+ **/
+XAresult XAEqualizerItfImpl_GetCenterFreq(XAEqualizerItf self, XAuint16 band,
+                                          XAmilliHertz *pCenter)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAEqualizerItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAEqualizerItfImpl_GetCenterFreq");
+
+    if(!impl || !pCenter)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_GetCenterFreq");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAEqualizerItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAEqualizerItfImpl_GetCenterFreq");
+        return ret;
+    }
+    ret = XAEqualizerItfAdapt_GetCenterFreq(impl->adapCtx, band, pCenter);
+
+    XAEqualizerItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAEqualizerItfImpl_GetCenterFreq");
+    return ret;
+}
+
+/**
+ * XAresult XAEqualizerItfImpl_GetBandFreqRange(XAEqualizerItf self, XAuint16 band,
+ *                                              XAmilliHertz *pMin,
+ *                                              XAmilliHertz *pMax)
+ * Description: Gets the frequency range of the given frequency band.
+ **/
+XAresult XAEqualizerItfImpl_GetBandFreqRange(XAEqualizerItf self, XAuint16 band,
+                                             XAmilliHertz *pMin,
+                                             XAmilliHertz *pMax)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint16 numOfBands = 0;
+    XAEqualizerItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAEqualizerItfImpl_GetBandFreqRange");
+
+    /* Get number of bands */
+    if(XA_RESULT_SUCCESS != XAEqualizerItfImpl_GetNumberOfBands(self, &numOfBands))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_GetBandFreqRange");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(!impl || (!pMin && !pMax) || band > numOfBands) /* pMin or pMax may be NULL */
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_GetBandFreqRange");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAEqualizerItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAEqualizerItfImpl_GetBandFreqRange");
+        return ret;
+    }
+    ret = XAEqualizerItfAdapt_GetBandFreqRange(impl->adapCtx, band, pMin, pMax);
+
+    XAEqualizerItfAdapt_ThreadExit(impl->adapCtx);
+#endif    
+    DEBUG_API("<-XAEqualizerItfImpl_GetBandFreqRange");
+    return ret;
+}
+
+/**
+ * XAresult XAEqualizerItfImpl_GetBand(XAEqualizerItf self, XAmilliHertz frequency,
+ *                                     XAuint16 *pBand)
+ *
+ * Description: Gets the band that has the most effect on the given frequency.
+ * If no band has an effect on the given frequency, XA_EQUALIZER_UNDEFINED is returned.
+ **/
+XAresult XAEqualizerItfImpl_GetBand(XAEqualizerItf self, XAmilliHertz frequency,
+                                    XAuint16 *pBand)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAEqualizerItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAEqualizerItfImpl_GetBand");
+
+    if(!impl || !pBand)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_GetBand");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAEqualizerItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAEqualizerItfImpl_GetBand");
+        return ret;
+    }
+    ret = XAEqualizerItfAdapt_GetBand(impl->adapCtx, frequency, pBand);
+
+    XAEqualizerItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAEqualizerItfImpl_GetBand");
+    return ret;
+}
+
+/**
+ * XAresult XAEqualizerItfImpl_GetCurrentPreset(XAEqualizerItf self,
+ *                                              XAuint16 *pPreset)
+ * Description: Gets the current preset.
+ **/
+XAresult XAEqualizerItfImpl_GetCurrentPreset(XAEqualizerItf self,
+                                             XAuint16 *pPreset)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAEqualizerItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAEqualizerItfImpl_GetCurrentPreset");
+
+    if(!impl || !pPreset)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_GetCurrentPreset");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* no presets defined */
+
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        *pPreset = impl->preset;
+    }
+
+    DEBUG_API("<-XAEqualizerItfImpl_GetCurrentPreset");
+    return ret;
+}
+
+/**
+ * XAresult XAEqualizerItfImpl_UsePreset(XAEqualizerItf self, XAuint16 index)
+ * Description: Sets the equalizer according to the given preset
+ **/
+XAresult XAEqualizerItfImpl_UsePreset(XAEqualizerItf self, XAuint16 index)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint16 numOfPresets = 0;
+    XAEqualizerItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XAEqualizerItfImpl_UsePreset");
+
+    /* get number of presets */
+    if( XA_RESULT_SUCCESS != XAEqualizerItfImpl_GetNumberOfPresets(self, &numOfPresets))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_UsePreset");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(!impl || index >= numOfPresets )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_UsePreset");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->preset = index;
+
+    DEBUG_API("<-XAEqualizerItfImpl_UsePreset");
+    return ret;
+}
+
+/**
+ * XAresult XAEqualizerItfImpl_GetNumberOfPresets(XAEqualizerItf self,
+ *                                                XAuint16 *pNumPresets)
+ * Description: Gets the total number of presets the equalizer supports.
+ **/
+XAresult XAEqualizerItfImpl_GetNumberOfPresets(XAEqualizerItf self,
+                                               XAuint16 *pNumPresets)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAEqualizerItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAEqualizerItfImpl_GetNumberOfPresets");
+
+    if(!impl || !pNumPresets)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_GetNumberOfPresets");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* No presets defined. */
+    *pNumPresets = equalizerNumOfPresets;
+
+    DEBUG_API("<-XAEqualizerItfImpl_GetNumberOfPresets");
+    return ret;
+}
+
+/**
+ * XAresult XAEqualizerItfImpl_GetPresetName(XAEqualizerItf self, XAuint16 index,
+ *                                           const XAchar **ppName)
+ * Description: Gets the preset name based on the index.
+ **/
+XAresult XAEqualizerItfImpl_GetPresetName(XAEqualizerItf self, XAuint16 index,
+                                          const XAchar **ppName)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint16 numOfPresets = 0;
+    XAEqualizerItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XAEqualizerItfImpl_GetPresetName");
+
+    /* get number of presets */
+    if( XA_RESULT_SUCCESS != XAEqualizerItfImpl_GetNumberOfPresets(self, &numOfPresets))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_GetPresetName");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(!impl || !ppName || index > (numOfPresets-1))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEqualizerItfImpl_GetPresetName");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* Implementation placeholder here for presets when defined.
+       Currently always return XA_RESULT_PARAMETER_INVALID */
+
+    DEBUG_API("<-XAEqualizerItfImpl_GetPresetName");
+    return ret;
+}
+
+/**
+ * XAEqualizerItfImpl -specific methods
+ **/
+#ifdef _GSTREAMER_BACKEND_  
+
+/**
+ * XAEqualizerItfImplImpl* XAEqualizerItfImpl_Create()
+ * @return  XAEqualizerItfImplImpl* - Pointer to  EqualizerItf interface implementation
+ **/
+XAEqualizerItfImpl* XAEqualizerItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
+{
+    XAuint16 index = 0;
+
+    XAEqualizerItfImpl *self = (XAEqualizerItfImpl*)
+        calloc(1,sizeof(XAEqualizerItfImpl));
+
+    DEBUG_API("->XAEqualizerItfImpl_Create");
+
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.GetBand = XAEqualizerItfImpl_GetBand;
+        self->itf.GetBandFreqRange = XAEqualizerItfImpl_GetBandFreqRange;
+        self->itf.GetBandLevel = XAEqualizerItfImpl_GetBandLevel;
+        self->itf.GetBandLevelRange = XAEqualizerItfImpl_GetBandLevelRange;
+        self->itf.GetCenterFreq = XAEqualizerItfImpl_GetCenterFreq;
+        self->itf.GetCurrentPreset = XAEqualizerItfImpl_GetCurrentPreset;
+        self->itf.GetNumberOfBands = XAEqualizerItfImpl_GetNumberOfBands;
+        self->itf.GetNumberOfPresets = XAEqualizerItfImpl_GetNumberOfPresets;
+        self->itf.GetPresetName = XAEqualizerItfImpl_GetPresetName;
+        self->itf.IsEnabled = XAEqualizerItfImpl_IsEnabled;
+        self->itf.SetBandLevel = XAEqualizerItfImpl_SetBandLevel;
+        self->itf.SetEnabled = XAEqualizerItfImpl_SetEnabled;
+        self->itf.UsePreset = XAEqualizerItfImpl_UsePreset;
+
+        /* init variables */
+        self->enabled = XA_BOOLEAN_FALSE;
+        self->preset = XA_EQUALIZER_UNDEFINED;
+
+        for(index = 0; index < EQUALIZER_NUM_OF_BANDS; index++)
+        {
+            self->levels[index] = EQUALIZER_DEFAULT_BAND_LEVEL;
+            self->changeLevel[index] = XA_BOOLEAN_FALSE;
+        }
+
+        self->adapCtx = adapCtx;
+
+        self->self = self;
+    }
+
+    DEBUG_API("<-XAEqualizerItfImpl_Create");
+    return self;
+}
+#endif
+/**
+ * void XAEqualizerItfImpl_Free(XAEqualizerItfImpl* self)
+ * @param  XAEqualizerItfImpl* self -
+ **/
+void XAEqualizerItfImpl_Free(XAEqualizerItfImpl* self)
+{
+    DEBUG_API("->XAEqualizerItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAEqualizerItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaequalizeritf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAEQUALIZERITF_H
+#define XAEQUALIZERITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_   
+#include "XAAdaptationContextBase.h"
+#include "XAEqualizerItfAdaptation.h"
+#endif
+/** MACROS **/
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAEqualizerItf implementation */
+typedef struct XAEqualizerItfImpl_
+{
+    /* parent interface */
+    struct XAEqualizerItf_ itf;
+    /* pointer to self */
+    struct XAEqualizerItfImpl_* self;
+
+    /* variables */
+    XAboolean   enabled;
+    XAuint16    preset;
+#ifdef _GSTREAMER_BACKEND_   
+    XAmillibel  levels[EQUALIZER_NUM_OF_BANDS];
+    XAboolean   changeLevel[EQUALIZER_NUM_OF_BANDS];
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+} XAEqualizerItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAEqualizerItf implementation */
+XAresult XAEqualizerItfImpl_SetEnabled(XAEqualizerItf self,XAboolean enabled);
+
+XAresult XAEqualizerItfImpl_IsEnabled(XAEqualizerItf self, XAboolean *pEnabled);
+
+XAresult XAEqualizerItfImpl_GetNumberOfBands(XAEqualizerItf self,
+                                             XAuint16 *pNumBands);
+
+XAresult XAEqualizerItfImpl_GetBandLevelRange(XAEqualizerItf self,
+                                              XAmillibel *pMin,
+                                              XAmillibel *pMax);
+
+XAresult XAEqualizerItfImpl_SetBandLevel(XAEqualizerItf self, XAuint16 band,
+                                         XAmillibel level);
+
+XAresult XAEqualizerItfImpl_GetBandLevel(XAEqualizerItf self, XAuint16 band,
+                                         XAmillibel *pLevel);
+
+XAresult XAEqualizerItfImpl_GetCenterFreq(XAEqualizerItf self, XAuint16 band,
+                                          XAmilliHertz *pCenter);
+
+XAresult XAEqualizerItfImpl_GetBandFreqRange(XAEqualizerItf self, XAuint16 band,
+                                             XAmilliHertz *pMin,
+                                             XAmilliHertz *pMax);
+
+XAresult XAEqualizerItfImpl_GetBand(XAEqualizerItf self, XAmilliHertz frequency,
+                                    XAuint16 *pBand);
+
+XAresult XAEqualizerItfImpl_GetCurrentPreset(XAEqualizerItf self,
+                                             XAuint16 *pPreset);
+
+XAresult XAEqualizerItfImpl_UsePreset(XAEqualizerItf self, XAuint16 index);
+
+XAresult XAEqualizerItfImpl_GetNumberOfPresets(XAEqualizerItf self,
+                                               XAuint16 *pNumPresets);
+
+XAresult XAEqualizerItfImpl_GetPresetName(XAEqualizerItf self, XAuint16 index,
+                                          const XAchar **ppName);
+
+#ifdef _GSTREAMER_BACKEND_  
+/* XAEqualizerItfImpl -specific methods */
+XAEqualizerItfImpl* XAEqualizerItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
+#endif
+void XAEqualizerItfImpl_Free(XAEqualizerItfImpl* self);
+
+#endif /* XAEQUALIZERITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaglobals.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,235 @@
+/*
+* 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: 
+*
+*/
+/*All global definitions and declarations here */
+
+#ifndef XAGLOBALS_H
+#define XAGLOBALS_H
+
+#include "openmaxalwrapper.h"
+#include "xadebug.h"
+
+/**
+GLOBAL ENUMERATIONS
+ */
+/**
+ * enumeration for different adaptation event types.
+ * add more types when needed, use single bit values.
+ **/
+typedef enum {
+    XA_GENERICEVENTS = 0x1,
+    XA_PLAYITFEVENTS = 0x2,
+    XA_RECORDITFEVENTS = 0x4,
+    XA_SNAPSHOTITFEVENTS = 0x8,
+    XA_OUTPUTMIXITFEVENTS = 0x10,
+    XA_CAMERAITFEVENTS = 0x20,
+    XA_PREFETCHITFEVENTS = 0x40,
+    XA_RADIOITFEVENTS = 0x80,
+    XA_RDSITFEVENTS = 0x100,
+    XA_METADATAEVENTS = 0x200,
+    XA_ADDMORETYPES  = 0x400
+}XAAdaptEventTypes;
+
+#define XA_ADAPT_PU_INTERVAL 50                     /* position update interval */
+#define XA_ADAPT_ASYNC_TIMEOUT 3000                 /* timeout to wait async events */
+#define XA_ADAPT_ASYNC_TIMEOUT_SHORT 1000           /* timeout to wait async events */
+#define XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC 1000000   /* timeout to wait async events */
+
+#define XA_ADAPT_POSITION_UPDATE_EVT 0xf0           /* position update event */
+#define XA_ADAPT_SNAPSHOT_TAKEN 0xf1                /* snapshot taken event */
+#define XA_ADAPT_SNAPSHOT_INITIATED 0xf2            /* snapshot intitiated event */
+#define XA_ADAPT_MDE_TAGS_AVAILABLE 0xf3            /* metadata taglist changed */
+#define XA_ADAPT_OMIX_DEVICESET_CHANGED 0xf4        /* Output mix device changed event */
+#define XA_ADAPT_RADIO_FREQUENCY_CHANGED 0xf6       /* Radio frequency changed event */
+#define XA_ADAPT_RADIO_FREQUENCY_RANGE_CHANGED 0xf7 /* Radio frequency range changed event */
+#define XA_ADAPT_RADIO_SEEK_COMPLETE 0xf8           /* Radio seek complete changed event */
+#define XA_ADAPT_RDS_GET_ODA_GROUP_DONE 0xf9        /* RDS get oda group done event */
+#define XA_ADAPT_BUFFERING 0xfa
+#define XA_ADAPT_MDE_TAGS_WRITTEN 0xfb
+/* TYPEDEFS */
+
+#define RADIO_DEFAULT_FREQ_RANGE XA_FREQRANGE_FMEUROAMERICA
+#define RADIO_DEFAULT_FREQ 88000000
+
+
+typedef enum
+{
+    XA_UNDEFINED = 0,
+    XA_READBUFFER,
+    XA_WRITEBUFFER,
+    XA_READ,
+    XA_WRITE
+} XAConfigExtensionCpKey;
+
+typedef enum
+{
+    XA_MEDIATYPE_AUDIO = 0,
+    XA_MEDIATYPE_VIDEO,
+    XA_MEDIATYPE_IMAGE,
+    XA_MEDIATYPE_UNKNOWN
+} XAMediaType;
+
+#define CPCONFIGKEY "TestAppPipeConfig"
+/**
+ * GLOBAL METHODS
+ */
+
+
+/*
+ * Engine
+ */
+XAresult XAEngineImpl_Create(XAObjectItf *pEngine,
+                             XAuint32 numOptions,
+                             const XAEngineOption *pEngineOptions,
+                             XAuint32 numInterfaces,
+                             const XAInterfaceID *pInterfaceIds,
+                             const XAboolean *pInterfaceRequired);
+
+XAresult XAEngineImpl_QueryNumSupportedInterfaces(XAuint32 *pNumSupportedInterfaces);
+
+XAresult XAEngineImpl_QuerySupportedInterfaces(XAuint32 index,
+                                               XAInterfaceID *pInterfaceId);
+
+/*
+ * Media Player
+ */
+XAresult XAMediaPlayerImpl_CreateMediaPlayer(XAObjectItf *pPlayer,
+                                           XADataSource *pDataSrc,
+                                           XADataSource *pBankSrc,
+                                           XADataSink *pAudioSnk,
+                                           XADataSink *pImageVideoSnk,
+                                           XADataSink *pVibra,
+                                           XADataSink *pLEDArray,
+                                           XAuint32 numInterfaces,
+                                           const XAInterfaceID *pInterfaceIds,
+                                           const XAboolean *pInterfaceRequired);
+
+XAresult XAMediaPlayerImpl_QueryNumSupportedInterfaces(XAuint32 *pNumSupportedInterfaces);
+
+XAresult XAMediaPlayerImpl_QuerySupportedInterfaces(XAuint32 index,
+                                                  XAInterfaceID *pInterfaceId);
+
+/*
+ * Metadata Extractor
+ */
+XAresult XAMetadataExtractorImpl_Create(XAObjectItf *pMetadataExtractor,
+                                           XADataSource *pDataSource,
+                                           XAuint32 numInterfaces,
+                                           const XAInterfaceID *pInterfaceIds,
+                                           const XAboolean *pInterfaceRequired);
+
+XAresult XAMetadataExtractorImpl_QueryNumSupportedInterfaces(XAuint32 *pNumSupportedInterfaces);
+
+XAresult XAMetadataExtractorImpl_QuerySupportedInterfaces(XAuint32 index,
+                                            XAInterfaceID *pInterfaceId);
+
+/*
+ * Output Mix
+ */
+XAresult XAOMixImpl_CreateOutputMix(XAObjectItf *pMix,
+                                    XAuint32 numInterfaces,
+                                    const XAInterfaceID *pInterfaceIds,
+                                    const XAboolean *pInterfaceRequired);
+
+XAresult XAOMixImpl_QueryNumSupportedInterfaces(XAuint32 *pNumSupportedInterfaces);
+
+XAresult XAOMixImpl_QuerySupportedInterfaces(XAuint32 index,
+                                             XAInterfaceID *pInterfaceId);
+
+/*
+ * Media Recorder
+ */
+XAresult XAMediaRecorderImpl_CreateMediaRecorder(XAObjectItf* pRecorder,
+                                                 XADataSource* pAudioSrc,
+                                                 XADataSource* pImageVideoSrc,
+                                                 XADataSink* pDataSnk,
+                                                 XAuint32 numInterfaces,
+                                                 const XAInterfaceID *pInterfaceIds,
+                                                 const XAboolean *pInterfaceRequired);
+
+XAresult XAMediaRecorderImpl_QueryNumSupportedInterfaces(XAuint32 *pNumSupportedInterfaces);
+
+XAresult XAMediaRecorderImpl_QuerySupportedInterfaces(XAuint32 index,
+                                                      XAInterfaceID *pInterfaceId);
+
+/*
+ * Camera Device
+ */
+XAresult XACameraDeviceImpl_CreateCameraDevice(XAObjectItf* pDevice,
+                                               XAuint32 deviceID,
+                                               XAuint32 numInterfaces,
+                                               const XAInterfaceID * pInterfaceIds,
+                                               const XAboolean * pInterfaceRequired);
+
+XAresult XACameraDeviceImpl_QueryNumSupportedInterfaces(XAuint32 *pNumSupportedInterfaces);
+
+XAresult XACameraDeviceImpl_QuerySupportedInterfaces(XAuint32 index,
+                                                     XAInterfaceID *pInterfaceId);
+
+/*
+ * Radio Device
+ */
+XAresult XARadioDeviceImpl_CreateRadioDevice(XAObjectItf* pDevice,
+                                             XAuint32 numInterfaces,
+                                             const XAInterfaceID * pInterfaceIds,
+                                             const XAboolean * pInterfaceRequired);
+
+XAresult XARadioDeviceImpl_QueryNumSupportedInterfaces(XAuint32 *pNumSupportedInterfaces);
+
+XAresult XARadioDeviceImpl_QuerySupportedInterfaces(XAuint32 index,
+                                                    XAInterfaceID *pInterfaceId);
+
+/*
+ * Vibra Device
+ */
+XAresult XAVibraDeviceImpl_CreateVibraDevice(XAObjectItf* pDevice,
+                                             XAuint32 deviceID,
+                                             XAuint32 numInterfaces,
+                                             const XAInterfaceID * pInterfaceIds,
+                                             const XAboolean * pInterfaceRequired);
+
+XAresult XAVibraDeviceImpl_QueryNumSupportedInterfaces(XAuint32 *pNumSupportedInterfaces);
+
+XAresult XAVibraDeviceImpl_QuerySupportedInterfaces(XAuint32 index,
+                                                    XAInterfaceID *pInterfaceId);
+
+/*
+ * LED Array
+ */
+XAresult XALEDArrayDeviceImpl_CreateLEDArrayDevice(XAObjectItf* pDevice,
+                                                   XAuint32 deviceID,
+                                                   XAuint32 numInterfaces,
+                                                   const XAInterfaceID * pInterfaceIds,
+                                                   const XAboolean * pInterfaceRequired);
+
+XAresult XALEDArrayDeviceImpl_QueryNumSupportedInterfaces(XAuint32 *pNumSupportedInterfaces);
+
+XAresult XALEDArrayDeviceImpl_QuerySupportedInterfaces(XAuint32 index,
+                                                    XAInterfaceID *pInterfaceId);
+
+
+/*
+ * Check if interface IDs are equal
+ */
+XAboolean XACommon_EqualIIds(XAInterfaceID idA, XAInterfaceID idB);
+
+/*
+ * Check Data Source availability and type
+ */
+XAresult XACommon_CheckDataSource(XADataSource* source, XAMediaType* type);
+
+XAresult XACommon_ValidateDataLocator( XAuint32 pCounter, void* pSnk, ... );
+#endif /*XAGLOBALS_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaimagecontrolsitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,358 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xaimagecontrolsitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAImageControlsItfAdaptation.h"
+#endif
+/**
+ * XAImageControlsItfImpl* GetImpl(XAVolumeItf self)
+ * Description: Validated interface pointer and cast it to implementations pointer.
+ **/
+static XAImageControlsItfImpl* GetImpl(XAImageControlsItf self)
+{
+    if(self)
+    {
+        XAImageControlsItfImpl* impl = (XAImageControlsItfImpl*)(*self);
+        if(impl && (impl == impl->self))
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAImageControlsItf implementation
+ */
+
+/**
+ * XAresult XAImageControlsItfImpl_SetBrightness(XAImageControlsItf self,
+ *                                               XAuint32 brightness)
+ * Description: Sets the brightness level.
+ **/
+XAresult XAImageControlsItfImpl_SetBrightness(XAImageControlsItf self,
+                                              XAuint32 brightness)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAImageControlsItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAImageControlsItfImpl_SetBrightness");
+
+    if(!impl || brightness > MAX_BRIGHTNESS_VALUE)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAImageControlsItfImpl_SetBrightness");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAImageControlsItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAImageControlsItfImpl_SetBrightness");
+        return ret;
+    }
+    ret = XAImageControlsItfAdapt_SetBrightness(impl->adapCtx, brightness);
+
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        impl->brightness = brightness;
+    }
+
+    XAImageControlsItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAImageControlsItfImpl_SetBrightness");
+    return ret;
+}
+
+/**
+ * XAresult XAImageControlsItfImpl_SetBrightness(XAImageControlsItf self,
+ *                                               XAuint32 *pBrightness)
+ * Description: Gets the current brightness level.
+ **/
+XAresult XAImageControlsItfImpl_GetBrightness(XAImageControlsItf self,
+                                              XAuint32 *pBrightness)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAImageControlsItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAImageControlsItfImpl_GetBrightness");
+
+    if(!impl || !pBrightness)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAImageControlsItfImpl_GetBrightness");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pBrightness = impl->brightness;
+
+    DEBUG_API("<-XAImageControlsItfImpl_GetBrightness");
+    return ret;
+}
+
+/**
+ * XAresult XAImageControlsItfImpl_SetContrast(XAImageControlsItf self,
+ *                                             XAint32 contrast)
+ * Description: Sets the contrast level.
+ **/
+XAresult XAImageControlsItfImpl_SetContrast(XAImageControlsItf self,
+                                            XAint32 contrast)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAImageControlsItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAImageControlsItfImpl_SetContrast");
+
+    if(!impl || (contrast < MIN_CONTRAST_VALUE || contrast > MAX_CONTRAST_VALUE))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAImageControlsItfImpl_SetContrast");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAImageControlsItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED)
+    {
+        DEBUG_API("<-XAImageControlsItfImpl_SetContrast");
+        return ret;
+    }
+    ret = XAImageControlsItfAdapt_SetContrast(impl->adapCtx, contrast);
+
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        impl->contrast = contrast;
+    }
+
+    XAImageControlsItfAdapt_ThreadExit(impl->adapCtx);
+#endif    
+    DEBUG_API("<-XAImageControlsItfImpl_SetContrast");
+    return ret;
+}
+
+/**
+ * XAresult XAImageControlsItfImpl_GetContrast(XAImageControlsItf self,
+ *                                             XAint32 *pContrast)
+ * Description: Gets the contrast level.
+ **/
+XAresult XAImageControlsItfImpl_GetContrast(XAImageControlsItf self,
+                                            XAint32 *pContrast)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAImageControlsItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAImageControlsItfImpl_GetContrast");
+
+    if(!impl || !pContrast)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAImageControlsItfImpl_GetContrast");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pContrast = impl->contrast;
+
+    DEBUG_API("<-XAImageControlsItfImpl_GetContrast");
+    return ret;
+}
+
+/**
+ * XAresult XAImageControlsItfImpl_SetGamma(XAImageControlsItf self,
+ *                                          XApermille gamma)
+ * Description: Sets the gamma level.
+ **/
+XAresult XAImageControlsItfImpl_SetGamma(XAImageControlsItf self,
+                                         XApermille gamma)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAImageControlsItfImpl* impl = GetImpl(self);
+    XApermille  minGammaValue = 0;
+    XApermille  maxGammaValue = 0;
+    XAuint32    numSettings = 0;
+    DEBUG_API("->XAImageControlsItfImpl_SetGamma");
+
+    /* check supported min and max gamma levels */
+    ret = XAImageControlsItfImpl_GetSupportedGammaSettings(self, &minGammaValue,
+                                                           &maxGammaValue, &numSettings, NULL);
+
+    if(!impl || (gamma < minGammaValue || gamma > maxGammaValue) ||
+       ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAImageControlsItfImpl_SetGamma");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAImageControlsItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAImageControlsItfImpl_SetGamma");
+        return ret;
+    }
+    ret = XAImageControlsItfAdapt_SetGamma(impl->adapCtx, gamma);
+
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        impl->gamma = gamma;
+    }
+
+    XAImageControlsItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAImageControlsItfImpl_SetGamma");
+    return ret;
+}
+
+/**
+ * XAresult XAImageControlsItfImpl_GetGamma(XAImageControlsItf self,
+ *                                          XApermille *pGamma)
+ * Description: Gets the gamma level.
+ **/
+XAresult XAImageControlsItfImpl_GetGamma(XAImageControlsItf self,
+                                         XApermille *pGamma)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAImageControlsItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAImageControlsItfImpl_GetGamma");
+
+    if(!impl || !pGamma)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAImageControlsItfImpl_GetGamma");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pGamma = impl->gamma;
+
+    DEBUG_API("<-XAImageControlsItfImpl_GetGamma");
+    return ret;
+}
+
+/**
+ * XAresult XAImageControlsItfImpl_GetSupportedGammaSettings(XAImageControlsItf self,
+ *                                                           XApermille *pMinValue,
+ *                                                           XApermille *pMaxValue,
+ *                                                           XAuint32 *pNumSettings,
+ *                                                           XApermille **ppSettings)
+ * Description: This method gets the supported gamma settings.
+ **/
+XAresult XAImageControlsItfImpl_GetSupportedGammaSettings(XAImageControlsItf self,
+                                                          XApermille *pMinValue,
+                                                          XApermille *pMaxValue,
+                                                          XAuint32 *pNumSettings,
+                                                          XApermille **ppSettings)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAImageControlsItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAImageControlsItfImpl_GetSupportedGammaSettings");
+
+    if(!impl || !pMinValue || !pMaxValue || !pNumSettings)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAImageControlsItfImpl_GetSupportedGammaSettings");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAImageControlsItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAImageControlsItfImpl_GetSupportedGammaSettings");
+        return ret;
+    }
+    /* if ppSettings is non-null and non-continuos from min and max gamma value is
+     * supported then pnunSettings is length of the ppSettings array. Else
+     * pNumSettings returns the number of supported gamma settings. */
+    if( ppSettings && pNumSettings != 0 )
+    {
+        /* solve array of supported gamma settings */
+        ret = XAImageControlsItfAdapt_GetSupportedGammaSettings(impl->adapCtx,
+                                                                pMinValue, pMaxValue,
+                                                                pNumSettings, ppSettings);
+    }
+    else
+    {
+        /* Solve min and max values and numSettings */
+        ret = XAImageControlsItfAdapt_GetSupportedGammaSettings(impl->adapCtx,
+                                                                pMinValue, pMaxValue,
+                                                                pNumSettings, NULL);
+    }
+
+    XAImageControlsItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAImageControlsItfImpl_GetSupportedGammaSettings");
+    return ret;
+}
+
+/**
+ * XAImageControlsItfImpl -specific methods
+ **/
+#ifdef _GSTREAMER_BACKEND_  
+
+/**
+ * XAImageControlsItfImplImpl* XAImageControlsItfImpl_Create()
+ * @return  XAImageControlsItfImplImpl* - Pointer to  ImageControlsItf interface implementation
+ **/
+XAImageControlsItfImpl* XAImageControlsItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
+{
+    XAImageControlsItfImpl* self = (XAImageControlsItfImpl*)
+        calloc(1,sizeof(XAImageControlsItfImpl));
+    DEBUG_API("->XAImageControlsItfImpl_Create");
+
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.GetBrightness = XAImageControlsItfImpl_GetBrightness;
+        self->itf.GetContrast = XAImageControlsItfImpl_GetContrast;
+        self->itf.GetGamma = XAImageControlsItfImpl_GetGamma;
+        self->itf.GetSupportedGammaSettings = XAImageControlsItfImpl_GetSupportedGammaSettings;
+        self->itf.SetBrightness = XAImageControlsItfImpl_SetBrightness;
+        self->itf.SetContrast = XAImageControlsItfImpl_SetContrast;
+        self->itf.SetGamma = XAImageControlsItfImpl_SetGamma;
+
+        /* init variables */
+        self->brightness = DEFAULT_BRIGHTNESS_VALUE;
+        self->contrast = DEFAULT_CONTRAST_VALUE;
+        self->gamma = DEFAULT_GAMMA_VALUE;
+
+        self->adapCtx = adapCtx;
+
+        self->self = self;
+    }
+    DEBUG_API("<-XAImageControlsItfImpl_Create");
+    return self;
+}
+#endif
+/**
+ * void XAImageControlsItfImpl_Free(XAImageControlsItfImpl* self)
+ * @param  XAImageControlsItfImpl* self -
+ **/
+void XAImageControlsItfImpl_Free(XAImageControlsItfImpl* self)
+{
+    DEBUG_API("->XAImageControlsItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAImageControlsItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaimagecontrolsitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,90 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAIMAGECONTROLSITF_H
+#define XAIMAGECONTROLSITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#endif
+
+/** MACROS **/
+#define DEFAULT_BRIGHTNESS_VALUE    50
+#define DEFAULT_CONTRAST_VALUE      0
+#define DEFAULT_GAMMA_VALUE         1000
+#define MAX_BRIGHTNESS_VALUE        100
+#define MAX_CONTRAST_VALUE          100
+#define MIN_CONTRAST_VALUE         -100
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAImageControlsItf implementation */
+typedef struct XAImageControlsItfImpl_
+{
+    /* parent interface */
+    struct XAImageControlsItf_ itf;
+    /* pointer to self */
+    struct XAImageControlsItfImpl_* self;
+
+    /* variables */
+    XAuint32    brightness;
+    XAint32     contrast;
+    XApermille  gamma;
+#ifdef _GSTREAMER_BACKEND_
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif    
+
+} XAImageControlsItfImpl;
+
+/** METHODS **/
+
+XAresult XAImageControlsItfImpl_SetBrightness(XAImageControlsItf self,
+                                              XAuint32 brightness);
+
+XAresult XAImageControlsItfImpl_GetBrightness(XAImageControlsItf self,
+                                              XAuint32 *pBrightness);
+
+XAresult XAImageControlsItfImpl_SetContrast(XAImageControlsItf self,
+                                            XAint32 contrast);
+
+XAresult XAImageControlsItfImpl_GetContrast(XAImageControlsItf self,
+                                            XAint32 *pContrast);
+
+XAresult XAImageControlsItfImpl_SetGamma(XAImageControlsItf self,
+                                         XApermille gamma);
+
+XAresult XAImageControlsItfImpl_GetGamma(XAImageControlsItf self,
+                                         XApermille *pGamma);
+
+XAresult XAImageControlsItfImpl_GetSupportedGammaSettings(XAImageControlsItf self,
+                                                          XApermille *pMinValue,
+                                                          XApermille *pMaxValue,
+                                                          XAuint32 *pNumSettings,
+                                                          XApermille **ppSettings);
+#ifdef _GSTREAMER_BACKEND_   
+/* XAImageControlsItfImpl -specific methods */
+XAImageControlsItfImpl* XAImageControlsItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
+#endif
+void XAImageControlsItfImpl_Free(XAImageControlsItfImpl* self);
+
+#endif /* XAIMAGECONTROLSITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaimageeffectsitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,250 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xaimageeffectsitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAImageEffectsItfAdaptation.h"
+#endif
+static XAImageEffectsItfImpl* GetImpl(XAImageEffectsItf self)
+{
+    if(self)
+    {
+        XAImageEffectsItfImpl* impl = (XAImageEffectsItfImpl*)(*self);
+        if(impl && (impl == impl->self))
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAImageEffectsItf implementation
+ */
+
+/**
+ * XAresult XAImageEffectsItfImpl_QuerySupportedImageEffects(XAImageEffectsItf self,
+ *                                                           XAuint32 index,
+ *                                                           XAuint32 *pImageEffectId)
+ * Description: Queries image effects supported.
+ **/
+XAresult XAImageEffectsItfImpl_QuerySupportedImageEffects(XAImageEffectsItf self,
+                                                          XAuint32 index,
+                                                          XAuint32 *pImageEffectId)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAImageEffectsItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAImageEffectsItfImpl_QuerySupportedImageEffects");
+
+    if(!impl || !pImageEffectId)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAImageEffectsItfImpl_QuerySupportedImageEffects");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAImageEffectsItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAImageEffectsItfImpl_QuerySupportedImageEffects");
+        return ret;
+    }
+
+    ret = XAImageEffectsItfAdapt_QuerySupportedImageEffects(impl->adapCtx, index,
+                                                            pImageEffectId);
+
+    if( ret == XA_RESULT_SUCCESS )
+    {
+        impl->index = index;
+    }
+
+    XAImageEffectsItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAImageEffectsItfImpl_QuerySupportedImageEffects");
+    return ret;
+}
+
+/**
+ * XAresult XAImageEffectsItfImpl_EnableImageEffect(XAImageEffectsItf self,
+ *                                                  XAuint32 imageEffectID
+ * Description: Enables an image effect.
+ **/
+XAresult XAImageEffectsItfImpl_EnableImageEffect(XAImageEffectsItf self,
+                                                 XAuint32 imageEffectID)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAImageEffectsItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAImageEffectsItfImpl_EnableImageEffect");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAImageEffectsItfImpl_EnableImageEffect");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAImageEffectsItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAImageEffectsItfImpl_EnableImageEffect");
+        return ret;
+    }
+
+    ret = XAImageEffectsItfAdapt_EnableImageEffect(impl->adapCtx, imageEffectID);
+
+    if( ret == XA_RESULT_SUCCESS )
+    {
+        impl->imageEffectID = imageEffectID;
+    }
+
+    XAImageEffectsItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAImageEffectsItfImpl_EnableImageEffect");
+    return ret;
+}
+
+/**
+ * XAresult XAImageEffectsItfImpl_DisableImageEffect(XAImageEffectsItf self,
+ *                                                   XAuint32 imageEffectID)
+ * Description: Disable an image effect.
+ **/
+XAresult XAImageEffectsItfImpl_DisableImageEffect(XAImageEffectsItf self,
+                                                  XAuint32 imageEffectID)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAImageEffectsItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAImageEffectsItfImpl_DisableImageEffect");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAImageEffectsItfImpl_DisableImageEffect");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAImageEffectsItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAImageEffectsItfImpl_DisableImageEffect");
+        return ret;
+    }
+
+    ret = XAImageEffectsItfAdapt_DisableImageEffect(impl->adapCtx, imageEffectID);
+
+    if( ret == XA_RESULT_SUCCESS )
+    {
+        impl->imageEffectID = NO_IMAGE_EFFECTS;
+    }
+
+    XAImageEffectsItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAImageEffectsItfImpl_DisableImageEffect");
+    return ret;
+}
+
+/**
+ * XAresult XAImageEffectsItfImpl_IsImageEffectEnabled(XAImageEffectsItf self,
+ *                                                     XAuint32 imageEffectID,
+ *                                                     XAboolean *pEnabled)
+ * Description: Checks to see if an image effect is enabled.
+ **/
+XAresult XAImageEffectsItfImpl_IsImageEffectEnabled(XAImageEffectsItf self,
+                                                    XAuint32 imageEffectID,
+                                                    XAboolean *pEnabled)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAImageEffectsItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAImageEffectsItfImpl_IsImageEffectEnabled");
+
+    if(!impl || !pEnabled)
+    {
+        DEBUG_ERR("XA_RESUT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAImageEffectsItfImpl_IsImageEffectEnabled");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAImageEffectsItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAImageEffectsItfImpl_IsImageEffectEnabled");
+        return ret;
+    }
+
+    ret = XAImageEffectsItfAdapt_IsImageEffectEnabled(impl->adapCtx, imageEffectID,
+                                                      pEnabled);
+
+    XAImageEffectsItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAImageEffectsItfImpl_IsImageEffectEnabled");
+    return ret;
+}
+
+/**
+ * XAImageEffectsItfImpl -specific methods
+ **/
+#ifdef _GSTREAMER_BACKEND_  
+
+/**
+ * XAImageEffectsItfImplImpl* XAImageEffectsItfImpl_Create()
+ * @return  XAImageEffectsItfImplImpl* - Pointer to  ImageEffectsItf interface implementation
+ **/
+XAImageEffectsItfImpl* XAImageEffectsItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
+{
+    XAImageEffectsItfImpl* self = (XAImageEffectsItfImpl*)
+        calloc(1,sizeof(XAImageEffectsItfImpl));
+    DEBUG_API("->XAImageEffectsItfImpl_Create");
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.DisableImageEffect = XAImageEffectsItfImpl_DisableImageEffect;
+        self->itf.EnableImageEffect = XAImageEffectsItfImpl_EnableImageEffect;
+        self->itf.IsImageEffectEnabled = XAImageEffectsItfImpl_IsImageEffectEnabled;
+        self->itf.QuerySupportedImageEffects = XAImageEffectsItfImpl_QuerySupportedImageEffects;
+
+        /* init variables */
+        self->enabled = XA_BOOLEAN_FALSE;
+        self->index = 0;
+        self->imageEffectID = NO_IMAGE_EFFECTS;
+        self->adapCtx = adapCtx;
+
+        self->self = self;
+    }
+    DEBUG_API("<-XAImageEffectsItfImpl_Create");
+    return self;
+}
+#endif
+/**
+ * void XAImageEffectsItfImpl_Free(XAImageEffectsItfImpl* self)
+ * @param  XAImageEffectsItfImpl* self -
+ **/
+void XAImageEffectsItfImpl_Free(XAImageEffectsItfImpl* self)
+{
+    DEBUG_API("->XAImageEffectsItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAImageEffectsItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaimageeffectsitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,76 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAIMAGEEFFECTSITF_H
+#define XAIMAGEEFFECTSITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_   
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+#define NO_IMAGE_EFFECTS 0
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAImageEffectsItf implementation */
+typedef struct XAImageEffectsItfImpl_
+{
+    /* parent interface */
+    struct XAImageEffectsItf_ itf;
+    /* pointer to self */
+    struct XAImageEffectsItfImpl_* self;
+
+    /* variables */
+    XAuint32    index;
+    XAboolean   enabled;
+    XAuint32    imageEffectID;
+#ifdef _GSTREAMER_BACKEND_   
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+
+} XAImageEffectsItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAImageEffectsItf implementation */
+XAresult XAImageEffectsItfImpl_QuerySupportedImageEffects(XAImageEffectsItf self,
+                                                          XAuint32 index,
+                                                          XAuint32 *pImageEffectId);
+
+XAresult XAImageEffectsItfImpl_EnableImageEffect(XAImageEffectsItf self,
+                                                 XAuint32 imageEffectID);
+
+XAresult XAImageEffectsItfImpl_DisableImageEffect(XAImageEffectsItf self,
+                                                  XAuint32 imageEffectID);
+
+XAresult XAImageEffectsItfImpl_IsImageEffectEnabled(XAImageEffectsItf self,
+                                                    XAuint32 imageEffectID,
+                                                    XAboolean *pEnabled);
+
+#ifdef _GSTREAMER_BACKEND_   
+/* XAImageEffectsItfImpl -specific methods */
+XAImageEffectsItfImpl* XAImageEffectsItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
+#endif
+
+void XAImageEffectsItfImpl_Free(XAImageEffectsItfImpl* self);
+#endif /* XAIMAGEEFFECTSITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xametadataextractionitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,576 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#include "xametadataextractionitf.h"
+#include "xadebug.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAMetadataAdaptation.h"
+#endif
+/* XAMetadataExtractionItfImpl* GetImpl(XAMetadataExtractionItf self)
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ **/
+static XAMetadataExtractionItfImpl* GetImpl(XAMetadataExtractionItf self)
+{
+    if( self )
+    {
+        XAMetadataExtractionItfImpl* impl = (XAMetadataExtractionItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/*****************************************************************************
+ * Base interface XAMetadataExtractionItf implementation
+ *****************************************************************************/
+
+/*
+ * Returns the number of metadata items within the current scope of the object.
+ * @XAuint32 *pItemCount
+ *      Number of metadata items.  Must be non-NULL
+ */
+XAresult XAMetadataExtractionItfImpl_GetItemCount(XAMetadataExtractionItf self,
+                                                  XAuint32 *pItemCount)
+{
+    XAMetadataExtractionItfImpl *impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAMetadataExtractionItfImpl_GetItemCount");
+
+    impl = GetImpl(self);
+    /* check parameters */
+    if( !impl || !pItemCount )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_  
+        if( impl->adaptCtx )
+        {
+            if(impl->filteringOn)
+            {
+                *pItemCount = impl->filteredcount;
+            }
+            else
+            {
+                *pItemCount = impl->currentTags.itemcount;
+            }
+            res = XA_RESULT_SUCCESS;
+        }
+        else
+        {
+            res = XA_RESULT_INTERNAL_ERROR;
+        }
+#endif
+        DEBUG_INFO_A1("itemCount = %d", (int)*pItemCount);
+    }
+
+    DEBUG_API_A1("<-XAMetadataExtractionItfImpl_GetItemCount (%d)", (int)res);
+    return res;
+}
+
+/*
+ * Returns the byte size of a given metadata key
+ *
+ * @XAuint32 index
+ *      Metadata item Index. Range is [0, GetItemCount)
+ * @XAuint32 *pKeySize
+ *      Address to store key size. size must be greater than 0.  Must be non-NULL
+ */
+XAresult XAMetadataExtractionItfImpl_GetKeySize(XAMetadataExtractionItf self,
+                                                XAuint32 index,
+                                                XAuint32 *pKeySize)
+{
+    XAMetadataExtractionItfImpl *impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+    XAuint32 newidx = 0;
+    DEBUG_API("->XAMetadataExtractionItfImpl_GetKeySize");
+
+    impl = GetImpl(self);
+    if( !impl || !pKeySize )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataExtractionItfImpl_GetKeySize");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    *pKeySize = 0;
+
+    /* check index and return unfiltered index */
+    if( CheckAndUnfilterIndex(impl,index,&newidx) != XA_RESULT_SUCCESS )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataExtractionItfImpl_GetKeySize");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    /* size = size of struct + size of data - 1 (struct size already includes one char) */
+    *pKeySize = sizeof(XAMetadataInfo) + impl->currentTags.mdeKeys[newidx]->size - 1;
+#endif
+    DEBUG_API_A1("<-XAMetadataExtractionItfImpl_GetKeySize (%d)", (int)res);
+    return res;
+}
+
+/*
+ * Returns a XAMetadataInfo structure and associated data referenced by the structure for a key.
+ * @XAuint32 index
+ *      Metadata item Index. Range is [0, GetItemCount())
+ * @XAuint32 keySize
+ *      Size of the memory block passed as key. Range is [1, GetKeySize].
+ * @XAMetadataInfo *pKey
+ *      Address to store the key.  Must be non-NULL
+ */
+XAresult XAMetadataExtractionItfImpl_GetKey(XAMetadataExtractionItf self,
+                                            XAuint32 index,
+                                            XAuint32 keySize,
+                                            XAMetadataInfo *pKey)
+{
+    XAMetadataExtractionItfImpl *impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+    XAuint32 newidx = 0;
+#ifdef _GSTREAMER_BACKEND_  
+    XAuint32 neededsize = 0;
+#endif
+    XAuint32 newdatasize = 0;
+    DEBUG_API("->XAMetadataExtractionItfImpl_GetKey");
+
+    impl = GetImpl(self);
+    if( !impl || !pKey )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataExtractionItfImpl_GetKey");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check index and return unfiltered index */
+    if(CheckAndUnfilterIndex(impl,index,&newidx) != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataExtractionItfImpl_GetKey");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    memset(pKey,0,keySize);
+#ifdef _GSTREAMER_BACKEND_     
+    /* needed size = size of struct + size of data - 1 (struct size already includes one char) */
+    neededsize = sizeof(XAMetadataInfo) + impl->currentTags.mdeKeys[newidx]->size - 1;
+    if( keySize<neededsize )
+    {   /* cannot fit all of key data */
+        newdatasize = impl->currentTags.mdeKeys[newidx]->size - (neededsize-keySize);
+        DEBUG_ERR("XA_RESULT_BUFFER_INSUFFICIENT");
+        res = XA_RESULT_BUFFER_INSUFFICIENT;
+    }
+    else
+    {
+        newdatasize = impl->currentTags.mdeKeys[newidx]->size;
+        res = XA_RESULT_SUCCESS;
+    }
+    /* copy data up to given size */
+    memcpy(pKey,impl->currentTags.mdeKeys[newidx],keySize-1);
+    /* ensure null-termination */
+#endif    
+    memset(pKey->data+newdatasize-1,0,1);
+    pKey->size = newdatasize;
+
+    DEBUG_API_A1("<-XAMetadataExtractionItfImpl_GetKey (%d)", (int)res);
+    return res;
+}
+
+
+/*
+ * Returns the byte size of a given metadata value
+ * @XAuint32 index
+ *      Metadata item Index. Range is [0, GetItemCount())
+ * @XAuint32 *pValueSize
+ *      Address to store value size. size must be greater than 0.  Must be non-NULL
+ */
+XAresult XAMetadataExtractionItfImpl_GetValueSize(XAMetadataExtractionItf self,
+                                                  XAuint32 index,
+                                                  XAuint32 *pValueSize)
+{
+    XAMetadataExtractionItfImpl *impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+    XAuint32 newidx = 0;
+    DEBUG_API("->XAMetadataExtractionItfImpl_GetValueSize");
+
+    impl = GetImpl(self);
+    if( !impl || !pValueSize )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataExtractionItfImpl_GetValueSize");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    *pValueSize = 0;
+
+    /* check index and return unfiltered index */
+    if(CheckAndUnfilterIndex(impl,index,&newidx) != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataExtractionItfImpl_GetValueSize");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    /* size = size of struct + size of data - 1 (struct size already includes one char) */
+    *pValueSize = sizeof(XAMetadataInfo) + impl->currentTags.mdeValues[newidx]->size - 1;
+#endif
+    DEBUG_API_A1("<-XAMetadataExtractionItfImpl_GetValueSize (%d)", (int)res);
+    return res;
+}
+
+/*
+ * Returns a XAMetadataInfo structure and associated data referenced by the structure for a value.
+ *  @XAuint32 index
+ *      Metadata item Index. Range is [0, GetItemCount())
+ *  @XAuint32 valueSize
+ *      Size of the memory block passed as value. Range is [0, GetValueSize]
+ *  @XAMetadataInfo *pValue
+ *      Address to store the value.  Must be non-NULL
+ */
+XAresult XAMetadataExtractionItfImpl_GetValue(XAMetadataExtractionItf self,
+                                              XAuint32 index,
+                                              XAuint32 valueSize,
+                                              XAMetadataInfo *pValue)
+{
+    XAMetadataExtractionItfImpl *impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+    XAuint32 newidx = 0;
+#ifdef _GSTREAMER_BACKEND_  
+    XAuint32 neededsize = 0;
+#endif
+    XAuint32 newdatasize = 0;
+    DEBUG_API("->XAMetadataExtractionItfImpl_GetValue");
+
+    impl = GetImpl(self);
+    if( !impl || !pValue )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataExtractionItfImpl_GetValue");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check index and return unfiltered index */
+    if(CheckAndUnfilterIndex(impl,index,&newidx) != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataExtractionItfImpl_GetValue");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    memset(pValue,0,valueSize);
+#ifdef _GSTREAMER_BACKEND_  
+    /* needed size = size of struct + size of data - 1 (struct size already includes one char) */
+    neededsize = sizeof(XAMetadataInfo) + impl->currentTags.mdeValues[newidx]->size - 1;
+    if( valueSize<neededsize )
+    {   /* cannot fit all of key data */
+        newdatasize = impl->currentTags.mdeValues[newidx]->size - (neededsize-valueSize);
+        DEBUG_ERR("XA_RESULT_BUFFER_INSUFFICIENT");
+        res = XA_RESULT_BUFFER_INSUFFICIENT;
+    }
+    else
+    {
+        newdatasize = impl->currentTags.mdeValues[newidx]->size;
+        res = XA_RESULT_SUCCESS;
+    }
+    /* copy data up to given size */
+    memcpy(pValue,impl->currentTags.mdeValues[newidx],valueSize-1);
+    /* ensure null-termination */
+#endif
+    memset(pValue->data+newdatasize-1,0,1);
+
+    pValue->size = newdatasize;
+
+    DEBUG_API_A1("<-XAMetadataExtractionItfImpl_GetValue (%d)",(int)res);
+    return res;
+}
+
+
+/*
+ * Adds a filter for a specific key
+ * @XAuint32 keySize
+ *      Size in bytes, of the pKey parameter. Ignored if filtering by key is disabled
+ * @const void *pKey
+ *      The key to filter by. The entire key must match. Ignored if filtering by key is disabled.
+ * @XAuint32 keyEncoding
+ *      Character encoding of the pKey parameter. Ignored if filtering by key is disabled
+ * @const XAchar *pValueLangCountry
+ *      Language / country code of the value to filter by. Ignored if filtering by language / country is disabled
+ * @XAuint32 valueEncoding
+ *      Encoding of the value to filter by. Ignored if filtering by encoding is disabled
+ * @XAuint8 filterMask
+ *      Bitmask indicating which criteria to filter by. Should be one of the XA_METADATA_FILTER macros
+ */
+XAresult XAMetadataExtractionItfImpl_AddKeyFilter(XAMetadataExtractionItf self,
+                                                  XAuint32 keySize,
+                                                  const void *pKey,
+                                                  XAuint32 keyEncoding,
+                                                  const XAchar *pValueLangCountry,
+                                                  XAuint32 valueEncoding,
+                                                  XAuint8 filterMask)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    
+    
+#ifdef _GSTREAMER_BACKEND_  
+    XAMetadataExtractionItfImpl *impl = NULL;
+    const XAchar* parsedkey;
+    impl = GetImpl(self);
+#endif
+    DEBUG_API("->XAMetadataExtractionItfImpl_AddKeyFilter");
+
+#ifdef _GSTREAMER_BACKEND_  
+    XAuint32 idx = 0;
+    XAuint8 matchMask = 0;
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataExtractionItfImpl_AddKeyFilter");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        impl->filteringOn = XA_BOOLEAN_TRUE;
+        for(idx=0; idx < impl->currentTags.itemcount; idx++)
+        {
+            if((filterMask & XA_METADATA_FILTER_KEY) && pKey)
+            {
+                parsedkey = XAMetadataAdapt_ParseKhronosKey(pKey);
+                if( strcmp((char*)parsedkey,
+                           (char*)impl->currentTags.mdeKeys[idx]->data) == 0 )
+                {
+                    matchMask |= XA_METADATA_FILTER_KEY;
+                }
+            }
+            if(filterMask & XA_METADATA_FILTER_LANG && pValueLangCountry)
+            {
+                if( strcmp((char*)pValueLangCountry,
+                           (char*)impl->currentTags.mdeKeys[idx]->langCountry) == 0 )
+                {
+                    matchMask |= XA_METADATA_FILTER_LANG;
+                }
+            }
+            if(filterMask & XA_METADATA_FILTER_ENCODING)
+            {
+                if(keyEncoding==impl->currentTags.mdeKeys[idx]->encoding)
+                {
+                    matchMask |= XA_METADATA_FILTER_ENCODING;
+                }
+                if(valueEncoding==impl->currentTags.mdeValues[idx]->encoding)
+                {
+                    matchMask |= XA_METADATA_FILTER_ENCODING;
+                }
+            }
+            /* check if all filters apply */
+            if(filterMask == matchMask)
+            {
+                if(impl->tagmatchesfilter[idx] == XA_BOOLEAN_FALSE)
+                {
+                    impl->tagmatchesfilter[idx] = XA_BOOLEAN_TRUE;
+                    impl->filteredcount++;
+                }
+            }
+            /*reset matchmask*/
+            matchMask=0;
+        }
+    }
+#endif    
+    DEBUG_API_A1("<-XAMetadataExtractionItfImpl_AddKeyFilter (%d)", (int)res);
+    return res;
+ }
+
+/*
+ * Clears the key filter
+ */
+XAresult XAMetadataExtractionItfImpl_ClearKeyFilter(XAMetadataExtractionItf self)
+{
+    XAMetadataExtractionItfImpl *impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+#ifdef _GSTREAMER_BACKEND_  
+    XAuint32 idx = 0;
+#endif
+    DEBUG_API("->XAMetadataExtractionItfImpl_ClearKeyFilter");
+    impl = GetImpl(self);
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if(impl->tagmatchesfilter)
+        {
+#ifdef _GSTREAMER_BACKEND_  
+            for(idx=0; idx < impl->currentTags.itemcount; idx++)
+            {
+                impl->tagmatchesfilter[idx] = XA_BOOLEAN_FALSE;
+            }
+#endif
+        }
+        impl->filteredcount = 0;
+        impl->filteringOn = XA_BOOLEAN_FALSE;
+    }
+
+    DEBUG_API_A1("<-XAMetadataExtractionItfImpl_ClearKeyFilter (%d)", (int)res);
+    return res;
+}
+
+/*****************************************************************************
+ * XAMetadataExtractionItfImpl -specific methods
+ *****************************************************************************/
+#ifdef _GSTREAMER_BACKEND_  
+/* XAMetadataExtractionItfImpl* XAMetadataExtractionItfImpl_Create()
+ * Description: Allocate and initialize XAMetadataExtractionItfImpl
+ */
+XAMetadataExtractionItfImpl* XAMetadataExtractionItfImpl_Create(XAAdaptationBaseCtx *adaptCtx)
+{
+    XAMetadataExtractionItfImpl *self = NULL;
+    DEBUG_API("->XAMetadataExtractionItfImpl_Create");
+
+    self = (XAMetadataExtractionItfImpl*)calloc(1,sizeof(XAMetadataExtractionItfImpl));
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.GetItemCount = XAMetadataExtractionItfImpl_GetItemCount;
+        self->itf.GetKeySize = XAMetadataExtractionItfImpl_GetKeySize;
+        self->itf.GetKey = XAMetadataExtractionItfImpl_GetKey;
+        self->itf.GetValueSize = XAMetadataExtractionItfImpl_GetValueSize;
+        self->itf.GetValue = XAMetadataExtractionItfImpl_GetValue;
+        self->itf.AddKeyFilter = XAMetadataExtractionItfImpl_AddKeyFilter;
+        self->itf.ClearKeyFilter = XAMetadataExtractionItfImpl_ClearKeyFilter;
+
+        /* init variables */
+        self->filteredcount = 0;
+        self->filteringOn = XA_BOOLEAN_FALSE;
+
+        self->adaptCtx = adaptCtx;
+        XAAdaptationBase_AddEventHandler( adaptCtx, &XAMetadataExtractionItfImp_AdaptCb, XA_METADATAEVENTS, self );
+
+        self->self = self;
+    }
+
+    DEBUG_API("<-XAMetadataExtractionItfImpl_Create");
+    return self;
+}
+#endif
+/* void XAMetadataExtractionItfImpl_Free(XAMetadataExtractionItfImpl* self)
+ * Description: Free all resources reserved at XAMetadataExtractionItfImpl_Create
+ */
+void XAMetadataExtractionItfImpl_Free(XAMetadataExtractionItfImpl* self)
+{
+    DEBUG_API("->XAMetadataExtractionItfImpl_Free");
+    assert(self==self->self);
+#ifdef _GSTREAMER_BACKEND_  
+    XAAdaptationBase_RemoveEventHandler( self->adaptCtx, &XAMetadataExtractionItfImp_AdaptCb );
+    XAMetadataAdapt_FreeImplTagList(&(self->currentTags), XA_BOOLEAN_TRUE);
+#endif
+    if(self->tagmatchesfilter)
+    {
+        free(self->tagmatchesfilter);
+    }
+    free(self);
+    DEBUG_API("<-XAMetadataExtractionItfImpl_Free");
+}
+
+#ifdef _GSTREAMER_BACKEND_  
+/* With this method, adaptation infroms that new tags are found (e.g. if source,
+ * has changed, live stream contains metadata...)
+ */
+void XAMetadataExtractionItfImp_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+{
+    XAMetadataExtractionItfImpl* impl = NULL;
+    DEBUG_API("->XAMetadataExtractionItfImp_AdaptCb");
+    impl = (XAMetadataExtractionItfImpl*)pHandlerCtx;
+    if(!impl)
+    {
+        DEBUG_ERR("XAMetadataExtractionItfImp_AdaptCb, invalid context pointer!");
+        DEBUG_API("<-XAMetadataExtractionItfImp_AdaptCb");
+        return;
+    }
+    if( event && event->eventid == XA_ADAPT_MDE_TAGS_AVAILABLE )
+    {
+        /* get the tag list */
+        XAMetadataExtractionItfAdapt_FillTagList( impl->adaptCtx, &(impl->currentTags) );
+        if(impl->tagmatchesfilter)
+        {
+            free(impl->tagmatchesfilter);
+        }
+        impl->tagmatchesfilter = calloc(impl->currentTags.itemcount,sizeof(XAboolean));
+        impl->filteredcount = 0;
+    }
+    else
+    {
+        DEBUG_INFO("unhandled");
+    }
+    DEBUG_API("<-XAMetadataExtractionItfImp_AdaptCb");
+}
+
+#endif
+/* For given index over filtered array, return index over whole array
+ */
+XAresult CheckAndUnfilterIndex(XAMetadataExtractionItfImpl *impl,
+                               XAuint32 oldidx, XAuint32 *newidx)
+{
+    DEBUG_API("->CheckAndUnfilterIndex");
+#ifdef _GSTREAMER_BACKEND_  
+    if( impl->filteringOn )
+    {
+        XAint16 i=-1;
+        if(oldidx>=impl->filteredcount)
+        {
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("<-CheckAndUnfilterIndex");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+        *newidx=0;
+        while(*newidx<impl->currentTags.itemcount)
+        {
+            if(impl->tagmatchesfilter[*newidx]) i++;
+            if(i<oldidx) (*newidx)++;
+            else break;
+        }
+        if(*newidx==impl->currentTags.itemcount)
+        {
+            /* should not end up here */
+            *newidx=0;
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("<-CheckAndUnfilterIndex");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+    }
+    else
+    {
+        if(oldidx>=impl->currentTags.itemcount)
+        {
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("<-CheckAndUnfilterIndex");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+        *newidx=oldidx;
+    }
+#endif
+    DEBUG_API("<-CheckAndUnfilterIndex");
+    return XA_RESULT_SUCCESS;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xametadataextractionitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,97 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAMETADATAEXTRACTIONITF_H
+#define XAMETADATAEXTRACTIONITF_H
+
+#include "openmaxalwrapper.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAAdaptationContextBase.h"
+#include "XAMetadataAdaptation.h"
+#endif
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAMetadataExtractionItf implementation */
+typedef struct XAMetadataExtractionItfImpl_
+{
+    /* parent interface */
+    struct XAMetadataExtractionItf_ itf;
+    /* pointer to self */
+    struct XAMetadataExtractionItfImpl_* self;
+
+    /* variables */
+    XAuint32                filteredcount;
+    XAboolean*              tagmatchesfilter;
+    XAboolean               filteringOn;
+#ifdef _GSTREAMER_BACKEND_  
+    XAMetadataImplTagList   currentTags;
+
+    XAAdaptationBaseCtx *adaptCtx;
+#endif
+} XAMetadataExtractionItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAMetadataExtractionItf implementation */
+XAresult XAMetadataExtractionItfImpl_GetItemCount(XAMetadataExtractionItf self,
+                                                  XAuint32 *pItemCount);
+
+XAresult XAMetadataExtractionItfImpl_GetKeySize(XAMetadataExtractionItf self,
+                                                XAuint32 index,
+                                                XAuint32 *pKeySize);
+
+XAresult XAMetadataExtractionItfImpl_GetKey(XAMetadataExtractionItf self,
+                                            XAuint32 index,
+                                            XAuint32 keySize,
+                                            XAMetadataInfo *pKey);
+
+XAresult XAMetadataExtractionItfImpl_GetValueSize(XAMetadataExtractionItf self,
+                                                  XAuint32 index,
+                                                  XAuint32 *pValueSize);
+
+XAresult XAMetadataExtractionItfImpl_GetValue(XAMetadataExtractionItf self,
+                                              XAuint32 index,
+                                              XAuint32 valueSize,
+                                              XAMetadataInfo *pValue);
+
+XAresult XAMetadataExtractionItfImpl_AddKeyFilter(XAMetadataExtractionItf self,
+                                                  XAuint32 keySize,
+                                                  const void *pKey,
+                                                  XAuint32 keyEncoding,
+                                                  const XAchar *pValueLangCountry,
+                                                  XAuint32 valueEncoding,
+                                                  XAuint8 filterMask);
+
+XAresult XAMetadataExtractionItfImpl_ClearKeyFilter(XAMetadataExtractionItf self);
+
+#ifdef _GSTREAMER_BACKEND_  
+/* XAMetadataExtractionItfImpl -specific methods */
+XAMetadataExtractionItfImpl* XAMetadataExtractionItfImpl_Create( XAAdaptationBaseCtx *adaptCtx);
+void XAMetadataExtractionItfImp_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
+#endif
+void XAMetadataExtractionItfImpl_Free(XAMetadataExtractionItfImpl* self);
+
+/* internal methods */
+XAresult CheckAndUnfilterIndex(XAMetadataExtractionItfImpl *impl,
+                               XAuint32 oldidx, XAuint32 *newidx);
+
+#endif /* XAMETADATAEXTRACTIONITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xametadatatraversalitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,304 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "xametadatatraversalitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAMetadataAdaptation.h"
+#endif
+/* XAMetadataTraversalImpl* GetImpl(XAMetadataTraversalItf self)
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XAMetadataTraversalImpl* GetImpl(XAMetadataTraversalItf self)
+{
+    if( self )
+    {
+        XAMetadataTraversalImpl* impl = (XAMetadataTraversalImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/*****************************************************************************
+ * Base interface XAMetadataTraversalItf implementation
+ *****************************************************************************/
+
+/* XAresult XAMetadataTraversalItfImpl_SetMode
+ * Description: Sets the metadata traversal mode
+ */
+XAresult XAMetadataTraversalItfImpl_SetMode(XAMetadataTraversalItf self,
+                                            XAuint32 mode)
+{
+    XAMetadataTraversalImpl *impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataTraversalItfImpl_SetMode");
+    impl = GetImpl(self);
+    /* check parameters */
+    if( !impl  ||
+       (mode!=XA_METADATATRAVERSALMODE_NODE &&
+        mode!=XA_METADATATRAVERSALMODE_ALL))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else if(impl->traversemode != mode)
+    {
+#ifdef _GSTREAMER_BACKEND_  
+        res =XAMetadataTraversalItfAdapt_SetMode(impl->adaptCtx, mode);
+#endif
+        if( res == XA_RESULT_SUCCESS )
+        {
+            impl->traversemode = mode;
+        }
+    }
+    else
+    {
+        /* do nothing */
+    }
+
+    DEBUG_API("<-XAMetadataTraversalItfImpl_SetMode");
+    return res;
+}
+
+/* XAresult XAMetadataTraversalItfImpl_GetChildCount
+ * Description: Returns the number of children (nodes, streams, etc.) within the current scope
+ */
+XAresult XAMetadataTraversalItfImpl_GetChildCount(XAMetadataTraversalItf self,
+                                                  XAuint32 *pCount)
+{
+    XAMetadataTraversalImpl *impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataTraversalItfImpl_GetChildCount");
+    impl = GetImpl(self);
+    if( !impl || !pCount )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if(impl->traversemode==XA_METADATATRAVERSALMODE_ALL)
+        {
+            /* for this mode, child count is always 0 */
+            *pCount = 0;
+            res = XA_RESULT_SUCCESS;
+        }
+        else
+        {
+#ifdef _GSTREAMER_BACKEND_  
+            res = XAMetadataTraversalItfAdapt_GetChildCount(impl->adaptCtx, pCount);
+#endif
+        }
+    }
+
+    DEBUG_API("<-XAMetadataTraversalItfImpl_GetChildCount");
+    return res;
+}
+
+/* XAresult XAMetadataTraversalItfImpl_GetChildMIMETypeSize
+ * Description: Returns the size in bytes needed to store the MIME type of a child
+ */
+XAresult XAMetadataTraversalItfImpl_GetChildMIMETypeSize(XAMetadataTraversalItf self,
+                                                         XAuint32 index,
+                                                         XAuint32 *pSize)
+{
+    XAMetadataTraversalImpl *impl = NULL;
+#ifdef _GSTREAMER_BACKEND_  
+    XAuint32 chCount = 0;
+#endif    
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataTraversalItfImpl_GetChildMIMETypeSize");
+    impl = GetImpl(self);
+
+    if( !impl || !pSize)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_  
+        res = XAMetadataTraversalItfAdapt_GetChildCount(impl->adaptCtx, &chCount);
+        if(index >= chCount || res != XA_RESULT_SUCCESS)
+        {
+            /* out of bounds */
+            res = XA_RESULT_PARAMETER_INVALID;
+        }
+        res = XAMetadataTraversalItfAdapt_GetChildMIMETypeSize(impl->adaptCtx, index, pSize);
+#endif
+    }
+
+    DEBUG_API("<-XAMetadataTraversalItfImpl_GetChildMIMETypeSize");
+    return res;
+}
+
+/* XAresult XAMetadataTraversalItfImpl_GetChildInfo
+ * Description: Returns information about a child
+ */
+XAresult XAMetadataTraversalItfImpl_GetChildInfo(XAMetadataTraversalItf self,
+                                                 XAuint32 index,
+                                                 XAint32 *pNodeID,
+                                                 XAuint32 *pType,
+                                                 XAuint32 size,
+                                                 XAchar *pMimeType)
+{
+    XAMetadataTraversalImpl *impl = NULL;
+#ifdef _GSTREAMER_BACKEND_  
+    XAuint32 chCount = 0;
+#endif
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataTraversalItfImpl_GetChildInfo");
+    impl = GetImpl(self);
+    if( !impl || !pNodeID || !pType )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_  
+        res = XAMetadataTraversalItfAdapt_GetChildCount(impl->adaptCtx, &chCount);
+        if(index >= chCount || res != XA_RESULT_SUCCESS)
+        {
+            /* out of bounds */
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("<-XAMetadataTraversalItfImpl_GetChildInfo");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+        res = XAMetadataTraversalItfAdapt_GetChildInfo(impl->adaptCtx, index,
+                                                pNodeID, pType, size, pMimeType);
+#endif
+    }
+
+    DEBUG_API("<-XAMetadataTraversalItfImpl_GetChildInfo");
+    return res;
+}
+
+/* XAresult XAMetadataTraversalItfImpl_SetActiveNode
+ * Description: Sets the scope to a child node
+ */
+XAresult XAMetadataTraversalItfImpl_SetActiveNode(XAMetadataTraversalItf self,
+                                                  XAuint32 index)
+{
+    XAMetadataTraversalImpl *impl = NULL;
+#ifdef _GSTREAMER_BACKEND_  
+    XAuint32 chCount = 0;
+#endif
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataTraversalItfImpl_SetActiveNode");
+    impl = GetImpl(self);
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_  
+        res = XAMetadataTraversalItfAdapt_GetChildCount(impl->adaptCtx, &chCount);
+        if( res == XA_RESULT_SUCCESS )
+        {
+            if((impl->nodedepth==0 && index==XA_NODE_PARENT) ||
+                (index >= chCount && index!=XA_NODE_PARENT))
+            {
+                /* try to ascend from root or descend to nonexistend child node */
+                res = XA_RESULT_PARAMETER_INVALID;
+            }
+            else
+            {
+                /* update node and childs */
+                res = XAMetadataTraversalItfAdapt_SetActiveNode(impl->adaptCtx, index);
+                if( res == XA_RESULT_SUCCESS )
+                {
+                    if(index==XA_NODE_PARENT)
+                    {
+                        impl->nodedepth++;
+                    }
+                    else
+                    {
+                        impl->nodedepth--;
+                    }
+                }
+            }
+        }
+        else
+        {
+            DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+            DEBUG_API("<-XAMetadataTraversalItfImpl_SetActiveNode");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+#endif        
+    }
+
+    DEBUG_API("<-XAMetadataTraversalItfImpl_SetActiveNode");
+    return res;
+}
+
+/*****************************************************************************
+ * XAMetadataTraversalImpl -specific methods
+ *****************************************************************************/
+#ifdef _GSTREAMER_BACKEND_  
+
+/* XAMetadataTraversalImpl* XAMetadataTraversalItfImpl_Create()
+ * Description: Allocate and initialize XAMetadataTraversalImpl
+ */
+XAMetadataTraversalImpl* XAMetadataTraversalItfImpl_Create( XAAdaptationBaseCtx *adaptCtx )
+{
+    XAMetadataTraversalImpl *self = NULL;
+    DEBUG_API("->XAMetadataTraversalItfImpl_Create");
+
+    self = (XAMetadataTraversalImpl*) calloc(1,sizeof(XAMetadataTraversalImpl));
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.SetMode = XAMetadataTraversalItfImpl_SetMode;
+        self->itf.GetChildCount = XAMetadataTraversalItfImpl_GetChildCount;
+        self->itf.GetChildMIMETypeSize = XAMetadataTraversalItfImpl_GetChildMIMETypeSize;
+        self->itf.GetChildInfo = XAMetadataTraversalItfImpl_GetChildInfo;
+        self->itf.SetActiveNode = XAMetadataTraversalItfImpl_SetActiveNode;
+
+        /* init variables */
+        self->adaptCtx = adaptCtx;
+
+        self->self = self;
+    }
+    DEBUG_API("<-XAMetadataTraversalItfImpl_Create");
+    return self;
+}
+#endif
+/* void XAMetadataTraversalItfImpl_Free(XAMetadataTraversalImpl* self)
+ * Description: Free all resources reserved at XAMetadataTraversalItfImpl_Create
+ */
+void XAMetadataTraversalItfImpl_Free(XAMetadataTraversalImpl* self)
+{
+    DEBUG_API("->XAMetadataTraversalItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAMetadataTraversalItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xametadatatraversalitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAMETADATATRAVERSALITF_H
+#define XAMETADATATRAVERSALITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAMetadataTraversalItf implementation */
+typedef struct XAMetadataTraversalImpl_
+{
+    /* parent interface */
+    struct XAMetadataTraversalItf_ itf;
+    /* pointer to self */
+    struct XAMetadataTraversalImpl_* self;
+
+    /* pointer to metadata variables */
+    XAuint32 traversemode;
+    XAuint32 index;
+    XAuint32 nodedepth;
+
+#ifdef _GSTREAMER_BACKEND_  
+    XAAdaptationBaseCtx *adaptCtx;
+#endif
+} XAMetadataTraversalImpl;
+
+/** METHODS **/
+
+/* Base interface XAMetadataTraversalItf implementation */
+XAresult XAMetadataTraversalItfImpl_SetMode(XAMetadataTraversalItf self,
+                                          XAuint32 mode);
+
+XAresult XAMetadataTraversalItfImpl_GetChildCount(XAMetadataTraversalItf self,
+                                                XAuint32 *pCount);
+
+XAresult XAMetadataTraversalItfImpl_GetChildMIMETypeSize(XAMetadataTraversalItf self,
+                                                       XAuint32 index,
+                                                       XAuint32 *pSize);
+
+XAresult XAMetadataTraversalItfImpl_GetChildInfo(XAMetadataTraversalItf self,
+                                               XAuint32 index,
+                                               XAint32 *pNodeID,
+                                               XAuint32 *pType,
+                                               XAuint32 size,
+                                               XAchar *pMimeType);
+
+XAresult XAMetadataTraversalItfImpl_SetActiveNode(XAMetadataTraversalItf self,
+                                                XAuint32 index);
+
+#ifdef _GSTREAMER_BACKEND_  
+/* XAMetadataExtractionItfImpl -specific methods */
+XAMetadataTraversalImpl* XAMetadataTraversalItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
+#endif
+void XAMetadataTraversalItfImpl_Free(XAMetadataTraversalImpl* self);
+
+#endif /* XAMETADATATRAVERSALITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaobjectitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,530 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "xaobjectitf.h"
+
+/**
+ * Base interface XAObjectItf implementation
+ */
+XAresult XAObjectItfImpl_Realize(XAObjectItf self, XAboolean async)
+{
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*self);
+    XAresult retval = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAObjectItfImpl_Realize");
+    if( !pObjImp || pObjImp != pObjImp->self)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAObjectItfImpl_Realize");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( async )
+    {
+        /* invoke asynchronously */
+        if( !pObjImp->callBack )
+        {
+            retval = XA_RESULT_PARAMETER_INVALID;
+        }
+        else
+        {
+            /* check if another async operation is processed */
+            if(pObjImp->asyncOngoing)
+            {
+                /* abort ongoing operation */
+                XAImpl_CancelThread(pObjImp->asyncThr);
+            }
+            pObjImp->asyncOngoing = XA_BOOLEAN_TRUE;
+            if(XAImpl_StartThread(pObjImp->asyncThr, NULL,
+                    XAObjectItfImpl_AsyncRealize,(void*)(self)))
+            {
+                pObjImp->asyncOngoing = XA_BOOLEAN_FALSE;
+                retval = XA_RESULT_RESOURCE_ERROR;
+            }
+            else
+            {
+                retval = XA_RESULT_SUCCESS;
+            }
+        }
+    }
+    else
+    {
+        /* Check if the object is in unrealized state */
+        if(pObjImp->state != XA_OBJECT_STATE_UNREALIZED)
+        {
+            DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+            DEBUG_API("<-XAObjectItfImpl_Realize");
+            return XA_RESULT_PRECONDITIONS_VIOLATED;
+        }
+        /* invoke synchronously */
+        if( pObjImp->DoRealizeImpl )
+        {
+            retval = pObjImp->DoRealizeImpl(self);
+        }
+    }
+    DEBUG_API("<-XAObjectItfImpl_Realize");
+    return retval;
+}
+
+XAresult XAObjectItfImpl_Resume(XAObjectItf self, XAboolean async)
+{
+    XAresult retval = XA_RESULT_SUCCESS;
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*self);
+    DEBUG_API("->XAObjectItfImpl_Resume");
+
+    if( !pObjImp || pObjImp != pObjImp->self )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAObjectItfImpl_Resume");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    if( async )
+    {
+        /* invoke asynchronously */
+        if( !pObjImp->callBack )
+        {
+            retval = XA_RESULT_PARAMETER_INVALID;
+        }
+        else
+        {
+            /* check if another async operation is processed */
+            if(pObjImp->asyncOngoing)
+            {
+                /* abort ongoing operation */
+                XAImpl_CancelThread(pObjImp->asyncThr);
+            }
+            pObjImp->asyncOngoing = XA_BOOLEAN_TRUE;
+            if(XAImpl_StartThread(pObjImp->asyncThr, NULL,
+                    XAObjectItfImpl_AsyncResume,(void*)(self)))
+            {
+                pObjImp->asyncOngoing = XA_BOOLEAN_FALSE;
+                retval = XA_RESULT_RESOURCE_ERROR;
+            }
+            else
+            {
+                retval = XA_RESULT_SUCCESS;
+            }
+        }
+    }
+    else
+    {
+        /* invoke synchronously */
+        if( pObjImp->DoResumeImpl )
+        {
+            retval = pObjImp->DoResumeImpl(self);
+        }
+    }
+    DEBUG_API("<-XAObjectItfImpl_Resume");
+    return retval;
+}
+
+XAresult XAObjectItfImpl_GetState(XAObjectItf self, XAuint32 *pState)
+{
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*self);
+    DEBUG_API("->XAObjectItfImpl_GetState");
+    if( !pObjImp || pObjImp != pObjImp->self || !pState )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAObjectItfImpl_GetState");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    *pState = pObjImp->state;
+
+    DEBUG_API("<-XAObjectItfImpl_GetState");
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XAObjectItfImpl_GetInterface(XAObjectItf self, const XAInterfaceID iid,
+                                       void *pInterface)
+{
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*self);
+    XAObjItfMapEntry *mapEntry = NULL;
+    DEBUG_API("->XAObjectItfImpl_GetInterface");
+
+    if( !pObjImp || pObjImp != pObjImp->self || !pInterface || !iid )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAObjectItfImpl_GetInterface");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(pObjImp->state != XA_OBJECT_STATE_REALIZED)
+    {
+        DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+        DEBUG_API("<-XAObjectItfImpl_GetInterface");
+        /*state is not correct */
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+
+    mapEntry = XAObjectItfImpl_GetItfEntry(self, iid);
+    if( mapEntry && mapEntry->pItf )
+    {
+        *(void**)pInterface = &(mapEntry->pItf);
+        DEBUG_API("<-XAObjectItfImpl_GetInterface");
+        return XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        DEBUG_API("<-XAObjectItfImpl_GetInterface");
+        return XA_RESULT_FEATURE_UNSUPPORTED;
+    }
+}
+
+
+XAresult XAObjectItfImpl_RegisterCallback(XAObjectItf self,
+                                       xaObjectCallback callback,
+                                       void *pContext)
+{
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*self);
+    DEBUG_API("->XAObjectItfImpl_RegisterCallback");
+
+    if( !pObjImp || pObjImp != pObjImp->self )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAObjectItfImpl_RegisterCallback");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    pObjImp->callBack = callback;
+    pObjImp->context = pContext;
+    pObjImp->cbPtrToSelf = self;
+
+    DEBUG_API("<-XAObjectItfImpl_RegisterCallback");
+    return XA_RESULT_SUCCESS;
+}
+
+void XAObjectItfImpl_AbortAsyncOperation(XAObjectItf self)
+{
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*self);
+    DEBUG_API("->XAObjectItfImpl_AbortAsyncOperation");
+
+    if( pObjImp &&
+       (pObjImp == pObjImp->self) &&
+        pObjImp->callBack &&
+        pObjImp->asyncOngoing )
+    {
+        /* abort ongoing operation */
+        XAImpl_CancelThread(pObjImp->asyncThr);
+    }
+
+    DEBUG_API("<-XAObjectItfImpl_AbortAsyncOperation");
+}
+
+void XAObjectItfImpl_Destroy(XAObjectItf self)
+{
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*self);
+    DEBUG_API("->XAObjectItfImpl_Destroy");
+
+    if( pObjImp && pObjImp == pObjImp->self )
+    {
+        if( pObjImp->asyncOngoing )
+        {
+            /* abort ongoing operation */
+            XAImpl_CancelThread(pObjImp->asyncThr);
+        }
+        /* free object specific resources */
+        if( pObjImp->FreeResourcesImpl )
+        {
+            pObjImp->FreeResourcesImpl(self);
+        }
+        free(pObjImp->interfaceMap);
+        XAImpl_DeleteThreadHandle(pObjImp->asyncThr);
+        free(pObjImp);
+    }
+
+    DEBUG_API("<-XAObjectItfImpl_Destroy");
+}
+
+XAresult XAObjectItfImpl_SetPriority(XAObjectItf self, XAint32 priority,
+                                  XAboolean preemptable)
+{
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*self);
+    DEBUG_API("->XAObjectItfImpl_SetPriority");
+
+    if( !pObjImp || pObjImp != pObjImp->self )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAObjectItfImpl_SetPriority");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    pObjImp->priority = priority;
+    pObjImp->preemptable = preemptable;
+
+    DEBUG_API("<-XAObjectItfImpl_SetPriority");
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XAObjectItfImpl_GetPriority(XAObjectItf self, XAint32 *pPriority,
+                                  XAboolean *pPreemptable)
+{
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*self);
+    DEBUG_API("->XAObjectItfImpl_GetPriority");
+
+    if( !pObjImp || pObjImp != pObjImp->self )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAObjectItfImpl_GetPriority");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    *pPriority = pObjImp->priority;
+    *pPreemptable = pObjImp->preemptable;
+
+    DEBUG_API("<-XAObjectItfImpl_GetPriority");
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XAObjectItfImpl_SetLossOfControlInterfaces(XAObjectItf self,
+                                              XAint16 numInterfaces,
+                                              XAInterfaceID *pInterfaceIDs,
+                                              XAboolean enabled)
+{
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*self);
+    XAint32 itfIndex = 0;
+    XAObjItfMapEntry *mapEntry = NULL;
+    DEBUG_API("->XAObjectItfImpl_SetLossOfControlInterfaces");
+
+    if( !pObjImp || pObjImp != pObjImp->self || !pInterfaceIDs )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAObjectItfImpl_SetLossOfControlInterfaces");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    if( pInterfaceIDs )
+    {
+        for(itfIndex = 0; itfIndex < numInterfaces; itfIndex++)
+        {
+            mapEntry = XAObjectItfImpl_GetItfEntry(self, pInterfaceIDs[itfIndex]);
+            if( mapEntry )
+            {
+                mapEntry->locEnabled = enabled;
+            }
+        }
+    }
+
+    DEBUG_API("<-XAObjectItfImpl_SetLossOfControlInterfaces");
+    return XA_RESULT_SUCCESS;
+}
+
+/**
+ * XAObjectItfImpl -specific methods
+ **/
+
+/*
+ * Allocate and init new object itf instance
+ */
+XAresult XAObjectItfImpl_Init(XAObjectItfImpl* self,
+                              XAuint32 itfCount,
+                              const XAInterfaceID** itfIIDs,
+                              xaDoRealizeImpl doRealizeImpl,
+                              xaDoResumeImpl doResumeImpl,
+                              xaFreeResourcesImpl freeResourcesImpl)
+{
+    XAuint32 i = 0;
+    DEBUG_API("->XAObjectItfImpl_Init");
+
+    assert( self && itfIIDs && doRealizeImpl && doResumeImpl && freeResourcesImpl );
+
+    self->interfaceMap =
+       (XAObjItfMapEntry*)calloc(itfCount, sizeof(XAObjItfMapEntry));
+    if( !self->interfaceMap )
+    {
+        free(self);
+        DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+        DEBUG_API("<-XAObjectItfImpl_Init");
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+    if( XAImpl_CreateThreadHandle(&(self->asyncThr)) != XA_RESULT_SUCCESS )
+    {
+        free(self);
+        DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+        DEBUG_API("<-XAObjectItfImpl_Init");
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+    for(i=0;i<itfCount;i++)
+    {
+        self->interfaceMap[i].mapIdx = i;
+        self->interfaceMap[i].iid = *(itfIIDs[i]);
+        self->interfaceMap[i].pItf = NULL;
+        self->interfaceMap[i].locEnabled = XA_BOOLEAN_FALSE;
+        self->interfaceMap[i].required = XA_BOOLEAN_FALSE;
+        self->interfaceMap[i].isDynamic = XA_BOOLEAN_FALSE;
+    }
+    self->interfaceMap[0].pItf = self;
+    self->interfaceMap[0].required = XA_BOOLEAN_TRUE;
+
+    self->interfaceCount = itfCount;
+    self->priority = XA_PRIORITY_NORMAL;
+    self->preemptable = XA_BOOLEAN_FALSE;
+    self->state = XA_OBJECT_STATE_UNREALIZED;
+    self->callBack = NULL;
+    self->context = NULL;
+    self->asyncOngoing = XA_BOOLEAN_FALSE;
+    self->cbPtrToSelf = NULL;
+
+    self->DoRealizeImpl = doRealizeImpl;
+    self->DoResumeImpl = doResumeImpl;
+    self->FreeResourcesImpl = freeResourcesImpl;
+
+    /* init itf default implementation */
+    self->itf.Realize = XAObjectItfImpl_Realize;
+    self->itf.Resume = XAObjectItfImpl_Resume;
+    self->itf.GetState = XAObjectItfImpl_GetState;
+    self->itf.GetInterface = XAObjectItfImpl_GetInterface;
+    self->itf.RegisterCallback = XAObjectItfImpl_RegisterCallback;
+    self->itf.AbortAsyncOperation = XAObjectItfImpl_AbortAsyncOperation;
+    self->itf.Destroy = XAObjectItfImpl_Destroy;
+    self->itf.SetPriority = XAObjectItfImpl_SetPriority;
+    self->itf.GetPriority = XAObjectItfImpl_GetPriority;
+    self->itf.SetLossOfControlInterfaces  = XAObjectItfImpl_SetLossOfControlInterfaces;
+    self->self = self;
+
+    DEBUG_API("<-XAObjectItfImpl_Init");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * Asynchronous invocation of Realize
+ */
+void* XAObjectItfImpl_AsyncRealize(void* args)
+{
+    XAresult retval = XA_RESULT_SUCCESS;
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*(XAObjectItf)(args));
+    DEBUG_API("->XAObjectItfImpl_AsyncRealize");
+
+    if( pObjImp && pObjImp == pObjImp->self)
+    {
+        /* Check if the object is in unrealized state */
+        if(pObjImp->state != XA_OBJECT_STATE_UNREALIZED)
+        {
+            retval = XA_RESULT_PRECONDITIONS_VIOLATED;
+        }
+        else if( pObjImp->DoRealizeImpl )
+        {
+            retval = pObjImp->DoRealizeImpl((XAObjectItf)(args));
+        }
+        if( pObjImp->callBack )
+        {
+            pObjImp->callBack(pObjImp->cbPtrToSelf, pObjImp->context,
+                              XA_OBJECT_EVENT_ASYNC_TERMINATION,
+                              retval, pObjImp->state, NULL);
+        }
+        pObjImp->asyncOngoing = XA_BOOLEAN_FALSE;
+        XAImpl_ExitThread(pObjImp->asyncThr);
+    }
+    else
+    {
+        DEBUG_API("XAObjectItfImpl_AsyncRealize: INVALID args");
+    }
+    
+
+    DEBUG_API("<-XAObjectItfImpl_AsyncRealize");
+    return NULL;
+}
+
+
+/*
+ * Asynchronous invocation of Resume
+ */
+void* XAObjectItfImpl_AsyncResume(void* args)
+{
+    XAresult retval = XA_RESULT_SUCCESS;
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*(XAObjectItf)(args));
+    DEBUG_API("->XAObjectItfImpl_AsyncResume");
+
+    if( pObjImp && pObjImp == pObjImp->self )
+    {
+        if( pObjImp->DoResumeImpl )
+        {
+            retval = pObjImp->DoResumeImpl((XAObjectItf)(args));
+        }
+        if( pObjImp->callBack )
+        {
+            pObjImp->callBack(pObjImp->cbPtrToSelf, pObjImp->context,
+                              XA_OBJECT_EVENT_ASYNC_TERMINATION,
+                              retval, pObjImp->state, NULL);
+        }
+        pObjImp->asyncOngoing = XA_BOOLEAN_FALSE;
+        XAImpl_ExitThread(pObjImp->asyncThr);
+    }
+    else
+    {
+        DEBUG_API("XAObjectItfImpl_AsyncResume: INVALID args");
+    }
+    
+
+    DEBUG_API("<-XAObjectItfImpl_AsyncResume");
+    return NULL;
+}
+
+void XAObjectItfImpl_AsyncCleanup(void* args)
+{
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*(XAObjectItf)(args));
+    DEBUG_API("->XAObjectItfImpl_AsyncCleanup");
+
+    if( pObjImp &&
+       (pObjImp == pObjImp->self) &&
+        pObjImp->FreeResourcesImpl )
+    {
+        pObjImp->FreeResourcesImpl((XAObjectItf)(args));
+    }
+    else
+    {
+        DEBUG_API("XAObjectItfImpl_AsyncCleanup: INVALID args");
+    }
+
+    DEBUG_API("<-XAObjectItfImpl_AsyncCleanup");
+}
+
+XAObjItfMapEntry* XAObjectItfImpl_GetItfEntry(const XAObjectItf self,
+                                              const XAInterfaceID iid)
+{
+    XAuint32 mapIndex = 0;
+    XAObjectItfImpl* pObjImp = (XAObjectItfImpl*)(*self);
+    DEBUG_API("->XAObjectItfImpl_GetItfEntry");
+
+    if( pObjImp &&
+       (pObjImp == pObjImp->self) &&
+        pObjImp->interfaceMap &&
+        iid )
+    {
+        /* Check interface */
+        for(mapIndex = 0; mapIndex < pObjImp->interfaceCount; mapIndex++)
+        {
+            if(XACommon_EqualIIds(pObjImp->interfaceMap[mapIndex].iid, iid))
+            {
+                DEBUG_API("<-XAObjectItfImpl_GetItfEntry");
+                return &(pObjImp->interfaceMap[mapIndex]);
+            }
+        }
+    }
+
+    DEBUG_API("<-XAObjectItfImpl_GetItfEntry");
+    return NULL;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaobjectitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,128 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAOBJECTITF_H
+#define XAOBJECTITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#include "xaplatform.h"
+
+/** MACROS **/
+
+/** TYPES **/
+/* object-specific function pointers */
+typedef XAresult (*xaDoRealizeImpl)(XAObjectItf self);
+typedef XAresult (*xaDoResumeImpl)(XAObjectItf self);
+typedef void (*xaFreeResourcesImpl)(XAObjectItf self);
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+typedef struct XAObjItfMapEntry_
+{
+    XAInterfaceID iid;
+    XAuint8       mapIdx;
+    void          *pItf;
+    XAboolean     locEnabled;
+    XAboolean     required;
+    XAboolean     isDynamic;
+} XAObjItfMapEntry;
+
+/* Definition of XAObjectItf implementation */
+typedef struct XAObjectItfImpl_
+{
+    /* parent interface */
+    struct XAObjectItf_ itf;
+    /* pointer to self */
+    struct XAObjectItfImpl_* self;
+
+    /* variables */
+    XAint32 priority;
+    XAboolean preemptable;
+    XAuint32 state;
+
+    /* array of available interfaces */
+    XAObjItfMapEntry *interfaceMap;
+    XAuint32 interfaceCount;
+
+    /* async related variables */
+    XAImplThreadHandle asyncThr;
+    XAboolean asyncOngoing;
+    xaObjectCallback callBack;
+    void *context;
+    XAObjectItf cbPtrToSelf;
+
+    /* object-specific function implementation pointers */
+    /* (must be implemented by every object) */
+    xaDoRealizeImpl DoRealizeImpl;
+    xaDoResumeImpl DoResumeImpl;
+    xaFreeResourcesImpl FreeResourcesImpl;
+} XAObjectItfImpl;
+
+
+/** METHODS **/
+
+/* Base interface XAObjectItf implementation */
+XAresult XAObjectItfImpl_Realize(XAObjectItf self, XAboolean async);
+
+XAresult XAObjectItfImpl_Resume(XAObjectItf self, XAboolean async);
+
+XAresult XAObjectItfImpl_GetState(XAObjectItf self, XAuint32 *pState);
+
+XAresult XAObjectItfImpl_GetInterface(XAObjectItf self,
+                                       const XAInterfaceID iid,
+                                       void *pInterface);
+
+XAresult XAObjectItfImpl_RegisterCallback(XAObjectItf self,
+                                           xaObjectCallback callback,
+                                           void *pContext);
+
+void XAObjectItfImpl_AbortAsyncOperation(XAObjectItf self);
+
+void XAObjectItfImpl_Destroy(XAObjectItf self);
+
+XAresult XAObjectItfImpl_SetPriority(XAObjectItf self, XAint32 priority,
+                                      XAboolean preemptable);
+
+XAresult XAObjectItfImpl_GetPriority(XAObjectItf self, XAint32 *pPriority,
+                                      XAboolean *pPreemptable);
+
+XAresult XAObjectItfImpl_SetLossOfControlInterfaces(XAObjectItf self,
+                                                     XAint16 numInterfaces,
+                                                     XAInterfaceID *pInterfaceIDs,
+                                                     XAboolean enabled);
+
+/* XAObjectItfImpl -specific methods */
+
+/* Allocate and initialize base object */
+XAresult XAObjectItfImpl_Init(XAObjectItfImpl* self,
+                              XAuint32 itfCount,
+                              const XAInterfaceID** itfIIDs,
+                              xaDoRealizeImpl doRealizeImpl,
+                              xaDoResumeImpl doResumeImpl,
+                              xaFreeResourcesImpl freeResourcesImpl);
+
+/* methods for asynchronous service */
+void* XAObjectItfImpl_AsyncRealize(void* args);
+void* XAObjectItfImpl_AsyncResume(void* args);
+void XAObjectItfImpl_AsyncCleanup(void* args);
+
+XAObjItfMapEntry* XAObjectItfImpl_GetItfEntry(const XAObjectItf self,
+                                              const XAInterfaceID iid);
+
+#endif /* XAOBJECTITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaplatform.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,283 @@
+/*
+* 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 <pthread.h>
+#include <semaphore.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <errno.h>
+
+#include "xaplatform.h"
+
+
+
+/** MACROS **/
+
+/**********************************************************************
+ * mutex management
+ **********************************************************************/
+/* define next if platform supports posix error checking mutex type */
+#undef _MUTEXERRORSUPPORT
+
+#ifdef _MUTEXERRORSUPPORT
+    typedef pthread_mutex_t XA_MTX;
+#else
+    typedef struct
+    {
+        pthread_mutex_t mutex;
+        pthread_t owner;
+    } XA_MTX;
+#endif
+
+XAresult XAImpl_CreateMutex( XAImplMutexHandle *mtx )
+{
+    XA_MTX *pMtx = (XA_MTX *)malloc(sizeof(XA_MTX));
+    assert(mtx);
+    if( pMtx )
+    {
+        pthread_mutexattr_t *pAttr = NULL;
+#ifdef _MUTEXERRORSUPPORT
+        pthread_mutexattr_t attr;
+        pAttr = &attr;
+        pthread_mutexattr_init(pAttr);
+        pthread_mutexattr_settype(pAttr, PTHREAD_MUTEX_ERRORCHECK);
+        if(pthread_mutex_init(pMtx, pAttr))
+#else
+        if(pthread_mutex_init(&(pMtx->mutex), pAttr))
+#endif
+        {
+            free(pMtx);
+            *mtx = NULL;
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+        *mtx = (XAImplMutexHandle)pMtx;
+        return XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+}
+
+
+XAresult XAImpl_LockMutex( XAImplMutexHandle mtx )
+{
+    XA_MTX *pMtx = (XA_MTX*)mtx;
+    assert(pMtx);
+#ifdef _MUTEXERRORSUPPORT
+    if(pthread_mutex_lock(pMtx))
+    {
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+#else
+    if( pthread_self() == pMtx->owner ||
+        pthread_mutex_unlock(&(pMtx->mutex)) )
+    {
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+    pMtx->owner = pthread_self();
+#endif
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XAImpl_TryLockMutex( XAImplMutexHandle  mtx )
+{
+    XA_MTX *pMtx = (XA_MTX*)mtx;
+    XAint32 mutexRet;
+    XAresult ret = XA_RESULT_SUCCESS;
+    assert(pMtx);
+
+#ifdef _MUTEXERRORSUPPORT
+    mutexRet = pthread_ mutex_trylock(pMtx);
+    switch (mutexRet)
+    {
+    case EBUSY:
+        /* if mutex is already locked, return permission denied */
+        ret =  XA_RESULT_PERMISSION_DENIED;
+        break;
+    case 0:
+        ret =  XA_RESULT_SUCCESS;
+        break;
+    default:
+        ret = XA_RESULT_PRECONDITIONS_VIOLATED;
+        break;
+    }
+#else
+    if( pthread_self() == pMtx->owner )
+    {
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+
+    mutexRet = pthread_mutex_trylock(&(pMtx->mutex));
+    switch (mutexRet)
+    {
+    case EBUSY:
+        /* if mutex is already locked, return permission denied */
+        ret =  XA_RESULT_PERMISSION_DENIED;
+        break;
+    case 0:
+        pMtx->owner = pthread_self();
+        ret =  XA_RESULT_SUCCESS;
+        break;
+    default:
+        ret =  XA_RESULT_PRECONDITIONS_VIOLATED;
+        break;
+    }
+#endif
+    return ret;
+}
+
+
+XAresult XAImpl_UnlockMutex( XAImplMutexHandle mtx )
+{
+    XA_MTX *pMtx = (XA_MTX*)mtx;
+    assert(pMtx);
+#ifdef _MUTEXERRORSUPPORT
+    if(pthread_mutex_lock(pMtx))
+    {
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+#else
+    if( pthread_self() != pMtx->owner ||
+        pthread_mutex_unlock(&(pMtx->mutex)) )
+    {
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+    // Changing the below value to 0 since owner is an unsigned int.
+    // pMtx->owner = -1;
+    pMtx->owner = 0;
+#endif
+    return XA_RESULT_SUCCESS;
+}
+
+void XAImpl_DeleteMutex( XAImplMutexHandle mtx )
+{
+    XA_MTX *pMtx = (XA_MTX*)mtx;
+    if( pMtx )
+    {
+#ifdef _MUTEXERRORSUPPORT
+        pthread_mutex_destroy(pMtx);
+#else
+        pthread_mutex_destroy(&(pMtx->mutex));
+#endif
+        free(pMtx);
+    }
+}
+
+/**********************************************************************
+ * semaphores
+ **********************************************************************/
+
+
+XAresult XAImpl_CreateSemaphore( XAImplSemHandle *sem )
+{
+    sem_t *pSem = (sem_t*)malloc(sizeof(sem_t));
+    assert(sem);
+    if( pSem )
+    {
+        if(sem_init(pSem,0,0))
+        {
+            free(pSem);
+            *sem = NULL;
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+        *sem = (XAImplSemHandle)pSem;
+        return XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+}
+
+XAresult XAImpl_WaitSemaphore( XAImplSemHandle sem )
+{
+    sem_t* pSem = (sem_t*)sem;
+    assert(pSem);
+    sem_wait(pSem);
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XAImpl_PostSemaphore( XAImplSemHandle sem )
+{
+    sem_t *pSem = (sem_t*)sem;
+    assert(pSem);
+    sem_post(pSem);
+    return XA_RESULT_SUCCESS;
+}
+
+void XAImpl_DeleteSemaphore( XAImplSemHandle sem )
+{
+    sem_t *pSem = (sem_t*)sem;
+    if( pSem )
+    {
+        sem_destroy(pSem);
+        free(pSem);
+    }
+}
+
+/**********************************************************************
+ * THREADS
+ **********************************************************************/
+
+XAresult XAImpl_CreateThreadHandle( XAImplThreadHandle *thd )
+{
+    pthread_t *pThd = (pthread_t*)malloc(sizeof(pthread_t));
+    assert(thd);
+    if( !pThd )
+    {
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+    *thd = (XAImplThreadHandle)pThd;
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XAImpl_StartThread( XAImplThreadHandle thd,
+        void *thdattrib, XAImplThreadFunction thdfunc, void* thdfuncargs )
+{
+    pthread_t *pThd = (pthread_t*)thd;
+    assert(thd);
+    if ( pthread_create(pThd, thdattrib, thdfunc, thdfuncargs) )
+    {
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    return XA_RESULT_SUCCESS;
+}
+
+void XAImpl_CancelThread( XAImplThreadHandle thd )
+{
+// int res;
+ // TL: TODO: There is no pthread_cancel API in S60, need to replace
+ //res = pthread_cancel(*pThd);
+ 
+}
+
+void XAImpl_ExitThread( XAImplThreadHandle thd )
+{
+    pthread_exit(NULL);
+}
+
+void XAImpl_DeleteThreadHandle( XAImplThreadHandle thd )
+{
+    pthread_t *pThd = (pthread_t*)thd;
+    if( pThd )
+    {
+        free(pThd);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaplatform.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAPLATFORM_H
+#define XAPLATFORM_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+typedef void* XAImplMutexHandle;
+typedef void* XAImplSemHandle;
+typedef void* XAImplThreadHandle;
+typedef void* (* XAImplThreadFunction)(
+    void *xaThdFunAargs
+);
+
+/** METHODS **/
+
+/* mutex management */
+XAresult XAImpl_CreateMutex( XAImplMutexHandle *mtx );
+XAresult XAImpl_TryLockMutex( XAImplMutexHandle  mtx );
+XAresult XAImpl_LockMutex( XAImplMutexHandle  mtx );
+XAresult XAImpl_UnlockMutex( XAImplMutexHandle mtx );
+void XAImpl_DeleteMutex( XAImplMutexHandle mtx );
+
+/* semaphores */
+XAresult XAImpl_CreateSemaphore( XAImplSemHandle *sem );
+XAresult XAImpl_WaitSemaphore( XAImplSemHandle sem );
+XAresult XAImpl_PostSemaphore( XAImplSemHandle sem );
+void XAImpl_DeleteSemaphore( XAImplSemHandle sem );
+
+/* thread management */
+
+XAresult XAImpl_CreateThreadHandle( XAImplThreadHandle *thd );
+XAresult XAImpl_StartThread( XAImplThreadHandle thd,
+                         void *thdattrib,
+                         XAImplThreadFunction thdfunc, void *thdfuncargs );
+void XAImpl_CancelThread( XAImplThreadHandle thd );
+void XAImpl_ExitThread( XAImplThreadHandle thd );
+void XAImpl_DeleteThreadHandle( XAImplThreadHandle thd );
+
+#endif /* XAPLATFORM_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xathreadsafety.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,167 @@
+/*
+* 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 <stdlib.h>
+#include "xathreadsafety.h"
+
+typedef struct
+{
+    XAImplMutexHandle mutexTable[XATSCount];
+    XAboolean tsEnabled;
+}XAThreadSafetyImpl;
+
+static XAThreadSafetyImpl* threadSafety;
+
+/*
+ * XAresult XAThreadSafety_Init()
+ * Description: Creates mutex table for thread safety support
+ * @return: Success value
+ */
+XAresult XAThreadSafety_Init( XAboolean tsEnable )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAint32 i = 0;
+    DEBUG_API_A1("->XAThreadSafety_Init - tsEnable:%lu",tsEnable);
+
+    /* Initialize thread safety only once */
+    if ( !threadSafety )
+    {
+        threadSafety = (XAThreadSafetyImpl *)calloc(1,sizeof(XAThreadSafetyImpl));
+        if ( !threadSafety )
+        {
+            DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+            DEBUG_API("<-XAThreadSafety_Init");
+            /* memory allocation failed */
+            return XA_RESULT_MEMORY_FAILURE;
+        }
+
+        threadSafety->tsEnabled = tsEnable;
+
+        if ( tsEnable )
+        {
+            for( i = 0; i < XATSCount; i++ )
+            {
+                ret = XAImpl_CreateMutex( &threadSafety->mutexTable[i] );
+                if ( ret != XA_RESULT_SUCCESS )
+                {
+                    break;
+                }
+                DEBUG_INFO_A2("Created %s:%x",MEDIAOBJECTNAME(i), threadSafety->mutexTable[i] );
+            }
+        }
+        else
+        {
+            DEBUG_INFO("Thread safety: disabled.");
+        }
+    }
+
+    DEBUG_API("<-XAThreadSafety_Init");
+    return ret;
+}
+
+/*
+ * XAresult XAThreadSafety_Destroy()
+ * Description: Destroys mutex table created for thread safety support
+ */
+XAresult XAThreadSafety_Destroy()
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAint32 i = 0;
+    DEBUG_API("->XAThreadSafety_Destroy");
+
+    if ( threadSafety )
+    {
+        if ( threadSafety->tsEnabled )
+        {
+            for( i = 0; i < XATSCount; i++ )
+            {
+                DEBUG_INFO_A2("Free %s:%x",MEDIAOBJECTNAME(i), threadSafety->mutexTable[i] );
+                XAImpl_DeleteMutex( threadSafety->mutexTable[i] );
+            }
+        }
+        free( threadSafety);
+    }
+    else
+    {
+        DEBUG_INFO("Thread safety: disabled.");
+    }
+
+    DEBUG_API("<-XAThreadSafety_Destroy");
+    return ret;
+
+}
+
+/*
+ * XAresult XAThreadSafety_Unlock( XAThreadSafetyMediaObjects mediaObject )
+ * Description:
+ * @param XAThreadSafetyMediaObjects mediaObject
+ * @return
+ */
+XAresult XAThreadSafety_Unlock( XAThreadSafetyMediaObjects mediaObject )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAThreadSafety_Unlock");
+
+    if ( threadSafety )
+    {
+        if ( threadSafety->tsEnabled )
+        {
+            ret = XAImpl_UnlockMutex( threadSafety->mutexTable[mediaObject] );
+            if ( ret == XA_RESULT_SUCCESS)
+            {
+                DEBUG_INFO_A2("Released lock for %s:%x",MEDIAOBJECTNAME(mediaObject), threadSafety->mutexTable[mediaObject] );
+            }
+        }
+    }
+    else
+    {
+        DEBUG_INFO("Thread safety: disabled.");
+    }
+    DEBUG_API("<-XAThreadSafety_Unlock");
+    return ret;
+}
+/*
+ * XAresult XAThreadSafety_TryLock( XAThreadSafetyMediaObjects mediaObject );
+ * Description:
+ * @param XAThreadSafetyMediaObjects mediaObject
+ * @return
+ */
+XAresult XAThreadSafety_TryLock( XAThreadSafetyMediaObjects mediaObject )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAThreadSafety_TryLock");
+
+    if ( threadSafety )
+    {
+        if ( threadSafety->tsEnabled )
+        {
+            ret = XAImpl_TryLockMutex( threadSafety->mutexTable[mediaObject]);
+            if ( ret == XA_RESULT_SUCCESS)
+            {
+                DEBUG_INFO_A2("Locked %s:%x",MEDIAOBJECTNAME(mediaObject), threadSafety->mutexTable[mediaObject] );
+            }
+        }
+    }
+    else
+    {
+        DEBUG_INFO("Thread safety: disabled.");
+    }
+
+    DEBUG_API("<-XAThreadSafety_TryLock");
+    return ret;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xathreadsafety.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,161 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XATHREADSAFETY_H_
+#define XATHREADSAFETY_H_
+
+#include "openmaxalwrapper.h"
+#include "xaplatform.h"
+#include "xadebug.h"
+
+#ifdef _DEBUG
+/*parse media object names for debug prints*/
+
+static const char* mediaobjectnames[9] =
+{
+    "XATSMediaPlayer",
+    "XATSMediaRecorder",
+    "XATSEngine",
+    "XATSRadio",
+    "XATSCamera",
+    "XATSOutputMix",
+    "XATSVibra",
+    "XATSLEDArray",
+    "XATSMetaDataExtractor"
+};
+#define MEDIAOBJECTNAME(i) ((i<XATSCount)?mediaobjectnames[i]:"INVALID")
+#endif /*_DEBUG*/
+
+/* MACROS */
+/*
+ * XA_IMPL_THREAD_SAFETY_ENTRY( mediaObject )
+ * Description: Tries to lock media object specified by parameter. If object is already locked
+ * returns error value.
+ * @param mediaObject - Index of media object where check is to be done
+ * @return: XA_RESULT_PRECONDITIONS_VIOLATED - If shared data mutex is already in use
+ * @return: XA_RESULT_INTERNAL_ERROR - If there is problem when reserving mutex
+ * @return: In success cases doesn't return
+ */
+#define XA_IMPL_THREAD_SAFETY_ENTRY( mediaObject )                                      \
+{                                                                                       \
+    XAresult  mutexRet = XA_RESULT_SUCCESS;                                             \
+    if ( mediaObject > XATSCount )                                                      \
+    {                                                                                   \
+        DEBUG_INFO("Thread safety - invalid mutex reference index");                    \
+        return XA_RESULT_PARAMETER_INVALID;                                             \
+    }                                                                                   \
+    DEBUG_INFO_A1("Thread safety entry for %s",MEDIAOBJECTNAME(mediaObject));           \
+    mutexRet = XAThreadSafety_TryLock( mediaObject );                                   \
+    if ( mutexRet == XA_RESULT_PERMISSION_DENIED )                                      \
+    {                                                                                   \
+        DEBUG_INFO("Media object already locked!");                                     \
+        return XA_RESULT_PRECONDITIONS_VIOLATED;                                        \
+    }                                                                                   \
+    else if ( mutexRet != XA_RESULT_SUCCESS )                                           \
+    {                                                                                   \
+        DEBUG_INFO("Media object lock error!");                                         \
+        return XA_RESULT_INTERNAL_ERROR;                                                \
+    }                                                                                   \
+    /* Fall through if XA_RESULT_SUCCESS */                                             \
+}                                                                                       \
+
+#define XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS( mediaObject )                   \
+{                                                                                       \
+    XAresult  mutexRet = XA_RESULT_SUCCESS;                                             \
+    if ( mediaObject > XATSCount )                                                      \
+    {                                                                                   \
+        DEBUG_INFO("Thread safety - invalid mutex reference index");                    \
+        return;                                                                         \
+    }                                                                                   \
+    DEBUG_INFO_A1("Thread safety entry for %s",MEDIAOBJECTNAME(mediaObject));           \
+    mutexRet = XAThreadSafety_TryLock( mediaObject );                                   \
+    if ( mutexRet == XA_RESULT_PERMISSION_DENIED )                                      \
+    {                                                                                   \
+        DEBUG_INFO("Media object already locked!");                                     \
+        return;                                                                         \
+    }                                                                                   \
+    else if ( mutexRet != XA_RESULT_SUCCESS )                                           \
+    {                                                                                   \
+        DEBUG_INFO("Media object lock error!");                                         \
+        return;                                                                         \
+    }                                                                                   \
+    /* Fall through if XA_RESULT_SUCCESS */                                             \
+}                                                                                       \
+/*
+ * XA_IMPL_THREAD_SAFETY_EXIT( mediaObject )
+ * Description: Frees reserved lock for shared data related specified by parameter.
+ * @param mediaObject - Index of media object where check is to be done
+ * @return: XA_RESULT_PRECONDITIONS_VIOLATED if lock is not reserved
+ * @return: XA_RESULT_INTERNAL_ERROR if freeing of lock cannot be done
+ * @return: In success cases doesn't return anything
+ */
+#define XA_IMPL_THREAD_SAFETY_EXIT( mediaObject )                                       \
+{                                                                                       \
+    XAresult  mutexRet = XA_RESULT_SUCCESS;                                             \
+    if ( mediaObject > XATSCount )                                                      \
+    {                                                                                   \
+        DEBUG_INFO("Thread safety - invalid mutex reference index");                    \
+        return XA_RESULT_PARAMETER_INVALID;                                             \
+    }                                                                                   \
+    DEBUG_INFO_A1("Thread safety exit for %s",MEDIAOBJECTNAME(mediaObject));            \
+    mutexRet = XAThreadSafety_Unlock( mediaObject );                                    \
+    if ( mutexRet != XA_RESULT_SUCCESS)                                                 \
+    {                                                                                   \
+        DEBUG_INFO("Unable to unlock media object!")                                    \
+        return XA_RESULT_INTERNAL_ERROR;                                                \
+    }                                                                                   \
+}                                                                                       \
+
+#define XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS( mediaObject )                    \
+{                                                                                       \
+    XAresult  mutexRet = XA_RESULT_SUCCESS;                                             \
+    if ( mediaObject > XATSCount )                                                      \
+    {                                                                                   \
+        DEBUG_INFO("Thread safety - invalid mutex reference index");                    \
+        return;                                                                         \
+    }                                                                                   \
+    DEBUG_INFO_A1("Thread safety exit for %s",MEDIAOBJECTNAME(mediaObject));            \
+    mutexRet = XAThreadSafety_Unlock( mediaObject );                                    \
+    if ( mutexRet != XA_RESULT_SUCCESS)                                                 \
+    {                                                                                   \
+        DEBUG_INFO("Unable to unlock media object!")                                    \
+        return;                                                                         \
+    }                                                                                   \
+}                                                                                       \
+/* ENUMERATIONS */
+
+typedef enum
+{
+    XATSMediaPlayer = 0,
+    XATSMediaRecorder,
+    XATSEngine,
+    XATSRadio,
+    XATSCamera,
+    XATSOutputMix,
+    XATSVibra,
+    XATSLEDArray,
+    XATSMetaDataExtractor,
+    XATSCount
+}XAThreadSafetyMediaObjects;
+
+/* FUNCTIONS */
+XAresult XAThreadSafety_Init( XAboolean tsEnable);
+XAresult XAThreadSafety_Destroy(void);
+XAresult XAThreadSafety_Unlock( XAThreadSafetyMediaObjects mediaObject );
+XAresult XAThreadSafety_TryLock( XAThreadSafetyMediaObjects mediaObject );
+
+#endif /* XATHREADSAFETY_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xavideopostprocessingitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,361 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xavideopostprocessingitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAVideoPostProsessingItfAdaptation.h"
+#endif
+/**
+ * XAVideoPostProcessingItfImpl* GetImpl(XAVideoPostProcessingItf self)
+ * Description: Validated interface pointer and cast it to implementations pointer.
+ **/
+static XAVideoPostProcessingItfImpl* GetImpl(XAVideoPostProcessingItf self)
+{
+    if(self)
+    {
+        XAVideoPostProcessingItfImpl* impl = (XAVideoPostProcessingItfImpl*)(*self);
+        if(impl && (impl == impl->self))
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAVideoPostProcessingItf implementation
+ */
+
+/**
+ * XAresult XAVideoPostProcessingItfImpl_SetRotation(XAVideoPostProcessingItf self,
+ *                                                   XAmillidegree rotation)
+ * Description: Sets post-prosessing options for rotation.
+ **/
+XAresult XAVideoPostProcessingItfImpl_SetRotation(XAVideoPostProcessingItf self,
+                                                  XAmillidegree rotation)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVideoPostProcessingItfImpl* impl = GetImpl(self);
+    XAboolean isSupported = XA_BOOLEAN_FALSE;
+    DEBUG_API("->XAVideoPostProcessingItfImpl_SetRotation");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoPostProcessingItfImpl_SetRotation");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* Check is arbitrary rotation supported */
+    ret = XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported( self, &isSupported );
+
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        if( isSupported == XA_BOOLEAN_FALSE )
+        {
+            /* check that wanted angle is integer multiple of 90 degrees */
+            if( rotation % 90000 != 0 )
+            {
+                /* feature unsupported */
+                ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                return ret;
+            }
+        }
+
+        impl->rotation = rotation;
+        impl->isRotate = XA_BOOLEAN_TRUE;
+    }
+
+    DEBUG_API("<-XAVideoPostProcessingItfImpl_SetRotation");
+    return ret;
+}
+
+/**
+ * XAresult XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported(XAVideoPostProcessingItf self,
+ *                                                                    XAboolean *pSupported)
+ * Description: Determines if arbitrary rotation angles are supported by the implementation.
+ */
+XAresult XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported(XAVideoPostProcessingItf self,
+                                                                   XAboolean *pSupported)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVideoPostProcessingItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported");
+    if(!impl || !pSupported)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAVideoPostProcessingItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+    	DEBUG_API("<-XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported");
+    	return ret;
+    }
+
+    ret = XAVideoPostProcessingItfAdapt_IsArbitraryRotationSupported(impl->adapCtx,
+                                                                     pSupported);
+
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        impl->supported = *pSupported;
+    }
+
+    XAVideoPostProcessingItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported");
+    return ret;
+}
+
+/**
+ * XAresult XAVideoPostProcessingItfImpl_SetScaleOptions(XAVideoPostProcessingItf self,
+ *                                                       XAuint32 scaleOptions,
+ *                                                       XAuint32 backgroundColor,
+ *                                                       XAuint32 renderingHints)
+ * Description: Sets the options for scaling
+ */
+XAresult XAVideoPostProcessingItfImpl_SetScaleOptions(XAVideoPostProcessingItf self,
+                                                      XAuint32 scaleOptions,
+                                                      XAuint32 backgroundColor,
+                                                      XAuint32 renderingHints)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVideoPostProcessingItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAVideoPostProcessingItfImpl_SetScaleOptions");
+
+    if(!impl || (scaleOptions != XA_VIDEOSCALE_STRETCH && scaleOptions != XA_VIDEOSCALE_FIT
+        && scaleOptions != XA_VIDEOSCALE_CROP))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoPostProcessingItfImpl_SetScaleOptions");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->scaleOptions = scaleOptions;
+    impl->backgroundColor = backgroundColor;
+    impl->renderingHints = renderingHints;
+    impl->isScaleOptions = XA_BOOLEAN_TRUE;
+
+    DEBUG_API("<-XAVideoPostProcessingItfImpl_SetScaleOptions");
+    return ret;
+}
+
+/**
+ * XAresult XAVideoPostProcessingItfImpl_SetSourceRectangle(XAVideoPostProcessingItf self,
+ *                                                          const XARectangle *pSrcRect)
+ * Description: Defines the rectangle in the original frame that is to be used for further processing
+ */
+XAresult XAVideoPostProcessingItfImpl_SetSourceRectangle(XAVideoPostProcessingItf self,
+                                                         const XARectangle *pSrcRect)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVideoPostProcessingItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAVideoPostProcessingItfImpl_SetSourceRectangle");
+
+    if(!impl || !pSrcRect)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoPostProcessingItfImpl_SetSourceRectangle");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->srcRect = *pSrcRect;
+    impl->isSrcRect = XA_BOOLEAN_TRUE;
+
+    DEBUG_API("<-XAVideoPostProcessingItfImpl_SetSourceRectangle");
+    return ret;
+}
+
+/**
+ * XAresult XAVideoPostProcessingItfImpl_SetDestinationRectangle(XAVideoPostProcessingItf self,
+ *                                                               const XARectangle *pDestRect)
+ *
+ * Description:  Defines the destination rectangle for the processed frame. This rectangle,
+ * in conjunction with the scaling options used  (fit, crop, stretch) determines
+ * the scaling applied to the frame.
+ */
+XAresult XAVideoPostProcessingItfImpl_SetDestinationRectangle(XAVideoPostProcessingItf self,
+                                                              const XARectangle *pDestRect)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVideoPostProcessingItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAVideoPostProcessingItfImpl_SetDestinationRectangle");
+
+    if(!impl || !pDestRect)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoPostProcessingItfImpl_SetDestinationRectangle");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->destRect = *pDestRect;
+    impl->isDestRect = XA_BOOLEAN_TRUE;
+
+    DEBUG_API("<-XAVideoPostProcessingItfImpl_SetDestinationRectangle");
+    return ret;
+}
+
+/**
+ * XAresult XAVideoPostProcessingItfImpl_SetMirror(XAVideoPostProcessingItf self,
+ *                                                 XAuint32 mirror)
+ * Description: Sets post-prosessing options for mirroring.
+ */
+XAresult XAVideoPostProcessingItfImpl_SetMirror(XAVideoPostProcessingItf self,
+                                                XAuint32 mirror)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVideoPostProcessingItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAVideoPostProcessingItfImpl_SetMirror");
+
+    if(!impl || (mirror != XA_VIDEOMIRROR_NONE && mirror != XA_VIDEOMIRROR_VERTICAL
+       && mirror != XA_VIDEOMIRROR_HORIZONTAL && mirror != XA_VIDEOMIRROR_BOTH ))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoPostProcessingItfImpl_SetMirror");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->mirror = mirror;
+    impl->isMirror = XA_BOOLEAN_TRUE;
+
+    DEBUG_API("<-XAVideoPostProcessingItfImpl_SetMirror");
+    return ret;
+}
+
+/**
+ * XAresult XAVideoPostProcessingItfImpl_Commit(XAVideoPostProcessingItf self)
+ * Description: Commit all video post-processing changes since the last Commit().
+ */
+XAresult XAVideoPostProcessingItfImpl_Commit(XAVideoPostProcessingItf self)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVideoPostProcessingItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAVideoPostProcessingItfImpl_Commit");
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoPostProcessingItfImpl_Commit");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAVideoPostProcessingItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+    	DEBUG_API("<-XAVideoPostProcessingItfImpl_Commit");
+    	return ret;
+    }
+
+    ret = XAVideoPostProcessingItfAdapt_Commit(impl->adapCtx,
+                                               impl->rotation,
+                                               impl->scaleOptions,
+                                               impl->backgroundColor,
+                                               impl->renderingHints,
+                                               &impl->srcRect,
+                                               &impl->destRect,
+                                               impl->mirror,
+                                               impl->isMirror,
+                                               impl->isRotate,
+                                               impl->isDestRect,
+											   impl->isSrcRect,
+											   impl->isScaleOptions);
+
+    if( ret == XA_RESULT_SUCCESS )
+    {
+        impl->isMirror = XA_BOOLEAN_FALSE;
+        impl->isRotate = XA_BOOLEAN_FALSE;
+		impl->isDestRect = XA_BOOLEAN_FALSE;
+		impl->isSrcRect = XA_BOOLEAN_FALSE;
+		impl->isScaleOptions = XA_BOOLEAN_FALSE;
+    }
+
+    XAVideoPostProcessingItfAdapt_ThreadExit(impl->adapCtx);
+#endif    
+    DEBUG_API("<-XAVideoPostProcessingItfImpl_Commit");
+    return ret;
+}
+
+/**
+ * XAVideoPostProcessingItfImpl -specific methods
+ **/
+#ifdef _GSTREAMER_BACKEND_  
+
+/**
+ * XAVideoPostProcessingItfImpl* XAVideoPostProcessingItfImpl_Create()
+ * @return  XAVideoPostProcessingItfImpl* - Pointer to  VideoPostProcessingItf interface implementation
+ **/
+XAVideoPostProcessingItfImpl* XAVideoPostProcessingItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
+{
+    XAVideoPostProcessingItfImpl* self = (XAVideoPostProcessingItfImpl*)
+        calloc(1,sizeof(XAVideoPostProcessingItfImpl));
+    DEBUG_API("->XAVideoPostProcessingItfImpl_Create");
+    if(self)
+    {
+        XARectangle emptyRect = {0,0,0,0};
+        /* init itf default implementation */
+        self->itf.Commit = XAVideoPostProcessingItfImpl_Commit;
+        self->itf.IsArbitraryRotationSupported = XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported;
+        self->itf.SetDestinationRectangle = XAVideoPostProcessingItfImpl_SetDestinationRectangle;
+        self->itf.SetMirror = XAVideoPostProcessingItfImpl_SetMirror;
+        self->itf.SetRotation = XAVideoPostProcessingItfImpl_SetRotation;
+        self->itf.SetScaleOptions = XAVideoPostProcessingItfImpl_SetScaleOptions;
+        self->itf.SetSourceRectangle = XAVideoPostProcessingItfImpl_SetSourceRectangle;
+
+        /* init variables */
+        self->rotation = 0;
+        self->scaleOptions = XA_VIDEOSCALE_FIT;
+        self->mirror = XA_VIDEOMIRROR_NONE;
+        self->backgroundColor = 0;
+        self->renderingHints = XA_RENDERINGHINT_NONE;
+        self->adapCtx = adapCtx;
+        self->srcRect = emptyRect;
+        self->destRect = emptyRect;
+        self->isMirror = XA_BOOLEAN_FALSE;
+        self->isRotate = XA_BOOLEAN_FALSE;
+        self->isDestRect = XA_BOOLEAN_FALSE;
+        self->isSrcRect = XA_BOOLEAN_FALSE;
+        self->isScaleOptions = XA_BOOLEAN_FALSE;
+
+        self->self = self;
+    }
+    DEBUG_API("<-XAVideoPostProcessingItfImpl_Create");
+    return self;
+}
+#endif
+/**
+ * void XAVideoPostProcessingItfImpl_Free(XAVideoPostProcessingItfImpl* self);
+ * @param  XAVideoPostProcessingItfImpl* self -
+ **/
+void XAVideoPostProcessingItfImpl_Free(XAVideoPostProcessingItfImpl* self)
+{
+    DEBUG_API("->XAVideoPostProcessingItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAVideoPostProcessingItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xavideopostprocessingitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAVIDEOPOSTPROCESSINGITF_H
+#define XAVIDEOPOSTPROCESSINGITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_   
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAVideoPostProcessingItf implementation */
+typedef struct XAVideoPostProcessingItfImpl_
+{
+    /* parent interface */
+    struct XAVideoPostProcessingItf_ itf;
+    /* pointer to self */
+    struct XAVideoPostProcessingItfImpl_* self;
+
+    /* variables */
+    XAboolean       supported;
+    XARectangle     srcRect;
+    XARectangle     destRect;
+    XAuint32        scaleOptions;
+    XAuint32        backgroundColor;
+    XAuint32        renderingHints;
+    XAuint32        mirror;
+    XAmillidegree   rotation;
+    XAboolean       isRotate;
+    XAboolean       isMirror;
+    XAboolean		isDestRect;
+    XAboolean		isSrcRect;
+    XAboolean		isScaleOptions;
+#ifdef _GSTREAMER_BACKEND_   
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+} XAVideoPostProcessingItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAVideoPostProcessingItf implementation */
+XAresult XAVideoPostProcessingItfImpl_SetRotation(XAVideoPostProcessingItf self,
+                                                  XAmillidegree rotation);
+
+XAresult XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported(XAVideoPostProcessingItf self,
+                                                                   XAboolean *pSupported);
+
+XAresult XAVideoPostProcessingItfImpl_SetScaleOptions(XAVideoPostProcessingItf self,
+                                                      XAuint32 scaleOptions,
+                                                      XAuint32 backgroundColor,
+                                                      XAuint32 renderingHints);
+
+XAresult XAVideoPostProcessingItfImpl_SetSourceRectangle(XAVideoPostProcessingItf self,
+                                                         const XARectangle *pSrcRect);
+
+XAresult XAVideoPostProcessingItfImpl_SetDestinationRectangle(XAVideoPostProcessingItf self,
+                                                              const XARectangle *pDestRect);
+
+XAresult XAVideoPostProcessingItfImpl_SetMirror(XAVideoPostProcessingItf self,
+                                                XAuint32 mirror);
+
+XAresult XAVideoPostProcessingItfImpl_Commit(XAVideoPostProcessingItf self);
+#ifdef _GSTREAMER_BACKEND_   
+/* XAVideoPostProcessingItfImpl -specific methods */
+XAVideoPostProcessingItfImpl* XAVideoPostProcessingItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
+XAresult XAVideoPostProcessingItfImpl_ThreadEntry(XAAdaptationBaseCtx *adapCtx);
+XAresult XAVideoPostProcessingItfImpl_ThreadExit(XAVideoPostProcessingItfImpl* impl);
+#endif
+void XAVideoPostProcessingItfImpl_Free(XAVideoPostProcessingItfImpl* self);
+
+#endif /* XAVIDEOPOSTPROCESSINGITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xavolumeitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,412 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "xavolumeitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAVolumeItfAdaptation.h"
+#endif
+/**
+ * XAVolumeItfImpl* GetImpl(XAVolumeItf self)
+ * Description: Validated interface pointer and cast it to implementations pointer.
+ **/
+static XAVolumeItfImpl* GetImpl(XAVolumeItf self)
+{
+    if(self)
+    {
+        XAVolumeItfImpl* impl = (XAVolumeItfImpl*)(*self);
+        if(impl && impl == impl->self)
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAVolumeItf implementation
+ */
+
+/**
+ * XAresult XAVolumeItfImpl_SetVolumeLevel(XAVolumeItf self, XAmillibel level)
+ * Description: Sets the object's volume level.
+ **/
+XAresult XAVolumeItfImpl_SetVolumeLevel(XAVolumeItf self, XAmillibel level)
+{
+    XAVolumeItfImpl *impl = GetImpl(self);
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    XAmillibel maximumLevel = 0;
+    DEBUG_API("->XAVolumeItfImpl_SetVolumeLevel");
+
+    /* check maximum volume level */
+    if(XAVolumeItfImpl_GetMaxVolumeLevel(self, &maximumLevel) != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfImpl_SetVolumeLevel");
+        /* cannot solve maximum volume level */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(!impl || level > maximumLevel)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfImpl_SetVolumeLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAVolumeItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAVolumeItfImpl_SetVolumeLevel");
+        return ret;
+    }
+
+    ret = XAVolumeItfAdapt_SetVolumeLevel(impl->adapCtx,  level);
+
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        impl->volumeLevel = level;
+    }
+
+    XAVolumeItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAVolumeItfImpl_SetVolumeLevel");
+    return ret ;
+}
+
+/**
+ * XAresult XAVolumeItfImpl_GetVolumeLevel(XAVolumeItf self, XAmillibel *pLevel)
+ * Description: Gets the object’s volume level.
+ **/
+XAresult XAVolumeItfImpl_GetVolumeLevel(XAVolumeItf self, XAmillibel *pLevel)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVolumeItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAVolumeItfImpl_GetVolumeLevel");
+
+    if(!impl || !pLevel)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfImpl_GetVolumeLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pLevel = impl->volumeLevel;
+
+    DEBUG_API("<-XAVolumeItfImpl_GetVolumeLevel");
+    return ret;
+}
+
+/**
+ * XAresult XAVolumeItfImpl_GetMaxVolumeLevel(XAVolumeItf  self, XAmillibel *pMaxLevel)
+ * Description: Gets the maximum supported level.
+ **/
+XAresult XAVolumeItfImpl_GetMaxVolumeLevel(XAVolumeItf  self, XAmillibel *pMaxLevel)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVolumeItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAVolumeItfImpl_GetVolumeLevel");
+
+    if(!impl || !pMaxLevel)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfImpl_GetMaxVolumeLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAVolumeItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAVolumeItfImpl_GetMaxVolumeLevel");
+        return ret;
+    }
+    ret = XAVolumeItfAdapt_GetMaxVolumeLevel(impl->adapCtx,
+                                             pMaxLevel);
+
+    XAVolumeItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAVolumeItfImpl_GetMaxVolumeLevel");
+    return ret;
+}
+
+/**
+ * XAresult XAVolumeItfImpl_SetMute(XAVolumeItf self, XAboolean mute)
+ * Description: Mutes or unmutes the object.
+ **/
+XAresult XAVolumeItfImpl_SetMute(XAVolumeItf self, XAboolean mute)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVolumeItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAVolumeItfImpl_SetMute");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfImpl_SetMute");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAVolumeItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAVolumeItfImpl_SetMute");
+        return ret;
+    }
+    /* check is mute state changed */
+    if(mute != impl->mute)
+    {
+        ret = XAVolumeItfAdapt_SetMute(impl->adapCtx,  mute);
+
+        if(ret == XA_RESULT_SUCCESS)
+        {
+            impl->mute = mute;
+        }
+    }
+
+    XAVolumeItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAVolumeItfImpl_SetMute");
+    return ret;
+}
+
+/**
+ * XAresult XAVolumeItfImpl_GetMute(XAVolumeItf self, XAboolean *pMute)
+ * Description: Retrieves the object's state.
+ **/
+XAresult XAVolumeItfImpl_GetMute(XAVolumeItf self, XAboolean *pMute)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVolumeItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAVolumeItfImpl_GetMute");
+
+    if(!impl || !pMute)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfImpl_GetMute");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pMute = impl->mute;
+
+    DEBUG_API("<-XAVolumeItfImpl_GetMute");
+    return ret;
+}
+
+/**
+ * XAresult XAVolumeItfImpl_EnableStereoPosition(XAVolumeItf self, XAboolean enable)
+ * Description: Enables or disables the stereo positioning effect.
+ **/
+XAresult XAVolumeItfImpl_EnableStereoPosition(XAVolumeItf self, XAboolean enable)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVolumeItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAVolumeItfImpl_EnableStereoPosition");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfImpl_EnableStereoPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAVolumeItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAVolumeItfImpl_EnableStereoPosition");
+        return ret;
+    }
+    /* Check is stereo position state changed */
+    if(enable != impl->enableStereoPos)
+    {
+        ret = XAVolumeItfAdapt_EnableStereoPosition(impl->adapCtx,
+                                                    enable);
+
+        if(ret == XA_RESULT_SUCCESS)
+        {
+            impl->enableStereoPos = enable;
+        }
+    }
+
+    XAVolumeItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAVolumeItfImpl_EnableStereoPosition");
+    return ret;
+}
+
+/**
+ * XAresult XAVolumeItfImpl_IsEnabledStereoPosition(XAVolumeItf self,
+ *                                                  XAboolean *pEnable)
+ * Description: Returns the enabled state of the stereo positioning effect.
+ **/
+XAresult XAVolumeItfImpl_IsEnabledStereoPosition(XAVolumeItf self,
+                                                 XAboolean *pEnable)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVolumeItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAVolumeItfImpl_IsEnabledStereoPosition");
+
+    if(!impl || !pEnable)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfImpl_IsEnabledStereoPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pEnable = impl->enableStereoPos;
+
+    DEBUG_API("<-XAVolumeItfImpl_IsEnabledStereoPosition");
+    return ret;
+}
+
+/**
+ * XAresult XAVolumeItfImpl_SetStereoPosition(XAVolumeItf self,
+ *                                            XApermille stereoPosition)
+ * Description: Sets the stereo position of the object.
+ **/
+XAresult XAVolumeItfImpl_SetStereoPosition(XAVolumeItf self,
+                                           XApermille stereoPosition)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVolumeItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAVolumeItfImpl_SetStereoPosition");
+
+    if(!impl || (stereoPosition < STEREO_POSITION_LEFT) ||
+        (stereoPosition > STEREO_POSITION_RIGHT))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfImpl_SetStereoPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->stereoPosition = stereoPosition;
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAVolumeItfAdapt_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XAVolumeItfImpl_SetStereoPosition");
+        return ret;
+    }
+    /* check is stereo position effect enabled if is then handle effect */
+    if(impl->enableStereoPos)
+    {
+        ret = XAVolumeItfAdapt_SetStereoPosition(impl->adapCtx,
+                                                 stereoPosition);
+    }
+
+    XAVolumeItfAdapt_ThreadExit(impl->adapCtx);
+#endif
+    DEBUG_API("<-XAVolumeItfImpl_SetStereoPosition");
+    return ret;
+}
+
+/**
+ * XAresult XAVolumeItfImpl_GetStereoPosition(XAVolumeItf self,
+ *                                            XApermille *pStereoPosition)
+ * Description: Gets the object’s stereo position setting.
+ **/
+XAresult XAVolumeItfImpl_GetStereoPosition(XAVolumeItf self,
+                                           XApermille *pStereoPosition)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVolumeItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAVolumeItfImpl_GetStereoPosition");
+
+    if(!impl || !pStereoPosition)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfImpl_GetStereoPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pStereoPosition = impl->stereoPosition;
+
+    DEBUG_API("<-XAVolumeItfImpl_GetStereoPosition");
+    return ret;
+}
+
+/**
+ * XAVolumeItfImpl -specific methods
+ **/
+#ifdef _GSTREAMER_BACKEND_  
+
+/**
+ * XAVolumeItfImpl* XAVolumeItfImpl_Create()
+ * Description: Allocate and initialize VolumeItfImpl
+ **/
+XAVolumeItfImpl* XAVolumeItfImpl_Create(XAAdaptationBaseCtx *adapCtx )
+{
+    XAVolumeItfImpl *self = (XAVolumeItfImpl*)
+        calloc(1,sizeof(XAVolumeItfImpl));
+    DEBUG_API("->XAVolumeItfImpl_Create");
+
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.EnableStereoPosition = XAVolumeItfImpl_EnableStereoPosition;
+        self->itf.GetMaxVolumeLevel = XAVolumeItfImpl_GetMaxVolumeLevel;
+        self->itf.GetMute = XAVolumeItfImpl_GetMute;
+        self->itf.GetStereoPosition = XAVolumeItfImpl_GetStereoPosition;
+        self->itf.GetVolumeLevel = XAVolumeItfImpl_GetVolumeLevel;
+        self->itf.IsEnabledStereoPosition = XAVolumeItfImpl_IsEnabledStereoPosition;
+        self->itf.SetMute = XAVolumeItfImpl_SetMute;
+        self->itf.SetStereoPosition = XAVolumeItfImpl_SetStereoPosition;
+        self->itf.SetVolumeLevel = XAVolumeItfImpl_SetVolumeLevel;
+
+        /* init variables */
+        self->volumeLevel = 0;
+        self->mute = XA_BOOLEAN_FALSE;
+        self->enableStereoPos = XA_BOOLEAN_FALSE;
+        self->stereoPosition = STEREO_POSITION_CENTER;
+
+        self->adapCtx = adapCtx;
+
+        self->self = self;
+    }
+
+    DEBUG_API("<-XAVolumeItfImpl_Create");
+    return self;
+}
+#endif
+/**
+ * void XAVolumeItfImpl_Free(XAVolumeItfImpl* self)
+ * Description: Free all resources reserved at XAVolumeItfImpl_Create
+ **/
+void XAVolumeItfImpl_Free(XAVolumeItfImpl* self)
+{
+    DEBUG_API("->XAVolumeItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAVolumeItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xavolumeitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,90 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAVOLUMEITF_H
+#define XAVOLUMEITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+
+/* Max volume level is implementation-dependent but must be at least 0mB
+ * now used max volume 10 mB
+ */
+#define MAX_VOLUME_LEVEL 10
+#define MAX_VOLUME_AT_LEAST 0
+/* Stereo position range is -1000 to 1000 permille. -1000 permille is fully left
+ * and 1000 permille is fully right. 0 permille is center.
+ */
+#define STEREO_POSITION_RIGHT 1000
+#define STEREO_POSITION_LEFT -1000
+#define STEREO_POSITION_CENTER 0
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAVolumeItf implementation */
+typedef struct XAVolumeItfImpl_
+{
+    /* parent interface */
+    struct XAVolumeItf_ itf;
+    /* pointer to self */
+    struct XAVolumeItfImpl_* self;
+
+    XAmillibel volumeLevel;
+    XAboolean mute;
+    XAboolean enableStereoPos;
+    XApermille stereoPosition;
+#ifdef _GSTREAMER_BACKEND_  
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+} XAVolumeItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAVolumeItf implementation */
+XAresult XAVolumeItfImpl_SetVolumeLevel(XAVolumeItf self, XAmillibel level);
+
+XAresult XAVolumeItfImpl_GetVolumeLevel(XAVolumeItf self, XAmillibel *pLevel);
+
+XAresult XAVolumeItfImpl_GetMaxVolumeLevel(XAVolumeItf self, XAmillibel *pMaxLevel);
+
+XAresult XAVolumeItfImpl_SetMute(XAVolumeItf self, XAboolean mute);
+
+XAresult XAVolumeItfImpl_GetMute(XAVolumeItf self, XAboolean *pMute);
+
+XAresult XAVolumeItfImpl_EnableStereoPosition(XAVolumeItf self, XAboolean enable);
+
+XAresult XAVolumeItfImpl_IsEnabledStereoPosition(XAVolumeItf self, XAboolean *pEnable);
+
+XAresult XAVolumeItfImpl_SetStereoPosition(XAVolumeItf self, XApermille stereoPosition);
+
+XAresult XAVolumeItfImpl_GetStereoPosition(XAVolumeItf self, XApermille *pStereoPosition);
+
+#ifdef _GSTREAMER_BACKEND_  
+/* XAVolumeItfImpl -specific methods */
+XAVolumeItfImpl* XAVolumeItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
+#endif
+void XAVolumeItfImpl_Free(XAVolumeItfImpl* self);
+
+#endif /* XAVOLUMEITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaaudiodecodercapabilitiesitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,231 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+#include "xaglobals.h"
+#include "xaaudiodecodercapabilitiesitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAStaticCapsAdaptation.h"
+#endif
+/* XAAudioDecoderCapabilitiesItfImpl* GetImpl
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XAAudioDecoderCapabilitiesItfImpl* GetImpl(XAAudioDecoderCapabilitiesItf self)
+{
+    if( self )
+    {
+        XAAudioDecoderCapabilitiesItfImpl* impl = (XAAudioDecoderCapabilitiesItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/*****************************************************************************
+ * Base interface XAAudioDecoderCapabilitiesItf implementation
+ *****************************************************************************/
+
+/* XAresult XAAudioDecoderCapabilitiesItfImpl_GetAudioDecoders
+ * Description: Retrieves the available audio decoders.
+ */
+XAresult XAAudioDecoderCapabilitiesItfImpl_GetAudioDecoders(
+                            XAAudioDecoderCapabilitiesItf self,
+                            XAuint32* pNumDecoders,
+                            XAuint32* pDecoderIds)
+{
+    XAAudioDecoderCapabilitiesItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAAudioDecoderCapabilitiesItfImpl_GetAudioDecoders");
+
+    if( !impl || !pNumDecoders )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if( pDecoderIds )
+        {   /* query array of decoders */
+            if( *pNumDecoders < impl->numCodecs )
+            {
+                DEBUG_ERR("XA_RESULT_BUFFER_INSUFFICIENT");
+                res = XA_RESULT_BUFFER_INSUFFICIENT;
+            }
+            else
+            {
+#ifdef _GSTREAMER_BACKEND_  
+            XAuint32 i = 0;
+            XAStaticCapsData temp;
+                for( i=0; i<impl->numCodecs; i++ )
+                {
+                    /* query decoder id from adaptation using index value */
+                    XAStaticCapsAdapt_GetCapsByIdx(XACAP_DECODER|XACAP_AUDIO, i, &temp);
+                    pDecoderIds[i] = temp.xaid;
+                }
+#endif
+            }
+        }
+        /* return number of decoders */
+        *pNumDecoders = impl->numCodecs;
+    }
+    DEBUG_API("<-XAAudioDecoderCapabilitiesItfImpl_GetAudioDecoders");
+    return res;
+}
+
+/* XAresult XAAudioDecoderCapabilitiesItfImpl_GetAudioDecoderCapabilities
+ * Description: Queries for the audio decoder�s capabilities.
+ */
+XAresult XAAudioDecoderCapabilitiesItfImpl_GetAudioDecoderCapabilities(
+                            XAAudioDecoderCapabilitiesItf self,
+                            XAuint32 decoderId,
+                            XAuint32* pIndex,
+                            XAAudioCodecDescriptor* pDescriptor)
+{
+    XAAudioDecoderCapabilitiesItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAAudioDecoderCapabilitiesItfImpl_GetAudioDecoderCapabilities");
+
+    if( !impl || !pIndex )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if( !pDescriptor )
+        {   /* query number of capa structures */
+            *pIndex = 1;
+        }
+        else
+        {   /* query capabilities */
+            if( *pIndex >= 1 )
+            {
+                DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+                res = XA_RESULT_PARAMETER_INVALID;
+            }
+            else
+            {
+#ifdef _GSTREAMER_BACKEND_  
+                /* query capabilities from adaptation using codec id */
+                XAStaticCapsData temp;
+                memset(pDescriptor,0,sizeof(XAAudioCodecDescriptor));
+                res = XAStaticCapsAdapt_GetCapsById(XACAP_DECODER|XACAP_AUDIO, decoderId, &temp);
+                if( res == XA_RESULT_SUCCESS )
+                {
+                    /* map applicable values to XAAudioCodecCapabilities */
+                    pDescriptor->maxChannels=temp.maxCh;
+                    pDescriptor->minSampleRate=temp.minSR*1000; /* milliHz */
+                    if (temp.maxSR < (0xFFFFFFFF / 1000))
+                    {
+                        pDescriptor->maxSampleRate = temp.maxSR*1000;
+                    }
+                    else
+                    {
+                        pDescriptor->maxSampleRate = 0xFFFFFFFF;
+                    }
+                    pDescriptor->minBitsPerSample=temp.minBPS;
+                    pDescriptor->maxBitsPerSample=temp.maxBPS;
+                    pDescriptor->isFreqRangeContinuous=XA_BOOLEAN_TRUE;
+                    pDescriptor->minBitRate=temp.minBR;
+                    pDescriptor->maxBitRate=temp.maxBR;
+                    pDescriptor->numBitratesSupported = temp.numBitrates;
+                    pDescriptor->isBitrateRangeContinuous=XA_BOOLEAN_TRUE;
+                    if (temp.xaid == XA_AUDIOCODEC_PCM )
+                    {
+                        pDescriptor->profileSetting=XA_AUDIOPROFILE_PCM;
+                        pDescriptor->modeSetting=0; /* no chanmode for pcm defined */
+                    }
+                    else if (temp.xaid == XA_ADAPTID_VORBIS) /* for ogg */
+                    {
+                        if (temp.maxCh == 1)
+                        {
+                            pDescriptor->profileSetting=XA_AUDIOPROFILE_MPEG1_L3;
+                            pDescriptor->modeSetting=XA_AUDIOCHANMODE_MP3_MONO;
+                        }
+                        else
+                        {
+                            pDescriptor->profileSetting=XA_AUDIOPROFILE_MPEG2_L3;
+                            pDescriptor->modeSetting=XA_AUDIOCHANMODE_MP3_STEREO;
+                        }
+                    }
+                    else
+                    {
+                        /* do nothing */
+                    }
+                    /*other caps undefined*/
+                }
+#endif                
+            }
+        }
+    }
+
+    DEBUG_API("<-XAAudioDecoderCapabilitiesItfImpl_GetAudioDecoderCapabilities");
+    return res;
+}
+
+
+/*****************************************************************************
+ * XAAudioDecoderCapabilitiesItfImpl -specific methods
+ *****************************************************************************/
+
+/* XAAudioDecoderCapabilitiesItfImpl_Create
+ * Description: Allocate and initialize XAAudioDecoderCapabilitiesItfImpl
+ */
+XAAudioDecoderCapabilitiesItfImpl* XAAudioDecoderCapabilitiesItfImpl_Create()
+{
+    XAAudioDecoderCapabilitiesItfImpl* self = (XAAudioDecoderCapabilitiesItfImpl*)
+        calloc(1,sizeof(XAAudioDecoderCapabilitiesItfImpl));
+
+    DEBUG_API("->XAAudioDecoderCapabilitiesItfImpl_Create");
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.GetAudioDecoders =
+            XAAudioDecoderCapabilitiesItfImpl_GetAudioDecoders;
+        self->itf.GetAudioDecoderCapabilities =
+            XAAudioDecoderCapabilitiesItfImpl_GetAudioDecoderCapabilities;
+
+        /* init variables */
+#ifdef _GSTREAMER_BACKEND_  
+        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_DECODER|XACAP_AUDIO,
+                                  &(self->numCodecs) ) == XA_RESULT_SUCCESS );
+#endif
+        self->self = self;
+    }
+    DEBUG_API("<-XAAudioDecoderCapabilitiesItfImpl_Create");
+    return self;
+}
+
+/* void XAAudioDecoderCapabilitiesItfImpl_Free
+ * Description: Free all resources reserved at XAAudioDecoderCapabilitiesItfImpl_Create
+ */
+void XAAudioDecoderCapabilitiesItfImpl_Free(XAAudioDecoderCapabilitiesItfImpl* self)
+{
+    DEBUG_API("->XAAudioDecoderCapabilitiesItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAAudioDecoderCapabilitiesItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaaudiodecodercapabilitiesitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAAUDIODECODERCAPABILITIESITF_H
+#define XAAUDIODECODERCAPABILITIESITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAAudioDecoderCapabilitiesItf implementation */
+typedef struct XAAudioDecoderCapabilitiesItfImpl_
+{
+    /* parent interface */
+    struct XAAudioDecoderCapabilitiesItf_ itf;
+    /* pointer to self */
+    struct XAAudioDecoderCapabilitiesItfImpl_* self;
+    /* variables */
+    XAuint32 numCodecs;
+} XAAudioDecoderCapabilitiesItfImpl;
+
+/* Base interface XAAudioDecoderCapabilitiesItf implementation */
+XAresult XAAudioDecoderCapabilitiesItfImpl_GetAudioDecoders(
+                            XAAudioDecoderCapabilitiesItf self,
+                            XAuint32* pNumDecoders,
+                            XAuint32* pDecoderIds);
+
+XAresult XAAudioDecoderCapabilitiesItfImpl_GetAudioDecoderCapabilities(
+                            XAAudioDecoderCapabilitiesItf self,
+                            XAuint32 decoderId,
+                            XAuint32* pIndex,
+                            XAAudioCodecDescriptor* pDescriptor);
+
+/* XAAudioDecoderCapabilitiesItfImpl -specific methods */
+XAAudioDecoderCapabilitiesItfImpl* XAAudioDecoderCapabilitiesItfImpl_Create(void);
+void XAAudioDecoderCapabilitiesItfImpl_Free(XAAudioDecoderCapabilitiesItfImpl* self);
+
+#endif /* XAAUDIODECODERCAPABILITIESITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaaudioencodercapabilitiesitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,336 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+#include "xaglobals.h"
+#include "xaaudioencodercapabilitiesitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAStaticCapsAdaptation.h"
+#endif
+/* XAAudioEncoderCapabilitiesItfImpl* GetImpl
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XAAudioEncoderCapabilitiesItfImpl* GetImpl(XAAudioEncoderCapabilitiesItf self)
+{
+    if( self )
+    {
+        XAAudioEncoderCapabilitiesItfImpl* impl = (XAAudioEncoderCapabilitiesItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/*****************************************************************************
+ * Base interface XAAudioEncoderCapabilitiesItf implementation
+ *****************************************************************************/
+
+/* XAresult XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoders
+ * Description: Retrieves the available audio encoders.
+ */
+XAresult XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoders(
+                            XAAudioEncoderCapabilitiesItf self,
+                            XAuint32* pNumEncoders,
+                            XAuint32* pEncoderIds)
+{
+    XAAudioEncoderCapabilitiesItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoders");
+    
+    if( !impl || !pNumEncoders )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if( pEncoderIds )
+        {   /* query array of encoders */
+            if( *pNumEncoders < impl->numCodecs )
+            {
+                DEBUG_ERR("XA_RESULT_BUFFER_INSUFFICIENT");
+                res = XA_RESULT_BUFFER_INSUFFICIENT;
+            }
+            else
+            {
+#ifdef _GSTREAMER_BACKEND_  
+                XAuint32 i = 0;
+                XAStaticCapsData temp;
+                for( i=0; i<impl->numCodecs; i++ )
+                {
+                    /* query encoder id from adaptation using index value */
+                    XAStaticCapsAdapt_GetCapsByIdx(XACAP_ENCODER|XACAP_AUDIO, i, &temp);
+                    pEncoderIds[i] = temp.xaid;
+                }
+#endif
+            pEncoderIds[0] = XA_AUDIOCODEC_AMR;
+            pEncoderIds[1] = XA_AUDIOCODEC_AAC;
+            pEncoderIds[2] = XA_AUDIOCODEC_PCM;
+            }
+        }
+
+    /* return number of encoders */
+    *pNumEncoders = impl->numCodecs;
+    }
+    DEBUG_API("<-XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoders");
+    return res;
+}
+
+/* XAresult XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoderCapabilities
+ * Description: Queries for the audio encoders capabilities.
+ */
+XAresult XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoderCapabilities(
+                            XAAudioEncoderCapabilitiesItf self,
+                            XAuint32 encoderId,
+                            XAuint32 *pIndex,
+                            XAAudioCodecDescriptor *pDescriptor)
+{
+    XAAudioEncoderCapabilitiesItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+
+#ifdef _GSTREAMER_BACKEND_  
+    XAStaticCapsData temp;
+#endif
+    DEBUG_API("->XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoderCapabilities");
+
+    /*if( !impl || !pIndex || !pDescriptor )*/
+    /*Removing the pDescriptor because the client can pass
+     * it as NULL to query the pIndex for number of Codec/Mode
+     * pair capabilities for each encoder */
+    if( !impl || !pIndex )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+        return res;
+    }
+    else
+    {
+    	*pIndex = 1;
+        if(!pDescriptor)
+            {
+            return res;
+            }
+  	}
+    
+  	/* query capabilities from adaptation using codec id */
+    memset(pDescriptor,0,sizeof(XAAudioCodecDescriptor));
+    
+    switch (encoderId)
+        {
+        case XA_AUDIOCODEC_AMR: 
+            {
+            impl->sampleRateArray[0] = 8000000;
+
+            impl->bitRateArray[0] = 4750;
+            impl->bitRateArray[1] = 5150;
+            impl->bitRateArray[2] = 5900;
+            impl->bitRateArray[3] = 6700;
+            impl->bitRateArray[4] = 7400;
+            impl->bitRateArray[5] = 7950;
+            impl->bitRateArray[6] = 10200;            
+            impl->bitRateArray[7] = 12200;
+
+            pDescriptor->maxChannels = 1;
+            pDescriptor->minBitsPerSample = 8;
+            pDescriptor->maxBitsPerSample = 8;
+            pDescriptor->minSampleRate = 8000000;  /*milliHz*/ 
+            pDescriptor->maxSampleRate = 8000000;
+            pDescriptor->isFreqRangeContinuous=XA_BOOLEAN_FALSE;
+            pDescriptor->pSampleRatesSupported = (XAmilliHertz*)(&(impl->sampleRateArray));
+            pDescriptor->numSampleRatesSupported = 1;
+            pDescriptor->minBitRate=4750;
+            pDescriptor->maxBitRate=12200;
+            pDescriptor->isBitrateRangeContinuous=XA_BOOLEAN_FALSE;
+            pDescriptor->pBitratesSupported = (XAuint32*)(&(impl->bitRateArray));
+            pDescriptor->numBitratesSupported = 8;
+            pDescriptor->profileSetting = XA_AUDIOPROFILE_AMR;
+            pDescriptor->modeSetting = 0;
+            }
+            break;
+        case XA_AUDIOCODEC_AAC: 
+            {
+            impl->sampleRateArray[0] = 8000000;
+            impl->sampleRateArray[1] = 11025000;
+            impl->sampleRateArray[2] = 16000000;
+            impl->sampleRateArray[3] = 22050000;
+            impl->sampleRateArray[4] = 32000000;
+            impl->sampleRateArray[5] = 44100000;
+            impl->sampleRateArray[6] = 48000000;
+
+            impl->bitRateArray[0] = 32000;
+            impl->bitRateArray[1] = 64000;
+            impl->bitRateArray[2] = 96000;
+            impl->bitRateArray[3] = 128000;
+            impl->bitRateArray[4] = 160000;
+            impl->bitRateArray[5] = 192000;
+            impl->bitRateArray[6] = 224000;            
+            impl->bitRateArray[7] = 256000;    
+            
+            pDescriptor->maxChannels = 2;
+            pDescriptor->minBitsPerSample = 16;
+            pDescriptor->maxBitsPerSample = 16;
+            pDescriptor->minSampleRate = 8000*1000;  /*milliHz*/ 
+            pDescriptor->maxSampleRate = 48000 * 1000;
+            pDescriptor->isFreqRangeContinuous=XA_BOOLEAN_FALSE;
+            pDescriptor->pSampleRatesSupported = (XAmilliHertz*)(&(impl->sampleRateArray));
+            pDescriptor->numSampleRatesSupported = 7;
+            pDescriptor->minBitRate=32000;
+            pDescriptor->maxBitRate=256000;
+            pDescriptor->isBitrateRangeContinuous=XA_BOOLEAN_FALSE;
+            pDescriptor->pBitratesSupported = (XAuint32*)(&(impl->bitRateArray));
+            pDescriptor->numBitratesSupported = 8;
+            pDescriptor->profileSetting = XA_AUDIOPROFILE_AAC_AAC;
+            pDescriptor->modeSetting = XA_AUDIOMODE_AAC_LC;
+            }
+            break;
+        case XA_AUDIOCODEC_PCM: 
+            {
+            impl->sampleRateArray[0] = 12000000;
+            impl->sampleRateArray[1] = 16000000;
+            impl->sampleRateArray[2] = 22050000;
+            impl->sampleRateArray[3] = 24000000;
+            impl->sampleRateArray[4] = 32000000;
+            impl->sampleRateArray[5] = 44100000;
+            impl->sampleRateArray[6] = 48000000;
+            impl->sampleRateArray[7] = 64000000;
+            impl->sampleRateArray[8] = 88200000;
+            impl->sampleRateArray[9] = 96000000;
+
+            pDescriptor->maxChannels = 2;
+            pDescriptor->minBitsPerSample = 16;
+            pDescriptor->maxBitsPerSample = 16;
+            pDescriptor->minSampleRate = 8000000;  /*milliHz*/ 
+            pDescriptor->maxSampleRate = 96000000;
+            pDescriptor->isFreqRangeContinuous=XA_BOOLEAN_FALSE;
+            pDescriptor->pSampleRatesSupported = (XAmilliHertz*)(&(impl->sampleRateArray));
+            pDescriptor->numSampleRatesSupported = 10;
+            pDescriptor->minBitRate= 0;
+            pDescriptor->maxBitRate= 0;
+            pDescriptor->isBitrateRangeContinuous=XA_BOOLEAN_FALSE;
+            pDescriptor->pBitratesSupported = NULL;
+            pDescriptor->numBitratesSupported = 0;
+            pDescriptor->profileSetting = XA_AUDIOPROFILE_PCM        ;
+            pDescriptor->modeSetting = 0;            
+            }
+            break;
+        }
+    
+    
+#ifdef _GSTREAMER_BACKEND_  
+    res = XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_AUDIO, encoderId, &temp);
+   	if( res == XA_RESULT_SUCCESS )
+    {
+   		/* map applicable values to XAAudioCodecCapabilities */
+      pDescriptor->maxChannels=temp.maxCh;
+      pDescriptor->minSampleRate=temp.minSR*1000; /* milliHz */
+      if (temp.maxSR < (0xFFFFFFFF / 1000))
+      {
+      	pDescriptor->maxSampleRate = temp.maxSR*1000;
+      }
+      else
+      {
+    		pDescriptor->maxSampleRate = 0xFFFFFFFF;
+   		}
+      pDescriptor->minBitsPerSample=temp.minBPS;
+      pDescriptor->maxBitsPerSample=temp.maxBPS;
+      pDescriptor->isFreqRangeContinuous=XA_BOOLEAN_TRUE;
+      pDescriptor->minBitRate=temp.minBR;
+    	pDescriptor->maxBitRate=temp.maxBR;
+      pDescriptor->numBitratesSupported = temp.numBitrates;
+      pDescriptor->isBitrateRangeContinuous=XA_BOOLEAN_TRUE;
+      
+      if (temp.xaid == XA_AUDIOCODEC_PCM )
+      {
+     		pDescriptor->profileSetting=XA_AUDIOPROFILE_PCM;
+        pDescriptor->modeSetting=0;
+      }
+    	else if (temp.xaid == XA_ADAPTID_VORBIS) /* for ogg */
+      {
+      	if (temp.maxCh == 1)
+        {
+        	pDescriptor->profileSetting=XA_AUDIOPROFILE_MPEG1_L3;
+          pDescriptor->modeSetting=XA_AUDIOCHANMODE_MP3_MONO;
+       	}
+        else
+        {
+       		pDescriptor->profileSetting=XA_AUDIOPROFILE_MPEG2_L3;
+          pDescriptor->modeSetting=XA_AUDIOCHANMODE_MP3_STEREO;
+        }
+      }
+      else
+      {
+     		/* Do nothing */
+      }
+    }
+#endif   	
+    DEBUG_API("<-XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoderCapabilities");
+    return res;
+}
+
+
+/*****************************************************************************
+ * XAAudioEncoderCapabilitiesItfImpl -specific methods
+ *****************************************************************************/
+
+/* XAAudioEncoderCapabilitiesItfImpl_Create
+ * Description: Allocate and initialize XAAudioEncoderCapabilitiesItfImpl
+ */
+XAAudioEncoderCapabilitiesItfImpl* XAAudioEncoderCapabilitiesItfImpl_Create()
+{
+    XAAudioEncoderCapabilitiesItfImpl* self = (XAAudioEncoderCapabilitiesItfImpl*)
+        calloc(1,sizeof(XAAudioEncoderCapabilitiesItfImpl));
+
+    DEBUG_API("->XAAudioEncoderCapabilitiesItfImpl_Create");
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.GetAudioEncoders =
+            XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoders;
+        self->itf.GetAudioEncoderCapabilities =
+            XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoderCapabilities;
+
+#ifdef _GSTREAMER_BACKEND_  
+        /* init variables */
+        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_ENCODER|XACAP_AUDIO,
+                                  &(self->numCodecs) ) == XA_RESULT_SUCCESS );
+#endif
+        /*self->mmfEngine = (void*)mmf_capability_engine_init();*/
+        self->numCodecs = 3;
+        self->self = self;
+        
+    }
+    DEBUG_API("<-XAAudioEncoderCapabilitiesItfImpl_Create");
+    return self;
+}
+
+/* void XAAudioEncoderCapabilitiesItfImpl_Free
+ * Description: Free all resources reserved at XAAudioEncoderCapabilitiesItfImpl_Create
+ */
+void XAAudioEncoderCapabilitiesItfImpl_Free(XAAudioEncoderCapabilitiesItfImpl* self)
+{
+    DEBUG_API("->XAAudioEncoderCapabilitiesItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAAudioEncoderCapabilitiesItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaaudioencodercapabilitiesitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAAUDIOENCODERCAPABILITIESITF_H
+#define XAAUDIOENCODERCAPABILITIESITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAAudioEncoderCapabilitiesItf implementation */
+typedef struct XAAudioEncoderCapabilitiesItfImpl_
+{
+    /* parent interface */
+    struct XAAudioEncoderCapabilitiesItf_ itf;
+    /* pointer to self */
+    struct XAAudioEncoderCapabilitiesItfImpl_* self;
+    /* variables */
+    XAuint32 numCodecs;
+    XAmilliHertz sampleRateArray[10];
+    XAuint32 bitRateArray[10];
+    void* mmfEngine;
+} XAAudioEncoderCapabilitiesItfImpl;
+
+/* Base interface XAAudioEncoderCapabilitiesItf implementation */
+XAresult XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoders(
+                            XAAudioEncoderCapabilitiesItf self,
+                            XAuint32* pNumEncoders,
+                            XAuint32* pEncoderIds);
+
+XAresult XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoderCapabilities(
+                            XAAudioEncoderCapabilitiesItf self,
+                            XAuint32 encoderId,
+                            XAuint32* pIndex,
+                            XAAudioCodecDescriptor* pCapabilities);
+
+/* XAAudioEncoderCapabilitiesItfImpl -specific methods */
+XAAudioEncoderCapabilitiesItfImpl* XAAudioEncoderCapabilitiesItfImpl_Create(void);
+void XAAudioEncoderCapabilitiesItfImpl_Free(XAAudioEncoderCapabilitiesItfImpl* self);
+
+#endif /* XAAUDIOENCODERCAPABILITIESITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaaudioiodevicecapabilitiesitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,800 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+#include "xaglobals.h"
+#include "xaaudioiodevicecapabilitiesitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAStaticCapsAdaptation.h"
+#endif
+
+static XAchar deviceName1[] = "Default Mic";
+
+/* XAAudIODevCapaItfImpl* GetImpl
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XAAudIODevCapaItfImpl* GetImpl(XAAudioIODeviceCapabilitiesItf self)
+{
+    if( self )
+    {
+        XAAudIODevCapaItfImpl* impl = (XAAudIODevCapaItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAAudioIODeviceCapabilitiesItf implementation
+ **/
+
+/* XAresult XAAudIODevCapaItfImpl_GetAvailableAudioInputs
+ * Description: Gets the number and IDs of audio input devices currently available.
+ */
+XAresult XAAudIODevCapaItfImpl_GetAvailableAudioInputs(
+                                            XAAudioIODeviceCapabilitiesItf self,
+                                            XAint32* pNumInputs,
+                                            XAuint32* pInputDeviceIDs)
+{
+    XAAudIODevCapaItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAudIODevCapaItfImpl_GetAvailableAudioInputs");
+
+    if( !impl || !pNumInputs )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if( pInputDeviceIDs )
+        {   /* query array of input devices */
+            if( *pNumInputs < impl->numInputDevices )
+            {
+                DEBUG_ERR("XA_RESULT_BUFFER_INSUFFICIENT");
+                res = XA_RESULT_BUFFER_INSUFFICIENT;
+            }
+            else
+            {
+
+#ifdef _GSTREAMER_BACKEND_
+                XAuint32 i;
+                XAStaticCapsData temp;
+                for( i=0; i<impl->numInputDevices; i++ )
+                {
+                    /* query device id from adaptation using index value */
+                    res = XAStaticCapsAdapt_GetCapsByIdx(XACAP_DEVSRC|XACAP_AUDIO, i, &temp);
+                    pInputDeviceIDs[i] = temp.xaid;
+                }
+#endif
+                pInputDeviceIDs[0] = 0xAD7E5001;
+            }
+        }
+        *pNumInputs = impl->numInputDevices;
+    }
+    DEBUG_API("<-XAAudIODevCapaItfImpl_GetAvailableAudioInputs");
+    return res;
+}
+
+/* XAresult XAAudIODevCapaItfImpl_QueryAudioInputCapabilities
+ * Description: Gets the capabilities of the specified audio input device.
+ */
+XAresult XAAudIODevCapaItfImpl_QueryAudioInputCapabilities(
+                                            XAAudioIODeviceCapabilitiesItf self,
+                                            XAuint32 deviceId,
+                                            XAAudioInputDescriptor* pDescriptor)
+{
+    XAAudIODevCapaItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAudIODevCapaItfImpl_QueryAudioInputCapabilities");
+
+    if( !impl || !pDescriptor )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        memset(pDescriptor,0,sizeof(XAAudioInputDescriptor));
+#ifdef _GSTREAMER_BACKEND_
+        /* query capabilities from adaptation using device id */
+        XAStaticCapsData temp;
+
+        res = XAStaticCapsAdapt_GetCapsById(XACAP_DEVSRC|XACAP_AUDIO, deviceId, &temp);
+        if( res == XA_RESULT_SUCCESS )
+        {
+            /* map applicable values to XAAudioCodecCapabilities */
+            pDescriptor->maxChannels=temp.maxCh;
+            pDescriptor->minSampleRate=temp.minSR*1000; /* milliHz */
+            if (temp.maxSR < (0xFFFFFFFF / 1000))
+            {
+                pDescriptor->maxSampleRate = temp.maxSR*1000;
+            }
+            else
+            {
+                pDescriptor->maxSampleRate = 0xFFFFFFFF;
+            }
+            pDescriptor->isFreqRangeContinuous=XA_BOOLEAN_TRUE;
+            pDescriptor->deviceConnection = XA_DEVCONNECTION_INTEGRATED;
+            pDescriptor->deviceScope = XA_DEVSCOPE_ENVIRONMENT;
+            pDescriptor->deviceLocation = XA_DEVLOCATION_HANDSET;
+            pDescriptor->deviceName = temp.adaptId;
+            /* other caps undefined */
+        }
+#endif
+        switch (deviceId)
+                {
+                case 0xAD7E5001:
+                    {
+                    impl->sampleRateArray[0] = 8000000;
+                    impl->sampleRateArray[1] = 11025000;
+                    impl->sampleRateArray[2] = 12000000;
+                    impl->sampleRateArray[3] = 16000000;
+                    impl->sampleRateArray[4] = 22050000;
+                    impl->sampleRateArray[5] = 24000000;
+                    impl->sampleRateArray[6] = 32000000;
+                    impl->sampleRateArray[7] = 44100000;
+                    impl->sampleRateArray[8] = 48000000;
+                    impl->sampleRateArray[9] = 64000000;
+                    impl->sampleRateArray[10] = 88200000;
+                    impl->sampleRateArray[11] = 96000000;
+
+                    pDescriptor->deviceName = (XAchar *)deviceName1;
+                    pDescriptor->deviceConnection = XA_DEVCONNECTION_INTEGRATED;
+                    pDescriptor->deviceScope = XA_DEVSCOPE_ENVIRONMENT;
+                    pDescriptor->deviceLocation = XA_DEVLOCATION_HANDSET;
+                    pDescriptor->isForTelephony = XA_BOOLEAN_FALSE;
+                    pDescriptor->minSampleRate=8000000; /* milliHz */
+                    pDescriptor->maxSampleRate = 96000000;
+                    pDescriptor->isFreqRangeContinuous=XA_BOOLEAN_FALSE;
+                    pDescriptor->samplingRatesSupported = (XAmilliHertz*)(&(impl->sampleRateArray));
+                    pDescriptor->numOfSamplingRatesSupported = 12;
+                    pDescriptor->maxChannels = 2;
+                    }
+                    break;
+                default:
+                    res = XA_RESULT_PARAMETER_INVALID;
+                    break;
+                }
+    }
+
+    DEBUG_API("<-XAAudIODevCapaItfImpl_QueryAudioInputCapabilities");
+    return res;
+}
+
+/* XAresult XAAudIODevCapaItfImpl_RegisterAvailableAudioInputsChangedCallback
+ * Description: Sets or clears xaAvailableAudioInputsChangedCallback().
+ */
+XAresult XAAudIODevCapaItfImpl_RegisterAvailableAudioInputsChangedCallback(
+                                            XAAudioIODeviceCapabilitiesItf self,
+                                            xaAvailableAudioInputsChangedCallback callback,
+                                            void* pContext)
+{
+    XAAudIODevCapaItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAAudIODevCapaItfImpl_RegisterAvailableAudioInputsChangedCallback");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        impl->inputCb = callback;
+        impl->inputCbCtx = pContext;
+        impl->inputCbPtrToSelf = self;
+    }
+
+    DEBUG_API("<-XAAudIODevCapaItfImpl_RegisterAvailableAudioInputsChangedCallback");
+    return res;
+}
+
+/* XAresult XAAudIODevCapaItfImpl_GetAvailableAudioOutputs
+ * Description: Gets the number and IDs of audio output devices currently available.
+ */
+XAresult XAAudIODevCapaItfImpl_GetAvailableAudioOutputs(
+                                            XAAudioIODeviceCapabilitiesItf self,
+                                            XAint32* pNumOutputs,
+                                            XAuint32* pOutputDeviceIDs)
+{
+    XAAudIODevCapaItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAAudIODevCapaItfImpl_GetAvailableAudioOutputs");
+
+    /* NOTE: only default speaker supported by this impl */
+    if( !impl || !pNumOutputs )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if( pOutputDeviceIDs )
+        {   /* query array of output devices */
+            if( *pNumOutputs < impl->numOutputDevices )
+            {
+                DEBUG_ERR("XA_RESULT_BUFFER_INSUFFICIENT");
+                res = XA_RESULT_BUFFER_INSUFFICIENT;
+            }
+            else
+            {
+
+#ifdef _GSTREAMER_BACKEND_
+                XAuint32 i = 0;
+                XAStaticCapsData temp;
+                for( i=0; i<impl->numOutputDevices; i++ )
+                {
+                    /* query device id from adaptation using index value */
+                    res = XAStaticCapsAdapt_GetCapsByIdx(XACAP_DEVSNK|XACAP_AUDIO, i, &temp);
+                    pOutputDeviceIDs[i] = temp.xaid;
+                }
+#endif
+                pOutputDeviceIDs[0] = 0xAD7E5002;
+            }
+        }
+        *pNumOutputs = impl->numOutputDevices;
+    }
+    DEBUG_API("<-XAAudIODevCapaItfImpl_GetAvailableAudioOutputs");
+    return res;
+}
+
+/* XAresult XAAudIODevCapaItfImpl_QueryAudioOutputCapabilities
+ * Description: Gets the capabilities of the specified audio output device.
+ */
+XAresult XAAudIODevCapaItfImpl_QueryAudioOutputCapabilities(
+                                        XAAudioIODeviceCapabilitiesItf self,
+                                        XAuint32 deviceId,
+                                        XAAudioOutputDescriptor* pDescriptor)
+{
+
+    XAAudIODevCapaItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAudIODevCapaItfImpl_QueryAudioOutputCapabilities");
+
+    if( !impl || !pDescriptor )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        memset(pDescriptor,0,sizeof(XAAudioOutputDescriptor));
+        /* query capabilities from adaptation using device id */
+#ifdef _GSTREAMER_BACKEND_
+        XAStaticCapsData temp;
+
+        res = XAStaticCapsAdapt_GetCapsById(XACAP_DEVSNK|XACAP_AUDIO, deviceId, &temp);
+        if( res == XA_RESULT_SUCCESS )
+        {
+            /* map applicable values to XAAudioCodecCapabilities */
+            pDescriptor->maxChannels=temp.maxCh;
+            pDescriptor->minSampleRate=temp.minSR*1000; /* milliHz */
+            if (temp.maxSR < (0xFFFFFFFF / 1000))
+            {
+                pDescriptor->maxSampleRate = temp.maxSR*1000;
+            }
+            else
+            {
+                pDescriptor->maxSampleRate = 0xFFFFFFFF;
+            }
+            pDescriptor->isFreqRangeContinuous=XA_BOOLEAN_TRUE;
+            pDescriptor->deviceConnection = XA_DEVCONNECTION_INTEGRATED;
+            pDescriptor->deviceScope = XA_DEVSCOPE_ENVIRONMENT;
+            pDescriptor->deviceLocation = XA_DEVLOCATION_HANDSET;
+            pDescriptor->pDeviceName = temp.adaptId;
+            /* other caps undefined */
+        }
+#endif
+
+        switch (deviceId)
+                {
+                case 0xAD7E5002:
+                    {
+                    impl->sampleRateArray[0] = 8000000;
+                    impl->sampleRateArray[1] = 11025000;
+                    impl->sampleRateArray[2] = 12000000;
+                    impl->sampleRateArray[3] = 16000000;
+                    impl->sampleRateArray[4] = 22050000;
+                    impl->sampleRateArray[5] = 24000000;
+                    impl->sampleRateArray[6] = 32000000;
+                    impl->sampleRateArray[7] = 44100000;
+                    impl->sampleRateArray[8] = 48000000;
+                    impl->sampleRateArray[9] = 64000000;
+                    impl->sampleRateArray[10] = 88200000;
+                    impl->sampleRateArray[11] = 96000000;
+
+                    pDescriptor->pDeviceName = (XAchar *)"Device Speaker";
+                    pDescriptor->deviceConnection = XA_DEVCONNECTION_INTEGRATED;
+                    pDescriptor->deviceScope = XA_DEVSCOPE_ENVIRONMENT;
+                    pDescriptor->deviceLocation = XA_DEVLOCATION_HANDSET;
+                    pDescriptor->isForTelephony = XA_BOOLEAN_FALSE;
+                    pDescriptor->minSampleRate=8000000; /* milliHz */
+                    pDescriptor->maxSampleRate = 96000000;
+                    pDescriptor->isFreqRangeContinuous=XA_BOOLEAN_FALSE;
+                    pDescriptor->samplingRatesSupported = (XAmilliHertz*)(&(impl->sampleRateArray));
+                    pDescriptor->numOfSamplingRatesSupported = 12;
+                    pDescriptor->maxChannels = 2;
+                    }
+                    break;
+                default:
+                    res = XA_RESULT_PARAMETER_INVALID;
+                    break;
+                }
+    }
+
+    DEBUG_API("<-XAAudIODevCapaItfImpl_QueryAudioOutputCapabilities");
+    return res;
+}
+
+/* XAresult XAAudIODevCapaItfImpl_RegisterAvailableAudioOutputsChangedCallback
+ * Description: Sets or clears xaAvailableAudioOutputsChangedCallback().
+ */
+XAresult XAAudIODevCapaItfImpl_RegisterAvailableAudioOutputsChangedCallback(
+                                            XAAudioIODeviceCapabilitiesItf self,
+                                            xaAvailableAudioOutputsChangedCallback callback,
+                                            void* pContext)
+{
+
+    XAAudIODevCapaItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAudIODevCapaItfImpl_RegisterAvailableAudioOutputsChangedCallback");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        impl->outputCb = callback;
+        impl->outputCbCtx = pContext;
+        impl->outputCbPtrToSelf = self;
+    }
+
+    DEBUG_API("<-XAAudIODevCapaItfImpl_RegisterAvailableAudioOutputsChangedCallback");
+    return res;
+}
+
+/* XAresult XAAudIODevCapaItfImpl_RegisterDefaultDeviceIDMapChangedCallback
+ * Description: Sets or clears xaDefaultDeviceIDMapChangedCallback().
+ */
+XAresult XAAudIODevCapaItfImpl_RegisterDefaultDeviceIDMapChangedCallback(
+                                            XAAudioIODeviceCapabilitiesItf self,
+                                            xaDefaultDeviceIDMapChangedCallback callback,
+                                            void* pContext)
+{
+    XAAudIODevCapaItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAAudIODevCapaItfImpl_RegisterDefaultDeviceIDMapChangedCallback");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        impl->deviceMapCb = callback;
+        impl->deviceMapCtx = pContext;
+        impl->deviceMapCbPtrToSelf = self;
+    }
+
+    DEBUG_API("<-XAAudIODevCapaItfImpl_RegisterDefaultDeviceIDMapChangedCallback");
+    return res;
+}
+
+/* XAresult XAAudIODevCapaItfImpl_GetAssociatedAudioInputs
+ * Description: This method returns an array of audio input devices physically
+ * associated with this audio I/O device.
+ */
+XAresult XAAudIODevCapaItfImpl_GetAssociatedAudioInputs(
+                                                XAAudioIODeviceCapabilitiesItf self,
+                                                XAuint32 deviceId,
+                                                XAint32* pNumAudioInputs,
+                                                XAuint32* pAudioInputDeviceIDs)
+{
+    XAAudIODevCapaItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAudIODevCapaItfImpl_GetAssociatedAudioInputs");
+    if( !impl || !pNumAudioInputs )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+        XAStaticCapsData temp;
+        XAuint32 associatedCount = 0;
+
+        XAuint32 i = 0;
+        for( i=0; i<impl->numInputDevices; i++ )
+        {
+            /* query device id from adaptation using index value */
+            res = XAStaticCapsAdapt_GetCapsByIdx(XACAP_DEVSRC|XACAP_AUDIO, i, &temp);
+            if (temp.xaid != deviceId)
+            {
+                associatedCount++;
+            }
+        }
+
+        if (pAudioInputDeviceIDs)
+        {
+            if( *pNumAudioInputs < associatedCount )
+            {
+                DEBUG_ERR("XA_RESULT_BUFFER_INSUFFICIENT");
+                DEBUG_API("<-XAAudIODevCapaItfImpl_GetAssociatedAudioInputs");
+                return XA_RESULT_BUFFER_INSUFFICIENT;
+            }
+
+            for( i=0, associatedCount = 0; i<impl->numInputDevices; i++ )
+            {
+                /* query device id from adaptation using index value */
+                res = XAStaticCapsAdapt_GetCapsByIdx(XACAP_DEVSRC|XACAP_AUDIO, i, &temp);
+                if (temp.xaid != deviceId)
+                {
+                    pAudioInputDeviceIDs[associatedCount++] = temp.xaid;
+                }
+            }
+        }
+
+        *pNumAudioInputs = associatedCount;
+#endif
+
+    if(!pAudioInputDeviceIDs)
+        {
+        switch(deviceId)
+            {
+            case 0xAD7E5001:
+                *pNumAudioInputs = 0;
+                break;
+            case 0xAD7E5002:
+                *pNumAudioInputs = 1;
+                break;
+            default:
+                res = XA_RESULT_PARAMETER_INVALID;
+                break;
+            }
+        }
+    else
+        {
+        switch(deviceId)
+            {
+            case 0xAD7E5001:
+                res = XA_RESULT_PARAMETER_INVALID;
+                break;
+            case 0xAD7E5002:
+                pAudioInputDeviceIDs[*pNumAudioInputs - 1] = 0xAD7E5001;
+                break;
+            default:
+                res = XA_RESULT_PARAMETER_INVALID;
+                break;
+            }
+        }
+
+    }
+
+    DEBUG_API("<-XAAudIODevCapaItfImpl_GetAssociatedAudioInputs");
+    return res;
+}
+
+/* XAresult XAAudIODevCapaItfImpl_GetAssociatedAudioOutputs
+ * Description: This method returns an array of audio output devices physically
+ * associated with this audio I/O device.
+ */
+XAresult XAAudIODevCapaItfImpl_GetAssociatedAudioOutputs(
+                                                XAAudioIODeviceCapabilitiesItf self,
+                                                XAuint32 deviceId,
+                                                XAint32* pNumAudioOutputs,
+                                                XAuint32* pAudioOutputDeviceIDs)
+{
+    XAAudIODevCapaItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAudIODevCapaItfImpl_GetAssociatedAudioOutputs");
+
+    if( !impl || !pNumAudioOutputs )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+        XAStaticCapsData temp;
+        XAuint32 associatedCount = 0;
+
+        XAuint32 i = 0;
+        for( i=0; i<impl->numOutputDevices; i++ )
+        {
+            /* query device id from adaptation using index value */
+            res = XAStaticCapsAdapt_GetCapsByIdx(XACAP_DEVSNK|XACAP_AUDIO, i, &temp);
+            if (temp.xaid != deviceId)
+            {
+                associatedCount++;
+            }
+        }
+
+        if (pAudioOutputDeviceIDs)
+        {
+            if( *pNumAudioOutputs < associatedCount )
+            {
+                DEBUG_ERR("XA_RESULT_BUFFER_INSUFFICIENT");
+                DEBUG_API("<-XAAudIODevCapaItfImpl_GetAssociatedAudioOutputs");
+                return XA_RESULT_BUFFER_INSUFFICIENT;
+            }
+
+            for( i=0, associatedCount = 0; i<impl->numOutputDevices; i++ )
+            {
+                /* query device id from adaptation using index value */
+                res = XAStaticCapsAdapt_GetCapsByIdx(XACAP_DEVSNK|XACAP_AUDIO, i, &temp);
+                if (temp.xaid != deviceId)
+                {
+                    pAudioOutputDeviceIDs[associatedCount++] = temp.xaid;
+                }
+            }
+        }
+
+        *pNumAudioOutputs = associatedCount;
+#endif
+
+        if(!pAudioOutputDeviceIDs)
+            {
+            switch(deviceId)
+                {
+                case 0xAD7E5002:
+                    *pNumAudioOutputs = 0;
+                    break;
+                case 0xAD7E5001:
+                    *pNumAudioOutputs = 1;
+                    break;
+                default:
+                    res = XA_RESULT_PARAMETER_INVALID;
+                    break;
+                }
+            }
+        else
+            {
+            switch(deviceId)
+                {
+                case 0xAD7E5002:
+                    res = XA_RESULT_PARAMETER_INVALID;
+                    break;
+                case 0xAD7E5001:
+                    pAudioOutputDeviceIDs[*pNumAudioOutputs - 1] = 0xAD7E5001;
+                    break;
+                default:
+                    res = XA_RESULT_PARAMETER_INVALID;
+                    break;
+                }
+            }
+    }
+
+    DEBUG_API("<-XAAudIODevCapaItfImpl_GetAssociatedAudioOutputs");
+    return res;
+}
+
+/* XAresult XAAudIODevCapaItfImpl_GetDefaultAudioDevices
+ * Gets the number of audio devices currently mapped to the given default device ID.
+ */
+XAresult XAAudIODevCapaItfImpl_GetDefaultAudioDevices(XAAudioIODeviceCapabilitiesItf self,
+                                                      XAuint32 defaultDeviceID,
+                                                      XAint32 *pNumAudioDevices,
+                                                      XAuint32 *pAudioDeviceIDs)
+{
+    XAAudIODevCapaItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAudIODevCapaItfImpl_GetDefaultAudioDevices");
+
+    if( !impl || !pNumAudioDevices )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+    if(!pAudioDeviceIDs)
+        {
+        switch(defaultDeviceID)
+            {
+            case XA_DEFAULTDEVICEID_AUDIOOUTPUT:
+                *pNumAudioDevices = 1;
+                break;
+            case XA_DEFAULTDEVICEID_AUDIOINPUT :
+                *pNumAudioDevices = 1;
+                break;
+            default:
+                res = XA_RESULT_PARAMETER_INVALID;
+                break;
+            }
+        }
+    else
+        {
+        switch(defaultDeviceID)
+            {
+            case XA_DEFAULTDEVICEID_AUDIOOUTPUT:
+                pAudioDeviceIDs[*pNumAudioDevices - 1] = 0xAD7E5002;
+                break;
+            case XA_DEFAULTDEVICEID_AUDIOINPUT:
+                pAudioDeviceIDs[*pNumAudioDevices - 1] = 0xAD7E5001;
+                break;
+            default:
+                res = XA_RESULT_PARAMETER_INVALID;
+                break;
+            }
+        }      
+
+    }
+    DEBUG_API("<-XAAudIODevCapaItfImpl_GetDefaultAudioDevices");
+    return res;
+}
+
+/* XAresult XAAudIODevCapaItfImpl_GetAssociatedAudioOutputs
+ * Description: Gets an array of sample formats supported by the audio I/O
+ * device for the given sampling rate.
+ */
+XAresult XAAudIODevCapaItfImpl_QuerySampleFormatsSupported(
+                                            XAAudioIODeviceCapabilitiesItf self,
+                                            XAuint32 deviceId,
+                                            XAmilliHertz samplingRate,
+                                            XAint32* pSampleFormats,
+                                            XAint32* pNumOfSampleFormats)
+{
+    XAAudIODevCapaItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAudIODevCapaItfImpl_QuerySampleFormatsSupported");
+
+    if( !impl || !pNumOfSampleFormats )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+        XAStaticCapsData temp;
+        res = XAStaticCapsAdapt_GetCapsById(XACAP_DEVSNK|XACAP_AUDIO,
+                                            deviceId, &temp);
+        /* deviceid can be either input or output*/
+        if( res == XA_RESULT_FEATURE_UNSUPPORTED )
+        {
+            res = XAStaticCapsAdapt_GetCapsById(XACAP_DEVSRC|XACAP_AUDIO,
+                                                deviceId, &temp);
+        }
+        if( res == XA_RESULT_SUCCESS )
+        {
+            XAuint32 count = 0, i = 0;
+            for (i=0; i < sizeof(temp.pcmProfilesSupported)*8; i++)
+                count+=temp.pcmProfilesSupported>>i&0x1;
+
+            if(pSampleFormats)
+            {
+                if(*pNumOfSampleFormats<count)
+                {
+                    res = XA_RESULT_BUFFER_INSUFFICIENT;
+                }
+                else
+                {
+                    XAuint32 insertCount = 0;
+                    if (temp.pcmProfilesSupported & XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_8) {
+                        pSampleFormats[insertCount++] = XA_PCMSAMPLEFORMAT_FIXED_8; }
+                    if (temp.pcmProfilesSupported & XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_16) {
+                        pSampleFormats[insertCount++] = XA_PCMSAMPLEFORMAT_FIXED_16; }
+                    if (temp.pcmProfilesSupported & XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_20) {
+                        pSampleFormats[insertCount++] = XA_PCMSAMPLEFORMAT_FIXED_20; }
+                    if (temp.pcmProfilesSupported & XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_24) {
+                        pSampleFormats[insertCount++] = XA_PCMSAMPLEFORMAT_FIXED_20; }
+                    if (temp.pcmProfilesSupported & XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_28) {
+                        pSampleFormats[insertCount++] = XA_PCMSAMPLEFORMAT_FIXED_20; }
+                    if (temp.pcmProfilesSupported & XA_ADAPT_PCMSAMPLEFORMAT_SUPPORTED_32) {
+                        pSampleFormats[insertCount++] = XA_PCMSAMPLEFORMAT_FIXED_20; }
+                }
+            }
+            *pNumOfSampleFormats = count;
+        }
+#endif
+
+    if(!pSampleFormats)
+        {
+        *pNumOfSampleFormats = 1;
+        }
+    else
+        {
+        pSampleFormats[*pNumOfSampleFormats - 1] = XA_PCMSAMPLEFORMAT_FIXED_16;
+        }
+
+    }
+
+    DEBUG_API("<-XAAudIODevCapaItfImpl_QuerySampleFormatsSupported");
+    return res;
+}
+
+/**
+ * XAAudIODevCapaItfImpl -specific methods
+ **/
+
+/* XAAudIODevCapaItfImpl_Create
+ * Description: Allocate and initialize XAAudIODevCapaItfImpl
+ */
+XAAudIODevCapaItfImpl* XAAudIODevCapaItfImpl_Create()
+{
+    XAAudIODevCapaItfImpl* self = (XAAudIODevCapaItfImpl*)
+        calloc(1,sizeof(XAAudIODevCapaItfImpl));
+    DEBUG_API("->XAAudIODevCapaItfImpl_Create");
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.GetAssociatedAudioInputs =
+            XAAudIODevCapaItfImpl_GetAssociatedAudioInputs;
+        self->itf.GetAssociatedAudioOutputs =
+            XAAudIODevCapaItfImpl_GetAssociatedAudioOutputs;
+        self->itf.GetAvailableAudioInputs =
+            XAAudIODevCapaItfImpl_GetAvailableAudioInputs;
+        self->itf.GetAvailableAudioOutputs =
+            XAAudIODevCapaItfImpl_GetAvailableAudioOutputs;
+        self->itf.QueryAudioInputCapabilities =
+            XAAudIODevCapaItfImpl_QueryAudioInputCapabilities;
+        self->itf.QueryAudioOutputCapabilities =
+            XAAudIODevCapaItfImpl_QueryAudioOutputCapabilities;
+        self->itf.GetDefaultAudioDevices =
+            XAAudIODevCapaItfImpl_GetDefaultAudioDevices;
+        self->itf.QuerySampleFormatsSupported =
+            XAAudIODevCapaItfImpl_QuerySampleFormatsSupported;
+        self->itf.RegisterAvailableAudioInputsChangedCallback =
+            XAAudIODevCapaItfImpl_RegisterAvailableAudioInputsChangedCallback;
+        self->itf.RegisterAvailableAudioOutputsChangedCallback =
+            XAAudIODevCapaItfImpl_RegisterAvailableAudioOutputsChangedCallback;
+        self->itf.RegisterDefaultDeviceIDMapChangedCallback =
+            XAAudIODevCapaItfImpl_RegisterDefaultDeviceIDMapChangedCallback;
+#ifdef _GSTREAMER_BACKEND_
+        /* init variables */
+        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_DEVSNK|XACAP_AUDIO,
+                                  &(self->numOutputDevices) ) == XA_RESULT_SUCCESS );
+        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_DEVSRC|XACAP_AUDIO,
+                                  &(self->numInputDevices) ) == XA_RESULT_SUCCESS );
+#endif
+        self->inputCbPtrToSelf = NULL;
+        self->outputCbPtrToSelf = NULL;
+        self->deviceMapCbPtrToSelf = NULL;
+        self->numInputDevices = 1;
+        self->numOutputDevices = 1;
+        self->self = self;
+    }
+    DEBUG_API("<-XAAudIODevCapaItfImpl_Create");
+    return self;
+}
+
+/* void XAAudIODevCapaItfImpl_Free
+ * Description: Free all resources reserved at XAAudIODevCapaItfImpl_Create
+ */
+void XAAudIODevCapaItfImpl_Free(XAAudIODevCapaItfImpl* self)
+{
+    DEBUG_API("->XAAudIODevCapaItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAAudIODevCapaItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaaudioiodevicecapabilitiesitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,110 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAAUDIOIODEVICECAPABILITIESITF_H
+#define XAAUDIOIODEVICECAPABILITIESITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAAudioIODeviceCapabilitiesItf implementation */
+typedef struct XAAudIODevCapaItfImpl_
+{
+    /* parent interface */
+    struct XAAudioIODeviceCapabilitiesItf_ itf;
+    /* pointer to self */
+    struct XAAudIODevCapaItfImpl_* self;
+
+    /* variables */
+    xaAvailableAudioInputsChangedCallback inputCb;
+    void* inputCbCtx;
+    XAAudioIODeviceCapabilitiesItf inputCbPtrToSelf;
+    xaAvailableAudioOutputsChangedCallback outputCb;
+    void* outputCbCtx;
+    XAAudioIODeviceCapabilitiesItf outputCbPtrToSelf;
+    xaDefaultDeviceIDMapChangedCallback deviceMapCb;
+    void* deviceMapCtx;
+    XAAudioIODeviceCapabilitiesItf deviceMapCbPtrToSelf;
+
+    XAuint32 numInputDevices;
+    XAuint32 numOutputDevices;
+    XAmilliHertz sampleRateArray[12];
+    
+} XAAudIODevCapaItfImpl;
+
+/* Base interface XAAudioIODeviceCapabilitiesItf implementation */
+XAresult XAAudIODevCapaItfImpl_GetAvailableAudioInputs(XAAudioIODeviceCapabilitiesItf self,
+                                                       XAint32* pNumInputs,
+                                                       XAuint32* pInputDeviceIDs);
+
+XAresult XAAudIODevCapaItfImpl_QueryAudioInputCapabilities(XAAudioIODeviceCapabilitiesItf self,
+                                                           XAuint32 deviceId,
+                                                           XAAudioInputDescriptor* pDescriptor);
+
+XAresult XAAudIODevCapaItfImpl_RegisterAvailableAudioInputsChangedCallback(XAAudioIODeviceCapabilitiesItf self,
+                                                                           xaAvailableAudioInputsChangedCallback callback,
+                                                                           void* pContext);
+
+XAresult XAAudIODevCapaItfImpl_GetAvailableAudioOutputs(XAAudioIODeviceCapabilitiesItf self,
+                                                        XAint32* pNumOutputs,
+                                                        XAuint32* pOutputDeviceIDs);
+
+XAresult XAAudIODevCapaItfImpl_QueryAudioOutputCapabilities(XAAudioIODeviceCapabilitiesItf self,
+                                                            XAuint32 deviceId,
+                                                            XAAudioOutputDescriptor* pDescriptor);
+
+XAresult XAAudIODevCapaItfImpl_RegisterAvailableAudioOutputsChangedCallback(XAAudioIODeviceCapabilitiesItf self,
+                                                                            xaAvailableAudioOutputsChangedCallback callback,
+                                                                            void* pContext);
+
+XAresult XAAudIODevCapaItfImpl_RegisterDefaultDeviceIDMapChangedCallback(XAAudioIODeviceCapabilitiesItf self,
+                                                                         xaDefaultDeviceIDMapChangedCallback callback,
+                                                                         void* pContext);
+
+XAresult XAAudIODevCapaItfImpl_GetAssociatedAudioInputs(XAAudioIODeviceCapabilitiesItf self,
+                                                        XAuint32 deviceId,
+                                                        XAint32* pNumAudioInputs,
+                                                        XAuint32* pAudioInputDeviceIDs);
+
+XAresult XAAudIODevCapaItfImpl_GetAssociatedAudioOutputs(XAAudioIODeviceCapabilitiesItf self,
+                                                         XAuint32 deviceId,
+                                                         XAint32* pNumAudioOutputs,
+                                                         XAuint32* pAudioOutputDeviceIDs);
+
+XAresult XAAudIODevCapaItfImpl_GetDefaultAudioDevices(XAAudioIODeviceCapabilitiesItf self,
+                                                      XAuint32 defaultDeviceID,
+                                                      XAint32 *pNumAudioDevices,
+                                                      XAuint32 *pAudioDeviceIDs);
+
+XAresult XAAudIODevCapaItfImpl_QuerySampleFormatsSupported(XAAudioIODeviceCapabilitiesItf self,
+                                                           XAuint32 deviceId,
+                                                           XAmilliHertz samplingRate,
+                                                           XAint32* pSampleFormats,
+                                                           XAint32* pNumOfSampleFormats);
+
+/* XAAudIODevCapaItfImpl -specific methods */
+XAAudIODevCapaItfImpl* XAAudIODevCapaItfImpl_Create(void);
+void XAAudIODevCapaItfImpl_Free(XAAudIODevCapaItfImpl* self);
+
+#endif /* XAAUDIOIODEVICECAPABILITIESITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xacameracapabilitiesitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,330 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xaglobals.h"
+#include "xacameracapabilitiesitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAStaticCapsAdaptation.h"
+#include "XAStaticCameraCapsAdaptation.h"
+#endif
+
+static XACameraCapabilitiesItfImpl* GetImpl(XACameraCapabilitiesItf self)
+{
+    if( self )
+    {
+        XACameraCapabilitiesItfImpl* impl = (XACameraCapabilitiesItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XACameraCapabilitiesItf implementation
+ */
+XAresult XACameraCapabilitiesItfImpl_GetCameraCapabilities(
+                        XACameraCapabilitiesItf self,
+                        XAuint32* pIndex,
+                        XAuint32* pCameraDeviceID,
+                        XACameraDescriptor* pDescriptor)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraCapabilitiesItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XACameraCapabilitiesItfImpl_GetCameraCapabilities");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraCapabilitiesItfImpl_GetCameraCapabilities");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAStaticCameraCaps_GetCameraCapabilities(pIndex,pCameraDeviceID,pDescriptor);
+#endif
+    DEBUG_API("<-XACameraCapabilitiesItfImpl_GetCameraCapabilities");
+    return ret;
+}
+
+
+XAresult XACameraCapabilitiesItfImpl_QueryFocusRegionPatterns(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pPatternID,
+                        XAuint32* pFocusPattern,
+                        XAuint32* pCustomPoints1,
+                        XAuint32* pCustomPoints2)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraCapabilitiesItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XACameraCapabilitiesItfImpl_QueryFocusRegionPatterns");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraCapabilitiesItfImpl_QueryFocusRegionPatterns");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAStaticCameraCaps_QueryFocusRegionPatterns(
+            cameraDeviceID, pPatternID, pFocusPattern,pCustomPoints1,pCustomPoints2);
+#endif
+    DEBUG_API("<-XACameraCapabilitiesItfImpl_QueryFocusRegionPatterns");
+    return ret;
+}
+
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedAutoLocks(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pNumCombinations,
+                        XAuint32** ppLocks)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraCapabilitiesItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XACameraCapabilitiesItfImpl_GetSupportedAutoLocks");
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedAutoLocks");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAStaticCameraCaps_GetSupportedAutoLocks(
+                cameraDeviceID, pNumCombinations, ppLocks);
+#endif
+    DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedAutoLocks");
+    return ret;
+}
+
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedFocusManualSettings(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAboolean macroEnabled,
+                        XAmillimeter* pMinValue,
+                        XAmillimeter* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAmillimeter** ppSettings)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraCapabilitiesItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XACameraCapabilitiesItfImpl_GetSupportedFocusManualSettings");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedFocusManualSettings");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAStaticCameraCaps_GetSupportedFocusManualSettings(
+            cameraDeviceID, macroEnabled,pMinValue, pMaxValue, pNumSettings, ppSettings);
+#endif
+    DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedFocusManualSettings");
+    return ret;
+}
+
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedISOSensitivitySettings(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pMinValue,
+                        XAuint32* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAuint32** ppSettings)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraCapabilitiesItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XACameraCapabilitiesItfImpl_GetSupportedISOSensitivitySettings");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedISOSensitivitySettings");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAStaticCameraCaps_GetSupportedISOSensitivitySettings(
+                cameraDeviceID, pMinValue, pMaxValue, pNumSettings, ppSettings );
+#endif
+    DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedISOSensitivitySettings");
+    return ret;
+}
+
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedApertureManualSettings(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pMinValue,
+                        XAuint32* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAuint32** ppSettings)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraCapabilitiesItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XACameraCapabilitiesItfImpl_GetSupportedApertureManualSettings");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedApertureManualSettings");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAStaticCameraCaps_GetSupportedApertureManualSettings(
+                cameraDeviceID, pMinValue, pMaxValue, pNumSettings, ppSettings );
+#endif
+    DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedApertureManualSettings");
+    return ret;
+}
+
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedShutterSpeedManualSettings(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAmicrosecond* pMinValue,
+                        XAmicrosecond* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAmicrosecond** ppSettings)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraCapabilitiesItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XACameraCapabilitiesItfImpl_GetSupportedShutterSpeedManualSettings");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedShutterSpeedManualSettings");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAStaticCameraCaps_GetSupportedShutterSpeedManualSettings(
+                cameraDeviceID, pMinValue, pMaxValue, pNumSettings, ppSettings);
+#endif
+    DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedShutterSpeedManualSettings");
+    return ret;
+}
+
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedWhiteBalanceManualSettings(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pMinValue,
+                        XAuint32* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAuint32** ppSettings)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraCapabilitiesItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XACameraCapabilitiesItfImpl_GetSupportedWhiteBalanceManualSettings");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedWhiteBalanceManualSettings");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAStaticCameraCaps_GetSupportedWhiteBalanceManualSettings(
+                cameraDeviceID, pMinValue, pMaxValue, pNumSettings, ppSettings);
+#endif
+    DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedWhiteBalanceManualSettings");
+    return ret;
+}
+
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedZoomSettings(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAboolean digitalEnabled,
+                        XAboolean macroEnabled,
+                        XApermille* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XApermille** ppSettings,
+                        XAboolean* pSpeedSupported)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XACameraCapabilitiesItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XACameraCapabilitiesItfImpl_GetSupportedZoomSettings");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedZoomSettings");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAStaticCameraCaps_GetSupportedZoomSettings(
+                cameraDeviceID, digitalEnabled, macroEnabled, pMaxValue,
+                pNumSettings, ppSettings, pSpeedSupported);
+#endif
+    DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedZoomSettings");
+    return ret;
+}
+
+#ifdef _GSTREAMER_BACKEND_  
+/**
+ * XACameraCapabilitiesItfImpl -specific methods
+ **/
+XACameraCapabilitiesItfImpl* XACameraCapabilitiesItfImpl_Create()
+{
+    XACameraCapabilitiesItfImpl* self = (XACameraCapabilitiesItfImpl*)
+        calloc(1,sizeof(XACameraCapabilitiesItfImpl));
+    DEBUG_API("->XACameraCapabilitiesItfImpl_Create");
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.GetCameraCapabilities =
+            XACameraCapabilitiesItfImpl_GetCameraCapabilities;
+        self->itf.QueryFocusRegionPatterns =
+            XACameraCapabilitiesItfImpl_QueryFocusRegionPatterns;
+        self->itf.GetSupportedAutoLocks =
+            XACameraCapabilitiesItfImpl_GetSupportedAutoLocks;
+        self->itf.GetSupportedFocusManualSettings =
+            XACameraCapabilitiesItfImpl_GetSupportedFocusManualSettings;
+        self->itf.GetSupportedISOSensitivitySettings =
+            XACameraCapabilitiesItfImpl_GetSupportedISOSensitivitySettings;
+        self->itf.GetSupportedApertureManualSettings =
+            XACameraCapabilitiesItfImpl_GetSupportedApertureManualSettings;
+        self->itf.GetSupportedShutterSpeedManualSettings =
+            XACameraCapabilitiesItfImpl_GetSupportedShutterSpeedManualSettings;
+        self->itf.GetSupportedWhiteBalanceManualSettings =
+            XACameraCapabilitiesItfImpl_GetSupportedWhiteBalanceManualSettings;
+        self->itf.GetSupportedZoomSettings =
+            XACameraCapabilitiesItfImpl_GetSupportedZoomSettings;
+
+        self->self = self;
+    }
+    DEBUG_API("<-XACameraCapabilitiesItfImpl_Create");
+    return self;
+}
+
+void XACameraCapabilitiesItfImpl_Free(XACameraCapabilitiesItfImpl* self)
+{
+    DEBUG_API("->XACameraCapabilitiesItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XACameraCapabilitiesItfImpl_Free");
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xacameracapabilitiesitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,117 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XACAMERACAPABILITIESITF_H
+#define XACAMERACAPABILITIESITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XACameraCapabilitiesItf implementation */
+typedef struct XACameraCapabilitiesItfImpl_
+{
+    /* parent interface */
+    struct XACameraCapabilitiesItf_ itf;
+    /* pointer to self */
+    struct XACameraCapabilitiesItfImpl_* self;
+    /* variables */
+} XACameraCapabilitiesItfImpl;
+
+/* Base interface XACameraCapabilitiesItf implementation */
+XAresult XACameraCapabilitiesItfImpl_GetCameraCapabilities(
+                        XACameraCapabilitiesItf self,
+                        XAuint32* pIndex,
+                        XAuint32* pCameraDeviceID,
+                        XACameraDescriptor* pDescriptor);
+
+XAresult XACameraCapabilitiesItfImpl_QueryFocusRegionPatterns(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pPatternID,
+                        XAuint32* pFocusPattern,
+                        XAuint32* pCustomPoints1,
+                        XAuint32* pCustomPoints2);
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedAutoLocks(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pNumCombinations,
+                        XAuint32** ppLocks);
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedFocusManualSettings(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAboolean macroEnabled,
+                        XAmillimeter* pMinValue,
+                        XAmillimeter* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAmillimeter** ppSettings);
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedISOSensitivitySettings(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pMinValue,
+                        XAuint32* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAuint32** ppSettings);
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedApertureManualSettings(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pMinValue,
+                        XAuint32* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAuint32** ppSettings);
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedShutterSpeedManualSettings(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAmicrosecond* pMinValue,
+                        XAmicrosecond* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAmicrosecond** ppSettings);
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedWhiteBalanceManualSettings(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAuint32* pMinValue,
+                        XAuint32* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XAuint32** ppSettings);
+
+XAresult XACameraCapabilitiesItfImpl_GetSupportedZoomSettings(
+                        XACameraCapabilitiesItf self,
+                        XAuint32 cameraDeviceID,
+                        XAboolean digitalEnabled,
+                        XAboolean macroEnabled,
+                        XApermille* pMaxValue,
+                        XAuint32* pNumSettings,
+                        XApermille** ppSettings,
+                        XAboolean* pSpeedSupported);
+#ifdef _GSTREAMER_BACKEND_  
+/* XACameraCapabilitiesItfImpl -specific methods */
+XACameraCapabilitiesItfImpl* XACameraCapabilitiesItfImpl_Create();
+void XACameraCapabilitiesItfImpl_Free(XACameraCapabilitiesItfImpl* self);
+#endif
+#endif /* XACAMERACAPABILITIESITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xadevicevolumeitf.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xaglobals.h"
+#include "xadevicevolumeitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XADeviceVolumeItfAdaptation.h"
+#endif
+
+static XADeviceVolumeItfImpl* GetImpl(XADeviceVolumeItf self)
+{
+    if( self )
+    {
+        XADeviceVolumeItfImpl* impl = (XADeviceVolumeItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XADeviceVolumeItf implementation
+ */
+
+/* XAresult XADeviceVolumeItfImpl_GetVolumeScale( XADeviceVolumeItf self,
+ *                                                XAuint32 deviceID,
+ *                                                XAint32* pMinValue,
+ *                                                XAint32* pMaxValue,
+ *                                                XAboolean* pIsMillibelScale)
+ * Description: Gets the properties of the volume scale supported by the given device.
+ */
+XAresult XADeviceVolumeItfImpl_GetVolumeScale( XADeviceVolumeItf self,
+                                               XAuint32 deviceID,
+                                               XAint32* pMinValue,
+                                               XAint32* pMaxValue,
+                                               XAboolean* pIsMillibelScale)
+{
+    XADeviceVolumeItfImpl* impl = GetImpl(self);
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAboolean supported = XA_BOOLEAN_FALSE;
+    DEBUG_API("->XADeviceVolumeItfImpl_GetVolumeScale");
+    if( !impl || !pMinValue || !pMaxValue || !pIsMillibelScale )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XADeviceVolumeItfImpl_GetVolumeScale");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported(impl->adapCtx, deviceID, &supported);
+#endif
+    if( ret != XA_RESULT_SUCCESS || supported != XA_BOOLEAN_TRUE )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XADeviceVolumeItfImpl_GetVolumeScale");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pMinValue = impl->minVolume;
+    *pMaxValue = impl->maxVolume;
+    *pIsMillibelScale = impl->ismBscale;
+
+    DEBUG_API("<-XADeviceVolumeItfImpl_GetVolumeScale");
+    return ret;
+}
+
+/* XAresult XADeviceVolumeItfImpl_SetVolume( XADeviceVolumeItf self,
+ *                                           XAuint32 deviceID,
+ *                                           XAint32 volume)
+ * Description: Sets the device's volume.
+ */
+XAresult XADeviceVolumeItfImpl_SetVolume( XADeviceVolumeItf self,
+                                          XAuint32 deviceID,
+                                          XAint32 volume)
+{
+    XADeviceVolumeItfImpl* impl = GetImpl(self);
+    XAresult ret = XA_RESULT_SUCCESS;
+#ifdef _GSTREAMER_BACKEND_  
+    XAboolean supported = XA_BOOLEAN_FALSE;
+#endif
+    DEBUG_API("->XADeviceVolumeItfImpl_SetVolume");
+
+    if( !impl || volume < impl->minVolume || volume > impl->maxVolume )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XADeviceVolumeItfImpl_SetVolume");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported(impl->adapCtx, deviceID, &supported);
+    if( ret != XA_RESULT_SUCCESS || supported != XA_BOOLEAN_TRUE )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XADeviceVolumeItfImpl_SetVolume");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    ret = XADeviceVolumeItfAdapt_SetVolume(impl->adapCtx, deviceID, volume);
+
+    if( ret == XA_RESULT_SUCCESS )
+    {
+        impl->curVolume = volume;
+    }
+#endif
+    DEBUG_API("<-XADeviceVolumeItfImpl_SetVolume");
+    return ret;
+}
+
+/* XAresult XADeviceVolumeItfImpl_GetVolume( XADeviceVolumeItf self,
+ *                                           XAuint32 deviceID,
+ *                                           XAint32 * pVolume)
+ * Description: Gets the device's volume.
+ */
+XAresult XADeviceVolumeItfImpl_GetVolume( XADeviceVolumeItf self,
+                                          XAuint32 deviceID,
+                                          XAint32 * pVolume)
+{
+    XADeviceVolumeItfImpl* impl = GetImpl(self);
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAboolean supported = XA_BOOLEAN_FALSE;
+    DEBUG_API("->XADeviceVolumeItfImpl_GetVolume");
+
+    if( !impl || !pVolume )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XADeviceVolumeItfImpl_GetVolume");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported(impl->adapCtx, deviceID, &supported);
+#endif
+    if( ret != XA_RESULT_SUCCESS || supported != XA_BOOLEAN_TRUE )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XADeviceVolumeItfImpl_GetVolume");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    *pVolume = impl->curVolume;
+    DEBUG_API("<-XADeviceVolumeItfImpl_GetVolume");
+    return XA_RESULT_SUCCESS;
+}
+
+/**
+ * XADeviceVolumeItfImpl -specific methods
+ **/
+#ifdef _GSTREAMER_BACKEND_  
+/**
+ * XADeviceVolumeItfImpl* XADeviceVolumeItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
+ * Description: Allocate and initialize DeviceVolumeImpl
+ **/
+XADeviceVolumeItfImpl* XADeviceVolumeItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
+{
+    XADeviceVolumeItfImpl* self = (XADeviceVolumeItfImpl*)
+        calloc(1,sizeof(XADeviceVolumeItfImpl));
+    DEBUG_API("->XADeviceVolumeItfImpl_Create");
+
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.GetVolumeScale =
+            XADeviceVolumeItfImpl_GetVolumeScale;
+        self->itf.GetVolume =
+            XADeviceVolumeItfImpl_GetVolume;
+        self->itf.SetVolume =
+            XADeviceVolumeItfImpl_SetVolume;
+
+        /* init variables */
+        /* these values are replaced by adaptation in init phase */
+        self->curVolume = DEFAULTDEVICEVOLUME;
+        self->minVolume = DEFAULTDEVICEMINVOLUME;
+        self->maxVolume = DEFAULTDEVICEMAXVOLUME;
+        self->ismBscale = DEFAULTSCALEISMILLIBEL;
+
+        self->adapCtx = adapCtx;
+        self->self = self;
+    }
+    DEBUG_API("<-XADeviceVolumeItfImpl_Create");
+    return self;
+}
+#endif
+/* void XADeviceVolumeItfImpl_Free(XADeviceVolumeItfImpl* self)
+ * Description: Free all resources reserved at XADeviceVolumeItfImpl_Create
+ */
+void XADeviceVolumeItfImpl_Free(XADeviceVolumeItfImpl* self)
+{
+    DEBUG_API("->XADeviceVolumeItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XADeviceVolumeItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xadevicevolumeitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XADEVICEVOLUMEITF_H
+#define XADEVICEVOLUMEITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+#define DEFAULTDEVICEVOLUME 5
+#define DEFAULTDEVICEMINVOLUME 0
+#define DEFAULTDEVICEMAXVOLUME 10
+#define DEFAULTSCALEISMILLIBEL XA_BOOLEAN_FALSE
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XADeviceVolumeItf implementation */
+typedef struct XADeviceVolumeItfImpl_
+{
+    /* parent interface */
+    struct XADeviceVolumeItf_ itf;
+    /* pointer to self */
+    struct XADeviceVolumeItfImpl_* self;
+
+    /* variables */
+
+    XAint32 curVolume;
+    XAint32 minVolume;
+    XAint32 maxVolume;
+    XAboolean ismBscale;
+#ifdef _GSTREAMER_BACKEND_  
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+} XADeviceVolumeItfImpl;
+
+/* Base interface XADeviceVolumeItf implementation */
+XAresult XADeviceVolumeItfImpl_GetVolumeScale(
+                        XADeviceVolumeItf self,
+                        XAuint32 deviceID,
+                        XAint32 * pMinValue,
+                        XAint32 * pMaxValue,
+                        XAboolean * pIsMillibelScale);
+XAresult XADeviceVolumeItfImpl_SetVolume(
+                        XADeviceVolumeItf self,
+                        XAuint32 deviceID,
+                        XAint32 volume);
+XAresult XADeviceVolumeItfImpl_GetVolume(
+                        XADeviceVolumeItf self,
+                        XAuint32 deviceID,
+                        XAint32 * pVolume);
+#ifdef _GSTREAMER_BACKEND_  
+/* XADeviceVolumeItfImpl -specific methods */
+XADeviceVolumeItfImpl* XADeviceVolumeItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
+#endif
+void XADeviceVolumeItfImpl_Free(XADeviceVolumeItfImpl* self);
+
+#endif /* XADEVICEVOLUMEITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaengine.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,450 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "xaengine.h"
+#include "xaobjectitf.h"
+#include "xaengineitf.h"
+#include "xathreadsyncitf.h"
+#include "xadynintmgmtitf.h"
+#include "xaaudioiodevicecapabilitiesitf.h"
+#include "xaaudiodecodercapabilitiesitf.h"
+#include "xaaudioencodercapabilitiesitf.h"
+#include "xaimagedecodercapabilitiesitf.h"
+#include "xaimageencodercapabilitiesitf.h"
+#include "xavideodecodercapabilitiesitf.h"
+#include "xavideoencodercapabilitiesitf.h"
+#include "xacameracapabilitiesitf.h"
+#include "xadevicevolumeitf.h"
+#include "xaconfigextensionsitf.h"
+#include "xathreadsafety.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAStaticCameraCapsAdaptation.h"
+#endif
+/* Static mapping of enumeration XAEngineInterfaces to interface iids */
+static const XAInterfaceID* xaEngineItfIIDs[ENGINE_ITFCOUNT]={
+    &XA_IID_OBJECT,
+    &XA_IID_ENGINE,
+    &XA_IID_DYNAMICINTERFACEMANAGEMENT,
+    &XA_IID_THREADSYNC,
+    &XA_IID_CONFIGEXTENSION,
+    &XA_IID_DEVICEVOLUME,
+    &XA_IID_AUDIOIODEVICECAPABILITIES,
+    &XA_IID_AUDIODECODERCAPABILITIES,
+    &XA_IID_AUDIOENCODERCAPABILITIES,
+    &XA_IID_CAMERACAPABILITIES,
+    &XA_IID_IMAGEDECODERCAPABILITIES,
+    &XA_IID_IMAGEENCODERCAPABILITIES,
+    &XA_IID_VIDEODECODERCAPABILITIES,
+    &XA_IID_VIDEOENCODERCAPABILITIES
+};
+
+/*****************************************************************************
+ * Global methods
+ *****************************************************************************/
+
+/* XAResult XAEngineImpl_Create
+ * Description: Create object
+ */
+XAresult XAEngineImpl_Create(XAObjectItf *pEngine,
+                             XAuint32 numOptions,
+                             const XAEngineOption *pEngineOptions,
+                             XAuint32 numInterfaces,
+                             const XAInterfaceID *pInterfaceIds,
+                             const XAboolean *pInterfaceRequired)
+{
+    XAEngineImpl* pImpl = NULL;
+    XAObjectItfImpl* pBaseObj = NULL;
+    XAuint32 itfIndex = 0;
+    //XAboolean optEnabled = XA_BOOLEAN_FALSE;
+    XAboolean threadSafeEnabled = XA_BOOLEAN_TRUE;
+    DEBUG_API("->XAEngineImpl_Create");
+
+    if( !pEngine )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEngineImpl_Create");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check engine options */
+    if( pEngineOptions && (numOptions != 0))
+    {
+        int i;
+        for(i = 0; i<numOptions; i++)
+        {
+            if (pEngineOptions[i].feature==XA_ENGINEOPTION_LOSSOFCONTROL)
+            {
+                //XAboolean optEnabled = pEngineOptions[i].data;
+                // TODO: do something with the above value or else remove the code
+            }
+            if (pEngineOptions[i].feature==XA_ENGINEOPTION_THREADSAFE)
+            {
+                threadSafeEnabled = pEngineOptions[i].data;
+            }
+        }
+    }
+
+    /* instantiate object implementation */
+    pImpl = (XAEngineImpl*)calloc(1,sizeof(XAEngineImpl));
+    if( !pImpl )
+    {
+        DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+        DEBUG_API("<-XAEngineImpl_Create");
+        /* memory allocation failed */
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+    pBaseObj = &pImpl->baseObj;
+
+    /* Initialize base object default implementation */
+    XAObjectItfImpl_Init(pBaseObj,
+                         ENGINE_ITFCOUNT,
+                         xaEngineItfIIDs,
+                         XAEngineImpl_DoRealize,
+                         XAEngineImpl_DoResume,
+                         XAEngineImpl_FreeResources);
+
+
+    /* Mark interfaces that need to be exposed */
+    /* Implicit and mandated interfaces */
+    pBaseObj->interfaceMap[ENGINE_ENGINEITF].required = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[ENGINE_DIMITF].required = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[ENGINE_THREADSYNCITF].required = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[ENGINE_AUDIOIODEVICECAPAITF].required = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[ENGINE_AUDIOENCODERCAPAITF].required = XA_BOOLEAN_TRUE;
+    /* Explicit interfaces */
+    if( (numInterfaces != 0) &&  pInterfaceIds && pInterfaceRequired )
+    {
+        /* Check required interfaces */
+        for(itfIndex = 0; itfIndex < numInterfaces; itfIndex++)
+        {
+            /* If mapEntry is null then required interface is not supported.*/
+            XAObjItfMapEntry *entry =
+                XAObjectItfImpl_GetItfEntry((XAObjectItf)&(pBaseObj), pInterfaceIds[itfIndex]);
+            if( !entry  )
+            {
+                if( pInterfaceRequired[itfIndex] )
+                {
+                    /* required interface cannot be accommodated - fail creation */
+                    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+                    DEBUG_ERR("Required interface not found - abort creation!");
+                    DEBUG_API("<-XAEngineImpl_Create");
+                    return XA_RESULT_FEATURE_UNSUPPORTED;
+                }
+                else
+                {
+                    DEBUG_INFO("Requested (not required) interface not found - continue creation");
+                }
+            }
+            else
+            {
+                entry->required = XA_BOOLEAN_TRUE;
+            }
+        }
+    }
+
+    /* Initialize XAEngineImpl variables */
+    if( threadSafeEnabled )
+    {
+        XAresult ret = XA_RESULT_SUCCESS;
+        pImpl->isThreadSafe = threadSafeEnabled;
+        ret = XAThreadSafety_Init( threadSafeEnabled );
+        if ( ret != XA_RESULT_SUCCESS )
+        {
+            DEBUG_INFO_A1("Unable to initialize thread safety - ret:%x", ret );
+        }
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    pImpl->adaptationCtx = XAEngineAdapt_Create();
+#endif
+    /* Set ObjectItf to point to newly created object */
+    *pEngine = ((XAObjectItf)&(pBaseObj->self));
+
+    DEBUG_API("<-XAEngineImpl_Create");
+    return XA_RESULT_SUCCESS;
+}
+
+/* XAResult XAEngineImpl_QueryNumSupportedInterfaces
+ * Description: Statically query number of supported interfaces
+ */
+XAresult XAEngineImpl_QueryNumSupportedInterfaces(
+                                XAuint32 *pNumSupportedInterfaces)
+{
+    DEBUG_API("->XAEngineImpl_QueryNumSupportedInterfaces");
+    if(pNumSupportedInterfaces)
+    {
+        *pNumSupportedInterfaces = ENGINE_ITFCOUNT;
+        DEBUG_API("<-XAEngineImpl_QueryNumSupportedInterfaces");
+        return XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEngineImpl_QueryNumSupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+}
+
+/* XAResult XAEngineImpl_QuerySupportedInterfaces
+ * Description: Statically query supported interfaces
+ */
+XAresult XAEngineImpl_QuerySupportedInterfaces(
+                                XAuint32 index,
+                                XAInterfaceID *pInterfaceId)
+{
+    DEBUG_API("->XAEngineImpl_QuerySupportedInterfaces");
+    if (index >= ENGINE_ITFCOUNT || !pInterfaceId )
+    {
+        if(pInterfaceId)
+            {
+            *pInterfaceId = XA_IID_NULL;
+            }
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEngineImpl_QuerySupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        *pInterfaceId = *(xaEngineItfIIDs[index]);
+        DEBUG_API("<-XAEngineImpl_QuerySupportedInterfaces");
+        return XA_RESULT_SUCCESS;
+    }
+}
+
+/*****************************************************************************
+ * base object XAObjectItfImpl methods
+ *****************************************************************************/
+
+/* XAresult XAEngineImpl_DoRealize
+ * Description: Realize all implicit and explicitly wanted interfaces.
+ * Create and initialize implementation-specific variables.
+ * Called from base object XAObjectItfImpl
+ */
+XAresult XAEngineImpl_DoRealize(XAObjectItf self)
+{
+    XAuint8 itfIdx = 0;
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAEngineImpl* pObjImpl = (XAEngineImpl*)(pObj);
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAEngineImpl_DoRealize");
+
+    /* check casting from correct pointer type */
+    if( !pObjImpl || pObj != pObjImpl->baseObj.self )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEngineImpl_DoRealize");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_  
+    ret = XAEngineAdapt_PostInit( pObjImpl->adaptationCtx );
+#endif
+    if( ret != XA_RESULT_SUCCESS )
+    {
+        DEBUG_ERR_A1("Engine postinit failed - %d", ret);
+        DEBUG_API("<-XAEngineImpl_DoRealize");
+        return ret;
+    }
+
+    ret = XAEngineAdaptMMF_PostInit( pObjImpl->adaptationMmfCtx );
+    if( ret != XA_RESULT_SUCCESS )
+    {
+        DEBUG_ERR_A1("Engine postinit failed (MMF) - %d", ret);
+        DEBUG_API("<-XAEngineImpl_DoRealize");
+        return ret;
+    }
+    /* Realize all implicit and explicitly wanted interfaces */
+    for(itfIdx=0; itfIdx<ENGINE_ITFCOUNT; itfIdx++)
+    {
+        if(!(pObj->interfaceMap[itfIdx].pItf) &&
+           pObj->interfaceMap[itfIdx].required )
+        {
+            void *pItf = NULL;
+            switch(itfIdx)
+            {
+                case ENGINE_ENGINEITF:
+                    pItf = XAEngineItfImpl_Create();
+                    break;
+                case ENGINE_THREADSYNCITF:
+                    pItf = XAThreadSyncItfImpl_Create();
+                    break;
+                case ENGINE_DIMITF:
+                    pItf = XADIMItfImpl_Create();
+                    break;
+                case ENGINE_AUDIOIODEVICECAPAITF:
+                    pItf = XAAudIODevCapaItfImpl_Create();
+                    break;
+                case ENGINE_AUDIOENCODERCAPAITF:
+                    pItf = XAAudioEncoderCapabilitiesItfImpl_Create();
+                    break;
+                case ENGINE_AUDIODECODERCAPAITF:
+                    pItf = XAAudioDecoderCapabilitiesItfImpl_Create();
+                    break;
+                case ENGINE_CONFIGEXTENSIONSITF:
+                    pItf = XAConfigExtensionsItfImpl_Create();
+                    break;
+                case ENGINE_DEVICEVOLUMEITF:
+#ifdef _GSTREAMER_BACKEND_  
+                    pItf = XADeviceVolumeItfImpl_Create(pObjImpl->adaptationCtx);
+#endif
+                    break;
+                case ENGINE_CAMERACAPAITF:
+#ifdef _GSTREAMER_BACKEND_
+                    XAStaticCameraCaps_Init();
+                    pItf = XACameraCapabilitiesItfImpl_Create();
+#endif                    
+                    break;
+                case ENGINE_IMAGEDECODERCAPAITF:
+                    pItf = XAImageDecoderCapabilitiesItfImpl_Create();
+                    break;
+                case ENGINE_IMAGEENCODERCAPAITF:
+                    pItf = XAImageEncoderCapabilitiesItfImpl_Create();
+                    break;
+                case ENGINE_VIDEODECODERCAPAITF:
+                    pItf = XAVideoDecoderCapabilitiesItfImpl_Create();
+                    break;
+                case ENGINE_VIDEOENCODERCAPAITF:
+                    pItf = XAVideoEncoderCapabilitiesItfImpl_Create();
+                    break;
+                default:
+                    break;
+            }
+            if(!pItf)
+            {
+                DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+                DEBUG_API("<-XAEngineImpl_DoRealize");
+                /* memory allocation failed */
+                return XA_RESULT_MEMORY_FAILURE;
+            }
+            else
+            {
+                pObj->interfaceMap[itfIdx].pItf = pItf;
+            }
+        }
+    }
+
+    pObj->state = XA_OBJECT_STATE_REALIZED;
+    DEBUG_API("<-XAEngineImpl_DoRealize");
+    return XA_RESULT_SUCCESS;
+}
+
+/* XAresult XAEngineImpl_DoResume
+ * Description: Resume object from suspended state
+ */
+XAresult XAEngineImpl_DoResume(XAObjectItf self)
+{
+    DEBUG_API("->XAEngineImpl_DoResume");
+    DEBUG_API("<-XAEngineImpl_DoResume");
+
+    return XA_RESULT_PRECONDITIONS_VIOLATED;
+}
+
+/* void XAEngineImpl_FreeResources
+ * Description: Free all resources reserved at XA%ExampleObject%Impl_DoRealize()
+ */
+void XAEngineImpl_FreeResources(XAObjectItf self)
+{
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAEngineImpl* pImpl = (XAEngineImpl*)(*self);
+    XAuint8 itfIdx = 0;
+    DEBUG_API("->XAEngineImpl_FreeResources");
+    assert( pObj && pImpl && pObj == pObj->self );
+
+    /* free all allocated interfaces */
+    for(itfIdx=0; itfIdx<ENGINE_ITFCOUNT; itfIdx++)
+    {
+        void *pItf = pObj->interfaceMap[itfIdx].pItf;
+        if(pItf)
+        {
+            switch(itfIdx)
+            {
+                case ENGINE_ENGINEITF:
+                    XAEngineItfImpl_Free(pItf);
+                    break;
+                case ENGINE_THREADSYNCITF:
+                    XAThreadSyncItfImpl_Free(pItf);
+                    break;
+                case ENGINE_DIMITF:
+                    XADIMItfImpl_Free(pItf);
+                    break;
+                case ENGINE_AUDIOIODEVICECAPAITF:
+                    XAAudIODevCapaItfImpl_Free(pItf);
+                    break;
+                case ENGINE_AUDIOENCODERCAPAITF:
+                    XAAudioEncoderCapabilitiesItfImpl_Free(pItf);
+                    break;
+                case ENGINE_AUDIODECODERCAPAITF:
+                    XAAudioDecoderCapabilitiesItfImpl_Free(pItf);
+                    break;
+                case ENGINE_CONFIGEXTENSIONSITF:
+                    XAConfigExtensionsItfImpl_Free(pItf);
+                    break;
+                case ENGINE_DEVICEVOLUMEITF:
+                    XADeviceVolumeItfImpl_Free(pItf);
+                    break;
+                case ENGINE_CAMERACAPAITF:
+#ifdef _GSTREAMER_BACKEND_
+                    XACameraCapabilitiesItfImpl_Free(pItf);
+#endif                    
+                    break;
+                case ENGINE_IMAGEDECODERCAPAITF:
+                    XAImageDecoderCapabilitiesItfImpl_Free(pItf);
+                    break;
+                case ENGINE_IMAGEENCODERCAPAITF:
+                    XAImageEncoderCapabilitiesItfImpl_Free(pItf);
+                    break;
+                case ENGINE_VIDEODECODERCAPAITF:
+                    XAVideoDecoderCapabilitiesItfImpl_Free(pItf);
+                    break;
+                case ENGINE_VIDEOENCODERCAPAITF:
+                    XAVideoEncoderCapabilitiesItfImpl_Free(pItf);
+                    break;
+                default:
+                    break;
+            }
+            pObj->interfaceMap[itfIdx].pItf = NULL;
+        }
+    }
+
+    /* free all other allocated resources*/
+#ifdef _GSTREAMER_BACKEND_  
+    if ( pImpl->adaptationCtx != NULL )
+    {
+        XAEngineAdapt_Destroy( pImpl->adaptationCtx );
+        pImpl->adaptationCtx = NULL;
+    }
+#endif    
+    if ( pImpl->adaptationMmfCtx != NULL )
+    {
+        XAEngineAdaptMMF_Destroy( pImpl->adaptationMmfCtx );
+        pImpl->adaptationMmfCtx = NULL;
+    }
+
+    XAThreadSafety_Destroy();
+
+    DEBUG_API("<-XAEngineImpl_FreeResources");
+    return;
+}
+
+/* END OF FILE */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaengine.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,81 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAENGINE_H
+#define XAENGINE_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#include "xaobjectitf.h"
+#ifdef _GSTREAMER_BACKEND_   
+#include "XAEngineAdaptCtx.h"
+#endif
+#include "xaengineadaptctxmmf.h"
+
+/** MACROS **/
+
+
+/** TYPES **/
+
+
+/** ENUMERATIONS **/
+/* Enumeration for interfaces that Engine supports.  */
+typedef enum
+{
+    ENGINE_OBJECTITF,
+    ENGINE_ENGINEITF,
+    ENGINE_DIMITF,
+    ENGINE_THREADSYNCITF,
+    ENGINE_CONFIGEXTENSIONSITF,
+    ENGINE_DEVICEVOLUMEITF,
+    ENGINE_AUDIOIODEVICECAPAITF,
+    ENGINE_AUDIODECODERCAPAITF,
+    ENGINE_AUDIOENCODERCAPAITF,
+    ENGINE_CAMERACAPAITF,
+    ENGINE_IMAGEDECODERCAPAITF,
+    ENGINE_IMAGEENCODERCAPAITF,
+    ENGINE_VIDEODECODERCAPAITF,
+    ENGINE_VIDEOENCODERCAPAITF,
+    ENGINE_ITFCOUNT
+} XAEngineInterfaces;
+
+/** STRUCTURES **/
+/* Specification for XAEngineImpl.
+ */
+typedef struct XAEngineImpl_
+{
+    /* Parent for XAEngineImpl */
+    XAObjectItfImpl baseObj;
+
+    /* engine variables */
+    XAboolean isThreadSafe;
+
+    //actual adpatation context can point to either MMF or GST implementations
+    void* adaptationGstCtx;
+    void* adaptationMmfCtx;
+} XAEngineImpl;
+
+/** METHODS **/
+
+/* base object XAObjectItfImpl methods */
+XAresult XAEngineImpl_DoRealize(XAObjectItf self);
+XAresult XAEngineImpl_DoResume(XAObjectItf self);
+void XAEngineImpl_FreeResources(XAObjectItf self);
+
+/* XAEngineImpl -specific methods */
+
+#endif /* XAENGINE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaengineitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,516 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xaengineitf.h"
+#include "xavibraitf.h"
+#include "xaledarrayitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAStaticCapsAdaptation.h"
+#endif
+
+/*static XAchar implementationText[] = "Implementation does not conform to AL Spec";*/
+
+
+/**
+ * Base interface XAEngineItf implementation
+ */
+XAresult XAEngineItfImpl_CreateCameraDevice(XAEngineItf self,
+                                            XAObjectItf *pDevice,
+                                            XAuint32 deviceID,
+                                            XAuint32 numInterfaces,
+                                            const XAInterfaceID *pInterfaceIds,
+                                            const XAboolean *pInterfaceRequired)
+{
+    return XACameraDeviceImpl_CreateCameraDevice( pDevice, deviceID,numInterfaces,
+                                                  pInterfaceIds, pInterfaceRequired );
+}
+
+XAresult XAEngineItfImpl_CreateRadioDevice(XAEngineItf self,
+                                            XAObjectItf *pDevice,
+                                            XAuint32 numInterfaces,
+                                            const XAInterfaceID *pInterfaceIds,
+                                            const XAboolean *pInterfaceRequired)
+{
+    return XARadioDeviceImpl_CreateRadioDevice( pDevice, numInterfaces,
+                                                pInterfaceIds, pInterfaceRequired );
+}
+
+XAresult XAEngineItfImpl_CreateLEDDevice(XAEngineItf self,
+                                         XAObjectItf *pDevice,
+                                         XAuint32 deviceID,
+                                         XAuint32 numInterfaces,
+                                         const XAInterfaceID *pInterfaceIds,
+                                         const XAboolean *pInterfaceRequired)
+{
+    return XALEDArrayDeviceImpl_CreateLEDArrayDevice( pDevice, deviceID, numInterfaces,
+                                                      pInterfaceIds, pInterfaceRequired );
+}
+
+XAresult XAEngineItfImpl_CreateVibraDevice(XAEngineItf self,
+                                           XAObjectItf *pDevice,
+                                           XAuint32 deviceID,
+                                           XAuint32 numInterfaces,
+                                           const XAInterfaceID *pInterfaceIds,
+                                           const XAboolean *pInterfaceRequired)
+{
+    return XAVibraDeviceImpl_CreateVibraDevice( pDevice, deviceID, numInterfaces,
+                                                pInterfaceIds, pInterfaceRequired);
+}
+
+XAresult XAEngineItfImpl_CreateMediaPlayer(XAEngineItf self,
+                                           XAObjectItf *pPlayer,
+                                           XADataSource *pDataSrc,
+                                           XADataSource *pBankSrc,
+                                           XADataSink *pAudioSnk,
+                                           XADataSink *pImageVideoSnk,
+                                           XADataSink *pVibra,
+                                           XADataSink *pLEDArray,
+                                           XAuint32 numInterfaces,
+                                           const XAInterfaceID *pInterfaceIds,
+                                           const XAboolean *pInterfaceRequired)
+{
+    return XAMediaPlayerImpl_CreateMediaPlayer(pPlayer, pDataSrc, pBankSrc, pAudioSnk,
+                                             pImageVideoSnk, pVibra, pLEDArray,
+                                             numInterfaces, pInterfaceIds, pInterfaceRequired);
+}
+
+XAresult XAEngineItfImpl_CreateMediaRecorder(XAEngineItf self,
+                                             XAObjectItf * pRecorder,
+                                             XADataSource * pAudioSrc,
+                                             XADataSource * pImageVideoSrc,
+                                             XADataSink * pDataSnk,
+                                             XAuint32 numInterfaces,
+                                             const XAInterfaceID * pInterfaceIds,
+                                             const XAboolean * pInterfaceRequired)
+{
+    return XAMediaRecorderImpl_CreateMediaRecorder(pRecorder, pAudioSrc, pImageVideoSrc, pDataSnk,
+                                                   numInterfaces, pInterfaceIds, pInterfaceRequired);
+}
+
+XAresult XAEngineItfImpl_CreateOutputMix(XAEngineItf self,
+                                         XAObjectItf *pMix,
+                                         XAuint32 numInterfaces,
+                                         const XAInterfaceID *pInterfaceIds,
+                                         const XAboolean *pInterfaceRequired)
+{
+    return XAOMixImpl_CreateOutputMix(pMix, numInterfaces,
+                                      pInterfaceIds, pInterfaceRequired);
+}
+
+XAresult XAEngineItfImpl_CreateMetadataExtractor(XAEngineItf self,
+                                                 XAObjectItf *pMetadataExtractor,
+                                                 XADataSource *pDataSource,
+                                                 XAuint32 numInterfaces,
+                                                 const XAInterfaceID *pInterfaceIds,
+                                                 const XAboolean *pInterfaceRequired)
+{
+    return XAMetadataExtractorImpl_Create(pMetadataExtractor, pDataSource,
+                                          numInterfaces, pInterfaceIds, pInterfaceRequired);
+}
+
+XAresult XAEngineItfImpl_CreateExtensionObject(XAEngineItf self,
+                                               XAObjectItf *pObject,
+                                               void *pParameters,
+                                               XAuint32 objectID,
+                                               XAuint32 numInterfaces,
+                                               const XAInterfaceID *pInterfaceIds,
+                                               const XAboolean *pInterfaceRequired)
+{
+    DEBUG_API("->XAEngineItfImpl_CreateExtensionObject");
+    /* no supported extensions */
+    DEBUG_API("<-XAEngineItfImpl_CreateExtensionObject - XA_RESULT_FEATURE_UNSUPPORTED");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+}
+
+XAresult XAEngineItfImpl_GetImplementationInfo(XAEngineItf self,
+                                               XAuint32 *pMajor,
+                                               XAuint32 *pMinor,
+                                               XAuint32 *pStep,
+                                               const XAchar *pImplementationText)
+{
+    DEBUG_API("->XAEngineItfImpl_GetImplementationInfo");
+
+    if( !pMajor || !pMinor || !pStep )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEngineItfImpl_GetImplementationInfo");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    /* OpenMAX AL API ver 1.0.1 */
+    *pMajor = 1;
+    *pMinor = 0;
+    *pStep = 1;
+    /*pImplementationText = (XAchar *) implementationText;*/
+
+    DEBUG_API("<-XAEngineItfImpl_GetImplementationInfo");
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XAEngineItfImpl_QuerySupportedProfiles(XAEngineItf self,
+                                                XAint16 *pProfilesSupported)
+{
+    DEBUG_API("->XAEngineItfImpl_QuerySupportedProfiles");
+
+    if( !pProfilesSupported )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEngineItfImpl_QuerySupportedProfiles");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    /* NOTE: enable +MIDI when/if XMF issues solved
+     *        XA_PROFILES_MEDIA_PLAYER |
+     *        XA_PROFILES_MEDIA_PLAYER_RECORDER |
+     *        XA_PROFILES_PLUS_MIDI;
+     */
+    *pProfilesSupported = XA_PROFILES_MEDIA_PLAYER | XA_PROFILES_MEDIA_PLAYER_RECORDER;
+
+    DEBUG_API("<-XAEngineItfImpl_QuerySupportedProfiles");
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XAEngineItfImpl_QueryNumSupportedInterfaces(XAEngineItf self,
+                                                     XAuint32 objectID,
+                                                     XAuint32 *pNumSupportedInterfaces)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAEngineItfImpl_QueryNumSupportedInterfaces");
+
+    if( !pNumSupportedInterfaces )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEngineItfImpl_QueryNumSupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    *pNumSupportedInterfaces=0;
+    switch(objectID)
+    {
+        case XA_OBJECTID_ENGINE:
+            res = XAEngineImpl_QueryNumSupportedInterfaces(
+                                            pNumSupportedInterfaces);
+            break;
+        case XA_OBJECTID_MEDIAPLAYER:
+            res = XAMediaPlayerImpl_QueryNumSupportedInterfaces(
+                                            pNumSupportedInterfaces);
+            break;
+        case XA_OBJECTID_MEDIARECORDER:
+            res = XAMediaRecorderImpl_QueryNumSupportedInterfaces(
+                                            pNumSupportedInterfaces);
+            break;
+        case XA_OBJECTID_OUTPUTMIX:
+            res = XAOMixImpl_QueryNumSupportedInterfaces(
+                                            pNumSupportedInterfaces);
+            break;
+        case XA_OBJECTID_CAMERADEVICE:
+            res = XACameraDeviceImpl_QueryNumSupportedInterfaces(
+                                            pNumSupportedInterfaces);
+            break;
+        case XA_OBJECTID_RADIODEVICE:
+            res = XARadioDeviceImpl_QueryNumSupportedInterfaces(
+                                            pNumSupportedInterfaces);
+            break;
+        case XA_OBJECTID_LEDDEVICE:
+            res = XALEDArrayDeviceImpl_QueryNumSupportedInterfaces(
+                                            pNumSupportedInterfaces);
+            break;
+        case XA_OBJECTID_VIBRADEVICE:
+            res = XAVibraDeviceImpl_QueryNumSupportedInterfaces(
+                                            pNumSupportedInterfaces);
+            break;
+        case XA_OBJECTID_METADATAEXTRACTOR:
+            res = XAMetadataExtractorImpl_QueryNumSupportedInterfaces(
+                                            pNumSupportedInterfaces);
+            break;
+        default:
+            res = XA_RESULT_FEATURE_UNSUPPORTED;
+            break;
+    }
+
+    DEBUG_API_A1("<-XAEngineItfImpl_QueryNumSupportedInterfaces %lu",res);
+    return res;
+}
+
+XAresult XAEngineItfImpl_QuerySupportedInterfaces(XAEngineItf self,
+                                                  XAuint32 objectID,
+                                                  XAuint32 index,
+                                                  XAInterfaceID *pInterfaceId)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAEngineItfImpl_QuerySupportedInterfaces");
+
+    if( !pInterfaceId )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEngineItfImpl_QuerySupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    *pInterfaceId = XA_IID_NULL;
+    switch (objectID)
+    {
+        case XA_OBJECTID_ENGINE:
+            res = XAEngineImpl_QuerySupportedInterfaces(
+                                                index, pInterfaceId);
+            break;
+        case XA_OBJECTID_MEDIAPLAYER:
+            res = XAMediaPlayerImpl_QuerySupportedInterfaces(
+                                                index, pInterfaceId);
+            break;
+        case XA_OBJECTID_MEDIARECORDER:
+            res = XAMediaRecorderImpl_QuerySupportedInterfaces(
+                                                index, pInterfaceId);
+            break;
+        case XA_OBJECTID_OUTPUTMIX:
+            res = XAOMixImpl_QuerySupportedInterfaces(
+                                                index, pInterfaceId);
+            break;
+        case XA_OBJECTID_CAMERADEVICE:
+            res = XACameraDeviceImpl_QuerySupportedInterfaces(
+                                                index, pInterfaceId );
+            break;
+        case XA_OBJECTID_RADIODEVICE:
+            res = XARadioDeviceImpl_QuerySupportedInterfaces(
+                                                index, pInterfaceId );
+            break;
+        case XA_OBJECTID_LEDDEVICE:
+            res = XALEDArrayDeviceImpl_QuerySupportedInterfaces(
+                                                index, pInterfaceId );
+            break;
+        case XA_OBJECTID_VIBRADEVICE:
+            res = XAVibraDeviceImpl_QuerySupportedInterfaces(
+                                                index, pInterfaceId );
+            break;
+        case XA_OBJECTID_METADATAEXTRACTOR:
+            res = XAMetadataExtractorImpl_QuerySupportedInterfaces(
+                                                index, pInterfaceId);
+            break;
+        default:
+            res = XA_RESULT_FEATURE_UNSUPPORTED;
+    }
+
+    DEBUG_API_A1("<-XAEngineItfImpl_QuerySupportedInterfaces %lu", res);
+    return res;
+}
+
+XAresult XAEngineItfImpl_QueryLEDCapabilities(XAEngineItf self,
+                                              XAuint32 *pIndex,
+                                              XAuint32 *pLEDDeviceID,
+                                              XALEDDescriptor *pDescriptor)
+{
+#ifdef _GSTREAMER_BACKEND_  
+    XALEDDescriptor descriptor;
+#endif    
+    DEBUG_API("->XAEngineItfImpl_QueryLEDCapabilities");
+
+    if( !pDescriptor )
+    {   /*query number of devices*/
+        if( !pIndex )
+        {
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("<-XAEngineItfImpl_QueryLEDCapabilities");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+        /* Number of devices */
+        *pIndex = 1;
+    }
+    else
+    {   
+#ifdef _GSTREAMER_BACKEND_  
+        /* query device capabilities */
+        if( pIndex )
+        {
+            if( *pIndex == 0 )
+            {
+                if( !pLEDDeviceID )
+                {
+                    DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+                    DEBUG_API("<-XAEngineItfImpl_QueryLEDCapabilities");
+                    return XA_RESULT_PARAMETER_INVALID;
+                }
+                *pLEDDeviceID = XA_ADAPTID_LEDARRAY;
+            }
+            else
+            {
+                DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+                DEBUG_API("<-XAEngineItfImpl_QueryLEDCapabilities");
+                return XA_RESULT_PARAMETER_INVALID;
+            }
+        }
+
+        if( *pLEDDeviceID == XA_ADAPTID_LEDARRAY )
+        {
+            descriptor.colorMask = COLOR_MASK;
+            descriptor.ledCount = LED_COUNT;
+            descriptor.primaryLED = PRIMARY_LED;
+            *pDescriptor = descriptor;
+        }
+#endif        
+    }
+    DEBUG_API("<-XAEngineItfImpl_QueryLEDCapabilities");
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XAEngineItfImpl_QueryVibraCapabilities(XAEngineItf self,
+                                                XAuint32 *pIndex,
+                                                XAuint32 *pVibraDeviceID,
+                                                XAVibraDescriptor *pDescriptor)
+{
+#ifdef _GSTREAMER_BACKEND_  
+    XAVibraDescriptor descriptor;
+#endif
+    DEBUG_API("->XAEngineItfImpl_QueryVibraCapabilities");
+
+    if( !pDescriptor  )
+    {   /*query number of devices*/
+        if( !pIndex )
+        {
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("<-XAEngineItfImpl_QueryVibraCapabilities");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+        /* Number of devices */
+        *pIndex = 1;
+    }
+    else
+    {   
+#ifdef _GSTREAMER_BACKEND_  
+        /* query device capabilities */
+        if( pIndex )
+        {
+            if( *pIndex == 0 )
+            {
+                if( !pVibraDeviceID )
+                {
+                    DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+                    DEBUG_API("<-XAEngineItfImpl_QueryVibraCapabilities");
+                    return XA_RESULT_PARAMETER_INVALID;
+                }
+
+                *pVibraDeviceID = XA_ADAPTID_VIBRA;
+            }
+            else
+            {
+                DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+                DEBUG_API("<-XAEngineItfImpl_QueryVibraCapabilities");
+                return XA_RESULT_PARAMETER_INVALID;
+            }
+        }
+
+        if( *pVibraDeviceID == XA_ADAPTID_VIBRA )
+        {
+            descriptor.minFrequency = MIN_FREQUENCY;
+            descriptor.maxFrequency = MAX_FREQUENCY;
+            descriptor.supportsFrequency = XA_BOOLEAN_TRUE;
+            descriptor.supportsIntensity = XA_BOOLEAN_TRUE;
+            *pDescriptor = descriptor;
+        }
+#endif        
+    }
+
+    DEBUG_API("<-XAEngineItfImpl_QueryVibraCapabilities");
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XAEngineItfImpl_QueryNumSupportedExtensions(XAEngineItf self,
+                                                     XAuint32 *pNumExtensions)
+{
+    DEBUG_API("->XAEngineItfImpl_QuerySupportedExtension");
+    if(pNumExtensions==NULL)
+    {
+       DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+       DEBUG_API("<-XAEngineItfImpl_QuerySupportedExtension");
+       return XA_RESULT_PARAMETER_INVALID;
+    }
+    /* no supported extensions */
+    *pNumExtensions=0;
+    DEBUG_API("<-XAEngineItfImpl_QuerySupportedExtension");
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XAEngineItfImpl_QuerySupportedExtension(XAEngineItf self,
+                                               XAuint32 index,
+                                               XAchar *pExtensionName,
+                                               XAint16 *pNameLength)
+{
+    DEBUG_API("->XAEngineItfImpl_QuerySupportedExtension");
+    /* no supported extensions => index is always wrong */
+    DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+    DEBUG_API("<-XAEngineItfImpl_QuerySupportedExtension");
+    return XA_RESULT_PARAMETER_INVALID;
+}
+
+XAresult XAEngineItfImpl_IsExtensionSupported(XAEngineItf self,
+                                            const XAchar *pExtensionName,
+                                            XAboolean *pSupported)
+{
+    DEBUG_API("->XAEngineItfImpl_IsExtensionSupported");
+    if(pSupported==NULL)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAEngineItfImpl_IsExtensionSupported");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    /* no supported extensions */
+    *pSupported=XA_BOOLEAN_FALSE;
+    DEBUG_API("<-XAEngineItfImpl_IsExtensionSupported");
+    return XA_RESULT_SUCCESS;
+}
+
+/**
+ * XAEngineItfImpl -specific methods
+ **/
+XAEngineItfImpl* XAEngineItfImpl_Create()
+{
+    XAEngineItfImpl* self = (XAEngineItfImpl*)
+        calloc(1,sizeof(XAEngineItfImpl));
+    DEBUG_API("->XAEngineItfImpl_Create");
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.CreateCameraDevice = XAEngineItfImpl_CreateCameraDevice;
+        self->itf.CreateRadioDevice = XAEngineItfImpl_CreateRadioDevice;
+        self->itf.CreateLEDDevice = XAEngineItfImpl_CreateLEDDevice;
+        self->itf.CreateVibraDevice = XAEngineItfImpl_CreateVibraDevice;
+        self->itf.CreateMediaPlayer = XAEngineItfImpl_CreateMediaPlayer;
+        self->itf.CreateMediaRecorder = XAEngineItfImpl_CreateMediaRecorder;
+        self->itf.CreateOutputMix = XAEngineItfImpl_CreateOutputMix;
+        self->itf.CreateMetadataExtractor = XAEngineItfImpl_CreateMetadataExtractor;
+        self->itf.CreateExtensionObject = XAEngineItfImpl_CreateExtensionObject;
+        self->itf.GetImplementationInfo = XAEngineItfImpl_GetImplementationInfo;
+        self->itf.QuerySupportedProfiles = XAEngineItfImpl_QuerySupportedProfiles;
+        self->itf.QueryNumSupportedInterfaces = XAEngineItfImpl_QueryNumSupportedInterfaces;
+        self->itf.QuerySupportedInterfaces = XAEngineItfImpl_QuerySupportedInterfaces;
+        self->itf.QueryLEDCapabilities = XAEngineItfImpl_QueryLEDCapabilities;
+        self->itf.QueryVibraCapabilities = XAEngineItfImpl_QueryVibraCapabilities;
+        self->itf.QueryNumSupportedExtensions = XAEngineItfImpl_QueryNumSupportedExtensions;
+        self->itf.QuerySupportedExtension = XAEngineItfImpl_QuerySupportedExtension;
+        self->itf.IsExtensionSupported = XAEngineItfImpl_IsExtensionSupported;
+        self->self = self;
+    }
+    DEBUG_API("<-XAEngineItfImpl_Create");
+    return self;
+}
+
+void XAEngineItfImpl_Free(XAEngineItfImpl* self)
+{
+    DEBUG_API("->XAEngineItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAEngineItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaengineitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAENGINEITF_H
+#define XAENGINEITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAEngineItf implementation */
+typedef struct XAEngineItfImpl_
+{
+    /* parent interface */
+    struct XAEngineItf_ itf;
+    /* pointer to self */
+    struct XAEngineItfImpl_* self;
+    /* variables */
+} XAEngineItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAEngineItf implementation */
+XAresult XAEngineItfImpl_CreateCameraDevice(XAEngineItf self,
+                                            XAObjectItf *pDevice,
+                                            XAuint32 deviceID,
+                                            XAuint32 numInterfaces,
+                                            const XAInterfaceID *pInterfaceIds,
+                                            const XAboolean *pInterfaceRequired);
+
+XAresult XAEngineItfImpl_CreateRadioDevice(XAEngineItf self,
+                                           XAObjectItf *pDevice,
+                                           XAuint32 numInterfaces,
+                                           const XAInterfaceID *pInterfaceIds,
+                                           const XAboolean *pInterfaceRequired);
+
+
+XAresult XAEngineItfImpl_CreateLEDDevice(XAEngineItf self,
+                                         XAObjectItf *pDevice,
+                                         XAuint32 deviceID,
+                                         XAuint32 numInterfaces,
+                                         const XAInterfaceID *pInterfaceIds,
+                                         const XAboolean *pInterfaceRequired);
+
+XAresult XAEngineItfImpl_CreateVibraDevice(XAEngineItf self,
+                                           XAObjectItf *pDevice,
+                                           XAuint32 deviceID,
+                                           XAuint32 numInterfaces,
+                                           const XAInterfaceID *pInterfaceIds,
+                                           const XAboolean *pInterfaceRequired);
+
+XAresult XAEngineItfImpl_CreateMediaPlayer(XAEngineItf self,
+                                           XAObjectItf *pPlayer,
+                                           XADataSource *pDataSrc,
+                                           XADataSource *pBankSrc,
+                                           XADataSink *pAudioSnk,
+                                           XADataSink *pImageVideoSnk,
+                                           XADataSink *pVibra,
+                                           XADataSink *pLEDArray,
+                                           XAuint32 numInterfaces,
+                                           const XAInterfaceID *pInterfaceIds,
+                                           const XAboolean *pInterfaceRequired);
+
+XAresult XAEngineItfImpl_CreateMediaRecorder(XAEngineItf self,
+                                             XAObjectItf *pRecorder,
+                                             XADataSource *pAudioSrc,
+                                             XADataSource *pImageVideoSrc,
+                                             XADataSink *pDataSnk,
+                                             XAuint32 numInterfaces,
+                                             const XAInterfaceID *pInterfaceIds,
+                                             const XAboolean *pInterfaceRequired);
+
+XAresult XAEngineItfImpl_CreateOutputMix(XAEngineItf self,
+                                         XAObjectItf *pMix,
+                                         XAuint32 numInterfaces,
+                                         const XAInterfaceID *pInterfaceIds,
+                                         const XAboolean *pInterfaceRequired);
+
+XAresult XAEngineItfImpl_CreateMetadataExtractor(XAEngineItf self,
+                                                 XAObjectItf *pMetadataExtractor,
+                                                 XADataSource *pDataSource,
+                                                 XAuint32 numInterfaces,
+                                                 const XAInterfaceID *pInterfaceIds,
+                                                 const XAboolean *pInterfaceRequired);
+
+XAresult XAEngineItfImpl_CreateExtensionObject(XAEngineItf self,
+                                               XAObjectItf *pObject,
+                                               void *pParameters,
+                                               XAuint32 objectID,
+                                               XAuint32 numInterfaces,
+                                               const XAInterfaceID *pInterfaceIds,
+                                               const XAboolean *pInterfaceRequired);
+
+XAresult XAEngineItfImpl_GetImplementationInfo(XAEngineItf self,
+                                               XAuint32 *pMajor,
+                                               XAuint32 *pMinor,
+                                               XAuint32 *pStep,
+                                               const XAchar *pImplementationText);
+
+XAresult XAEngineItfImpl_QuerySupportedProfiles(XAEngineItf self,
+                                                XAint16 *pProfilesSupported);
+
+XAresult XAEngineItfImpl_QueryNumSupportedInterfaces(XAEngineItf self,
+                                                     XAuint32 objectID,
+                                                     XAuint32 *pNumSupportedInterfaces);
+
+XAresult XAEngineItfImpl_QuerySupportedInterfaces(XAEngineItf self,
+                                                  XAuint32 objectID,
+                                                  XAuint32 index,
+                                                  XAInterfaceID *pInterfaceId);
+
+XAresult XAEngineItfImpl_QueryLEDCapabilities(XAEngineItf self,
+                                              XAuint32 *pIndex,
+                                              XAuint32 *pLEDDeviceID,
+                                              XALEDDescriptor *pDescriptor);
+
+XAresult XAEngineItfImpl_QueryVibraCapabilities(XAEngineItf self,
+                                                XAuint32 *pIndex,
+                                                XAuint32 *pVibraDeviceID,
+                                                XAVibraDescriptor *pDescriptor);
+
+XAresult XAEngineItfImpl_QueryNumSupportedExtensions(XAEngineItf self,
+                                                     XAuint32 *pNumExtensions);
+
+XAresult XAEngineItfImpl_QuerySupportedExtension(XAEngineItf self,
+                                                 XAuint32 index,
+                                                 XAchar *pExtensionName,
+                                                 XAint16 *pNameLength);
+
+XAresult XAEngineItfImpl_IsExtensionSupported(XAEngineItf self,
+                                              const XAchar *pExtensionName,
+                                              XAboolean *pSupported);
+
+/* XAEngineItfImpl -specific methods */
+XAEngineItfImpl* XAEngineItfImpl_Create(void);
+void XAEngineItfImpl_Free(XAEngineItfImpl *self);
+
+#endif /* XAENGINEITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaimagedecodercapabilitiesitf.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+#include "xaglobals.h"
+#include "xaimagedecodercapabilitiesitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAStaticCapsAdaptation.h"
+#endif
+/* XAImageDecoderCapabilitiesItfImpl* GetImpl
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XAImageDecoderCapabilitiesItfImpl* GetImpl(XAImageDecoderCapabilitiesItf self)
+{
+    if( self )
+    {
+        XAImageDecoderCapabilitiesItfImpl* impl = (XAImageDecoderCapabilitiesItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAImageDecoderCapabilitiesItf implementation
+ **/
+
+/* XAresult XAImageDecoderCapabilitiesItfImpl_GetImageDecoderCapabilities
+ * Description: Retrieves image decoder capabilities.
+ */
+XAresult XAImageDecoderCapabilitiesItfImpl_GetImageDecoderCapabilities(
+                            XAImageDecoderCapabilitiesItf self,
+                            XAuint32* pDecoderId,
+                            XAImageCodecDescriptor* pDescriptor)
+{
+    XAImageDecoderCapabilitiesItfImpl* impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAImageDecoderCapabilitiesItfImpl_GetImageDecoderCapabilities");
+
+    impl = GetImpl(self);
+    if( !impl || !pDecoderId )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if( !pDescriptor )
+        {   /* query number of image decoders */
+            *pDecoderId = impl->numCodecs;
+        }
+        else
+        {
+            /* query capabilities from adaptation using codec id */
+#ifdef _GSTREAMER_BACKEND_  
+            XAStaticCapsData temp;
+            memset(pDescriptor,0,sizeof(XAImageCodecDescriptor));
+            /* here pEncoderId refers to index rather than codec id */
+            res = XAStaticCapsAdapt_GetCapsByIdx(XACAP_DECODER|XACAP_IMAGE, *pDecoderId, &temp);
+            if( res == XA_RESULT_SUCCESS )
+            {
+                /* map applicable values to XAAudioCodecCapabilities */
+                pDescriptor->codecId = temp.xaid;
+                pDescriptor->maxWidth = temp.maxW;
+                pDescriptor->maxHeight = temp.maxH;
+            }
+#endif
+        }
+    }
+
+    DEBUG_API("<-XAImageDecoderCapabilitiesItfImpl_GetImageDecoderCapabilities");
+    return res;
+}
+
+/* XAresult XAImageDecoderCapabilitiesItfImpl_QueryColorFormats
+ * Description: This method is used to query the color formats supported
+ *              by the image decoder.
+ */
+XAresult XAImageDecoderCapabilitiesItfImpl_QueryColorFormats(
+                            const XAImageDecoderCapabilitiesItf self,
+                            XAuint32* pIndex,
+                            XAuint32* pColorFormats)
+{
+    XAImageDecoderCapabilitiesItfImpl* impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAImageDecoderCapabilitiesItfImpl_QueryColorFormats");
+    impl = GetImpl(self);
+    if( !impl || !pIndex )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+        res = XAStaticCapsAdapt_QueryColorFormats(pIndex, pColorFormats);
+#endif        
+    }
+    DEBUG_API("<-XAImageDecoderCapabilitiesItfImpl_QueryColorFormats");
+    return res;
+}
+
+/**
+ * XAImageDecoderCapabilitiesItfImpl -specific methods
+ **/
+
+/* XAImageDecoderCapabilitiesItfImpl_Create
+ * Description: Allocate and initialize XAImageDecoderCapabilitiesItfImpl
+ */
+XAImageDecoderCapabilitiesItfImpl* XAImageDecoderCapabilitiesItfImpl_Create()
+{
+    XAImageDecoderCapabilitiesItfImpl* self = (XAImageDecoderCapabilitiesItfImpl*)
+        calloc(1,sizeof(XAImageDecoderCapabilitiesItfImpl));
+    DEBUG_API("->XAImageDecoderCapabilitiesItfImpl_Create");
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.GetImageDecoderCapabilities =
+            XAImageDecoderCapabilitiesItfImpl_GetImageDecoderCapabilities;
+        self->itf.QueryColorFormats =
+            XAImageDecoderCapabilitiesItfImpl_QueryColorFormats;
+
+#ifdef _GSTREAMER_BACKEND_  
+        /* init variables */
+        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_DECODER|XACAP_IMAGE,
+                                  &(self->numCodecs) ) == XA_RESULT_SUCCESS );
+#endif
+        self->self = self;
+    }
+    DEBUG_API("<-XAImageDecoderCapabilitiesItfImpl_Create");
+    return self;
+}
+
+/* void XAImageDecoderCapabilitiesItfImpl_Free
+ * Description: Free all resources reserved at XAImageDecoderCapabilitiesItfImpl
+ */
+void XAImageDecoderCapabilitiesItfImpl_Free(XAImageDecoderCapabilitiesItfImpl* self)
+{
+    DEBUG_API("->XAImageDecoderCapabilitiesItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAImageDecoderCapabilitiesItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaimagedecodercapabilitiesitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAIMAGEDECODERCAPABILITIESITF_H
+#define XAIMAGEDECODERCAPABILITIESITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAImageDecoderCapabilitiesItf implementation */
+typedef struct XAImageDecoderCapabilitiesItfImpl_
+{
+    /* parent interface */
+    struct XAImageDecoderCapabilitiesItf_ itf;
+    /* pointer to self */
+    struct XAImageDecoderCapabilitiesItfImpl_* self;
+    /* variables */
+    XAuint32 numCodecs;
+} XAImageDecoderCapabilitiesItfImpl;
+
+/* Base interface XAImageDecoderCapabilitiesItf implementation */
+XAresult XAImageDecoderCapabilitiesItfImpl_GetImageDecoderCapabilities(
+                            XAImageDecoderCapabilitiesItf self,
+                            XAuint32* pDecoderId,
+                            XAImageCodecDescriptor* pDescriptor);
+
+XAresult XAImageDecoderCapabilitiesItfImpl_QueryColorFormats(
+                            const XAImageDecoderCapabilitiesItf self,
+                            XAuint32* pIndex,
+                            XAuint32* pColorFormats);
+
+/* XAImageDecoderCapabilitiesItfImpl -specific methods */
+XAImageDecoderCapabilitiesItfImpl* XAImageDecoderCapabilitiesItfImpl_Create(void);
+void XAImageDecoderCapabilitiesItfImpl_Free(XAImageDecoderCapabilitiesItfImpl* self);
+
+#endif /* XAIMAGEDECODERCAPABILITIESITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaimageencodercapabilitiesitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,165 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include "xaglobals.h"
+#include "xaimageencodercapabilitiesitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAStaticCapsAdaptation.h"
+#endif
+/* XAImageEncoderCapabilitiesItfImpl* GetImpl
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XAImageEncoderCapabilitiesItfImpl* GetImpl(XAImageEncoderCapabilitiesItf self)
+{
+    if( self )
+    {
+        XAImageEncoderCapabilitiesItfImpl* impl = (XAImageEncoderCapabilitiesItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAImageEncoderCapabilitiesItf implementation
+ **/
+
+/* XAresult XAImageEncoderCapabilitiesItfImpl_GetImageEncoderCapabilities
+ * Description: Retrieves image encoder capabilities.
+ */
+XAresult XAImageEncoderCapabilitiesItfImpl_GetImageEncoderCapabilities(
+                            XAImageEncoderCapabilitiesItf self,
+                            XAuint32* pEncoderId,
+                            XAImageCodecDescriptor* pDescriptor)
+{
+    XAImageEncoderCapabilitiesItfImpl* impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAImageEncoderCapabilitiesItfImpl_GetImageEncoderCapabilities");
+
+    impl = GetImpl(self);
+
+    if( !impl || !pEncoderId )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if( !pDescriptor )
+        {   /* query number of image encoders */
+            *pEncoderId = impl->numCodecs;
+        }
+        else
+        {
+            /* query capabilities from adaptation using codec id */
+#ifdef _GSTREAMER_BACKEND_  
+            XAStaticCapsData temp;
+            memset(pDescriptor,0,sizeof(XAImageCodecDescriptor));
+            /* here pEncoderId refers to index rather than codec id */
+            res = XAStaticCapsAdapt_GetCapsByIdx(XACAP_ENCODER|XACAP_IMAGE, *pEncoderId, &temp);
+            if( res == XA_RESULT_SUCCESS )
+            {
+                /* map applicable values to XAAudioCodecCapabilities */
+                pDescriptor->codecId = temp.xaid;
+                pDescriptor->maxWidth = temp.maxW;
+                pDescriptor->maxHeight = temp.maxH;
+            }
+#endif
+        }
+    }
+
+    DEBUG_API("<-XAImageEncoderCapabilitiesItfImpl_GetImageEncoderCapabilities");
+    return res;
+}
+
+/* XAresult XAImageEncoderCapabilitiesItfImpl_QueryColorFormats
+ * Description: This method is used to query the color formats supported
+ *              by the image encoder.
+ */
+XAresult XAImageEncoderCapabilitiesItfImpl_QueryColorFormats(
+                            const XAImageEncoderCapabilitiesItf self,
+                            XAuint32* pIndex,
+                            XAuint32* pColorFormats)
+{
+    XAImageEncoderCapabilitiesItfImpl* impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAImageEncoderCapabilitiesItfImpl_QueryColorFormats");
+
+    impl = GetImpl(self);
+    if( !impl || !pIndex )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+        res = XAStaticCapsAdapt_QueryColorFormats(pIndex, pColorFormats);
+#endif        
+    }
+    DEBUG_API("<-XAImageEncoderCapabilitiesItfImpl_QueryColorFormats");
+    return res;
+}
+
+/**
+ * XAImageEncoderCapabilitiesItfImpl -specific methods
+ **/
+
+/* XAImageEncoderCapabilitiesItfImpl_Create
+ * Description: Allocate and initialize XAImageEncoderCapabilitiesItfImpl
+ */
+XAImageEncoderCapabilitiesItfImpl* XAImageEncoderCapabilitiesItfImpl_Create()
+{
+    XAImageEncoderCapabilitiesItfImpl* self = (XAImageEncoderCapabilitiesItfImpl*)
+        calloc(1,sizeof(XAImageEncoderCapabilitiesItfImpl));
+    DEBUG_API("->XAImageEncoderCapabilitiesItfImpl_Create");
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.GetImageEncoderCapabilities =
+            XAImageEncoderCapabilitiesItfImpl_GetImageEncoderCapabilities;
+        self->itf.QueryColorFormats =
+            XAImageEncoderCapabilitiesItfImpl_QueryColorFormats;
+
+#ifdef _GSTREAMER_BACKEND_  
+        /* init variables */
+        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_ENCODER|XACAP_IMAGE,
+                                  &(self->numCodecs) ) == XA_RESULT_SUCCESS );
+#endif
+        self->self = self;
+    }
+    DEBUG_API("<-XAImageEncoderCapabilitiesItfImpl_Create");
+    return self;
+}
+
+/* void XAImageEncoderCapabilitiesItfImpl_Free
+ * Description: Free all resources reserved at XAImageEncoderCapabilitiesItfImpl
+ */
+void XAImageEncoderCapabilitiesItfImpl_Free(XAImageEncoderCapabilitiesItfImpl* self)
+{
+    DEBUG_API("->XAImageEncoderCapabilitiesItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAImageEncoderCapabilitiesItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xaimageencodercapabilitiesitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAIMAGEENCODERCAPABILITIESITF_H
+#define XAIMAGEENCODERCAPABILITIESITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAImageEncoderCapabilitiesItf implementation */
+typedef struct XAImageEncoderCapabilitiesItfImpl_
+{
+    /* parent interface */
+    struct XAImageEncoderCapabilitiesItf_ itf;
+    /* pointer to self */
+    struct XAImageEncoderCapabilitiesItfImpl_* self;
+    /* variables */
+    XAuint32 numCodecs;
+} XAImageEncoderCapabilitiesItfImpl;
+
+/* Base interface XAImageEncoderCapabilitiesItf implementation */
+XAresult XAImageEncoderCapabilitiesItfImpl_GetImageEncoderCapabilities(
+                            XAImageEncoderCapabilitiesItf self,
+                            XAuint32* pEncoderId,
+                            XAImageCodecDescriptor* pDescriptor);
+
+XAresult XAImageEncoderCapabilitiesItfImpl_QueryColorFormats(
+                            const XAImageEncoderCapabilitiesItf self,
+                            XAuint32* pIndex,
+                            XAuint32* pColorFormats);
+
+/* XAImageEncoderCapabilitiesItfImpl -specific methods */
+XAImageEncoderCapabilitiesItfImpl* XAImageEncoderCapabilitiesItfImpl_Create(void);
+void XAImageEncoderCapabilitiesItfImpl_Free(XAImageEncoderCapabilitiesItfImpl* self);
+
+#endif /* XAIMAGEENCODERCAPABILITIESITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xathreadsyncitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,134 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "xathreadsyncitf.h"
+
+/**
+ * Base interface XAThreadSyncItf Implementation
+ */
+XAresult XAThreadSyncItfImpl_EnterCriticalSection(XAThreadSyncItf self)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAThreadSyncItfImpl* impl = NULL;
+
+    DEBUG_API("->XAThreadSyncItfImpl_EnterCriticalSection");
+
+    impl = (XAThreadSyncItfImpl*)(*self);
+    if( !impl || impl != impl->self )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAThreadSyncItfImpl_EnterCriticalSection");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( impl->engInCritical )
+    {
+        /* The calling context must not already be in
+           critical section state. */
+        DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+        ret = XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+    else
+    {
+        ret = XAImpl_LockMutex( impl->engCriticalSection );
+        if(ret == XA_RESULT_SUCCESS)
+        {
+            impl->engInCritical = XA_BOOLEAN_TRUE;
+        }
+    }
+    DEBUG_API("<-XAThreadSyncItfImpl_EnterCriticalSection");
+    return ret;
+}
+
+XAresult XAThreadSyncItfImpl_ExitCriticalSection(XAThreadSyncItf self)
+{
+    XAThreadSyncItfImpl* impl = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    impl = (XAThreadSyncItfImpl*)(*self);
+    DEBUG_API("->XAThreadSyncItfImpl_ExitCriticalSection");
+
+    if( !impl || impl != impl->self )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAThreadSyncItfImpl_ExitCriticalSection");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( impl->engInCritical  )
+    {
+        ret = XAImpl_UnlockMutex( impl->engCriticalSection );
+        if(ret == XA_RESULT_SUCCESS)
+        {
+            impl->engInCritical = XA_BOOLEAN_FALSE;
+        }
+    }
+    else
+    {
+        /* The engine must be in critical section state */
+        DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+        ret = XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+    DEBUG_API("<-XAThreadSyncItfImpl_ExitCriticalSection");
+    return ret;
+}
+
+/**
+ * XAThreadSyncItfImpl -specific methods
+ **/
+
+XAThreadSyncItfImpl* XAThreadSyncItfImpl_Create()
+{
+    XAThreadSyncItfImpl *self = NULL;
+    DEBUG_API("->XAThreadSyncItfImpl_Create");
+
+    self = (XAThreadSyncItfImpl*)calloc(1,sizeof(XAThreadSyncItfImpl));
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.EnterCriticalSection = XAThreadSyncItfImpl_EnterCriticalSection;
+        self->itf.ExitCriticalSection = XAThreadSyncItfImpl_ExitCriticalSection;
+
+        if( XAImpl_CreateMutex( &(self->engCriticalSection) )
+            != XA_RESULT_SUCCESS )
+        {
+            DEBUG_ERR("Mutex creation failed, abort");
+            free(self);
+            DEBUG_API("<-XAThreadSyncItfImpl_Create");
+            return NULL;
+        }
+
+        self->self = self;
+    }
+    DEBUG_API("<-XAThreadSyncItfImpl_Create");
+    return self;
+}
+
+void XAThreadSyncItfImpl_Free(XAThreadSyncItfImpl* self)
+{
+    DEBUG_API("->XAThreadSyncItfImpl_Free");
+    assert(self==self->self);
+    XAImpl_DeleteMutex(self->engCriticalSection);
+    free(self);
+    DEBUG_API("<-XAThreadSyncItfImpl_Free");
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xathreadsyncitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XATHREADSYNCITF_H
+#define XATHREADSYNCITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#include "xaplatform.h"
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XA%ExampleItf% implementation */
+typedef struct XAThreadSyncItfImpl_
+{
+    /* parent interface */
+    struct XAThreadSyncItf_ itf;
+    /* pointer to self */
+    struct XAThreadSyncItfImpl_* self;
+
+    /* variables */
+    XAImplMutexHandle engCriticalSection;
+    XAboolean engInCritical;
+} XAThreadSyncItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAThreadSyncItf implementation */
+XAresult XAThreadSyncItfImpl_EnterCriticalSection(XAThreadSyncItf self);
+XAresult XAThreadSyncItfImpl_ExitCriticalSection(XAThreadSyncItf self);
+
+/* XAThreadSyncItfImpl -specific methods */
+XAThreadSyncItfImpl* XAThreadSyncItfImpl_Create(void);
+void XAThreadSyncItfImpl_Free(XAThreadSyncItfImpl* self);
+
+#endif /* XATHREADSYNCITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xavideodecodercapabilitiesitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,202 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#include "xaglobals.h"
+#include "xavideodecodercapabilitiesitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAStaticCapsAdaptation.h"
+#endif
+/* XAVideoDecoderCapabilitiesItfImpl* GetImpl
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XAVideoDecoderCapabilitiesItfImpl* GetImpl(XAVideoDecoderCapabilitiesItf self)
+{
+    if( self )
+    {
+        XAVideoDecoderCapabilitiesItfImpl* impl = (XAVideoDecoderCapabilitiesItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAVideoDecoderCapabilitiesItf implementation
+ **/
+
+/* XAresult XAVideoDecoderCapabilitiesItfImpl_GetVideoDecoders
+ * Description: Retrieves available video decoders.
+ */
+XAresult XAVideoDecoderCapabilitiesItfImpl_GetVideoDecoders(
+                            XAVideoDecoderCapabilitiesItf self,
+                            XAuint32* pNumDecoders,
+                            XAuint32* pDecoderIds)
+{
+    XAVideoDecoderCapabilitiesItfImpl* impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAVideoDecoderCapabilitiesItfImpl_GetVideoDecoders");
+
+    impl = GetImpl(self);
+    if( !impl || !pNumDecoders )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if( pDecoderIds )
+        {   /* query array of decoders */
+            if( *pNumDecoders < impl->numCodecs )
+            {
+                DEBUG_ERR("XA_RESULT_BUFFER_INSUFFICIENT");
+                res = XA_RESULT_BUFFER_INSUFFICIENT;
+            }
+            else
+            {
+                
+#ifdef _GSTREAMER_BACKEND_  
+                XAuint32 i = 0;
+                XAStaticCapsData temp;
+                for( i=0; i<impl->numCodecs; i++ )
+                {
+                    /* query decoder id from adaptation using index value */
+                    XAStaticCapsAdapt_GetCapsByIdx(XACAP_DECODER|XACAP_VIDEO, i, &temp);
+                    pDecoderIds[i] = temp.xaid;
+                }
+#endif
+            }
+        }
+        /* return number of decoders */
+        *pNumDecoders = impl->numCodecs;
+    }
+
+    DEBUG_API("<-XAVideoDecoderCapabilitiesItfImpl_GetVideoDecoders");
+    return res;
+}
+
+/* XAresult XAVideoDecoderCapabilitiesItfImpl_GetVideoDecoderCapabilities
+ * Description: Retrieves video decoder capabilities.
+ */
+XAresult XAVideoDecoderCapabilitiesItfImpl_GetVideoDecoderCapabilities(
+                            XAVideoDecoderCapabilitiesItf self,
+                            XAuint32 decoderId,
+                            XAuint32* pIndex,
+                            XAVideoCodecDescriptor* pDescriptor)
+{
+    XAVideoDecoderCapabilitiesItfImpl* impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAVideoDecoderCapabilitiesItfImpl_GetDecoderCapabilities");
+    impl = GetImpl(self);
+
+    if( !impl || !pIndex )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if( !pDescriptor )
+        {   /* query number of capa structures */
+            *pIndex = 1;
+        }
+        else
+        {   /* query capabilities */
+            if( *pIndex >= 1 )
+            {
+                DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+                res = XA_RESULT_PARAMETER_INVALID;
+            }
+            else
+            {
+                /* query capabilities from adaptation using codec id */
+#ifdef _GSTREAMER_BACKEND_  
+                XAStaticCapsData temp;
+                memset(pDescriptor,0,sizeof(XAVideoCodecDescriptor));
+                res = XAStaticCapsAdapt_GetCapsById(XACAP_DECODER|XACAP_VIDEO, decoderId, &temp);
+                if( res == XA_RESULT_SUCCESS )
+                {
+                    /* map applicable values to XAVideoCodecCapabilities */
+                    pDescriptor->codecId = temp.xaid;
+                    pDescriptor->maxWidth = temp.maxW;
+                    pDescriptor->maxHeight = temp.maxH;
+                    pDescriptor->maxFrameRate = (temp.maxFR & 0xffff)<<16;
+                    pDescriptor->maxBitRate = temp.maxBR;
+                    /*other caps undefined*/
+                    pDescriptor->rateControlSupported = 0; /* reserved in decoders */
+                    pDescriptor->profileSetting = 0; /* unknown for theora or motionjpeg */
+                    pDescriptor->levelSetting = 0; /* unknown for theora or motionjpeg */
+                }
+#endif
+            }
+        }
+    }
+
+    DEBUG_API("<-XAVideoDecoderCapabilitiesItfImpl_GetDecoderCapabilities");
+    return res;
+}
+
+/**
+ * XAVideoDecoderCapabilitiesItfImpl -specific methods
+ **/
+
+/* XAVideoDecoderCapabilitiesItfImpl_Create
+ * Description: Allocate and initialize XAVideoDecoderCapabilitiesItfImpl
+ */
+XAVideoDecoderCapabilitiesItfImpl* XAVideoDecoderCapabilitiesItfImpl_Create()
+{
+    XAVideoDecoderCapabilitiesItfImpl* self = (XAVideoDecoderCapabilitiesItfImpl*)
+        calloc(1,sizeof(XAVideoDecoderCapabilitiesItfImpl));
+    DEBUG_API("->XAVideoDecoderCapabilitiesItfImpl_Create");
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.GetVideoDecoders =
+            XAVideoDecoderCapabilitiesItfImpl_GetVideoDecoders;
+        self->itf.GetVideoDecoderCapabilities =
+            XAVideoDecoderCapabilitiesItfImpl_GetVideoDecoderCapabilities;
+
+#ifdef _GSTREAMER_BACKEND_  
+        /* init variables */
+        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_DECODER|XACAP_VIDEO,
+                                  &(self->numCodecs) ) == XA_RESULT_SUCCESS );
+#endif
+        self->self = self;
+    }
+    DEBUG_API("<-XAVideoDecoderCapabilitiesItfImpl_Create");
+    return self;
+}
+
+/* void XAVideoDecoderCapabilitiesItfImpl_Free
+ * Description: Free all resources reserved at XAVideoDecoderCapabilitiesItfImpl_Create
+ */
+void XAVideoDecoderCapabilitiesItfImpl_Free(XAVideoDecoderCapabilitiesItfImpl* self)
+{
+    DEBUG_API("->XAVideoDecoderCapabilitiesItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAVideoDecoderCapabilitiesItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xavideodecodercapabilitiesitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAVIDEODECODERCAPABILITIESITF_H
+#define XAVIDEODECODERCAPABILITIESITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAVideoDecoderCapabilitiesItf implementation */
+typedef struct XAVideoDecoderCapabilitiesItfImpl_
+{
+    /* parent interface */
+    struct XAVideoDecoderCapabilitiesItf_ itf;
+    /* pointer to self */
+    struct XAVideoDecoderCapabilitiesItfImpl_* self;
+    /* variables */
+    XAuint32 numCodecs;
+} XAVideoDecoderCapabilitiesItfImpl;
+
+/* Base interface XAVideoDecoderCapabilitiesItf implementation */
+XAresult XAVideoDecoderCapabilitiesItfImpl_GetVideoDecoders(
+                            XAVideoDecoderCapabilitiesItf self,
+                            XAuint32* pNumDecoders,
+                            XAuint32* pDecoderIds);
+
+XAresult XAVideoDecoderCapabilitiesItfImpl_GetVideoDecoderCapabilities(
+                            XAVideoDecoderCapabilitiesItf self,
+                            XAuint32 decoderId,
+                            XAuint32* pIndex,
+                            XAVideoCodecDescriptor* pDescriptor);
+
+/* XAVideoDecoderCapabilitiesItfImpl -specific methods */
+XAVideoDecoderCapabilitiesItfImpl* XAVideoDecoderCapabilitiesItfImpl_Create(void);
+void XAVideoDecoderCapabilitiesItfImpl_Free(XAVideoDecoderCapabilitiesItfImpl* self);
+
+#endif /* XAVIDEODECODERCAPABILITIESITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xavideoencodercapabilitiesitf.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+#include "xaglobals.h"
+#include "xavideoencodercapabilitiesitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAStaticCapsAdaptation.h"
+#endif
+/* XAVideoEncoderCapabilitiesItfImpl* GetImpl
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XAVideoEncoderCapabilitiesItfImpl* GetImpl(XAVideoEncoderCapabilitiesItf self)
+{
+    if( self )
+    {
+        XAVideoEncoderCapabilitiesItfImpl* impl = (XAVideoEncoderCapabilitiesItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAVideoEncoderCapabilitiesItf implementation
+ **/
+
+/* XAresult XAVideoEncoderCapabilitiesItfImpl_GetVideoEncoders
+ * Description: Retrieves available video encoders.
+ */
+XAresult XAVideoEncoderCapabilitiesItfImpl_GetVideoEncoders(
+                            XAVideoEncoderCapabilitiesItf self,
+                            XAuint32* pNumEncoders,
+                            XAuint32* pEncoderIds)
+{
+    XAVideoEncoderCapabilitiesItfImpl* impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAVideoEncoderCapabilitiesItfImpl_GetVideoEncoders");
+
+    if( !impl || !pNumEncoders )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if( pEncoderIds )
+        {   /* query array of encoders */
+            if( *pNumEncoders < impl->numCodecs )
+            {
+                DEBUG_ERR("XA_RESULT_BUFFER_INSUFFICIENT");
+                res = XA_RESULT_BUFFER_INSUFFICIENT;
+            }
+            else
+            {
+                
+#ifdef _GSTREAMER_BACKEND_  
+                XAuint32 i = 0;
+                XAStaticCapsData temp;
+                for( i=0; i<impl->numCodecs; i++ )
+                {
+                    /* query encoder id from adaptation using index value */
+                    XAStaticCapsAdapt_GetCapsByIdx(XACAP_ENCODER|XACAP_VIDEO, i, &temp);
+                    pEncoderIds[i] = temp.xaid;
+                }
+#endif
+            }
+        }
+        /* return number of encoders */
+        *pNumEncoders = impl->numCodecs;
+    }
+
+    DEBUG_API("<-XAVideoEncoderCapabilitiesItfImpl_GetVideoEncoders");
+    return res;
+}
+
+/* XAresult XAVideoEncoderCapabilitiesItfImpl_GetVideoEncoderCapabilities
+ * Description: Retrieves video encoder capabilities.
+ */
+XAresult XAVideoEncoderCapabilitiesItfImpl_GetVideoEncoderCapabilities(
+                            XAVideoEncoderCapabilitiesItf self,
+                            XAuint32 encoderId,
+                            XAuint32* pIndex,
+                            XAVideoCodecDescriptor* pDescriptor)
+{
+    XAVideoEncoderCapabilitiesItfImpl* impl = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAVideoEncoderCapabilitiesItfImpl_GetEncoderCapabilities");
+    impl = GetImpl(self);
+    if( !impl || !pIndex )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        if( !pDescriptor )
+        {   /* query number of capa structures */
+            *pIndex = 1;
+        }
+        else
+        {   /* query capabilities */
+            if( *pIndex >= 1 )
+            {
+                DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+                res = XA_RESULT_PARAMETER_INVALID;
+            }
+            else
+            {
+#ifdef _GSTREAMER_BACKEND_  
+                /* query capabilities from adaptation using codec id */
+                XAStaticCapsData temp;
+                memset(pDescriptor,0,sizeof(XAVideoCodecDescriptor));
+                res = XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_VIDEO, encoderId, &temp);
+                if( res == XA_RESULT_SUCCESS )
+                {
+                    /* map applicable values to XAAudioCodecCapabilities */
+                    pDescriptor->codecId = temp.xaid;
+                    pDescriptor->maxWidth = temp.maxW;
+                    pDescriptor->maxHeight = temp.maxH;
+                    pDescriptor->maxFrameRate = (temp.maxFR & 0xffff)<<16;
+                    pDescriptor->maxBitRate = temp.maxBR;
+                    /*other caps undefined*/
+                    pDescriptor->rateControlSupported = XA_RATECONTROLMODE_CONSTANTBITRATE;
+                    pDescriptor->profileSetting = 0; /* unknown for theora or motionjpeg */
+                    pDescriptor->levelSetting = 0; /* unknown for theora or motionjpeg */
+                }
+#endif            
+            }
+        }
+    }
+
+    DEBUG_API("<-XAVideoEncoderCapabilitiesItfImpl_GetEncoderCapabilities");
+    return res;
+}
+
+/**
+ * XAVideoEncoderCapabilitiesItfImpl -specific methods
+ **/
+
+/* XAVideoEncoderCapabilitiesItfImpl_Create
+ * Description: Allocate and initialize XAVideoEncoderCapabilitiesItfImpl
+ */
+XAVideoEncoderCapabilitiesItfImpl* XAVideoEncoderCapabilitiesItfImpl_Create()
+{
+    XAVideoEncoderCapabilitiesItfImpl* self = (XAVideoEncoderCapabilitiesItfImpl*)
+        calloc(1,sizeof(XAVideoEncoderCapabilitiesItfImpl));
+    DEBUG_API("->XAVideoEncoderCapabilitiesItfImpl_Create");
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.GetVideoEncoders =
+            XAVideoEncoderCapabilitiesItfImpl_GetVideoEncoders;
+        self->itf.GetVideoEncoderCapabilities =
+            XAVideoEncoderCapabilitiesItfImpl_GetVideoEncoderCapabilities;
+
+#ifdef _GSTREAMER_BACKEND_  
+        /* init variables */
+        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_ENCODER|XACAP_VIDEO,
+                                  &(self->numCodecs) ) == XA_RESULT_SUCCESS );
+#endif
+        self->self = self;
+    }
+    DEBUG_API("<-XAVideoEncoderCapabilitiesItfImpl_Create");
+    return self;
+}
+
+/* void XAVideoEncoderCapabilitiesItfImpl_Free
+ * Description: Free all resources reserved at XAVideoEncoderCapabilitiesItfImpl_Create
+ */
+void XAVideoEncoderCapabilitiesItfImpl_Free(XAVideoEncoderCapabilitiesItfImpl* self)
+{
+    DEBUG_API("->XAVideoEncoderCapabilitiesItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAVideoEncoderCapabilitiesItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/engine/xavideoencodercapabilitiesitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAVIDEOENCODERCAPABILITIESITF_H
+#define XAVIDEOENCODERCAPABILITIESITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAVideoEncoderCapabilitiesItf implementation */
+typedef struct XAVideoEncoderCapabilitiesItfImpl_
+{
+    /* parent interface */
+    struct XAVideoEncoderCapabilitiesItf_ itf;
+    /* pointer to self */
+    struct XAVideoEncoderCapabilitiesItfImpl_* self;
+    /* variables */
+    XAuint32 numCodecs;
+} XAVideoEncoderCapabilitiesItfImpl;
+
+/* Base interface XAVideoEncoderCapabilitiesItf implementation */
+XAresult XAVideoEncoderCapabilitiesItfImpl_GetVideoEncoders(
+                            XAVideoEncoderCapabilitiesItf self,
+                            XAuint32* pNumEncoders,
+                            XAuint32* pEncoderIds);
+
+XAresult XAVideoEncoderCapabilitiesItfImpl_GetVideoEncoderCapabilities(
+                            XAVideoEncoderCapabilitiesItf self,
+                            XAuint32 decoderId,
+                            XAuint32* pIndex,
+                            XAVideoCodecDescriptor* pDescriptor);
+
+/* XAVideoEncoderCapabilitiesItfImpl -specific methods */
+XAVideoEncoderCapabilitiesItfImpl* XAVideoEncoderCapabilitiesItfImpl_Create(void);
+void XAVideoEncoderCapabilitiesItfImpl_Free(XAVideoEncoderCapabilitiesItfImpl* self);
+
+#endif /* XAVIDEOENCODERCAPABILITIESITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/khronos/openmaxal_iid.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2007-2009 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and/or associated documentation files (the
+ * "Materials "), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to 
+ * the following conditions: 
+ *
+ * The above copyright notice and this permission notice shall be included 
+ * in all copies or substantial portions of the Materials. 
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ *
+ * OpenMAXAL_IID.c - OpenMAX AL version 1.0
+ *
+ */
+
+/****************************************************************************/
+/* NOTE: This file is a standard OpenMAX AL file and should not be          */
+/* modified in any way.                                                     */
+/****************************************************************************/
+#include "OpenMAXAL.h"
+
+/*****************************************************************************/
+/* Interface IDs                                                             */
+/*****************************************************************************/
+
+static const struct XAInterfaceID_ XA_IID_NULL_ = { 0xec7178ec, 0xe5e1, 0x4432, 0xa3f4, { 0x46, 0x57, 0xe6, 0x79, 0x52, 0x10 } };
+XA_API const XAInterfaceID XA_IID_NULL = &XA_IID_NULL_;
+
+static const struct XAInterfaceID_ XA_IID_AUDIODECODERCAPABILITIES_ = { 0xdeac0cc0, 0x3995, 0x11dc, 0x8872, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_AUDIODECODERCAPABILITIES = &XA_IID_AUDIODECODERCAPABILITIES_;
+
+static const struct XAInterfaceID_ XA_IID_AUDIOENCODER_ = { 0xebbab900, 0x3997, 0x11dc, 0x891f, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_AUDIOENCODER = &XA_IID_AUDIOENCODER_;
+
+static const struct XAInterfaceID_ XA_IID_AUDIOENCODERCAPABILITIES_ = { 0x83fbc600, 0x3998, 0x11d, 0x8f6d, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_AUDIOENCODERCAPABILITIES = &XA_IID_AUDIOENCODERCAPABILITIES_;
+
+static const struct XAInterfaceID_ XA_IID_AUDIOIODEVICECAPABILITIES_ = { 0x2b276d00, 0xf775, 0x11db, 0xa963, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_AUDIOIODEVICECAPABILITIES = &XA_IID_AUDIOIODEVICECAPABILITIES_;
+
+static const struct XAInterfaceID_ XA_IID_CAMERA_ = { 0xc7b84d20, 0xdf00, 0x11db, 0xba87, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_CAMERA = &XA_IID_CAMERA_;
+
+static const struct XAInterfaceID_ XA_IID_CAMERACAPABILITIES_ = { 0x01cab1c0, 0xe86a, 0x11db, 0xa5b9, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_CAMERACAPABILITIES = &XA_IID_CAMERACAPABILITIES_;
+
+static const struct XAInterfaceID_ XA_IID_CONFIGEXTENSION_ = { 0x6dc22ea0, 0xdf03, 0x11db, 0xbed7, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_CONFIGEXTENSION = &XA_IID_CONFIGEXTENSION_;
+
+static const struct XAInterfaceID_ XA_IID_DEVICEVOLUME_ = { 0x4bb44020, 0xf775, 0x11db, 0xad03, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_DEVICEVOLUME = &XA_IID_DEVICEVOLUME_;
+
+static const struct XAInterfaceID_ XA_IID_DYNAMICINTERFACEMANAGEMENT_ = { 0x6e2340c0, 0xf775, 0x11db, 0x85da, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_DYNAMICINTERFACEMANAGEMENT = &XA_IID_DYNAMICINTERFACEMANAGEMENT_;
+
+static const struct XAInterfaceID_ XA_IID_DYNAMICSOURCE_ = { 0xc88d5480, 0x3a12, 0x11dc, 0x80a2, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_DYNAMICSOURCE = &XA_IID_DYNAMICSOURCE_;
+
+static const struct XAInterfaceID_ XA_IID_ENGINE_ = { 0x45c58f40, 0xdf04, 0x11db, 0x9e76, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_ENGINE = &XA_IID_ENGINE_;
+
+static const struct XAInterfaceID_ XA_IID_EQUALIZER_ = { 0x7ad86d40, 0xf775, 0x11db, 0xbc77, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_EQUALIZER = &XA_IID_EQUALIZER_;
+
+static const struct XAInterfaceID_ XA_IID_IMAGECONTROLS_ = { 0xf46de3e0, 0xdf03, 0x11db, 0x92f1, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_IMAGECONTROLS = &XA_IID_IMAGECONTROLS_;
+
+static const struct XAInterfaceID_ XA_IID_IMAGEDECODERCAPABILITIES_ = { 0xc333e7a0, 0xe616, 0x11dc, 0xa93e, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_IMAGEDECODERCAPABILITIES = &XA_IID_IMAGEDECODERCAPABILITIES_;
+
+static const struct XAInterfaceID_ XA_IID_IMAGEEFFECTS_ = { 0xb865bca0, 0xdf04, 0x11db, 0xbab9, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_IMAGEEFFECTS = &XA_IID_IMAGEEFFECTS_;
+
+static const struct XAInterfaceID_ XA_IID_IMAGEENCODER_ = { 0xcd49f140, 0xdf04, 0x11db, 0x8888, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_IMAGEENCODER = &XA_IID_IMAGEENCODER_;
+
+static const struct XAInterfaceID_ XA_IID_IMAGEENCODERCAPABILITIES_ = { 0xc19f0640, 0xe86f, 0x11db, 0xb2d2, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_IMAGEENCODERCAPABILITIES = &XA_IID_IMAGEENCODERCAPABILITIES_;
+
+static const struct XAInterfaceID_ XA_IID_LED_ = { 0xa534d920, 0xf775, 0x11db, 0x8b70, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_LED = &XA_IID_LED_;
+
+static const struct XAInterfaceID_ XA_IID_METADATAEXTRACTION_ = { 0x5df4fda0, 0xf776, 0x11db, 0xabc5, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_METADATAEXTRACTION = &XA_IID_METADATAEXTRACTION_;
+
+static const struct XAInterfaceID_ XA_IID_METADATAINSERTION_ = { 0x49a14d60, 0xdf05, 0x11db, 0x9191, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_METADATAINSERTION = &XA_IID_METADATAINSERTION_;
+
+static const struct XAInterfaceID_ XA_IID_METADATATRAVERSAL_ = { 0x73ffb0e0, 0xf776, 0x11db, 0xa00e, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_METADATATRAVERSAL = &XA_IID_METADATATRAVERSAL_;
+
+static const struct XAInterfaceID_ XA_IID_OBJECT_ = { 0x82f5a5a0, 0xf776, 0x11db, 0x9700, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_OBJECT = &XA_IID_OBJECT_;
+
+static const struct XAInterfaceID_ XA_IID_OUTPUTMIX_ = { 0xb25b6fa0, 0xf776, 0x11db, 0xb86b, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_OUTPUTMIX = &XA_IID_OUTPUTMIX_;
+
+static const struct XAInterfaceID_ XA_IID_PLAY_ = { 0xb9c293e0, 0xf776, 0x11db, 0x80df, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_PLAY = &XA_IID_PLAY_;
+
+static const struct XAInterfaceID_ XA_IID_PLAYBACKRATE_ = { 0xc36f1440, 0xf776, 0x11db, 0xac48, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_PLAYBACKRATE = &XA_IID_PLAYBACKRATE_;
+
+static const struct XAInterfaceID_ XA_IID_PREFETCHSTATUS_ = { 0xcceac0a0, 0xf776, 0x11db, 0xbb9c, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_PREFETCHSTATUS = &XA_IID_PREFETCHSTATUS_;
+
+static const struct XAInterfaceID_ XA_IID_RADIO_ = { 0xb316ad80, 0xdf05, 0x11db, 0xb5b6, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_RADIO = &XA_IID_RADIO_;
+
+static const struct XAInterfaceID_ XA_IID_RDS_ = { 0xb80f42c0, 0xdf05, 0x11db, 0x92a5, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_RDS = &XA_IID_RDS_;
+
+static const struct XAInterfaceID_ XA_IID_RECORD_ = { 0xd7948cc0, 0xf776, 0x11db, 0x8a3b, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_RECORD = &XA_IID_RECORD_;
+
+static const struct XAInterfaceID_ XA_IID_SEEK_ = { 0xee6a3120, 0xf776, 0x11db, 0xb518, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_SEEK = &XA_IID_SEEK_;
+
+static const struct XAInterfaceID_ XA_IID_SNAPSHOT_ = { 0xdb1b6dc0, 0xdf05, 0x11db, 0x8c01, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_SNAPSHOT = &XA_IID_SNAPSHOT_;
+
+static const struct XAInterfaceID_ XA_IID_THREADSYNC_ = { 0xf3599ea0, 0xf776, 0x11db, 0xb3ea, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_THREADSYNC = &XA_IID_THREADSYNC_;
+
+static const struct XAInterfaceID_ XA_IID_VIBRA_ = { 0xfe374c00, 0xf776, 0x11db, 0xa8f0, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_VIBRA = &XA_IID_VIBRA_;
+
+static const struct XAInterfaceID_ XA_IID_VIDEODECODERCAPABILITIES_ = { 0xd18cb200, 0xe616, 0x11dc, 0xab01, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_VIDEODECODERCAPABILITIES = &XA_IID_VIDEODECODERCAPABILITIES_;
+
+static const struct XAInterfaceID_ XA_IID_VIDEOENCODER_ = { 0x9444db60, 0xdf06, 0x11db, 0xb311, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_VIDEOENCODER = &XA_IID_VIDEOENCODER_;
+
+static const struct XAInterfaceID_ XA_IID_VIDEOENCODERCAPABILITIES_ = { 0x5aef2760, 0xe872, 0x11db, 0x849f, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_VIDEOENCODERCAPABILITIES = &XA_IID_VIDEOENCODERCAPABILITIES_;
+
+static const struct XAInterfaceID_ XA_IID_VIDEOPOSTPROCESSING_ = { 0x898b6820, 0x7e6e, 0x11dd, 0x8caf, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_VIDEOPOSTPROCESSING = &XA_IID_VIDEOPOSTPROCESSING_;
+
+static const struct XAInterfaceID_ XA_IID_VOLUME_ = { 0x088ba520, 0xf777, 0x11db, 0xa5e3, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_VOLUME = &XA_IID_VOLUME_;
+
+static const struct XAInterfaceID_ XA_IID_STREAMINFORMATION_ = { 0x3a628fe0, 0x1238, 0x11de, 0xad9f, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_STREAMINFORMATION = &XA_IID_STREAMINFORMATION_;
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/ledarray/xaledarraydevice.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xaledarraydevice.h"
+#include "xaledarrayitf.h"
+#include "xaconfigextensionsitf.h"
+#include "xadynintmgmtitf.h"
+#include "xathreadsafety.h"
+
+
+/* Static mapping of enumeration XALEDArrayDeviceInterfaces to interface iids */
+static const XAInterfaceID* XALEDArrayDeviceItfIIDs[LEDARRAY_ITFCOUNT]=
+{
+    &XA_IID_OBJECT,
+    &XA_IID_LED,
+    &XA_IID_CONFIGEXTENSION,
+    &XA_IID_DYNAMICINTERFACEMANAGEMENT,
+};
+
+
+/*****************************************************************************
+ * Global methods
+ *****************************************************************************/
+
+/* XAResult XALEDArrayDeviceImpl_Create
+ * Description: Create object
+ */
+XAresult XALEDArrayDeviceImpl_CreateLEDArrayDevice(XAObjectItf* pDevice,
+                                                   XAuint32 deviceID,
+                                                   XAuint32 numInterfaces,
+                                                   const XAInterfaceID * pInterfaceIds,
+                                                   const XAboolean * pInterfaceRequired)
+{
+
+    
+    XAuint8 itfIndex = 0;
+
+    XALEDArrayDeviceImpl* pImpl = NULL;
+    XAObjectItfImpl* pBaseObj = NULL;
+    
+
+    DEBUG_API("->XALEDArrayDeviceImpl_Create");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSLEDArray);
+
+    if( !pDevice )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XALEDArrayDeviceImpl_Create");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* instantiate object implementation */
+    pImpl = (XALEDArrayDeviceImpl*)calloc(1,sizeof(XALEDArrayDeviceImpl));
+    if( !pImpl )
+    {
+        /* memory allocation failed */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+        DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+        DEBUG_API("<-XALEDArrayDeviceImpl_Create");
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+    pBaseObj = &pImpl->baseObj;
+
+
+
+    /* Initialize base object default implementation */
+    XAObjectItfImpl_Init(pBaseObj,
+                         LEDARRAY_ITFCOUNT,
+                         XALEDArrayDeviceItfIIDs,
+                         XALEDArrayDeviceImpl_DoRealize,
+                         XALEDArrayDeviceImpl_DoResume,
+                         XALEDArrayDeviceImpl_FreeResources);
+
+    /* Mark interfaces that need to be exposed */
+    /* Implicit and mandated interfaces */
+    pBaseObj->interfaceMap[LEDARRAY_LEDARRAYITF].required = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[LEDARRAY_DIMITF].required = XA_BOOLEAN_TRUE;
+
+    /* Explicit interfaces */
+    if( (numInterfaces != 0) && pInterfaceIds && pInterfaceRequired )
+    {
+        /* Check required interfaces */
+        for( itfIndex = 0; itfIndex < numInterfaces; itfIndex++ )
+        {
+            /* If mapEntry is null then required interface is not supported.*/
+            XAObjItfMapEntry *entry =
+                XAObjectItfImpl_GetItfEntry((XAObjectItf)&(pBaseObj), pInterfaceIds[itfIndex]);
+           if( !entry  )
+            {
+                if( pInterfaceRequired[itfIndex] )
+                {
+                    /* required interface cannot be accommodated - fail creation */
+                    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+                    XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+                    DEBUG_ERR("Required interface not found - abort creation!");
+                    DEBUG_API("<-XALEDArrayDeviceImpl_Create");
+                    return XA_RESULT_FEATURE_UNSUPPORTED;
+                }
+                else
+                {
+                    DEBUG_INFO("Requested (not required) interface not found - continue creation");
+                }
+            }
+            else
+            {
+                entry->required = XA_BOOLEAN_TRUE;
+            }
+        }
+    }
+
+    /* Initialize XALEDArrayDeviceImpl variables */
+    pImpl->deviceID = deviceID;
+#ifdef _GSTREAMER_BACKEND_  
+    pImpl->adaptationCtx = XALEDArrayAdapt_Create(pImpl->deviceID);
+#endif
+    
+    /* This code is put here to return Feature Not Supported since adaptation is not present*/
+    /*************************************************/
+    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+    DEBUG_ERR("Required interface not found - abort creation!");
+    DEBUG_API("<-XALEDArrayDeviceImpl_Create");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+    /*************************************************/
+    
+    /* Set ObjectItf to point to newly created object */
+/*
+    *pDevice = (XAObjectItf)&(pBaseObj->self);
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+    DEBUG_API("<-XALEDArrayDeviceImpl_Create");
+    return XA_RESULT_SUCCESS;
+*/
+}
+
+/* XAResult XALEDArrayDeviceImpl_QueryNumSupportedInterfaces
+ * Description: Statically query number of supported interfaces
+ */
+XAresult XALEDArrayDeviceImpl_QueryNumSupportedInterfaces( XAuint32 *pNumSupportedInterfaces )
+{
+    DEBUG_API("->XALEDArrayDeviceImpl_QueryNumSupportedInterfaces");
+    if( pNumSupportedInterfaces )
+    {
+#ifdef _GSTREAMER_BACKEND_  
+        *pNumSupportedInterfaces = LEDARRAY_ITFCOUNT;
+#endif
+        DEBUG_API_A1("<-XALEDArrayDeviceImpl_QueryNumSupportedInterfaces - %ld", *pNumSupportedInterfaces );
+        return XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XALEDArrayDeviceImpl_QueryNumSupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+}
+/* XAResult XALEDArrayDeviceImpl_QuerySupportedInterfaces
+ * Description: Statically query supported interfaces
+ */
+XAresult XALEDArrayDeviceImpl_QuerySupportedInterfaces( XAuint32 index,
+                                                      XAInterfaceID * pInterfaceId )
+{
+    DEBUG_API("->XALEDArrayDeviceImpl_QuerySupportedInterfaces");
+
+#ifdef _GSTREAMER_BACKEND_  
+    if( index >= LEDARRAY_ITFCOUNT || !pInterfaceId )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XALEDArrayDeviceImpl_QuerySupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        *pInterfaceId = *(XALEDArrayDeviceItfIIDs[index]);
+#endif
+        DEBUG_API("<-XALEDArrayDeviceImpl_QuerySupportedInterfaces");
+        return XA_RESULT_SUCCESS;
+#ifdef _GSTREAMER_BACKEND_  
+    }
+#endif    
+}
+
+
+/*****************************************************************************
+ * base object XAObjectItfImpl methods
+ *****************************************************************************/
+
+/* XAresult XALEDArrayDeviceImpl_DoRealize( XAObjectItf self )
+ * Description: Realize all implicit and explicitly wanted interfaces.
+ * Create and initialize implementation-specific variables.
+ * Called from base object XAObjectItfImpl
+ */
+XAresult XALEDArrayDeviceImpl_DoRealize( XAObjectItf self )
+{
+#ifdef _GSTREAMER_BACKEND_
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAuint8 itfIdx = 0;
+    XALEDArrayDeviceImpl* pObjImpl = (XALEDArrayDeviceImpl*)(pObj);
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XALEDArrayDeviceImpl_DoRealize");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSLEDArray);
+
+    /* check casting from correct pointer type */
+    if( !pObjImpl || pObj != pObjImpl->baseObj.self )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XALEDArrayDeviceImpl_DoRealize");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    ret = XALEDArrayAdapt_PostInit( pObjImpl->adaptationCtx );
+    if( ret != XA_RESULT_SUCCESS )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+        DEBUG_ERR_A1("Error: %d",ret);
+        DEBUG_API("<-XALEDArrayDeviceImpl_DoRealize");
+        return ret;
+    }
+
+    /* Realize all implicit and explicitly wanted interfaces */
+    for( itfIdx = 0; itfIdx < LEDARRAY_ITFCOUNT; itfIdx++)
+    {
+        if( !(pObj->interfaceMap[itfIdx].pItf) &&
+            pObj->interfaceMap[itfIdx].required )
+        {
+            void *pItf = NULL;
+            switch( itfIdx )
+            {
+                case LEDARRAY_LEDARRAYITF:
+                    pItf = XALEDArrayItfImpl_Create( pObjImpl->adaptationCtx );
+                    break;
+                case LEDARRAY_CONFIGEXTENSIONITF:
+                    pItf = XAConfigExtensionsItfImpl_Create();
+                    break;
+                case LEDARRAY_DIMITF:
+                    pItf = XADIMItfImpl_Create();
+                    break;
+                default:
+                    break;
+            }
+            if( !pItf )
+            {
+                /* memory allocation failed */
+                XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+                DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+                DEBUG_API("<-XALEDArrayDeviceImpl_DoRealize");
+                return XA_RESULT_MEMORY_FAILURE;
+            }
+            else
+            {
+                pObj->interfaceMap[itfIdx].pItf = pItf;
+            }
+        }
+    }
+
+    pObj->state = XA_OBJECT_STATE_REALIZED;
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+#endif    
+    DEBUG_API("<-XALEDArrayDeviceImpl_DoRealize");
+    return XA_RESULT_SUCCESS;
+}
+
+/* XAresult XALEDArrayDeviceImpl_DoResume
+ * Description: Resume object from suspended state
+ */
+XAresult XALEDArrayDeviceImpl_DoResume(XAObjectItf self)
+{
+    DEBUG_API("->XALEDArrayDeviceImpl_DoResume");
+    DEBUG_API("<-XALEDArrayDeviceImpl_DoResume");
+    /* This implementation does not support suspended state */
+    return XA_RESULT_PRECONDITIONS_VIOLATED;
+}
+
+/* void XALEDArrayDeviceImpl_FreeResources
+ * Description: Free all resources reserved at XALEDArrayDeviceImpl_DoRealize()
+ */
+void XALEDArrayDeviceImpl_FreeResources(XAObjectItf self)
+{
+#ifdef _GSTREAMER_BACKEND_  
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XALEDArrayDeviceImpl* pImpl = (XALEDArrayDeviceImpl*)(*self);
+    XAuint8 itfIdx = 0;
+    DEBUG_API("->XALEDArrayDeviceImpl_FreeResources");
+    XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS(XATSLEDArray);
+    assert( pObj && pImpl && pObj == pObj->self );
+
+    if ( pImpl->adaptationCtx != NULL )
+    {
+        XALEDArrayAdapt_Destroy( pImpl->adaptationCtx );
+        pImpl->adaptationCtx = NULL;
+    }
+
+    /* free all allocated interfaces */
+    for(itfIdx = 0; itfIdx < LEDARRAY_ITFCOUNT; itfIdx++)
+    {
+        void *pItf = pObj->interfaceMap[itfIdx].pItf;
+        if(pItf)
+        {
+            switch(itfIdx)
+            {
+                case LEDARRAY_LEDARRAYITF:
+                    XALEDArrayItfImpl_Free( pItf );
+                    break;
+                case LEDARRAY_CONFIGEXTENSIONITF:
+                    XAConfigExtensionsItfImpl_Free( pItf );
+                    break;
+                case LEDARRAY_DIMITF:
+                    XADIMItfImpl_Free( pItf );
+                    break;
+
+                default:
+                    break;
+            }
+            pObj->interfaceMap[itfIdx].pItf = NULL;
+        }
+    }
+
+    if ( pImpl->adaptationCtx != NULL )
+    {
+        XALEDArrayAdapt_Destroy( pImpl->adaptationCtx );
+        pImpl->adaptationCtx = NULL;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS(XATSLEDArray);
+    DEBUG_API("<-XALEDArrayDeviceImpl_FreeResources");
+#endif    
+    return;
+}
+/* END OF FILE */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/ledarray/xaledarraydevice.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,67 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XALEDARRAYDEVICE_H
+#define XALEDARRAYDEVICE_H
+
+#include "openmaxalwrapper.h"
+#include "xaobjectitf.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "../adaptation/XALEDArrayAdaptCtx.h"
+#endif
+/** MACROS **/
+
+
+/** TYPES **/
+
+
+/** ENUMERATIONS **/
+/* Enumeration for interfaces that LEDArrayDevice supports.  */
+typedef enum
+{
+    LEDARRAY_OBJECTITF,
+    LEDARRAY_LEDARRAYITF,
+    LEDARRAY_CONFIGEXTENSIONITF,
+    LEDARRAY_DIMITF,
+    LEDARRAY_ITFCOUNT
+} XALEDArrayDeviceInterfaces;
+
+/** STRUCTURES **/
+/* Specification for LEDArrayDeviceImpl. */
+typedef struct XALEDArrayDeviceImpl_
+{
+    /* Parent for XALEDArrayDeviceImpl */
+    XAObjectItfImpl baseObj;
+
+    /* variables */
+    XAuint32 deviceID;
+
+#ifdef _GSTREAMER_BACKEND_
+    XAAdaptationBaseCtx* adaptationCtx;
+#endif
+} XALEDArrayDeviceImpl;
+
+
+/** METHODS **/
+
+/* base object XAObjectItfImpl methods */
+XAresult    XALEDArrayDeviceImpl_DoRealize(XAObjectItf self);
+XAresult    XALEDArrayDeviceImpl_DoResume(XAObjectItf self);
+void        XALEDArrayDeviceImpl_FreeResources(XAObjectItf self);
+
+#endif /* XALEDARRAYDEVICE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/ledarray/xaledarrayitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,252 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xaledarrayitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XALEDArrayItfAdaptation.h"
+#endif
+#include "xathreadsafety.h"
+
+/* XALEDArrayItfImpl* GetImpl(XALEDArrayItf self)
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XALEDArrayItfImpl* GetImpl(XALEDArrayItf self)
+{
+    if( self )
+    {
+        XALEDArrayItfImpl* impl = (XALEDArrayItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/*****************************************************************************
+ * Base interface XALEDArrayItf implementation
+ *****************************************************************************/
+/*
+ * XAresult XALEDArrayItfImpl_ActivateLEDArray ( XALEDArrayItf self,
+ *                                               XAuint32 lightMask )
+ * Description: Activates or deactivates individual LEDs in an array of LEDs.
+ */
+XAresult XALEDArrayItfImpl_ActivateLEDArray ( XALEDArrayItf self,
+                                              XAuint32 lightMask )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XALEDArrayItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XALEDArrayItfImpl_ActivateLEDArray");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSLEDArray);
+
+    if( !impl || lightMask > LED_COUNT)
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XALEDArrayItfImpl_ActivateLEDArray");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is ligtMask mode changed */
+    if( impl->lightMask != lightMask )
+    {
+#ifdef _GSTREAMER_BACKEND_  
+        ret = XALEDArrayItfAdapt_ActivateLEDArray( impl->adapCtx, lightMask );
+#endif
+        if ( ret == XA_RESULT_SUCCESS )
+        {
+            impl->lightMask = lightMask;
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+    DEBUG_API("<-XALEDArrayItfImpl_ActivateLEDArray");
+    return ret;
+}
+/*
+ * XAresult XALEDArrayItfImpl_IsLEDArrayActivated ( XALEDArrayItf self,
+ *                                                  XAuint32 * pLightMask )
+ * Description: Returns the state of each LED in an array of LEDs.
+ */
+XAresult XALEDArrayItfImpl_IsLEDArrayActivated ( XALEDArrayItf self,
+                                                 XAuint32 * pLightMask )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XALEDArrayItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XALEDArrayItfImpl_IsLEDArrayActivated");
+
+    if( !impl || !pLightMask)
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XALEDArrayItfImpl_IsLEDArrayActivated");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pLightMask = impl->lightMask;
+
+    if( *pLightMask )
+    {
+        DEBUG_API("The LED is on.");
+    }
+    else
+    {
+        DEBUG_API("The LED is off.");
+    }
+
+    DEBUG_API("<-XALEDArrayItfImpl_IsLEDArrayActivated");
+    return ret;
+}
+/*
+ * XAresult XALEDArrayItfImpl_SetColor ( XALEDArrayItf self,
+ *                                       XAuint8 index,
+ *                                       const XAHSL * pColor )
+ * Description: Sets the color of an individual LED.
+ */
+XAresult XALEDArrayItfImpl_SetColor ( XALEDArrayItf self,
+                                      XAuint8 index,
+                                      const XAHSL * pColor )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XALEDArrayItfImpl* impl = GetImpl(self);
+    XAboolean support = XA_BOOLEAN_FALSE;
+
+    DEBUG_API("->XALEDArrayItfImpl_SetColor");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSLEDArray);
+
+    if( !impl || index > LED_COUNT - 1 || !pColor )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XALEDArrayItfImpl_SetColor");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    support = ( COLOR_MASK >> index ) & 0x1;
+    if( !support ) /* Not supporting color*/
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+        DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED: not supporting color");
+        DEBUG_API("<-XALEDArrayItfImpl_SetColor");
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_  
+        ret = XALEDArrayItfAdapt_SetColor( impl->adapCtx, index, pColor);
+#endif
+        if ( ret == XA_RESULT_SUCCESS )
+        {
+            impl->color = *pColor;
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+    DEBUG_API("<-XALEDArrayItfImpl_SetColor");
+    return ret;
+}
+/*
+ * XAresult XALEDArrayItfImpl_GetColor ( XALEDArrayItf self,
+ *                                       XAuint8 index,
+ *                                       const XAHSL * pColor )
+ * Description: Returns the color of an individual LED.
+ */
+XAresult XALEDArrayItfImpl_GetColor ( XALEDArrayItf self,
+                                      XAuint8 index,
+                                      XAHSL * pColor )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XALEDArrayItfImpl* impl = GetImpl(self);
+    XAboolean support = XA_BOOLEAN_FALSE;
+    DEBUG_API("->XALEDArrayItfImpl_GetColor");
+
+    if( !impl || index > LED_COUNT - 1 || !pColor )
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XALEDArrayItfImpl_GetColor");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+
+    support = ( COLOR_MASK >> index ) & 0x1;
+    if( !support ) /* Not supporting color*/
+    {
+        DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED: not supporting color");
+        DEBUG_API("<-XALEDArrayItfImpl_GetColor");
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+    else
+    {
+        *pColor = impl->color;
+    }
+
+    DEBUG_API_A3("<-XALEDArrayItfImpl_GetColor: hue = %ld, saturation = %d, lightness = %d", pColor->hue, pColor->saturation, pColor->lightness);
+    return ret;
+}
+
+/*****************************************************************************
+ * XALEDArrayItfImpl -specific methods
+ *****************************************************************************/
+#ifdef _GSTREAMER_BACKEND_  
+
+/* XALEDArrayItfImpl* XALEDArrayItfImpl_Create()
+ * Description: Allocate and initialize LEDArrayItfImpl
+ */
+XALEDArrayItfImpl* XALEDArrayItfImpl_Create( XAAdaptationBaseCtx *adapCtx )
+{
+    XALEDArrayItfImpl* self = (XALEDArrayItfImpl*)
+        calloc(1,sizeof(XALEDArrayItfImpl));
+    DEBUG_API("->XALEDArrayItfImpl_Create");
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.ActivateLEDArray = XALEDArrayItfImpl_ActivateLEDArray;
+        self->itf.IsLEDArrayActivated = XALEDArrayItfImpl_IsLEDArrayActivated;
+        self->itf.SetColor = XALEDArrayItfImpl_SetColor;
+        self->itf.GetColor = XALEDArrayItfImpl_GetColor;
+
+        /* init variables */
+        self->lightMask = 0;
+        self->color.hue = 0;
+        self->color.saturation = 0;
+        self->color.lightness = 0;
+        self->adapCtx = adapCtx;
+
+        self->self = self;
+    }
+
+    DEBUG_API("<-XALEDArrayItfImpl_Create");
+    return self;
+}
+#endif
+/* void XALEDArrayItfImpl_Free(XALEDArrayItfImpl* self)
+ * Description: Free all resources reserved at XALEDArrayItfImpl_Create
+ */
+void XALEDArrayItfImpl_Free(XALEDArrayItfImpl* self)
+{
+    DEBUG_API("->XALEDArrayItfImpl_Free");
+    assert( self==self->self );
+    free( self );
+    DEBUG_API("<-XALEDArrayItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/ledarray/xaledarrayitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XALEDARRAYITF_H
+#define XALEDARRAYITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+#define LED_COUNT 1
+#define PRIMARY_LED 0
+#define COLOR_MASK 1
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XALEDArrayItf implementation */
+typedef struct XALEDArrayItfImpl_
+{
+    /* parent interface */
+    struct XALEDArrayItf_ itf;
+    /* pointer to self */
+    struct XALEDArrayItfImpl_* self;
+
+    /* variables */
+    XAuint32    lightMask;
+    XAHSL       color;
+
+#ifdef _GSTREAMER_BACKEND_  
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+} XALEDArrayItfImpl;
+
+/** METHODS **/
+
+/* Base interface XALEDArrayItf implementation
+ *See API Specification for method documentation
+ */
+XAresult XALEDArrayItfImpl_ActivateLEDArray ( XALEDArrayItf self, XAuint32 lightMask );
+XAresult XALEDArrayItfImpl_IsLEDArrayActivated ( XALEDArrayItf self, XAuint32 * pLightMask );
+XAresult XALEDArrayItfImpl_SetColor ( XALEDArrayItf self, XAuint8 index, const XAHSL * pColor );
+XAresult XALEDArrayItfImpl_GetColor ( XALEDArrayItf self, XAuint8 index, XAHSL * pColor );
+/* XALEDArrayItfImpl -specific methods */
+#ifdef _GSTREAMER_BACKEND_  
+XALEDArrayItfImpl* XALEDArrayItfImpl_Create( XAAdaptationBaseCtx *adapCtx );
+void XALEDArrayItfImpl_Free(XALEDArrayItfImpl* self);
+#endif
+
+#endif /* XALEDARRAYITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediaplayer/xamediaplayer.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,682 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include "xamediaplayer.h"
+#include "xaplayitf.h"
+#include "xaseekitf.h"
+#include "xaprefetchstatusitf.h"
+#include "xadynintmgmtitf.h"
+#include "xavolumeitf.h"
+#include "xametadataextractionitf.h"
+#include "xametadatatraversalitf.h"
+#include "xaplaybackrateitf.h"
+#include "xaequalizeritf.h"
+#include "xaimagecontrolsitf.h"
+#include "xaimageeffectsitf.h"
+#include "xavideopostprocessingitf.h"
+#include "xaconfigextensionsitf.h"
+#include "xathreadsafety.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAMetadataAdaptation.h"
+#endif
+#include "xadynamicsourceitf.h"
+
+
+extern void* vfHandle;
+
+/* Static mapping of enumeration XAMediaPlayerInterfaces to interface iids */
+static const XAInterfaceID* xaMediaPlayerItfIIDs[MP_ITFCOUNT] =
+{
+    &XA_IID_OBJECT,
+    &XA_IID_DYNAMICINTERFACEMANAGEMENT,
+    &XA_IID_PLAY,
+    &XA_IID_SEEK,
+    &XA_IID_VOLUME,
+    &XA_IID_PREFETCHSTATUS,
+    &XA_IID_CONFIGEXTENSION,
+    &XA_IID_DYNAMICSOURCE,
+    &XA_IID_EQUALIZER,
+    &XA_IID_IMAGECONTROLS,
+    &XA_IID_IMAGEEFFECTS,
+    &XA_IID_METADATAEXTRACTION,
+    &XA_IID_METADATATRAVERSAL,
+    &XA_IID_PLAYBACKRATE,
+    &XA_IID_VIDEOPOSTPROCESSING
+};
+
+/* Global methods */
+
+/* XAResult XAMediaPlayerImpl_CreateMediaPlayer
+ * Create object
+ */
+XAresult XAMediaPlayerImpl_CreateMediaPlayer(XAObjectItf *pPlayer,
+                                             XADataSource *pDataSrc,
+                                             XADataSource *pBankSrc,
+                                             XADataSink *pAudioSnk,
+                                             XADataSink *pImageVideoSnk,
+                                             XADataSink *pVibra,
+                                             XADataSink *pLEDArray,
+                                             XAuint32 numInterfaces,
+                                             const XAInterfaceID *pInterfaceIds,
+                                             const XAboolean *pInterfaceRequired)
+{
+    XAuint8 itfIdx = 0;
+    XAMediaType mediaType = XA_MEDIATYPE_UNKNOWN;
+    XAMediaPlayerImpl* pPlayerImpl = NULL;
+    XAObjectItfImpl* pBaseObj = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+    XADataLocator_URI* tmpUri;
+
+    DEBUG_API("->XAMediaPlayerImpl_CreateMediaPlayer");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaPlayer);
+
+    if(!pPlayer || !pDataSrc)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    /* check sink&source parameters */
+    ret = XACommon_ValidateDataLocator(6, pAudioSnk, pImageVideoSnk, pDataSrc,
+                                          pBankSrc, pVibra, pLEDArray);
+    if(ret!=XA_RESULT_SUCCESS)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+        DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer");
+        return ret;
+    }
+    /* also, check source availability */
+    ret = XACommon_CheckDataSource(pDataSrc,&mediaType);
+    if(ret!=XA_RESULT_SUCCESS)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+        DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer");
+        return ret;
+    }
+
+    /* instantiate object */
+    pPlayerImpl = (XAMediaPlayerImpl*)calloc(1,sizeof(XAMediaPlayerImpl));
+    if(!pPlayerImpl)
+    {
+        /* memory allocation failed */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+        DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer");
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+    pBaseObj = &pPlayerImpl->baseObj;
+
+    /* Initialize base object default implementation */
+    XAObjectItfImpl_Init(pBaseObj, MP_ITFCOUNT, xaMediaPlayerItfIIDs,
+                         XAMediaPlayerImpl_DoRealize, XAMediaPlayerImpl_DoResume,
+                         XAMediaPlayerImpl_FreeResources);
+
+    /* Mark interfaces that need to be exposed */
+    /* Implicit and mandated interfaces */
+    pBaseObj->interfaceMap[MP_PLAYITF].required = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[MP_DIMITF].required = XA_BOOLEAN_TRUE;
+
+    /* Explicit interfaces */
+    if((numInterfaces != 0) && pInterfaceIds && pInterfaceRequired)
+    {
+        /* Check required interfaces */
+        for(itfIdx = 0; itfIdx < numInterfaces; itfIdx++)
+        {
+            /* If mapEntry is null then required interface is not supported.*/
+            XAObjItfMapEntry *entry =
+                XAObjectItfImpl_GetItfEntry((XAObjectItf)&(pBaseObj), pInterfaceIds[itfIdx]);
+            if( !entry  )
+            {
+                if( pInterfaceRequired[itfIdx] )
+                {
+                    /* required interface cannot be accommodated - fail creation */
+                    DEBUG_ERR("Required interface not found - abort creation!");
+                    ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                    break;
+                }
+                else
+                {
+                    DEBUG_INFO("Requested (not required) interface not found - continue creation");
+                }
+            }
+            else
+            {   /* weed out unsupported content-aware itf's */
+                if( (mediaType==XA_MEDIATYPE_IMAGE &&
+                             (entry->mapIdx==MP_SEEKITF ||
+                              entry->mapIdx==MP_EQUALIZERITF ||
+                              entry->mapIdx==MP_VOLUMEITF))
+                        ||
+                    (mediaType==XA_MEDIATYPE_AUDIO &&
+                             (entry->mapIdx==MP_IMAGECONTROLSITF ||
+                              entry->mapIdx==MP_IMAGEEFFECTSITF ||
+                              entry->mapIdx==MP_VIDEOPOSTPROCESSINGITF)) )
+                {
+                    entry->required = XA_BOOLEAN_FALSE;
+                    if( pInterfaceRequired[itfIdx] )
+                    {
+                        DEBUG_ERR("Required interface not supported for given media - abort creation!");
+                        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                        break;
+                    }
+                }
+                else
+                {
+                    entry->required = XA_BOOLEAN_TRUE;
+                }
+            }
+        }
+    }
+
+    if(ret!=XA_RESULT_SUCCESS)
+    {   /* creation fails */
+        XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+        return ret;
+    }
+
+    /* Mark interfaces that can be handled dynamically */
+    /* Mandated dynamic itfs */
+    pBaseObj->interfaceMap[MP_EQUALIZERITF].isDynamic = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[MP_IMAGEEFFECTSITF].isDynamic = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[MP_METADATAEXTRACTIONITF].isDynamic = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[MP_METADATATRAVERSALITF].isDynamic = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[MP_PLAYBACKRATEITF].isDynamic = XA_BOOLEAN_TRUE;
+
+
+    /* Set ObjectItf to point to newly created object */
+    *pPlayer = (XAObjectItf)&(pBaseObj->self);
+
+    /* initialize XAPlayerImpl variables */
+
+    pPlayerImpl->dataSrc = pDataSrc;
+    pPlayerImpl->bankSrc = pBankSrc;
+    pPlayerImpl->audioSnk = pAudioSnk;
+    pPlayerImpl->imageVideoSnk = pImageVideoSnk;
+    pPlayerImpl->vibra = pVibra;
+    pPlayerImpl->LEDArray = pLEDArray;
+    
+    tmpUri = (XADataLocator_URI*)(pPlayerImpl->dataSrc->pLocator);
+    XAMediaPlayerImpl_DeterminePlaybackEngine(*pPlayer, tmpUri);
+    
+    /* This code is put here to return Feature Not Supported since adaptation is not present*/
+    /*************************************************/
+    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+    DEBUG_ERR("Required interface not found - abort creation!");
+    DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+    /*************************************************/
+    
+/*    if(pPlayerImpl->isMMFPlayback)
+    {
+        pPlayerImpl->adaptationCtxMMF = XAMediaPlayerAdaptMMF_Create(pPlayerImpl->dataSrc,
+                                                               pPlayerImpl->bankSrc,
+                                                               pPlayerImpl->audioSnk,
+                                                               pPlayerImpl->imageVideoSnk,
+                                                               pPlayerImpl->vibra,
+                                                               pPlayerImpl->LEDArray);
+    
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_  
+       pPlayerImpl->adaptationCtx = XAMediaPlayerAdapt_Create(pPlayerImpl->dataSrc,
+                                                           pPlayerImpl->bankSrc,
+                                                           pPlayerImpl->audioSnk,
+                                                           pPlayerImpl->imageVideoSnk,
+                                                           pPlayerImpl->vibra,
+                                                           pPlayerImpl->LEDArray);
+#endif
+    }
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+    DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer");
+    return XA_RESULT_SUCCESS;*/
+}
+
+/* XAResult XAMediaPlayerImpl_QueryNumSupportedInterfaces
+ * Statically query supported interfaces
+ */
+XAresult XAMediaPlayerImpl_QueryNumSupportedInterfaces(XAuint32 * pNumSupportedInterfaces)
+{
+    DEBUG_API("->XAMediaPlayerImpl_QueryNumSupportedInterfaces");
+
+    if(pNumSupportedInterfaces)
+    {
+        *pNumSupportedInterfaces = MP_ITFCOUNT;
+        DEBUG_API("<-XAMediaPlayerImpl_QueryNumSupportedInterfaces");
+        return XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMediaPlayerImpl_QueryNumSupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+}
+
+/* XAResult XAMediaPlayerImpl_QuerySupportedInterfaces
+ * Statically query supported interfaces
+ */
+XAresult XAMediaPlayerImpl_QuerySupportedInterfaces(XAuint32 index,
+                                                    XAInterfaceID * pInterfaceId)
+{
+    DEBUG_API("->XAMediaPlayerImpl_QuerySupportedInterfaces");
+
+    if (index >= MP_ITFCOUNT || !pInterfaceId )
+    {
+        if(pInterfaceId)
+            {
+            *pInterfaceId = XA_IID_NULL;
+            }
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMediaPlayerImpl_QuerySupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        *pInterfaceId = *(xaMediaPlayerItfIIDs[index]);
+        DEBUG_API("<-XAMediaPlayerImpl_QuerySupportedInterfaces");
+        return XA_RESULT_SUCCESS;
+    }
+}
+
+/*
+ * Realize the object
+ */
+XAresult XAMediaPlayerImpl_DoRealize(XAObjectItf self)
+{
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAMediaPlayerImpl* pImpl = (XAMediaPlayerImpl*)(pObj);
+    XAuint8 itfIdx = 0;
+    void *pItf = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+    XADataLocator_URI* tmpUri;
+
+    DEBUG_API("->XAMediaPlayerImpl_DoRealize");
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    /* check casting from correct pointer type */
+    if(!pImpl || pObj != pImpl->baseObj.self)
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMediaPlayerImpl_DoRealize");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* Realize all implicit and explicitly wanted interfaces */
+    for(itfIdx = 0; itfIdx < MP_ITFCOUNT; itfIdx++)
+    {
+        if(!(pObj->interfaceMap[itfIdx].pItf) && pObj->interfaceMap[itfIdx].required)
+        {
+            switch(itfIdx)
+            {
+                case MP_DIMITF:
+                    pItf = XADIMItfImpl_Create();
+                    if(pItf)
+                    {
+                        XADIMItfImpl_Init(pItf, self,
+                                          XAMediaPlayerImpl_DoAddItf,
+                                          XAMediaPlayerImpl_DoResumeItf,
+                                          XAMediaPlayerImpl_DoRemoveItf);
+                    }
+                    break;
+                case MP_PLAYITF:
+                    pItf = XAPlayItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+                            pImpl->adaptationCtx,
+#endif
+                            pImpl->adaptationCtxMMF);
+                    if ( pImpl->dataSrc )
+                    {
+                		XAuint32 locType = *((XAuint32*)(pImpl->dataSrc->pLocator));
+                		if ( locType == XA_DATALOCATOR_IODEVICE )
+                		    {
+                			XADataLocator_IODevice *ioDevice = (XADataLocator_IODevice*)(pImpl->dataSrc->pLocator);
+                			if ( ioDevice->deviceType == XA_IODEVICE_CAMERA)
+                			    {
+                				vfHandle = (void*) pItf;
+                				DEBUG_INFO_A1("Stored view finder pointer to global address %x", vfHandle);
+                			    }
+                		    }
+                		else if(locType == XA_DATALOCATOR_URI )
+                		    {
+                            tmpUri = (XADataLocator_URI*)(pImpl->dataSrc->pLocator);
+                            XAPlayItfImpl_DeterminePlaybackEngine(pItf, tmpUri);
+                		    }
+                		else
+                		    {
+                		
+                		    }
+                    }
+                    break;
+                case MP_VOLUMEITF:
+#ifdef _GSTREAMER_BACKEND_  
+                    pItf = XAVolumeItfImpl_Create(pImpl->adaptationCtx);
+                    break;
+                case MP_SEEKITF:
+                    pItf = XASeekItfImpl_Create(pImpl->adaptationCtx);
+                    break;
+                case MP_PREFETCHSTATUSITF:
+                    pItf = XAPrefetchStatusItfImpl_Create( pImpl->adaptationCtx );
+                    break;
+                case MP_METADATAEXTRACTIONITF:
+                    pItf = XAMetadataExtractionItfImpl_Create( pImpl->adaptationCtx );
+                    break;
+                case MP_METADATATRAVERSALITF:
+                    pItf = XAMetadataTraversalItfImpl_Create( pImpl->adaptationCtx );
+                    break;
+                case MP_PLAYBACKRATEITF:
+                    pItf = XAPlaybackRateItfImpl_Create(pImpl->adaptationCtx);
+                    break;
+                case MP_CONFIGEXTENSIONITF:
+                    pItf = XAConfigExtensionsItfImpl_Create();
+                    XAConfigExtensionsItfImpl_SetContext( pItf, pImpl->adaptationCtx);
+                    break;
+                case MP_DYNAMICSOURCEITF:
+                    pItf = XADynamicSourceItfImpl_Create(pImpl->adaptationCtx);
+                    break;
+                case MP_EQUALIZERITF:
+                    pItf = XAEqualizerItfImpl_Create(pImpl->adaptationCtx);
+                    break;
+                case MP_IMAGECONTROLSITF:
+                    pItf = XAImageControlsItfImpl_Create(pImpl->adaptationCtx);
+                    break;
+                case MP_IMAGEEFFECTSITF:
+                    pItf = XAImageEffectsItfImpl_Create(pImpl->adaptationCtx);
+                    break;
+                case MP_VIDEOPOSTPROCESSINGITF:
+                    pItf = XAVideoPostProcessingItfImpl_Create(pImpl->adaptationCtx);
+#endif
+                    break;
+                default:
+                    break;
+            }
+            if(!pItf)
+            {
+                /* Memory allocation failed */
+                XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+                DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+                DEBUG_API("<-XAMediaPlayerImpl_DoRealize");
+                return XA_RESULT_MEMORY_FAILURE;
+            }
+            else
+            {
+                pObj->interfaceMap[itfIdx].pItf = pItf;
+            }
+        }
+    }
+    /* init adaptation */
+    if(pImpl->isMMFPlayback)
+    {
+       ret = XAMediaPlayerAdaptMMF_PostInit( pImpl->adaptationCtxMMF );
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+       ret = XAMediaPlayerAdapt_PostInit( pImpl->adaptationCtx );
+#endif
+    }
+    if ( ret != XA_RESULT_SUCCESS )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("Adaptation init failed!");
+        DEBUG_API("<-XAMediaPlayerImpl_DoRealize");
+        return ret;
+    }
+
+    pObj->state = XA_OBJECT_STATE_REALIZED;
+
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+    DEBUG_API("<-XAMediaPlayerImpl_DoRealize");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * Resume object
+ */
+XAresult XAMediaPlayerImpl_DoResume(XAObjectItf self)
+{
+    DEBUG_API("->XAMediaPlayerImpl_DoResume");
+    DEBUG_API("<-XAMediaPlayerImpl_DoResume");
+    /* suspended state not supported by this implementation */
+    return XA_RESULT_PRECONDITIONS_VIOLATED;
+}
+
+/**
+ * void XAMediaPlayerImpl_FreeResources(XAObjectItf self)
+ * Description: Free all resources reserved at XAMediaPlayerImpl_DoRealize()
+ **/
+void XAMediaPlayerImpl_FreeResources(XAObjectItf self)
+{
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAuint8 itfIdx = 0;
+
+    DEBUG_API("->XAMediaPlayerImpl_FreeResources");
+    XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS( XATSMediaPlayer );
+#ifdef _GSTREAMER_BACKEND_
+    XAMediaPlayerImpl* pImpl = (XAMediaPlayerImpl*)pObj;
+    assert(pObj && pImpl && pObj == pObj->self);
+#endif
+
+    
+
+    for(itfIdx = 0; itfIdx < MP_ITFCOUNT; itfIdx++)
+    {
+        void *pItf = pObj->interfaceMap[itfIdx].pItf;
+        if(pItf)
+        {
+            switch(itfIdx)
+            {
+                case MP_DIMITF:
+                    XADIMItfImpl_Free(pItf);
+                    break;
+                case MP_PLAYITF:
+                    XAPlayItfImpl_Free(pItf);
+                    break;
+                case MP_VOLUMEITF:
+                    XAVolumeItfImpl_Free(pItf);
+                    break;
+                case MP_SEEKITF:
+                    XASeekItfImpl_Free(pItf);
+                    break;
+                case MP_PREFETCHSTATUSITF:
+                    XAPrefetchStatusItfImpl_Free(pItf);
+                    break;
+                case MP_METADATAEXTRACTIONITF:
+                    XAMetadataExtractionItfImpl_Free(pItf);
+                    break;
+                case MP_METADATATRAVERSALITF:
+                    XAMetadataTraversalItfImpl_Free(pItf);
+                    break;
+                case MP_PLAYBACKRATEITF:
+                    XAPlaybackRateItfImpl_Free(pItf);
+                    break;
+                case MP_CONFIGEXTENSIONITF:
+                    XAConfigExtensionsItfImpl_Free(pItf);
+                    break;
+                case MP_DYNAMICSOURCEITF:
+                    XADynamicSourceItfImpl_Free(pItf);
+                    break;
+                case MP_EQUALIZERITF:
+                    XAEqualizerItfImpl_Free(pItf);
+                    break;
+                case MP_IMAGECONTROLSITF:
+                    XAImageControlsItfImpl_Free(pItf);
+                    break;
+                case MP_IMAGEEFFECTSITF:
+                    XAImageEffectsItfImpl_Free(pItf);
+                    break;
+                case MP_VIDEOPOSTPROCESSINGITF:
+                    XAVideoPostProcessingItfImpl_Free(pItf);
+                    break;
+            }
+            pObj->interfaceMap[itfIdx].pItf = NULL;
+        }
+    }
+#ifdef _GSTREAMER_BACKEND_
+    if ( pImpl->adaptationCtx != NULL )
+    {
+        XAMediaPlayerAdapt_Destroy( pImpl->adaptationCtx );
+        pImpl->adaptationCtx = NULL;
+    }
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS( XATSMediaPlayer );
+    DEBUG_API("<-XAMediaPlayerImpl_FreeResources");
+    return;
+}
+
+/* XAMediaPlayerImpl_DoAddItf
+ * Dynamically add an interface, object specific parts
+ */
+XAresult XAMediaPlayerImpl_DoAddItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  )
+{
+#ifdef _GSTREAMER_BACKEND_  
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAMediaPlayerImpl* pImpl = (XAMediaPlayerImpl*)(pObj);
+#endif
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAMediaPlayerImpl_DoAddItf");
+
+    if(mapEntry)
+    {
+        switch( mapEntry->mapIdx )
+            {
+#ifdef _GSTREAMER_BACKEND_  
+            case MP_METADATAEXTRACTIONITF:
+                mapEntry->pItf = XAMetadataExtractionItfImpl_Create( pImpl->adaptationCtx );
+                break;
+            case MP_METADATATRAVERSALITF:
+                mapEntry->pItf = XAMetadataTraversalItfImpl_Create( pImpl->adaptationCtx );
+                break;
+            case MP_PLAYBACKRATEITF:
+                mapEntry->pItf = XAPlaybackRateItfImpl_Create(pImpl->adaptationCtx);
+                break;
+            case MP_EQUALIZERITF:
+                mapEntry->pItf = XAEqualizerItfImpl_Create( pImpl->adaptationCtx );
+                break;
+            case MP_IMAGEEFFECTSITF:
+                mapEntry->pItf = XAImageEffectsItfImpl_Create( pImpl->adaptationCtx );
+                break;
+#endif
+            default:
+                DEBUG_ERR("XAMediaPlayerImpl_DoAddItf unknown id");
+                ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                break;
+            }
+        
+        if( !mapEntry->pItf && ret == XA_RESULT_SUCCESS)
+            {
+            DEBUG_ERR("XAMediaPlayerImpl_DoAddItf itf creation failed");
+            ret = XA_RESULT_MEMORY_FAILURE;
+            }
+    }
+    else
+    {
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_API("<-XAMediaPlayerImpl_DoAddItf");
+    return ret;
+}
+
+/* XAMediaPlayerImpl_DoResumeItf
+ * Try to resume lost interface, object specific parts
+ */
+XAresult XAMediaPlayerImpl_DoResumeItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  )
+{
+    /* For now, no difference between suspended and unrealised itfs */
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAMediaPlayerImpl_DoResumeItf");
+    ret = XAMediaPlayerImpl_DoAddItf(self,mapEntry);
+    DEBUG_API("<-XAMediaPlayerImpl_DoResumeItf");
+    return ret;
+}
+
+/* XAMediaPlayerImpl_DoRemoveItf
+ * Dynamically remove an interface, object specific parts
+ */
+XAresult XAMediaPlayerImpl_DoRemoveItf(XAObjectItf self, XAObjItfMapEntry *mapEntry )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAMediaPlayerImpl_DoRemoveItf");
+
+    if(mapEntry)
+    {
+        switch( mapEntry->mapIdx )
+        {
+            case MP_METADATAEXTRACTIONITF:
+                XAMetadataExtractionItfImpl_Free(mapEntry->pItf);
+                break;
+            case MP_METADATATRAVERSALITF:
+                XAMetadataTraversalItfImpl_Free(mapEntry->pItf);
+                break;
+            case MP_PLAYBACKRATEITF:
+                XAPlaybackRateItfImpl_Free(mapEntry->pItf);
+                break;
+            case MP_EQUALIZERITF:
+                XAEqualizerItfImpl_Free(mapEntry->pItf);
+                break;
+            case MP_IMAGEEFFECTSITF:
+                XAImageEffectsItfImpl_Free(mapEntry->pItf);
+                break;
+            default:
+                DEBUG_ERR("XAMediaPlayerImpl_DoRemoveItf unknown id");
+                ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                break;
+        }
+        mapEntry->pItf = NULL;
+    }
+    else
+    {
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_API("<-XAMediaPlayerImpl_DoRemoveItf");
+    return ret;
+}
+XAresult XAMediaPlayerImpl_DeterminePlaybackEngine(XAObjectItf self, XADataLocator_URI *uri)
+{
+ 
+  XAresult ret = XA_RESULT_SUCCESS;
+  char* tempPtr = NULL;
+  char extension[5];
+  
+  XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+  XAMediaPlayerImpl* pImpl = (XAMediaPlayerImpl*)pObj;
+  DEBUG_API("->XAMediaPlayerImpl_DeterminePlaybackEngine");
+    
+  //need to move to configuration file and add more in final class
+  
+  pImpl->isMMFPlayback = XA_BOOLEAN_TRUE;
+	
+  tempPtr = strchr((char*)(uri->URI), '.');
+  strcpy(extension, tempPtr);
+	
+  if(!strcmp(extension, ".wav"))
+  {
+     pImpl->isMMFPlayback = XA_BOOLEAN_FALSE;
+  }
+
+  DEBUG_API("<-XAMediaPlayerImpl_DeterminePlaybackEngine"); 
+  return ret;  
+  
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediaplayer/xamediaplayer.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,96 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAMEDIAPLAYER_H
+#define XAMEDIAPLAYER_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#include "xaobjectitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAMediaPlayerAdaptCtx.h"
+#endif
+#include "xamediaplayeradaptctxmmf.h"
+
+/** MACROS **/
+
+
+/** TYPES **/
+
+
+/** ENUMERATIONS **/
+/* Enumeration for interfaces that MediaPlayer supports.  */
+typedef enum
+{
+    MP_OBJECTITF,
+    MP_DIMITF,
+    MP_PLAYITF,
+    MP_SEEKITF,
+    MP_VOLUMEITF,
+    MP_PREFETCHSTATUSITF,
+    MP_CONFIGEXTENSIONITF,
+    MP_DYNAMICSOURCEITF,
+    MP_EQUALIZERITF,
+    MP_IMAGECONTROLSITF,
+    MP_IMAGEEFFECTSITF,
+    MP_METADATAEXTRACTIONITF,
+    MP_METADATATRAVERSALITF,
+    MP_PLAYBACKRATEITF,
+    MP_VIDEOPOSTPROCESSINGITF,
+    MP_ITFCOUNT
+} MPInterfaces;
+
+/** STRUCTURES **/
+/* Specification for XAMediaPlayerImpl.*/
+typedef struct XAMediaPlayerImpl_
+{
+    /* Parent for XAMediaPlayerImpl */
+    XAObjectItfImpl baseObj;
+
+    /* variables */
+    XADataSource *dataSrc;
+    XADataSource *bankSrc;
+    XADataSink *audioSnk;
+    XADataSink *imageVideoSnk;
+    XADataSink *vibra;
+    XADataSink *LEDArray;
+    XAuint32 numRequiredInterfaces;
+    XAInterfaceID *requiredItfIds;
+
+#ifdef _GSTREAMER_BACKEND_
+    XAAdaptationBaseCtx* adaptationCtx;
+#endif
+    XAAdaptationBaseMMFCtx* adaptationCtxMMF;
+    XAboolean isMMFPlayback;
+} XAMediaPlayerImpl;
+
+
+/** METHODS **/
+
+/* base object XAObjectItfImpl methods */
+XAresult XAMediaPlayerImpl_DoRealize(XAObjectItf self);
+XAresult XAMediaPlayerImpl_DoResume(XAObjectItf self);
+void XAMediaPlayerImpl_FreeResources(XAObjectItf self);
+
+XAresult XAMediaPlayerImpl_DeterminePlaybackEngine(XAObjectItf self, XADataLocator_URI *uri);
+
+/* DynamicInterfaceManagement object-specific methods */
+XAresult XAMediaPlayerImpl_DoAddItf(XAObjectItf self, XAObjItfMapEntry *mapEntry );
+XAresult XAMediaPlayerImpl_DoResumeItf(XAObjectItf self, XAObjItfMapEntry *mapEntry );
+XAresult XAMediaPlayerImpl_DoRemoveItf(XAObjectItf self, XAObjItfMapEntry *mapEntry );
+
+#endif /* XAMEDIAPLAYER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediaplayer/xaplaybackrateitf.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xaplaybackrateitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAPlaybackRateItfAdaptation.h"
+#endif
+#include "xathreadsafety.h"
+
+static XAPlaybackRateItfImpl* GetImpl(XAPlaybackRateItf self)
+{
+    if(self)
+    {
+        XAPlaybackRateItfImpl *impl = (XAPlaybackRateItfImpl*)(*self);
+        if(impl && impl == impl->self)
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAPlaybackRateItf implementation
+ */
+XAresult XAPlaybackRateItfImpl_SetRate(XAPlaybackRateItf self, XApermille rate)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XAPlaybackRateItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAPlaybackRateItfImpl_SetRate");
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    if( !impl )
+    {
+
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlaybackRateItfImpl_SetRate");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    res = XAPlaybackRateItfAdapt_SetRate(impl->adaptCtx, rate);
+#endif
+    if(res == XA_RESULT_SUCCESS)
+    {
+        impl->currentRate = rate;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+    DEBUG_API("<-XAPlaybackRateItfImpl_SetRate");
+    return res;
+}
+
+XAresult XAPlaybackRateItfImpl_GetRate(XAPlaybackRateItf self, XApermille *pRate)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XAPlaybackRateItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAPlaybackRateItfImpl_GetRate");
+
+    if( !impl || !pRate )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlaybackRateItfImpl_GetRate");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    *pRate = impl->currentRate;
+
+    DEBUG_API("<-XAPlaybackRateItfImpl_GetRate");
+    return res;
+}
+
+XAresult XAPlaybackRateItfImpl_SetPropertyConstraints(XAPlaybackRateItf self,
+                                                        XAuint32 constraints)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XAPlaybackRateItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAPlaybackRateItfImpl_SetPropertyConstraints");
+
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+    if( !impl )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlaybackRateItfImpl_SetPropertyConstraints");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    
+#ifdef _GSTREAMER_BACKEND_
+    /* set to adaptation */
+    res = XAPlaybackRateItfAdapt_SetPropertyConstraints(impl->adaptCtx, constraints);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+    DEBUG_API("<-XAPlaybackRateItfImpl_SetPropertyConstraints");
+    return res;
+}
+
+XAresult XAPlaybackRateItfImpl_GetProperties(XAPlaybackRateItf self,
+                                               XAuint32 *pProperties)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XAPlaybackRateItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAPlaybackRateItfImpl_GetProperties");
+
+    if( !impl || !pProperties )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlaybackRateItfImpl_GetProperties");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+   
+#ifdef _GSTREAMER_BACKEND_
+    /* needs to be queried from adaptation */
+    res = XAPlaybackRateItfAdapt_GetProperties(impl->adaptCtx, pProperties);
+#endif
+    DEBUG_API("<-XAPlaybackRateItfImpl_GetProperties");
+    return res;
+}
+
+XAresult XAPlaybackRateItfImpl_GetCapabilitiesOfRate(XAPlaybackRateItf self,
+                                                       XApermille rate,
+                                                       XAuint32 *pCapabilities)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XAPlaybackRateItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAPlaybackRateItfImpl_GetCapabilitiesOfRate");
+
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+    if( !impl || !pCapabilities )
+    {
+
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlaybackRateItfImpl_GetCapabilitiesOfRate");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    
+#ifdef _GSTREAMER_BACKEND_
+    /* needs to be queried from adaptation */
+    res = XAPlaybackRateItfAdapt_GetCapabilitiesOfRate(impl->adaptCtx, rate, pCapabilities);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+    DEBUG_API("<-XAPlaybackRateItfImpl_GetCapabilitiesOfRate");
+    return res;
+}
+
+XAresult XAPlaybackRateItfImpl_GetRateRange(XAPlaybackRateItf self,
+                                              XAuint8 index,
+                                              XApermille *pMinRate,
+                                              XApermille *pMaxRate,
+                                              XApermille *pStepSize,
+                                              XAuint32 *pCapabilities)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XAPlaybackRateItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAPlaybackRateItfImpl_GetRateRange");
+
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+    if( !impl || !pMinRate || !pMaxRate || !pStepSize || !pCapabilities )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlaybackRateItfImpl_GetRateRange");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    
+#ifdef _GSTREAMER_BACKEND_
+    /* needs to be queried from adaptation */
+    res = XAPlaybackRateItfAdapt_GetRateRange(impl->adaptCtx, index, pMinRate,
+                                              pMaxRate,pStepSize, pCapabilities);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+    DEBUG_API("<-XAPlaybackRateItfImpl_GetRateRange");
+    return res;
+}
+
+/**
+ * XAPlaybackRateItfImpl -specific methods
+ **/
+#ifdef _GSTREAMER_BACKEND_
+
+/**
+ * XAPlaybackRateItfImpl* XAPlaybackRateItfImpl_Create();
+ * @return  XAPlaybackRateItfImpl* - Pointer to  PlaybackRateItf interface implementation
+ **/
+XAPlaybackRateItfImpl* XAPlaybackRateItfImpl_Create( XAAdaptationBaseCtx *adaptCtx )
+{
+    XAPlaybackRateItfImpl *self = (XAPlaybackRateItfImpl*)
+        calloc(1,sizeof(XAPlaybackRateItfImpl));
+    DEBUG_API("->XAPlaybackRateItfImpl_Create");
+
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.GetCapabilitiesOfRate = XAPlaybackRateItfImpl_GetCapabilitiesOfRate;
+        self->itf.GetProperties = XAPlaybackRateItfImpl_GetProperties;
+        self->itf.GetRate = XAPlaybackRateItfImpl_GetRate;
+        self->itf.GetRateRange = XAPlaybackRateItfImpl_GetRateRange;
+        self->itf.SetPropertyConstraints = XAPlaybackRateItfImpl_SetPropertyConstraints;
+        self->itf.SetRate = XAPlaybackRateItfImpl_SetRate;
+
+        /* init variables */
+        self->adaptCtx = adaptCtx;
+        self->currentRate = 1000;
+        self->self = self;
+    }
+
+    DEBUG_API("<-XAPlaybackRateItfImpl_Create");
+    return self;
+}
+#endif
+/**
+ * void XAPlaybackRateItfImpl_Free(XAPlaybackRateItfImpl* self);
+ * @param  XAPlaybackRateItfImpl* self -
+ **/
+void XAPlaybackRateItfImpl_Free(XAPlaybackRateItfImpl* self)
+{
+    DEBUG_API("->XAPlaybackRateItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAPlaybackRateItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediaplayer/xaplaybackrateitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAPLAYBACKRATEITF_H
+#define XAPLAYBACKRATEITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAPlaybackRateItf implementation */
+typedef struct XAPlaybackRateItfImpl_
+{
+    /* parent interface */
+    struct XAPlaybackRateItf_ itf;
+    /* pointer to self */
+    struct XAPlaybackRateItfImpl_* self;
+
+#ifdef _GSTREAMER_BACKEND_
+    /* variables */
+    XAAdaptationBaseCtx *adaptCtx;
+#endif
+    XApermille currentRate;
+
+} XAPlaybackRateItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAPlaybackRateItf implementation */
+XAresult XAPlaybackRateItfImpl_SetRate(XAPlaybackRateItf self, XApermille rate);
+
+XAresult XAPlaybackRateItfImpl_GetRate(XAPlaybackRateItf self, XApermille *pRate);
+
+XAresult XAPlaybackRateItfImpl_SetPropertyConstraints(XAPlaybackRateItf self,
+                                                        XAuint32 constraints);
+
+XAresult XAPlaybackRateItfImpl_GetProperties(XAPlaybackRateItf self,
+                                               XAuint32 *pProperties);
+
+XAresult XAPlaybackRateItfImpl_GetCapabilitiesOfRate(XAPlaybackRateItf self,
+                                                       XApermille rate,
+                                                       XAuint32 *pCapabilities);
+
+XAresult XAPlaybackRateItfImpl_GetRateRange(XAPlaybackRateItf self,
+                                              XAuint8 index,
+                                              XApermille *pMinRate,
+                                              XApermille *pMaxRate,
+                                              XApermille *pStepSize,
+                                              XAuint32 *pCapabilities);
+
+#ifdef _GSTREAMER_BACKEND_
+
+/* XAPlaybackRateItfImpl -specific methods */
+XAPlaybackRateItfImpl* XAPlaybackRateItfImpl_Create( XAAdaptationBaseCtx *adaptCtx );
+#endif
+void XAPlaybackRateItfImpl_Free(XAPlaybackRateItfImpl* self);
+
+#endif /* XAPLAYBACKRATEITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediaplayer/xaplayitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,647 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "xaplayitf.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAPlayItfAdaptation.h"
+#endif
+#include "xaplayitfadaptationmmf.h"
+#include "xathreadsafety.h"
+#include <string.h>
+
+void* vfHandle;
+
+/* XAPlayItfImpl* GetImpl
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XAPlayItfImpl* GetImpl(XAPlayItf self)
+{
+    if(self)
+    {
+        XAPlayItfImpl* impl = (XAPlayItfImpl*)(*self);
+        if(impl && impl == impl->self)
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAPlayItf implementation
+ */
+
+/**
+ * XAresult XAPlayItfImpl_SetPlayState(XAPlayItf self, XAuint32 state)
+ * Description: Requests a transition of the player into the given play state.
+ **/
+XAresult XAPlayItfImpl_SetPlayState(XAPlayItf self, XAuint32 state)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPlayItfImpl* impl = GetImpl(self);
+    DEBUG_API_A1("->XAPlayItfImpl_SetPlayState %s",PLAYSTATENAME(state));
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    if( !impl || state < XA_PLAYSTATE_STOPPED || state > XA_PLAYSTATE_PLAYING )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlayItfImpl_SetPlayState");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is play state changed, if not do nothing */
+    if(state != impl->playbackState)
+    {
+        if(state == XA_PLAYSTATE_PLAYING)
+        {
+#ifdef _GSTREAMER_BACKEND_
+        XAPlayItfAdapt_GetPosition(impl->adapCtx, &(impl->lastPosition));
+#endif        
+        }
+        if(impl->isMMFPlayback)
+        {
+           ret = XAPlayItfAdaptMMF_SetPlayState(impl->adaptCtxMMF, state);    
+        }
+        else
+        {
+#ifdef _GSTREAMER_BACKEND_
+        ret = XAPlayItfAdapt_SetPlayState(impl->adapCtx, state);
+#endif        
+        }
+
+        if(ret == XA_RESULT_SUCCESS)
+        {
+            impl->playbackState = state;
+            if(state == XA_PLAYSTATE_STOPPED || state == XA_PLAYSTATE_PAUSED)
+            {
+                impl->isMarkerPosCbSend = XA_BOOLEAN_FALSE;
+                impl->lastPosition = 0;
+            }
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+    DEBUG_API("<-XAPlayItfImpl_SetPlayState");
+    return ret;
+}
+
+/**
+ * XAresult XAPlayItfImpl_GetPlayState(XAPlayItf self, XAuint32 *pState)
+ * Description: Gets the player's current play state.
+ **/
+XAresult XAPlayItfImpl_GetPlayState(XAPlayItf self, XAuint32 *pState)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPlayItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAPlayItfImpl_GetPlayState");
+
+    if(!impl || !pState)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlayItfImpl_GetPlayState");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pState = impl->playbackState;
+
+    DEBUG_API_A1("<-XAPlayItfImpl_GetPlayState: %s",PLAYSTATENAME(impl->playbackState));
+    return ret;
+}
+
+/**
+ * XAresult XAPlayItfImpl_GetDuration(XAPlayItf self, XAmillisecond *pMsec)
+ * Description: Gets the duration of the current content, in milliseconds.
+ **/
+XAresult XAPlayItfImpl_GetDuration(XAPlayItf self, XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPlayItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAPlayItfImpl_GetDuration");
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    if(!impl || !pMsec)
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlayItfImpl_GetDuration");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_
+    ret = XAPlayItfAdapt_GetDuration(impl->adapCtx, pMsec);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+    DEBUG_API("<-XAPlayItfImpl_GetDuration");
+    return ret;
+}
+
+/**
+ * XAresult XAPlayItfImpl_GetPosition(XAPlayItf self, XAmillisecond *pMsec)
+ * Description: Returns the current position of the playback head relative
+ * to the beginning of the content.
+ **/
+XAresult XAPlayItfImpl_GetPosition(XAPlayItf self, XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPlayItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAPlayItfImpl_GetPosition");
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+    if(!impl || !pMsec)
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlayItfImpl_GetPosition");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if ( impl->playbackState == XA_PLAYSTATE_STOPPED )
+    {
+    	*pMsec = 0;
+    	DEBUG_API("<-XAPlayItfImpl_GetPosition");
+      XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );    	
+    	return XA_RESULT_SUCCESS;
+    }
+#ifdef _GSTREAMER_BACKEND_
+    ret = XAPlayItfAdapt_GetPosition(impl->adapCtx, pMsec);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+    DEBUG_API("<-XAPlayItfImpl_GetPosition");
+    return ret;
+}
+
+/**
+ * XAresult XAPlayItfImpl_RegisterCallback(XAPlayItf self, xaPlayCallback callback,
+ *                                         void *pContext)
+ * Description: Sets the playback callback function.
+ **/
+XAresult XAPlayItfImpl_RegisterCallback(XAPlayItf self, xaPlayCallback callback,
+                                        void *pContext)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPlayItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XAPlayItfImpl_RegisterCallback");
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlayItfImpl_RegisterCallback");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* callback may be NULL (to remove callback) */
+    impl->callback = callback;
+    impl->cbcontext = pContext;
+    impl->cbPtrToSelf = self;
+
+    DEBUG_API("<-XAPlayItfImpl_RegisterCallback");
+    return ret;
+}
+
+/**
+ * XAresult XAPlayItfImpl_SetCallbackEventsMask(XAPlayItf self, XAuint32 eventFlags)
+ * Description: Enables/disables notification of playback events.
+ **/
+XAresult XAPlayItfImpl_SetCallbackEventsMask(XAPlayItf self, XAuint32 eventFlags)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPlayItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XAPlayItfImpl_SetCallbackEventsMask");
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    if(!impl || ( eventFlags > (XA_PLAYEVENT_HEADATEND | XA_PLAYEVENT_HEADATMARKER |
+                  XA_PLAYEVENT_HEADATNEWPOS | XA_PLAYEVENT_HEADMOVING | XA_PLAYEVENT_HEADSTALLED) ) )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlayItfImpl_SetCallbackEventsMask");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->eventFlags = eventFlags;
+#ifdef _GSTREAMER_BACKEND_
+    /* enable position tracking if client wants so */
+    if( (eventFlags & (XA_PLAYEVENT_HEADATMARKER | XA_PLAYEVENT_HEADATNEWPOS))
+        &&  impl->adapCtx && !impl->positionupdateOn)
+    {
+        ret = XAPlayItfAdapt_EnablePositionTracking(impl->adapCtx, XA_BOOLEAN_TRUE);
+        if( ret == XA_RESULT_SUCCESS )
+        {
+            impl->positionupdateOn = XA_BOOLEAN_TRUE;
+        }
+    }
+    else if( !(eventFlags & (XA_PLAYEVENT_HEADATMARKER | XA_PLAYEVENT_HEADATNEWPOS))
+            &&  impl->adapCtx && impl->positionupdateOn)
+    {
+        ret = XAPlayItfAdapt_EnablePositionTracking(impl->adapCtx, XA_BOOLEAN_FALSE);
+        if( ret == XA_RESULT_SUCCESS )
+        {
+            impl->positionupdateOn = XA_BOOLEAN_FALSE;
+        }
+    }
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+    DEBUG_API("<-XAPlayItfImpl_SetCallbackEventsMask");
+    return ret;
+}
+
+/**
+ * XAresult XAPlayItfImpl_GetCallbackEventsMask(XAPlayItf self, XAuint32 *pEventFlags)
+ * Description: Queries for the notification state (enabled/disabled) of playback events.
+ **/
+XAresult XAPlayItfImpl_GetCallbackEventsMask(XAPlayItf self, XAuint32 *pEventFlags)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPlayItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XAPlayItfImpl_GetCallbackEventsMask");
+    if(!impl || !pEventFlags)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlayItfImpl_GetCallbackEventsMask");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pEventFlags = impl->eventFlags;
+
+    DEBUG_API("<-XAPlayItfImpl_GetCallbackEventsMask");
+    return ret;
+}
+
+/**
+ * XAresult XAPlayItfImpl_SetMarkerPosition(XAPlayItf self, XAmillisecond mSec)
+ * Description: Sets the position of the playback marker.
+ **/
+XAresult XAPlayItfImpl_SetMarkerPosition(XAPlayItf self, XAmillisecond mSec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAmillisecond duration = 0;
+    XAPlayItfImpl* impl = NULL;
+
+
+    DEBUG_API_A1("->XAPlayItfImpl_SetMarkerPosition: %lu ms", mSec);
+    /* Get duration of the content */
+    if(XAPlayItfImpl_GetDuration(self, &duration) != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlayItfImpl_SetMarkerPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl = GetImpl(self);
+
+    if(!impl || mSec > duration)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlayItfImpl_SetMarkerPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    impl->markerPosition = mSec;
+    impl->isMarkerPosCbSend = XA_BOOLEAN_FALSE;
+
+    DEBUG_API("<-XAPlayItfImpl_SetMarkerPosition");
+    return ret;
+}
+
+/**
+ * XAresult XAPlayItfImpl_ClearMarkerPosition(XAPlayItf self)
+ * Description: Clears marker.
+ **/
+XAresult XAPlayItfImpl_ClearMarkerPosition(XAPlayItf self)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPlayItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XAPlayItfImpl_ClearMarkerPosition");
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlayItfImpl_ClearMarkerPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    impl->isMarkerPosCbSend = XA_BOOLEAN_FALSE;
+    impl->markerPosition = NO_POSITION;
+
+    DEBUG_API("<-XAPlayItfImpl_ClearMarkerPosition");
+    return ret;
+}
+
+/**
+ * XAresult XAPlayItfImpl_GetMarkerPosition(XAPlayItf self, XAmillisecond *pMsec)
+ * Description: Queries the position of playback marker.
+ **/
+XAresult XAPlayItfImpl_GetMarkerPosition(XAPlayItf self, XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPlayItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XAPlayItfImpl_GetMarkerPosition");
+    if(!impl || !pMsec)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlayItfImpl_GetMarkerPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(impl->markerPosition == NO_POSITION)
+    {
+        DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+        DEBUG_API("<-XAPlayItfImpl_GetMarkerPosition");
+        /*marker is not set */
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+
+    *pMsec = impl->markerPosition;
+
+    DEBUG_API("<-XAPlayItfImpl_GetMarkerPosition");
+    return ret;
+}
+
+/**
+ * XAresult XAPlayItfImpl_SetPositionUpdatePeriod(XAPlayItf self, XAmillisecond mSec)
+ * Description: Sets the interval between periodic position notifications.
+ **/
+XAresult XAPlayItfImpl_SetPositionUpdatePeriod(XAPlayItf self, XAmillisecond mSec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPlayItfImpl* impl = GetImpl(self);
+
+    DEBUG_API_A1("->XAPlayItfImpl_SetPositionUpdatePeriod, %lu mSec", mSec);
+    if(!impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlayItfImpl_SetPositionUpdatePeriod");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    impl->positionUpdatePeriod = mSec;
+
+    DEBUG_API("<-XAPlayItfImpl_SetPositionUpdatePeriod");
+    return ret;
+}
+
+/**
+ * XAresult XAPlayItfImpl_GetPositionUpdatePeriod(XAPlayItf self, XAmillisecond *pMsec)
+ * Description: Queries the interval between periodic position notifications.
+ **/
+XAresult XAPlayItfImpl_GetPositionUpdatePeriod(XAPlayItf self, XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPlayItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XAPlayItfImpl_GetPositionUpdatePeriod");
+    if(!impl || !pMsec)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPlayItfImpl_GetPositionUpdatePeriod");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pMsec = impl->positionUpdatePeriod;
+
+    DEBUG_API("<-XAPlayItfImpl_GetPositionUpdatePeriod");
+    return ret;
+}
+
+
+/**
+ * XAPlayItfImpl -specific methods
+ **/
+
+/**
+ * XAPlayItfImpl* XAPlayItfImpl_Create()
+ * Description: Allocate and initialize PlayItfImpl
+ **/
+XAPlayItfImpl* XAPlayItfImpl_Create( 
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adapCtx,
+#endif        
+        XAAdaptationBaseMMFCtx *adaptationCtxMMF )
+{
+    XAPlayItfImpl *self;
+
+    DEBUG_API("->XAPlayItfImpl_Create");
+    self = (XAPlayItfImpl*)calloc(1,sizeof(XAPlayItfImpl));
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.ClearMarkerPosition = XAPlayItfImpl_ClearMarkerPosition;
+        self->itf.GetCallbackEventsMask = XAPlayItfImpl_GetCallbackEventsMask;
+        self->itf.GetDuration = XAPlayItfImpl_GetDuration;
+        self->itf.GetMarkerPosition = XAPlayItfImpl_GetMarkerPosition;
+        self->itf.GetPlayState = XAPlayItfImpl_GetPlayState;
+        self->itf.GetPosition = XAPlayItfImpl_GetPosition;
+        self->itf.GetPositionUpdatePeriod = XAPlayItfImpl_GetPositionUpdatePeriod;
+        self->itf.RegisterCallback = XAPlayItfImpl_RegisterCallback;
+        self->itf.SetCallbackEventsMask = XAPlayItfImpl_SetCallbackEventsMask;
+        self->itf.SetMarkerPosition = XAPlayItfImpl_SetMarkerPosition;
+        self->itf.SetPlayState = XAPlayItfImpl_SetPlayState;
+        self->itf.SetPositionUpdatePeriod = XAPlayItfImpl_SetPositionUpdatePeriod;
+
+        /* init variables */
+        self->callback = NULL;
+        self->cbcontext = NULL;
+        self->playbackState = XA_PLAYSTATE_STOPPED;
+        self->eventFlags = 0;
+        self->markerPosition = NO_POSITION;
+        self->positionUpdatePeriod = PLAYITF_DEFAULT_UPDATE_PERIOD;
+        self->lastPosition = START_POSITION;
+#ifdef _GSTREAMER_BACKEND_
+        self->adapCtx = adapCtx;
+#endif        
+        self->adaptCtxMMF = adaptationCtxMMF;
+        self->cbPtrToSelf = NULL;
+        self->isMarkerPosCbSend = XA_BOOLEAN_FALSE;
+
+#ifdef _GSTREAMER_BACKEND_  
+        XAAdaptationBase_AddEventHandler( adapCtx, &XAPlayItfImpl_AdaptCb, XA_PLAYITFEVENTS, self );
+#endif
+
+        self->self = self;
+    }
+
+    DEBUG_API("<-XAPlayItfImpl_Create");
+    return self;
+}
+
+/* void XAPlayItfImpl_Free(XAPlayItfImpl* self)
+ * Description: Free all resources reserved at XAPlayItfImpl_Create
+ */
+void XAPlayItfImpl_Free(XAPlayItfImpl* self)
+{
+    DEBUG_API("->XAPlayItfImpl_Free");
+    assert(self==self->self);
+#ifdef _GSTREAMER_BACKEND_   
+    XAAdaptationBase_RemoveEventHandler( self->adapCtx, &XAPlayItfImpl_AdaptCb );
+#endif    
+    free(self);
+    DEBUG_API("<-XAPlayItfImpl_Free");
+}
+
+#ifdef _GSTREAMER_BACKEND_  
+
+/* void XAPlayItfImpl_AdaptCb
+ * Description: Listen changes in adaptation
+ */
+void XAPlayItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+{
+    XAPlayItfImpl* impl = (XAPlayItfImpl*)pHandlerCtx;
+    XAuint32 newpos = 0;
+
+    DEBUG_API("->XAPlayItfImpl_AdaptCb");
+    XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS( XATSMediaPlayer );
+    if(!impl)
+    {
+        DEBUG_ERR("XAPlayItfImpl_AdaptCb, invalid context pointer!");
+        DEBUG_API("<-XAPlayItfImpl_AdaptCb");
+        XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS( XATSMediaPlayer );
+        return;
+    }
+    assert(event);
+    /* check position update events */
+    if( event->eventid == XA_ADAPT_POSITION_UPDATE_EVT )
+    {
+        assert(event->data);
+        newpos = *((XAuint32*)(event->data));
+        DEBUG_API_A1("Position update from adaptation: new position %lu ms",newpos);
+
+        /* Check is looping start file playing before marker position */
+        if(newpos < impl->markerPosition || impl->lastPosition > newpos)
+        {
+        	DEBUG_INFO("Restart looping, clear marker position callback flag.");
+            impl->isMarkerPosCbSend = XA_BOOLEAN_FALSE;
+        }
+
+        /* check if marker passed and callback needed */
+        if( (impl->markerPosition != NO_POSITION) &&
+            (impl->eventFlags & XA_PLAYEVENT_HEADATMARKER) )
+        {
+            if( impl->callback &&
+                (
+                  ((impl->lastPosition < impl->markerPosition) &&
+                  (newpos > impl->markerPosition))
+                  ||
+                  (newpos == impl->markerPosition)
+                )
+              )
+            {
+                /* Check is callback already send */
+                if( impl->isMarkerPosCbSend != XA_BOOLEAN_TRUE )
+                {
+                    impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_PLAYEVENT_HEADATMARKER);
+                    impl->isMarkerPosCbSend = XA_BOOLEAN_TRUE;
+                }
+            }
+        }
+        /* check if update period passed and callback needed */
+        if( (impl->positionUpdatePeriod > 0) &&
+            (impl->eventFlags & XA_PLAYEVENT_HEADATNEWPOS) &&
+            impl->callback )
+        {
+            if( (XAuint32)((impl->lastPosition)/(impl->positionUpdatePeriod )) <
+                (XAuint32)(newpos/(impl->positionUpdatePeriod )) )
+            {
+                impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_PLAYEVENT_HEADATNEWPOS);
+            }
+        }
+        /* store position */
+        impl->lastPosition = newpos;
+    }
+
+    /* check other events */
+    else if( event->eventid == XA_PLAYEVENT_HEADATEND )
+    {
+        impl->playbackState = XA_PLAYSTATE_STOPPED;
+        impl->lastPosition=0;
+        /* send callback if needed */
+        if( (XA_PLAYEVENT_HEADATEND & impl->eventFlags) && impl->callback )
+        {
+            impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_PLAYEVENT_HEADATEND);
+        }
+    }
+    else if( event->eventid == XA_PLAYEVENT_HEADSTALLED )
+    {
+        impl->playbackState = XA_PLAYSTATE_PAUSED;
+        XAPlayItfAdapt_GetPosition(impl->adapCtx, &(impl->lastPosition));
+        /* send callback if needed */
+        if( (XA_PLAYEVENT_HEADSTALLED & impl->eventFlags) && impl->callback )
+        {
+            impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_PLAYEVENT_HEADSTALLED);
+        }
+    }
+    else if( event->eventid == XA_PLAYEVENT_HEADMOVING )
+    {
+        impl->playbackState = XA_PLAYSTATE_PLAYING;
+        /* send callback if needed */
+        if( (XA_PLAYEVENT_HEADMOVING & impl->eventFlags) && impl->callback )
+        {
+            impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_PLAYEVENT_HEADMOVING);
+        }
+    }
+    else
+    {
+        /* do nothing */
+    }
+
+    DEBUG_API("<-XAPlayItfImpl_AdaptCb");
+    XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS( XATSMediaPlayer );
+}
+#endif
+
+XAresult XAPlayItfImpl_DeterminePlaybackEngine(XAPlayItf self, XADataLocator_URI *uri)
+{
+
+  XAresult ret = XA_RESULT_SUCCESS;
+  
+  char* tempPtr = NULL;
+  char extension[5];
+  
+  XAPlayItfImpl* impl = (XAPlayItfImpl*)(self);
+  DEBUG_API("->XAPlayItfImpl_DeterminePlaybackEngine");
+    
+  //need to move to configuration file and add more in final class
+  
+  impl->isMMFPlayback = XA_BOOLEAN_TRUE;
+	
+  tempPtr = strchr((char*)(uri->URI), '.');
+  strcpy(extension, tempPtr);
+	
+  if(!strcmp(extension, ".wav"))
+  {
+     impl->isMMFPlayback = XA_BOOLEAN_FALSE;
+  }
+
+  return ret;  
+  
+  DEBUG_API("<-XAPlayItfImpl_DeterminePlaybackEngine");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediaplayer/xaplayitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,113 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAPLAYITF_H
+#define XAPLAYITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#endif
+#include "xaadaptationcontextbasemmf.h"
+#include "xamediaplayer.h"
+
+
+/** MACROS **/
+#define NO_POSITION XA_TIME_UNKNOWN
+#define PLAYITF_DEFAULT_UPDATE_PERIOD 1000
+#define START_POSITION 0
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAPlayItf implementation */
+typedef struct XAPlayItfImpl_
+{
+    /* parent interface */
+    struct XAPlayItf_ itf;
+    /* pointer to self */
+    struct XAPlayItfImpl_* self;
+
+    /* variables */
+    XAPlayItf cbPtrToSelf;
+    XAuint32 playbackState;
+    xaPlayCallback callback;
+    void *cbcontext;
+    XAuint32 eventFlags;
+    XAmillisecond markerPosition;
+    XAmillisecond positionUpdatePeriod;
+    XAboolean     positionupdateOn;
+    XAmillisecond lastPosition;
+    XAboolean isMarkerPosCbSend;
+
+#ifdef _GSTREAMER_BACKEND_
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+    XAAdaptationBaseMMFCtx *adaptCtxMMF;
+    XAboolean isMMFPlayback;
+
+} XAPlayItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAPlayItf implementation */
+XAresult XAPlayItfImpl_SetPlayState(XAPlayItf self, XAuint32 state);
+
+XAresult XAPlayItfImpl_GetPlayState(XAPlayItf self, XAuint32 *pState);
+
+XAresult XAPlayItfImpl_GetDuration(XAPlayItf self, XAmillisecond *pMsec);
+
+XAresult XAPlayItfImpl_GetPosition(XAPlayItf self, XAmillisecond *pMsec);
+
+XAresult XAPlayItfImpl_RegisterCallback(XAPlayItf self, xaPlayCallback callback,
+                                        void *pContext);
+
+XAresult XAPlayItfImpl_SetCallbackEventsMask(XAPlayItf self, XAuint32 eventFlags);
+
+XAresult XAPlayItfImpl_GetCallbackEventsMask(XAPlayItf self, XAuint32 *pEventFlags);
+
+XAresult XAPlayItfImpl_SetMarkerPosition(XAPlayItf self, XAmillisecond mSec);
+
+XAresult XAPlayItfImpl_ClearMarkerPosition(XAPlayItf self);
+
+XAresult XAPlayItfImpl_GetMarkerPosition(XAPlayItf self, XAmillisecond *pMsec);
+
+XAresult XAPlayItfImpl_SetPositionUpdatePeriod(XAPlayItf self, XAmillisecond mSec);
+
+XAresult XAPlayItfImpl_GetPositionUpdatePeriod(XAPlayItf self, XAmillisecond *pMsec);
+
+
+/*
+ * implementation-specific methods
+ */
+XAPlayItfImpl* XAPlayItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adapCtx,
+#endif
+        XAAdaptationBaseMMFCtx *adaptationCtxMMF );
+#ifdef _GSTREAMER_BACKEND_
+void XAPlayItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
+#endif
+XAresult XAPlayItfImpl_DeterminePlaybackEngine(XAPlayItf self, XADataLocator_URI *uri);
+void XAPlayItfImpl_Free(XAPlayItfImpl* self);
+
+
+#endif /* XAPLAYITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediaplayer/xaprefetchstatusitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,276 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "xaprefetchstatusitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#endif
+
+static XAPrefetchStatusItfImpl* GetImpl(XAPrefetchStatusItf self)
+{
+    if(self)
+    {
+        XAPrefetchStatusItfImpl* impl = (XAPrefetchStatusItfImpl*)(*self);
+        if(impl && impl == impl->self)
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+XAresult XAPrefetchStatusItfImpl_GetPrefetchStatus(XAPrefetchStatusItf self,
+                                                   XAuint32 *pStatus)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPrefetchStatusItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAPrefetchStatusItfImpl_GetPrefetchStatus");
+
+    if(!impl || !pStatus )
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPrefetchStatusItfImpl_GetPrefetchStatus");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pStatus = impl->pStatus;
+
+    DEBUG_API("<-XAPrefetchStatusItfImpl_GetPrefetchStatus");
+    return ret;
+}
+
+XAresult XAPrefetchStatusItfImpl_GetFillLevel(XAPrefetchStatusItf self,
+                                              XApermille *pLevel)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPrefetchStatusItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAPrefetchStatusItfImpl_GetFillLevel");
+
+    if(!impl || !pLevel)
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPrefetchStatusItfImpl_GetFillLevel");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pLevel = impl->pLevel;
+
+    DEBUG_API("<-XAPrefetchStatusItfImpl_GetFillLevel");
+    return ret;
+}
+
+XAresult XAPrefetchStatusItfImpl_RegisterCallback(XAPrefetchStatusItf self,
+                                                  xaPrefetchCallback callback,
+                                                  void *pContext)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPrefetchStatusItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAPrefetchStatusItfImpl_RegisterCallback");
+
+    if(!impl)
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPrefetchStatusItfImpl_RegisterCallback");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* Can be null to reset callback */
+    impl->callback = callback;
+    impl->cbcontext = pContext;
+    impl->cbPtrToSelf = self;
+
+    DEBUG_API("<-XAPrefetchStatusItfImpl_RegisterCallback");
+    return ret;
+}
+
+XAresult XAPrefetchStatusItfImpl_SetCallbackEventsMask(XAPrefetchStatusItf self,
+                                                       XAuint32 eventFlags)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPrefetchStatusItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAPrefetchStatusItfImpl_SetCallbackEventsMask");
+
+    if(!impl  )
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPrefetchStatusItfImpl_SetCallbackEventsMask");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->eventFlags = eventFlags;
+
+    DEBUG_API("<-XAPrefetchStatusItfImpl_SetCallbackEventsMask");
+    return ret;
+}
+
+XAresult XAPrefetchStatusItfImpl_GetCallbackEventsMask(XAPrefetchStatusItf self,
+                                                       XAuint32 *pEventFlags)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPrefetchStatusItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAPrefetchStatusItfImpl_GetCallbackEventsMask");
+
+    if(!impl || !pEventFlags)
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPrefetchStatusItfImpl_GetCallbackEventsMask");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pEventFlags = impl->eventFlags;
+
+    DEBUG_API("<-XAPrefetchStatusItfImpl_GetCallbackEventsMask");
+    return ret;
+}
+
+XAresult XAPrefetchStatusItfImpl_SetFillUpdatePeriod(XAPrefetchStatusItf self,
+                                                     XApermille period)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPrefetchStatusItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAPrefetchStatusItfImpl_SetFillUpdatePeriod");
+
+    if(!impl || period == 0 || period > 1000 )
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPrefetchStatusItfImpl_SetFillUpdatePeriod");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->fillUpdatePeriod = period;
+
+    DEBUG_API("<-XAPrefetchStatusItfImpl_SetFillUpdatePeriod");
+    return ret;
+}
+
+XAresult XAPrefetchStatusItfImpl_GetFillUpdatePeriod(XAPrefetchStatusItf self,
+                                                     XApermille *pPeriod)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAPrefetchStatusItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAPrefetchStatusItfImpl_GetFillUpdatePeriod");
+
+    if(!impl || !pPeriod)
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAPrefetchStatusItfImpl_GetFillUpdatePeriod");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pPeriod = impl->fillUpdatePeriod;
+
+    DEBUG_API("<-XAPrefetchStatusItfImpl_GetFillUpdatePeriod");
+    return ret;
+}
+
+#ifdef _GSTREAMER_BACKEND_
+
+/*
+ * implementation-specific methods
+ */
+XAPrefetchStatusItfImpl* XAPrefetchStatusItfImpl_Create( XAAdaptationBaseCtx* adaptationCtx )
+{
+    XAPrefetchStatusItfImpl *self = (XAPrefetchStatusItfImpl*)
+        calloc(1,sizeof(XAPrefetchStatusItfImpl));
+    DEBUG_API("->XAPrefetchStatusItfImpl_Create");
+
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.GetCallbackEventsMask = XAPrefetchStatusItfImpl_GetCallbackEventsMask;
+        self->itf.GetFillLevel = XAPrefetchStatusItfImpl_GetFillLevel;
+        self->itf.GetFillUpdatePeriod = XAPrefetchStatusItfImpl_GetFillUpdatePeriod;
+        self->itf.GetPrefetchStatus = XAPrefetchStatusItfImpl_GetPrefetchStatus;
+        self->itf.RegisterCallback = XAPrefetchStatusItfImpl_RegisterCallback;
+        self->itf.SetCallbackEventsMask = XAPrefetchStatusItfImpl_SetCallbackEventsMask;
+        self->itf.SetFillUpdatePeriod = XAPrefetchStatusItfImpl_SetFillUpdatePeriod;
+
+        self->callback = NULL;
+        self->cbcontext = NULL;
+        self->eventFlags = 0;
+        self->fillUpdatePeriod = PREFETCHSTATUSITF_DEFAULT_UPDATE_PERIOD;
+        self->pStatus = XA_PREFETCHSTATUS_SUFFICIENTDATA;
+        self->adaptationCtx = adaptationCtx;
+        self->cbPtrToSelf = NULL;
+
+        XAAdaptationBase_AddEventHandler( adaptationCtx, &XAPrefetchStatusItfImpl_AdaptCb, XA_PREFETCHITFEVENTS, self );
+
+        self->self = self;
+    }
+
+    DEBUG_API("<-XAPrefetchStatusItfImpl_Create");
+    return self;
+}
+#endif
+
+void XAPrefetchStatusItfImpl_Free(XAPrefetchStatusItfImpl* self)
+{
+    DEBUG_API("->XAPrefetchStatusItfImpl_Free");
+    assert(self==self->self);
+#ifdef _GSTREAMER_BACKEND_
+    XAAdaptationBase_RemoveEventHandler( (XAAdaptationBaseCtx*)self->adaptationCtx, &XAPrefetchStatusItfImpl_AdaptCb );
+#endif    
+    free(self);
+    DEBUG_API("<-XAPrefetchStatusItfImpl_Free");
+}
+
+#ifdef _GSTREAMER_BACKEND_
+
+/* void XAPrefetchStatusItfImpl_AdaptCb
+ * Description: Listen changes in adaptation
+ */
+void XAPrefetchStatusItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+{
+    XAPrefetchStatusItfImpl* impl = (XAPrefetchStatusItfImpl*)pHandlerCtx;
+    DEBUG_API("->XAPrefetchStatusItfImpl_AdaptCb");
+    if(!impl)
+    {
+        DEBUG_ERR("XAPrefetchStatusItfImpl_AdaptCb, invalid context pointer!");
+        DEBUG_API("<-XAPrefetchStatusItfImpl_AdaptCb");
+        return;
+    }
+    assert(event);
+    if( event->eventid == XA_ADAPT_BUFFERING )
+    {
+        /* Adaptation sends percents convert it to permille */
+        impl->fillUpdatePeriod = ((*(XAint32*)(event->data))*10);
+
+        /*Check do we have to send event */
+        if( impl->callback && impl->eventFlags & XA_PREFETCHEVENT_FILLLEVELCHANGE )
+        {
+            if ( (*(XAint32*)event->data) >  impl->fillUpdatePeriod / 10 )
+            {
+                impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_PREFETCHEVENT_FILLLEVELCHANGE);
+            }
+        }
+    }
+
+    DEBUG_API("<-XAPrefetchStatusItfImpl_AdaptCb");
+}
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediaplayer/xaprefetchstatusitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAPREFETCHSTATUSITF_H_
+#define XAPREFETCHSTATUSITF_H_
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAMediaPlayerAdaptCtx.h"
+#endif
+#define PREFETCHSTATUSITF_DEFAULT_UPDATE_PERIOD 100
+
+/*
+ * implementation declaration
+ */
+typedef struct XAPrefetchStatusItfImpl_
+{
+    /* "inherit" interface */
+    struct XAPrefetchStatusItf_ itf;
+    /* pointer to self */
+    struct XAPrefetchStatusItfImpl_* self;
+
+    /* variables */
+
+    XAuint32 pStatus;
+    XApermille pLevel;
+
+    XAPrefetchStatusItf cbPtrToSelf;
+    xaPrefetchCallback  callback;
+    void                *cbcontext;
+    XAuint32            eventFlags;
+    XApermille          fillUpdatePeriod;
+#ifdef _GSTREAMER_BACKEND_
+    XAAdaptationBaseCtx* adaptationCtx;
+#endif
+}XAPrefetchStatusItfImpl;
+
+/**
+ * XAPrefetchStatusItf interface implementation
+ */
+XAresult XAPrefetchStatusItfImpl_GetPrefetchStatus(XAPrefetchStatusItf self,
+                                                     XAuint32 *pStatus);
+
+XAresult XAPrefetchStatusItfImpl_GetFillLevel(XAPrefetchStatusItf self,
+                                                XApermille *pLevel);
+
+XAresult XAPrefetchStatusItfImpl_RegisterCallback(XAPrefetchStatusItf self,
+                                                    xaPrefetchCallback callback,
+                                                    void *pContext);
+
+XAresult XAPrefetchStatusItfImpl_SetCallbackEventsMask(XAPrefetchStatusItf self,
+                                                         XAuint32 eventFlags);
+
+XAresult XAPrefetchStatusItfImpl_GetCallbackEventsMask(XAPrefetchStatusItf self,
+                                                         XAuint32 *pEventFlags);
+
+XAresult XAPrefetchStatusItfImpl_SetFillUpdatePeriod(XAPrefetchStatusItf self,
+                                                       XApermille period);
+
+XAresult XAPrefetchStatusItfImpl_GetFillUpdatePeriod(XAPrefetchStatusItf self,
+                                                       XApermille *pPeriod);
+
+#ifdef _GSTREAMER_BACKEND_
+
+/*
+ * implementation-specific methods
+ */
+XAPrefetchStatusItfImpl* XAPrefetchStatusItfImpl_Create( XAAdaptationBaseCtx* adaptationCtx);
+void XAPrefetchStatusItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
+#endif
+
+void XAPrefetchStatusItfImpl_Free(XAPrefetchStatusItfImpl* self);
+
+#endif /* XAPREFETCHSTATUSITF_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediaplayer/xaseekitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,254 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "xaseekitf.h"
+
+#ifdef _GSTREAMER_BACKEND_
+#include "XASeekItfAdaptation.h"
+#include "XAPlayItfAdaptation.h"
+#endif
+#include "xathreadsafety.h"
+
+
+/**
+ * XASeekItfImpl* GetImpl(XASeekItf self)
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XASeekItfImpl* GetImpl(XASeekItf self)
+{
+    if(self)
+    {
+        XASeekItfImpl* impl = (XASeekItfImpl*)(*self);
+        if(impl && impl == impl->self)
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XASeekItf implementation
+ */
+
+/**
+ * XAresult XASeekItfImpl_SetPosition(XASeekItf self, XAmillisecond pos,
+ *                                    XAuint32 seekMode)
+ * Description: Sets the position of the playback head.
+ **/
+XAresult XASeekItfImpl_SetPosition(XASeekItf self, XAmillisecond pos,
+                                   XAuint32 seekMode)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAmillisecond duration = 0;
+    XASeekItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XASeekItfImpl_SetPosition");
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    if(!impl)
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASeekItfImpl_SetPosition");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    /* Get duration of the content */
+    if(XAPlayItfAdapt_GetDuration(impl->adapCtx, &duration) != XA_RESULT_SUCCESS)
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASeekItfImpl_SetPosition");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#endif
+    
+    if(pos > duration)
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASeekItfImpl_SetPosition");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(seekMode != XA_SEEKMODE_FAST && seekMode != XA_SEEKMODE_ACCURATE)
+    {
+        /* seek mode unsupported */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        DEBUG_API("<-XASeekItfImpl_SetPosition");
+        return XA_RESULT_FEATURE_UNSUPPORTED;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XASeekItfAdapt_SetPosition(impl->adapCtx, pos, seekMode);
+#endif
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        impl->playbackPosition = pos;
+        impl->seekMode = seekMode;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+    DEBUG_API("<-XASeekItfImpl_SetPosition");
+    return ret;
+}
+
+/**
+ * XAresult XASeekItfImpl_SetLoop(XASeekItf self, XAboolean loopEnable,
+ *                                XAmillisecond startPos, XAmillisecond endPos)
+ * Description: Enables or disables looping and sets the start and end points of looping.
+ **/
+XAresult XASeekItfImpl_SetLoop(XASeekItf self, XAboolean loopEnable,
+                               XAmillisecond startPos, XAmillisecond endPos)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAmillisecond duration = 0;
+    XASeekItfImpl* impl = GetImpl(self);
+    DEBUG_API_A2("->XASeekItfImpl_SetLoop, startPos:%lu, endPos:%lu", startPos, endPos);
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    if(!impl || (startPos > endPos))
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASeekItfImpl_SetLoop");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    /* Get duration of the content */
+    if(XAPlayItfAdapt_GetDuration(impl->adapCtx, &duration) != XA_RESULT_SUCCESS)
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASeekItfImpl_SetLoop");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#endif
+    if(endPos > duration && endPos != XA_TIME_UNKNOWN)
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASeekItfImpl_SetLoop");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XASeekItfAdapt_SetLoop(impl->adapCtx, loopEnable, startPos, endPos);
+#endif
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        impl->loopEnable = loopEnable;
+        impl->startPos = startPos;
+        impl->endPos = endPos;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+    DEBUG_API("<-XASeekItfImpl_SetLoop");
+    return ret;
+}
+
+/**
+ * XAresult XASeekItfImpl_GetLoop(XASeekItf self, XAboolean *pLoopEnabled,
+ *                                XAmillisecond *pStartPos,
+ *                                XAmillisecond *pEndPos)
+ * Description: Queries whether looping is enabled or disabled, and retrieves loop points.
+ **/
+XAresult XASeekItfImpl_GetLoop(XASeekItf self, XAboolean *pLoopEnabled,
+                               XAmillisecond *pStartPos,
+                               XAmillisecond *pEndPos)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    XASeekItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XASeekItfImpl_GetLoop");
+
+    if(!impl || !pLoopEnabled || !pStartPos || !pEndPos)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASeekItfImpl_GetLoop");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pLoopEnabled = impl->loopEnable;
+    *pStartPos = impl->startPos;
+    *pEndPos = impl->endPos;
+
+    DEBUG_API("<-XASeekItfImpl_GetLoop");
+    return ret;
+}
+
+/**
+ * XASeekItfImpl -specific methods
+ **/
+#ifdef _GSTREAMER_BACKEND_
+
+/**
+ * XASeekItfImpl* XASeekItfImpl_Create()
+ * Description: Allocate and initialize SeekItfImpl.
+ **/
+XASeekItfImpl* XASeekItfImpl_Create( XAAdaptationBaseCtx *adapCtx )
+{
+    XASeekItfImpl *self = (XASeekItfImpl*)
+        calloc(1,sizeof(XASeekItfImpl));
+    DEBUG_API("->XASeekItfImpl_Create");
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.GetLoop = XASeekItfImpl_GetLoop;
+        self->itf.SetLoop = XASeekItfImpl_SetLoop;
+        self->itf.SetPosition = XASeekItfImpl_SetPosition;
+
+        /* init variables */
+        self->playbackPosition = 0;
+        self->seekMode = 0;
+        self->loopEnable = XA_BOOLEAN_FALSE;
+        self->startPos = 0;
+        self->endPos = 0;
+
+        self->adapCtx = adapCtx;
+
+        self->self = self;
+    }
+    DEBUG_API("<-XASeekItfImpl_Create");
+    return self;
+}
+#endif
+/**
+ * void XASeekItfImpl_Free(XASeekItfImpl* self)
+ * Description: Free all resources reserved at XASeekItfImpl_Create.
+ **/
+void XASeekItfImpl_Free(XASeekItfImpl* self)
+{
+    DEBUG_API("->XASeekItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XASeekItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediaplayer/xaseekitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XASEEKITF_H
+#define XASEEKITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XASeekItf implementation */
+typedef struct XASeekItfImpl_
+{
+    /* parent interface */
+    struct XASeekItf_ itf;
+    /* pointer to self */
+    struct XASeekItfImpl_* self;
+
+    /* variables */
+    XAmillisecond playbackPosition;
+    XAuint32 seekMode;
+    XAboolean loopEnable;
+    XAmillisecond startPos;
+    XAmillisecond endPos;
+
+#ifdef _GSTREAMER_BACKEND_
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+}XASeekItfImpl;
+
+/** METHODS **/
+
+/* Base interface XASeekItf implementation */
+XAresult XASeekItfImpl_SetPosition(XASeekItf self, XAmillisecond pos,
+                                   XAuint32 seekMode);
+
+XAresult XASeekItfImpl_SetLoop(XASeekItf self, XAboolean loopEnable,
+                               XAmillisecond startPos,
+                               XAmillisecond endPos);
+
+XAresult XASeekItfImpl_GetLoop(XASeekItf self, XAboolean *pLoopEnabled,
+                               XAmillisecond *pStartPos,
+                               XAmillisecond *pEndPos);
+
+#ifdef _GSTREAMER_BACKEND_
+/* XASeekItfImpl -specific methods */
+XASeekItfImpl* XASeekItfImpl_Create( XAAdaptationBaseCtx *adapCtx );
+#endif
+void XASeekItfImpl_Free(XASeekItfImpl* self);
+
+#endif /* XASEEKITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xaaudioencoderitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,309 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include "xaaudioencoderitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAudioEncoderItfAdaptation.h"
+#include "XAStaticCapsAdaptation.h"
+#include "XARecordItfAdaptation.h"
+#endif
+#include "xathreadsafety.h"
+#include "xaadaptationmmf.h"
+#include "cmmfbackendengine.h"
+
+/* XAAudioEncoderItfImpl* GetImpl(XAAudioEncoderItf self)
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ **/
+static XAAudioEncoderItfImpl* GetImpl(XAAudioEncoderItf self)
+{
+    if( self )
+    {
+        XAAudioEncoderItfImpl* impl = (XAAudioEncoderItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/*****************************************************************************
+ * Base interface XAAudioEncoderItf implementation
+ *****************************************************************************/
+
+/**
+ * XAresult XAAudioEncoderItfImpl_SetEncoderSettings(XAAudioEncoderItf self,
+ *                                                   XAAudioEncoderSettings *pSettings)
+ * Description: Set audio encoder settings.
+ **/
+XAresult XAAudioEncoderItfImpl_SetEncoderSettings(XAAudioEncoderItf self,
+                                                  XAAudioEncoderSettings *pSettings)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 recState = XA_RECORDSTATE_STOPPED;
+    XAAudioEncoderItfImpl *impl = GetImpl(self);
+    XAMediaRecorderAdaptationMMFCtx* mCtx;
+    XAAudioEncoderSettings currentSettings;
+
+    DEBUG_API("->XAAudioEncoderItfImpl_SetEncoderSettings");
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaRecorder );
+
+    if( !impl || !pSettings )
+        {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
+        return XA_RESULT_PARAMETER_INVALID;
+        }
+
+    mCtx = (XAMediaRecorderAdaptationMMFCtx*) impl->pObjImpl->adaptationCtxMMF;
+    
+    if(mCtx->xaRecordState != recState)
+        {
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+        DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+        DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+        }
+
+    if(impl->pObjImpl->isMMFRecord)
+        {
+        XAAudioEncoderItfImpl_GetEncoderSettings(self, &currentSettings);
+        if(pSettings->encoderId == currentSettings.encoderId)
+            {
+            if(pSettings->channelsIn !=  currentSettings.channelsIn)
+                {
+                ret = mmf_set_destination_channels(mCtx->mmfContext, &(pSettings->channelsIn));
+                }
+            
+            if(pSettings->channelsOut != currentSettings.channelsOut)
+                {
+                ret = mmf_set_destination_channels(mCtx->mmfContext, &(pSettings->channelsOut));
+                }
+            
+            if(pSettings->sampleRate != currentSettings.sampleRate)
+                {
+                ret = mmf_set_destination_samplerate(mCtx->mmfContext, &(pSettings->sampleRate));
+                }
+
+            if(pSettings->bitRate != currentSettings.bitRate)
+                {
+                ret = mmf_set_destination_bitrate(mCtx->mmfContext, &(pSettings->bitRate));
+                }
+            
+            if(pSettings->rateControl != currentSettings.rateControl)
+                {
+                ret = XA_RESULT_PARAMETER_INVALID;
+                }
+            if(pSettings->channelMode != currentSettings.channelMode)
+                {
+                ret = XA_RESULT_PARAMETER_INVALID;
+                }
+            if(pSettings->encodeOptions != currentSettings.encodeOptions)
+                {
+                ret = XA_RESULT_PARAMETER_INVALID;
+                }
+            if(pSettings->blockAlignment != currentSettings.blockAlignment)
+                {
+                ret = XA_RESULT_PARAMETER_INVALID;
+                }    
+            if(pSettings->bitsPerSample != currentSettings.bitsPerSample)
+                {
+                ret = XA_RESULT_PARAMETER_INVALID;
+                }    
+            if(pSettings->profileSetting != currentSettings.profileSetting)
+                {
+                ret = XA_RESULT_PARAMETER_INVALID;
+                }    
+            if(pSettings->levelSetting != currentSettings.levelSetting)
+                {
+                ret = XA_RESULT_PARAMETER_INVALID;
+                }    
+            }
+        else
+            {
+            ret = XA_RESULT_PARAMETER_INVALID;
+            }
+        }
+    else
+        {
+#ifdef _GSTREAMER_BACKEND_
+        XAStaticCapsData temp;
+    
+        ret = XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_AUDIO, pSettings->encoderId, &temp);
+        if( ret == XA_RESULT_SUCCESS )
+            {
+            ret = XARecordItfAdapt_GetRecordState( impl->adapCtx, &recState );
+            if( ret == XA_RESULT_SUCCESS )
+                {
+                if( XA_RECORDSTATE_STOPPED == recState )
+                    {
+                    ret = XAAudioEncoderItfAdapt_SetEncoderSettings( impl->adapCtx, pSettings);
+                    }
+                else
+                    {
+                    DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+                    DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
+                    return XA_RESULT_PRECONDITIONS_VIOLATED;
+                    }
+                }
+            }
+        else
+            {
+            DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+            DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
+            return XA_RESULT_FEATURE_UNSUPPORTED;
+            }
+#endif
+        }    
+    
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+    DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
+    return ret;
+}
+
+/**
+ * XAresult XAAudioEncoderItfImpl_GetEncoderSettings(XAAudioEncoderItf self,
+ *                                                   XAAudioEncoderSettings *pSettings)
+ * Description: Get audio encoder settings.
+ **/
+XAresult XAAudioEncoderItfImpl_GetEncoderSettings(XAAudioEncoderItf self,
+                                                  XAAudioEncoderSettings *pSettings)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 encoderId;
+    XAuint32 channelsIn;
+    XAuint32 channelsOut;
+    XAmilliHertz sampleRate;
+    XAuint32 bitRate;
+    XAMediaRecorderAdaptationMMFCtx* mCtx;
+   
+    XAAudioEncoderItfImpl *impl = GetImpl(self);
+    
+    DEBUG_API("->XAAudioEncoderItfImpl_GetEncoderSettings");
+    if(!impl || !pSettings )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XAMediaRecorderAdaptationMMFCtx*) (impl->pObjImpl->adaptationCtxMMF);
+    
+
+
+    if(impl->pObjImpl->isMMFRecord)
+        {
+        mmf_get_encoder_id(mCtx->mmfContext, &encoderId);
+        
+        switch(encoderId)
+            {
+            case 0x36315020:
+                pSettings->encoderId = XA_AUDIOCODEC_PCM;
+                pSettings->bitsPerSample = 16;
+                pSettings->profileSetting = XA_AUDIOPROFILE_PCM;
+                pSettings->levelSetting = 0;
+                pSettings->streamFormat = 0;
+                break;
+            case 0x524d4120:
+                pSettings->encoderId = XA_AUDIOCODEC_AMR;
+                pSettings->bitsPerSample = 8;
+                pSettings->profileSetting = XA_AUDIOPROFILE_AMR;
+                pSettings->levelSetting = 0;
+                pSettings->streamFormat = XA_AUDIOSTREAMFORMAT_FSF;
+                break;
+            case 0x43414120:
+                pSettings->encoderId = XA_AUDIOCODEC_AAC;
+                pSettings->bitsPerSample = 16;
+                pSettings->profileSetting = XA_AUDIOPROFILE_AAC_AAC;
+                pSettings->levelSetting = XA_AUDIOMODE_AAC_LC;
+                pSettings->streamFormat = XA_AUDIOSTREAMFORMAT_RAW;
+                break;
+            }
+        
+        mmf_get_destination_channels(mCtx->mmfContext, &channelsIn);
+        pSettings->channelsIn =  channelsIn;
+        mmf_get_destination_channels(mCtx->mmfContext, &channelsOut);
+        pSettings->channelsOut = channelsOut;
+        mmf_get_destination_samplerate(mCtx->mmfContext, &sampleRate);
+        pSettings->sampleRate = sampleRate;
+        mmf_get_destination_bitrate(mCtx->mmfContext, &bitRate);
+        pSettings->bitRate = bitRate;
+        pSettings->rateControl = XA_RATECONTROLMODE_CONSTANTBITRATE;
+        pSettings->channelMode = 0;
+        pSettings->encodeOptions = 0;
+        pSettings->blockAlignment = 0;
+        }
+    else
+        {
+#ifdef _GSTREAMER_BACKEND_
+        ret = XAAudioEncoderItfAdapt_GetEncoderSettings(impl->adapCtx, pSettings);
+#endif    
+        }
+    DEBUG_API("<-XAAudioEncoderItfImpl_GetEncoderSettings");
+    return ret;
+}
+
+/*****************************************************************************
+ * XAAudioEncoderItfImpl -specific methods
+ *****************************************************************************/
+
+/* XAAudioEncoderItfImpl* XAAudioEncoderItfImpl_Create()
+ * Description: Allocate and initialize XAAudioEncoderItfImpl
+ */
+XAAudioEncoderItfImpl* XAAudioEncoderItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adapCtx,
+#endif
+        XAMediaRecorderImpl* impl
+        )
+{
+    XAAudioEncoderItfImpl* self = (XAAudioEncoderItfImpl*)
+        calloc(1,sizeof(XAAudioEncoderItfImpl));
+    DEBUG_API("->XAAudioEncoderItfImpl_Create");
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.GetEncoderSettings = XAAudioEncoderItfImpl_GetEncoderSettings;
+        self->itf.SetEncoderSettings = XAAudioEncoderItfImpl_SetEncoderSettings;
+        self->pObjImpl = impl;
+        /* init variables */
+#ifdef _GSTREAMER_BACKEND_
+        self->adapCtx = adapCtx;
+#endif        
+
+        self->self = self;
+    }
+    DEBUG_API("<-XAAudioEncoderItfImpl_Create");
+    return self;
+}
+
+/* void XAAudioEncoderItfImpl_Free(XAAudioEncoderItfImpl* self)
+ * Description: Free all resources reserved at XAAudioEncoderItfImpl_Create
+ */
+void XAAudioEncoderItfImpl_Free(XAAudioEncoderItfImpl* self)
+{
+    DEBUG_API("->XAAudioEncoderItfImpl_Free");
+    assert( self==self->self );
+    free( self );
+    DEBUG_API("<-XAAudioEncoderItfImpl_Free");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xaaudioencoderitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAAUDIOENCODERITF_H
+#define XAAUDIOENCODERITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#endif
+
+#include "xamediarecorder.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAAudioEncoderItf implementation */
+typedef struct XAAudioEncoderItfImpl_
+{
+    /* parent interface */
+    struct XAAudioEncoderItf_ itf;
+    /* pointer to self */
+    struct XAAudioEncoderItfImpl_* self;
+    
+    XAMediaRecorderImpl* pObjImpl;
+    
+#ifdef _GSTREAMER_BACKEND_
+    /* variables */
+    XAAdaptationBaseCtx    *adapCtx;
+#endif
+} XAAudioEncoderItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAAudioEncoderItf implementation
+ * See API Specification for method documentation
+ */
+XAresult XAAudioEncoderItfImpl_SetEncoderSettings( XAAudioEncoderItf self,
+                                                   XAAudioEncoderSettings *pSettings );
+
+XAresult XAAudioEncoderItfImpl_GetEncoderSettings( XAAudioEncoderItf self,
+                                                   XAAudioEncoderSettings *pSettings );
+
+/* XAAudioEncoderItfImpl -specific methods */
+XAAudioEncoderItfImpl* XAAudioEncoderItfImpl_Create( 
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adapCtx, 
+#endif
+        XAMediaRecorderImpl* impl 
+        );
+void XAAudioEncoderItfImpl_Free( XAAudioEncoderItfImpl* self );
+
+#endif /* XAAUDIOENCODERITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xaimageencoderitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,261 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include "xaimageencoderitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAImageEncoderItfAdaptation.h"
+#include "XARecordItfAdaptation.h"
+#include "XAStaticCapsAdaptation.h"
+#endif
+#include "xathreadsafety.h"
+
+#define APPROX_MAXRATIO (90/100)
+
+/* static XAImageEncoderItfImpl* GetImpl(XAImageEncoderItf self)
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XAImageEncoderItfImpl* GetImpl(XAImageEncoderItf self)
+{
+    if( self )
+    {
+        XAImageEncoderItfImpl* impl = (XAImageEncoderItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/*****************************************************************************
+ * Base interface XAImageEncoderItf implementation
+ *****************************************************************************/
+
+/* XAresult XAImageEncoderItfImpl_SetImageSettings
+ * Description: Set image encoder settings.
+ */
+XAresult XAImageEncoderItfImpl_SetImageSettings(XAImageEncoderItf self,
+                                                const XAImageSettings *pSettings)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+#ifdef _GSTREAMER_BACKEND_
+    XAStaticCapsData temp;
+    XAImageEncoderItfImpl *impl = GetImpl(self);
+
+    DEBUG_API("->XAImageEncoderItfImpl_SetImageSettings");
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaRecorder );
+
+    if( !impl || !pSettings )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageEncoderItfImpl_SetImageSettings");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    res = XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_IMAGE, pSettings->encoderId, &temp);
+    if( res == XA_RESULT_SUCCESS )
+    {
+        res = XAImageEncoderItfAdapt_SetImageSettings(impl->adaptCtx, pSettings);
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        DEBUG_API("<-XAImageEncoderItfImpl_SetImageSettings");
+        return XA_RESULT_FEATURE_UNSUPPORTED;
+    }
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+#endif
+    DEBUG_API("<-XAImageEncoderItfImpl_SetImageSettings");
+    return res;
+}
+
+/* XAresult XAImageEncoderItfImpl_GetImageSettings
+ * Description: Get image encoder settings.
+ */
+XAresult XAImageEncoderItfImpl_GetImageSettings(XAImageEncoderItf self,
+                                                XAImageSettings *pSettings)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XAImageEncoderItfImpl *impl = GetImpl(self);
+
+    DEBUG_API("->XAImageEncoderItfImpl_GetImageSettings");
+    if( !impl || !pSettings )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageEncoderItfImpl_GetImageSettings");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_
+    res = XAImageEncoderItfAdapt_GetImageSettings(impl->adaptCtx, pSettings);
+#endif
+    DEBUG_API("<-XAImageEncoderItfImpl_GetImageSettings");
+    return res;
+}
+
+/* XAresult XAImageEncoderItfImpl_GetSizeEstimate
+ * Description: Get estimated image size.
+ */
+XAresult XAImageEncoderItfImpl_GetSizeEstimate(XAImageEncoderItf self,
+                                               XAuint32 *pSize)
+{
+    XAuint32 bpp = 0; /*bytes per pixel*/
+    XAuint32 compPct = 0; /*compression percentage*/
+    XAImageEncoderItfImpl *impl = GetImpl(self);
+    XAImageSettings curSettings = {0,0,0,0,0};
+    DEBUG_API("->XAImageEncoderItfImpl_GetImageSettings");
+
+    if( !impl || !pSize )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageEncoderItfImpl_GetImageSettings");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    /* calculate size estimate */
+
+#ifdef _GSTREAMER_BACKEND_
+    XAImageEncoderItfAdapt_GetImageSettings(impl->adaptCtx, &curSettings);
+#endif
+    switch(curSettings.colorFormat)
+    {
+        case XA_COLORFORMAT_MONOCHROME:
+            bpp = 1;
+            break;
+        case XA_COLORFORMAT_L2:
+            bpp = 2;
+            break;
+        case XA_COLORFORMAT_L4:
+            bpp = 4;
+            break;
+        case XA_COLORFORMAT_8BITRGB332:
+        case XA_COLORFORMAT_RAWBAYER8BIT:
+        case XA_COLORFORMAT_RAWBAYER8BITCOMPRESSED:
+        case XA_COLORFORMAT_L8:
+            bpp = 8;
+            break;
+        case XA_COLORFORMAT_RAWBAYER10BIT:
+            bpp = 10;
+            break;
+        case XA_COLORFORMAT_12BITRGB444:
+        case XA_COLORFORMAT_YUV444INTERLEAVED:
+        case XA_COLORFORMAT_YUV411PLANAR:
+        case XA_COLORFORMAT_YUV420PLANAR:
+        case XA_COLORFORMAT_YUV420SEMIPLANAR:
+            bpp = 12;
+            break;
+        case XA_COLORFORMAT_16BITARGB4444:
+        case XA_COLORFORMAT_16BITARGB1555:
+        case XA_COLORFORMAT_16BITRGB565:
+        case XA_COLORFORMAT_16BITBGR565:
+        case XA_COLORFORMAT_YCBYCR:
+        case XA_COLORFORMAT_YCRYCB:
+        case XA_COLORFORMAT_CBYCRY:
+        case XA_COLORFORMAT_CRYCBY:
+        case XA_COLORFORMAT_L16:
+        case XA_COLORFORMAT_YUV422PLANAR:
+        case XA_COLORFORMAT_YUV422SEMIPLANAR:
+            bpp = 16;
+            break;
+        case XA_COLORFORMAT_18BITRGB666:
+        case XA_COLORFORMAT_18BITARGB1665:
+        case XA_COLORFORMAT_18BITBGR666:
+            bpp = 18;
+            break;
+        case XA_COLORFORMAT_19BITARGB1666:
+            bpp = 19;
+            break;
+        case XA_COLORFORMAT_24BITRGB888:
+        case XA_COLORFORMAT_24BITBGR888:
+        case XA_COLORFORMAT_24BITARGB1887:
+        case XA_COLORFORMAT_24BITARGB6666:
+        case XA_COLORFORMAT_24BITABGR6666:
+        case XA_COLORFORMAT_L24:
+            bpp = 24;
+            break;
+        case XA_COLORFORMAT_25BITARGB1888:
+            bpp = 25;
+            break;
+        case XA_COLORFORMAT_32BITBGRA8888:
+        case XA_COLORFORMAT_32BITARGB8888:
+        case XA_COLORFORMAT_L32:
+            bpp = 32;
+            break;
+        default:
+            bpp = 8;
+            break;
+    }
+
+    compPct = (1000 - (curSettings.compressionLevel*APPROX_MAXRATIO))/1000;
+
+    /* numofpixels * colorformat(bits/pixel) * compression rate */
+    *pSize = (curSettings.height * curSettings.width ) * bpp/8 * compPct;
+
+    DEBUG_API("<-XAImageEncoderItfImpl_GetImageSettings");
+    return XA_RESULT_SUCCESS;
+}
+/*****************************************************************************
+ * XAImageEncoderItfImpl -specific methods
+ *****************************************************************************/
+
+
+/* XAImageEncoderItfImpl* XAImageEncoderItfImpl_Create()
+ * Description: Allocate and initialize ImageEncoderItfImpl
+ */
+XAImageEncoderItfImpl* XAImageEncoderItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adaptCtx
+#endif
+        )
+{
+    XAImageEncoderItfImpl* self = (XAImageEncoderItfImpl*)
+        calloc(1,sizeof(XAImageEncoderItfImpl));
+    DEBUG_API("->XAImageEncoderItfImpl_Create");
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.GetImageSettings = XAImageEncoderItfImpl_GetImageSettings;
+        self->itf.SetImageSettings = XAImageEncoderItfImpl_SetImageSettings;
+        self->itf.GetSizeEstimate = XAImageEncoderItfImpl_GetSizeEstimate;
+
+        /* init variables */
+#ifdef _GSTREAMER_BACKEND_
+        self->adaptCtx = adaptCtx;
+#endif        
+        
+        self->self = self;
+    }
+    DEBUG_API("<-XAImageEncoderItfImpl_Create");
+    return self;
+}
+
+/* void XAImageEncoderItfImpl_Free(XAImageEncoderItfImpl* self)
+ * Description: Free all resources reserved at XAImageEncoderItfImpl_Create()
+ */
+void XAImageEncoderItfImpl_Free(XAImageEncoderItfImpl* self)
+{
+    DEBUG_API("->XAImageEncoderItfImpl_Free");
+    assert( self==self->self );
+    free( self );
+    DEBUG_API("<-XAImageEncoderItfImpl_Free");
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xaimageencoderitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,71 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAIMAGEENCODERITF_H
+#define XAIMAGEENCODERITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAImageEncoderItf implementation */
+typedef struct XAImageEncoderItfImpl_
+{
+    /* parent interface */
+    struct XAImageEncoderItf_ itf;
+    /* pointer to self */
+    struct XAImageEncoderItfImpl_* self;
+#ifdef _GSTREAMER_BACKEND_
+    /* variables */
+    XAAdaptationBaseCtx *adaptCtx;
+#endif
+} XAImageEncoderItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAImageEncoderItf implementation
+ * See API Specification for method documentation
+ */
+XAresult XAImageEncoderItfImpl_SetImageSettings(XAImageEncoderItf self,
+                                                const XAImageSettings *pSettings);
+
+XAresult XAImageEncoderItfImpl_GetImageSettings(XAImageEncoderItf self,
+                                                XAImageSettings *pSettings);
+
+XAresult XAImageEncoderItfImpl_GetSizeEstimate(XAImageEncoderItf self,
+                                               XAuint32 * pSize);
+
+
+/* XAImageEncoderItfImpl -specific methods */
+XAImageEncoderItfImpl* XAImageEncoderItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adaptCtx,
+#endif
+        void
+        );
+
+void XAImageEncoderItfImpl_Free(XAImageEncoderItfImpl* self);
+
+#endif /* XAIMAGEENCODERITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xamediarecorder.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,721 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xamediarecorder.h"
+#include "xaaudioencoderitf.h"
+#include "xaconfigextensionsitf.h"
+#include "xadynintmgmtitf.h"
+#include "xaequalizeritf.h"
+#include "xaimagecontrolsitf.h"
+#include "xaimageeffectsitf.h"
+#include "xaimageencoderitf.h"
+#include "xametadatainsertionitf.h"
+#include "xarecorditf.h"
+#include "xasnapshotitf.h"
+#include "xavideoencoderitf.h"
+#include "xavideopostprocessingitf.h"
+#include "xavolumeitf.h"
+#include "xametadataextractionitf.h"
+#include "xametadatatraversalitf.h"
+#include "xathreadsafety.h"
+#include <string.h>
+/* Static mapping of enumeration XAMediaRecorderInterfaces to interface iids */
+static const XAInterfaceID* xaMediaRecorderItfIIDs[MR_ITFCOUNT]=
+{
+    &XA_IID_OBJECT,
+    &XA_IID_AUDIOENCODER,
+    &XA_IID_CONFIGEXTENSION,
+    &XA_IID_DYNAMICINTERFACEMANAGEMENT,
+    &XA_IID_EQUALIZER,
+    &XA_IID_IMAGECONTROLS,
+    &XA_IID_IMAGEEFFECTS,
+    &XA_IID_IMAGEENCODER,
+    &XA_IID_METADATAINSERTION,
+    &XA_IID_RECORD,
+    &XA_IID_SNAPSHOT,
+    &XA_IID_VIDEOENCODER,
+    &XA_IID_VIDEOPOSTPROCESSING,
+    &XA_IID_VOLUME,
+    &XA_IID_METADATAEXTRACTION,
+    &XA_IID_METADATATRAVERSAL
+};
+
+/* Global methods */
+
+/* XAResult XAMediaRecorderImpl_Create
+ * Create object
+ */
+XAresult XAMediaRecorderImpl_CreateMediaRecorder(XAObjectItf* pRecorder,
+                                                 XADataSource* pAudioSrc,
+                                                 XADataSource* pImageVideoSrc,
+                                                 XADataSink* pDataSnk,
+                                                 XAuint32 numInterfaces,
+                                                 const XAInterfaceID *pInterfaceIds,
+                                                 const XAboolean *pInterfaceRequired)
+{
+    XAMediaRecorderImpl* pImpl = NULL;
+    XAObjectItfImpl* pBaseObj = NULL;
+    XAuint8 itfIdx;
+    XAMediaType mediaType = XA_MEDIATYPE_UNKNOWN;
+    XAresult ret=XA_RESULT_SUCCESS;
+    XADataLocator_URI* tmpUri;
+
+    DEBUG_API("->XAMediaRecorderImpl_CreateMediaRecorder");
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaRecorder );
+
+    if( !pRecorder )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMediaRecorderImpl_CreateMediaRecorder");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check sink&source parameters */
+    ret = XACommon_ValidateDataLocator(3, pAudioSrc, pImageVideoSrc, pDataSnk);
+    if(ret!=XA_RESULT_SUCCESS)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+        DEBUG_API("<-XAMediaRecorderImpl_CreateMediaRecorder");
+        return ret;
+    }
+
+    /* instantiate object implementation */
+    pImpl = (XAMediaRecorderImpl*)calloc(1,sizeof(XAMediaRecorderImpl));
+    if( !pImpl )
+    {
+
+        /* memory allocation failed */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+        DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+        DEBUG_API("<-XAMediaRecorderImpl_CreateMediaRecorder");
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+    pBaseObj = &pImpl->baseObj;
+
+    /* Initialize base object default implementation */
+    XAObjectItfImpl_Init(pBaseObj,
+                         MR_ITFCOUNT,
+                         xaMediaRecorderItfIIDs,
+                         XAMediaRecorderImpl_DoRealize,
+                         XAMediaRecorderImpl_DoResume,
+                         XAMediaRecorderImpl_FreeResources);
+
+    /* Mark interfaces that need to be exposed */
+    /* Implicit and mandated interfaces */
+    pBaseObj->interfaceMap[MR_RECORDITF].required = XA_BOOLEAN_TRUE;
+    if(pAudioSrc && mediaType!=XA_MEDIATYPE_IMAGE)
+    {
+        pBaseObj->interfaceMap[MR_AUDIOENCODERITF].required = XA_BOOLEAN_TRUE;
+    }
+    if(pImageVideoSrc && mediaType!=XA_MEDIATYPE_AUDIO)
+    {
+        pBaseObj->interfaceMap[MR_VIDEOENCODER].required = XA_BOOLEAN_TRUE;
+        pBaseObj->interfaceMap[MR_IMAGEENCODERITF].required = XA_BOOLEAN_TRUE;
+        pBaseObj->interfaceMap[MR_SNAPSHOTITF].required = XA_BOOLEAN_TRUE;
+    }
+    pBaseObj->interfaceMap[MR_DIMITF].required = XA_BOOLEAN_TRUE;
+
+    /* Explicit interfaces */
+    if((numInterfaces != 0) && pInterfaceIds && pInterfaceRequired)
+    {
+        /* check only sink media type, do not care about return value (availability) */
+        XACommon_CheckDataSource((XADataSource*)pDataSnk,&mediaType);
+        /* Check required interfaces */
+        for( itfIdx = 0; itfIdx < numInterfaces; itfIdx++)
+        {
+            /* If mapEntry is null then required interface is not supported.*/
+            XAObjItfMapEntry *entry =
+                XAObjectItfImpl_GetItfEntry((XAObjectItf)&(pBaseObj), pInterfaceIds[itfIdx]);
+            if( !entry  )
+            {
+                if( pInterfaceRequired[itfIdx] )
+                {
+                    /* required interface cannot be accommodated - fail creation */
+                    DEBUG_ERR("Required interface not found - abort creation!");
+                    ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                    break;
+                }
+                else
+                {
+                    DEBUG_INFO("Requested (not required) interface not found - continue creation");
+                }
+            }
+            else
+            {   /* weed out unsupported content-aware itf's */
+                if( ( (mediaType==XA_MEDIATYPE_IMAGE || !pAudioSrc) &&
+                             (entry->mapIdx==MR_EQUALIZERITF ||
+                              entry->mapIdx==MR_VOLUMEITF ||
+                              entry->mapIdx==MR_AUDIOENCODERITF))
+                        ||
+                    ( (mediaType==XA_MEDIATYPE_AUDIO || !pImageVideoSrc) &&
+                             (entry->mapIdx==MR_IMAGECONTROLSITF ||
+                              entry->mapIdx==MR_IMAGEEFFECTSITF ||
+                              entry->mapIdx==MR_VIDEOPOSTPROCESSINGITF ||
+                              entry->mapIdx==MR_VIDEOENCODER ||
+                              entry->mapIdx==MR_IMAGEENCODERITF ||
+                              entry->mapIdx==MR_SNAPSHOTITF)) )
+                {
+                    entry->required = XA_BOOLEAN_FALSE;
+                    if( pInterfaceRequired[itfIdx] )
+                    {
+                        DEBUG_ERR("Required interface not supported for given media - abort creation!");
+                        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                        break;
+                    }
+                }
+                else
+                {
+                    entry->required = XA_BOOLEAN_TRUE;
+                }
+
+                if(entry->mapIdx==MR_SNAPSHOTITF)
+                {
+                    DEBUG_ERR("SnapshotItf requested - support still mode");
+                    pImpl->recModes |= XA_RECMODE_STILL;
+                }
+                if(entry->mapIdx==MR_RECORDITF)
+                {
+                    DEBUG_ERR("RecordItf requested - support stream mode");
+                    pImpl->recModes |= XA_RECMODE_STREAM;
+                }
+            }
+        }
+    }
+    if( pImpl->recModes ==0 )
+    {
+        DEBUG_ERR("Warning!!! No recording interfaces requested - unable to record!!");
+    }
+    /*check sink and src parameters*/
+    if(ret==XA_RESULT_SUCCESS)
+    {
+        ret = XACommon_ValidateDataLocator(3, pDataSnk, pAudioSrc, pImageVideoSrc);
+        /*datasink ignored if only snapshotitf is used*/
+        if(!pDataSnk && (pImpl->recModes & XA_RECMODE_STREAM))
+        {
+            DEBUG_ERR("No datasink to record to!");
+            ret = XA_RESULT_PARAMETER_INVALID;
+        }
+        if(!pAudioSrc && !pImageVideoSrc)
+        {
+            DEBUG_ERR("No data sources set!");
+            ret = XA_RESULT_PARAMETER_INVALID;
+        }
+    }
+
+    if(ret!=XA_RESULT_SUCCESS)
+    {   /* creation fails */
+        XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+        DEBUG_API("<-XAMediaRecorderImpl_CreateMediaRecorder");
+        return ret;
+    }
+
+    /* Mark interfaces that can be handled dynamically */
+    /* Mandated dynamic itfs */
+    pBaseObj->interfaceMap[MR_METADATAINSERTIONITF].isDynamic = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[MR_EQUALIZERITF].isDynamic = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[MR_IMAGEEFFECTSITF].isDynamic = XA_BOOLEAN_TRUE;
+
+
+    /* Initialize XAMediaRecorderImpl variables */
+    pImpl->audioSrc = pAudioSrc;
+    pImpl->dataSnk = pDataSnk;
+    pImpl->imageVideoSrc = pImageVideoSrc;
+    
+    /* Set ObjectItf to point to newly created object */
+    *pRecorder = (XAObjectItf)&(pBaseObj->self);    
+    
+    
+    tmpUri = (XADataLocator_URI*)(pImpl->dataSnk->pLocator);
+    XAMediaRecorderImpl_DetermineRecordEngine(*pRecorder, tmpUri);
+    
+    if(pImpl->isMMFRecord)
+    {    
+        
+       pImpl->adaptationCtxMMF = XAMediaRecorderAdaptMMF_Create(pImpl->audioSrc,
+                                                             pImpl->imageVideoSrc,
+                                                             pImpl->dataSnk,
+                                                             pImpl->recModes);      
+    }
+    else
+    {
+
+#ifdef _GSTREAMER_BACKEND_
+        pImpl->adaptationCtx = XAMediaRecorderAdapt_Create(pImpl->audioSrc,
+                                                           pImpl->imageVideoSrc,
+                                                           pImpl->dataSnk,
+                                                           pImpl->recModes);
+#endif
+    }
+
+
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+    DEBUG_API("<-XAMediaRecorderImpl_CreateMediaRecorder");
+    return XA_RESULT_SUCCESS;
+}
+
+/* XAResult XAMediaRecorderImpl_QueryNumSupportedInterfaces
+ * Statically query supported interfaces
+ */
+XAresult XAMediaRecorderImpl_QueryNumSupportedInterfaces(XAuint32 *pNumSupportedInterfaces)
+{
+    DEBUG_API("->XAMediaRecorderImpl_QueryNumSupportedInterfaces");
+    if( pNumSupportedInterfaces )
+    {
+        *pNumSupportedInterfaces = MR_ITFCOUNT;
+
+        DEBUG_API("<-XAMediaRecorderImpl_QueryNumSupportedInterfaces");
+        return XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+}
+/* XAResult XAMediaRecorderImpl_QuerySupportedInterfaces
+ * Statically query supported interfaces
+ */
+XAresult XAMediaRecorderImpl_QuerySupportedInterfaces(XAuint32 index,
+                                                      XAInterfaceID *pInterfaceId)
+{
+    DEBUG_API("->XAMediaRecorderImpl_QuerySupportedInterfaces");
+    if( index >= MR_ITFCOUNT || !pInterfaceId )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        *pInterfaceId = *(xaMediaRecorderItfIIDs[index]);
+
+        DEBUG_API("<-XAMediaRecorderImpl_QuerySupportedInterfaces");
+        return XA_RESULT_SUCCESS;
+    }
+}
+
+/*****************************************************************************
+ * base object XAObjectItfImpl methods
+ *****************************************************************************/
+
+/* XAresult XAMediaRecorderImpl_DoRealize( XAObjectItf self )
+ * Description: Realize all implicit and explicitly wanted interfaces.
+ * Create and initialize implementation-specific variables.
+ * Called from base object XAObjectItfImpl
+ */
+XAresult XAMediaRecorderImpl_DoRealize( XAObjectItf self )
+{
+    XAuint8 itfIdx;
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAMediaRecorderImpl* pObjImpl = (XAMediaRecorderImpl*)(pObj);
+    XAresult ret = XA_RESULT_SUCCESS;
+    XADataLocator_URI* tmpUri;
+
+    DEBUG_API("->XAMediaRecorderImpl_DoRealize");
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaRecorder );
+
+    /* check casting from correct pointer type */
+    if( !pObjImpl || pObj != pObjImpl->baseObj.self )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* init adaptation */
+    if(pObjImpl->isMMFRecord)
+    {
+       ret = XAMediaRecorderAdaptMMF_PostInit( pObjImpl->adaptationCtxMMF );
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+       ret = XAMediaRecorderAdapt_PostInit( pObjImpl->adaptationCtx );
+#endif
+    }
+
+    if( ret != XA_RESULT_SUCCESS )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+        return ret;
+    }
+
+    /* Realize all implicit and explicitly wanted interfaces */
+    for( itfIdx = 0; itfIdx < MR_ITFCOUNT; itfIdx++ )
+    {
+        if( !(pObj->interfaceMap[itfIdx].pItf) &&
+            pObj->interfaceMap[itfIdx].required )
+        {
+            void *pItf = NULL;
+            switch( itfIdx )
+            {
+                case MR_DIMITF:
+                    pItf = XADIMItfImpl_Create();
+                    if(pItf)
+                    {
+                        XADIMItfImpl_Init(pItf, self,
+                                XAMediaRecorderImpl_DoAddItf,
+                                XAMediaRecorderImpl_DoResumeItf,
+                                XAMediaRecorderImpl_DoRemoveItf);
+                    }
+                    break;
+                case MR_RECORDITF:
+                    pItf = XARecordItfImpl_Create( pObjImpl );
+                    tmpUri = (XADataLocator_URI*)(pObjImpl->dataSnk->pLocator);
+                    XARecordItfImpl_DetermineRecordEngine(pItf, tmpUri);                
+                    break;
+                    
+
+                case MR_AUDIOENCODERITF:
+                    pItf = XAAudioEncoderItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+                            pObjImpl->adaptationCtx,
+#endif
+                            pObjImpl
+                            );
+                    break;
+                case MR_SNAPSHOTITF:
+                    pItf = XASnapshotItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+                            pObjImpl->adaptationCtx
+#endif
+                            );
+                    break;
+                case MR_VIDEOENCODER:
+                    pItf = XAVideoEncoderItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+                            pObjImpl->adaptationCtx
+#endif
+                            );
+                    break;  
+                case MR_IMAGEENCODERITF:
+                    pItf = XAImageEncoderItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+                            pObjImpl->adaptationCtx
+#endif
+                            );
+                    break; 
+                case MR_METADATAINSERTIONITF:
+                    pItf = XAMetadataInsertionItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+                            pObjImpl->adaptationCtx
+#endif
+                            );
+                    break;                    
+#ifdef _GSTREAMER_BACKEND_
+                    case MR_CONFIGEXTENSIONITF:
+                    pItf = XAConfigExtensionsItfImpl_Create();
+                    XAConfigExtensionsItfImpl_SetContext( pItf, pObjImpl->adaptationCtx);
+                    break;
+                case MR_EQUALIZERITF:
+                    pItf = XAEqualizerItfImpl_Create( pObjImpl->adaptationCtx );
+                    break;
+                case MR_IMAGECONTROLSITF:
+                    pItf = XAImageControlsItfImpl_Create( pObjImpl->adaptationCtx );
+                    break;
+                case MR_IMAGEEFFECTSITF:
+                    pItf = XAImageEffectsItfImpl_Create( pObjImpl->adaptationCtx );
+                    break;
+                case MR_VIDEOPOSTPROCESSINGITF:
+                    pItf = XAVideoPostProcessingItfImpl_Create( pObjImpl->adaptationCtx );
+                    break;
+                case MR_VOLUMEITF:
+                    pItf = XAVolumeItfImpl_Create( pObjImpl->adaptationCtx );
+                    break;
+                case MR_METADATAEXTRACTIONITF:
+                    pItf = XAMetadataExtractionItfImpl_Create( pObjImpl->adaptationCtx );
+                    break;
+                case MR_METADATATRAVERSALITF:
+                    pItf = XAMetadataTraversalItfImpl_Create( pObjImpl->adaptationCtx );
+                    break;
+#endif                    
+                default:
+                    break;
+            }
+            if( !pItf )
+            {
+                DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+                /* memory allocation failed */
+                XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+                return XA_RESULT_MEMORY_FAILURE;
+            }
+            else
+            {
+                pObj->interfaceMap[itfIdx].pItf = pItf;
+            }
+        }
+    }
+
+    pObj->state = XA_OBJECT_STATE_REALIZED;
+    DEBUG_API("<-XAMediaRecorderImpl_DoRealize");
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+    return XA_RESULT_SUCCESS;
+}
+
+/* XAresult XAMediaRecorderImpl_DoResume
+ * Description: Resume object from suspended state
+ */
+XAresult XAMediaRecorderImpl_DoResume(XAObjectItf self)
+{
+    DEBUG_API("->XAMediaRecorderImpl_DoResume");
+    DEBUG_API("<-XAMediaRecorderImpl_DoResume");
+    /* This implementation does not support suspended state */
+    return XA_RESULT_PRECONDITIONS_VIOLATED;
+}
+
+/* void XAMediaRecorderImpl_FreeResources
+ * Description: Free all resources reserved at XAMediaRecorderImpl_DoRealize()
+ */
+void XAMediaRecorderImpl_FreeResources(XAObjectItf self)
+{
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAMediaRecorderImpl* pObjImpl = (XAMediaRecorderImpl*)(pObj);
+    XAuint8 itfIdx;
+
+    DEBUG_API("->XAMediaRecorderImpl_FreeResources");
+    XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS( XATSMediaRecorder );
+#ifdef _GSTREAMER_BACKEND_
+    XAMediaRecorderImpl* pImpl = (XAMediaRecorderImpl*)(*self);
+    assert( pObj && pImpl && pObj == pObj->self );
+#endif
+    /* free all allocated interfaces */
+    for(itfIdx = 0; itfIdx < MR_ITFCOUNT; itfIdx++)
+    {
+        void *pItf = pObj->interfaceMap[itfIdx].pItf;
+        if(pItf)
+        {
+            switch(itfIdx)
+            {
+                case MR_AUDIOENCODERITF:
+                    XAAudioEncoderItfImpl_Free(pItf);
+                    break;
+                case MR_CONFIGEXTENSIONITF:
+                    XAConfigExtensionsItfImpl_Free(pItf);
+                    break;
+                case MR_DIMITF:
+                    XADIMItfImpl_Free(pItf);
+                    break;
+                case MR_EQUALIZERITF:
+                    XAEqualizerItfImpl_Free(pItf);
+                    break;
+                case MR_IMAGECONTROLSITF:
+                    XAImageControlsItfImpl_Free(pItf);
+                    break;
+                case MR_IMAGEEFFECTSITF:
+                    XAImageEffectsItfImpl_Free(pItf);
+                    break;
+                case MR_IMAGEENCODERITF:
+                    XAImageEncoderItfImpl_Free(pItf);
+                    break;
+                case MR_METADATAINSERTIONITF:
+                    XAMetadataInsertionItfImpl_Free(pItf);
+                    break;
+                case MR_RECORDITF:
+                    XARecordItfImpl_Free(pItf);
+                    break;
+                case MR_SNAPSHOTITF:
+                    XASnapshotItfImpl_Free(pItf);
+                    break;
+                case MR_VIDEOENCODER:
+                    XAVideoEncoderItfImpl_Free(pItf);
+                    break;
+                case MR_VIDEOPOSTPROCESSINGITF:
+                    XAVideoPostProcessingItfImpl_Free(pItf);
+                    break;
+                case MR_VOLUMEITF:
+                    XAVolumeItfImpl_Free(pItf);
+                    break;
+                case MR_METADATAEXTRACTIONITF:
+                    XAMetadataExtractionItfImpl_Free(pItf);
+                    break;
+                case MR_METADATATRAVERSALITF:
+                    XAMetadataTraversalItfImpl_Free(pItf);
+                    break;
+                default:
+                    break;
+            }
+            pObj->interfaceMap[itfIdx].pItf = NULL;
+        }
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    if ( pImpl->adaptationCtx != NULL )
+    {
+        XAMediaRecorderAdapt_Destroy( pImpl->adaptationCtx );
+        pImpl->adaptationCtx = NULL;
+    }
+#endif
+    XAMediaRecorderAdaptMMF_Destroy( pObjImpl->adaptationCtxMMF );
+    /* free all other allocated resources*/
+
+    DEBUG_API("<-XAMediaRecorderImpl_FreeResources");
+    XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS( XATSMediaRecorder );
+    return;
+}
+
+/*****************************************************************************
+ * MediaRecorderImpl -specific methods
+ *****************************************************************************/
+
+/* XAMediaRecorderImpl_DoAddItf
+ * Dynamically add an interface, object specific parts
+ */
+XAresult XAMediaRecorderImpl_DoAddItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  )
+{
+#ifdef _GSTREAMER_BACKEND_
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAMediaRecorderImpl* pImpl = (XAMediaRecorderImpl*)(pObj);
+#endif
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMediaRecorderImpl_DoAddItf");
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaRecorder );
+
+    if(mapEntry)
+    {
+        switch( mapEntry->mapIdx )
+        {
+
+        case MR_METADATAINSERTIONITF:
+            mapEntry->pItf = XAMetadataInsertionItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+                    pImpl->adaptationCtx
+#endif
+                    );
+            break;
+#ifdef _GSTREAMER_BACKEND_
+        case MR_EQUALIZERITF:
+            mapEntry->pItf = XAEqualizerItfImpl_Create( pImpl->adaptationCtx );
+            break;
+        case MR_IMAGEEFFECTSITF:
+            mapEntry->pItf = XAImageEffectsItfImpl_Create( pImpl->adaptationCtx );
+            break;
+#endif
+        default:
+            DEBUG_ERR("XAMediaRecorderImpl_DoAddItf unknown id");
+            ret = XA_RESULT_FEATURE_UNSUPPORTED;
+            break;
+        }
+        
+        if( !mapEntry->pItf && ret == XA_RESULT_SUCCESS)
+        {
+            DEBUG_ERR("XAMediaRecorderImpl_DoAddItf itf creation failed");
+            ret = XA_RESULT_MEMORY_FAILURE;
+        }
+    }
+    else
+    {
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+    DEBUG_API("<-XAMediaRecorderImpl_DoAddItf");
+    return ret;
+}
+
+/* XAMediaRecorderImpl_DoResumeItf
+ * Try to resume lost interface, object specific parts
+ */
+XAresult XAMediaRecorderImpl_DoResumeItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  )
+{
+    XAresult ret;
+    /* For now, no difference between suspended and unrealised itfs */
+    DEBUG_API("->XAMediaRecorderImpl_DoResumeItf");
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaRecorder );
+    ret = XAMediaRecorderImpl_DoAddItf(self,mapEntry);
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+    DEBUG_API("<-XAMediaRecorderImpl_DoResumeItf");
+    return ret;
+}
+
+/* XAMediaRecorderImpl_DoRemoveItf
+ * Dynamically remove an interface, object specific parts
+ */
+XAresult XAMediaRecorderImpl_DoRemoveItf(XAObjectItf self, XAObjItfMapEntry *mapEntry )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAMediaRecorderImpl_DoRemoveItf");
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaRecorder );
+    if(mapEntry)
+    {
+        switch( mapEntry->mapIdx )
+        {
+        case MR_METADATAINSERTIONITF:
+            XAMetadataInsertionItfImpl_Free( mapEntry->pItf );
+            break;
+        case MR_EQUALIZERITF:
+            XAEqualizerItfImpl_Free( mapEntry->pItf );
+            break;
+        case MR_IMAGEEFFECTSITF:
+            XAImageEffectsItfImpl_Free( mapEntry->pItf );
+            break;
+        default:
+            DEBUG_ERR("XAMediaRecorderImpl_DoRemoveItf unknown id");
+            ret = XA_RESULT_FEATURE_UNSUPPORTED;
+            break;
+        }
+        mapEntry->pItf = NULL;
+    }
+    else
+    {
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+    DEBUG_API("<-XAMediaRecorderImpl_DoRemoveItf");
+    return ret;
+}
+
+XAresult XAMediaRecorderImpl_DetermineRecordEngine(XAObjectItf self, XADataLocator_URI *uri)
+{
+
+  XAresult ret = XA_RESULT_SUCCESS;
+  char* tempPtr = NULL;
+  char extension[5];
+  
+  XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+  XAMediaRecorderImpl* pImpl = (XAMediaRecorderImpl*)(pObj);  
+  
+    
+  DEBUG_API("->XAMediaRecorderImpl_DetermineRecordEngine");
+    
+  //need to move to configuration file and add more in final class
+  
+  pImpl->isMMFRecord = XA_BOOLEAN_TRUE;
+	
+  tempPtr = strchr((char*)(uri->URI), '.');
+  strcpy(extension, tempPtr);
+	
+	//TODO:
+	//temp everything goes to mmf. in future wav format to go to gst
+  //if(!strcmp(extension, ".wav"))  
+  //{
+  //   pImpl->isMMFRecord = XA_BOOLEAN_FALSE;
+  //}
+
+  DEBUG_API("<-XAMediaRecorderImpl_DetermineRecordEngine"); 
+  return ret;  
+  
+}
+
+/* END OF FILE */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xamediarecorder.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,95 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAMEDIARECORDER_H
+#define XAMEDIARECORDER_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#include "xaobjectitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAMediaRecorderAdaptCtx.h"
+#endif
+#include "xamediarecorderadaptctxmmf.h"
+
+/** MACROS **/
+
+
+/** TYPES **/
+
+
+/** ENUMERATIONS **/
+/* Enumeration for interfaces that MediaRecorder supports.  */
+typedef enum
+{
+    MR_OBJECTITF,
+    MR_AUDIOENCODERITF,
+    MR_CONFIGEXTENSIONITF,
+    MR_DIMITF,
+    MR_EQUALIZERITF,
+    MR_IMAGECONTROLSITF,
+    MR_IMAGEEFFECTSITF,
+    MR_IMAGEENCODERITF,
+    MR_METADATAINSERTIONITF,
+    MR_RECORDITF,
+    MR_SNAPSHOTITF,
+    MR_VIDEOENCODER,
+    MR_VIDEOPOSTPROCESSINGITF,
+    MR_VOLUMEITF,
+    MR_METADATAEXTRACTIONITF,
+    MR_METADATATRAVERSALITF,
+    MR_ITFCOUNT
+} MRInterfaces;
+
+/** STRUCTURES **/
+/* Specification for  MediaRecorderImpl. */
+typedef struct XAMediaRecorderImpl_
+{
+    /* Parent for XAMediaRecorder */
+    XAObjectItfImpl baseObj;
+
+    /* variables */
+    XADataSource *audioSrc;
+    XADataSource *imageVideoSrc;
+    XADataSink *dataSnk;
+    XAuint8 recModes;
+    XAboolean isMMFRecord;    
+
+#ifdef _GSTREAMER_BACKEND_
+    XAAdaptationBaseCtx* adaptationCtx;
+#endif
+    XAAdaptationBaseMMFCtx* adaptationCtxMMF;    
+
+} XAMediaRecorderImpl;
+
+
+/** METHODS **/
+
+/* base object XAObjectItfImpl methods */
+XAresult    XAMediaRecorderImpl_DoRealize(XAObjectItf self);
+XAresult    XAMediaRecorderImpl_DoResume(XAObjectItf self);
+void        XAMediaRecorderImpl_FreeResources(XAObjectItf self);
+
+
+XAresult XAMediaRecorderImpl_DetermineRecordEngine(XAObjectItf self, XADataLocator_URI *uri);
+
+/* MediaRecorderImpl -specific methods*/
+XAresult XAMediaRecorderImpl_DoAddItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  );
+XAresult XAMediaRecorderImpl_DoResumeItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  );
+XAresult XAMediaRecorderImpl_DoRemoveItf(XAObjectItf self, XAObjItfMapEntry *mapEntry );
+
+#endif /* XAMEDIARECORDER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xametadatainsertionitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,463 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xametadatainsertionitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAMetadataAdaptation.h"
+#endif
+#define MAX_TAGS 255
+/* XAMetadataInsertionItfImpl* GetImpl(XAMetadataInsertionItf self)
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XAMetadataInsertionItfImpl* GetImpl(XAMetadataInsertionItf self)
+{
+    if( self )
+    {
+        XAMetadataInsertionItfImpl* impl = (XAMetadataInsertionItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/*****************************************************************************
+ * Base interface XAMetadataInsertionItf implementation
+ *****************************************************************************/
+
+/* XAMetadataInsertionItfImpl_CreateChildNode
+ * Description: Creates a new child node for the given parent.
+ */
+XAresult XAMetadataInsertionItfImpl_CreateChildNode(XAMetadataInsertionItf self,
+                                                    XAint32 parentNodeID,
+                                                    XAuint32 type,
+                                                    XAchar *mimeType,
+                                                    XAint32 *pChildNodeID)
+{
+    XAMetadataInsertionItfImpl *impl = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataInsertionItfImpl_CreateChildNode");
+    impl = GetImpl(self);
+    if(!impl || !mimeType || !pChildNodeID )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+        if( impl->adaptCtx )
+        {
+            ret = XAMetadataInsertionItfAdapt_CreateChildNode(
+                    impl->adaptCtx,parentNodeID,type,mimeType,pChildNodeID);
+        }
+        else
+        {
+            ret = XA_RESULT_INTERNAL_ERROR;
+        }
+#endif
+    /*******************************************/
+    /****This is being done since mmf does not 
+     * support metadata Insertion
+     *******************************************/
+    ret = XA_RESULT_FEATURE_UNSUPPORTED;    
+    }
+    DEBUG_API("<-XAMetadataInsertionItfImpl_CreateChildNode");
+    return ret;
+}
+
+/* XAresult XAMetadataInsertionItfImpl_GetSupportedKeysCount
+ * Description: A query method to tell if the metadata keys (for writing metadata)
+ * can be freely chosen by the application or if they are fixed (for the given node).
+ */
+XAresult XAMetadataInsertionItfImpl_GetSupportedKeysCount(XAMetadataInsertionItf self,
+                                                          XAint32 nodeID,
+                                                          XAboolean *pFreeKeys,
+                                                          XAuint32 *pKeyCount,
+                                                          XAuint32 *pEncodingCount)
+{
+    XAMetadataInsertionItfImpl *impl = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataInsertionItfImpl_GetSupportedKeysCount");
+    impl = GetImpl(self);
+    if(!impl || !pFreeKeys || !pKeyCount || !pEncodingCount )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+        if( impl->adaptCtx )
+        {
+            ret = XAMetadataInsertionItfAdapt_GetSupportedKeysCount(
+                    impl->adaptCtx,nodeID,pFreeKeys,pKeyCount,pEncodingCount);
+        }
+        else
+        {
+            ret = XA_RESULT_INTERNAL_ERROR;
+        }
+#endif
+    /*******************************************/
+    /****This is being done since mmf does not 
+     * support metadata Insertion
+     *******************************************/
+
+    ret = XA_RESULT_PARAMETER_INVALID;     
+    }
+    DEBUG_API("<-XAMetadataInsertionItfImpl_GetSupportedKeysCount");
+    return ret;
+}
+
+/* XAresult XAMetadataInsertionItfImpl_GetKeySize
+ * Description: Returns the byte size required for a supported metadata
+ * key pointed by the given index
+ */
+XAresult XAMetadataInsertionItfImpl_GetKeySize(XAMetadataInsertionItf self,
+                                               XAint32 nodeID,
+                                               XAuint32 keyIndex,
+                                               XAuint32 *pKeySize)
+{
+    XAMetadataInsertionItfImpl *impl = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataInsertionItfImpl_GetKeySize");
+    impl = GetImpl(self);
+    if(!impl || !pKeySize )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+        if( impl->adaptCtx )
+        {
+            ret = XAMetadataInsertionItfAdapt_GetKeySize(
+                        impl->adaptCtx, nodeID, keyIndex, pKeySize);
+        }
+        else
+        {
+            ret = XA_RESULT_INTERNAL_ERROR;
+        }
+#endif
+        /*******************************************/
+        /****This is being done since mmf does not 
+         * support metadata Insertion
+         *******************************************/
+
+        ret = XA_RESULT_PARAMETER_INVALID;          
+    }
+    DEBUG_API("<-XAMetadataInsertionItfImpl_GetKeySize");
+    return ret;
+}
+
+/* XAresult XAMetadataInsertionItfImpl_GetKey
+ * Description; Returns a XAMetadataInfo structure and associated data
+ * referenced by the structure for a supported key
+ */
+XAresult XAMetadataInsertionItfImpl_GetKey(XAMetadataInsertionItf self,
+                                           XAint32 nodeID,
+                                           XAuint32 keyIndex,
+                                           XAuint32 keySize,
+                                           XAMetadataInfo *pKey)
+{
+    XAMetadataInsertionItfImpl *impl = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataInsertionItfImpl_GetKey");
+    impl = GetImpl(self);
+    if(!impl || !pKey )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+        if( impl->adaptCtx )
+        {
+            ret = XAMetadataInsertionItfAdapt_GetKey(
+                    impl->adaptCtx,nodeID,keyIndex,keySize,pKey);
+        }
+        else
+        {
+            ret = XA_RESULT_INTERNAL_ERROR;
+        }
+#endif
+    /*******************************************/
+    /****This is being done since mmf does not 
+     * support metadata Insertion
+     *******************************************/
+
+    ret = XA_RESULT_PARAMETER_INVALID;         
+    }
+    DEBUG_API("<-XAMetadataInsertionItfImpl_GetKey");
+    return ret;
+}
+
+/* XAresult XAMetadataInsertionItfImpl_GetFreeKeysEncoding
+ * Description: A method to be used in case implementation supports
+ * free keys for metadata insertion.
+ */
+XAresult XAMetadataInsertionItfImpl_GetFreeKeysEncoding(XAMetadataInsertionItf self,
+                                                        XAint32 nodeID,
+                                                        XAuint32 encodingIndex,
+                                                        XAuint32 *pEncoding)
+{
+    XAMetadataInsertionItfImpl *impl = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataInsertionItfImpl_GetFreeKeysEncoding");
+    impl = GetImpl(self);
+    if( !impl || !pEncoding )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        ret =XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+        if( impl->adaptCtx )
+        {
+            ret = XAMetadataInsertionItfAdapt_GetFreeKeysEncoding(
+                    impl->adaptCtx,nodeID,encodingIndex,pEncoding);
+        }
+        else
+        {
+            ret = XA_RESULT_INTERNAL_ERROR;
+        }
+#endif
+        /*******************************************/
+        /****This is being done since mmf does not 
+         * support metadata Insertion
+         *******************************************/
+
+        ret = XA_RESULT_PARAMETER_INVALID;         
+    }
+    DEBUG_API("<-XAMetadataInsertionItfImpl_GetFreeKeysEncoding");
+    return ret;
+}
+
+/* XAresult XAMetadataInsertionItfImpl_InsertMetadataItem
+ * Description: Inserts the key/value pair to the specified node of the metadata tree.
+ */
+XAresult XAMetadataInsertionItfImpl_InsertMetadataItem(XAMetadataInsertionItf self,
+                                                       XAint32 nodeID,
+                                                       XAMetadataInfo *pKey,
+                                                       XAMetadataInfo *pValue,
+                                                       XAboolean overwrite)
+{
+    XAMetadataInsertionItfImpl *impl = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataInsertionItfImpl_InsertMetadataItem");
+    impl = GetImpl(self);
+    if( !impl || !pKey || !pValue )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+        if( impl->adaptCtx )
+        {
+            ret = XAMetadataInsertionItfAdapt_InsertMetadataItem(
+                    impl->adaptCtx,nodeID,pKey,pValue,overwrite);
+            /*store pointers for callback*/
+            impl->currentTags.mdeKeys[impl->currentTags.itemcount] = pKey;
+            impl->currentTags.mdeValues[impl->currentTags.itemcount] = pValue;
+            impl->currentTags.itemcount++;
+        }
+        else
+        {
+            ret = XA_RESULT_INTERNAL_ERROR;
+        }
+#endif      
+        /*******************************************/
+        /****This is being done since mmf does not 
+         * support metadata Insertion
+         *******************************************/
+
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;         
+    }
+    DEBUG_API("<-XAMetadataInsertionItfImpl_InsertMetadataItem");
+    return ret;
+}
+
+/* XAresult XAMetadataInsertionItfImpl_RegisterCallback
+ * Description: Registers a callback on the object that executes after each of
+ * the actual writings of metadata key/value pairs takes place.
+ */
+XAresult XAMetadataInsertionItfImpl_RegisterCallback(XAMetadataInsertionItf self,
+                                                     xaMetadataInsertionCallback callback,
+                                                     void *pContext)
+{
+    XAMetadataInsertionItfImpl *impl = NULL;
+
+    DEBUG_API("->XAMetadataInsertionItfImpl_RegisterCallback");
+    impl = GetImpl(self);
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataInsertionItfImpl_RegisterCallback");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_
+    if(callback)
+    {
+        XAAdaptationBase_AddEventHandler( impl->adaptCtx, &XAMetadataInsertionItfImpl_AdaptCb,
+                                          XA_METADATAEVENTS, impl );
+    }
+    else
+    {
+        XAAdaptationBase_RemoveEventHandler(impl->adaptCtx, &XAMetadataInsertionItfImpl_AdaptCb );
+    }
+#endif
+    impl->callback = callback;
+    impl->cbcontext  = pContext;
+    impl->cbPtrToSelf = self;
+
+    DEBUG_API("<-XAMetadataInsertionItfImpl_RegisterCallback");
+    return XA_RESULT_SUCCESS;
+}
+
+/*****************************************************************************
+ * XAMetadataTraversalImpl -specific methods
+ *****************************************************************************/
+
+
+/* XAMetadataInsertionItfImpl* XAMetadataInsertionItfImpl_Create()
+ * Description: Allocate and initialize MetadataInsertionItfImpl
+ */
+XAMetadataInsertionItfImpl* XAMetadataInsertionItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adaptCtx
+#endif
+        )
+{
+    XAMetadataInsertionItfImpl* self = (XAMetadataInsertionItfImpl*)
+        calloc(1,sizeof(XAMetadataInsertionItfImpl));
+    DEBUG_API("->XAMetadataInsertionItfImpl_Create");
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.CreateChildNode = XAMetadataInsertionItfImpl_CreateChildNode;
+        self->itf.GetFreeKeysEncoding = XAMetadataInsertionItfImpl_GetFreeKeysEncoding;
+        self->itf.GetKey = XAMetadataInsertionItfImpl_GetKey;
+        self->itf.GetKeySize = XAMetadataInsertionItfImpl_GetKeySize;
+        self->itf.GetSupportedKeysCount = XAMetadataInsertionItfImpl_GetSupportedKeysCount;
+        self->itf.InsertMetadataItem = XAMetadataInsertionItfImpl_InsertMetadataItem;
+        self->itf.RegisterCallback = XAMetadataInsertionItfImpl_RegisterCallback;
+
+        /* init variables*/
+        
+        self->callback = NULL;
+        self->cbcontext = NULL;
+        self->cbPtrToSelf = NULL;
+#ifdef _GSTREAMER_BACKEND_
+        self->adaptCtx = adaptCtx;
+        self->currentTags.mdeKeys = calloc(MAX_TAGS,sizeof(XAMetadataInfo*));
+        self->currentTags.mdeValues = calloc(MAX_TAGS,sizeof(XAMetadataInfo*));
+#endif
+        self->self = self;
+
+    }
+    DEBUG_API("<-XAMetadataInsertionItfImpl_Create");
+    return self;
+}
+
+/* void XAMetadataInsertionItfImpl_Free(XAMetadataInsertionItfImpl* self)
+ * Description: Free all resources reserved at XAMetadataInsertionItfImpl_Create()
+ */
+void XAMetadataInsertionItfImpl_Free(XAMetadataInsertionItfImpl* self)
+{
+    DEBUG_API("->XAMetadataInsertionItfImpl_Free");
+    assert( self==self->self );
+    if(self->callback)
+    {
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBase_RemoveEventHandler(self->adaptCtx, &XAMetadataInsertionItfImpl_AdaptCb );
+#endif        
+    }
+#ifdef _GSTREAMER_BACKEND_
+    XAMetadataAdapt_FreeImplTagList(&(self->currentTags), XA_BOOLEAN_FALSE);
+#endif
+    free( self );
+    DEBUG_API("<-XAMetadataInsertionItfImpl_Free");
+}
+#ifdef _GSTREAMER_BACKEND_
+/* With this method, adaptation infroms that tags are written to stream
+ */
+void XAMetadataInsertionItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+{
+    XAMetadataInsertionItfImpl* impl = NULL;
+    XAuint32 idx = 0, nodeID = XA_ROOT_NODE_ID;
+    XAboolean result = XA_BOOLEAN_TRUE;
+    DEBUG_API("->XAMetadataInsertionItfImpl_AdaptCb");
+    impl = (XAMetadataInsertionItfImpl*)pHandlerCtx;
+    if(!impl)
+    {
+        DEBUG_ERR("XAMetadataInsertionItfImpl_AdaptCb, invalid context pointer!");
+        DEBUG_API("<-XAMetadataInsertionItfImpl_AdaptCb");
+        return;
+    }
+    if( event && event->eventid == XA_ADAPT_MDE_TAGS_WRITTEN )
+    {
+        /*here datasize field is used for return value*/
+        if(event->datasize != XA_RESULT_SUCCESS)
+        {
+            DEBUG_ERR_A1("Adaptation failed to write metadata (code %x)!",(int)event->datasize);
+            result=XA_BOOLEAN_FALSE;
+        }
+        /*all tags written, send cb for client to free the memory*/
+        for(idx=0;idx<impl->currentTags.itemcount;idx++)
+        {
+            if(impl->callback)
+            {
+                impl->callback(impl->cbPtrToSelf, impl->cbcontext,
+                               impl->currentTags.mdeKeys[idx],
+                               impl->currentTags.mdeValues[idx],
+                               nodeID, result);
+            }
+            impl->currentTags.mdeKeys[idx]=NULL;
+            impl->currentTags.mdeValues[idx]=NULL;
+        }
+        impl->currentTags.itemcount=0;
+    }
+    else
+    {
+        DEBUG_INFO("unhandled");
+    }
+    DEBUG_API("<-XAMetadataInsertionItfImpl_AdaptCb");
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xametadatainsertionitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,108 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAMETADATAINSERTIONITF_H
+#define XAMETADATAINSERTIONITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#include "XAMetadataAdaptation.h"
+#endif
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAMetadataInsertionItf implementation */
+typedef struct XAMetadataInsertionItfImpl_
+{
+    /* parent interface */
+    struct XAMetadataInsertionItf_ itf;
+    /* pointer to self */
+    struct XAMetadataInsertionItfImpl_* self;
+
+#ifdef _GSTREAMER_BACKEND_
+    /* variables */
+    XAAdaptationBaseCtx *adaptCtx;
+    XAMetadataImplTagList   currentTags;
+#endif
+    /*Callback*/
+    xaMetadataInsertionCallback callback;
+    void    *cbcontext;
+    XAMetadataInsertionItf cbPtrToSelf;
+
+} XAMetadataInsertionItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAMetadataInsertionItf implementation */
+XAresult XAMetadataInsertionItfImpl_CreateChildNode(XAMetadataInsertionItf self,
+                                                    XAint32 parentNodeID,
+                                                    XAuint32 type,
+                                                    XAchar *mimeType,
+                                                    XAint32 *pChildNodeID);
+
+XAresult XAMetadataInsertionItfImpl_GetSupportedKeysCount(XAMetadataInsertionItf self,
+                                                          XAint32 nodeID,
+                                                          XAboolean *pFreeKeys,
+                                                          XAuint32 *pKeyCount,
+                                                          XAuint32 *pEncodingCount);
+
+XAresult XAMetadataInsertionItfImpl_GetKeySize(XAMetadataInsertionItf self,
+                                               XAint32 nodeID,
+                                               XAuint32 keyIndex,
+                                               XAuint32 *pKeySize);
+
+XAresult XAMetadataInsertionItfImpl_GetKey(XAMetadataInsertionItf self,
+                                           XAint32 nodeID,
+                                           XAuint32 keyIndex,
+                                           XAuint32 keySize,
+                                           XAMetadataInfo *pKey);
+
+XAresult XAMetadataInsertionItfImpl_GetFreeKeysEncoding(XAMetadataInsertionItf self,
+                                                        XAint32 nodeID,
+                                                        XAuint32 encodingIndex,
+                                                        XAuint32 *pEncoding);
+
+XAresult XAMetadataInsertionItfImpl_InsertMetadataItem(XAMetadataInsertionItf self,
+                                                       XAint32 nodeID,
+                                                       XAMetadataInfo *pKey,
+                                                       XAMetadataInfo *pValue,
+                                                       XAboolean overwrite);
+
+XAresult XAMetadataInsertionItfImpl_RegisterCallback(XAMetadataInsertionItf self,
+                                                     xaMetadataInsertionCallback callback,
+                                                     void *pContext);
+
+/* XAMetadataInsertionItfImpl -specific methods */
+XAMetadataInsertionItfImpl* XAMetadataInsertionItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adaptCtx,
+#else
+        void
+#endif
+        );
+#ifdef _GSTREAMER_BACKEND_
+void XAMetadataInsertionItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
+#endif
+void XAMetadataInsertionItfImpl_Free(XAMetadataInsertionItfImpl* self);
+
+#endif /* XAMETADATAINSERTIONITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xarecorditf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,763 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xarecorditf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XARecordItfAdaptation.h"
+#endif
+#include "xarecorditfadaptationmmf.h"
+#include "xathreadsafety.h"
+#include <string.h>
+/**
+ * XARecordItfImpl* GetImpl(XARecordItf self)
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ **/
+static XARecordItfImpl* GetImpl(XARecordItf self)
+{
+    if( self )
+    {
+        XARecordItfImpl* impl = (XARecordItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/*****************************************************************************
+ * Base interface XARecordItf implementation
+ *****************************************************************************/
+
+/**
+ * XAresult XARecordItfImpl_SetRecordState(XARecordItf self,
+ *                                         XAuint32 state)
+ * Description: Transitions recorder into the given record state.
+ **/
+XAresult XARecordItfImpl_SetRecordState(XARecordItf self,
+                                        XAuint32 state)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARecordItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XARecordItfImpl_SetRecordState");
+
+    if( !impl || state < XA_RECORDSTATE_STOPPED || state > XA_RECORDSTATE_RECORDING )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfImpl_SetRecordState");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is play state changed, if not do nothing */
+    if(state != impl->recordState)
+    {
+        if(impl->isMMFRecord)
+        {
+           ret = XARecordItfAdaptMMF_SetRecordState(impl->adaptCtxMMF, state);
+        }
+        else
+        {
+#ifdef _GSTREAMER_BACKEND_
+           ret = XARecordItfAdapt_SetRecordState(impl->adapCtx, state);
+#endif
+        }
+
+        if(ret == XA_RESULT_SUCCESS)
+        {
+            impl->recordState = state;
+        }
+    }
+
+    DEBUG_API("<-XARecordItfImpl_SetRecordState");
+    return ret;
+}
+
+/**
+ * XAresult XARecordItfImpl_GetRecordState(XARecordItf self,
+ *                                         XAuint32 *pState)
+ * Description: Gets the recorder’s current record state.
+ **/
+XAresult XARecordItfImpl_GetRecordState(XARecordItf self,
+                                        XAuint32 *pState)
+{
+    XARecordItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XARecordItfImpl_GetRecordState");
+
+    if( !impl || !pState )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfImpl_GetRecordState");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pState = impl->recordState;
+
+    DEBUG_API("<-XARecordItfImpl_GetRecordState");
+
+    return XA_RESULT_SUCCESS;
+}
+
+/**
+ * XAresult XARecordItfImpl_SetDurationLimit(XARecordItf self,
+ *                                           XAmillisecond msec)
+ * Description: Sets the duration of current content in milliseconds.
+ **/
+XAresult XARecordItfImpl_SetDurationLimit(XARecordItf self,
+                                          XAmillisecond msec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARecordItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XARecordItfImpl_SetDurationLimit");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+    if( !impl || msec <= 0 )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfImpl_SetDurationLimit");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->durationLimitSetted = 1;
+    impl->durationLimit = msec;
+    if(!(impl->isMMFRecord))
+    {
+#ifdef _GSTREAMER_BACKEND_
+       ret = XARecordItfAdapt_EnablePositionTracking( impl->adapCtx, 1 );
+#endif
+    }
+    else
+    {
+    ret = XARecordItfAdaptMMF_EnablePositionTracking( impl->adaptCtxMMF, 1 );
+    }
+
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    DEBUG_API("<-XARecordItfImpl_SetDurationLimit");
+    return ret;
+}
+
+/**
+ * XAresult XARecordItfImpl_GetPosition(XARecordItf self,
+ *                                      XAmillisecond *pMsec)
+ * Description: Returns the current position of the recording head relative
+ *              to the beginning of content.
+ **/
+XAresult XARecordItfImpl_GetPosition(XARecordItf self,
+                                     XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARecordItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XARecordItfImpl_GetPosition");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+    if( !impl || !pMsec )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfImpl_GetPosition");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    
+    if(!(impl->isMMFRecord))
+    {
+    
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARecordItfAdapt_GetPosition(impl->adapCtx, pMsec);
+#endif
+    }
+    else
+    {
+    ret = XARecordItfAdaptMMF_GetPosition(impl->adaptCtxMMF, pMsec);
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    DEBUG_API("<-XARecordItfImpl_GetPosition");
+    return ret;
+}
+
+/**
+ * XAresult XARecordItfImpl_RegisterCallback(XARecordItf self,
+ *                                           xaRecordCallback callback,
+ *                                           void *pContext)
+ * Description: Registers the record callback function.
+ **/
+XAresult XARecordItfImpl_RegisterCallback(XARecordItf self,
+                                          xaRecordCallback callback,
+                                          void *pContext)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARecordItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XARecordItfImpl_RegisterCallback");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfImpl_RegisterCallback");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( callback )
+    {
+        impl->callback = callback;
+        impl->cbcontext  = pContext;
+        impl->cbPtrToSelf = self;
+    }
+    else
+    {
+        /* There is no callback */
+    }
+
+    DEBUG_API("<-XARecordItfImpl_RegisterCallback");
+    return ret;
+}
+
+/**
+ * XAresult XARecordItfImpl_SetCallbackEventsMask(XARecordItf self,
+ *                                                XAuint32 eventFlags)
+ * Description: Sets the notification state of record events.
+ **/
+XAresult XARecordItfImpl_SetCallbackEventsMask(XARecordItf self,
+                                               XAuint32 eventFlags)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARecordItfImpl* impl = GetImpl(self);
+    DEBUG_API_A1("->XARecordItfImpl_SetCallbackEventsMask- %lu", eventFlags);
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+
+    if(!impl || (eventFlags > (XA_RECORDEVENT_HEADATLIMIT | XA_RECORDEVENT_HEADATMARKER |
+                 XA_RECORDEVENT_HEADATNEWPOS | XA_RECORDEVENT_HEADMOVING |
+                 XA_RECORDEVENT_HEADSTALLED | XA_RECORDEVENT_BUFFER_FULL)) )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfImpl_SetCallbackEventsMask");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->eventFlags = eventFlags;
+    
+    if(!(impl->isMMFRecord))
+        {
+#ifdef _GSTREAMER_BACKEND_
+            /* enable position tracking if client wants so */
+            if( (eventFlags & (XA_RECORDEVENT_HEADATMARKER | XA_RECORDEVENT_HEADATNEWPOS))
+                &&  impl->adapCtx && !impl->positionupdateOn)
+            {
+                ret = XARecordItfAdapt_EnablePositionTracking(impl->adapCtx, XA_BOOLEAN_TRUE);
+                if( ret == XA_RESULT_SUCCESS )
+                {
+                    impl->positionupdateOn = XA_BOOLEAN_TRUE;
+                }
+            }
+            else if( !(eventFlags & (XA_RECORDEVENT_HEADATMARKER | XA_RECORDEVENT_HEADATNEWPOS))
+                    &&  impl->adapCtx && impl->positionupdateOn)
+            {
+                ret = XARecordItfAdapt_EnablePositionTracking(impl->adapCtx, XA_BOOLEAN_FALSE);
+                if( ret == XA_RESULT_SUCCESS )
+                {
+                    impl->positionupdateOn = XA_BOOLEAN_FALSE;
+                }
+            }
+#endif
+        }
+    else
+        {
+            /* enable position tracking if client wants so */
+            if( (eventFlags & (XA_RECORDEVENT_HEADATMARKER | XA_RECORDEVENT_HEADATNEWPOS))
+                &&  impl->adaptCtxMMF && !impl->positionupdateOn)
+            {
+                ret = XARecordItfAdaptMMF_EnablePositionTracking(impl->adaptCtxMMF, XA_BOOLEAN_TRUE);
+                if( ret == XA_RESULT_SUCCESS )
+                {
+                    impl->positionupdateOn = XA_BOOLEAN_TRUE;
+                }
+            }
+            else if( !(eventFlags & (XA_RECORDEVENT_HEADATMARKER | XA_RECORDEVENT_HEADATNEWPOS))
+                    &&  impl->adaptCtxMMF && impl->positionupdateOn)
+            {
+                ret = XARecordItfAdaptMMF_EnablePositionTracking(impl->adaptCtxMMF, XA_BOOLEAN_FALSE);
+                if( ret == XA_RESULT_SUCCESS )
+                {
+                    impl->positionupdateOn = XA_BOOLEAN_FALSE;
+                }
+    }
+        }
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    DEBUG_API("<-XARecordItfImpl_SetCallbackEventsMask");
+    return ret;
+}
+
+/**
+ * XAresult XARecordItfImpl_GetCallbackEventsMask(XARecordItf self,
+ *                                                XAuint32 *pEventFlags)
+ * Description: Queries the notification state of record events.
+ **/
+XAresult XARecordItfImpl_GetCallbackEventsMask(XARecordItf self,
+                                               XAuint32 *pEventFlags)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARecordItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XARecordItfImpl_GetCallbackEventsMask");
+
+    DEBUG_INFO_A1("pEventFlags - %u", pEventFlags);
+
+
+    if( !impl || !pEventFlags )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfImpl_GetCallbackEventsMask");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pEventFlags = impl->eventFlags;
+    DEBUG_API("<-XARecordItfImpl_GetCallbackEventsMask");
+    return ret;
+}
+
+/**
+ * XAresult XARecordItfImpl_SetMarkerPosition(XARecordItf self,
+ *                                            XAmillisecond mSec)
+ * Description: Sets the position of the recording marker.
+ **/
+XAresult XARecordItfImpl_SetMarkerPosition(XARecordItf self,
+                                           XAmillisecond mSec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARecordItfImpl *impl = GetImpl(self);
+    DEBUG_API_A1("->XARecordItfImpl_SetMarkerPosition, mSec-%lu",mSec);
+
+    if( !impl || (( impl->durationLimitSetted) && (mSec > impl->durationLimit) ) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfImpl_SetMarkerPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->markerPosition = mSec;
+
+    DEBUG_API("<-XARecordItfImpl_SetMarkerPosition");
+    return ret;
+}
+
+/**
+ * XAresult XARecordItfImpl_ClearMarkerPosition(XARecordItf self)
+ * Description: Clears marker.
+ **/
+XAresult XARecordItfImpl_ClearMarkerPosition(XARecordItf self)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARecordItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XARecordItfImpl_ClearMarkerPosition");
+
+    if( !impl )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfImpl_ClearMarkerPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->markerPosition = NO_POSITION;
+
+    DEBUG_API("<-XARecordItfImpl_ClearMarkerPosition");
+    return ret;
+}
+
+/**
+ * XAresult XARecordItfImpl_GetMarkerPosition(XARecordItf self,
+ *                                            XAmillisecond *pMsec)
+ * Description: Queries the position of the recording marker.
+ **/
+XAresult XARecordItfImpl_GetMarkerPosition(XARecordItf self,
+                                           XAmillisecond *pMsec)
+{
+    XARecordItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XARecordItfImpl_GetMarkerPosition");
+
+    if( !impl || !pMsec )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfImpl_GetMarkerPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    if ( impl->markerPosition == NO_POSITION )
+    {
+        DEBUG_ERR("No marker position set.");
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+
+    *pMsec = impl->markerPosition;
+
+    DEBUG_API("<-XARecordItfImpl_GetMarkerPosition");
+    return XA_RESULT_SUCCESS;
+}
+
+/**
+ * XAresult XARecordItfImpl_SetPositionUpdatePeriod(XARecordItf self,
+ *                                                  XAmillisecond mSec)
+ * Description: Sets the interval between periodic position notifications.
+ **/
+XAresult XARecordItfImpl_SetPositionUpdatePeriod(XARecordItf self,
+                                                 XAmillisecond mSec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARecordItfImpl *impl = GetImpl(self);
+    DEBUG_API_A1("->XARecordItfImpl_SetPositionUpdatePeriod, mSec-%lu",mSec);
+
+    if( !impl || (( impl->durationLimitSetted) && (mSec > impl->durationLimit) ) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfImpl_SetPositionUpdatePeriod");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->positionUpdatePeriod = mSec;
+
+    DEBUG_API("<-XARecordItfImpl_SetPositionUpdatePeriod");
+    return ret;
+}
+
+/**
+ * XAresult XARecordItfImpl_GetPositionUpdatePeriod(XARecordItf self,
+ *                                                  XAmillisecond *pMsec)
+ * Description: Queries the interval between periodic position notifications.
+ **/
+XAresult XARecordItfImpl_GetPositionUpdatePeriod(XARecordItf self,
+                                                 XAmillisecond *pMsec)
+{
+    XARecordItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XARecordItfImpl_GetPositionUpdatePeriod");
+
+    if( !impl || !pMsec )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfImpl_GetPositionUpdatePeriod");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pMsec = impl->positionUpdatePeriod;
+
+    DEBUG_API("<-XARecordItfImpl_GetPositionUpdatePeriod");
+    return XA_RESULT_SUCCESS;
+}
+
+/*****************************************************************************
+ * XARecordItfImpl -specific methods
+ *****************************************************************************/
+
+
+/**
+ * XARecordItfImpl* XARecordItfImpl_Create()
+ * Description: Allocate and initialize XARecordItfImpl
+ **/
+XARecordItfImpl* XARecordItfImpl_Create( 
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adapCtx,
+#endif
+        XAMediaRecorderImpl* impl )
+{
+    XARecordItfImpl* self = (XARecordItfImpl*)
+        calloc(1,sizeof(XARecordItfImpl));
+    DEBUG_API("->XARecordItfImpl_Create");
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.ClearMarkerPosition = XARecordItfImpl_ClearMarkerPosition;
+        self->itf.GetCallbackEventsMask = XARecordItfImpl_GetCallbackEventsMask;
+        self->itf.GetMarkerPosition = XARecordItfImpl_GetMarkerPosition;
+        self->itf.GetPosition = XARecordItfImpl_GetPosition;
+        self->itf.GetPositionUpdatePeriod = XARecordItfImpl_GetPositionUpdatePeriod;
+        self->itf.GetRecordState = XARecordItfImpl_GetRecordState;
+        self->itf.RegisterCallback = XARecordItfImpl_RegisterCallback;
+        self->itf.SetCallbackEventsMask = XARecordItfImpl_SetCallbackEventsMask;
+        self->itf.SetDurationLimit = XARecordItfImpl_SetDurationLimit;
+        self->itf.SetMarkerPosition = XARecordItfImpl_SetMarkerPosition;
+        self->itf.SetPositionUpdatePeriod = XARecordItfImpl_SetPositionUpdatePeriod;
+        self->itf.SetRecordState = XARecordItfImpl_SetRecordState;
+
+        /* init variables */
+        self->recordState = XA_RECORDSTATE_STOPPED;
+        self->markerPosition = NO_POSITION;
+        self->durationLimit = DURATION_LIMIT_NOT_SETTED;
+        self->durationLimitSetted = 0;
+        self->positionUpdatePeriod = RECORDITF_DEFAULT_UPDATE_PERIOD;
+        self->lastPosition = START_POSITION;
+        self->callback = NULL;
+        self->cbcontext = NULL;
+        self->eventFlags = 0;
+        self->adaptCtxMMF = impl->adaptationCtxMMF;
+        self->cbPtrToSelf = NULL;
+        self->pObjImpl = impl;
+#ifdef _GSTREAMER_BACKEND_
+        self->adapCtx = adapCtx;
+        XAAdaptationBase_AddEventHandler( adapCtx, &XARecordItfImpl_AdaptCb, XA_RECORDITFEVENTS, self );
+#endif
+        XAAdaptationBaseMMF_AddEventHandler( impl->adaptationCtxMMF, &XARecordItfImplMMF_AdaptCb, XA_RECORDITFEVENTS, self );
+        self->self = self;
+    }
+    DEBUG_API("<-XARecordItfImpl_Create");
+    return self;
+}
+
+/**
+ * void XARecordItfImpl_Free(XARecordItfImpl* self)
+ * Description: Free all resources reserved at XARecordItfImpl_Create
+ **/
+void XARecordItfImpl_Free(XARecordItfImpl* self)
+{
+    DEBUG_API("->XARecordItfImpl_Free");
+    assert( self==self->self );
+#ifdef _GSTREAMER_BACKEND_
+    XAAdaptationBase_RemoveEventHandler( self->adapCtx, &XARecordItfImpl_AdaptCb );
+#endif    
+    XAAdaptationBaseMMF_RemoveEventHandler( self->adaptCtxMMF, &XARecordItfImplMMF_AdaptCb );
+    free( self );
+    DEBUG_API("<-XARecordItfImpl_Free");
+}
+
+#ifdef _GSTREAMER_BACKEND_
+/* void XARecordItfImpl_AdaptCb
+ * Description: Listen changes in adaptation
+ */
+void XARecordItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+{
+    XARecordItfImpl* impl = (XARecordItfImpl*)pHandlerCtx;
+    DEBUG_API("->XARecordItfImpl_AdaptCb");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XARecordItfImpl_AdaptCb, invalid context pointer!");
+        DEBUG_API("<-XARecordItfImpl_AdaptCb");
+        return;
+    }
+    assert(event);
+    /* check position update events */
+    if( event->eventid == XA_ADAPT_POSITION_UPDATE_EVT )
+    {
+        XAuint32 newpos = 0;
+        assert(event->data);
+        newpos = *((XAuint32*)(event->data));
+        DEBUG_INFO_A1("new position %u",newpos);
+        /* check if marker passed and callback needed */
+        if( (impl->markerPosition != NO_POSITION) &&
+            (impl->eventFlags & XA_RECORDEVENT_HEADATMARKER) )
+        {
+            if( (impl->lastPosition < impl->markerPosition) &&
+                (newpos >= impl->markerPosition) &&
+                impl->callback )
+            {
+                impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_RECORDEVENT_HEADATMARKER);
+            }
+        }
+        /* check if update period passed and callback needed */
+        if( (impl->positionUpdatePeriod > 0) &&
+            (impl->eventFlags & XA_RECORDEVENT_HEADATNEWPOS) &&
+            impl->callback )
+        {
+            if( (XAuint32)((impl->lastPosition)/(impl->positionUpdatePeriod )) <
+                (XAuint32)(newpos/(impl->positionUpdatePeriod )) )
+            {
+                impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_RECORDEVENT_HEADATNEWPOS);
+            }
+        }
+        /* store position */
+        impl->lastPosition = newpos;
+
+        /* Check have we reached record duration limit */
+        if ( impl->durationLimitSetted)
+        {
+            if ( impl->lastPosition >= impl->durationLimit )
+            {
+                XARecordItfImpl_SetRecordState( impl->cbPtrToSelf,XA_RECORDSTATE_STOPPED );
+                impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_RECORDEVENT_HEADATLIMIT);
+            }
+        }
+    }
+    else if( event->eventid == XA_RECORDEVENT_HEADSTALLED )
+    {
+        impl->recordState = XA_RECORDSTATE_PAUSED;
+        /* send callback if needed */
+        if( (XA_RECORDEVENT_HEADSTALLED & impl->eventFlags) && impl->callback )
+        {
+            impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_RECORDEVENT_HEADSTALLED);
+        }
+    }
+    else if( event->eventid == XA_RECORDEVENT_BUFFER_FULL )
+    {
+        /* Adaptation is set to pause, need to sync state with AL-layer*/
+        impl->recordState = XA_RECORDSTATE_STOPPED;
+        /* send callback if needed */
+        if( (XA_RECORDEVENT_BUFFER_FULL & impl->eventFlags) && impl->callback )
+        {
+            impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_RECORDEVENT_BUFFER_FULL);
+        }
+    }
+    else if( event->eventid == XA_RECORDEVENT_HEADMOVING )
+    {
+        /* send callback if needed */
+        if( (XA_RECORDEVENT_HEADMOVING & impl->eventFlags) && impl->callback )
+        {
+            impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_RECORDEVENT_HEADMOVING);
+        }
+    }
+    else
+    {
+        /* do nothing */
+    }
+
+    DEBUG_API("<-XARecordItfImpl_AdaptCb");
+}
+#endif
+
+
+/* void XARecordItfImpl_AdaptCb
+ * Description: Listen changes in adaptation
+ */
+void XARecordItfImplMMF_AdaptCb( void *pHandlerCtx, XAAdaptEventMMF *event )
+{
+    XARecordItfImpl* impl = (XARecordItfImpl*)pHandlerCtx;
+    DEBUG_API("->XARecordItfImpl_AdaptCb");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XARecordItfImpl_AdaptCb, invalid context pointer!");
+        DEBUG_API("<-XARecordItfImpl_AdaptCb");
+        return;
+    }
+    assert(event);
+    /* check position update events */
+    if( event->eventid == XA_ADAPT_POSITION_UPDATE_EVT )
+    {
+        XAuint32 newpos = 0;
+        assert(event->data);
+        newpos = *((XAuint32*)(event->data));
+        DEBUG_INFO_A1("new position %u",newpos);
+        /* check if marker passed and callback needed */
+        if( (impl->markerPosition != NO_POSITION) &&
+            (impl->eventFlags & XA_RECORDEVENT_HEADATMARKER) )
+        {
+            if( (impl->lastPosition < impl->markerPosition) &&
+                (newpos >= impl->markerPosition) &&
+                impl->callback )
+            {
+                impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_RECORDEVENT_HEADATMARKER);
+            }
+        }
+        /* check if update period passed and callback needed */
+        if( (impl->positionUpdatePeriod > 0) &&
+            (impl->eventFlags & XA_RECORDEVENT_HEADATNEWPOS) &&
+            impl->callback )
+        {
+            if( (XAuint32)((impl->lastPosition)/(impl->positionUpdatePeriod )) <
+                (XAuint32)(newpos/(impl->positionUpdatePeriod )) )
+            {
+                impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_RECORDEVENT_HEADATNEWPOS);
+            }
+        }
+        /* store position */
+        impl->lastPosition = newpos;
+
+        /* Check have we reached record duration limit */
+        if ( impl->durationLimitSetted && impl->callback)
+        {
+            if ( impl->lastPosition >= impl->durationLimit )
+            {
+                XARecordItfImpl_SetRecordState( impl->cbPtrToSelf,XA_RECORDSTATE_STOPPED );
+                impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_RECORDEVENT_HEADATLIMIT);
+            }
+        }
+    }
+    else if( event->eventid == XA_RECORDEVENT_HEADSTALLED )
+    {
+        impl->recordState = XA_RECORDSTATE_PAUSED;
+        /* send callback if needed */
+        if( (XA_RECORDEVENT_HEADSTALLED & impl->eventFlags) && impl->callback )
+        {
+            impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_RECORDEVENT_HEADSTALLED);
+        }
+    }
+    else if( event->eventid == XA_RECORDEVENT_BUFFER_FULL )
+    {
+        /* Adaptation is set to pause, need to sync state with AL-layer*/
+        impl->recordState = XA_RECORDSTATE_STOPPED;
+        /* send callback if needed */
+        if( (XA_RECORDEVENT_BUFFER_FULL & impl->eventFlags) && impl->callback )
+        {
+            impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_RECORDEVENT_BUFFER_FULL);
+        }
+    }
+    else if( event->eventid == XA_RECORDEVENT_HEADMOVING )
+    {
+        /* send callback if needed */
+        if( (XA_RECORDEVENT_HEADMOVING & impl->eventFlags) && impl->callback )
+        {
+            impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_RECORDEVENT_HEADMOVING);
+        }
+    }
+    else
+    {
+        impl->pObjImpl->baseObj.callBack(impl->pObjImpl->baseObj.cbPtrToSelf, impl->pObjImpl->baseObj.context, 
+                                        event->eventid, 0 ,
+                                        impl->pObjImpl->baseObj.state , NULL);
+    }
+
+    DEBUG_API("<-XARecordItfImpl_AdaptCb");
+}
+
+XAresult XARecordItfImpl_DetermineRecordEngine(XARecordItf self, XADataLocator_URI *uri)
+{
+
+  XAresult ret = XA_RESULT_SUCCESS;
+  
+  char* tempPtr = NULL;
+  char extension[5];
+  
+  XARecordItfImpl* impl = (XARecordItfImpl*)(self);
+  DEBUG_API("->XAPlayItfImpl_DetermineRecordEngine");
+    
+  //need to move to configuration file and add more in final class
+  
+  impl->isMMFRecord = XA_BOOLEAN_TRUE;
+	
+  tempPtr = strchr((char*)(uri->URI), '.');
+  strcpy(extension, tempPtr);
+	
+	//TODO:
+	//For now all record use cases need to go to MMF in the future can move wav to gst
+  //if(!strcmp(extension, ".wav"))  
+  //{
+  //   impl->isMMFRecord = XA_BOOLEAN_FALSE;
+  //}
+
+  return ret;  
+  
+  DEBUG_API("<-XAPlayItfImpl_DetermineRecordEngine");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xarecorditf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,125 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XARECORDITF_H
+#define XARECORDITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#endif
+#include "xaadaptationcontextbasemmf.h"
+#include "xamediarecorder.h"
+/** MACROS **/
+#define NO_POSITION XA_TIME_UNKNOWN
+#define RECORDITF_DEFAULT_UPDATE_PERIOD 1000
+#define START_POSITION 0
+#define DURATION_LIMIT_NOT_SETTED 0
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XARecordItf implementation */
+typedef struct XARecordItfImpl_
+{
+    /* parent interface */
+    struct XARecordItf_ itf;
+    /* pointer to self */
+    struct XARecordItfImpl_* self;
+
+    XAMediaRecorderImpl* pObjImpl;
+    /* variables */
+    XAuint32        recordState;
+    XAboolean       durationLimitSetted;
+    XAmillisecond   durationLimit;
+    XAmillisecond   markerPosition;
+    XAmillisecond   positionUpdatePeriod;
+    void            *cbcontext;
+    XAuint32        eventFlags;
+    XAboolean       positionupdateOn;
+    XAmillisecond   lastPosition;
+
+    xaRecordCallback callback;
+    void*            context;
+    XARecordItf      cbPtrToSelf;
+
+#ifdef _GSTREAMER_BACKEND_
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+    XAAdaptationBaseMMFCtx *adaptCtxMMF;
+    XAboolean isMMFRecord;    
+
+} XARecordItfImpl;
+
+/** METHODS **/
+
+/* Base interface XARecordItf implementation
+ * See API Specification for method documentation
+ */
+XAresult XARecordItfImpl_SetRecordState( XARecordItf self,
+                                         XAuint32 state );
+
+XAresult XARecordItfImpl_GetRecordState( XARecordItf self,
+                                         XAuint32 *pState );
+
+XAresult XARecordItfImpl_SetDurationLimit( XARecordItf self,
+                                           XAmillisecond msec );
+
+XAresult XARecordItfImpl_GetPosition( XARecordItf self,
+                                      XAmillisecond *pMsec );
+
+XAresult XARecordItfImpl_RegisterCallback( XARecordItf self,
+                                           xaRecordCallback callback,
+                                           void *pContext );
+
+XAresult XARecordItfImpl_SetCallbackEventsMask( XARecordItf self,
+                                                XAuint32 eventFlags );
+
+XAresult XARecordItfImpl_GetCallbackEventsMask( XARecordItf self,
+                                                XAuint32 *pEventFlags );
+
+XAresult XARecordItfImpl_SetMarkerPosition( XARecordItf self,
+                                            XAmillisecond mSec );
+
+XAresult XARecordItfImpl_ClearMarkerPosition( XARecordItf self );
+
+XAresult XARecordItfImpl_GetMarkerPosition( XARecordItf self,
+                                            XAmillisecond *pMsec );
+
+XAresult XARecordItfImpl_SetPositionUpdatePeriod( XARecordItf self,
+                                                  XAmillisecond mSec );
+
+XAresult XARecordItfImpl_GetPositionUpdatePeriod( XARecordItf self,
+                                                  XAmillisecond *pMsec );
+
+/* XARecordItfImpl -specific methods */
+XARecordItfImpl* XARecordItfImpl_Create( 
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adapCtx,
+#endif
+        XAMediaRecorderImpl* impl );
+XAresult XARecordItfImpl_DetermineRecordEngine(XARecordItf self, XADataLocator_URI *uri);
+void XARecordItfImpl_Free( XARecordItfImpl* self );
+#ifdef _GSTREAMER_BACKEND_
+void XARecordItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
+#endif
+void XARecordItfImplMMF_AdaptCb( void *pHandlerCtx, XAAdaptEventMMF *event );
+#endif /* XARECORDITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xasnapshotitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,555 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xasnapshotitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XASnapShotItfAdaptation.h"
+#endif
+#include "xathreadsafety.h"
+#include "xaplayitf.h"
+#include "xaglobals.h"
+
+extern void* vfHandle;
+
+/**
+ * static XASnapshotItfImpl* GetImpl(XASnapshotItf self)
+ * Description: Validated interface pointer and cast it to implementations pointer.
+ **/
+static XASnapshotItfImpl* GetImpl(XASnapshotItf self)
+{
+    if( self )
+    {
+        XASnapshotItfImpl* impl = (XASnapshotItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XASnapshotItf implementation
+ */
+
+/*
+    This method prepares the device for snapshot to shorten the actual shooting
+    delay with TakeSnapshot() method. The various settings for snapshot are
+    set with this method: the specified number of snapshots, the output location
+    either to the XADataSink (if it is specified) or to memory (if no XADataSink
+    is specified) and then calls xaSnapshotInitiatedCallback() method.
+    Asynchronous.
+    Second call of this method before the call to TakeSnapshot() method will
+    reinitialize the shooting with the new parameter values.
+*/
+XAresult XASnapshotItfImpl_InitiateSnapshot(XASnapshotItf self,
+                                            XAuint32 numberOfPictures,
+                                            XAuint32 fps,
+                                            XAboolean freezeViewFinder,
+                                            XADataSink sink,
+                                            xaSnapshotInitiatedCallback initiatedCallback,
+                                            xaSnapshotTakenCallback takenCallback,
+                                            void * pContext)
+{
+    XASnapshotItfImpl *impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+    XAuint32 minF = 0, maxF = 0, maxP = 0;
+
+    DEBUG_API("->XASnapshotItfImpl_InitiateSnapshot");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+
+    if(!impl)
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASnapshotItfImpl_InitiateSnapshot");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    XASnapshotItfAdaptation_GetBurstFPSRange(impl->adapCtx,&minF,&maxF);
+    XASnapshotItfAdaptation_GetMaxPicsPerBurst(impl->adapCtx,&maxP);
+#endif
+    /*Check attributes and initialize local variables*/
+    /*NOTE: bug in spec? - should sink attribute be a pointer?*/
+    if( numberOfPictures > maxP ||
+        (numberOfPictures!=1 && !(sink.pLocator) ) )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        DEBUG_ERR("XASnapshotItfImpl_InitiateSnapshot -"
+                        "XA_RESULT_PARAMETER_INVALID (numberOfPictures)");
+        DEBUG_API("<-XASnapshotItfImpl_InitiateSnapshot");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    if( numberOfPictures!=1 && (fps<minF || fps>maxF) )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        DEBUG_ERR("XASnapshotItfImpl_InitiateSnapshot -"
+                        "XA_RESULT_PARAMETER_INVALID (fps)");
+        DEBUG_API("<-XASnapshotItfImpl_InitiateSnapshot");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->numberofpictures = numberOfPictures;
+    impl->usercontext = pContext;
+    impl->initcallback = initiatedCallback;
+    impl->takencallback = takenCallback;
+    impl->cbPtrToSelf = self;
+    impl->freezevf = freezeViewFinder;
+
+#ifdef _GSTREAMER_BACKEND_
+
+    if( impl->initongoing ||
+        impl->initialized ||
+        impl->snapshotongoing )
+    {
+        res = XASnapshotItfAdaptation_CancelSnapshot(impl->adapCtx);
+        impl->initongoing = XA_BOOLEAN_FALSE;
+        impl->snapshotongoing = XA_BOOLEAN_FALSE;
+    }
+
+    /* Initialize snapshot to adaptation */
+    if( impl->adapCtx )
+    {
+        impl->initongoing = XA_BOOLEAN_TRUE;
+        res = XASnapshotItfAdaptation_InitiateSnapshot(impl->adapCtx,
+                                                       numberOfPictures,
+                                                       fps,
+                                                       freezeViewFinder,
+                                                       &sink);
+    }
+    else
+    {
+        res = XA_RESULT_INTERNAL_ERROR;
+    }
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    DEBUG_API_A1("<-XASnapshotItfImpl_InitiateSnapshot (%d)", (int)res);
+    return res;
+}
+
+/*
+    This method takes the specified number of snapshots, stores them either to
+    the XADataSink (if it is specified by InitiateSnapshot()) or to memory (if
+    no XADataSink is specified) and then calls xaSnapshotTakenCallback()
+    method.
+ */
+XAresult XASnapshotItfImpl_TakeSnapshot(XASnapshotItf self)
+{
+    XASnapshotItfImpl *impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XASnapshotItfImpl_TakeSnapshot");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+    if(!impl)
+    {
+        DEBUG_ERR("XASnapshotItfImpl_TakeSnapshot -"
+                "XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( impl->initongoing ||
+        impl->snapshotongoing ||
+        !impl->initialized )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        DEBUG_ERR("XASnapshotItfImpl_TakeSnapshot -"
+                        "XA_RESULT_PRECONDITIONS_VIOLATED");
+        DEBUG_API("<-XASnapshotItfImpl_TakeSnapshot");
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+
+    if( impl->numberofpictures == 0 )
+    {
+        if( impl->takencallback )
+        {
+            impl->takencallback(impl->cbPtrToSelf, impl->usercontext,
+                                impl->numberofpictures, NULL);
+        }
+        res = XA_RESULT_SUCCESS;
+    }
+#ifdef _GSTREAMER_BACKEND_
+    /*Inform adaptation to take snapshot*/
+    else if( impl->adapCtx )
+    {
+        impl->snapshotongoing = XA_BOOLEAN_TRUE;
+        res = XASnapshotItfAdaptation_TakeSnapshot(impl->adapCtx);
+        if( res!=XA_RESULT_SUCCESS )
+        {
+            DEBUG_ERR_A1("Adaptation returns error %d taking snapshot!", (int)res);
+            impl->snapshotongoing = XA_BOOLEAN_FALSE;
+        }
+    }
+#endif    
+    else
+    {
+        res = XA_RESULT_INTERNAL_ERROR;
+        DEBUG_ERR("XASnapshotItfImpl_TakeSnapshot"
+                "-XA_RESULT_INTERNAL_ERROR ");
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    DEBUG_API("<-XASnapshotItfImpl_TakeSnapshot");
+    return res;
+}
+
+/*
+    This method cancels an ongoing shooting session. Snapshooting needs to be
+    initiated again after calling this method with InitiateSnapshot method.
+
+    Synchronous.
+*/
+XAresult XASnapshotItfImpl_CancelSnapshot(XASnapshotItf self)
+{
+    XASnapshotItfImpl *impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XASnapshotItfImpl_CancelSnapshot");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASnapshotItfImpl_CancelSnapshot");
+        /* invalid parameter */
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( impl->initongoing ||
+        impl->snapshotongoing ||
+        impl->initialized )
+    {
+#ifdef _GSTREAMER_BACKEND_
+        if( impl->adapCtx )
+        {
+            res = XASnapshotItfAdaptation_CancelSnapshot(impl->adapCtx);
+        }
+        else
+        {
+            DEBUG_ERR("No adaptation context!!");
+            res = XA_RESULT_INTERNAL_ERROR;
+        }
+#endif        
+        impl->initongoing = XA_BOOLEAN_FALSE;
+        impl->snapshotongoing = XA_BOOLEAN_FALSE;
+        impl->initialized = XA_BOOLEAN_FALSE;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    DEBUG_API_A1("<-XASnapshotItfImpl_CancelSnapshot (%d)", (int)res);
+    return res;
+}
+
+/*
+     This method releases the given buffer.
+ */
+XAresult XASnapshotItfImpl_ReleaseBuffers(XASnapshotItf self,
+                                          XADataSink *image)
+{
+    XASnapshotItfImpl *impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XASnapshotItfImpl_ReleaseBuffers");
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        res =  XA_RESULT_PARAMETER_INVALID;
+    }
+    if( image && (image->pLocator) &&
+        *((XAuint32*)(image->pLocator)) == XA_DATALOCATOR_ADDRESS )
+    {
+        if( ((XADataLocator_Address*)(image->pLocator))->pAddress )
+        {
+            free(((XADataLocator_Address*)(image->pLocator))->pAddress);
+        }
+        image->pLocator = NULL;
+        image->pFormat = NULL;
+        DEBUG_API("<-XASnapshotItfImpl_ReleaseBuffers- buffers released");
+        res = XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        DEBUG_ERR_A1("<-XASnapshotItfImpl_ReleaseBuffers- "
+                "INVALID XADataSink at 0x%x", (int)image);
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API("<-XASnapshotItfImpl_ReleaseBuffers");
+    return res;
+}
+
+/*
+    This method tells how many pictures it is possible to
+    be taken during single burst.
+*/
+XAresult XASnapshotItfImpl_GetMaxPicsPerBurst(XASnapshotItf self,
+                                              XAuint32 *maxNumberOfPictures)
+{
+    XASnapshotItfImpl *impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XASnapshotItfImpl_GetMaxPicsPerBurst");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+    if( !impl || !maxNumberOfPictures )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASnapshotItfImpl_GetMaxPicsPerBurst");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    if( impl->adapCtx )
+    {
+        res = XASnapshotItfAdaptation_GetMaxPicsPerBurst(impl->adapCtx, maxNumberOfPictures);
+    }
+    else
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        DEBUG_API("<-XASnapshotItfImpl_GetMaxPicsPerBurst");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    DEBUG_API("<-XASnapshotItfImpl_GetMaxPicsPerBurst");
+    return res;
+}
+
+/*
+    This method tells the range of shooting rates possible in burst shooting
+    mode. Please note that these rates might be different depending on which
+    encoder and which resolution has been chosen; not all the rates can
+    necessarily be reached with every resolution or encoder.
+*/
+XAresult XASnapshotItfImpl_GetBurstFPSRange(XASnapshotItf self,
+                                            XAuint32 *minFPS,
+                                            XAuint32 *maxFPS)
+{
+    XASnapshotItfImpl *impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XASnapshotItfImpl_GetBurstFPSRange");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+    if( !impl || !minFPS || !maxFPS )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASnapshotItfImpl_GetBurstFPSRange");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    if( impl->adapCtx )
+    {
+        res = XASnapshotItfAdaptation_GetBurstFPSRange(impl->adapCtx,minFPS,maxFPS);
+    }
+    else
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        DEBUG_API("<-XASnapshotItfImpl_GetBurstFPSRange");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    DEBUG_API("<-XASnapshotItfImpl_GetBurstFPSRange");
+    return res;
+}
+
+/*
+    Toggles the shutter feedback (such as shutter sound or some visual
+    feedback while taking a snapshot).
+*/
+XAresult XASnapshotItfImpl_SetShutterFeedback(XASnapshotItf self,
+                                              XAboolean enabled)
+{
+    XASnapshotItfImpl *impl = GetImpl(self);
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XASnapshotItfImpl_SetShutterFeedback");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    impl->shutterfeedback = enabled;
+    
+#ifdef _GSTREAMER_BACKEND_
+    if( impl->adapCtx )
+    {
+        /*Inform adaptation about shutter feedback */
+        res = XASnapshotItfAdaptation_SetShutterFeedback(impl->adapCtx, enabled);
+    }
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+    DEBUG_API("<-XASnapshotItfImpl_SetShutterFeedback");
+    return res;
+}
+
+/*
+    This method tells if the shutter feedback (such as shutter sound or some
+    visual feedback while taking a snapshot) is enabled.
+ */
+XAresult XASnapshotItfImpl_GetShutterFeedback(XASnapshotItf self,
+                                              XAboolean *enabled)
+{
+    XASnapshotItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XASnapshotItfImpl_GetShutterFeedback");
+    if( !impl || !enabled )
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XASnapshotItfImpl_GetShutterFeedback");
+        return  XA_RESULT_PARAMETER_INVALID;
+    }
+    enabled = (XAboolean*)impl->shutterfeedback;
+
+    DEBUG_API("<-XASnapshotItfImpl_GetShutterFeedback");
+    return XA_RESULT_SUCCESS;
+}
+
+/**
+ * XASnapshotItfImpl -specific methods
+ **/
+
+
+/**
+ * XASnapshotItfImpl* XASnapshotItfImpl_Create()
+ * Description: Allocate and initialize SnapshotItfImpl
+ **/
+XASnapshotItfImpl* XASnapshotItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adaptCtx
+#endif
+        )
+{
+    XASnapshotItfImpl* self = (XASnapshotItfImpl*)
+        calloc(1,sizeof(XASnapshotItfImpl));
+    DEBUG_API("->XASnapshotItfImpl_Create");
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.CancelSnapshot = XASnapshotItfImpl_CancelSnapshot;
+        self->itf.GetBurstFPSRange = XASnapshotItfImpl_GetBurstFPSRange;
+        self->itf.GetMaxPicsPerBurst = XASnapshotItfImpl_GetMaxPicsPerBurst;
+        self->itf.GetShutterFeedback = XASnapshotItfImpl_GetShutterFeedback;
+        self->itf.InitiateSnapshot = XASnapshotItfImpl_InitiateSnapshot;
+        self->itf.ReleaseBuffers = XASnapshotItfImpl_ReleaseBuffers;
+        self->itf.SetShutterFeedback = XASnapshotItfImpl_SetShutterFeedback;
+        self->itf.TakeSnapshot = XASnapshotItfImpl_TakeSnapshot;
+
+        /* init variables */
+#ifdef _GSTREAMER_BACKEND_
+        self->adapCtx = adapCtx;
+#endif
+        self->self = self;
+        self->cbPtrToSelf = NULL;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    /* Add call back function to eventhandler. */
+    XAAdaptationBase_AddEventHandler( adapCtx, &XASnapshotItfImpl_AdaptCb, XA_SNAPSHOTITFEVENTS, self );
+#endif
+    DEBUG_API("<-XASnapshotItfImpl_Create");
+    return self;
+}
+
+/**
+ * void XASnapshotItfImpl_Free(XASnapshotItfImpl* self)
+ * Description: Free all resources reserved at XASnapshotItfImpl_Create()
+ **/
+void XASnapshotItfImpl_Free(XASnapshotItfImpl* self)
+{
+    DEBUG_API("->XASnapshotItfImpl_Free");
+    assert( self==self->self );
+    /*
+     * Free all resources reserved at XASnapshotItfImpl_Create
+     */
+#ifdef _GSTREAMER_BACKEND_
+    if( self->adapCtx )
+    {
+        XASnapshotItfAdaptation_CancelSnapshot(self->adapCtx);
+    }
+    XAAdaptationBase_RemoveEventHandler( self->adapCtx, &XASnapshotItfImpl_AdaptCb );
+#endif    
+    free( self );
+    DEBUG_API("<-XASnapshotItfImpl_Free");
+}
+#ifdef _GSTREAMER_BACKEND_
+/* void XASnapshotItfImpl_AdaptCb
+ * Description:
+ * Listen adaptation callBacks from camera adaptation
+ */
+void XASnapshotItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+{
+    XASnapshotItfImpl* impl = (XASnapshotItfImpl*)pHandlerCtx;
+    DEBUG_API("->XASnapshotItfImpl_AdaptCb");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XASnapshotItfImpl_AdaptCb, invalid context pointer!");
+        return;
+    }
+    assert(event);
+
+    if( event->eventid == XA_ADAPT_SNAPSHOT_TAKEN )
+    {
+        DEBUG_INFO("**Snapshot taken**");
+        impl->snapshotongoing = XA_BOOLEAN_FALSE;
+        if( impl->takencallback )
+        {
+        	if ( vfHandle && impl->freezevf )
+        	{
+        		XAresult ret = XA_RESULT_SUCCESS;
+        		XAPlayItfImpl* vf = (XAPlayItfImpl*)vfHandle;
+        		DEBUG_INFO_A1("Using global view finder handle from %x to freeze view finder", vf);
+        		ret = XAPlayItfImpl_SetPlayState( (XAPlayItf)&vf, XA_PLAYSTATE_PAUSED);
+        		if ( ret != XA_RESULT_SUCCESS )
+        		{
+        			DEBUG_ERR("Could not change view finder to pause");
+        		}
+        	}
+            /* datasize used for "number taken", the pointer to
+             * data sink structure itself contains the data size */
+            impl->takencallback(impl->cbPtrToSelf, impl->usercontext,
+                                event->datasize, (XADataSink*)event->data);
+        }
+    }
+    else if( event->eventid == XA_ADAPT_SNAPSHOT_INITIATED )
+    {
+        DEBUG_INFO("**Snapshot initiated**");
+        impl->initongoing = XA_BOOLEAN_FALSE;
+        impl->initialized = XA_BOOLEAN_TRUE;
+        if( impl->initcallback )
+        {
+            impl->initcallback(impl->cbPtrToSelf, impl->usercontext);
+        }
+    }
+    DEBUG_API("<-XASnapshotItfImpl_AdaptCb");
+}
+#endif
+/*End of file*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xasnapshotitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,110 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XASNAPSHOTITF_H
+#define XASNAPSHOTITF_H
+
+#include <semaphore.h>
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+
+/** TYPES **/
+
+/*Callbacks*/
+
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+
+
+/* Definition of XASnapshotItf implementation */
+typedef struct XASnapshotItfImpl_
+{
+    /* parent interface */
+    struct XASnapshotItf_ itf;
+    /* pointer to self */
+    struct XASnapshotItfImpl_* self;
+
+    /* variables */
+    XAuint32 numberofpictures;
+    XAboolean shutterfeedback;
+    xaSnapshotInitiatedCallback initcallback;
+    xaSnapshotTakenCallback takencallback;
+    void* usercontext;
+    XASnapshotItf cbPtrToSelf;
+
+#ifdef _GSTREAMER_BACKEND_
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+    XAboolean           snapshotongoing;
+    XAboolean           initongoing;
+    XAboolean           initialized;
+    XAboolean			freezevf;
+
+} XASnapshotItfImpl;
+
+/** METHODS **/
+
+/* Base interface XASnapshotItf implementation */
+XAresult XASnapshotItfImpl_InitiateSnapshot(XASnapshotItf self,
+                                            XAuint32 numberOfPictures,
+                                            XAuint32 fps,
+                                            XAboolean freezeViewFinder,
+                                            XADataSink sink,
+                                            xaSnapshotInitiatedCallback initiatedCallback,
+                                            xaSnapshotTakenCallback takenCallback,
+                                            void * pContext);
+
+XAresult XASnapshotItfImpl_TakeSnapshot(XASnapshotItf self);
+
+XAresult XASnapshotItfImpl_CancelSnapshot(XASnapshotItf self);
+
+XAresult XASnapshotItfImpl_ReleaseBuffers(XASnapshotItf self,
+                                          XADataSink *image);
+
+XAresult XASnapshotItfImpl_GetMaxPicsPerBurst(XASnapshotItf self,
+                                              XAuint32 *maxNumberOfPictures);
+
+XAresult XASnapshotItfImpl_GetBurstFPSRange(XASnapshotItf self,
+                                            XAuint32 *minFPS,
+                                            XAuint32 *maxFPS);
+
+XAresult XASnapshotItfImpl_SetShutterFeedback(XASnapshotItf self,
+                                              XAboolean enabled);
+
+XAresult XASnapshotItfImpl_GetShutterFeedback(XASnapshotItf self,
+                                              XAboolean *enabled);
+
+/* XASnapshotItfImpl -specific methods */
+XASnapshotItfImpl* XASnapshotItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adaptCtx,
+#else
+        void
+#endif
+        );
+#ifdef _GSTREAMER_BACKEND_
+void XASnapshotItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
+#endif
+void XASnapshotItfImpl_Free(XASnapshotItfImpl* self);
+
+#endif /* XASNAPSHOTITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xavideoencoderitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,172 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include "xavideoencoderitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAVideoEncoderItfAdaptation.h"
+#include "XAStaticCapsAdaptation.h"
+#include "XARecordItfAdaptation.h"
+#endif
+#include "xathreadsafety.h"
+
+
+/* static XAVideoEncoderItfImpl* GetImpl(XAVideoEncoderItf self)
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XAVideoEncoderItfImpl* GetImpl(XAVideoEncoderItf self)
+{
+    if( self )
+    {
+        XAVideoEncoderItfImpl* impl = (XAVideoEncoderItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/*****************************************************************************
+ * Base interface XAVideoEncoderItf implementation
+ *****************************************************************************/
+
+/* XAresult XAVideoEncoderItfImpl_SetVideoSettings
+ * Description: Set video encoder settings.
+ */
+XAresult XAVideoEncoderItfImpl_SetVideoSettings(XAVideoEncoderItf self,
+                                                XAVideoSettings *pSettings)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+#ifdef _GSTREAMER_BACKEND_
+    XAStaticCapsData temp;
+    XAuint32 recState = XA_RECORDSTATE_STOPPED;
+    XAVideoEncoderItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAVideoEncoderItfImpl_SetVideoSettings");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+
+    if( !impl || !pSettings )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoEncoderItfImpl_SetVideoSettings");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    res = XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_VIDEO, pSettings->encoderId, &temp);
+    if( res == XA_RESULT_SUCCESS )
+    {
+        res = XARecordItfAdapt_GetRecordState( impl->adaptCtx, &recState );
+        if( res == XA_RESULT_SUCCESS )
+        {
+            if( XA_RECORDSTATE_STOPPED == recState )
+            {
+                res = XAVideoEncoderItfAdapt_SetVideoSettings(impl->adaptCtx, pSettings);
+            }
+            else
+            {
+                DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+                DEBUG_API("<-XAVideoEncoderItfImpl_SetVideoSettings");
+                return XA_RESULT_PRECONDITIONS_VIOLATED;
+            }
+        }
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        DEBUG_API("<-XAVideoEncoderItfImpl_SetVideoSettings");
+        return XA_RESULT_FEATURE_UNSUPPORTED;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+#endif
+    DEBUG_API("<-XAVideoEncoderItfImpl_SetVideoSettings");
+    return res;
+}
+
+/* XAresult XAVideoEncoderItfImpl_GetVideoSettings
+ * Description: Get video encoder settings.
+ */
+XAresult XAVideoEncoderItfImpl_GetVideoSettings(XAVideoEncoderItf self,
+                                                XAVideoSettings *pSettings)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XAVideoEncoderItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XAVideoEncoderItfImpl_GetVideoSettings");
+    if( !impl || !pSettings )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoEncoderItfImpl_GetVideoSettings");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_
+    res = XAVideoEncoderItfAdapt_GetVideoSettings(impl->adaptCtx, pSettings);
+#endif
+    DEBUG_API("<-XAVideoEncoderItfImpl_GetVideoSettings");
+    return res;
+}
+
+/*****************************************************************************
+ * XAVideoEncoderItfImpl -specific methods
+ *****************************************************************************/
+
+
+/* XAVideoEncoderItfImpl* XAVideoEncoderItfImpl_Create()
+ * Description: Allocate and initialize VideoEncoderItfImpl
+ */
+XAVideoEncoderItfImpl* XAVideoEncoderItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adaptCtx
+#endif
+        )
+{
+    XAVideoEncoderItfImpl* self = (XAVideoEncoderItfImpl*)
+        calloc(1,sizeof(XAVideoEncoderItfImpl));
+    DEBUG_API("->XAVideoEncoderItfImpl_Create");
+
+    if( self )
+    {
+        /* init itf default implementation */
+        self->itf.GetVideoSettings = XAVideoEncoderItfImpl_GetVideoSettings;
+        self->itf.SetVideoSettings = XAVideoEncoderItfImpl_SetVideoSettings;
+
+#ifdef _GSTREAMER_BACKEND_
+        /* init variables */
+        self->adaptCtx = adaptCtx;
+#endif
+        self->self = self;
+    }
+    DEBUG_API("<-XAVideoEncoderItfImpl_Create");
+    return self;
+}
+
+/* void XAVideoEncoderItfImpl_Free(XAVideoEncoderItfImpl* self)
+ * Description: Free all resources reserved at XAVideoEncoderItfImpl_Create()
+ */
+void XAVideoEncoderItfImpl_Free(XAVideoEncoderItfImpl* self)
+{
+    DEBUG_API("->XAVideoEncoderItfImpl_Free");
+    assert( self==self->self );
+    free( self );
+    DEBUG_API("<-XAVideoEncoderItfImpl_Free");
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mediarecorder/xavideoencoderitf.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XAVIDEOENCODERITF_H
+#define XAVIDEOENCODERITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAVideoEncoderItf implementation */
+typedef struct XAVideoEncoderItfImpl_
+{
+    /* parent interface */
+    struct XAVideoEncoderItf_ itf;
+    /* pointer to self */
+    struct XAVideoEncoderItfImpl_* self;
+#ifdef _GSTREAMER_BACKEND_
+    /* variables */
+    XAAdaptationBaseCtx *adaptCtx;
+#endif
+} XAVideoEncoderItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAVideoEncoderItf implementation
+ * See API Specification for method documentation
+ */
+XAresult XAVideoEncoderItfImpl_SetVideoSettings(XAVideoEncoderItf self,
+                                                XAVideoSettings *pSettings);
+
+XAresult XAVideoEncoderItfImpl_GetVideoSettings(XAVideoEncoderItf self,
+                                                XAVideoSettings *pSettings);
+
+
+/* XAVideoEncoderItfImpl -specific methods */
+XAVideoEncoderItfImpl* XAVideoEncoderItfImpl_Create(
+#ifdef _GSTREAMER_BACKEND_
+        XAAdaptationBaseCtx *adaptCtx,
+#else
+        void
+#endif
+        );
+
+void XAVideoEncoderItfImpl_Free(XAVideoEncoderItfImpl* self);
+
+#endif /* XAVIDEOENCODERITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/metadataextractor/xametadataextractor.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,463 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xametadataextractor.h"
+#include "xadynamicsourceitf.h"
+#include "xadynintmgmtitf.h"
+#include "xametadataextractionitf.h"
+#include "xametadatatraversalitf.h"
+#include "xaconfigextensionsitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAMetadataAdaptCtx.h"
+#endif
+#include "xathreadsafety.h"
+
+/* Static mapping of enumeration XAMetadataInterfaces to interface iids */
+static const XAInterfaceID* xaMetadataExtractorItfIIDs[MDE_ITFCOUNT]=
+{
+    &XA_IID_OBJECT,
+    &XA_IID_DYNAMICINTERFACEMANAGEMENT,
+    &XA_IID_METADATAEXTRACTION,
+    &XA_IID_METADATATRAVERSAL,
+    &XA_IID_CONFIGEXTENSION,
+    &XA_IID_DYNAMICSOURCE
+};
+
+
+/*****************************************************************************
+ * Global methods
+ *****************************************************************************/
+
+/* XAResult XAMetadataExtractorImpl_Create
+ * Description: Create object
+ * Add this method to XAGlobals.h
+ */
+XAresult XAMetadataExtractorImpl_Create(XAObjectItf *pMetadataExtractor,
+                                        XADataSource *pDataSource,
+                                        XAuint32 numInterfaces,
+                                        const XAInterfaceID * pInterfaceIds,
+                                        const XAboolean * pInterfaceRequired)
+{
+    XAMetadataExtractorImpl* pImpl = NULL;
+    XAObjectItfImpl* pBaseObj = NULL;
+    XAuint8 itfIndex = 0;
+    XAresult res = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataExtractorImpl_Create");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaPlayer);
+
+    if( !pMetadataExtractor )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAMetadataExtractorImpl_Create");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    res = XACommon_CheckDataSource(pDataSource,NULL);
+    if(res!=XA_RESULT_SUCCESS)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+        DEBUG_API("<-XAMetadataExtractorImpl_Create");
+        return res;
+    }
+
+    /* instantiate object implementation */
+    pImpl = (XAMetadataExtractorImpl*)calloc(1,sizeof(XAMetadataExtractorImpl));
+    if(!pImpl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+        DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+        /* memory allocation failed */
+        DEBUG_API("<-XAMetadataExtractorImpl_Create");
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+    pBaseObj = &pImpl->baseObj;
+
+    /* Initialize base object default implementation */
+    XAObjectItfImpl_Init(pBaseObj,
+                         MDE_ITFCOUNT,
+                         xaMetadataExtractorItfIIDs,
+                         XAMetadataExtractorImpl_DoRealize,
+                         XAMetadataExtractorImpl_DoResume,
+                         XAMetadataExtractorImpl_FreeResources);
+
+    /* Mark interfaces that need to be exposed */
+    /* Implicit and mandated interfaces */
+    pBaseObj->interfaceMap[MDE_METADATAEXTRACTIONITF].required = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[MDE_METADATATRAVERSALITF].required = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[MDE_DYNAMICSOURCEITF].required = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[MDE_DIMITF].required = XA_BOOLEAN_TRUE;
+
+    /* Explicit interfaces */
+    if ((numInterfaces != 0) && pInterfaceIds && pInterfaceRequired )
+    {
+        /* Check required interfaces */
+        for(itfIndex = 0; itfIndex < numInterfaces; itfIndex++)
+        {
+            /* If mapEntry is null then required interface is not supported.*/
+            XAObjItfMapEntry *entry =
+                XAObjectItfImpl_GetItfEntry((XAObjectItf)&(pBaseObj), pInterfaceIds[itfIndex]);
+            if( !entry  )
+            {
+                if( pInterfaceRequired[itfIndex] )
+                {
+                    /* required interface cannot be accommodated - fail creation */
+                    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+                    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+                    DEBUG_ERR("Required interface not found - abort creation!");
+                    DEBUG_API("<-XAMetadataExtractorImpl_Create");
+                    return XA_RESULT_FEATURE_UNSUPPORTED;
+                }
+                else
+                {
+                    DEBUG_INFO("Requested (not required) interface not found - continue creation");
+                }
+            }
+            else
+            {
+                entry->required = XA_BOOLEAN_TRUE;
+            }
+        }
+    }
+
+    /* Mark interfaces that can be handled dynamically */
+    pBaseObj->interfaceMap[MDE_CONFIGEXTENSIONITF].isDynamic = XA_BOOLEAN_TRUE;
+
+    /* Set ObjectItf to point to newly created object */
+    *pMetadataExtractor = (XAObjectItf)&(pBaseObj->self);
+
+#ifdef _GSTREAMER_BACKEND_
+    /* Create metadata adaptation context */
+    pImpl->adaptationCtx = XAMetadataAdaptCtx_Create(pDataSource);
+#endif
+    
+    /* This code is put here to return Feature Not Supported since adaptation is not present*/
+    /*************************************************/
+    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+    DEBUG_ERR("Required interface not found - abort creation!");
+    DEBUG_API("<-XAMetadataExtractorImpl_Create");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+    /*************************************************/    
+    
+/*    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+    DEBUG_API("<-XAMetadataExtractorImpl_Create");
+    return XA_RESULT_SUCCESS;*/
+}
+
+/* XAResult XAMetadataExtractorImpl_QueryNumSupportedInterfaces
+ * Description: Statically query number of supported interfaces
+ */
+XAresult XAMetadataExtractorImpl_QueryNumSupportedInterfaces(
+                                    XAuint32 *pNumSupportedInterfaces)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAMetadataExtractorImpl_QueryNumSupportedInterfaces");
+    if(pNumSupportedInterfaces)
+    {
+        *pNumSupportedInterfaces = MDE_ITFCOUNT;
+        res = XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API_A1("<-XAMetadataExtractorImpl_QueryNumSupportedInterfaces (%d)", (int)res);
+    return res;
+}
+/* XAResult XAMetadataExtractorImpl_QuerySupportedInterfaces
+ * Description: Statically query supported interfaces
+ */
+XAresult XAMetadataExtractorImpl_QuerySupportedInterfaces(
+                                    XAuint32 index,
+                                    XAInterfaceID * pInterfaceId)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAMetadataExtractorImpl_QuerySupportedInterfaces");
+
+    if (index >= MDE_ITFCOUNT || !pInterfaceId )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        res = XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        *pInterfaceId = *(xaMetadataExtractorItfIIDs[index]);
+        res = XA_RESULT_SUCCESS;
+    }
+    DEBUG_API_A1("<-XAMetadataExtractorImpl_QuerySupportedInterfaces (%d)", (int)res);
+    return res;
+}
+
+
+/*****************************************************************************
+ * base object XAObjectItfImpl methods
+ *****************************************************************************/
+
+/* XAresult XAMetadataExtractorImpl_DoRealize( XAObjectItf self )
+ * Description: Realize all implicit and explicitly wanted interfaces.
+ * Create and initialize implementation-specific variables.
+ * Called from base object XAObjectItfImpl
+ */
+XAresult XAMetadataExtractorImpl_DoRealize( XAObjectItf self )
+{
+    XAuint8 itfIdx = 0;
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAMetadataExtractorImpl* pObjImpl = (XAMetadataExtractorImpl*)(pObj);
+    void *pItf = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataExtractorImpl_DoRealize");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaPlayer);
+
+    /* check casting from correct pointer type */
+    if( !pObjImpl || pObj != pObjImpl->baseObj.self )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XAMetadataExtractorImpl_DoRealize");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* Realize all implicit and explicitly wanted interfaces */
+    for(itfIdx=0; itfIdx<MDE_ITFCOUNT; itfIdx++)
+    {
+        if(!(pObj->interfaceMap[itfIdx].pItf) &&
+            pObj->interfaceMap[itfIdx].required )
+        {
+            switch(itfIdx)
+            {
+                case MDE_DIMITF:
+                    pItf = XADIMItfImpl_Create();
+                    if(pItf)
+                    {
+                        XADIMItfImpl_Init(pItf, self,
+                                      XAMetadataExtractorImpl_DoAddItf,
+                                      XAMetadataExtractorImpl_DoResumeItf,
+                                      XAMetadataExtractorImpl_DoRemoveItf);
+                    }
+                    break;
+#ifdef _GSTREAMER_BACKEND_
+                case MDE_METADATAEXTRACTIONITF:
+                    pItf = XAMetadataExtractionItfImpl_Create( pObjImpl->adaptationCtx );
+                    break;
+                case MDE_METADATATRAVERSALITF:
+                    pItf = XAMetadataTraversalItfImpl_Create( pObjImpl->adaptationCtx );
+                    break;
+                case MDE_CONFIGEXTENSIONITF:
+                    pItf = XAConfigExtensionsItfImpl_Create();
+                    XAConfigExtensionsItfImpl_SetContext( pItf, pObjImpl->adaptationCtx );
+                    break;
+                case MDE_DYNAMICSOURCEITF:
+                    pItf = XADynamicSourceItfImpl_Create( pObjImpl->adaptationCtx );
+                    break;
+#endif
+                default:
+                    break;
+            }
+            if(!pItf)
+            {
+                XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+                DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+                /* memory allocation failed */
+                DEBUG_API("<-XAMetadataExtractorImpl_DoRealize");
+                return XA_RESULT_MEMORY_FAILURE;
+            }
+            else
+            {
+                pObj->interfaceMap[itfIdx].pItf = pItf;
+            }
+        }
+    }
+    /*Initialize adaptation context*/
+    /* init adaptation */
+#ifdef _GSTREAMER_BACKEND_
+    ret = XAMetadataAdaptCtx_PostInit( pObjImpl->adaptationCtx );
+#endif
+    if ( ret != XA_RESULT_SUCCESS )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+        DEBUG_ERR("Adaptation init failed!");
+        DEBUG_API("<-XAMetadataExtractorImpl_DoRealize");
+        return ret;
+    }
+    pObj->state = XA_OBJECT_STATE_REALIZED;
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+    DEBUG_API("<-XAMetadataExtractorImpl_DoRealize");
+    return XA_RESULT_SUCCESS;
+}
+
+/* XAresult XAMetadataExtractorImpl_DoResume
+ * Description: Resume object from suspended state
+ */
+XAresult XAMetadataExtractorImpl_DoResume(XAObjectItf self)
+{
+    DEBUG_API("->XAMetadataExtractorImpl_DoResume");
+    DEBUG_API("<-XAMetadataExtractorImpl_DoResume");
+    /* "suspended" state not supported by this implementation */
+    return XA_RESULT_PRECONDITIONS_VIOLATED;
+}
+
+/* void XAMetadataExtractorImpl_FreeResources
+ * Description: Free all resources reserved at XAMetadataExtractorImpl_DoRealize()
+ */
+void XAMetadataExtractorImpl_FreeResources(XAObjectItf self)
+{
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    
+    XAuint8 itfIdx = 0;
+    void *pItf = NULL;
+    DEBUG_API("->XAMetadataExtractorImpl_FreeResources");
+    XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS(XATSMediaPlayer);
+#ifdef _GSTREAMER_BACKEND_
+    XAMetadataExtractorImpl* pImpl = (XAMetadataExtractorImpl*)(*self);
+    assert( pObj && pImpl && pObj == pObj->self );
+#endif
+    for(itfIdx = 0; itfIdx < MDE_ITFCOUNT; itfIdx++)
+    {
+        pItf = pObj->interfaceMap[itfIdx].pItf;
+        if(pItf)
+        {
+            switch(itfIdx)
+            {
+                case MDE_METADATAEXTRACTIONITF:
+                    XAMetadataExtractionItfImpl_Free(pItf);
+                    break;
+                case MDE_METADATATRAVERSALITF:
+                    XAMetadataTraversalItfImpl_Free(pItf);
+                    break;
+                case MDE_DYNAMICSOURCEITF:
+                    XADynamicSourceItfImpl_Free(pItf);
+                    break;
+                case MDE_DIMITF:
+                    XADIMItfImpl_Free(pItf);
+                    break;
+                case MDE_CONFIGEXTENSIONITF:
+                    XAConfigExtensionsItfImpl_Free(pItf);
+                    break;
+            }
+            pObj->interfaceMap[itfIdx].pItf = NULL;
+        }
+    }
+#ifdef _GSTREAMER_BACKEND_
+    if ( pImpl->adaptationCtx != NULL )
+    {
+        XAMetadataAdaptCtx_Destroy( pImpl->adaptationCtx );
+        pImpl->adaptationCtx = NULL;
+    }
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS(XATSMediaPlayer);
+    DEBUG_API("<-XAMetadataExtractorImpl_FreeResources");
+    return;
+}
+
+/*****************************************************************************
+ * MetadataExtractorImpl -specific methods
+ *****************************************************************************/
+
+/* XAMetadataExtractorImpl_DoAddItf
+ * Dynamically add an interface, object specific parts
+ */
+XAresult XAMetadataExtractorImpl_DoAddItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  )
+{
+#ifdef _GSTREAMER_BACKEND_
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAMetadataExtractorImpl* pImpl = (XAMetadataExtractorImpl*)(pObj);
+#endif
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAMetadataExtractorImpl_DoAddItf");
+
+    if(mapEntry)
+    {
+        switch( mapEntry->mapIdx )
+        {
+            case MDE_CONFIGEXTENSIONITF:
+                mapEntry->pItf = XAConfigExtensionsItfImpl_Create();
+#ifdef _GSTREAMER_BACKEND_
+                XAConfigExtensionsItfImpl_SetContext( mapEntry->pItf, pImpl->adaptationCtx);
+#endif
+                break;
+            default:
+                DEBUG_ERR("XAMetadataExtractorImpl_DoAddItf unknown id");
+                ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                break;
+        }
+        if( !mapEntry->pItf && ret == XA_RESULT_SUCCESS)
+        {
+            DEBUG_ERR("XAMetadataExtractorImpl_DoAddItf itf creation failed");
+            ret = XA_RESULT_MEMORY_FAILURE;
+        }
+    }
+    else
+    {
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_API("<-XAMetadataExtractorImpl_DoAddItf");
+    return ret;
+}
+
+/* XAMetadataExtractorImpl_DoResumeItf
+ * Try to resume lost interface, object specific parts
+ */
+XAresult XAMetadataExtractorImpl_DoResumeItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAMetadataExtractorImpl_DoResumeItf");
+    /* For now, no difference between suspended and unrealised itfs */
+    ret = XAMetadataExtractorImpl_DoAddItf(self,mapEntry);
+    DEBUG_API("<-XAMetadataExtractorImpl_DoResumeItf");
+    return ret;
+}
+
+/* XAMetadataExtractorImpl_DoRemoveItf
+ * Dynamically remove an interface, object specific parts
+ */
+XAresult XAMetadataExtractorImpl_DoRemoveItf(XAObjectItf self, XAObjItfMapEntry *mapEntry )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAMetadataExtractorImpl_DoRemoveItf");
+    ret = XA_RESULT_SUCCESS;
+    if(mapEntry)
+    {
+        switch( mapEntry->mapIdx )
+        {
+            case MDE_CONFIGEXTENSIONITF:
+                XAConfigExtensionsItfImpl_Free(mapEntry->pItf);
+                break;
+            default:
+                DEBUG_ERR("XAMetadataExtractorImpl_DoRemoveItf unknown id");
+                ret = XA_RESULT_FEATURE_UNSUPPORTED;
+                break;
+        }
+        mapEntry->pItf = NULL;
+    }
+    else
+    {
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    DEBUG_API("<-XAMetadataExtractorImpl_DoRemoveItf");
+    return ret;
+}
+/* END OF FILE */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/metadataextractor/xametadataextractor.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAMETADATAEXTRACTOR_H
+#define XAMETADATAEXTRACTOR_H
+
+#include "openmaxalwrapper.h"
+#include "xaobjectitf.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAMetadataAdaptCtx.h"
+#endif
+
+/** MACROS **/
+
+
+/** TYPES **/
+
+
+/** ENUMERATIONS **/
+/* Enumeration for interfaces that MetadataExtractor supports.  */
+typedef enum
+{
+    MDE_OBJECTITF, /* <-keep this first */
+    MDE_DIMITF,
+    MDE_METADATAEXTRACTIONITF,
+    MDE_METADATATRAVERSALITF,
+    MDE_CONFIGEXTENSIONITF,
+    MDE_DYNAMICSOURCEITF,
+    MDE_ITFCOUNT
+} XAMetadataExtractorInterfaces;
+
+/** STRUCTURES **/
+/* Specification for XAMetadataExtractorImpl
+ */
+typedef struct XAMetadataExtractorImpl_
+{
+    /* Parent for XAMetadataExtractorImpl */
+    XAObjectItfImpl baseObj; /* <-keep this first */
+
+#ifdef _GSTREAMER_BACKEND_
+    /* variables */
+    XAAdaptationBaseCtx* adaptationCtx;
+#endif
+} XAMetadataExtractorImpl;
+
+
+/** METHODS **/
+
+/* base object XAObjectItfImpl methods */
+XAresult    XAMetadataExtractorImpl_DoRealize(XAObjectItf self);
+XAresult    XAMetadataExtractorImpl_DoResume(XAObjectItf self);
+void        XAMetadataExtractorImpl_FreeResources(XAObjectItf self);
+
+/* MetadataExtractorImpl -specific methods */
+XAresult XAMetadataExtractorImpl_DoAddItf(XAObjectItf self, XAObjItfMapEntry *mapEntry );
+XAresult XAMetadataExtractorImpl_DoResumeItf(XAObjectItf self, XAObjItfMapEntry *mapEntry );
+XAresult XAMetadataExtractorImpl_DoRemoveItf(XAObjectItf self, XAObjItfMapEntry *mapEntry );
+
+
+#endif /* XAMETADATAEXTRACTOR_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/cmmfbackendengine.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,839 @@
+/*
+* 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: 
+*
+*/
+/*
+Media Helper Class for handling surface events
+
+Shy Ward
+*/
+
+#include "cmmfbackendengine.h"
+#include <string.h>
+#include <ctype.h>
+#include <uri8.h>
+
+extern "C" {
+#include "xaadaptationmmf.h"
+}
+
+
+#define ENABLE_GRAPHICS_SURFACE_INTEGRATION_NOT_NOW
+
+CMMFBackendEngine* CMMFBackendEngine::NewL()
+    {
+    CMMFBackendEngine* self = new (ELeave) CMMFBackendEngine();
+    self->ConstructL();
+    return self;
+    }
+
+CMMFBackendEngine::~CMMFBackendEngine()
+    {
+    CloseAndDestroy();
+    }
+    
+CMMFBackendEngine::CMMFBackendEngine()                  
+    {
+    iVideoPlayer = NULL;
+    m_bWindowReferencePassed = FALSE;
+    iRecordState = ERecorderNotReady;
+    iPositionUpdateTimer = NULL;
+    }
+
+
+void CMMFBackendEngine::InitVideoPlayerUtilityL()
+    {
+	iBaseVideoPlayer = CVideoPlayerUtility2::NewL(*this,EMdaPriorityNormal,EMdaPriorityPreferenceTimeAndQuality);
+	iVideoPlayer = (CVideoPlayerUtility2*)iBaseVideoPlayer;
+	iVideoPlayer->RegisterForVideoLoadingNotification(*this);   
+    }
+
+void CMMFBackendEngine::CreateAndConfigureWindowL()
+    {
+#ifdef ENABLE_GRAPHICS_SURFACE_INTEGRATION_NOT_NOW
+    // create window for attaching the surface as its background
+    //RWsSession ws;
+    //TInt err2(KErrNone);
+    TInt err2 = m_ws.Connect();
+    m_pScr = new(ELeave) CWsScreenDevice(m_ws);
+    err2 = m_pScr->Construct();
+    CWindowGc* gc = NULL;
+    err2 = m_pScr->CreateContext(gc);
+    RWindowGroup grp(m_ws);
+    err2 = grp.Construct(0xf00f00);
+    const TSize KWinSize(320, 240);
+    m_pWindow = new (ELeave) RWindow(m_ws);
+    err2 = m_pWindow->Construct(grp, 0xfeefee);
+    m_pWindow->SetExtent(TPoint(), KWinSize);
+    m_pWindow->SetBackgroundColor(TRgb(255,0,0,128));
+    //win.SetBackgroundColor(TRgb(0,0,0,0));
+    m_pWindow->Activate();
+    m_pWindow->Invalidate();
+    m_pWindow->BeginRedraw();
+    gc->Activate(*m_pWindow);
+    m_pWindow->EndRedraw();
+    m_ws.Flush();
+
+    //Create MediaClientUitlity for NGA Surfaces
+    TInt displayId = m_pScr->GetScreenNumber();
+
+    // Add the display window
+    m_cropRegion = TRect(m_pWindow->Size());
+    m_clipRect = TRect(m_pWindow->Size());
+    m_videoExtent = TRect(m_pWindow->Size());
+    m_rotation = EVideoRotationNone;
+            
+#endif // ENABLE_GRAPHICS_SURFACE_INTEGRATION_NOT_NOW     
+    
+    }
+
+void CMMFBackendEngine::ConstructL()
+    {
+	//iBaseAudioPlayer = CMdaAudioPlayerUtility::NewL(*this);
+	//iAudioPlayer = (CMdaAudioPlayerUtility*)iBaseAudioPlayer;
+	iAPIBeingUsed = EAudioPlayerUtility;	
+	//InitVideoPlayerUtilityL();
+	iPlayerState = EPlayerClosed;
+	iBaseAudioRecorder = CMdaAudioRecorderUtility::NewL(*this);
+	iAudioRecorder = (CMdaAudioRecorderUtility*)iBaseAudioRecorder;
+	iActiveSchedulerWait = new (ELeave) CActiveSchedulerWait;
+    } 
+
+TInt CMMFBackendEngine::SetFileName(char* uri, XAuint32 format, TFuncInUse func)
+    {
+    TInt err(KErrNone);
+    _LIT8(KFileSlash,"file:///");
+    TInt fileslashlen = KFileSlash().Length();
+    if(func == ERecord)
+        {
+        if(iRecordState == ERecorderNotReady)
+            {
+            iFileFormat = format;
+            iAPIBeingUsed = DetermineAPIToUse(uri, ERecord);
+            TPtr8 fileuri(((TUint8*)uri), strlen(uri) ,strlen(uri));
+            TPtr8 filepath = fileuri.RightTPtr(strlen(uri)-fileslashlen);
+            if(iAPIBeingUsed == EAudioPlayerUtility)
+                {
+                TInt pos = filepath.LocateReverse(':');
+                if(pos != KErrNotFound)
+                    {
+                    fileuri.Delete(fileslashlen+pos,1);
+                    }
+                
+                TUriParser8 localfileUri;
+                TInt ret = localfileUri.Parse(fileuri);
+                HBufC* file = NULL;
+                TRAP(err,file = localfileUri.GetFileNameL());  
+                TPtr des = file->Des();
+                iFileName = des;
+                delete file;
+                file = NULL;
+                TRAP(err, iAudioRecorder->OpenFileL(iFileName));
+                if(!iActiveSchedulerWait->IsStarted())
+                    {
+                    iActiveSchedulerWait->Start();
+                    }
+                }
+           }
+        }
+    else
+        {
+        if(iPlayerState == EPlayerClosed)
+            {
+            iFileFormat = format;
+            iAPIBeingUsed = DetermineAPIToUse(uri,EPlay);
+            TPtr8 fileuri((TUint8*)uri, strlen(uri),strlen(uri));
+            
+            if(iAPIBeingUsed == EAudioPlayerUtility)
+                {
+                TInt pos = fileuri.LocateReverse(':');
+                fileuri.Delete(pos,1);
+                
+                TUriParser8 localfileUri;
+                TInt ret = localfileUri.Parse(fileuri);
+                HBufC* file = NULL;
+                TRAP(err,file = localfileUri.GetFileNameL());  
+                TPtr des = file->Des();
+                iFileName = des;
+                delete file;
+                file = NULL;
+                }
+            else
+                {
+                HBufC* f(NULL);
+                TRAP(err, f = HBufC::NewL(strlen(uri)));
+                TPtr des = f->Des();
+                des.Copy(fileuri);
+                iFileName = des;
+                delete f;
+                f = NULL;
+                }
+           }
+        }
+    return err;
+    }
+
+TInt CMMFBackendEngine::DetermineAPIToUse(char* uri, TFuncInUse aFunc)
+    {
+    char* tempExtensionPtr = NULL;
+    char extension[MAX_EXTENSION_SIZE] = { 0 };
+    
+    tempExtensionPtr = strchr(uri, (int)'.');
+    strcpy(extension, tempExtensionPtr);
+        
+    for(unsigned int i=0;i<sizeof(extension);i++)
+        {
+        extension[i] = tolower(extension[i]);
+        }
+    
+    if(aFunc == ERecord)
+        {
+        return EAudioPlayerUtility; 
+        }
+    else
+        {
+        if(!strcmp(extension, ".mp3") || (!strcmp(extension, ".amr")) || (!strcmp(extension, ".aac")) || (!strcmp(extension, ".mid")) ||
+                  (!strcmp(extension, ".awb")))
+            {
+            return EAudioPlayerUtility; 
+            }
+          else 
+            {
+            return EVideoPlayerUtility;
+            }
+        }
+    }
+
+void CMMFBackendEngine::SetWindowHandle(void* display_info)
+    {
+    XADataLocator_NativeDisplay* nativeDisplay;
+    XADataSink* videoSink = (XADataSink*)display_info;
+    
+    nativeDisplay = (XADataLocator_NativeDisplay*) (videoSink->pLocator);
+    
+    m_pWindow = ((RWindow*)(nativeDisplay->hWindow));
+    m_pWs =     ((RWsSession*)(nativeDisplay->hDisplay));
+    
+    m_bWindowReferencePassed = TRUE;
+    
+    }
+
+//From MVidePlayerUtilityObserver
+void CMMFBackendEngine::MvpuoOpenComplete(TInt aError)
+    {
+    if(aError == KErrNone)
+        {
+        //Issue the command to Play the file
+        TRAPD (error, iVideoPlayer->Prepare());
+        if (error == KErrNone)
+            {
+                //prepare success
+            }
+        else
+            {
+                //prepare failed
+            }
+        }
+    else
+        {
+        //could not open file
+        }
+    }
+
+
+
+void CMMFBackendEngine::MvpuoFrameReady(CFbsBitmap& /*aFrame*/,TInt /*aError*/)
+    {
+    
+    }
+
+
+
+void CMMFBackendEngine::MvpuoPlayComplete(TInt aError)
+    {
+    
+        
+    if(aError == KErrNone)
+        {
+            //playback complete
+        }
+    else
+        {
+            //playback complete with error
+        }
+    }
+
+
+
+void CMMFBackendEngine::MvpuoEvent(class TMMFEvent const & event)
+    {
+    RDebug::Print(_L("CMMFBackendEngine::MvpuoEvent (0x%x %d)\n"),
+  		          event.iEventType, event.iErrorCode);
+
+    if (event.iEventType == KMMFEventCategoryVideoPlayerGeneralError &&
+        event.iErrorCode == KErrHardwareNotAvailable)
+        {
+        //audio device taken
+        //handle this case
+        }
+
+	else if (event.iEventType == KMMFEventCategoryVideoPlayerGeneralError &&
+			 event.iErrorCode == KErrMMPartialPlayback)
+        {
+        //Partial Playback
+        } 
+    
+    else if (event.iEventType == KMMFRefreshMetaData)
+        {
+       //entry = iVideoPlayer->MetaDataEntryL( event.iErrorCode );
+        }
+    else
+        {
+    
+        }
+    
+}
+
+
+
+void CMMFBackendEngine::MvpuoPrepareComplete(TInt aError)
+    {
+    TInt err(KErrNone);
+    TAutoScaleType autoScale = EAutoScaleBestFit;
+	if(aError == KErrNone)
+	    {
+        if(m_pWindow == NULL)
+            {
+            //no RWindow was given to use so I'll create one and handle it
+            //CreateAndConfigureWindowL();
+            }
+        else
+            {
+            TRAP(err, iVideoPlayer->AddDisplayWindowL(*m_pWs, *m_pScr, *m_pWindow));
+            TRAP(err, iVideoPlayer->SetAutoScaleL(*m_pWindow, autoScale));
+            }
+
+        TReal beginSecs = 1;
+        TReal intervalSecs = 5;
+        TTimeIntervalMicroSeconds  interval(1000000*intervalSecs);
+        TTimeIntervalMicroSeconds  beginning(1000000*beginSecs);
+        
+        iVideoPlayer->Play();
+        iPlayerState = EPlayerPlaying;
+	    }
+    }
+
+// From MRebufferCallback
+void CMMFBackendEngine::MvloLoadingStarted()
+    {
+    }
+
+
+
+
+void CMMFBackendEngine::MvloLoadingComplete()
+    {
+    //file playing
+    }
+
+//MMdaAudioPlayerCallback
+void CMMFBackendEngine::MapcInitComplete(TInt aError,
+										  const TTimeIntervalMicroSeconds& /* aDuration */)
+    {
+    if (aError == KErrNone)
+        {
+        iAudioPlayer->Play();
+        iPlayerState = EPlayerPlaying;
+        }
+    else
+        {
+        //init failed
+        }
+    }
+
+
+void CMMFBackendEngine::MapcPlayComplete(TInt /* aError */)
+    {
+    //audio playback complete
+    }
+
+// from MMdaObjectStateChangeObserver
+void CMMFBackendEngine::MoscoStateChangeEvent(CBase* /*aObject*/, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
+    {
+    iPreviousRecordState = aPreviousState;
+    iCurrentRecordState = aCurrentState;
+    iErrorCode = aErrorCode;
+    RDebug::Print(_L("CMMFBackendEngine::MoscoStateChangeEvent 1 Error[%d]"),aErrorCode);  
+    if(iCurrentRecordState == CMdaAudioClipUtility::EOpen)  //EOpen
+        {
+        //outputfile is open and ready for recording
+        iRecordState = CMMFBackendEngine::ERecorderOpen;
+        if(iErrorCode == KErrNone)
+            {
+            if (iPreviousRecordState == CMdaAudioClipUtility::ENotReady)
+                {
+                RDebug::Print(_L("CMMFBackendEngine::MoscoStateChangeEvent 2"));    
+                TMMFMessageDestination destination(KUidMetaDataWriteCustomCommand);
+                TMMFMessageDestinationPckg pckg = TMMFMessageDestinationPckg(destination);
+                TInt ret = iAudioRecorder->RecordControllerCustomCommandSync(pckg, 0, KNullDesC8, KNullDesC8);
+                RDebug::Print(_L("CMMFBackendEngine::MoscoStateChangeEvent 3 [%d]"),ret);    
+                if(ret != KErrNone && iFileFormat == XA_CONTAINERTYPE_MP4)
+                    {
+                    iPauseSupportMP4 = FALSE;
+                    }
+                if(iActiveSchedulerWait->IsStarted())
+                    {
+                    iActiveSchedulerWait->AsyncStop();
+                    }
+                }
+            }
+        else
+            {
+            XAAdaptEventMMF event = {XA_RECORDITFEVENTS, XA_OBJECT_EVENT_RESOURCES_LOST, 0, NULL};
+            XAAdaptationBaseMMF_SendAdaptEvents((XAAdaptationBaseMMFCtx*)iAdaptContext, &event );
+            }
+        }
+    else if(iCurrentRecordState == CMdaAudioClipUtility::ERecording)  //ERecording
+        {
+        iRecordState = CMMFBackendEngine::ERecorderRecording;
+        iPositionUpdateTimer->Start(iTimerDelay);
+        XAAdaptEventMMF event = {XA_RECORDITFEVENTS, XA_RECORDEVENT_HEADMOVING, 0, NULL};
+        XAAdaptationBaseMMF_SendAdaptEvents((XAAdaptationBaseMMFCtx*)iAdaptContext, &event );
+        }
+    else   //ENotReady
+        {
+        //outputfile is not open
+        iRecordState = CMMFBackendEngine::ERecorderNotReady;   
+        }
+    }
+
+TInt CMMFBackendEngine::SetRecorderState(TRecorderState state, XAboolean stopCalled)
+    {
+    TInt err(KErrNone);
+    switch(state)
+        {
+        case ERecorderNotReady:
+            iAudioRecorder->Close();
+            iRecordState = ERecorderNotReady;
+            break;
+        case ERecorderOpen:
+            if(iFileFormat == XA_CONTAINERTYPE_MP4 && !iPauseSupportMP4 && !stopCalled)
+                {
+                err = KErrNotSupported;
+                return err;
+                }            
+            iPositionUpdateTimer->Stop();
+            iAudioRecorder->Stop(); 
+            iRecordState = ERecorderOpen;
+            break;
+        case ERecorderRecording:
+            TRAP(err, iAudioRecorder->RecordL());
+            break;
+        }
+    return err;
+    }
+
+void CMMFBackendEngine::AudioOpenFile()
+    {
+	TRAPD(err, iAudioPlayer->OpenFileL(iFileName));
+	if(err)
+	    {
+        
+	    }
+    }
+
+void CMMFBackendEngine::AudioStop()
+    {
+	iAudioPlayer->Stop();
+    }
+
+void CMMFBackendEngine::AudioPause()
+    {
+	iAudioPlayer->Pause();
+    }
+
+void CMMFBackendEngine::AudioClose()
+    {
+	iAudioPlayer->Close();
+    }
+
+void CMMFBackendEngine::ResumePlayback()
+    {
+    if(iPlayerState == EPlayerClosed)
+        {
+        //prepare playback
+        if(iAPIBeingUsed == EAudioPlayerUtility)
+            {
+            AudioOpenFile();
+            }
+        else
+            {
+            TRAPD (error, iVideoPlayer->OpenFileL(iFileName));
+            if(error != KErrNone)
+                {
+                
+                }
+            }
+        iPlayerState = EPlayerPaused;    
+        }
+    else if (iPlayerState == EPlayerPaused)
+        {
+        if(iAPIBeingUsed == EAudioPlayerUtility)
+            {
+            iAudioPlayer->Play();  
+            }
+        else
+            {
+            iVideoPlayer->Play();
+            }
+        iPlayerState = EPlayerPlaying;
+        }
+    }
+
+void CMMFBackendEngine::PausePlayback()
+    {
+    if(iAPIBeingUsed == EAudioPlayerUtility)
+        {
+        AudioPause();
+        }
+    else
+        {
+        TRAPD(err, iVideoPlayer->PauseL());
+        if(err != KErrNone)
+            {
+            
+            }
+        } 
+    iPlayerState = EPlayerPaused;
+    }
+
+void CMMFBackendEngine::StopPlayback()
+    {
+    if(iAPIBeingUsed == EAudioPlayerUtility)
+        {
+        AudioStop();
+        }
+    if(iAPIBeingUsed == EVideoPlayerUtility)
+        {
+        iVideoPlayer->Stop();
+        }
+    iPlayerState = EPlayerClosed;   
+    }
+
+void CMMFBackendEngine::CloseAndDestroy()
+    {
+    if (iBaseVideoPlayer && iVideoPlayer)
+        {
+        iVideoPlayer->Close();
+        delete iBaseVideoPlayer;
+        iVideoPlayer = NULL;
+        iBaseVideoPlayer = NULL;
+        }
+    
+    if (iBaseAudioPlayer && iAudioPlayer)
+        {
+        iAudioPlayer->Close();
+        delete iBaseAudioPlayer;
+        iAudioPlayer = NULL;
+        iBaseAudioPlayer = NULL;
+        }
+    
+    if (iBaseAudioRecorder)
+        {
+        iAudioRecorder->Close();
+        delete iBaseAudioRecorder;
+        iAudioRecorder = NULL;
+        iBaseAudioRecorder = NULL;
+        }
+    
+    if(iPositionUpdateTimer)
+        {
+        delete iPositionUpdateTimer;
+        iPositionUpdateTimer = NULL;
+        }
+
+    if(iActiveSchedulerWait)
+        {
+        if(iActiveSchedulerWait->IsStarted())
+            {
+            iActiveSchedulerWait->AsyncStop();
+            }
+        delete iActiveSchedulerWait;
+        iActiveSchedulerWait = NULL;
+        } 
+    }
+
+void CMMFBackendEngine::SetNativeDisplayInformation(void* display_info)
+    {
+	//display_info is of type XADataSink
+	//display_info.pLocator is of type XADataLocator_NativeDisplay
+	m_bWindowReferencePassed = TRUE;
+	XADataLocator_NativeDisplay* nativeDisplay;
+	XADataSink* videoSink = (XADataSink*)display_info;
+	
+	nativeDisplay = (XADataLocator_NativeDisplay*) (videoSink->pLocator);
+	//TODO: scrDevice is not been passed Properly
+    // Add the display window
+    m_cropRegion = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+    m_videoExtent = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+    m_cropRect = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+    m_clipRect = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+    m_cropRegion = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+    m_pWindow = ((RWindow*)(nativeDisplay->hWindow));
+    m_pWs = ((RWsSession*)(nativeDisplay->hDisplay));
+    
+    TRAPD(err, m_pScr = new(ELeave) CWsScreenDevice(*m_pWs));
+    if(err == KErrNone)
+        {
+        m_pScr->Construct();
+        }
+    }
+
+TInt CMMFBackendEngine::GetRecordPosition(XAuint64* position)
+    {
+    TInt err(KErrNone);
+    *position = iAudioRecorder->Position().Int64();
+    return err;
+    }
+
+TInt CMMFBackendEngine::SetPositionUpdatePerioed(XAmillisecond period)
+    {
+    TInt err(KErrNone);
+    iTimerDelay = period;
+    return err;
+    }
+
+TInt CMMFBackendEngine::SetAdaptContext(void* adaptcontext)
+    {
+    TInt err(KErrNone);
+    iAdaptContext = adaptcontext;
+    TRAP(err, iPositionUpdateTimer = new (ELeave) LocalTimer(this, iAdaptContext));
+    if(!err)
+        {
+        iPositionUpdateTimer->PostInit();
+        }
+    return err;
+    }
+
+TInt CMMFBackendEngine::GetEncoderId(XAuint32* encoderId)
+    {
+    TInt err(KErrNone);
+    if(iRecordState == CMMFBackendEngine::ERecorderOpen)
+        {
+        TFourCC dest;
+        TRAP(err, dest = iAudioRecorder->DestinationDataTypeL());
+        if(err == KErrNone)
+            {
+            *encoderId = dest.FourCC();
+            }
+        }
+    return err;
+    }
+
+TInt CMMFBackendEngine::GetDestinationBitRate(XAuint32* bitrate)
+    {
+    TInt err(KErrNone);
+    TUint br(0);
+    if(iRecordState == CMMFBackendEngine::ERecorderOpen)
+        {
+        TRAP(err, br = iAudioRecorder->DestinationBitRateL());
+        if(err == KErrNone)
+            {
+            *bitrate = br;
+            }
+        }
+    return err;
+    }
+
+TInt CMMFBackendEngine::GetDestinationSampleRate(XAmilliHertz* samplerate)
+    {
+    TInt err(KErrNone);
+    TUint sr(0);
+    if(iRecordState == CMMFBackendEngine::ERecorderOpen)
+        {
+        TRAP(err, sr = iAudioRecorder->DestinationSampleRateL());
+        if(err == KErrNone)
+            {
+            *samplerate = sr;
+            }
+        }
+    return err;
+    }
+
+TInt CMMFBackendEngine::GetDestinationChannels(XAuint32* channels)
+    {
+    TInt err(KErrNone);
+    TUint ch(0);
+    if(iRecordState == CMMFBackendEngine::ERecorderOpen)
+        {
+        TRAP(err,ch = iAudioRecorder->DestinationNumberOfChannelsL());
+        if(err == KErrNone)
+            {
+            *channels = ch;
+            }
+        }
+    return err;
+    }
+
+TInt CMMFBackendEngine::SetDestinationBitRate(XAuint32* bitrate)
+    {
+    TInt err(KErrNone);
+    if(iRecordState == CMMFBackendEngine::ERecorderOpen)
+        {
+        TRAP(err, iAudioRecorder->SetDestinationBitRateL(*bitrate));
+        if(err != KErrNone)
+            {
+            return XA_RESULT_PARAMETER_INVALID;
+            }
+        }
+    return err;
+    }
+
+TInt CMMFBackendEngine::SetDestinationSampleRate(XAmilliHertz* samplerate)
+    {
+    TInt err(KErrNone);
+    if(iRecordState == CMMFBackendEngine::ERecorderOpen)
+        {
+        TRAP(err, iAudioRecorder->SetDestinationSampleRateL(*samplerate));
+        if(err != KErrNone)
+            {
+            return XA_RESULT_PARAMETER_INVALID;
+            }
+        }
+    return err;
+    }
+
+TInt CMMFBackendEngine::SetDestinationChannels(XAuint32* channels)
+    {
+    TInt err(KErrNone);
+    if(iRecordState == CMMFBackendEngine::ERecorderOpen)
+        {
+        TRAP(err,iAudioRecorder->SetDestinationNumberOfChannelsL(*channels));
+        if(err != KErrNone)
+            {
+            return XA_RESULT_PARAMETER_INVALID;
+            }
+        }
+    return err;
+    }
+
+extern "C" {
+
+    int mmf_backend_engine_init(void** engine)
+    { 
+        TRAPD(err, *engine = CMMFBackendEngine::NewL());
+        return err;
+        /*int err = CreateEngine(engine);
+        return err;*/
+    }
+        
+    int mmf_set_recorder_uri(void* context, char* uri, XAuint32 format)
+    {
+        return ((CMMFBackendEngine*)(context))->SetFileName(uri,format,CMMFBackendEngine::ERecord);
+    }
+
+    void mmf_set_player_uri(void* context, char* uri, XAuint32 format)
+    {
+        ((CMMFBackendEngine*)(context))->SetFileName(uri,format,CMMFBackendEngine::EPlay);
+    }
+
+    int mmf_set_adapt_context(void* context, void* adaptcontext)
+    {
+        return ((CMMFBackendEngine*)(context))->SetAdaptContext(adaptcontext);
+    }
+
+    void mmf_pause_playback(void* context)
+    {
+        ((CMMFBackendEngine*)(context))->PausePlayback();      
+    }
+
+    void mmf_resume_playback(void* context)
+    {
+        ((CMMFBackendEngine*)(context))->ResumePlayback();       
+    }
+    void mmf_set_window_handle(void* context, void* display_info)
+    {
+        ((CMMFBackendEngine*)(context))->SetWindowHandle(display_info);
+    }
+    
+    void mmf_stop_playback(void* context)
+    {
+        ((CMMFBackendEngine*)(context))->StopPlayback(); 
+    }
+    void mmf_close(void* context)
+    {
+        delete ((CMMFBackendEngine*)context);
+    }
+    void mmf_setup_native_display(void* context, void* display_info)
+    {
+        ((CMMFBackendEngine*)(context))->SetNativeDisplayInformation(display_info); 
+    }
+    
+    int mmf_start_recording(void* context)
+    {
+        return ((CMMFBackendEngine*)(context))->SetRecorderState(CMMFBackendEngine::ERecorderRecording,FALSE); 
+    }
+    
+    int mmf_stop_recording(void* context, XAboolean stopCalled )
+    {
+        return ((CMMFBackendEngine*)(context))->SetRecorderState(CMMFBackendEngine::ERecorderOpen, stopCalled); 
+    }
+        
+    int mmf_get_record_position(void* context, XAuint64* position)
+    {
+        return ((CMMFBackendEngine*)(context))->GetRecordPosition(position);
+    }
+    
+    int mmf_set_record_position_update_period(void* context, XAmillisecond msec)
+    {
+        return ((CMMFBackendEngine*)(context))->SetPositionUpdatePerioed(msec);
+    }    
+    
+    int mmf_get_encoder_id(void* context, XAuint32* encoderId)
+    {
+        return ((CMMFBackendEngine*)(context))->GetEncoderId(encoderId);
+    }
+    
+    int mmf_get_destination_channels(void* context, XAuint32* channelsIn)
+    {
+        return ((CMMFBackendEngine*)(context))->GetDestinationChannels(channelsIn);
+    }
+    
+    int mmf_get_destination_samplerate(void* context, XAmilliHertz* sampleRate)
+    {
+        return ((CMMFBackendEngine*)(context))->GetDestinationSampleRate(sampleRate);
+    }
+
+    int mmf_get_destination_bitrate(void* context, XAuint32* bitRate)
+    {
+        return ((CMMFBackendEngine*)(context))->GetDestinationBitRate(bitRate);
+    }
+
+    int mmf_set_destination_channels(void* context, XAuint32* channelsIn)
+    {
+        return ((CMMFBackendEngine*)(context))->SetDestinationChannels(channelsIn);
+    }
+    
+    int mmf_set_destination_samplerate(void* context, XAmilliHertz* sampleRate)
+    {
+        return ((CMMFBackendEngine*)(context))->SetDestinationSampleRate(sampleRate);
+    }
+
+    int mmf_set_destination_bitrate(void* context, XAuint32* bitRate)
+    {
+        return ((CMMFBackendEngine*)(context))->SetDestinationBitRate(bitRate);
+    }
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/cmmfbackendengine.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+/*
+Media Helper Class for handling surface events
+
+Shy Ward
+*/
+
+#ifndef XA_CMMFBackendEngine_H
+#define XA_CMMFBackendEngine_H
+
+#define ENABLE_GRAPHICS_SURFACE_INTEGRATION
+
+#include "openmaxalwrapper.h"
+
+#ifdef __cplusplus
+
+#include <e32base.h>
+#include <MdaAudioSamplePlayer.h>  
+#include <f32file.h>
+#include <videoplayer.h>
+#include <videoplayer2.h>
+#include <e32std.h>
+#include <mmf/common/mmferrors.h>
+#include <mmf/common/Mmfbase.h>
+#include <MMFMetadataEventConfigConstants.h>
+#ifdef ENABLE_GRAPHICS_SURFACE_INTEGRATION
+#include <graphics/surface.h> //TSurfaceId
+#include <mmf/common/mmfvideo.h> //TVideoAspectRatio
+#include <mediaclientvideodisplay.h>
+#include <surfaceeventhandler.h>
+#include <mdaaudiosampleeditor.h>
+#include "sfmrlocaltimer.h"
+#endif
+
+// MetaDataWrite Custom Command UID
+const TUid KUidMetaDataWriteCustomCommand = {0x10207af9};
+
+#define MAX_EXTENSION_SIZE 10
+
+NONSHARABLE_CLASS(CMMFBackendEngine) : public CBase,
+                          public MVideoPlayerUtilityObserver,
+                          public MVideoLoadingObserver,
+						              public MMdaAudioPlayerCallback,
+						              public MMdaObjectStateChangeObserver
+    {
+public:      
+      enum TFuncInUse
+          {
+          EPlay = 0,
+          ERecord
+          };
+      
+	enum TPlayerInUse
+	{
+		EVideoPlayerUtility = 0,
+		EAudioPlayerUtility,
+	};
+	
+	enum TPlayerState
+	{
+	  EPlayerClosed,
+		EPlayerPaused,
+		EPlayerPlaying,
+		EPlayerError
+	};
+	
+	enum TRecorderState
+	{
+	  ERecorderNotReady = 0,
+	  ERecorderOpen,
+	  ERecorderRecording
+	};
+	      
+public:
+
+    static CMMFBackendEngine* NewL();
+    ~CMMFBackendEngine();
+    
+
+    void InitVideoPlayerUtilityL();
+    TInt SetFileName(char* uri,XAuint32 format,TFuncInUse func);
+    void ResumePlayback();
+    void PausePlayback();    
+    void StopPlayback();
+    void SetWindowHandle(void* display_info);
+    void CreateAndConfigureWindowL();
+    void CloseAndDestroy();
+    void SetNativeDisplayInformation(void* display_info);
+    TInt SetRecorderState(TRecorderState state, XAboolean stopCalled);
+    TInt GetRecordPosition(XAuint64* position);
+    TInt SetPositionUpdatePerioed(XAmillisecond period);
+    TInt SetAdaptContext(void* adaptcontext);
+    TInt GetEncoderId(XAuint32* encoderId);
+    TInt GetDestinationBitRate(XAuint32* bitrate);
+    TInt GetDestinationSampleRate(XAmilliHertz* samplerate);
+    TInt GetDestinationChannels(XAuint32* channels);
+    TInt SetDestinationBitRate(XAuint32* bitrate);
+    TInt SetDestinationSampleRate(XAmilliHertz* samplerate);
+    TInt SetDestinationChannels(XAuint32* channels);
+private:
+
+		//From MVidePlayerUtilityObserver
+		void MvpuoOpenComplete(TInt aError);
+		void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError);
+		void MvpuoPlayComplete(TInt aError);
+		void MvpuoEvent(const TMMFEvent& aEvent);
+		void MvpuoPrepareComplete(TInt aError);
+
+public:
+
+		//MMdaAudioPlayerCallback
+		void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
+		void MapcPlayComplete(TInt aError);
+		
+    // from MMdaObjectStateChangeObserver
+    void MoscoStateChangeEvent(CBase* /*aObject*/, TInt /*aPreviousState*/, TInt /*aCurrentState*/, TInt /*aErrorcCode*/);
+		
+    
+private:
+
+		// From MRebufferCallback
+		void MvloLoadingStarted();
+		void MvloLoadingComplete();		
+
+private:
+    //audio player methods
+    void AudioOpenFile();
+    void AudioClose();
+    void AudioStop();
+    void AudioPause();
+    
+    //video player methods
+    
+private:
+    CMMFBackendEngine();
+    void ConstructL();
+    TInt DetermineAPIToUse(char *uri, TFuncInUse aFunc);
+  
+    
+    //RThread                   m_ThreadHandle; 
+    CVideoPlayerUtility2*		  iVideoPlayer;
+		CBase*		                iBaseVideoPlayer;
+		CBase*                    iBaseAudioPlayer; 
+		CBase*                    iBaseAudioRecorder;
+		CMdaAudioPlayerUtility*	  iAudioPlayer;  
+		CMdaAudioRecorderUtility* iAudioRecorder;
+		TFileName					        iFileName;
+		TInt						iAPIBeingUsed;		
+		TPlayerState              iPlayerState;
+		TInt                      iPreviousRecordState;
+		TInt                      iCurrentRecordState;
+		TInt                      iErrorCode;
+		TRecorderState            iRecordState;
+		LocalTimer*               iPositionUpdateTimer;
+		TUint64                   iTimerDelay;
+		void*                     iAdaptContext;
+		XAuint32                  iFileFormat;
+		TInt                      iPauseSupportMP4;
+		CActiveSchedulerWait*     iActiveSchedulerWait;
+#ifdef ENABLE_GRAPHICS_SURFACE_INTEGRATION
+    CMediaClientVideoDisplay* iMediaClientVideoDisplay;
+    TRect m_clipRect;
+    TRect m_videoExtent;    
+    TRect m_cropRegion;
+    TVideoAspectRatio m_pixelAspectRatio;
+    RWindow m_Window;
+    RWindow* m_pWindow;
+    TRect m_cropRect;
+    TSurfaceId m_surfaceId;
+    TVideoRotation m_rotation;
+    TReal32 m_scaleWidth;
+    TReal32 m_scaleHeight;
+    TInt m_horizPos;
+    TInt m_vertPos; 
+    TInt m_displayId;   
+    TBool m_bWindowReferencePassed;
+    CWsScreenDevice* m_pScr;
+    RWsSession m_ws;
+    RWsSession* m_pWs;
+
+#endif /*ENABLE_GRAPHICS_SURFACE_INTEGRATION*/    
+    };
+#else  /* __cplusplus */
+
+
+extern int mmf_backend_engine_init(void** engine);
+
+extern int mmf_set_recorder_uri(void* context, char* uri, XAuint32 format);
+
+extern void mmf_set_player_uri(void* context, char* uri, XAuint32 format);
+
+extern void mmf_pause_playback(void* context);
+
+extern void mmf_resume_playback(void* context);
+
+extern void mmf_set_window_handle(void* context, void* display_infos);
+
+extern void mmf_stop_playback(void* context);
+
+extern void mmf_close(void* context);
+    
+extern void mmf_setup_native_display(void* context, void* display_info);
+
+extern int mmf_set_adapt_context(void* context, void* adaptcontext);
+
+extern int mmf_start_recording(void* context);
+
+extern int mmf_stop_recording(void* context, XAboolean stopCalled);
+
+extern int mmf_get_record_position(void* context, XAuint64* position);
+
+extern int mmf_set_record_position_update_period(void* context, XAmillisecond msec);
+
+extern int mmf_get_encoder_id(void* context, XAuint32* encoderId);
+extern int mmf_get_destination_channels(void* context, XAuint32* channelsIn);
+extern int mmf_get_destination_samplerate(void* context, XAmilliHertz* sampleRate);
+extern int mmf_get_destination_bitrate(void* context, XAuint32* bitRate);
+extern int mmf_set_destination_channels(void* context, XAuint32* channelsIn);
+extern int mmf_set_destination_samplerate(void* context, XAmilliHertz* sampleRate);
+extern int mmf_set_destination_bitrate(void* context, XAuint32* bitRate);
+
+#endif /* __cplusplus */
+
+#endif /* XA_CMMFBackendEngine_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/sfmrlocaltimer.cpp	Fri Apr 16 15:29:42 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: 
+*
+*/
+// sfmrlocaltimer.cpp
+
+#include "sfmrlocaltimer.h"
+
+extern "C" {
+#include "xarecorditfadaptationmmf.h"
+}
+
+#include "cmmfbackendengine.h"
+
+
+LocalTimer::LocalTimer(CMMFBackendEngine* parent, void* adaptContext)
+:CActive(CActive::EPriorityStandard),
+iTime(0)
+    {
+    CActiveScheduler::Add(this);
+    iParent = parent;
+    iAdaptContext = adaptContext;
+    }
+
+LocalTimer::~LocalTimer()
+    {
+    Cancel();
+    iTimer.Close();
+    }
+
+TInt LocalTimer::PostInit()
+    {
+    return iTimer.CreateLocal();
+    }
+
+void LocalTimer::Start(TUint64 aDelay)
+    {
+    if (!IsActive())
+        {
+        iDelay = aDelay;
+        /* Convert milli to micro */
+        TTimeIntervalMicroSeconds32 delay(aDelay * 1000);
+        iStatus = KRequestPending;
+        iTimer.After(iStatus, delay);
+        SetActive();
+        }
+    }
+
+void LocalTimer::Stop()
+    {
+    Cancel();
+    }
+
+void LocalTimer::ResetTime()
+    {
+    iTime = 0;
+    }
+
+TUint64 LocalTimer::GetTime()
+    {
+    return iTime;
+    }
+
+void LocalTimer::RunL()
+    {
+    if (iStatus == KErrNone)
+        {
+        iTime+= iDelay;
+        XAuint64 position;
+        iParent->GetRecordPosition(&position);
+        
+        XARecordItfAdaptMMF_PositionUpdate(iAdaptContext,position);
+        Start(iDelay);
+        }
+    }
+
+void LocalTimer::DoCancel()
+    {
+    iTimer.Cancel();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/sfmrlocaltimer.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* 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: 
+*
+*/
+// sfmrlocaltimer.h
+
+#ifndef SFMRLOCALTIMER_H
+#define SFMRLOCALTIMER_H
+
+#include <e32base.h>
+class CMMFBackendEngine;
+
+NONSHARABLE_CLASS(LocalTimer) : public CActive
+    {
+public:
+    // Construct/destruct
+    LocalTimer(CMMFBackendEngine* parent, void* adaptContext);
+    TInt PostInit();
+    ~LocalTimer();
+
+public:
+    // Starts ticking after every aDelay microsecs
+    void Start(TUint64 aDelay);
+    void Stop();
+    void ResetTime();
+    TUint64 GetTime();
+
+protected:
+    // From CActive
+    void RunL();
+    void DoCancel();
+
+
+private:
+    RTimer iTimer;      // Has
+    TUint64 iTime;
+    TUint64 iDelay;
+    CMMFBackendEngine* iParent;
+    void* iAdaptContext;
+    };
+
+#endif /* SFMRLOCALTIMER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaadaptationcontextbasemmf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,143 @@
+/*
+* 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 <assert.h>
+#include <string.h>
+#include "xaadaptationcontextbasemmf.h"
+#include "xaadaptationmmf.h"
+#include "xaobjectitf.h"
+#include "xamediaplayeradaptctxmmf.h"
+
+/*
+ * XAAdaptationBaseCtx* XAAdaptationBase_Create()
+ * 1st phase initialization function for Adaptation Base context structure.
+ * Reserves memory for base context and initializes GStreamer FW.
+ */
+XAresult XAAdaptationBaseMMF_Init( XAAdaptationBaseMMFCtx* pSelf, XAuint32 ctxId )
+{
+    DEBUG_API("->XAAdaptationBase_Init");
+
+    if ( pSelf )
+    {
+    pSelf->evtHdlrs = g_array_new (FALSE, FALSE, sizeof (XAAdaptEvtHdlrMMF));
+    pSelf->ctxId = ctxId;
+    }
+    else
+    {
+        DEBUG_ERR("Invalid Adaptation Base Context.")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_API("<-XAAdaptationBase_Init");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAAdaptationBase_PostInit()
+ * 2nd phase initialization for Adaptation Base.
+ */
+XAresult XAAdaptationBaseMMF_PostInit( XAAdaptationBaseMMFCtx* ctx )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAdaptationBase_PostInit");
+
+   
+
+    DEBUG_API("<-XAAdaptationBase_PostInit");
+    return ret;
+}
+
+/*
+ * void XAAdaptationBase_Free( XAAdaptationBaseCtx* ctx )
+ * Frees all Base context variables .
+ */
+void XAAdaptationBaseMMF_Free( XAAdaptationBaseMMFCtx* ctx )
+{
+    g_array_free(ctx->evtHdlrs, TRUE);
+    DEBUG_API("<-XAAdaptationBase_Free");
+}
+
+/*
+ * XAresult XAAdaptationBase_AddEventHandler
+ * Adds event handler for certain event types.
+ */
+XAresult XAAdaptationBaseMMF_AddEventHandler( XAAdaptationBaseMMFCtx* ctx, xaAdaptEventHandlerMMF evtHandler,
+                                    XAuint32 evtTypes, void *pHandlerCtx )
+{
+    XAuint32 i;
+    XAAdaptEvtHdlrMMF tmp;
+    DEBUG_API("->XAAdaptationBase_AddEventHandler");
+    if(!ctx)
+    {
+        DEBUG_ERR("no context");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    for(i=0; i<ctx->evtHdlrs->len; i++)
+    {
+        if( (g_array_index(ctx->evtHdlrs, XAAdaptEvtHdlrMMF, i)).handlerfunc == evtHandler )
+        {
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+    }
+    tmp.handlerfunc = evtHandler;
+    tmp.handlercontext = pHandlerCtx;
+    tmp.eventtypes = evtTypes;
+    g_array_append_val(ctx->evtHdlrs, tmp);
+    DEBUG_API("<-XAAdaptationBase_AddEventHandler");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAAdaptationBase_RemoveEventHandler
+ * Removes event handler for certain event types.
+ */
+XAresult XAAdaptationBaseMMF_RemoveEventHandler( XAAdaptationBaseMMFCtx* ctx, xaAdaptEventHandlerMMF evtHandler)
+{
+    XAuint32 i;
+    DEBUG_API("->XAAdaptationBase_RemoveEventHandler");
+    if(!ctx)
+    {
+        DEBUG_ERR("no context");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    for(i=0; i<ctx->evtHdlrs->len; i++)
+    {
+        if( (g_array_index(ctx->evtHdlrs, XAAdaptEvtHdlrMMF, i)).handlerfunc == evtHandler )
+        {
+            g_array_remove_index(ctx->evtHdlrs, i);
+            return XA_RESULT_SUCCESS;
+        }
+    }
+    DEBUG_API("<-XAAdaptationBase_RemoveEventHandler");
+    /*did not find, return error*/
+    return XA_RESULT_PARAMETER_INVALID;
+}
+
+void XAAdaptationBaseMMF_SendAdaptEvents(XAAdaptationBaseMMFCtx* ctx, XAAdaptEventMMF* event)
+{
+    XAuint32 i;
+    XAAdaptEvtHdlrMMF* tmp;
+    for(i=0; i<ctx->evtHdlrs->len; i++)
+    {
+        tmp = &g_array_index(ctx->evtHdlrs, XAAdaptEvtHdlrMMF, i);
+        if( tmp->eventtypes & event->eventtype )
+        {
+            (tmp->handlerfunc)(tmp->handlercontext, event);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaadaptationcontextbasemmf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAADAPTATIONCONTEXTBASEMMF_H
+#define XAADAPTATIONCONTEXTBASEMMF_H
+
+#include <stdlib.h>
+#include "xaglobals.h"
+#include "openmaxalwrapper.h"
+//#include "OpenMAXAL_ContentPipe.h"
+#include "xaplatform.h"
+
+
+/* ENUMERATIONS */
+typedef enum {
+    XAMediaPlayerAdaptationMMF = 0,
+    XAMediaRecorderAdaptationMMF,
+    XARadioAdaptationMMF,
+    XACameraAdaptationMMF,
+    XAOutputMixAdaptationMMF,
+    XAVibraAdaptationMMF,
+    XALedArrayAdaptationMMF,
+    XAMDAdaptationMMF,
+    XAEngineAdaptationMMF
+}AdaptationContextMMFIDS;
+
+/* Adaptation event structure */
+typedef struct XAAdaptEventMMF_
+{
+    XAAdaptEventTypes  eventtype; /* what kind of event, e.g. playitf event  */
+    XAuint32            eventid;   /* eventtype-specific event, e.g. XA_PLAYEVENT macro */
+    XAuint32           datasize;  /* event data size */
+    void*              data;      /* event data if needed */
+} XAAdaptEventMMF;
+
+/* Adaptation event callback */
+typedef void (*xaAdaptEventHandlerMMF) ( void *pHandlerCtx, XAAdaptEventMMF* event );
+
+/* Forward declaration of adaptation basecontext */
+typedef struct XAAdaptationBaseMMFCtx_ XAAdaptationBaseMMFCtx;
+
+/* FUNCTIONS */
+XAresult XAAdaptationBaseMMF_Init( XAAdaptationBaseMMFCtx* pSelf, XAuint32 ctxId );
+XAresult XAAdaptationBaseMMF_PostInit( XAAdaptationBaseMMFCtx* ctx );
+XAresult XAAdaptationBaseMMF_AddEventHandler( XAAdaptationBaseMMFCtx* ctx, xaAdaptEventHandlerMMF evtHandler,
+                                    XAuint32 evtTypes,void *pHandlerCtx );
+XAresult XAAdaptationBaseMMF_RemoveEventHandler( XAAdaptationBaseMMFCtx* ctx, xaAdaptEventHandlerMMF evtHandler );
+void XAAdaptationBaseMMF_Free( XAAdaptationBaseMMFCtx* ctx );
+//XAresult XAAdaptationBase_SetCPConfiguration(XAAdaptationBaseCtx* ctx, XAConfigExtensionCpKey configValue);
+
+#endif /*XAADAPTATIONCONTEXTBASEMMF_H*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaadaptationmmf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,221 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAADAPTATION_H_
+#define XAADAPTATION_H_
+
+#include <pthread.h>
+#include <semaphore.h>
+#include <garray.h>
+#include <string.h>
+#include <unistd.h>
+#include "openmaxalwrapper.h"
+#include "xaadaptationcontextbasemmf.h"
+#include "xaglobals.h"
+//#include "OpenMAXAL_ContentPipe.h"
+#include "xaplatform.h"
+
+#ifdef XA_IMPL_MEASURE_GST_DELAY
+#include <time.h>
+#endif /* XA_IMPL_MEASURE_GST_DELAY */
+
+/* MACROS */
+#define FLIP_NONE               0
+#define FLIP_CLOCKWISE          1 /* Rotate clockwise 90 degrees */
+#define FLIP_ROTATE_180         2 /* Rotate 180 degrees */
+#define FLIP_COUNTERCLOCKWISE   3 /* Rotate counter-clockwise 90 degrees */
+#define FLIP_HORIZONTAL         4 /* Flip image horizontally */
+#define FLIP_VERTICAL           5 /* Flip image vertically */
+
+/* TYPEDEFS */
+//typedef gboolean (*GstBusCb)( GstBus *bus, GstMessage *message, gpointer data );
+#define XA_IMPL_SUPPORTED_AUDIO_OUT_NUM 3
+#define XA_IMPL_OMIX_MAX_CONNECTED_MEDIAPLAYERS 10
+#define CONTENT_PIPE_BUFFER_SIZE 1000
+#define TEST_VIDEO_WIDTH     640
+#define TEST_VIDEO_HEIGHT    480
+
+typedef enum
+{
+    XA_AUDIO_WAVENC = 0,
+    XA_AUDIO_VORBISENC,
+    XA_AUDIO_PCM,
+    XA_NUM_OF_AUDIOENCODERS /* Do not move this line */
+} XAAudioEnc;
+
+typedef enum
+{
+    XA_VIDEO_JPEGENC = 0,
+    XA_VIDEO_THEORAENC,
+    XA_NUM_OF_VIDEOENCODERS /* Do not move this line */
+} XAVideoEnc;
+
+typedef enum CP_STATE
+{
+	CPStateNull =0,
+	CPStateInitialized,
+	CPStatePrerolling,
+	CPStateStarted,
+	CPStateRunning,
+	CPStatePaused,
+	CPStateStopped,
+	CPStateWaitForData,
+	CPStateEOS,
+	CPStateError
+}CP_STATE;
+
+typedef struct XAAdaptEvtHdlrMMF_
+{
+    xaAdaptEventHandlerMMF handlerfunc;    /* function handling the callback */
+    void               *handlercontext; /* context of handler */
+    XAuint32            eventtypes;     /* what kind of events this handles */
+} XAAdaptEvtHdlrMMF;
+
+/*
+ * Structure that holds all common variables for every
+ * mmf-Adaptation context structures.
+ */
+typedef struct XAAdaptationBaseMMFCtx_
+{
+    /* Common Variables for all adaptation elements */
+    GArray*         evtHdlrs;    /* array of event handlers */
+    XAuint32        ctxId;
+    XAboolean       placeholder;
+
+} XAAdaptationBaseMMFCtx_;
+
+typedef struct XAEngineAdaptationMMFCtx_
+{
+    /* Parent*/
+    XAAdaptationBaseMMFCtx_    baseObj;
+
+} XAEngineAdaptationMMFCtx_;
+
+/*
+ * Structure for Media Player specific gst-adaptation.
+ */
+typedef struct XAMediaPlayerAdaptationMMFCtx_
+{
+    /* Parent*/
+    XAAdaptationBaseMMFCtx_    baseObj;
+
+    /* OMX-AL Variables */
+    XADataSource            *xaSource, *xaBankSrc;
+    XADataSink              *xaAudioSink, *xaVideoSink, *xaLEDArray, *xaVibra;
+
+    /* MMF elements */
+    XAboolean               isobjsrc;    /*is source another XA object?*/
+
+    XAboolean               isobjasink;   /*is audio sink another XA object?*/
+    XAboolean               isobjvsink;   /*is video sink another XA object?*/
+
+    XAboolean               mute;
+    XAuint32                imageEffectID;
+    XAboolean               isStereoPosition;
+    XAmillidegree           curRotation;
+    XAuint32                curMirror;
+
+    XAint32                 buffering;
+
+    /* internals */
+    XAboolean               trackpositionenabled;
+
+
+    XAboolean               loopingenabled;
+
+    XAboolean		            cameraSinkSynced;
+    void*                   mmfContext;
+
+
+} XAMediaPlayerAdaptationMMFCtx_;
+
+typedef struct XAMediaRecorderAdaptationMMFCtx_
+{
+    /* Parent*/
+    XAAdaptationBaseMMFCtx_ baseObj;
+
+    /* OMX-AL Variables */
+    XADataSource            *xaAudioSource, *xaVideoSource;
+    XADataSink              *xaSink;
+    XAuint8                 recModes;
+
+    /* GST elements */
+    XAboolean               isobjsink;   /*is sink another XA object?*/
+    XAboolean               isobjasrc;    /*is audio source another XA object?*/
+    XAboolean               isobjvsrc;    /*is video source another XA object?*/
+    XAboolean               encodingchanged;
+
+    XAboolean               mute;
+    XAuint32                imageEffectID;
+    XAboolean               isStereoPosition;
+    XAuint32                xaRecordState;
+    XAmillidegree           curRotation;
+    XAuint32                curMirror;
+    XAboolean               isRecord;
+
+    /* internals */
+    XAboolean               trackpositionenabled;
+    gboolean                runpositiontimer;
+
+    XAImplThreadHandle      recordingEventThr;
+
+    /* Variables for encoders */
+    XAAudioEncoderSettings  audioEncSettings;
+    XAVideoSettings         videoEncSettings;
+    XAImageSettings         imageEncSettings;
+    
+    void*                   mmfContext;
+
+
+} XAMediaRecorderAdaptationMMFCtx_;
+
+
+/* FUNCTIONS */
+/*
+ * gboolean XAAdaptationBase_GstBusCb( GstBus *bus, GstMessage *message, gpointer data );
+ * Default CallBack handler for gst-bus messages. This will be called if object specific callback is
+ * not implemented.
+ */
+
+
+void XAAdaptationBaseMMF_SendAdaptEvents(XAAdaptationBaseMMFCtx* ctx, XAAdaptEventMMF* event);
+
+//void XAAdaptationBase_PrepareAsyncWait(XAAdaptationBaseCtx* ctx);
+//void XAAdaptationBase_StartAsyncWait(XAAdaptationBaseCtx* ctx);
+//gboolean XAAdaptationBase_CancelAsyncWait(gpointer ctx);
+//void XAAdaptationBase_CompleteAsyncWait(XAAdaptationBaseCtx* ctx);
+
+
+//XAresult XAMediaPlayerAdapt_UpdatePositionCbTimer(XAMediaPlayerAdaptationCtx_* mCtx);
+
+//XAresult XAMediaRecorderAdapt_ChangeEncoders( XAMediaRecorderAdaptationCtx_* mCtx );
+//XAresult XAMediaRecorderAdapt_CheckCodec( XAMediaRecorderAdaptationCtx_* mCtx, XACapsType encType, XAuint32 encoderId );
+
+//XAresult XAMetadataAdapt_TryWriteTags(XAAdaptationBaseCtx* mCtx, GstBin* binToWriteTo);
+//void XAMetadataAdapt_FreeVars(XAMetadataAdaptVars *vars);
+
+//GstElement* XAOutputMixAdapt_GetSink(XAAdaptationBaseCtx* bCtx);
+
+
+//XAresult XAOutputMixAdapt_ConnectObject(XAAdaptationBaseCtx* omCtx, XAAdaptationBaseCtx* bCtx, GstElement* usedMix);
+//XAresult XAOutputMixAdapt_DisconnectObject(XAAdaptationBaseCtx* omCtx, XAAdaptationBaseCtx* bCtx);
+//void* XAAdaptationBase_ContentPipeScrThrFunc( void* arg);
+//void* XAAdaptationBase_ContentPipeSinkThrFunc( void* arg);
+//CPresult XAAdaptationBase_ContentPipeSrcCb(CP_EVENTTYPE eEvent, CPuint iParam);
+//CPresult XAAdaptationBase_ContentPipeSinkCb(CP_EVENTTYPE eEvent, CPuint iParam);
+
+#endif /* XAADAPTATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaengineadaptctxmmf.c	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#include <string.h>
+#include "xaengineadaptctxmmf.h"
+#include "xaadaptationmmf.h"
+
+/*
+ * XAAdaptationBaseCtx* XAEngineAdaptMMF_Create()
+ * Allocates memory for Engine Adaptation Context and makes 1st phase initialization
+ * @returns XAEngineAdaptationCtx* - Pointer to created context
+ */
+XAAdaptationBaseMMFCtx* XAEngineAdaptMMF_Create()
+{
+    XAEngineAdaptationMMFCtx *pSelf = NULL;
+    DEBUG_API("->XAEngineAdaptMMF_Create");
+
+    pSelf = calloc(1, sizeof(XAEngineAdaptationMMFCtx));
+    if ( pSelf)
+    {
+        if( XAAdaptationBaseMMF_Init(&(pSelf->baseObj),XAEngineAdaptationMMF)
+                    != XA_RESULT_SUCCESS )
+            {
+                DEBUG_ERR("Failed to init base context!!!");
+                free(pSelf);
+                pSelf = NULL;
+            }
+            else
+            {
+                /* Init internal variables */
+            }
+    }
+
+    DEBUG_API("<-XAEngineAdaptMMF_Create");
+    return (XAAdaptationBaseMMFCtx*)pSelf;
+}
+
+/*
+ * XAresult XAEngineAdaptMMF_PostInit()
+ * 2nd phase initialization of engine Adaptation Context
+ */
+XAresult XAEngineAdaptMMF_PostInit(XAAdaptationBaseMMFCtx* bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("<-XAEngineAdaptMMF_PostInit");
+    return ret;
+}
+
+/*
+ * void XAEngineAdapt_Destroy(XAEngineAdaptationCtx* ctx)
+ * Destroys Engine Adaptation Context
+ * @param ctx - Engine Adaptation context to be destroyed
+ */
+void XAEngineAdaptMMF_Destroy(XAAdaptationBaseMMFCtx* bCtx)
+{
+	XAEngineAdaptationMMFCtx* ctx = NULL;
+
+	DEBUG_API("->XAEngineAdaptMMF_Destroy");
+//	if( !bCtx || bCtx->ctxId != XAEngineAdaptation )
+//	{
+//		DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+//		DEBUG_API("<-XAEngineAdaptMMF_Destroy");
+//		return;
+//	}
+	ctx = (XAEngineAdaptationMMFCtx*)bCtx;
+  
+  XAAdaptationBaseMMF_Free(&(ctx->baseObj));
+
+
+    free(ctx);
+    ctx = NULL;
+
+    DEBUG_API("<-XAEngineAdaptMMF_Destroy");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaengineadaptctxmmf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAENGINEADAPTCTXMMF_H_
+#define XAENGINEADAPTCTXMMF_H_
+
+#include "xaadaptationcontextbasemmf.h"
+//#include "XAStaticCapsAdaptation.h"
+
+/* TYPEDEFS */
+
+typedef struct XAEngineAdaptationMMFCtx_ XAEngineAdaptationMMFCtx;
+
+/* FUNCTIONS */
+XAAdaptationBaseMMFCtx* XAEngineAdaptMMF_Create(void);
+XAresult XAEngineAdaptMMF_PostInit(XAAdaptationBaseMMFCtx* bCtx);
+void XAEngineAdaptMMF_Destroy(XAAdaptationBaseMMFCtx* bCtx);
+
+#endif /* XAENGINEADAPTCTXMMF_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xamediaplayeradaptctxmmf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,152 @@
+/*
+* 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 <assert.h>
+#include <stdlib.h>
+#include "xamediaplayeradaptctxmmf.h"
+#include "xaadaptationmmf.h"
+#include "xaobjectitf.h"
+#include "cmmfbackendengine.h"
+
+
+/*
+ * XAMediaPlayerAdaptationMMFCtx* XAMediaPlayerAdapt_Create()
+ * Allocates memory for Media Player Adaptation Context and makes 1st phase initialization
+ * @param XADataSource *pDataSrc - pointer to OMX-AL data source
+ * @param XADataSource *pBankSrc - pointer to instrument bank structure in Mobile DLS, if NULL default will be used.
+ * @param XADataSink *pAudioSnk - pointer to OMX-AL audio sink definition
+ * @param XADataSink *pImageVideoSnk - pointer to OMX-AL image and video sink definition
+ * @returns XAMediaPlayerAdaptationMMFCtx* - Pointer to created context, NULL if error occurs.
+ */
+XAAdaptationBaseMMFCtx* XAMediaPlayerAdaptMMF_Create(XADataSource *pDataSrc, XADataSource *pBankSrc,
+                                                      XADataSink *pAudioSnk, XADataSink *pImageVideoSnk,
+                                                      XADataSink *pVibra, XADataSink *pLEDArray)
+{
+    XAMediaPlayerAdaptationMMFCtx *pSelf = NULL;
+    XAuint32 locType = 0;
+    XAresult res;
+    DEBUG_API("->XAMediaPlayerAdaptMMF_Create");
+    
+    pSelf = calloc(1, sizeof(XAMediaPlayerAdaptationMMFCtx));
+    if ( pSelf)
+    {
+#ifdef _GSTREAMER_BACKEND_          
+        if( XAAdaptationBaseMMF_Init(&(pSelf->baseObj),0)
+            != XA_RESULT_SUCCESS )
+        {
+            DEBUG_ERR("Failed to init base context!!!");
+            free(pSelf);
+            pSelf = NULL;
+        }
+        else
+#endif            
+        {
+            pSelf->xaSource = pDataSrc;
+            pSelf->xaBankSrc = pBankSrc;
+            pSelf->xaAudioSink = pAudioSnk;
+            pSelf->xaVideoSink = pImageVideoSnk;
+            pSelf->xaLEDArray = pLEDArray;
+            pSelf->xaVibra = pVibra;
+            pSelf->curMirror = XA_VIDEOMIRROR_NONE;
+            pSelf->curRotation = 0;
+            pSelf->isobjsrc = XA_BOOLEAN_FALSE;
+            pSelf->cameraSinkSynced = XA_BOOLEAN_FALSE;
+            /*pSelf->waitData = XA_BOOLEAN_FALSE;*/
+        }
+
+  
+    if ( pDataSrc )
+		{
+			locType = *((XAuint32*)(pDataSrc->pLocator));
+			if ( locType == XA_DATALOCATOR_IODEVICE  )
+			{
+			//XADataLocator_IODevice *ioDevice = (XADataLocator_IODevice*)(pDataSrc->pLocator);
+			}
+		}
+    }
+    
+    if(pSelf)
+        {
+        res = mmf_backend_engine_init(&(pSelf->mmfContext));
+        if(pSelf->mmfContext && res == XA_RESULT_SUCCESS)
+            {
+            XADataLocator_URI*   tempUri;
+            XADataFormat_MIME* tempFormat;
+            tempUri = (XADataLocator_URI*)(pSelf->xaSource->pLocator);
+            tempFormat = (XADataFormat_MIME*)(pSelf->xaSource->pFormat);
+            mmf_set_player_uri(pSelf->mmfContext, (char *)(tempUri->URI), tempFormat->containerType);       
+            if(pImageVideoSnk)
+              {
+              mmf_setup_native_display(pSelf->mmfContext, pImageVideoSnk);
+              }
+            }
+        else
+            {
+             DEBUG_ERR("Failed to init mmf context!!!");
+             free(pSelf);
+             pSelf = NULL; 
+            }
+        }
+
+    DEBUG_API("<-XAMediaPlayerAdaptMMF_Create");
+    return (XAAdaptationBaseMMFCtx*)pSelf;
+}
+
+
+
+/*
+ * XAresult XAMediaPlayerAdaptMMF_PostInit()
+ * 2nd phase initialization of Media Player Adaptation Context
+ * @param XAMediaPlayerAdaptationMMFCtx* ctx - pointer to Media Player adaptation context
+ * @return XAresult - Success value
+ */
+XAresult XAMediaPlayerAdaptMMF_PostInit( XAAdaptationBaseMMFCtx* bCtx )
+{
+  XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("<-XAMediaPlayerAdaptMMF_PostInit");
+    return ret;
+}
+
+/*
+ * void XAMediaPlayerAdaptMMF_Destroy( XAMediaPlayerAdaptationMMFCtx* ctx )
+ * Destroys Media Player Adaptation Context
+ * @param ctx - Media Player Adaptation context to be destroyed
+ */
+void XAMediaPlayerAdaptMMF_Destroy( XAAdaptationBaseMMFCtx* bCtx )
+{
+    XAMediaPlayerAdaptationMMFCtx* ctx = NULL;
+
+    
+    DEBUG_API("->XAMediaPlayerAdaptMMF_Destroy");
+    if(bCtx == NULL)
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XAMediaPlayerAdaptMMF_Destroy");
+        return;
+    }
+    ctx = (XAMediaPlayerAdaptationMMFCtx*)bCtx;
+
+#ifdef _GSTREAMER_BACKEND_  
+    XAAdaptationBase_Free( bCtx );
+#endif    
+    free(ctx);
+    ctx = NULL;
+
+    DEBUG_API("<-XAMediaPlayerAdaptMMF_Destroy");
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xamediaplayeradaptctxmmf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAMEDIAPLAYERADAPTCTXMMF_H
+#define XAMEDIAPLAYERADAPTCTXMMF_H
+
+#include "xaadaptationcontextbasemmf.h"
+
+/* TYPEDEFS */
+
+typedef struct XAMediaPlayerAdaptationMMFCtx_ XAMediaPlayerAdaptationMMFCtx;
+
+/* FUNCTIONS */
+XAAdaptationBaseMMFCtx* XAMediaPlayerAdaptMMF_Create( XADataSource *pDataSrc, XADataSource *pBankSrc,
+                                                       XADataSink *pAudioSnk, XADataSink *pImageVideoSnk,
+                                                       XADataSink *pVibra, XADataSink *pLEDArray);
+XAresult XAMediaPlayerAdaptMMF_PostInit( XAAdaptationBaseMMFCtx* bCtx );
+void XAMediaPlayerAdaptMMF_Destroy( XAAdaptationBaseMMFCtx* bCtx );
+
+//XAresult XAMediaPlayerAdapt_InitContentPipeSrc(XAMediaPlayerAdaptationCtx* ctx);
+#endif /*XAMEDIAPLAYERADAPTCTXMMF_H*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xamediarecorderadaptctxmmf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,186 @@
+/*
+* 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 <string.h>
+#include <assert.h>
+#include "xamediarecorderadaptctxmmf.h"
+#include "xaadaptationmmf.h"
+#include "cmmfbackendengine.h"
+//#include "XAMetadataAdaptation.h"
+//#include "XAStaticCapsAdaptation.h"
+
+
+#define XA_ADAPTID_UNINITED 0
+#ifdef _GSTREAMER_BACKEND_ 
+extern XAboolean cameraRealized;
+#endif
+//extern XACameraAdaptationCtx_* cameraCtx;
+
+
+
+/*
+ * XAAdaptationBaseCtx* XAMediaRecorderAdaptMMF_Create()
+ * Allocates memory for Media Recorder Adaptation Context and makes 1st phase initialization
+ * @param XADataSource *pAudioSrc - pointer to OMX-AL audio source
+ * @param XADataSource *pImageVideoSrc - pointer image/video source
+ * @param XADataSink *pDataSnk - pointer to OMX-AL sink
+ * @returns XAMediaRecorderAdaptationMMFCtx* - Pointer to created context, NULL if error occurs.
+ */
+XAAdaptationBaseMMFCtx* XAMediaRecorderAdaptMMF_Create(XADataSource* pAudioSrc,
+        XADataSource* pImageVideoSrc, XADataSink* pDataSnk, XAuint8 recModes)
+    {
+    XAMediaRecorderAdaptationMMFCtx *pSelf = NULL;
+    XAuint32 locType = 0;
+    XAresult res;
+    XADataLocator_IODevice *ioDevice;
+    DEBUG_API("->XAMediaRecorderAdaptMMF_Create");
+
+    pSelf = calloc(1, sizeof(XAMediaRecorderAdaptationMMFCtx));
+    if (pSelf)
+        {            
+        if (XAAdaptationBaseMMF_Init(&(pSelf->baseObj),
+                XAMediaRecorderAdaptationMMF) != XA_RESULT_SUCCESS)
+            {
+            DEBUG_ERR("Failed to init base context!!!");
+            free(pSelf);
+            pSelf = NULL;
+            }
+        else        
+            {
+            pSelf->xaAudioSource = pAudioSrc;
+            pSelf->xaVideoSource = pImageVideoSrc;
+            pSelf->xaSink = pDataSnk;
+            pSelf->xaRecordState = XA_RECORDSTATE_STOPPED;
+            pSelf->curMirror = XA_VIDEOMIRROR_NONE;
+            pSelf->curRotation = 0;
+            pSelf->recModes = recModes;
+            pSelf->isRecord = XA_BOOLEAN_FALSE;
+
+            /* defaults from API spec */
+            pSelf->imageEncSettings.width = 640;
+            pSelf->imageEncSettings.height = 480;
+            pSelf->imageEncSettings.compressionLevel = 0;
+            pSelf->imageEncSettings.encoderId = XA_IMAGECODEC_JPEG;
+            pSelf->imageEncSettings.colorFormat = XA_COLORFORMAT_UNUSED;
+            /* no specified defaults for rest, determined later from container type */
+            pSelf->videoEncSettings.encoderId = XA_ADAPTID_UNINITED;
+            pSelf->videoEncSettings.width = 640;
+            pSelf->videoEncSettings.height = 480;
+            pSelf->videoEncSettings.frameRate = 15;
+            pSelf->audioEncSettings.encoderId = XA_ADAPTID_UNINITED;
+            pSelf->audioEncSettings.channelsIn = 2;
+            pSelf->audioEncSettings.channelsOut = 2;
+            pSelf->audioEncSettings.bitsPerSample = 8;
+            pSelf->audioEncSettings.bitRate = 128;
+            pSelf->audioEncSettings.sampleRate = 44100;
+            }
+
+        if (pImageVideoSrc)
+            {
+            locType = *((XAuint32*) (pImageVideoSrc->pLocator));
+            if (locType == XA_DATALOCATOR_IODEVICE)
+                {
+                ioDevice
+                        = (XADataLocator_IODevice*) (pImageVideoSrc->pLocator);
+                if (ioDevice->deviceType == XA_IODEVICE_CAMERA
+#ifdef _GSTREAMER_BACKEND_ 
+                        && !cameraRealized
+#endif                        
+                        )
+                    {
+                    DEBUG_ERR("Preconditions violated - Camera object not realized");
+                    XAAdaptationBaseMMF_Free(&pSelf->baseObj);
+                    free(pSelf);
+                    pSelf = NULL;
+                    }
+                }
+            }
+        }
+    
+    if(pSelf)
+        {
+        res = mmf_backend_engine_init(&(pSelf->mmfContext) );
+        if(!(pSelf->mmfContext) || (res != XA_RESULT_SUCCESS))
+            {
+            DEBUG_ERR("Failed to init mmf context!!!");
+            free(pSelf);
+            pSelf = NULL;           
+            }   
+        }
+    
+    DEBUG_API("<-XAMediaRecorderAdaptMMF_Create");
+    return (XAAdaptationBaseMMFCtx*) pSelf;
+    }
+
+/*
+ * XAresult XAMediaRecorderAdaptMMF_PostInit()
+ * 2nd phase initialization of Media Recorder Adaptation Context
+ * @param XAAdaptationBaseCtx* ctx - pointer to Media Recorder adaptation context
+ * @return XAresult - Success value
+ */
+XAresult XAMediaRecorderAdaptMMF_PostInit(XAAdaptationBaseMMFCtx* bCtx)
+    {
+
+    XAresult ret = XA_RESULT_SUCCESS;
+    XADataLocator_URI*   tempUri;
+    XADataFormat_MIME* tempFormat;
+    XAMediaRecorderAdaptationMMFCtx *pSelf = (XAMediaRecorderAdaptationMMFCtx*)bCtx;
+    DEBUG_API("->XAMediaRecorderAdapt_PostInit");
+    if(pSelf->mmfContext)
+        {
+        tempUri = (XADataLocator_URI*)(pSelf->xaSink->pLocator);
+        tempFormat = (XADataFormat_MIME*)(pSelf->xaSink->pFormat);
+        mmf_set_recorder_uri(pSelf->mmfContext, (char *)(tempUri->URI), tempFormat->containerType);  
+        mmf_set_adapt_context(pSelf->mmfContext, &(pSelf->baseObj));
+        }
+
+    DEBUG_API("<-XAMediaRecorderAdapt_PostInit");
+    return ret;
+    }
+
+/*
+ * void XAMediaRecorderAdaptMMF_Destroy( XAAdaptationBaseMMFCtx* bCtx )
+ * Destroys Media Recorder Adaptation Context
+ * @param ctx - Media Recorder Adaptation context to be destroyed
+ */
+void XAMediaRecorderAdaptMMF_Destroy(XAAdaptationBaseMMFCtx* bCtx)
+    {
+    XAMediaRecorderAdaptationMMFCtx* ctx = NULL;
+    
+    DEBUG_API("->XAMediaRecorderAdaptMMF_Destroy");
+
+    if (bCtx == NULL)
+    {
+        DEBUG_ERR("Invalid parameter!!");DEBUG_API("<-XAMediaRecorderAdaptMMF_Destroy");
+        return;
+    }
+    ctx = (XAMediaRecorderAdaptationMMFCtx*) bCtx;
+
+    if(ctx->mmfContext)
+        {
+        mmf_close(ctx->mmfContext);
+        }
+    XAAdaptationBaseMMF_Free(bCtx);
+
+    free(ctx);
+    ctx = NULL;
+
+    DEBUG_API("<-XAMediaRecorderAdaptMMF_Destroy");
+    }
+
+/***************** INTERNAL FUNCTIONS *******************************/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xamediarecorderadaptctxmmf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAMEDIARECORDERADAPTCTXMMF_H_
+#define XAMEDIARECORDERADAPTCTXMMF_H_
+
+#include "xaadaptationcontextbasemmf.h"
+
+
+/* TYPEDEFS */
+#define XA_RECMODE_STREAM 1
+#define XA_RECMODE_STILL 2
+
+typedef struct XAMediaRecorderAdaptationMMFCtx_ XAMediaRecorderAdaptationMMFCtx;
+
+/* FUNCTIONS */
+XAAdaptationBaseMMFCtx* XAMediaRecorderAdaptMMF_Create(  XADataSource* pAudioSrc, XADataSource* pImageVideoSrc, XADataSink* pDataSnk, XAuint8 recModes );
+XAresult XAMediaRecorderAdaptMMF_PostInit( XAAdaptationBaseMMFCtx* bCtx );
+void XAMediaRecorderAdaptMMF_Destroy( XAAdaptationBaseMMFCtx* bCtx );
+
+
+#endif /* XAMEDIARECORDERADAPTCTXMMF_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xangavideosink.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,160 @@
+/*
+* 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: 
+*
+*/
+/*
+Media Helper Class for handling surface events
+
+Shy Ward
+*/
+
+#include "XANGAVideoSink.h"
+#include "openmaxalwrapper.h"
+
+
+CNgaVideoSink* CNgaVideoSink::NewL()
+{
+	CNgaVideoSink* self = new CNgaVideoSink();
+	self->ConstructL();
+	return self;
+}
+
+CNgaVideoSink::~CNgaVideoSink()
+{
+	iMediaClientVideoDisplay->RemoveDisplayWindow(*m_pWindow);
+	delete iMediaClientVideoDisplay;
+  if(IsActive())
+  {
+     Cancel();
+  }	
+}
+    
+CNgaVideoSink::CNgaVideoSink()
+                  :CActive(EPriorityStandard)
+{
+	iMediaClientVideoDisplay = NULL;
+  CActiveScheduler::Add(this);
+  m_ThreadHandle.Duplicate(RThread());
+  m_MediaHelperInitialized = EInitializedReady;
+  m_rotation = EVideoRotationNone;
+  m_scaleWidth = (100.0f);
+  m_scaleHeight = (100.0f);
+  m_horizPos = (EHorizontalAlignCenter);
+  m_vertPos = (EVerticalAlignCenter);      
+}
+
+void CNgaVideoSink::RunL()
+{
+	  iMediaClientVideoDisplay->SurfaceCreated(m_surfaceId,m_cropRect,m_pixelAspectRatio,m_cropRegion);	
+}
+
+void CNgaVideoSink::Activate()
+{
+    if(!IsActive())
+    {
+        iStatus = KRequestPending;
+        SetActive();
+    }
+}
+
+void CNgaVideoSink::DoCancel()
+{
+      if(iStatus.Int() == KRequestPending)
+      {
+          TRequestStatus* pStatus = &iStatus;
+          m_ThreadHandle.RequestComplete(pStatus, KErrCancel);
+    }
+}
+
+void CNgaVideoSink::CompleteRequest(TInt status)
+{
+    // Checking for IsActive alone results in this block getting executed 
+    // from other thread more thanone time. Hence the chk for iStatus
+    if(IsActive() && iStatus == KRequestPending)
+    {
+        TRequestStatus* pStatus = &iStatus;
+        m_ThreadHandle.RequestComplete(pStatus, status);
+    }
+}
+
+void CNgaVideoSink::SurfaceCreated(int surfaceid0,int surfaceid1,int surfaceid2,int surfaceid3,int crop_rect_tl_x,
+                     									 int crop_rect_tl_y,int crop_rect_br_x,int crop_rect_br_y,int aspect_ratio_num,int aspect_ratio_denom)
+{
+   
+   m_surfaceId.iInternal[0] = surfaceid0;
+   m_surfaceId.iInternal[1] = surfaceid1;
+   m_surfaceId.iInternal[2] = surfaceid2;
+   m_surfaceId.iInternal[3] = surfaceid3;
+   m_cropRect.iTl.iX = crop_rect_tl_x;
+   m_cropRect.iTl.iY = crop_rect_tl_y;
+   m_cropRect.iBr.iX = crop_rect_br_x;
+   m_cropRect.iBr.iY = crop_rect_br_y;
+   m_pixelAspectRatio.iNumerator = aspect_ratio_num;
+   m_pixelAspectRatio.iDenominator = aspect_ratio_denom;  
+   
+   Activate();
+   CompleteRequest(KErrNone);
+   	
+}
+
+void CNgaVideoSink::ConstructL()
+{
+	iMediaClientVideoDisplay = CMediaClientVideoDisplay::NewL(0);
+	Activate();
+} 
+
+void CNgaVideoSink::SetNativeDisplayInformation(void* display_info)
+{
+	//display_info is of type XADataSink
+	//display_info.pLocator is of type XADataLocator_NativeDisplay
+	XADataLocator_NativeDisplay* nativeDisplay;
+	XADataSink* videoSink = (XADataSink*)display_info;
+	
+	nativeDisplay = (XADataLocator_NativeDisplay*) (videoSink->pLocator);
+	//TODO: scrDevice is not been passed Properly
+  // Add the display window
+  m_cropRegion = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+  m_videoExtent = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+  m_cropRect = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+  m_clipRect = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+  m_cropRegion = TRect(((RWindow*)(nativeDisplay->hWindow))->Size());
+  m_pWindow = ((RWindow*)(nativeDisplay->hWindow));
+  
+
+  iMediaClientVideoDisplay->AddDisplayWindowL(m_pWindow, m_clipRect, m_cropRegion, m_videoExtent, m_scaleWidth, m_scaleHeight,
+                                               m_rotation, EAutoScaleBestFit, m_horizPos, m_vertPos, m_pWindow);  
+
+}
+
+extern "C" {
+
+    void* nga_video_sink_init()
+    { 
+          return CNgaVideoSink::NewL();
+    }
+        
+    void surface_created(void* context,int surfaceid0,int surfaceid1,int surfaceid2,int surfaceid3,int crop_rect_tl_x,
+                         									int crop_rect_tl_y,int crop_rect_br_x,int crop_rect_br_y,int aspect_ratio_num,int aspect_ratio_denom)
+    {
+            ((CNgaVideoSink*)(context))->SurfaceCreated(surfaceid0,surfaceid1,surfaceid2,surfaceid3,crop_rect_tl_x,
+                         									                  crop_rect_tl_y,crop_rect_br_x,crop_rect_br_y,aspect_ratio_num,aspect_ratio_denom);
+    }
+        
+    void  setup_native_display(void* context, void* display_info)
+    {
+            ((CNgaVideoSink*)(context))->SetNativeDisplayInformation(display_info);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xangavideosink.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,100 @@
+/*
+* 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: 
+*
+*/
+/*
+Media Helper Class for handling surface events
+
+Shy Ward
+*/
+
+#ifndef XA_CNGAVIDEOSINK_H
+#define XA_CNGAVIDEOSINK_H
+
+#define ENABLE_GRAPHICS_SURFACE_INTEGRATION
+
+
+#ifdef __cplusplus
+
+#include <e32base.h>
+#ifdef ENABLE_GRAPHICS_SURFACE_INTEGRATION
+#include <graphics/surface.h> //TSurfaceId
+#include <mmf/common/mmfvideo.h> //TVideoAspectRatio
+#include <mediaclientvideodisplay.h>
+#endif
+
+class CNgaVideoSink : public CBase,
+                      public CActive
+    {
+public:
+
+    static CNgaVideoSink* NewL();
+    ~CNgaVideoSink();
+    void SurfaceCreated(int surfaceid0,int surfaceid1,int surfaceid2,int surfaceid3,int crop_rect_tl_x,
+         							 int crop_rect_tl_y,int crop_rect_br_x,int crop_rect_br_y,int aspect_ratio_num,int aspect_ratio_denom);    
+    void SetNativeDisplayInformation(void* display_info);
+    
+    // CActive methods
+    virtual void RunL();
+    virtual void DoCancel();
+    void Activate();
+
+    void CompleteRequest(TInt status = KErrNone);    
+    
+private:
+    CNgaVideoSink();
+    void ConstructL();
+    
+    RThread     m_ThreadHandle;
+    
+    enum InitializeState
+    {
+        EInitializedReady = 0,
+        EInitializedSuccess,
+        EInitializedFailed,
+    };
+    
+#ifdef ENABLE_GRAPHICS_SURFACE_INTEGRATION
+    CMediaClientVideoDisplay* iMediaClientVideoDisplay;
+    TSurfaceId surfaceId;
+    TRect m_clipRect;
+    TRect m_videoExtent;    
+    TRect m_cropRegion;
+    TVideoAspectRatio m_pixelAspectRatio;
+    RWindow* m_pWindow;
+    TRect m_cropRect;
+    TSurfaceId m_surfaceId;
+    InitializeState     m_MediaHelperInitialized;    
+    TVideoRotation m_rotation;
+    TReal32 m_scaleWidth;
+    TReal32 m_scaleHeight;
+    TInt m_horizPos;
+    TInt m_vertPos;    
+
+#endif /*ENABLE_GRAPHICS_SURFACE_INTEGRATION*/    
+    };
+#else  /* __cplusplus */
+
+
+extern void* nga_video_sink_init();
+
+extern void  surface_created(void* context,int surfaceid0,int surfaceid1,int surfaceid2,int surfaceid3,int crop_rect_tl_x,
+                     									int crop_rect_tl_y,int crop_rect_br_x,int crop_rect_br_y,int aspect_ratio_num,int aspect_ratio_denom);
+extern void  setup_native_display(void* context, void* display_info);
+
+
+#endif /* __cplusplus */
+
+#endif /* XA_CNGAVIDEOSINK_H */
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaplayitfadaptationmmf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,143 @@
+/*
+* 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 "unistd.h"
+#include "xamediaplayeradaptctxmmf.h"
+#include "xaplayitfadaptationmmf.h"
+#include "xaadaptationmmf.h"
+#include "cmmfbackendengine.h"
+#include <glib.h>
+
+extern XAboolean cameraRealized;
+
+/*forward declaration of position updater callback*/
+gboolean XAPlayItfAdapt_PositionUpdate(gpointer ctx);
+
+/*
+ * XAresult XAPlayItfAdapt_SetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 state)
+ * Sets play state to GStreamer.
+ * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID
+ * XAuint32 state - Play state to be set
+ * @return XAresult ret - Success value
+ */
+XAresult XAPlayItfAdaptMMF_SetPlayState(XAAdaptationBaseMMFCtx *bCtx, XAuint32 state)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    
+    XAMediaPlayerAdaptationMMFCtx* mCtx = NULL;
+
+
+    
+    DEBUG_API_A1("->XAPlayItfAdapt_SetPlayState %s",PLAYSTATENAME(state));
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
+    switch ( state )
+    {
+        case XA_PLAYSTATE_STOPPED:
+        {
+            mmf_stop_playback(mCtx->mmfContext);
+            mmf_close(mCtx->mmfContext);
+            break;
+        }
+        case XA_PLAYSTATE_PAUSED:
+            mmf_pause_playback(mCtx->mmfContext);
+            break;
+        case XA_PLAYSTATE_PLAYING:
+        {
+            mmf_resume_playback(mCtx->mmfContext);
+            break;
+        }
+        default:
+            ret = XA_RESULT_PARAMETER_INVALID;
+            break;
+    }
+
+   DEBUG_API("<-XAPlayItfAdapt_SetPlayState");
+    return ret;
+}
+
+/*
+ * XAresult XAPlayItfAdapt_GetDuration(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec)
+ * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID
+ * XAmillisecond *pMsec - Pointer where to store duration of stream.
+ * @return XAresult ret - Success value
+ */
+XAresult XAPlayItfAdaptMMF_GetDuration(XAAdaptationBaseMMFCtx *bCtx, XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAPlayItfAdapt_GetDuration");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+
+    DEBUG_API("<-XAPlayItfAdapt_GetDuration");
+    return ret;
+}
+
+/*
+ * XAresult XAPlayItfAdapt_GetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec)
+ * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID value
+ * XAmillisecond *pMsec - Pointer where to store current position in stream.
+ * @return XAresult ret - Success value
+ */
+XAresult XAPlayItfAdaptMMF_GetPosition(XAAdaptationBaseMMFCtx *bCtx, XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    
+    DEBUG_API("->XAPlayItfAdapt_GetPosition");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    
+    DEBUG_API("<-XAPlayItfAdapt_GetPosition");
+    return ret;
+}
+
+/*
+ * XAresult XAPlayItfAdapt_EnablePositionTracking
+ * Enable/disable periodic position tracking callbacks
+ */
+XAresult XAPlayItfAdaptMMF_EnablePositionTracking(XAAdaptationBaseMMFCtx *bCtx, XAboolean enable)
+{
+    DEBUG_API_A1("->XAPlayItfAdapt_EnablePositionTracking (enable: %d)", (int)enable);
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_API("<-XAPlayItfAdapt_EnablePositionTracking");
+    return XA_RESULT_SUCCESS;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaplayitfadaptationmmf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAPLAYITFADAPTATIONMMF_H
+#define XAPLAYITFADAPTATIONMMF_H
+
+#include "xaadaptationcontextbasemmf.h"
+#include "xadebug.h"
+
+#ifdef _DEBUG
+/*parse state names for debug prints*/
+static const char* playstatenamemmf[3] =
+{
+    "XA_PLAYSTATE_STOPPED",
+    "XA_PLAYSTATE_PAUSED",
+    "XA_PLAYSTATE_PLAYING"
+};
+#define PLAYSTATENAME(i) (const char*)((i>0&&i<4)?playstatenamesmmf[i-1]:"INVALID")
+#endif /*_DEBUG*/
+
+
+/* FUNCTIONS */
+
+XAresult XAPlayItfAdaptMMF_SetPlayState(XAAdaptationBaseMMFCtx *bCtx, XAuint32 state);
+XAresult XAPlayItfAdaptMMF_GetDuration(XAAdaptationBaseMMFCtx *bCtx, XAmillisecond *pMsec);
+XAresult XAPlayItfAdaptMMF_GetPosition(XAAdaptationBaseMMFCtx *bCtx, XAmillisecond *pMsec);
+XAresult XAPlayItfAdaptMMF_EnablePositionTracking(XAAdaptationBaseMMFCtx *bCtx, XAboolean enable);
+
+
+#endif /* XAPLAYITFADAPTATIONMMF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xarecorditfadaptationmmf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,232 @@
+/*
+* 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 "xamediarecorderadaptctxmmf.h"
+#include "xarecorditfadaptationmmf.h"
+#include "cmmfbackendengine.h"
+#include "xaadaptationmmf.h"
+
+/*
+ * XAresult XARecordItfAdaptMMF_SetRecordState(XAAdaptationBaseMMFCtx *ctx, XAuint32 state)
+ * Sets record state to GStreamer.
+ * @param XAAdaptationBaseCtx *ctx - Adaptation context
+ * XAuint32 state - Record state to be set
+ * @return XAresult ret - Success value
+ */
+XAresult XARecordItfAdaptMMF_SetRecordState(XAAdaptationBaseMMFCtx *bCtx, XAuint32 state)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    int mmfretCode;
+    XAAdaptEventMMF stalledevent = {XA_RECORDITFEVENTS, XA_RECORDEVENT_HEADSTALLED, 0, NULL};
+    XAMediaRecorderAdaptationMMFCtx* mCtx = NULL;
+    DEBUG_API_A1("->XARecordItfAdaptMMF_SetRecordState %s",RECORDSTATENAME(state));
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfAdaptMMF_SetRecordState");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XAMediaRecorderAdaptationMMFCtx*) bCtx;
+
+    mCtx->isRecord = XA_BOOLEAN_TRUE;
+
+    switch ( state )
+    {
+        case XA_RECORDSTATE_STOPPED:
+        {
+            mmfretCode= mmf_stop_recording(mCtx->mmfContext, TRUE);
+            if(mmfretCode != XA_RESULT_SUCCESS)
+                {
+                ret = XA_RESULT_PARAMETER_INVALID;
+                }
+            break;
+        }
+        case XA_RECORDSTATE_PAUSED:
+        {
+            mmfretCode = mmf_stop_recording(mCtx->mmfContext,FALSE);
+            if(mmfretCode != XA_RESULT_SUCCESS)
+                {
+                ret = XA_RESULT_PARAMETER_INVALID;
+                }
+            else
+                {
+                XAAdaptationBaseMMF_SendAdaptEvents(bCtx, &stalledevent );
+                }
+            break;
+        }
+        case XA_RECORDSTATE_RECORDING:
+        {
+            mmfretCode = mmf_start_recording(mCtx->mmfContext);
+            if(mmfretCode != XA_RESULT_SUCCESS)
+                {
+                ret = XA_RESULT_PARAMETER_INVALID;
+                }
+            break;
+        }
+        default:
+            DEBUG_ERR("Unhandled state");
+            ret = XA_RESULT_PARAMETER_INVALID;
+            break;
+    }
+
+    if( ret == XA_RESULT_SUCCESS )
+    {
+        mCtx->xaRecordState = state;
+    }
+
+
+    DEBUG_API("<-XARecordItfAdaptMMF_SetRecordState %d");
+    return ret;
+}
+
+/*
+ * XAresult XARecordItfAdapt_GetRecordState(XAAdaptationBaseCtx *bCtx, XAuint32 *state)
+ * Description: Return record state
+ */
+XAresult XARecordItfAdaptMMF_GetRecordState(XAAdaptationBaseMMFCtx *bCtx, XAuint32 *state)
+{
+    XAMediaRecorderAdaptationMMFCtx* mCtx = NULL;
+    DEBUG_API("->XARecordItfAdaptMMF_GetRecordState");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfAdaptMMF_GetRecordState");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XAMediaRecorderAdaptationMMFCtx*) bCtx;
+
+    *state = mCtx->xaRecordState;
+
+    DEBUG_API("<-XARecordItfAdaptMMF_GetRecordState");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XARecordItfAdapt_GetPosition(XAAdaptationBaseCtx *ctx, AdaptationContextIDS ctxIDs, XAmillisecond *pMsec)
+ * @param XAAdaptationBaseCtx *ctx - Adaptation context, this will be casted to correct type regarding to contextID value given as 2nd parameter
+ * XAmillisecond *pMsec - Pointer where to store current position in stream.
+ * @return XAresult ret - Success value
+ */
+XAresult XARecordItfAdaptMMF_GetPosition(XAAdaptationBaseMMFCtx *bCtx, XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint64 position;
+    XAMediaRecorderAdaptationMMFCtx* mCtx = NULL;
+    DEBUG_API("->XARecordItfAdaptMMF_GetPosition");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfAdaptMMF_GetPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    mCtx = (XAMediaRecorderAdaptationMMFCtx*) bCtx;
+    mmf_get_record_position(mCtx->mmfContext, &position);
+    
+    *pMsec =  (XAmillisecond)position;
+    
+    DEBUG_API("<-XARecordItfAdaptMMF_GetPosition");
+    return ret;
+}
+
+/*
+ * gboolean XARecordItfAdapt_PositionUpdate(gpointer ctx)
+ * callback.
+ * If position tracking enabled, periodic timer calls this method every XA_ADAPT_PU_INTERVAL msecs
+ * @return false to stop periodic calls
+ */
+gboolean XARecordItfAdaptMMF_PositionUpdate(gpointer ctx, XAuint64 position)
+{
+    XAAdaptationBaseMMFCtx *bCtx = (XAAdaptationBaseMMFCtx*) ctx;
+    XAMediaRecorderAdaptationMMFCtx* mCtx = (XAMediaRecorderAdaptationMMFCtx*) ctx;
+    XAAdaptEventMMF event = {XA_RECORDITFEVENTS, XA_ADAPT_POSITION_UPDATE_EVT, 1, NULL};
+    DEBUG_API("->XARecordItfAdapt_PositionUpdate");
+
+    if( mCtx && mCtx->trackpositionenabled )
+    {
+        XAmillisecond posInMsec = 0;
+        {
+            XARecordItfAdaptMMF_GetPosition(bCtx , &posInMsec);
+            event.data = &posInMsec;
+            DEBUG_API_A1("XARecordItfAdapt_PositionUpdate: pos %lu ms", posInMsec);
+            XAAdaptationBaseMMF_SendAdaptEvents(bCtx, &event );
+        }
+    DEBUG_API_A1("<-XARecordItfAdapt_PositionUpdate: %d", mCtx->runpositiontimer);
+    return( mCtx->runpositiontimer );
+    }
+    /* return false to stop timer */
+    return FALSE;
+}
+
+/*
+ * XAresult XARecordItfAdapt_EnablePositionTracking
+ * Enable/disable periodic position tracking callbacks
+ */
+XAresult XARecordItfAdaptMMF_EnablePositionTracking(XAAdaptationBaseMMFCtx *bCtx, XAboolean enable)
+{
+    XAMediaRecorderAdaptationMMFCtx* mCtx = (XAMediaRecorderAdaptationMMFCtx*) bCtx;
+    DEBUG_API_A1("->XARecordItfAdapt_EnablePositionTracking (enable: %lu)", enable);
+
+    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptationMMF)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfAdapt_EnablePositionTracking");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+
+    /* create a timer to track position of playback */
+    if(enable && !(mCtx->trackpositionenabled))
+    {
+        mCtx->trackpositionenabled = XA_BOOLEAN_TRUE;
+        //mCtx->positionCb = &XARecordItfAdaptMMF_PositionUpdate;
+
+    }
+    else if (!enable && (mCtx->trackpositionenabled))
+    {
+        mCtx->trackpositionenabled = XA_BOOLEAN_FALSE;
+        if(mCtx->runpositiontimer > 0)
+        {
+            mCtx->runpositiontimer=0;
+        }
+    }
+
+    DEBUG_API("<-XARecordItfAdapt_EnablePositionTracking");
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XARecordItfAdaptMMF_SetPositionUpdatePeriod(XAAdaptationBaseMMFCtx *bCtx, XAmillisecond pMsec)
+    {
+    XAMediaRecorderAdaptationMMFCtx* mCtx = (XAMediaRecorderAdaptationMMFCtx*) bCtx;
+    DEBUG_API_A1("->XARecordItfAdaptMMF_SetPositionUpdatePeriod (pMsec: %lu)", pMsec);
+
+    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptationMMF)
+        {
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("<-XARecordItfAdapt_EnablePositionTracking");
+            /* invalid parameter */
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+        
+    mmf_set_record_position_update_period(mCtx->mmfContext, pMsec);
+    return XA_RESULT_SUCCESS;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xarecorditfadaptationmmf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XARECORDITFADAPTATIONMMF_H
+#define XARECORDITFADAPTATIONMMF_H
+
+#include "xaadaptationcontextbasemmf.h"
+#include "xadebug.h"
+#include <glib.h>
+
+
+#ifdef _DEBUG
+/*parse state names for debug prints*/
+static const char* recordstatenamesmmf[3] =
+{
+    "XA_RECORDSTATE_STOPPED",
+    "XA_RECORDSTATE_PAUSED",
+    "XA_RECORDSTATE_RECORDING",
+};
+#define RECORDSTATENAME(i) ((i>0&&i<4)?recordstatenamesmmf[i-1]:"INVALID")
+#endif /*_DEBUG*/
+
+/*forward declaration of position updater callback*/
+gboolean XARecordItfAdaptMMF_PositionUpdate(gpointer ctx, XAuint64 position);
+
+
+/* FUNCTIONS */
+
+XAresult XARecordItfAdaptMMF_SetRecordState(XAAdaptationBaseMMFCtx *ctx, XAuint32 state );
+XAresult XARecordItfAdaptMMF_GetPosition( XAAdaptationBaseMMFCtx *ctx, XAmillisecond *pMsec );
+XAresult XARecordItfAdaptMMF_GetRecordState(XAAdaptationBaseMMFCtx *bCtx, XAuint32 *state);
+XAresult XARecordItfAdaptMMF_EnablePositionTracking(XAAdaptationBaseMMFCtx *ctx, XAboolean enable);
+XAresult XARecordItfAdaptMMF_SetPositionUpdatePeriod(XAAdaptationBaseMMFCtx *ctx, XAmillisecond pMsec);
+
+#endif /* XARECORDITFADAPTATIONMMF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/outputmix/xaoutputmix.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,454 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "xaoutputmix.h"
+#include "xaobjectitf.h"
+#include "xadynintmgmtitf.h"
+#include "xaconfigextensionsitf.h"
+#include "xaequalizeritf.h"
+#include "xavolumeitf.h"
+#include "xaoutputmixitf.h"
+#include "xathreadsafety.h"
+
+/* Static mapping of enumeration XAOMixInterfaces to interface iids */
+static const XAInterfaceID* xaOMixItfIIDs[OMIX_ITFCOUNT]={
+    &XA_IID_OBJECT,
+    &XA_IID_DYNAMICINTERFACEMANAGEMENT,
+    &XA_IID_CONFIGEXTENSION,
+    &XA_IID_OUTPUTMIX,
+    &XA_IID_EQUALIZER,
+    &XA_IID_VOLUME
+};
+
+/*****************************************************************************
+ * Global methods
+ *****************************************************************************/
+
+
+/*
+ *XAresult XAOMixImpl_CreateOutputMix(XAObjectItf *pMix,
+ *                                    XAuint32 numInterfaces,
+ *                                   const XAInterfaceID *pInterfaceIds,
+ *                                   const XAboolean *pInterfaceRequired)
+ * Description: Create object
+ */
+XAresult XAOMixImpl_CreateOutputMix(XAObjectItf *pMix,
+                                    XAuint32 numInterfaces,
+                                    const XAInterfaceID *pInterfaceIds,
+                                    const XAboolean *pInterfaceRequired)
+{
+
+    XAObjectItfImpl* pBaseObj = NULL;
+    XAOMixImpl* pImpl = NULL;
+    XAuint32 itfIdx = 0;
+    DEBUG_API("->XAOMixImpl_CreateOutputMix");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSOutputMix);
+    if(!pMix)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAOMixImpl_CreateOutputMix");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* instantiate object */
+    pImpl = (XAOMixImpl*)calloc(1,sizeof(XAOMixImpl));
+    if(!pImpl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+        /* memory allocation failed */
+        DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+        DEBUG_API("<-XAOMixImpl_CreateOutputMix");
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+    pBaseObj = &pImpl->baseObj;
+
+    XAObjectItfImpl_Init(pBaseObj,
+                         OMIX_ITFCOUNT,
+                         xaOMixItfIIDs,
+                         XAOMixImpl_DoRealize,
+                         XAOMixImpl_DoResume,
+                         XAOMixImpl_FreeResources );
+
+    /* Mark interfaces that need to be exposed */
+    /* Implicit and mandated interfaces */
+    pBaseObj->interfaceMap[OMIX_OUTPUTMIXITF].required = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[OMIX_DIMITF].required = XA_BOOLEAN_TRUE;
+
+    /* Explicit interfaces */
+    if((numInterfaces != 0) && pInterfaceIds && pInterfaceRequired)
+    {
+        /* Check required interfaces */
+        for(itfIdx = 0; itfIdx < numInterfaces; itfIdx++)
+        {
+            /* If mapEntry is null then required interface is not supported.*/
+            XAObjItfMapEntry *entry =
+                XAObjectItfImpl_GetItfEntry((XAObjectItf)&(pBaseObj), pInterfaceIds[itfIdx]);
+            if( !entry  )
+            {
+                if( pInterfaceRequired[itfIdx] )
+                {
+                    /* required interface cannot be accommodated - fail creation */
+                    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+                    XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+                    DEBUG_ERR("Required interface not found - abort creation!");
+                    return XA_RESULT_FEATURE_UNSUPPORTED;
+                }
+                else
+                {
+                    DEBUG_INFO("Requested (not required) interface not found - continue creation");
+                }
+            }
+            else
+            {
+                entry->required = XA_BOOLEAN_TRUE;
+            }
+        }
+    }
+    /* Mark interfaces that can be handled dynamically */
+    pBaseObj->interfaceMap[OMIX_EQUALIZERITF].isDynamic = XA_BOOLEAN_TRUE;
+#ifdef _GSTREAMER_BACKEND_
+    /* Create outputmix adaptation context */
+    pImpl->adaptationCtx = XAOutputMixAdapt_Create();
+#endif 
+    
+    /* This code is put here to return Feature Not Supported since adaptation is not present*/
+    /*************************************************/
+    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+    DEBUG_ERR("Required interface not found - abort creation!");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+    /*************************************************/
+    
+    /* Set ObjectItf to point to newly created object */
+/*
+    *pMix = (XAObjectItf)&(pBaseObj->self);
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+   
+    DEBUG_API("<-XAOMixImpl_CreateOutputMix");
+    return XA_RESULT_SUCCESS;
+*/
+}
+
+/*
+ * XAresult XAOMixImpl_QueryNumSupportedInterfaces(XAuint32 * pNumSupportedInterfaces)
+ * Description: Query number of supported interfaces
+ */
+XAresult XAOMixImpl_QueryNumSupportedInterfaces(XAuint32 * pNumSupportedInterfaces)
+{
+    DEBUG_API("->XAOMixImpl_QueryNumSupportedInterfaces");
+    if( pNumSupportedInterfaces )
+    {
+        *pNumSupportedInterfaces = OMIX_ITFCOUNT;
+        DEBUG_API_A1("<-XAOMixImpl_QueryNumSupportedInterfaces - %lu", *pNumSupportedInterfaces );
+        return XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAOMixImpl_QueryNumSupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+}
+
+/*
+ * XAresult XAOMixImpl_QuerySupportedInterfaces(XAuint32 index, XAInterfaceID * pInterfaceId)
+ * Description: Statically query supported interfaces
+ */
+XAresult XAOMixImpl_QuerySupportedInterfaces(XAuint32 index,
+                                             XAInterfaceID * pInterfaceId)
+{
+    DEBUG_API("->XAOMixImpl_QuerySupportedInterfaces");
+    if (index >= OMIX_ITFCOUNT || !pInterfaceId)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAOMixImpl_QuerySupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+#ifdef _GSTREAMER_BACKEND_
+        *pInterfaceId = *(xaOMixItfIIDs[index]);
+#endif
+        DEBUG_API("<-XAOMixImpl_QuerySupportedInterfaces");
+        return XA_RESULT_SUCCESS;
+    }
+}
+
+/*****************************************************************************
+ * base object XAObjectItfImpl methods
+ *****************************************************************************/
+
+/* XAresult XAOMixImpl_DoRealize(XAObjectItf self)
+ * Description: Realize all implicit and explicitly wanted interfaces.
+ * Create and initialize implementation-specific variables.
+ * Called from base object XAObjectItfImpl
+ */
+XAresult XAOMixImpl_DoRealize(XAObjectItf self)
+{
+#ifdef _GSTREAMER_BACKEND_
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAOMixImpl_DoRealize");
+    XAOMixImpl* pMixImpl = (XAOMixImpl*)(pObj);
+    XAuint8 itfIdx = 0;
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSOutputMix);
+
+    /* check casting from correct pointer type */
+    if( !pMixImpl || pObj != pMixImpl->baseObj.self )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAOMixImpl_DoRealize");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* Initialize adaptation */
+    ret = XAOutputMixAdapt_PostInit( pMixImpl->adaptationCtx );
+    if( ret != XA_RESULT_SUCCESS )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+        DEBUG_API("<-XAOMixImpl_DoRealize");
+        return ret;
+    }
+
+    /* Realize all implicit and explicitly wanted interfaces */
+    for( itfIdx = 0; itfIdx < OMIX_ITFCOUNT; itfIdx++)
+    {
+        if( !(pObj->interfaceMap[itfIdx].pItf) && pObj->interfaceMap[itfIdx].required )
+        {
+            void *pItf = NULL;
+            switch( itfIdx )
+            {
+                case OMIX_CONFIGEXTENSIONITF:
+                    pItf = XAConfigExtensionsItfImpl_Create();
+                    break;
+                case OMIX_DIMITF:
+                    pItf = XADIMItfImpl_Create();
+                    if(pItf)
+                    {
+                        XADIMItfImpl_Init(pItf, self,
+                                          XAOMixImpl_DoAddItf,
+                                          XAOMixImpl_DoResumeItf,
+                                          XAOMixImpl_DoRemoveItf);
+                    }
+                    break;
+                  case OMIX_EQUALIZERITF:
+                      pItf = XAEqualizerItfImpl_Create(pMixImpl->adaptationCtx);
+                      break;
+                  case OMIX_VOLUMEITF:
+                      pItf = XAVolumeItfImpl_Create(pMixImpl->adaptationCtx);
+                      break;
+                  case OMIX_OUTPUTMIXITF:
+                      pItf = XAOutputMixItfImpl_Create(pMixImpl->adaptationCtx);
+                      break;
+                  default:
+                      break;
+            }
+            if( !pItf )
+            {
+                XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+                DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+                /* memory allocation failed */
+                DEBUG_API("<-XAOMixImpl_DoRealize");
+                return XA_RESULT_MEMORY_FAILURE;
+            }
+            else
+            {
+                pObj->interfaceMap[itfIdx].pItf = pItf;
+            }
+        }
+    }
+
+    pObj->state = XA_OBJECT_STATE_REALIZED;
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+#endif    
+    DEBUG_API("<-XAOMixImpl_DoRealize");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAOMixImpl_DoResume(XAObjectItf self)
+ * Description: Resume object from suspended state
+ */
+XAresult XAOMixImpl_DoResume(XAObjectItf self)
+{
+    DEBUG_API("->XAOMixImpl_DoResume");
+    DEBUG_API("<-XAOMixImpl_DoResume");
+    /* This implementation does not support suspended state */
+    return XA_RESULT_PRECONDITIONS_VIOLATED;
+}
+
+/*
+ * void XAOMixImpl_FreeResources(XAObjectItf self)
+ * Description: Free all resources reserved at XACameraDeviceImpl_DoRealize()
+ */
+void XAOMixImpl_FreeResources(XAObjectItf self)
+{
+#ifdef _GSTREAMER_BACKEND_
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAOMixImpl* pImpl = (XAOMixImpl*)(*self);
+    XAuint8 itfIdx = 0;
+    DEBUG_API("->XAOMixImpl_FreeResources");
+    XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS(XATSOutputMix);
+    assert( pObj && pImpl && pObj == pObj->self );
+
+    if ( pImpl->adaptationCtx != NULL )
+    {
+        XAOutputMixAdapt_Destroy( pImpl->adaptationCtx );
+        pImpl->adaptationCtx = NULL;
+    }
+
+    /* free all allocated interfaces */
+    for(itfIdx = 0; itfIdx < OMIX_ITFCOUNT; itfIdx++)
+    {
+        void *pItf = pObj->interfaceMap[itfIdx].pItf;
+        if(pItf)
+        {
+            switch(itfIdx)
+            {
+               case OMIX_CONFIGEXTENSIONITF:
+                   XAConfigExtensionsItfImpl_Free( pItf );
+                   break;
+               case OMIX_DIMITF:
+                    XADIMItfImpl_Free( pItf );
+                    break;
+               case OMIX_EQUALIZERITF:
+                   XAEqualizerItfImpl_Free(pItf);
+                   break;
+               case OMIX_VOLUMEITF:
+                   XAVolumeItfImpl_Free(pItf);
+                   break;
+               case OMIX_OUTPUTMIXITF:
+                   XAOutputMixItfImpl_Free( pItf );
+                   break;
+               default:
+                   break;
+             }
+             pObj->interfaceMap[itfIdx].pItf = NULL;
+         }
+     }
+
+    if ( pImpl->adaptationCtx != NULL )
+    {
+        XAOutputMixAdapt_Destroy( pImpl->adaptationCtx );
+        pImpl->adaptationCtx = NULL;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS(XATSOutputMix);
+#endif    
+    DEBUG_API("<-XAOMixImpl_FreeResources");
+}
+
+/*****************************************************************************
+ * MediaRecorderImpl -specific methods
+ *****************************************************************************/
+
+/* XAOMixImpl_DoAddItf
+ * Dynamically add an interface, object specific parts
+ */
+XAresult XAOMixImpl_DoAddItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  )
+{
+#ifdef _GSTREAMER_BACKEND_
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAOMixImpl* pImpl = (XAOMixImpl*)(pObj);
+#endif
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAOMixImpl_DoAddItf");
+    if(mapEntry)
+    {
+        switch( mapEntry->mapIdx )
+        {
+        case OMIX_EQUALIZERITF:
+#ifdef _GSTREAMER_BACKEND_
+            mapEntry->pItf = XAEqualizerItfImpl_Create( pImpl->adaptationCtx );
+#endif
+            break;
+        default:
+            DEBUG_ERR("XAOMixImpl_DoAddItf unknown id");
+            ret = XA_RESULT_FEATURE_UNSUPPORTED;
+            break;
+        }
+        if( !mapEntry->pItf && ret == XA_RESULT_SUCCESS)
+        {
+            DEBUG_ERR("XAOMixImpl_DoAddItf itf creation failed");
+            ret = XA_RESULT_MEMORY_FAILURE;
+        }
+    }
+    else
+    {
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+
+
+    DEBUG_API("<-XAOMixImpl_DoAddItf");
+    return ret;
+}
+
+/* XAOMixImpl_DoResumeItf
+ * Try to resume lost interface, object specific parts
+ */
+XAresult XAOMixImpl_DoResumeItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAOMixImpl_DoResumeItf");
+    /* For now, no difference between suspended and unrealised itfs */
+    ret = XAOMixImpl_DoAddItf(self,mapEntry);
+    DEBUG_API("<-XAOMixImpl_DoResumeItf");
+    return ret;
+}
+
+/* XAOMixImpl_DoRemoveItf
+ * Dynamically remove an interface, object specific parts
+ */
+XAresult XAOMixImpl_DoRemoveItf(XAObjectItf self, XAObjItfMapEntry *mapEntry )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAOMixImpl_DoRemoveItf");
+
+    if(mapEntry)
+    {
+        switch( mapEntry->mapIdx )
+        {
+        case OMIX_EQUALIZERITF:
+            XAEqualizerItfImpl_Free( mapEntry->pItf );
+            break;
+        default:
+            DEBUG_ERR("XAOMixImpl_DoRemoveItf unknown id");
+            ret = XA_RESULT_FEATURE_UNSUPPORTED;
+            break;
+        }
+        mapEntry->pItf = NULL;
+    }
+    else
+    {
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_API("<-XAOMixImpl_DoRemoveItf");
+    return ret;
+}
+
+/*END OF FILE*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/outputmix/xaoutputmix.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,73 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAOUTPUTMIX_H
+#define XAOUTPUTMIX_H
+
+#include "openmaxalwrapper.h"
+#include "xaobjectitf.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "../adaptation/XAOutputMixAdaptCtx.h"
+#endif
+/** MACROS **/
+
+
+/** TYPES **/
+
+
+/** ENUMERATIONS **/
+/* Enumeration for interfaces that OutputMix supports.  */
+typedef enum
+{
+    OMIX_OBJECTITF,
+    OMIX_DIMITF,
+    OMIX_CONFIGEXTENSIONITF,
+    OMIX_OUTPUTMIXITF,
+    OMIX_EQUALIZERITF,
+    OMIX_VOLUMEITF,
+    OMIX_ITFCOUNT
+} XAOMixInterfaces;
+
+
+/** STRUCTURES **/
+/* Specification for  MediaPlayerImpl.*/
+typedef struct XAOMixImpl_
+{
+    /* Parent for XAMediaPlayerImpl */
+    XAObjectItfImpl baseObj;
+
+#ifdef _GSTREAMER_BACKEND_
+    /* variables */
+    XAAdaptationBaseCtx* adaptationCtx;
+#endif
+} XAOMixImpl;
+
+
+/** METHODS **/
+
+/* base object XAObjectItfImpl methods */
+XAresult XAOMixImpl_DoRealize(XAObjectItf self);
+XAresult XAOMixImpl_DoResume(XAObjectItf self);
+void XAOMixImpl_FreeResources(XAObjectItf self);
+
+/* XAOMixImpl -specific methods*/
+XAresult XAOMixImpl_DoAddItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  );
+XAresult XAOMixImpl_DoResumeItf(XAObjectItf self, XAObjItfMapEntry *mapEntry  );
+XAresult XAOMixImpl_DoRemoveItf(XAObjectItf self, XAObjItfMapEntry *mapEntry );
+
+#endif /* XAOUTPUTMIX_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/outputmix/xaoutputmixitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,226 @@
+/*
+* 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 "xaoutputmixitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAOutputMixItfAdaptation.h"
+#endif
+#include <assert.h>
+#include "xathreadsafety.h"
+#include "e32def.h"
+/**
+ * XAOutputMixtfImpl* GetImpl(XAOutputMixtfImpl self)
+ * Description: Validated interface pointer and cast it to implementations pointer.
+ **/
+static XAOutputMixItfImpl* GetImpl(XAOutputMixItf self)
+{
+    if(self)
+    {
+        XAOutputMixItfImpl* impl = (XAOutputMixItfImpl*)(*self);
+        if(impl && impl == impl->self)
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAOutputMixtf implementation
+ */
+
+/*
+ * XAresult XAOutputMixItfImpl_GetDestinationOutputDeviceIDs( XAOutputMixItf self,
+ *                                                          XAint32 * pNumDevices,
+ *                                                          XAuint32 * pDeviceIDs )
+ * Description: Retrieves the device IDs of the destination output devices currently
+ * associated with the output mix.
+ */
+XAresult XAOutputMixItfImpl_GetDestinationOutputDeviceIDs( XAOutputMixItf self, XAint32 * pNumDevices, XAuint32 * pDeviceIDs )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAOutputMixItfImpl* impl = GetImpl(self);
+    DEBUG_API_A1("->XAOutputMixItfImpl_GetDestinationOutputDeviceIDs - pNumDevices %ld",*pNumDevices);
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSOutputMix);
+    if(!impl || !pNumDevices  )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAOutputMixItfImpl_GetDestinationOutputDeviceIDs");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs(impl->adapCtx, pNumDevices, pDeviceIDs );
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+    DEBUG_API_A1("<-XAOutputMixItfImpl_GetDestinationOutputDeviceIDs - pNumDevices %ld",*pNumDevices);
+    return ret;
+}
+
+/*
+ * XAresult XAOutputMixItfImpl_RegisterDeviceChangeCallback( XAOutputMixItf self,
+ *                                                          xaMixDeviceChangeCallback callback,
+ *                                                          void * pContext)
+ * Description: Registers a callback to notify client when there are changes to the
+ * device IDs associated with the output mix.
+ */
+XAresult XAOutputMixItfImpl_RegisterDeviceChangeCallback( XAOutputMixItf self, xaMixDeviceChangeCallback callback, void * pContext)
+{
+   XAresult ret = XA_RESULT_SUCCESS;
+   XAOutputMixItfImpl* impl = GetImpl(self);
+   DEBUG_API("->XAOutputMixItfImpl_RegisterDeviceChangeCallback");
+   if(!impl)
+   {
+       /* invalid parameter */
+       DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+       DEBUG_API("<-XAOutputMixItfImpl_RegisterDeviceChangeCallback");
+       return XA_RESULT_PARAMETER_INVALID;
+   }
+
+   /* callback may be NULL (to remove callback) */
+   impl->callback = callback;
+   impl->cbContext = pContext;
+   impl->cbPtrToSelf = self;
+#ifdef _GSTREAMER_BACKEND_
+   if(callback)
+   {   /* start listening */
+       XAAdaptationBase_AddEventHandler( impl->adapCtx, &XAOutputMixItfImpl_AdaptCb, XA_OUTPUTMIXITFEVENTS, (void*)self );
+   }
+   else
+   {   /* stop listening */
+       XAAdaptationBase_RemoveEventHandler( impl->adapCtx, &XAOutputMixItfImpl_AdaptCb );
+   }
+#endif
+
+   DEBUG_API("<-XAOutputMixItfImpl_RegisterDeviceChangeCallback");
+   return ret;
+}
+
+/*
+ * XAresult XAOutputMixItfImpl_ReRoute( XAOutputMixItf self,
+ *                                      XAint32 numOutputDevices,
+ *                                      XAuint32 * pOutputDeviceIDs)
+ * Description: Requests a change to the specified set of output devices on an output mix.
+ */
+XAresult XAOutputMixItfImpl_ReRoute( XAOutputMixItf self, XAint32 numOutputDevices, XAuint32 * pOutputDeviceIDs)
+{
+   XAresult ret = XA_RESULT_SUCCESS;
+   XAOutputMixItfImpl* impl = GetImpl(self);
+
+   DEBUG_API("->XAOutputMixItfImpl_ReRoute");
+   XA_IMPL_THREAD_SAFETY_ENTRY(XATSOutputMix);
+
+   if(!impl || ( numOutputDevices > 0 && !pOutputDeviceIDs) )
+   {
+       /* invalid parameter */
+       XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+       DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+       DEBUG_API("<-XAOutputMixItfImpl_ReRoute");
+       return XA_RESULT_PARAMETER_INVALID;
+   }
+
+#ifdef _GSTREAMER_BACKEND_
+   ret = XAOutputMixItfAdapt_ReRoute(impl->adapCtx, numOutputDevices, pOutputDeviceIDs );
+#endif
+
+   XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+   DEBUG_API("<-XAOutputMixItfImpl_ReRoute");
+   return ret;
+
+}
+
+/**
+ * XAVolumeItfImpl -specific methods
+ **/
+#ifdef _GSTREAMER_BACKEND_
+
+/*
+ * XAOutputMixItfImpl* XAOutputMixItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
+ * Description: Creates new Output mix itf implmementation
+ */
+XAOutputMixItfImpl* XAOutputMixItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
+{
+   XAOutputMixItfImpl *self = (XAOutputMixItfImpl*)
+        calloc(1,sizeof(XAOutputMixItfImpl));
+   DEBUG_API("->XAVolumeItfImpl_Create");
+
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.GetDestinationOutputDeviceIDs = XAOutputMixItfImpl_GetDestinationOutputDeviceIDs;
+        self->itf.RegisterDeviceChangeCallback = XAOutputMixItfImpl_RegisterDeviceChangeCallback;
+        self->itf.ReRoute = XAOutputMixItfImpl_ReRoute;
+
+        /* init variables */
+        self->adapCtx = adapCtx;
+        self->callback = NULL;
+        self->cbContext = NULL;
+        self->cbPtrToSelf = NULL;
+
+        self->self = self;
+    }
+
+    DEBUG_API("<-XAVolumeItfImpl_Create");
+    return self;
+}
+
+/*
+ * void XAOutputMixItfImpl_Free(XAOutputMixItfImpl* self)
+ * Description: Frees XAOutputMixItfImpl
+ */
+void XAOutputMixItfImpl_Free(XAOutputMixItfImpl* self)
+{
+    DEBUG_API("->XAOutputMixItfImpl_Free");
+    assert(self==self->self);
+    if( self->callback )
+    {
+        XAAdaptationBase_RemoveEventHandler( self->adapCtx, &XAOutputMixItfImpl_AdaptCb );
+    }
+    free(self);
+    DEBUG_API("<-XAOutputMixItfImpl_Free");
+}
+
+
+
+/* void XAOutputMixItfImpl_AdaptCb( void *pHandlerCtx,
+ *                                  XAAdaptEvent *event )
+ * Description: Listen changes in adaptation
+ */
+void XAOutputMixItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+{
+     XAOutputMixItfImpl* impl = (XAOutputMixItfImpl*)pHandlerCtx;
+     DEBUG_API("->XAOutputMixItfImpl_AdaptCb");
+
+     if(!impl)
+     {
+        DEBUG_ERR("XAOutputMixItfImpl_AdaptCb, invalid context pointer!");
+        return;
+     }
+     assert(event);
+
+     /* send callback if needed.
+      * Check event-id to avoid sending incorrect events. */
+     if( (event->eventid==XA_ADAPT_OMIX_DEVICESET_CHANGED) && impl->callback )
+     {
+        impl->callback(impl->cbPtrToSelf, impl->cbContext);
+     }
+
+     DEBUG_API("<-XAOutputMixItfImpl_AdaptCb");
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/outputmix/xaoutputmixitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,68 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAOUTPUTMIXITF_H_
+#define XAOUTPUTMIXITF_H_
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAOutputMixItf implementation */
+typedef struct XAOutputMixItfImpl_
+{
+    /* parent interface */
+    struct XAOutputMixItf_ itf;
+    /* pointer to self */
+    struct XAOutputMixItfImpl_* self;
+
+    /* Variables */
+
+#ifdef _GSTREAMER_BACKEND_
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+    XAuint32 eventFlags;
+    xaMixDeviceChangeCallback callback;
+    void    *cbContext;
+    XAOutputMixItf cbPtrToSelf;
+
+} XAOutputMixItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAOutputMixItf implementation */
+XAresult XAOutputMixItfImpl_GetDestinationOutputDeviceIDs( XAOutputMixItf self, XAint32 * pNumDevices, XAuint32 * pDeviceIDs );
+XAresult XAOutputMixItfImpl_RegisterDeviceChangeCallback( XAOutputMixItf self, xaMixDeviceChangeCallback callback, void * pContext);
+XAresult XAOutputMixItfImpl_ReRoute( XAOutputMixItf self, XAint32 numOutputDevices, XAuint32 * pOutputDeviceIDs);
+
+#ifdef _GSTREAMER_BACKEND_
+/* XAOutputMixItfImpl -specific methods */
+XAOutputMixItfImpl* XAOutputMixItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
+void XAOutputMixItfImpl_Free(XAOutputMixItfImpl* self);
+void XAOutputMixItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
+#endif
+
+#endif /* XAOUTPUTMIXITF_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/radio/xaradiodevice.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,342 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xaradiodevice.h"
+#include "xaradioitf.h"
+#include "xaconfigextensionsitf.h"
+#include "xadynintmgmtitf.h"
+#include "xardsitf.h"
+#include "xathreadsafety.h"
+
+/* Static mapping of enumeration XARadioDeviceInterfaces to interface iids */
+static const XAInterfaceID* XARadioDeviceItfIIDs[RADIO_ITFCOUNT]=
+{
+    &XA_IID_OBJECT,
+    &XA_IID_RADIO,
+    &XA_IID_CONFIGEXTENSION,
+    &XA_IID_DYNAMICINTERFACEMANAGEMENT,
+    &XA_IID_RDS
+};
+
+/*****************************************************************************
+ * Global methods
+ *****************************************************************************/
+
+/* XAResult XARadioDeviceImpl_Create
+ * Description: Create object
+ */
+XAresult XARadioDeviceImpl_CreateRadioDevice(XAObjectItf* pDevice,
+                                             XAuint32 numInterfaces,
+                                             const XAInterfaceID * pInterfaceIds,
+                                             const XAboolean * pInterfaceRequired)
+{
+    XARadioDeviceImpl* pImpl = NULL;
+    XAObjectItfImpl* pBaseObj = NULL;
+    XAuint8 itfIndex = 0;
+
+    DEBUG_API("->XARadioDeviceImpl_Create");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+    if( !pDevice )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioDeviceImpl_CreateRadioDevice");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* instantiate object implementation */
+    pImpl = (XARadioDeviceImpl*)calloc(1,sizeof(XARadioDeviceImpl));
+    if( !pImpl )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* memory allocation failed */
+        DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+        DEBUG_API("<-XARadioDeviceImpl_CreateRadioDevice");
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+    pBaseObj = &pImpl->baseObj;
+
+    /* Initialize base object default implementation */
+    XAObjectItfImpl_Init(pBaseObj,
+                         RADIO_ITFCOUNT,
+                         XARadioDeviceItfIIDs,
+                         XARadioDeviceImpl_DoRealize,
+                         XARadioDeviceImpl_DoResume,
+                         XARadioDeviceImpl_FreeResources);
+
+    /* Mark interfaces that need to be exposed */
+    /* Implicit and mandated interfaces */
+    pBaseObj->interfaceMap[RADIO_RADIOITF].required = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[RADIO_DIMITF].required = XA_BOOLEAN_TRUE;
+
+    /* Explicit interfaces */
+    if( (numInterfaces != 0) && pInterfaceIds && pInterfaceRequired )
+    {
+        /* Check required interfaces */
+        for( itfIndex = 0; itfIndex < numInterfaces; itfIndex++ )
+        {
+            /* If mapEntry is null then required interface is not supported.*/
+            XAObjItfMapEntry *entry =
+                XAObjectItfImpl_GetItfEntry((XAObjectItf)&(pBaseObj), pInterfaceIds[itfIndex]);
+            if( !entry )
+            {
+                if( pInterfaceRequired[itfIndex] )
+                {
+                    /* required interface cannot be accommodated - fail creation */
+                    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+                    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+                    DEBUG_ERR("Required interface not found - abort creation!");
+                    DEBUG_API("<-XARadioDeviceImpl_CreateRadioDevice");
+                    return XA_RESULT_FEATURE_UNSUPPORTED;
+                }
+                else
+                {
+                    DEBUG_INFO("Requested (not required) interface not found - continue creation");
+                }
+            }
+            else
+            {
+                entry->required = XA_BOOLEAN_TRUE;
+            }
+        }
+    }
+#ifdef _GSTREAMER_BACKEND_
+    /* Initialize XARadioDeviceImpl variables */
+    pImpl->adaptationCtx = XARadioAdapt_Create();
+#endif
+    
+    /* This code is put here to return Feature Not Supported since adaptation is not present*/
+    /*************************************************/
+    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_ERR("Required interface not found - abort creation!");
+    DEBUG_API("<-XARadioDeviceImpl_CreateRadioDevice");
+    return XA_RESULT_FEATURE_UNSUPPORTED;  
+    /*************************************************/
+    
+    
+    /* Set ObjectItf to point to newly created object */
+/*    *pDevice = (XAObjectItf)&(pBaseObj->self);
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioDeviceImpl_Create");
+    return XA_RESULT_SUCCESS;*/
+}
+
+/* XAResult XARadioDeviceImpl_QueryNumSupportedInterfaces
+ * Description: Statically query number of supported interfaces
+ */
+XAresult XARadioDeviceImpl_QueryNumSupportedInterfaces( XAuint32 *pNumSupportedInterfaces )
+{
+    DEBUG_API("->XARadioDeviceImpl_QueryNumSupportedInterfaces");
+    if( pNumSupportedInterfaces )
+    {
+        *pNumSupportedInterfaces = RADIO_ITFCOUNT;
+
+        DEBUG_API_A1("<-XARadioDeviceImpl_QueryNumSupportedInterfaces - %lu", *pNumSupportedInterfaces );
+        return XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioDeviceImpl_QueryNumSupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+}
+/* XAResult XARadioDeviceImpl_QuerySupportedInterfaces
+ * Description: Statically query supported interfaces
+ */
+XAresult XARadioDeviceImpl_QuerySupportedInterfaces( XAuint32 index,
+                                                      XAInterfaceID * pInterfaceId )
+{
+    DEBUG_API("->XARadioDeviceImpl_QuerySupportedInterfaces");
+
+    if( index >= RADIO_ITFCOUNT || !pInterfaceId )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioDeviceImpl_QuerySupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        *pInterfaceId = *(XARadioDeviceItfIIDs[index]);
+
+        DEBUG_API("<-XARadioDeviceImpl_QuerySupportedInterfaces");
+        return XA_RESULT_SUCCESS;
+    }
+}
+
+
+/*****************************************************************************
+ * base object XAObjectItfImpl methods
+ *****************************************************************************/
+
+/* XAresult XARadioDeviceImpl_DoRealize( XAObjectItf self )
+ * Description: Realize all implicit and explicitly wanted interfaces.
+ * Create and initialize implementation-specific variables.
+ * Called from base object XAObjectItfImpl
+ */
+XAresult XARadioDeviceImpl_DoRealize( XAObjectItf self )
+{
+    XAuint8 itfIdx = 0;
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XARadioDeviceImpl* pObjImpl = (XARadioDeviceImpl*)(pObj);
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XARadioDeviceImpl_DoRealize");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    /* check casting from correct pointer type */
+    if( !pObjImpl || pObj != pObjImpl->baseObj.self )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioDeviceImpl_DoRealize");
+
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARadioAdapt_PostInit( pObjImpl->adaptationCtx );
+#endif
+    if( ret != XA_RESULT_SUCCESS )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_API("<-XARadioDeviceImpl_DoRealize");
+        return ret;
+    }
+
+    /* Realize all implicit and explicitly wanted interfaces */
+    for( itfIdx = 0; itfIdx < RADIO_ITFCOUNT; itfIdx++)
+    {
+        if( !(pObj->interfaceMap[itfIdx].pItf) &&
+            pObj->interfaceMap[itfIdx].required )
+        {
+            void *pItf = NULL;
+            switch( itfIdx )
+            {
+                case RADIO_RADIOITF:
+#ifdef _GSTREAMER_BACKEND_
+                    pItf = XARadioItfImpl_Create( pObjImpl->adaptationCtx );
+#endif
+                    break;
+                case RADIO_CONFIGEXTENSIONITF:
+                    pItf = XAConfigExtensionsItfImpl_Create();
+                    break;
+                case RADIO_DIMITF:
+                    pItf = XADIMItfImpl_Create();
+                    break;
+                case RADIO_RDSITF:
+#ifdef _GSTREAMER_BACKEND_
+                   pItf = XARDSItfImpl_Create( pObjImpl->adaptationCtx );
+#endif
+                   break;
+                default:
+                    break;
+            }
+            if( !pItf )
+            {
+                DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+                /* memory allocation failed */
+                DEBUG_API("<-XARadioDeviceImpl_DoRealize");
+                XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+                return XA_RESULT_MEMORY_FAILURE;
+            }
+            else
+            {
+                pObj->interfaceMap[itfIdx].pItf = pItf;
+            }
+        }
+    }
+
+    pObj->state = XA_OBJECT_STATE_REALIZED;
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioDeviceImpl_DoRealize");
+    return XA_RESULT_SUCCESS;
+}
+
+/* XAresult XARadioDeviceImpl_DoResume
+ * Description: Resume object from suspended state
+ */
+XAresult XARadioDeviceImpl_DoResume(XAObjectItf self)
+{
+    DEBUG_API("->XARadioDeviceImpl_DoResume");
+    DEBUG_API("<-XARadioDeviceImpl_DoResume");
+
+    return XA_RESULT_PRECONDITIONS_VIOLATED;
+}
+
+/* void XARadioDeviceImpl_FreeResources
+ * Description: Free all resources reserved at XARadioDeviceImpl_DoRealize()
+ */
+void XARadioDeviceImpl_FreeResources(XAObjectItf self)
+{
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    
+    XAuint8 itfIdx = 0;
+    DEBUG_API("->XARadioDeviceImpl_FreeResources");
+    XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS(XATSRadio);
+#ifdef _GSTREAMER_BACKEND_
+    XARadioDeviceImpl* pImpl = (XARadioDeviceImpl*)(*self);
+    assert( pObj && pImpl && pObj == pObj->self );
+#endif
+
+    /* free all allocated interfaces */
+    for(itfIdx = 0; itfIdx < RADIO_ITFCOUNT; itfIdx++)
+    {
+        void *pItf = pObj->interfaceMap[itfIdx].pItf;
+        if(pItf)
+        {
+            switch(itfIdx)
+            {
+                case RADIO_RADIOITF:
+                    XARadioItfImpl_Free( pItf );
+                    break;
+                case RADIO_CONFIGEXTENSIONITF:
+                    XAConfigExtensionsItfImpl_Free( pItf );
+                    break;
+                case RADIO_DIMITF:
+                    XADIMItfImpl_Free( pItf );
+                    break;
+                case RADIO_RDSITF:
+                    XARDSItfImpl_Free( pItf );
+                    break;
+                default:
+                    break;
+            }
+            pObj->interfaceMap[itfIdx].pItf = NULL;
+        }
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    if ( pImpl->adaptationCtx != NULL )
+    {
+        XARadioAdapt_Destroy( pImpl->adaptationCtx );
+        pImpl->adaptationCtx = NULL;
+    }
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS(XATSRadio);
+    DEBUG_API("<-XARadioDeviceImpl_FreeResources");
+    return;
+}
+
+/* END OF FILE */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/radio/xaradiodevice.h	Fri Apr 16 15:29:42 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: 
+*
+*/
+
+#ifndef XARADIODEVICE_H
+#define XARADIODEVICE_H
+
+#include "openmaxalwrapper.h"
+#include "xaobjectitf.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "../adaptation/XARadioAdaptCtx.h"
+#endif
+/** MACROS **/
+
+
+/** TYPES **/
+
+
+/** ENUMERATIONS **/
+/* Enumeration for interfaces that RadioDevice supports.  */
+typedef enum
+{
+    RADIO_OBJECTITF,
+    RADIO_RADIOITF,
+    RADIO_CONFIGEXTENSIONITF,
+    RADIO_DIMITF,
+    RADIO_RDSITF,
+    RADIO_ITFCOUNT
+} XARadioDeviceInterfaces;
+
+/** STRUCTURES **/
+/* Specification for RadioDeviceImpl. */
+typedef struct XARadioDeviceImpl_
+{
+    /* Parent for XARadioDeviceImpl */
+    XAObjectItfImpl baseObj;
+
+    /* variables */
+
+#ifdef _GSTREAMER_BACKEND_
+    XAAdaptationBaseCtx* adaptationCtx;
+#endif
+} XARadioDeviceImpl;
+
+
+/** METHODS **/
+
+/* base object XAObjectItfImpl methods */
+XAresult    XARadioDeviceImpl_DoRealize(XAObjectItf self);
+XAresult    XARadioDeviceImpl_DoResume(XAObjectItf self);
+void        XARadioDeviceImpl_FreeResources(XAObjectItf self);
+
+/* RadioDeviceImpl -specific methods */
+
+#endif /* XARADIODEVICE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/radio/xaradioitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,825 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include "xaradioitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XARadioItfAdaptation.h"
+#endif
+#include "xathreadsafety.h"
+
+/**
+ * XARadioItfImpl* GetImpl(XARadioItf self)
+ * Description: Validated interface pointer and cast it to implementations pointer.
+ **/
+static XARadioItfImpl* GetImpl(XARadioItf self)
+{
+    if(self)
+    {
+        XARadioItfImpl *impl = (XARadioItfImpl*)(*self);
+        if(impl && impl == impl->self)
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XARadioItf implementation
+ */
+
+/**
+ * XAresult XARadioItfImpl_SetFreqRange(XARadioItf self, XAuint8 range)
+ * Description: Sets the frequency range. Asynchronous – xaRadioCallback() callback with
+ *              XA_RADIO_EVENT_FREQUENCY_RANGE_CHANGED event is used for notifying of the result.
+ **/
+XAresult XARadioItfImpl_SetFreqRange(XARadioItf self, XAuint8 range)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+#ifdef _GSTREAMER_BACKEND_
+    XAboolean isSupported = XA_BOOLEAN_FALSE;
+#endif
+    XARadioItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XARadioItfImpl_SetFreqRange");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfImpl_SetFreqRange");
+
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARadioItfAdapt_IsFreqRangeSupported(impl->adapCtx, range, &isSupported);
+
+    if ( ret == XA_RESULT_SUCCESS && isSupported == XA_BOOLEAN_TRUE )
+    {
+        ret = XARadioItfAdapt_SetFreqRange(impl->adapCtx, range);
+    }
+#endif
+    
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioItfImpl_SetFreqRange");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_GetFreqRange(XARadioItf self, XAuint8 * pRange)
+ * Description: Gets the current frequency range.
+ **/
+XAresult XARadioItfImpl_GetFreqRange(XARadioItf self, XAuint8 * pRange)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_GetFreqRange");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl || !pRange)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfImpl_GetFreqRange");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARadioItfAdapt_GetFreqRange( impl->adapCtx, pRange);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioItfImpl_GetFreqRange");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_IsFreqRangeSupported(XARadioItf self,
+ *                                              XAuint8 range,
+ *                                              XAboolean * pSupported)
+ * Description: Queries if the given frequency range is supported.
+ **/
+XAresult XARadioItfImpl_IsFreqRangeSupported(XARadioItf self,
+                                             XAuint8 range,
+                                             XAboolean * pSupported)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_IsFreqRangeSupported");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl || !pSupported)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfImpl_IsFreqRangeSupported");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARadioItfAdapt_IsFreqRangeSupported( impl->adapCtx, range, pSupported );
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioItfImpl_IsFreqRangeSupported");
+    return ret;
+}
+
+
+/**
+ * XAresult XARadioItfImpl_GetFreqRangeProperties(XARadioItf self,
+ *                                                XAuint8 range,
+ *                                                XAuint32 * pMinFreq,
+ *                                                XAuint32 * pMaxFreq,
+ *                                                XAuint32 * pFreqInterval)
+ * Description: Returns the minimum and maximum supported frequencies and the
+ *              modulation of the given frequency range.
+ **/
+XAresult XARadioItfImpl_GetFreqRangeProperties(XARadioItf self,
+                                               XAuint8 range,
+                                               XAuint32 * pMinFreq,
+                                               XAuint32 * pMaxFreq,
+                                               XAuint32 * pFreqInterval)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAboolean isSupported = XA_BOOLEAN_FALSE;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_GetFreqRangeProperties");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl || !pMinFreq || !pMaxFreq || !pFreqInterval)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfImpl_GetFreqRangeProperties");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARadioItfAdapt_IsFreqRangeSupported( impl->adapCtx, range, &isSupported );
+#endif
+    if (isSupported != XA_BOOLEAN_TRUE || ret != XA_RESULT_SUCCESS)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfImpl_GetFreqRangeProperties");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARadioItfAdapt_GetFreqRangeProperties( impl->adapCtx,
+            range, pMinFreq, pMaxFreq, pFreqInterval );
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioItfImpl_GetFreqRangeProperties");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_SetFrequency(XARadioItf self, XAuint32 freq)
+ * Description: Sets the frequency asynchronously – xaRadioCallback() callback
+ *              with XA_RADIO_EVENT_FREQUENCY_CHANGED event is used for notifying
+ *              of the result. The implementation rounds the given value to the
+ *              nearest supported one. See pFreqInterval parameter of
+ *              GetFreqRangeProperties() method.
+ **/
+XAresult XARadioItfImpl_SetFrequency(XARadioItf self, XAuint32 freq)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_SetFrequency");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfImpl_SetFrequency");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARadioItfAdapt_SetFrequency( impl->adapCtx, freq );
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioItfImpl_SetFrequency");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_CancelSetFrequency(XARadioItf self)
+ * Description: Cancels an outstanding SetFrequency() request. The method
+ *              blocks while canceling the outstanding request. Has not effect
+ *              if no set frequency operation is ongoing.
+ **/
+XAresult XARadioItfImpl_CancelSetFrequency(XARadioItf self)
+
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_CancelSetFrequency");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfImpl_CancelSetFrequency");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARadioItfAdapt_CancelSetFrequency( impl->adapCtx );
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioItfImpl_CancelSetFrequency");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_GetFrequency(XARadioItf self, XAuint32 * pFreq)
+ * Description: Gets the current frequency.
+ **/
+XAresult XARadioItfImpl_GetFrequency(XARadioItf self, XAuint32 * pFreq)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_GetFrequency");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl || !pFreq)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfImpl_GetFrequency");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARadioItfAdapt_GetFrequency( impl->adapCtx, pFreq);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioItfImpl_GetFrequency");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_SetSquelch(XARadioItf self, XAboolean squelch)
+ * Description: Toggles the squelch (muting in frequencies without broadcast).
+ **/
+XAresult XARadioItfImpl_SetSquelch(XARadioItf self, XAboolean squelch)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_SetSquelch");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfImpl_SetSquelch");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if (impl->squelch != squelch)
+    {
+#ifdef _GSTREAMER_BACKEND_
+        ret = XARadioItfAdapt_SetSquelch( impl->adapCtx, squelch );
+#endif
+        if ( ret == XA_RESULT_SUCCESS )
+        {
+            impl->squelch = squelch;
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioItfImpl_SetSquelch");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_GetSquelch(XARadioItf self, XAboolean * pSquelch)
+ * Description: Queries the squelch setting (muting in frequencies without broadcast).
+ **/
+XAresult XARadioItfImpl_GetSquelch(XARadioItf self, XAboolean * pSquelch)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_GetSquelch");
+    if(!impl || !pSquelch)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARadioItfImpl_GetSquelch");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pSquelch = impl->squelch;
+
+    DEBUG_API("<-XARadioItfImpl_GetSquelch");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_SetStereoMode(XARadioItf self, XAuint32 mode)
+ * Description: Sets the current stereo mode.
+ **/
+XAresult XARadioItfImpl_SetStereoMode(XARadioItf self, XAuint32 mode)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_SetStereoMode");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl || mode > XA_STEREOMODE_AUTO )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfImpl_SetStereoMode");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if ( impl->stereoMode != mode)
+    {
+#ifdef _GSTREAMER_BACKEND_
+        ret = XARadioItfAdapt_SetStereoMode( impl->adapCtx, mode );
+#endif
+        if ( ret == XA_RESULT_SUCCESS )
+        {
+            impl->stereoMode = mode;
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioItfImpl_SetStereoMode");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_GetStereoMode(XARadioItf self, XAuint32 * pMode)
+ * Description: Queries the current stereo mode.
+ **/
+XAresult XARadioItfImpl_GetStereoMode(XARadioItf self, XAuint32 * pMode)
+{
+
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_GetStereoMode");
+    if(!impl || !pMode)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARadioItfImpl_GetStereoMode");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pMode = impl->stereoMode;
+
+    DEBUG_API("<-XARadioItfImpl_GetStereoMode");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_GetSignalStrength(XARadioItf self, XAuint32 * pStrength)
+ * Description: Returns the signal strength in per cents.
+ **/
+XAresult XARadioItfImpl_GetSignalStrength(XARadioItf self, XAuint32 * pStrength)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_GetSignalStrength");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl || !pStrength)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfImpl_GetSignalStrength");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARadioItfAdapt_GetSignalStrength( impl->adapCtx, pStrength );
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioItfImpl_GetSignalStrength");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_Seek(XARadioItf self, XAboolean upwards)
+ * Description: Starts the seek from the current frequency to the given direction.
+ *              Asynchronous – xaRadioCallback() callback with XA_RADIO_EVENT_SEEK_COMPLETED
+ *              event is used for notifying of the result. If the end of the tuner’s
+ *              frequency band is reached before a signal was found, the scan continues
+ *              from the other end until a signal is found or the original frequency is reached.
+ **/
+XAresult XARadioItfImpl_Seek(XARadioItf self, XAboolean upwards)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_Seek");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfImpl_Seek");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARadioItfAdapt_Seek( impl->adapCtx, upwards );
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioItfImpl_Seek");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_StopSeeking(XARadioItf self)
+ * Description: Cancels an outstanding seek request. The method blocks while canceling
+ *              the outstanding request. After cancellation, the frequency is the one
+ *              where seeking stopped. Has not effect if no seek operation is ongoing.
+ **/
+XAresult XARadioItfImpl_StopSeeking(XARadioItf self)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_StopSeeking");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl)
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfImpl_StopSeeking");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARadioItfAdapt_StopSeeking( impl->adapCtx );
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARadioItfImpl_StopSeeking");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_GetNumberOfPresets(XARadioItf self, XAuint32 * pNumPresets)
+ * Description: Returns the number of preset slots the device has for storing the presets.
+ **/
+XAresult XARadioItfImpl_GetNumberOfPresets(XARadioItf self, XAuint32 * pNumPresets)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_GetNumberOfPresets");
+
+    if(!impl || !pNumPresets)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARadioItfImpl_GetNumberOfPresets");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pNumPresets = impl->numOfPresets;
+
+    DEBUG_API("<-XARadioItfImpl_GetNumberOfPresets");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_SetPreset(XARadioItf self,
+ *                                   XAuint32 preset,
+ *                                   XAuint32 freq,
+ *                                   XAuint8 range,
+ *                                   XAuint32 mode,
+ *                                   const XAchar * name)
+ * Description: Sets the preset.
+ **/
+XAresult XARadioItfImpl_SetPreset(XARadioItf self,
+                                  XAuint32 preset,
+                                  XAuint32 freq,
+                                  XAuint8 range,
+                                  XAuint32 mode,
+                                  const XAchar * name)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAboolean supported = XA_BOOLEAN_FALSE;
+    XAuint32 minFreq = 0;
+    XAuint32 maxFreq = 0;
+    XAuint32 freqInterval = 0;
+
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_SetPreset");
+
+    if(!impl || !name)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARadioItfImpl_SetPreset");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    ret = (*self)->IsFreqRangeSupported(self, range, &supported);
+    if(supported != XA_BOOLEAN_TRUE || ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid range */
+        DEBUG_API("<-XARadioItfImpl_SetPreset");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    ret = (*self)->GetFreqRangeProperties(self, range, &minFreq, &maxFreq, &freqInterval);
+    if (freq < minFreq || freq > maxFreq || ((freq-minFreq)%freqInterval != 0) ||
+            ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid freq */
+        DEBUG_API("<-XARadioItfImpl_SetPreset");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    if (preset < 1 || preset >= impl->numOfPresets ||
+             mode > XA_STEREOMODE_AUTO ||
+            strlen((char*)name) > RADIO_PRESET_NAME_MAX_LENGTH)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid preset, name or mode*/
+        DEBUG_API("<-XARadioItfImpl_SetPreset");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    
+    free(impl->presets[preset].name);
+
+    impl->presets[preset].freq = freq;
+    impl->presets[preset].range = range;
+    impl->presets[preset].stereoMode = mode;
+    impl->presets[preset].name = calloc(1, RADIO_PRESET_NAME_MAX_LENGTH+1);
+    strncpy( impl->presets[preset].name, (char*)name, RADIO_PRESET_NAME_MAX_LENGTH );
+#endif
+    DEBUG_API("<-XARadioItfImpl_SetPreset");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_GetPreset(XARadioItf self,
+ *                                   XAuint32 preset,
+ *                                   XAuint32 * pFreq,
+ *                                   XAuint8 * pRange,
+ *                                   XAuint32 * pMode,
+ *                                   XAchar * pName,
+ *                                   XAuint16 * pNameLength)
+ * Description: Gets the settings stored into a preset.
+ **/
+XAresult XARadioItfImpl_GetPreset(XARadioItf self,
+                                  XAuint32 preset,
+                                  XAuint32 * pFreq,
+                                  XAuint8 * pRange,
+                                  XAuint32 * pMode,
+                                  XAchar * pName,
+                                  XAuint16 * pNameLength)
+{
+    /* Supporting CT tester the API signature is newer, but API functionality reflects required spec version.
+       Implement newer specification in terms of handling pName and pNameLength*/
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_GetPreset");
+
+    if(!impl || !pFreq || !pRange || !pMode || !pNameLength)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARadioItfImpl_GetPreset");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    if (pName)
+    {
+        if(preset < 1 || preset > impl->numOfPresets)
+        {
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            /* invalid parameter */
+            DEBUG_API("<-XARadioItfImpl_GetPreset");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+#ifdef _GSTREAMER_BACKEND_
+        *pFreq = impl->presets[preset].freq;
+        *pRange = impl->presets[preset].range;
+        *pMode = impl->presets[preset].stereoMode;
+        if(*pNameLength<RADIO_PRESET_NAME_MAX_LENGTH)
+        {
+            strncpy( (char*)pName, impl->presets[preset].name, *pNameLength );
+            ret = XA_RESULT_BUFFER_INSUFFICIENT;
+        }
+        else
+        {
+            strncpy( (char*)pName, impl->presets[preset].name, RADIO_PRESET_NAME_MAX_LENGTH );
+        }
+#endif        
+    }
+    /*Just adding some meaninful value, when supporting new spec this must be fetch the system*/
+    *pNameLength = RADIO_PRESET_NAME_MAX_LENGTH;
+
+    DEBUG_API("<-XARadioItfImpl_GetPreset");
+    return ret;
+}
+
+/**
+ * XAresult XARadioItfImpl_RegisterRadioCallback(XARadioItf self,
+ *                                               xaRadioCallback callback,
+ *                                               void * pContext)
+ * Description: Sets or clears the xaRadioCallback.
+ **/
+XAresult XARadioItfImpl_RegisterRadioCallback(XARadioItf self,
+                                              xaRadioCallback callback,
+                                              void * pContext)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARadioItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARadioItfImpl_RegisterRadioCallback");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARadioItfImpl_RegisterRadioCallback");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->callback = callback;
+    impl->context = pContext;
+    impl->cbPtrToSelf = self;
+
+    DEBUG_API("<-XARadioItfImpl_RegisterRadioCallback");
+    return ret;
+}
+
+/**
+ * XARadioItfImpl -specific methods
+ **/
+#ifdef _GSTREAMER_BACKEND_
+
+/**
+ * XARadioItfImplImpl* XARadioItfImpl_Create()
+ * Description: Allocate and initialize RadioItfImpl
+ **/
+XARadioItfImpl* XARadioItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
+{
+    XAuint16 index = 0;
+
+    XARadioItfImpl *self = (XARadioItfImpl*)
+        calloc(1,sizeof(XARadioItfImpl));
+
+    DEBUG_API("->XARadioItfImpl_Create");
+
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.SetFreqRange = XARadioItfImpl_SetFreqRange;
+        self->itf.GetFreqRange = XARadioItfImpl_GetFreqRange;
+        self->itf.IsFreqRangeSupported = XARadioItfImpl_IsFreqRangeSupported;
+        self->itf.GetFreqRangeProperties = XARadioItfImpl_GetFreqRangeProperties;
+        self->itf.SetFrequency = XARadioItfImpl_SetFrequency;
+        self->itf.CancelSetFrequency = XARadioItfImpl_CancelSetFrequency;
+        self->itf.GetFrequency = XARadioItfImpl_GetFrequency;
+        self->itf.SetSquelch = XARadioItfImpl_SetSquelch;
+        self->itf.GetSquelch = XARadioItfImpl_GetSquelch;
+        self->itf.SetStereoMode = XARadioItfImpl_SetStereoMode;
+        self->itf.GetStereoMode = XARadioItfImpl_GetStereoMode;
+        self->itf.GetSignalStrength = XARadioItfImpl_GetSignalStrength;
+        self->itf.Seek = XARadioItfImpl_Seek;
+        self->itf.StopSeeking = XARadioItfImpl_StopSeeking;
+        self->itf.GetNumberOfPresets = XARadioItfImpl_GetNumberOfPresets;
+        self->itf.SetPreset = XARadioItfImpl_SetPreset;
+        self->itf.GetPreset = XARadioItfImpl_GetPreset;
+        self->itf.RegisterRadioCallback = XARadioItfImpl_RegisterRadioCallback;
+
+        /* init variables */
+
+        self->squelch = XA_BOOLEAN_FALSE;
+        self->stereoMode = RADIO_DEFAULT_STEREO_MODE;
+
+        self->preset = 0;
+        self->numOfPresets = RADIO_NUM_OF_PRESETS;
+
+        for (index = 0; index < self->numOfPresets; index++)
+        {
+            self->presets[index].freq = RADIO_DEFAULT_FREQ;
+            self->presets[index].range = RADIO_DEFAULT_FREQ_RANGE;
+            self->presets[index].stereoMode = RADIO_DEFAULT_STEREO_MODE;
+            self->presets[index].name = calloc(1, RADIO_PRESET_NAME_MAX_LENGTH+1);
+            strncpy( self->presets[index].name, RadioPresetDefaultName, RADIO_PRESET_NAME_MAX_LENGTH );
+        }
+
+        self->callback = NULL;
+        self->context = NULL;
+        self->cbPtrToSelf = NULL;
+
+        self->adapCtx = adapCtx;
+
+        XAAdaptationBase_AddEventHandler( adapCtx, &XARadioItfImpl_AdaptCb, XA_RADIOITFEVENTS, self );
+
+        self->self = self;
+    }
+
+    DEBUG_API("<-XARadioItfImpl_Create");
+    return self;
+}
+#endif
+/**
+ * void XARadioItfImpl_Free(XARadioItfImpl* self)
+ * Description: Free all resources reserved at XARadioItfImpl_Create
+ **/
+void XARadioItfImpl_Free(XARadioItfImpl* self)
+{
+    
+    DEBUG_API("->XARadioItfImpl_Free");
+    XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS(XATSRadio);
+#ifdef _GSTREAMER_BACKEND_
+    XAuint16 index = 0;
+    XAAdaptationBase_RemoveEventHandler( self->adapCtx, &XARadioItfImpl_AdaptCb );
+
+    XARadioItfAdapt_Free(self->adapCtx);
+
+    for (index = 0; index < self->numOfPresets; index++)
+    {
+        free(self->presets[index].name);
+    }
+#endif
+    assert(self==self->self);
+    free(self);
+
+    XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS(XATSRadio);
+    DEBUG_API("<-XARadioItfImpl_Free");
+}
+#ifdef _GSTREAMER_BACKEND_
+/* void XARadioItfimpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+ * Description: Event handler for adaptation events
+ */
+void XARadioItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+{
+    XARadioItfImpl* impl =(XARadioItfImpl*)pHandlerCtx;
+    DEBUG_API("->XARadioItfimpl_AdaptCb");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XARadioItfImpl_AdaptCb, invalid context pointer!");
+        DEBUG_API("<-XARadioItfImpl_AdaptCb");
+        return;
+    }
+    assert(event);
+
+    if( event->eventid == XA_ADAPT_RADIO_FREQUENCY_CHANGED && impl->callback )
+    {
+        DEBUG_API("Frequency changed in adaptation");
+        impl->callback( impl->cbPtrToSelf, impl->context, XA_RADIO_EVENT_FREQUENCY_CHANGED, 0, XA_BOOLEAN_FALSE );
+    }
+    else if( event->eventid == XA_ADAPT_RADIO_FREQUENCY_RANGE_CHANGED && impl->callback )
+    {
+        DEBUG_API("Frequency range changed in adaptation");
+        impl->callback( impl->cbPtrToSelf, impl->context, XA_RADIO_EVENT_FREQUENCY_RANGE_CHANGED, 0, XA_BOOLEAN_FALSE  );
+    }
+    else if( event->eventid == XA_ADAPT_RADIO_SEEK_COMPLETE && impl->callback )
+    {
+        DEBUG_API("Seek complete in adaptation");
+        impl->callback( impl->cbPtrToSelf, impl->context, XA_RADIO_EVENT_SEEK_COMPLETED, 0, XA_BOOLEAN_FALSE  );
+    }
+    else
+    {
+        /* do nothing */
+    }
+    DEBUG_API("<-XARadioItfimpl_AdaptCb");
+}
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/radio/xaradioitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,138 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XARADIOITF_H
+#define XARADIOITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#include "XARadioItfAdaptation.h"
+#endif
+/** MACROS **/
+#define RADIO_PRESET_NAME_MAX_LENGTH 20
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+
+/* Definition of radio preset */
+typedef struct RadioPreset_
+{
+    XAuint32    freq;
+    XAuint8     range;
+    XAuint32    stereoMode;
+    char*       name;
+} RadioPreset;
+
+/* Definition of XAEqualizerItf implementation */
+typedef struct XARadioItfImpl_
+{
+    /* parent interface */
+    struct XARadioItf_ itf;
+    /* pointer to self */
+    struct XARadioItfImpl_* self;
+
+    /* variables */
+    XAboolean   squelch;
+    XAuint32    stereoMode;
+
+    XAuint32    preset;
+    XAuint32    numOfPresets;
+
+#ifdef _GSTREAMER_BACKEND_
+    RadioPreset presets[RADIO_NUM_OF_PRESETS];
+#endif
+    XARadioItf         cbPtrToSelf;
+    xaRadioCallback    callback;
+    void               *context;
+
+#ifdef _GSTREAMER_BACKEND_
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+} XARadioItfImpl;
+
+/** METHODS **/
+
+/* Base interface XARadioItf implementation */
+XAresult XARadioItfImpl_SetFreqRange(XARadioItf self, XAuint8 range);
+
+XAresult XARadioItfImpl_GetFreqRange(XARadioItf self, XAuint8 * pRange);
+
+XAresult XARadioItfImpl_IsFreqRangeSupported(XARadioItf self,
+                                             XAuint8 range,
+                                             XAboolean * pSupported);
+
+XAresult XARadioItfImpl_GetFreqRangeProperties(XARadioItf self,
+                                               XAuint8 range,
+                                               XAuint32 * pMinFreq,
+                                               XAuint32 * pMaxFreq,
+                                               XAuint32 * pFreqInterval);
+
+XAresult XARadioItfImpl_SetFrequency(XARadioItf self, XAuint32 freq);
+
+XAresult XARadioItfImpl_CancelSetFrequency(XARadioItf self);
+
+XAresult XARadioItfImpl_GetFrequency(XARadioItf self, XAuint32 * pFreq);
+
+XAresult XARadioItfImpl_SetSquelch(XARadioItf self, XAboolean squelch);
+
+XAresult XARadioItfImpl_GetSquelch(XARadioItf self, XAboolean * pSquelch);
+
+XAresult XARadioItfImpl_SetStereoMode(XARadioItf self, XAuint32 mode);
+
+XAresult XARadioItfImpl_GetStereoMode(XARadioItf self, XAuint32 * pMode);
+
+XAresult XARadioItfImpl_GetSignalStrength(XARadioItf self, XAuint32 * pStrength);
+
+XAresult XARadioItfImpl_Seek(XARadioItf self, XAboolean upwards);
+
+XAresult XARadioItfImpl_StopSeeking(XARadioItf self);
+
+XAresult XARadioItfImpl_GetNumberOfPresets(XARadioItf self, XAuint32 * pNumPresets);
+
+XAresult XARadioItfImpl_SetPreset(XARadioItf self,
+                                  XAuint32 preset,
+                                  XAuint32 freq,
+                                  XAuint8 range,
+                                  XAuint32 mode,
+                                  const XAchar * name);
+
+XAresult XARadioItfImpl_GetPreset(XARadioItf self,
+                                  XAuint32 preset,
+                                  XAuint32 * pFreq,
+                                  XAuint8 * pRange,
+                                  XAuint32 * pMode,
+                                  XAchar * pName,
+                                  XAuint16 * pNameLength);
+
+XAresult XARadioItfImpl_RegisterRadioCallback(XARadioItf self,
+                                              xaRadioCallback callback,
+                                              void * pContext);
+#ifdef _GSTREAMER_BACKEND_
+
+/* XARadioItfImpl -specific methods */
+XARadioItfImpl* XARadioItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
+void XARadioItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
+#endif
+void XARadioItfImpl_Free(XARadioItfImpl* self);
+
+#endif /* XARADIOITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/radio/xardsitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,881 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xardsitf.h"
+/*#include "XARDSItfAdaptation.h"*/
+#include "xathreadsafety.h"
+
+/**
+ * XARDSItfImpl* GetImpl(XARDSItf self)
+ * Description: Validated interface pointer and cast it to implementations pointer.
+ **/
+static XARDSItfImpl* GetImpl(XARDSItf self)
+{
+    if(self)
+    {
+        XARDSItfImpl *impl = (XARDSItfImpl*)(*self);
+        if(impl && impl == impl->self)
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XARDSItf implementation
+ */
+
+/**
+ * XAresult XARDSItfImpl_QueryRDSSignal(XARDSItf self, XAboolean * isSignal)
+ * Description: Returns the status of the RDS reception.
+ **/
+XAresult XARDSItfImpl_QueryRDSSignal(XARDSItf self, XAboolean * isSignal)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_QueryRDSSignal");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+    if(!impl || !isSignal)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_QueryRDSSignal");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_QueryRDSSignal(impl->adapCtx, isSignal);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_QueryRDSSignal");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_GetProgrammeServiceName(XARDSItf self, XAchar * ps)
+ * Description: Gets the current Programme Service name (PS).
+ **/
+XAresult XARDSItfImpl_GetProgrammeServiceName(XARDSItf self, XAchar * ps)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_GetProgrammeServiceName");
+    if(!impl || !ps)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_GetProgrammeServiceName");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_GetProgrammeServiceName(impl->adapCtx, ps);
+#endif
+    DEBUG_API("<-XARDSItfImpl_GetProgrammeServiceName");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_GetRadioText(XARDSItf self, XAchar * rt)
+ * Description: Gets the current Radio Text (RT).
+ **/
+XAresult XARDSItfImpl_GetRadioText(XARDSItf self, XAchar * rt)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_GetRadioText");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl || !rt)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_GetRadioText");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_GetRadioText(impl->adapCtx, rt);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_GetRadioText");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_GetRadioTextPlus(XARDSItf self,
+ *                                        XAuint8 contentType,
+ *                                        XAchar * informationElement,
+ *                                        XAchar * descriptor,
+ *                                        XAuint8 * descriptorContentType)
+ * Description: Gets the current Radio Text+ (RT+) information element based
+ *              on the given class code.
+ **/
+XAresult XARDSItfImpl_GetRadioTextPlus(XARDSItf self,
+                                       XAuint8 contentType,
+                                       XAchar * informationElement,
+                                       XAchar * descriptor,
+                                       XAuint8 * descriptorContentType)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_GetRadioTextPlus");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl || contentType < XA_RDSRTPLUS_ITEMTITLE || contentType > XA_RDSRTPLUS_GETDATA
+            || !informationElement || !descriptor || !descriptorContentType)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_GetRadioTextPlus");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_GetRadioTextPlus(impl->adapCtx, contentType, informationElement,
+                                        descriptor, descriptorContentType);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_GetRadioTextPlus");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_GetProgrammeType(XARDSItf self, XAuint32 * pty)
+ * Description: Gets the current Programme TYpe (PTY) as short. The
+ *              return value zero corresponds to No Programme Type
+ *              or to undefined type. Please note that PTYs in RBDS
+ *              differ from the ones in RDS.
+ **/
+XAresult XARDSItfImpl_GetProgrammeType(XARDSItf self, XAuint32 * pty)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_GetProgrammeType");
+
+    if(!impl || !pty)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_GetProgrammeType");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_GetProgrammeType(impl->adapCtx, pty);
+#endif
+    DEBUG_API("<-XARDSItfImpl_GetProgrammeType");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_GetProgrammeTypeString(XARDSItf self,
+ *                                              XAboolean isLengthMax16,
+ *                                              XAchar * pty)
+ * Description: Gets the current Programme TYpe (PTY) as a String with
+ *              the maximum of 8 or 16 characters in English (char set TBD)
+ *              as defined in RDS and RBDS specifications. Please note
+ *              that PTYs in RBDS differ from the ones in RDS.
+ **/
+XAresult XARDSItfImpl_GetProgrammeTypeString(XARDSItf self,
+                                             XAboolean isLengthMax16,
+                                             XAchar * pty)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_GetProgrammeTypeString");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl || !pty)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_GetProgrammeTypeString");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_GetProgrammeTypeString(impl->adapCtx, isLengthMax16, pty);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_GetProgrammeTypeString");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_GetProgrammeIdentificationCode(XARDSItf self, XAint16 * pi)
+ * Description: Gets the current Programme Identification code (PI). The PI is not
+ *              intended for directly displaying to the end user, but instead to
+ *              identify uniquely a programme. This can be used to detect that two
+ *              frequencies are transmitting the same programme.
+ **/
+XAresult XARDSItfImpl_GetProgrammeIdentificationCode(XARDSItf self, XAint16 * pi)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_GetProgrammeIdentificationCode");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl || !pi)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_GetProgrammeIdentificationCode");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_GetProgrammeIdentificationCode(impl->adapCtx, pi);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_GetProgrammeIdentificationCode");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_GetClockTime(XARDSItf self, XAtime * dateAndTime)
+ * Description: Gets the current Clock Time and date (CT).
+ **/
+XAresult XARDSItfImpl_GetClockTime(XARDSItf self, XAtime * dateAndTime)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_GetClockTime");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl || !dateAndTime)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_GetClockTime");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_GetClockTime(impl->adapCtx, dateAndTime);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_GetClockTime");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_GetTrafficAnnouncement(XARDSItf self, XAboolean * ta)
+ * Description: Gets the current status of the Traffic Announcement (TA) switch.
+ **/
+XAresult XARDSItfImpl_GetTrafficAnnouncement(XARDSItf self, XAboolean * ta)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_GetTrafficAnnouncement");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl || !ta)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_GetTrafficAnnouncement");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_GetTrafficAnnouncement(impl->adapCtx, ta);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_GetTrafficAnnouncement");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_GetTrafficProgramme(XARDSItf self, XAboolean * tp)
+ * Description: Gets the current status of the Traffic Programme (TP) switch.
+ **/
+XAresult XARDSItfImpl_GetTrafficProgramme(XARDSItf self, XAboolean * tp)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_GetTrafficProgramme");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl || !tp)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_GetTrafficProgramme");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_GetTrafficProgramme(impl->adapCtx, tp);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_GetTrafficProgramme");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_SeekByProgrammeType(XARDSItf self,
+ *                                           XAuint32 pty,
+ *                                           XAboolean upwards)
+ * Description: Seeks for the frequency sending the given Programme TYpe (PTY).
+ *              If the end of the tuner’s frequency band is reached before the
+ *              given Programme TYpe is found, the scan continues from the other
+ *              end until the given Programme TYpe is found or the original frequency
+ *              is reached. Asynchronous - tuner callback xaRadioCallback() and
+ *              XA_RADIO_EVENT_SEEK_COMPLETED is used for notifying of the result.
+ *              StopSeeking() method of XARadioItf can be used to abort an ongoing seek.
+ **/
+XAresult XARDSItfImpl_SeekByProgrammeType(XARDSItf self,
+                                          XAuint32 pty,
+                                          XAboolean upwards)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_SeekByProgrammeType");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+    if(!impl || pty > XA_RDSPROGRAMMETYPE_RDSPTY_ALARM)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_SeekByProgrammeType");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_SeekByProgrammeType(impl->adapCtx, pty, upwards);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_SeekByProgrammeType");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_SeekTrafficAnnouncement(XARDSItf self, XAboolean upwards)
+ * Description: Seeks for a frequency sending Traffic Announcement (TA). If the end
+ *              of the tuner’s frequency band is reached before a Traffic Announcement
+ *              is found, the scan continues from the other end until a Traffic
+ *              Announcement is found or the original frequency is reached. Asynchronous
+ *              - tuner callback xaRadioCallback() and XA_RADIO_EVENT_SEEK_COMPLETED
+ *              is used for notifying of the result. StopSeeking() method of XARadioItf
+ *              can be used to abort an ongoing seek.
+ **/
+XAresult XARDSItfImpl_SeekTrafficAnnouncement(XARDSItf self, XAboolean upwards)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_SeekTrafficAnnouncement");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+    if(!impl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_SeekTrafficAnnouncement");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_SeekTrafficAnnouncement(impl->adapCtx, upwards);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_SeekTrafficAnnouncement");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_SeekTrafficProgramme(XARDSItf self, XAboolean upwards)
+ * Description: Seeks for a frequency sending Traffic Programme (TP). If the end
+ *              of the tuner’s frequency band is reached before a Traffic Programme
+ *              is found, the scan continues from the other end until a Traffic
+ *              Programme is found or the original frequency is reached. Asynchronous
+ *              - tuner callback xaRadioCallback() and XA_RADIO_EVENT_SEEK_COMPLETED
+ *              is used for notifying of the result. StopSeeking() method of XARadioItf
+ *              can be used to abort an ongoing seek.
+ **/
+XAresult XARDSItfImpl_SeekTrafficProgramme(XARDSItf self, XAboolean upwards)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_SeekTrafficProgramme");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+    if(!impl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_SeekTrafficProgramme");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_SeekTrafficProgramme(impl->adapCtx, upwards);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_SeekTrafficProgramme");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_SetAutomaticSwitching(XARDSItf self, XAboolean automatic)
+ * Description: Sets the automatic switching of the transmitter in the case of a
+ *              stronger transmitter with the same PI presence. Based on AF and/or
+ *              EON fields. Please note that NOT ALL IMPLEMENTATIONS SUPPORT THIS
+ *              FUNCTIONALITY.
+ **/
+XAresult XARDSItfImpl_SetAutomaticSwitching(XARDSItf self, XAboolean automatic)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_SetAutomaticSwitching");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+    if(!impl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_SetAutomaticSwitching");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_SetAutomaticSwitching(impl->adapCtx, automatic);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_SetAutomaticSwitching");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_GetAutomaticSwitching(XARDSItf self, XAboolean * automatic)
+ * Description: Gets the mode of the automatic switching of the transmitter in
+ *              case of a stronger transmitter with the same PI presence.
+ **/
+XAresult XARDSItfImpl_GetAutomaticSwitching(XARDSItf self, XAboolean * automatic)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_GetAutomaticSwitching");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+    if(!impl || !automatic)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_GetAutomaticSwitching");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_GetAutomaticSwitching(impl->adapCtx, automatic);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_GetAutomaticSwitching");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_SetAutomaticTrafficAnnouncement(XARDSItf self, XAboolean automatic)
+ * Description: Sets the automatic switching of the program in case of the presence
+ *              of Traffic Announcement in another program. Based on TP and TA fields.
+ *              Please note that NOT ALL IMPLEMENTATIONS SUPPORT THIS FUNCTIONALITY.
+ **/
+XAresult XARDSItfImpl_SetAutomaticTrafficAnnouncement(XARDSItf self, XAboolean automatic)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_SetAutomaticTrafficAnnouncement");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+    if(!impl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_SetAutomaticTrafficAnnouncement");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_SetAutomaticTrafficAnnouncement(impl->adapCtx, automatic);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_SetAutomaticTrafficAnnouncement");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_GetAutomaticTrafficAnnouncement(XARDSItf self, XAboolean * automatic)
+ * Description: Gets the mode of the automatic switching of the program in case of
+ *              the presence of Traffic Announcement in another program. Based on
+ *              TP and TA fields.
+ **/
+XAresult XARDSItfImpl_GetAutomaticTrafficAnnouncement(XARDSItf self, XAboolean * automatic)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_GetAutomaticTrafficAnnouncement");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+    if(!impl || !automatic)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_GetAutomaticTrafficAnnouncement");
+
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_GetAutomaticTrafficAnnouncement(impl->adapCtx, automatic);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_GetAutomaticTrafficAnnouncement");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_GetODAGroup(XARDSItf self,
+ *                                   XAint16 AID,
+ *                                   xaGetODAGroupCallback callback,
+ *                                   void * pContext)
+ * Description: Returns asynchronously via callback (xaGetODAGroupCallback())
+ *              the application Group and the message bits concerning the given
+ *              ODA (Open Data Application). ODA is a mechanism that a broadcaster
+ *              can use to transfer data that is not explicitly specified in the RDS
+ *              standard. Open Data Applications are subject to a registration process.
+ *              Transmission protocols used by ODAs may be public or private. See RDS
+ *              Forum web page (http://www.rds.org.uk/)for details.
+ **/
+XAresult XARDSItfImpl_GetODAGroup(XARDSItf self,
+                                  XAuint16 AID,
+                                  xaGetODAGroupCallback callback,
+                                  void * pContext)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_GetODAGroup");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+    if(!impl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_GetODAGroup");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->odaGroupCallback = callback;
+    impl->odaGroupContext = pContext;
+    impl->odaGroupCbPtrToSelf = self;
+
+    if (callback)
+    {
+#ifdef _GSTREAMER_BACKEND_
+        ret = XARDSItfAdapt_GetODAGroup(impl->adapCtx, AID);
+#endif
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_GetODAGroup");
+
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_SubscribeODAGroup(XARDSItf self,
+ *                                         XAint16 group,
+ *                                         XAboolean useErrorCorrection)
+ * Description: Subscribes the given ODA group. If the given group was already
+ *              subscribed, this call doesn’t do anything. Only new data in groups
+ *              that have been subscribed will cause a newODA callback.
+ **/
+XAresult XARDSItfImpl_SubscribeODAGroup(XARDSItf self,
+                                        XAint16 group,
+                                        XAboolean useErrorCorrection)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XARDSItfImpl_SubscribeODAGroup");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_SubscribeODAGroup");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_SubscribeODAGroup(impl->adapCtx, group, useErrorCorrection);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_SubscribeODAGroup");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_UnsubscribeODAGroup(XARDSItf self, XAint16 group)
+ * Description: Unsubscribes the given ODA group. If the given group has not
+ *              been subscribed, this doesn’t do anything. Only new data in
+ *              groups that have been subscribed will cause a newODA callback.
+ **/
+XAresult XARDSItfImpl_UnsubscribeODAGroup(XARDSItf self, XAint16 group)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+
+    DEBUG_API("->XARDSItfImpl_UnsubscribeODAGroup");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+
+    if(!impl)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_UnsubscribeODAGroup");
+
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XARDSItfAdapt_UnsubscribeODAGroup(impl->adapCtx, group);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_UnsubscribeODAGroup");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_ListODAGroupSubscriptions(XARDSItf self,
+ *                                                 XAint16* pGroups,
+ *                                                 XAuint32* pLength);
+ * Description: Lists ODA groups that are currently subscribed.
+ **/
+XAresult XARDSItfImpl_ListODAGroupSubscriptions(XARDSItf self,
+                                                XAint16* pGroups,
+                                                XAuint32* pLength)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+    DEBUG_API("->XARDSItfImpl_ListODAGroupSubscriptions");
+
+    if(!impl || !pLength)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_ListODAGroupSubscriptions");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    XARDSItfAdapt_ListODAGroupSubscriptions(impl->adapCtx, pGroups, pLength);
+#endif
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_ListODAGroupSubscriptions");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_RegisterRDSCallback(XARDSItf self,
+ *                                           xaRDSCallback callback,
+ *                                           void * pContext)
+ * Description: Sets or clears the xaNewODADataCallback(). xaNewODADataCallback()
+ *              is used tranfer the actual ODA data to the application.
+ **/
+XAresult XARDSItfImpl_RegisterRDSCallback(XARDSItf self,
+                                          xaRDSCallback callback,
+                                          void * pContext)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_RegisterRDSCallback");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_RegisterRDSCallback");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->rdsCallback = callback;
+    impl->rdsContext = pContext;
+    impl->rdsCbPtrToSelf = self;
+
+    DEBUG_API("<-XARDSItfImpl_RegisterRDSCallback");
+    return ret;
+}
+
+/**
+ * XAresult XARDSItfImpl_RegisterODADataCallback(XARDSItf self,
+ *                                               xaNewODADataCallback callback,
+ *                                               void * pContext)
+ * Description: Sets or clears the xaRDSCallback(). xaRDSCallback() is used to monitor
+ *              changes in RDS fields.
+ **/
+XAresult XARDSItfImpl_RegisterODADataCallback(XARDSItf self,
+                                              xaNewODADataCallback callback,
+                                              void * pContext)
+{
+
+    XAresult ret = XA_RESULT_SUCCESS;
+    XARDSItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XARDSItfImpl_RegisterODADataCallback");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XARDSItfImpl_RegisterODADataCallback");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->odaDataCallback = callback;
+    impl->odaDataContext = pContext;
+    impl->odaDataCbPtrToSelf = self;
+
+    DEBUG_API("<-XARDSItfImpl_RegisterODADataCallback");
+    return ret;
+}
+
+/**
+ * XARDSItfImpl -specific methods
+ **/
+#ifdef _GSTREAMER_BACKEND_
+
+/**
+ * XARDSItfImplImpl* XARDSItfImpl_Create()
+ * @return  XARDSItfImplImpl* - Pointer to  RDSItf interface implementation
+ **/
+XARDSItfImpl* XARDSItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
+{
+    XARDSItfImpl *self = (XARDSItfImpl*)
+        calloc(1,sizeof(XARDSItfImpl));
+    DEBUG_API("->XARDSItfImpl_Create");
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.QueryRDSSignal = XARDSItfImpl_QueryRDSSignal;
+        self->itf.GetProgrammeServiceName = XARDSItfImpl_GetProgrammeServiceName;
+        self->itf.GetRadioText = XARDSItfImpl_GetRadioText;
+        self->itf.GetRadioTextPlus = XARDSItfImpl_GetRadioTextPlus;
+        self->itf.GetProgrammeType = XARDSItfImpl_GetProgrammeType;
+        self->itf.GetProgrammeTypeString = XARDSItfImpl_GetProgrammeTypeString;
+        self->itf.GetProgrammeIdentificationCode = XARDSItfImpl_GetProgrammeIdentificationCode;
+        self->itf.GetClockTime = XARDSItfImpl_GetClockTime;
+        self->itf.GetTrafficAnnouncement = XARDSItfImpl_GetTrafficAnnouncement;
+        self->itf.GetTrafficProgramme = XARDSItfImpl_GetTrafficProgramme;
+        self->itf.SeekByProgrammeType = XARDSItfImpl_SeekByProgrammeType;
+        self->itf.SeekTrafficAnnouncement = XARDSItfImpl_SeekTrafficAnnouncement;
+        self->itf.SeekTrafficProgramme = XARDSItfImpl_SeekTrafficProgramme;
+        self->itf.SetAutomaticSwitching = XARDSItfImpl_SetAutomaticSwitching;
+        self->itf.GetAutomaticSwitching = XARDSItfImpl_GetAutomaticSwitching;
+        self->itf.SetAutomaticTrafficAnnouncement = XARDSItfImpl_SetAutomaticTrafficAnnouncement;
+        self->itf.GetAutomaticTrafficAnnouncement = XARDSItfImpl_GetAutomaticTrafficAnnouncement;
+        self->itf.GetODAGroup = XARDSItfImpl_GetODAGroup;
+        self->itf.SubscribeODAGroup = XARDSItfImpl_SubscribeODAGroup;
+        self->itf.UnsubscribeODAGroup = XARDSItfImpl_UnsubscribeODAGroup;
+        self->itf.ListODAGroupSubscriptions = XARDSItfImpl_ListODAGroupSubscriptions;
+        self->itf.RegisterRDSCallback = XARDSItfImpl_RegisterRDSCallback;
+        self->itf.RegisterODADataCallback = XARDSItfImpl_RegisterODADataCallback;
+
+        /* init variables */
+
+        self->odaDataCallback = NULL;
+        self->odaDataContext = NULL;
+        self->odaDataCbPtrToSelf = NULL;
+        self->odaGroupCallback = NULL;
+        self->odaGroupContext = NULL;
+        self->odaGroupCbPtrToSelf = NULL;
+        self->rdsCallback = NULL;
+        self->rdsContext = NULL;
+        self->rdsCbPtrToSelf = NULL;
+
+        XAAdaptationBase_AddEventHandler( adapCtx, &XARDSItfImpl_AdaptCb, XA_RDSITFEVENTS, self );
+
+        self->adapCtx = adapCtx;
+
+        self->self = self;
+    }
+
+    DEBUG_API("<-XARDSItfImpl_Create");
+    return self;
+}
+
+/* void XARDSItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+ * @param void *pHandlerCtx - pointer to cb context (XARadioItfImpl)
+ * @param XAAdaptEvent *event  - Event
+ * Description: Event handler for adaptation events
+ */
+void XARDSItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+{
+    XARDSItfImpl* impl =(XARDSItfImpl*)pHandlerCtx;
+    DEBUG_API("->XARDSItfImpl_AdaptCb");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XARadioItfImpl_AdaptCb, invalid context pointer!");
+        DEBUG_API("<-XARDSItfImpl_AdaptCb");
+        return;
+    }
+    assert(event);
+
+    if( event->eventid == XA_ADAPT_RDS_GET_ODA_GROUP_DONE && impl->odaGroupCallback )
+    {
+        /* stubbed (enough for emulation purposes) */
+        /* XA_BOOLEAN_FALSE and -1 means oda group not found */
+        impl->odaGroupCallback( (XARadioItf) impl->odaGroupCbPtrToSelf, impl->odaGroupContext, XA_BOOLEAN_FALSE, -1, 0 );
+    }
+    DEBUG_API("<-XARDSItfImpl_AdaptCb");
+}
+#endif
+/**
+ * void XARDSItfImpl_Free(XARDSItfImpl* self)
+ * @param  XARDSItfImpl* self -
+ **/
+void XARDSItfImpl_Free(XARDSItfImpl* self)
+{
+    DEBUG_API("->XARDSItfImpl_Free");
+    XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS(XATSRadio);
+    assert(self==self->self);
+#ifdef _GSTREAMER_BACKEND_
+    XAAdaptationBase_RemoveEventHandler( self->adapCtx, &XARDSItfImpl_AdaptCb );
+
+    XARDSItfAdapt_Free(self->adapCtx);
+#endif
+    free(self);
+    XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS(XATSRadio);
+    DEBUG_API("<-XARDSItfImpl_Free");
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/radio/xardsitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,138 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XARDSITF_H
+#define XARDSITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAAdaptationContextBase.h"
+#include "XARDSItfAdaptation.h"
+#endif
+/** MACROS **/
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAEqualizerItf implementation */
+typedef struct XARDSItfImpl_
+{
+    /* parent interface */
+    struct XARDSItf_ itf;
+    /* pointer to self */
+    struct XARDSItfImpl_* self;
+
+    /* variables */
+
+    xaRDSCallback           rdsCallback;
+    void                   *rdsContext;
+    XARDSItf               rdsCbPtrToSelf;
+
+    xaGetODAGroupCallback   odaGroupCallback;
+    void                   *odaGroupContext;
+    XARDSItf               odaGroupCbPtrToSelf;
+
+    xaNewODADataCallback    odaDataCallback;
+    void                   *odaDataContext;
+    XARDSItf               odaDataCbPtrToSelf;
+
+#ifdef _GSTREAMER_BACKEND_
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+} XARDSItfImpl;
+
+/** METHODS **/
+
+/* Base interface XARDSItf implementation */
+
+XAresult XARDSItfImpl_QueryRDSSignal(XARDSItf self, XAboolean * isSignal);
+
+XAresult XARDSItfImpl_GetProgrammeServiceName(XARDSItf self, XAchar * ps);
+
+XAresult XARDSItfImpl_GetRadioText(XARDSItf self, XAchar * rt);
+
+XAresult XARDSItfImpl_GetRadioTextPlus(XARDSItf self,
+                                       XAuint8 contentType,
+                                       XAchar * informationElement,
+                                       XAchar * descriptor,
+                                       XAuint8 * descriptorContentType);
+
+XAresult XARDSItfImpl_GetProgrammeType(XARDSItf self, XAuint32 * pty);
+
+XAresult XARDSItfImpl_GetProgrammeTypeString(XARDSItf self,
+                                             XAboolean isLengthMax16,
+                                             XAchar * pty);
+
+XAresult XARDSItfImpl_GetProgrammeIdentificationCode(XARDSItf self, XAint16 * pi);
+
+XAresult XARDSItfImpl_GetClockTime(XARDSItf self, XAtime * dateAndTime);
+
+XAresult XARDSItfImpl_GetTrafficAnnouncement(XARDSItf self, XAboolean * ta);
+
+XAresult XARDSItfImpl_GetTrafficProgramme(XARDSItf self, XAboolean * tp);
+
+XAresult XARDSItfImpl_SeekByProgrammeType(XARDSItf self,
+                                          XAuint32 pty,
+                                          XAboolean upwards);
+
+XAresult XARDSItfImpl_SeekTrafficAnnouncement(XARDSItf self, XAboolean upwards);
+
+XAresult XARDSItfImpl_SeekTrafficProgramme(XARDSItf self, XAboolean upwards);
+
+XAresult XARDSItfImpl_SetAutomaticSwitching(XARDSItf self, XAboolean automatic);
+
+XAresult XARDSItfImpl_GetAutomaticSwitching(XARDSItf self, XAboolean * automatic);
+
+XAresult XARDSItfImpl_SetAutomaticTrafficAnnouncement(XARDSItf self, XAboolean automatic);
+
+XAresult XARDSItfImpl_GetAutomaticTrafficAnnouncement(XARDSItf self, XAboolean * automatic);
+
+XAresult XARDSItfImpl_GetODAGroup(XARDSItf self,
+                                  XAuint16 AID,
+                                  xaGetODAGroupCallback callback,
+                                  void * pContext);
+
+XAresult XARDSItfImpl_SubscribeODAGroup(XARDSItf self,
+                                        XAint16 group,
+                                        XAboolean useErrorCorrection);
+
+XAresult XARDSItfImpl_UnsubscribeODAGroup(XARDSItf self, XAint16 group);
+
+XAresult XARDSItfImpl_ListODAGroupSubscriptions(XARDSItf self,
+                                                XAint16* pGroups,
+                                                XAuint32* pLength);
+
+XAresult XARDSItfImpl_RegisterRDSCallback(XARDSItf self,
+                                          xaRDSCallback callback,
+                                          void * pContext);
+
+XAresult XARDSItfImpl_RegisterODADataCallback(XARDSItf self,
+                                              xaNewODADataCallback callback,
+                                              void * pContext);
+#ifdef _GSTREAMER_BACKEND_
+
+/* XARDSItfImpl -specific methods */
+XARDSItfImpl* XARDSItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
+
+void XARDSItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
+#endif
+void XARDSItfImpl_Free(XARDSItfImpl* self);
+
+#endif /* XARDSITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/vibra/xavibradevice.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,315 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xavibradevice.h"
+#include "xavibraitf.h"
+#include "xaconfigextensionsitf.h"
+#include "xadynintmgmtitf.h"
+
+
+/* Static mapping of enumeration XAVibraDeviceInterfaces to interface iids */
+static const XAInterfaceID* XAVibraDeviceItfIIDs[VIBRA_ITFCOUNT]=
+{
+    &XA_IID_OBJECT,
+    &XA_IID_CONFIGEXTENSION,
+    &XA_IID_VIBRA,
+    &XA_IID_DYNAMICINTERFACEMANAGEMENT
+};
+
+
+/*****************************************************************************
+ * Global methods
+ *****************************************************************************/
+/*
+ * XAresult XAVibraDeviceImpl_CreateVibraDevice
+ * Description: Create object
+ */
+XAresult XAVibraDeviceImpl_CreateVibraDevice(XAObjectItf* pDevice,
+                                             XAuint32 deviceID,
+                                             XAuint32 numInterfaces,
+                                             const XAInterfaceID * pInterfaceIds,
+                                             const XAboolean * pInterfaceRequired)
+{
+    XAVibraDeviceImpl* pImpl = NULL;
+    XAObjectItfImpl* pBaseObj = NULL;
+    XAuint8 itfIndex = 0;
+
+    DEBUG_API("->XAVibraDeviceImpl_CreateVibraDevice");
+
+    if( !pDevice )
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraDeviceImpl_CreateVibraDevice");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* instantiate object implementation */
+    pImpl = (XAVibraDeviceImpl*)calloc(1,sizeof(XAVibraDeviceImpl));
+    if( !pImpl )
+    {
+        /* memory allocation failed */
+        DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+        DEBUG_API("<-XAVibraDeviceImpl_CreateVibraDevice");
+        return XA_RESULT_MEMORY_FAILURE;
+    }
+    pBaseObj = &pImpl->baseObj;
+
+    /* Initialize base object default implementation */
+    XAObjectItfImpl_Init(pBaseObj,
+                         VIBRA_ITFCOUNT,
+                         XAVibraDeviceItfIIDs,
+                         XAVibraDeviceImpl_DoRealize,
+                         XAVibraDeviceImpl_DoResume,
+                         XAVibraDeviceImpl_FreeResources);
+
+    /* Mark interfaces that need to be exposed */
+    /* Implicit and mandated interfaces */
+    pBaseObj->interfaceMap[VIBRA_VIBRAITF].required = XA_BOOLEAN_TRUE;
+    pBaseObj->interfaceMap[VIBRA_DIMITF].required = XA_BOOLEAN_TRUE;
+
+    /* Explicit interfaces */
+    if( (numInterfaces != 0) && pInterfaceIds && pInterfaceRequired )
+    {
+        /* Check required interfaces */
+        for( itfIndex = 0; itfIndex < numInterfaces; itfIndex++ )
+        {
+            /* If mapEntry is null then required interface is not supported.*/
+            XAObjItfMapEntry *entry =
+                XAObjectItfImpl_GetItfEntry((XAObjectItf)&(pBaseObj), pInterfaceIds[itfIndex]);
+            if( !entry  )
+            {
+                if( pInterfaceRequired[itfIndex] )
+                {
+                    /* required interface cannot be accommodated - fail creation */
+                    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+                    DEBUG_ERR("Required interface not found - abort creation!");
+                    DEBUG_API("<-XAVibraDeviceImpl_CreateVibraDevice");
+                    return XA_RESULT_FEATURE_UNSUPPORTED;
+                }
+                else
+                {
+                    DEBUG_INFO("Requested (not required) interface not found - continue creation");
+                }
+            }
+            else
+            {
+                entry->required = XA_BOOLEAN_TRUE;
+            }
+        }
+    }
+
+    /* Initialize XAVibraDeviceImpl variables */
+    pImpl->deviceID = deviceID;
+
+#ifdef _GSTREAMER_BACKEND_
+    pImpl->adaptationCtx = XAVibraAdapt_Create(pImpl->deviceID);
+#endif
+    
+    /* This code is put here to return Feature Not Supported since adaptation is not present*/
+    /*************************************************/
+    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+    DEBUG_ERR("Required interface not found - abort creation!");
+    DEBUG_API("<-XAVibraDeviceImpl_CreateVibraDevice");
+    return XA_RESULT_FEATURE_UNSUPPORTED;
+    /*************************************************/
+    
+    /* Set ObjectItf to point to newly created object */
+/*    *pDevice = (XAObjectItf)&(pBaseObj->self);
+
+    DEBUG_API("<-XAVibraDeviceImpl_Create");
+    return XA_RESULT_SUCCESS;*/
+}
+/* XAResult XAVibraDeviceImpl_QueryNumSupportedInterfaces
+ * Description: Statically query number of supported interfaces
+ */
+XAresult XAVibraDeviceImpl_QueryNumSupportedInterfaces(XAuint32 *pNumSupportedInterfaces)
+{
+    DEBUG_API("->XAVibraDeviceImpl_QueryNumSupportedInterfaces");
+    if( pNumSupportedInterfaces )
+    {
+        *pNumSupportedInterfaces = VIBRA_ITFCOUNT;
+
+        DEBUG_API_A1("<-XAVibraDeviceImpl_QueryNumSupportedInterfaces - %ld", *pNumSupportedInterfaces );
+        return XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraDeviceImpl_QueryNumSupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+}
+/* XAResult XACVibraDeviceImpl_QuerySupportedInterfaces
+ * Description: Statically query supported interfaces
+ */
+XAresult XAVibraDeviceImpl_QuerySupportedInterfaces(XAuint32 index,
+                                                    XAInterfaceID *pInterfaceId)
+{
+    DEBUG_API("->XAVibraDeviceImpl_QuerySupportedInterfaces");
+
+    if( index >= VIBRA_ITFCOUNT || !pInterfaceId )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraDeviceImpl_QuerySupportedInterfaces");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    else
+    {
+        *pInterfaceId = *(XAVibraDeviceItfIIDs[index]);
+
+        DEBUG_API("<-XAVibraDeviceImpl_QuerySupportedInterfaces");
+        return XA_RESULT_SUCCESS;
+    }
+}
+/*****************************************************************************
+ * base object XAObjectItfImpl methods
+ *****************************************************************************/
+/* XAResult XAVibraDeviceImpl_DoRealize
+ * Description: Realize all implicit and explicitly wanted interfaces.
+ * Create and initialize implementation-specific variables.
+ * Called from base object XAObjectItfImpl
+ */
+XAresult XAVibraDeviceImpl_DoRealize(XAObjectItf self)
+{
+    XAuint8 itfIdx = 0;
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
+    XAVibraDeviceImpl* pObjImpl = (XAVibraDeviceImpl*)(pObj);
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAVibraDeviceImpl_DoRealize");
+
+    /* check casting from correct pointer type */
+    if( !pObjImpl || pObj != pObjImpl->baseObj.self )
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraDeviceImpl_DoRealize");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+#ifdef _GSTREAMER_BACKEND_
+    ret = XAVibraAdapt_PostInit( pObjImpl->adaptationCtx );
+#endif
+    if( ret != XA_RESULT_SUCCESS )
+    {
+        DEBUG_API("<-XAVibraDeviceImpl_DoRealize");
+        return ret;
+    }
+
+    /* Realize all implicit and explicitly wanted interfaces */
+    for( itfIdx = 0; itfIdx < VIBRA_ITFCOUNT; itfIdx++)
+    {
+        if( !(pObj->interfaceMap[itfIdx].pItf) &&
+            pObj->interfaceMap[itfIdx].required )
+        {
+            void *pItf = NULL;
+            switch( itfIdx )
+            {
+                case VIBRA_VIBRAITF:
+#ifdef _GSTREAMER_BACKEND_
+                    pItf = XAVibraItfImpl_Create(pObjImpl->adaptationCtx);
+#endif
+                    break;
+                case VIBRA_CONFIGEXTENSIONITF:
+                    pItf = XAConfigExtensionsItfImpl_Create();
+                    break;
+                case VIBRA_DIMITF:
+                    pItf = XADIMItfImpl_Create();
+                    break;
+                default:
+                    break;
+            }
+            if( !pItf )
+            {
+                /* memory allocation failed */
+                DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
+                DEBUG_API("<-XAVibraDeviceImpl_DoRealize");
+                return XA_RESULT_MEMORY_FAILURE;
+            }
+            else
+            {
+                pObj->interfaceMap[itfIdx].pItf = pItf;
+            }
+        }
+    }
+
+    pObj->state = XA_OBJECT_STATE_REALIZED;
+    DEBUG_API("<-XAVibraDeviceImpl_DoRealize");
+    return XA_RESULT_SUCCESS;
+}
+
+/* XAResult XAVibraDeviceImpl_DoResume
+ * Description: Resume object from suspended state
+ */
+XAresult XAVibraDeviceImpl_DoResume(XAObjectItf self)
+{
+    DEBUG_API("->XAVibraDeviceImpl_DoResume");
+    DEBUG_API("<-XAVibraDeviceImpl_DoResume");
+    /* This implementation does not support suspended state */
+    return XA_RESULT_PRECONDITIONS_VIOLATED;
+}
+/* void XAVibraDeviceImpl_FreeResources
+ * Description: Free all resources reserved at XAVibraDeviceImpl_DoRealize()
+ */
+void XAVibraDeviceImpl_FreeResources(XAObjectItf self)
+{
+    XAObjectItfImpl* pObj = (XAObjectItfImpl*) (*self);
+    
+    XAuint8 itfIdx = 0;
+    DEBUG_API("->XAVibraDeviceImpl_FreeResources");
+#ifdef _GSTREAMER_BACKEND_
+    XAVibraDeviceImpl* pImpl = (XAVibraDeviceImpl*) (*self);
+    assert( pObj && pImpl && pObj == pObj->self );
+    if (pImpl->adaptationCtx != NULL)
+    {
+        XAVibraAdapt_Destroy(pImpl->adaptationCtx);
+        pImpl->adaptationCtx = NULL;
+    }
+#endif
+    /* free all allocated interfaces */
+    for (itfIdx = 0; itfIdx < VIBRA_ITFCOUNT; itfIdx++)
+    {
+        void *pItf = pObj->interfaceMap[itfIdx].pItf;
+        if (pItf)
+        {
+            switch (itfIdx)
+            {
+                 case VIBRA_VIBRAITF:
+                     XAVibraItfImpl_Free( pItf );
+                     break;
+                 case VIBRA_CONFIGEXTENSIONITF:
+                     XAConfigExtensionsItfImpl_Free( pItf );
+                     break;
+                 case VIBRA_DIMITF:
+                     XADIMItfImpl_Free( pItf );
+                     break;
+                 default:
+                     break;
+            }
+            pObj->interfaceMap[itfIdx].pItf = NULL;
+        }
+    }
+
+    DEBUG_API("<-XAVibraDeviceImpl_FreeResources");
+
+    return;
+}
+/* END OF FILE*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/vibra/xavibradevice.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAVIBRADEVICE_H
+#define XAVIBRADEVICE_H
+
+#include "openmaxalwrapper.h"
+#include "xaobjectitf.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "../adaptation/XAVibraAdaptCtx.h"
+#endif
+/** MACROS **/
+
+
+/** TYPES **/
+
+
+/** ENUMERATIONS **/
+/* Enumeration for interfaces that CameraDevice supports.  */
+typedef enum
+{
+    VIBRA_OBJECTITF,
+    VIBRA_CONFIGEXTENSIONITF,
+    VIBRA_VIBRAITF,
+    VIBRA_DIMITF,
+    VIBRA_ITFCOUNT
+} XAVibraDeviceInterfaces;
+
+/** STRUCTURES **/
+/* Specification for VibraDeviceImpl. */
+typedef struct XAVibraDeviceImpl_
+{
+    /* Parent for XACameraDeviceImpl */
+    XAObjectItfImpl baseObj;
+
+    /* variables */
+    XAuint32 deviceID;
+
+#ifdef _GSTREAMER_BACKEND_
+    XAAdaptationBaseCtx* adaptationCtx;
+#endif
+} XAVibraDeviceImpl;
+
+/** METHODS **/
+
+/* base object XAObjectItfImpl methods */
+XAresult    XAVibraDeviceImpl_DoRealize(XAObjectItf self);
+XAresult    XAVibraDeviceImpl_DoResume(XAObjectItf self);
+void        XAVibraDeviceImpl_FreeResources(XAObjectItf self);
+
+#endif /* XAVIBRADEVICE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/vibra/xavibraitf.c	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,280 @@
+/*
+* 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 <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "xavibraitf.h"
+#ifdef _GSTREAMER_BACKEND_
+#include "XAVibraItfAdaptation.h"
+#endif
+#include "xathreadsafety.h"
+/* XAVibraItfImpl* GetImpl(XAVibraItf self)
+ * Description: Validate interface pointer and cast it to implementation pointer.
+*/
+static XAVibraItfImpl* GetImpl(XAVibraItf self)
+{
+    if( self )
+    {
+        XAVibraItfImpl* impl = (XAVibraItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/*****************************************************************************
+ * Base interface XAVibraItf implementation
+ *****************************************************************************/
+/*
+ * XAresult XAVibraItfImpl_Vibrate ( XAVibraItf self, XAboolean vibrate )
+ * Description: Activates or deactivates vibration for the I/O device.
+ */
+XAresult XAVibraItfImpl_Vibrate ( XAVibraItf self,
+                                  XAboolean vibrate )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVibraItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAVibraItfImpl_Vibrate");
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSVibra);
+
+    if( !impl )
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSVibra);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraItfImpl_Vibrate");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is vibrate mode changed */
+    if( impl->vibrate != vibrate )
+    {
+#ifdef _GSTREAMER_BACKEND_
+        ret = XAVibraItfAdapt_Vibrate( impl->adapCtx, vibrate );
+#endif
+        if ( ret == XA_RESULT_SUCCESS )
+        {
+            impl->vibrate = vibrate;
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSVibra);
+    DEBUG_API("<-XAVibraItfImpl_Vibrate");
+    return ret;
+}
+/*
+ * XAresult XAVibraItfImpl_IsVibrating ( XAVibraItf self, XAboolean * pVibrating )
+ * Description: Returns whether the I/O device is vibrating.
+ */
+XAresult XAVibraItfImpl_IsVibrating ( XAVibraItf self, XAboolean * pVibrating )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVibraItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAVibraItfImpl_IsVibrating");
+
+    if( !impl || !pVibrating)
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraItfImpl_IsVibrating");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pVibrating = impl->vibrate;
+
+    if( *pVibrating )
+    {
+        DEBUG_API("It's vibrating");
+    }
+    else
+    {
+        DEBUG_API("Vibrate is off.");
+    }
+
+    DEBUG_API("<-XAVibraItfImpl_IsVibrating");
+    return ret;
+}
+/*
+ * XAresult XAVibraItfImpl_SetFrequency ( XAVibraItf self,  XAmilliHertz frequency )
+ * Description: Sets the vibration frequency of the I/O device.
+ */
+XAresult XAVibraItfImpl_SetFrequency ( XAVibraItf self, XAmilliHertz frequency )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVibraItfImpl* impl = GetImpl(self);
+
+    DEBUG_API_A1("->XAVibraItfImpl_SetFrequency %ld", frequency);
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSVibra);
+
+    if( !impl || frequency < MIN_FREQUENCY || frequency > MAX_FREQUENCY)
+    {
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSVibra);
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraItfImpl_SetFrequency");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is vibration frequency changed */
+    if( impl->frequency != frequency )
+    {
+#ifdef _GSTREAMER_BACKEND_
+        ret = XAVibraItfAdapt_SetFrequency( impl->adapCtx, frequency );
+#endif
+        if( ret == XA_RESULT_SUCCESS )
+        {
+            impl->frequency = frequency;
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSVibra);
+    DEBUG_API("<-XAVibraItfImpl_SetFrequency");
+    return ret;
+}
+/*
+ * XAresult XAVibraItfImpl_GetFrequency ( XAVibraItf self,  XAmilliHertz * pFrequency )
+ * Description: Returns the vibration frequency of the I/O device.
+ */
+XAresult XAVibraItfImpl_GetFrequency ( XAVibraItf self, XAmilliHertz * pFrequency )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVibraItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAVibraItfImpl_GetFrequency");
+    if( !impl || !pFrequency)
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraItfImpl_GetFrequency");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pFrequency = impl->frequency;
+
+    DEBUG_API_A1("Frequency is %ld", *pFrequency);
+    DEBUG_API("<-XAVibraItfImpl_GetFrequency");
+    return ret;
+}
+/*
+ * XAresult XAVibraItfImpl_SetIntensity ( XAVibraItf self,  XApermille intensity )
+ * Description: Sets the vibration intensity of the Vibra I/O device.
+ */
+XAresult XAVibraItfImpl_SetIntensity ( XAVibraItf self, XApermille intensity )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVibraItfImpl* impl = GetImpl(self);
+    DEBUG_API_A1("->XAVibraItfImpl_SetIntensity %d", intensity);
+    XA_IMPL_THREAD_SAFETY_ENTRY(XATSVibra);
+
+    if( !impl || intensity < MIN_INTENSITY || intensity > MAX_INTENSITY )
+    {
+        /* invalid parameter */
+        XA_IMPL_THREAD_SAFETY_EXIT(XATSVibra);
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraItfImpl_SetIntensity");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check is vibration intensity changed */
+    if( impl->intensity != intensity )
+    {
+#ifdef _GSTREAMER_BACKEND_
+        ret = XAVibraItfAdapt_SetIntensity( impl->adapCtx, intensity );
+#endif
+        if( ret == XA_RESULT_SUCCESS )
+        {
+            impl->intensity = intensity;
+        }
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT(XATSVibra);
+    DEBUG_API("<-XAVibraItfImpl_SetIntensity");
+    return ret;
+}
+/*
+ * XAresult XAVibraItfImpl_GetIntensity ( XAVibraItf self, XApermille * pIntensity )
+ * Description: Returns the vibration intensity of the Vibra I/O device.
+ */
+XAresult XAVibraItfImpl_GetIntensity ( XAVibraItf self, XApermille * pIntensity )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAVibraItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAVibraItfImpl_GetIntensity");
+
+    if( !impl || !pIntensity)
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVibraItfImpl_GetIntensity");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pIntensity = impl->intensity;
+
+    DEBUG_API_A1("Intensity is %d", *pIntensity);
+    DEBUG_API("<-XAVibraItfImpl_GetIntensity");
+    return ret;
+}
+
+#ifdef _GSTREAMER_BACKEND_
+
+/*****************************************************************************
+ * XAVibraItfImpl -specific methods
+ *****************************************************************************/
+/* XAVibraItfImpl* XAVibraItfImpl_Create()
+ * Description: Allocate and initialize VibraItfImpl
+ */
+XAVibraItfImpl* XAVibraItfImpl_Create( XAAdaptationBaseCtx *adapCtx )
+{
+    XAVibraItfImpl* self = (XAVibraItfImpl*) calloc(1,sizeof(XAVibraItfImpl));
+    DEBUG_API("->XAVibraItfImpl_Create");
+    if( self )
+    {
+        /* init itf default implementation*/
+        self->itf.Vibrate = XAVibraItfImpl_Vibrate;
+        self->itf.IsVibrating = XAVibraItfImpl_IsVibrating;
+        self->itf.SetFrequency = XAVibraItfImpl_SetFrequency;
+        self->itf.GetFrequency = XAVibraItfImpl_GetFrequency;
+        self->itf.SetIntensity = XAVibraItfImpl_SetIntensity;
+        self->itf.GetIntensity = XAVibraItfImpl_GetIntensity;
+
+        /* init variables*/
+        self->vibrate = XA_BOOLEAN_FALSE;
+        self->frequency = 0;
+        self->intensity = 0;
+        self->adapCtx = adapCtx;
+
+        self->self = self;
+    }
+
+    DEBUG_API("<-XAVibraItfImpl_Create");
+    return self;
+}
+#endif
+/* void XAVibraItfImpl_Free(XAVibraItfImpl* self)
+ * Description: Free all resources reserved at XAVibraItfImpl_Create
+ */
+void XAVibraItfImpl_Free(XAVibraItfImpl* self)
+{
+    DEBUG_API("->XAVibraItfImpl_Free");
+    assert( self==self->self );
+    free( self );
+    DEBUG_API("<-XAVibraItfImpl_Free");
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/vibra/xavibraitf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,73 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef XAVIBRAITF_H
+#define XAVIBRAITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#ifdef _GSTREAMER_BACKEND_  
+#include "XAAdaptationContextBase.h"
+#endif
+/** MACROS **/
+#define MIN_INTENSITY 0
+#define MAX_INTENSITY 1000
+#define MIN_FREQUENCY 0x00000001
+#define MAX_FREQUENCY 0xFFFFFFFF
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+
+/* Definition of XAXAVibraItfItf implementation */
+typedef struct XAVibraItfImpl_
+{
+   /* parent interface */
+    struct XAVibraItf_ itf;
+    /* pointer to self */
+    struct XAVibraItfImpl_* self;
+
+    /* variables */
+    XAboolean       vibrate;
+    XAmilliHertz    frequency;
+    XApermille      intensity;
+
+#ifdef _GSTREAMER_BACKEND_  
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+#endif
+} XAVibraItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAVibraItf implementation
+ * See API Specification for method documentation
+*/
+XAresult XAVibraItfImpl_Vibrate ( XAVibraItf self, XAboolean vibrate );
+XAresult XAVibraItfImpl_IsVibrating ( XAVibraItf self, XAboolean * pVibrating );
+XAresult XAVibraItfImpl_SetFrequency ( XAVibraItf self, XAmilliHertz frequency );
+XAresult XAVibraItfImpl_GetFrequency ( XAVibraItf self, XAmilliHertz * pFrequency );
+XAresult XAVibraItfImpl_SetIntensity ( XAVibraItf self, XApermille intensity );
+XAresult XAVibraItfImpl_GetIntensity ( XAVibraItf self, XApermille * pIntensity );
+
+#ifdef _GSTREAMER_BACKEND_  
+/* XAVibraItfImpl -specific methods*/
+XAVibraItfImpl* XAVibraItfImpl_Create( XAAdaptationBaseCtx *adapCtx );
+#endif
+void XAVibraItfImpl_Free(XAVibraItfImpl* self);
+#endif /* XAVIBRAITF_H */
--- a/layers.sysdef.xml	Tue Feb 02 01:08:46 2010 +0200
+++ b/layers.sysdef.xml	Fri Apr 16 15:29:42 2010 +0300
@@ -13,9 +13,6 @@
 			<module name="">
 				<unit unitID="mmmw_3GPExtParserLib" mrp="" bldFile="&layer_real_source_path;/mmserv/metadatautility/3GPExtParserLib/group" filter="!sf_build" name="mmmw_3GPExtParserLib" />
 			</module>
-			<module name="">
-				<unit unitID="mtp" mrp="" bldFile="&layer_real_source_path;/mtp/group" filter="!sf_build" name="mtp" />
-			</module>
     </layer>
     
   	<layer name="api_test_layer">
@@ -49,9 +46,6 @@
 			<module name="">
 				<unit unitID="mmmw_3GPExtParserLib_group" mrp="" bldFile="&layer_real_source_path;/mmserv/metadatautility/3GPExtParserLib/group" filter="!sf_build" name="mmmw_3GPExtParserLib_group" />
 			</module>
-			<module name="">
-				<unit unitID="mtp_group" mrp="" bldFile="&layer_real_source_path;/mtp/group" filter="!sf_build" name="mtp_group" />
-			</module>
     </layer>
 
   	<layer name="mw_mmmw_tms_layer">
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpDataSourceAdapter/EABI/3gpDataSourceAdapteru.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpDataSourceAdapter/EABI/3gpDataSourceAdapteru.def	Fri Apr 16 15:29:42 2010 +0300
@@ -24,15 +24,15 @@
 	_ZTIN21C3gpDataSourceAdapter21CAsyncProxyFillBufferE @ 23 NONAME
 	_ZTV21C3gpDataSourceAdapter @ 24 NONAME
 	_ZTVN21C3gpDataSourceAdapter21CAsyncProxyFillBufferE @ 25 NONAME
-	_ZThn60_N21C3gpDataSourceAdapter12EmptyBufferLEP10CMMFBufferP11MDataSource8TMediaId @ 26 NONAME
-	_ZThn60_N21C3gpDataSourceAdapter13BufferFilledLEP10CMMFBuffer @ 27 NONAME
-	_ZThn60_N21C3gpDataSourceAdapter14ConstructSinkLERK6TDesC8 @ 28 NONAME
-	_ZThn60_N21C3gpDataSourceAdapter16SinkDataTypeCodeE8TMediaId @ 29 NONAME
-	_ZThn60_N21C3gpDataSourceAdapter17CreateSinkBufferLE8TMediaIdRi @ 30 NONAME
-	_ZThn60_N21C3gpDataSourceAdapter19CanCreateSinkBufferEv @ 31 NONAME
-	_ZThn60_N21C3gpDataSourceAdapterD0Ev @ 32 NONAME
-	_ZThn60_N21C3gpDataSourceAdapterD1Ev @ 33 NONAME
-	_ZThn76_N21C3gpDataSourceAdapter10GetBitRateERj @ 34 NONAME
-	_ZThn76_N21C3gpDataSourceAdapter12BufferFilledEP10CMMFBuffer @ 35 NONAME
-	_ZThn76_N21C3gpDataSourceAdapter5EventE4TUid @ 36 NONAME
+	_ZThn64_N21C3gpDataSourceAdapter12EmptyBufferLEP10CMMFBufferP11MDataSource8TMediaId @ 26 NONAME
+	_ZThn64_N21C3gpDataSourceAdapter13BufferFilledLEP10CMMFBuffer @ 27 NONAME
+	_ZThn64_N21C3gpDataSourceAdapter14ConstructSinkLERK6TDesC8 @ 28 NONAME
+	_ZThn64_N21C3gpDataSourceAdapter16SinkDataTypeCodeE8TMediaId @ 29 NONAME
+	_ZThn64_N21C3gpDataSourceAdapter17CreateSinkBufferLE8TMediaIdRi @ 30 NONAME
+	_ZThn64_N21C3gpDataSourceAdapter19CanCreateSinkBufferEv @ 31 NONAME
+	_ZThn64_N21C3gpDataSourceAdapterD0Ev @ 32 NONAME
+	_ZThn64_N21C3gpDataSourceAdapterD1Ev @ 33 NONAME
+	_ZThn80_N21C3gpDataSourceAdapter10GetBitRateERj @ 34 NONAME
+	_ZThn80_N21C3gpDataSourceAdapter12BufferFilledEP10CMMFBuffer @ 35 NONAME
+	_ZThn80_N21C3gpDataSourceAdapter5EventE4TUid @ 36 NONAME
 
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpDataSourceAdapter/Src/3gpDataSourceAdapter.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpDataSourceAdapter/Src/3gpDataSourceAdapter.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -254,6 +254,10 @@
         }
 	if ((iSourceType == KUidMmfFileSource) || (iSourceType == KOldProgDLSourceUid))
     	{ // parser has file handle
+	   	if (iSourceType == KUidMmfFileSource) 
+			{
+		    	iIsLocalPlayback = ETrue;
+			}
 		// read async from lib when it has a file handle
 		iClip = static_cast<CMMFClip*>(iDataSource);
         iDataSource->SourcePrimeL();
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudioplaycontroller/Data/3GPAudioPlayControllerResource.rss	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudioplaycontroller/Data/3GPAudioPlayControllerResource.rss	Fri Apr 16 15:29:42 2010 +0300
@@ -32,6 +32,7 @@
     {
     shared_buffer_max_num = 2;
     shared_buffer_max_size = 20480;
+    shared_buffer_max_size_non_seekable_source = 20480;
     sampling_rate = EAapSampleRate16000Hz;
     stereo_support = 2;
     metadata_support = EAapMetadataSupportTrue;
@@ -66,6 +67,7 @@
     {
     shared_buffer_max_num = 2;
     shared_buffer_max_size = 8192;
+    shared_buffer_max_size_non_seekable_source = 8192;
     sampling_rate = EAapSampleRate8000Hz;
     stereo_support = 0;
     metadata_support = EAapMetadataSupportTrue;
@@ -90,6 +92,7 @@
     {
     shared_buffer_max_num = 2;
     shared_buffer_max_size = 8192;
+    shared_buffer_max_size_non_seekable_source = 8192;
     sampling_rate = EAapSampleRate16000Hz;
     stereo_support = 0;
     metadata_support = EAapMetadataSupportTrue;
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudioplaycontroller/Src/3GPAudioPlayControllerPlugin.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudioplaycontroller/Src/3GPAudioPlayControllerPlugin.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -267,6 +267,7 @@
     TAapProperties aapProperties = iAudioResource->PropertiesL();
     iSharedBufferMaxNum = aapProperties.iSharedBufferMaxNum;
     iSharedBufferMaxSize = aapProperties.iSharedBufferMaxSize;
+    iSharedBufferMaxSizeForNonSeekableSrc = aapProperties.iSharedBufferMaxSizeForNonSeekableSrc;
     iMetaDataSupport = aapProperties.iMetaDataSupport;
 	iChannels = (aapProperties.iStereoSupport < 2) ? 1 : 2;
 	iSinkNumChannels = iChannels; // Default same as source
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudiorecordcontroller/Data/3GPAudioRecordControllerResource.rss	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudiorecordcontroller/Data/3GPAudioRecordControllerResource.rss	Fri Apr 16 15:29:42 2010 +0300
@@ -32,6 +32,7 @@
     {
     shared_buffer_max_num = 2;
     shared_buffer_max_size = 20480;
+    shared_buffer_max_size_non_seekable_source = 20480;
     sampling_rate = EAapSampleRate8000Hz;
     stereo_support = 1;
     metadata_support = EAapMetadataSupportFalse;
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudiorecordcontroller/Src/3GPAudioRecordControllerPlugin.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudiorecordcontroller/Src/3GPAudioRecordControllerPlugin.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -58,6 +58,7 @@
     DP0(_L("C3GPAudioRecordControllerPlugin::ConstructL(3)"));
     iSharedBufferMaxNum = aapProperties.iSharedBufferMaxNum;    // default size
     iSharedBufferMaxSize = aapProperties.iSharedBufferMaxSize;    // default size
+    iSharedBufferMaxSizeForNonSeekableSrc = aapProperties.iSharedBufferMaxSizeForNonSeekableSrc;
 
     iMetaData = C3GPAudioRecordControllerMetaData::NewL();
 
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/EABI/AdvancedAudioControllerU.DEF	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/EABI/AdvancedAudioControllerU.DEF	Fri Apr 16 15:29:42 2010 +0300
@@ -323,49 +323,49 @@
 	_ZTV24CAdvancedAudioController @ 322 NONAME
 	_ZTV28CAdvancedAudioPlayController @ 323 NONAME
 	_ZTV30CAdvancedAudioRecordController @ 324 NONAME
-	_ZThn164_N28CAdvancedAudioPlayController12RefillBufferEP10CMMFBuffer @ 325 NONAME
-	_ZThn164_N28CAdvancedAudioPlayController14LastBufferSentEv @ 326 NONAME
-	_ZThn164_N28CAdvancedAudioPlayController16PlaybackCompleteEv @ 327 NONAME
-	_ZThn164_N28CAdvancedAudioPlayController9SendEventERK9TMMFEvent @ 328 NONAME
-	_ZThn164_N30CAdvancedAudioRecordController12EmptyBufferLEP10CMMFBuffer @ 329 NONAME
-	_ZThn164_N30CAdvancedAudioRecordController14RecordCompleteEv @ 330 NONAME
-	_ZThn164_N30CAdvancedAudioRecordController9SendEventERK9TMMFEvent @ 331 NONAME
-	_ZThn168_N28CAdvancedAudioPlayController22MapcSetPlaybackWindowLERK25TTimeIntervalMicroSecondsS2_ @ 332 NONAME
-	_ZThn168_N28CAdvancedAudioPlayController23MapcGetLoadingProgressLERi @ 333 NONAME
-	_ZThn168_N28CAdvancedAudioPlayController25MapcDeletePlaybackWindowLEv @ 334 NONAME
-	_ZThn168_N30CAdvancedAudioRecordController19MarcSetMaxDurationLERK25TTimeIntervalMicroSeconds @ 335 NONAME
-	_ZThn168_N30CAdvancedAudioRecordController19MarcSetMaxFileSizeLEi @ 336 NONAME
-	_ZThn168_N30CAdvancedAudioRecordController21MarcAddMetaDataEntryLERK17CMMFMetaDataEntry @ 337 NONAME
-	_ZThn168_N30CAdvancedAudioRecordController24MarcRemoveMetaDataEntryLEi @ 338 NONAME
-	_ZThn168_N30CAdvancedAudioRecordController25MarcReplaceMetaDataEntryLEiRK17CMMFMetaDataEntry @ 339 NONAME
-	_ZThn168_N30CAdvancedAudioRecordController27MarcGetRecordTimeAvailableLER25TTimeIntervalMicroSeconds @ 340 NONAME
-	_ZThn168_N30CAdvancedAudioRecordController9MarcCropLEi @ 341 NONAME
-	_ZThn172_N28CAdvancedAudioPlayController14BitRateChangedEv @ 342 NONAME
-	_ZThn172_N28CAdvancedAudioPlayController19SeekPositionReachedEj @ 343 NONAME
-	_ZThn172_N28CAdvancedAudioPlayController28PlayWindowEndPositionReachedEv @ 344 NONAME
-	_ZThn172_N30CAdvancedAudioRecordController12MardGetGainLERi @ 345 NONAME
-	_ZThn172_N30CAdvancedAudioRecordController12MardSetGainLEi @ 346 NONAME
-	_ZThn172_N30CAdvancedAudioRecordController15MardGetBalanceLERi @ 347 NONAME
-	_ZThn172_N30CAdvancedAudioRecordController15MardGetMaxGainLERi @ 348 NONAME
-	_ZThn172_N30CAdvancedAudioRecordController15MardSetBalanceLEi @ 349 NONAME
-	_ZThn176_N28CAdvancedAudioPlayController10GetBitRateERj @ 350 NONAME
-	_ZThn176_N28CAdvancedAudioPlayController12BufferFilledEP10CMMFBuffer @ 351 NONAME
-	_ZThn176_N28CAdvancedAudioPlayController5EventE4TUid @ 352 NONAME
-	_ZThn180_N28CAdvancedAudioPlayController15MscEnableEventsEi @ 353 NONAME
-	_ZThn180_N28CAdvancedAudioPlayController22MscGetSeekingSupportedERi @ 354 NONAME
-	_ZThn180_N28CAdvancedAudioPlayController28MscGetRandomSeekingSupportedERi @ 355 NONAME
-	_ZThn184_N28CAdvancedAudioPlayController14MapcSetRepeatsEiRK25TTimeIntervalMicroSeconds @ 356 NONAME
-	_ZThn188_N28CAdvancedAudioPlayController14MapdGetVolumeLERi @ 357 NONAME
-	_ZThn188_N28CAdvancedAudioPlayController14MapdSetVolumeLEi @ 358 NONAME
-	_ZThn188_N28CAdvancedAudioPlayController15MapdGetBalanceLERi @ 359 NONAME
-	_ZThn188_N28CAdvancedAudioPlayController15MapdSetBalanceLEi @ 360 NONAME
-	_ZThn188_N28CAdvancedAudioPlayController17MapdGetMaxVolumeLERi @ 361 NONAME
-	_ZThn188_N28CAdvancedAudioPlayController18MapdSetVolumeRampLERK25TTimeIntervalMicroSeconds @ 362 NONAME
-	_ZThn192_N28CAdvancedAudioPlayController16MdcExecuteIntentEN13ContentAccess7TIntentE @ 363 NONAME
-	_ZThn192_N28CAdvancedAudioPlayController17MdcEvaluateIntentEN13ContentAccess7TIntentE @ 364 NONAME
-	_ZThn192_N28CAdvancedAudioPlayController19MdcSetAgentPropertyEN13ContentAccess14TAgentPropertyEi @ 365 NONAME
-	_ZThn192_N28CAdvancedAudioPlayController25MdcDisableAutomaticIntentEi @ 366 NONAME
-	_ZThn196_N28CAdvancedAudioPlayController28TrailingSilenceTimerCompleteEv @ 367 NONAME
+	_ZThn168_N28CAdvancedAudioPlayController12RefillBufferEP10CMMFBuffer @ 325 NONAME
+	_ZThn168_N28CAdvancedAudioPlayController14LastBufferSentEv @ 326 NONAME
+	_ZThn168_N28CAdvancedAudioPlayController16PlaybackCompleteEv @ 327 NONAME
+	_ZThn168_N28CAdvancedAudioPlayController9SendEventERK9TMMFEvent @ 328 NONAME
+	_ZThn168_N30CAdvancedAudioRecordController12EmptyBufferLEP10CMMFBuffer @ 329 NONAME
+	_ZThn168_N30CAdvancedAudioRecordController14RecordCompleteEv @ 330 NONAME
+	_ZThn168_N30CAdvancedAudioRecordController9SendEventERK9TMMFEvent @ 331 NONAME
+	_ZThn172_N28CAdvancedAudioPlayController22MapcSetPlaybackWindowLERK25TTimeIntervalMicroSecondsS2_ @ 332 NONAME
+	_ZThn172_N28CAdvancedAudioPlayController23MapcGetLoadingProgressLERi @ 333 NONAME
+	_ZThn172_N28CAdvancedAudioPlayController25MapcDeletePlaybackWindowLEv @ 334 NONAME
+	_ZThn172_N30CAdvancedAudioRecordController19MarcSetMaxDurationLERK25TTimeIntervalMicroSeconds @ 335 NONAME
+	_ZThn172_N30CAdvancedAudioRecordController19MarcSetMaxFileSizeLEi @ 336 NONAME
+	_ZThn172_N30CAdvancedAudioRecordController21MarcAddMetaDataEntryLERK17CMMFMetaDataEntry @ 337 NONAME
+	_ZThn172_N30CAdvancedAudioRecordController24MarcRemoveMetaDataEntryLEi @ 338 NONAME
+	_ZThn172_N30CAdvancedAudioRecordController25MarcReplaceMetaDataEntryLEiRK17CMMFMetaDataEntry @ 339 NONAME
+	_ZThn172_N30CAdvancedAudioRecordController27MarcGetRecordTimeAvailableLER25TTimeIntervalMicroSeconds @ 340 NONAME
+	_ZThn172_N30CAdvancedAudioRecordController9MarcCropLEi @ 341 NONAME
+	_ZThn176_N28CAdvancedAudioPlayController14BitRateChangedEv @ 342 NONAME
+	_ZThn176_N28CAdvancedAudioPlayController19SeekPositionReachedEj @ 343 NONAME
+	_ZThn176_N28CAdvancedAudioPlayController28PlayWindowEndPositionReachedEv @ 344 NONAME
+	_ZThn176_N30CAdvancedAudioRecordController12MardGetGainLERi @ 345 NONAME
+	_ZThn176_N30CAdvancedAudioRecordController12MardSetGainLEi @ 346 NONAME
+	_ZThn176_N30CAdvancedAudioRecordController15MardGetBalanceLERi @ 347 NONAME
+	_ZThn176_N30CAdvancedAudioRecordController15MardGetMaxGainLERi @ 348 NONAME
+	_ZThn176_N30CAdvancedAudioRecordController15MardSetBalanceLEi @ 349 NONAME
+	_ZThn180_N28CAdvancedAudioPlayController10GetBitRateERj @ 350 NONAME
+	_ZThn180_N28CAdvancedAudioPlayController12BufferFilledEP10CMMFBuffer @ 351 NONAME
+	_ZThn180_N28CAdvancedAudioPlayController5EventE4TUid @ 352 NONAME
+	_ZThn184_N28CAdvancedAudioPlayController15MscEnableEventsEi @ 353 NONAME
+	_ZThn184_N28CAdvancedAudioPlayController22MscGetSeekingSupportedERi @ 354 NONAME
+	_ZThn184_N28CAdvancedAudioPlayController28MscGetRandomSeekingSupportedERi @ 355 NONAME
+	_ZThn188_N28CAdvancedAudioPlayController14MapcSetRepeatsEiRK25TTimeIntervalMicroSeconds @ 356 NONAME
+	_ZThn192_N28CAdvancedAudioPlayController14MapdGetVolumeLERi @ 357 NONAME
+	_ZThn192_N28CAdvancedAudioPlayController14MapdSetVolumeLEi @ 358 NONAME
+	_ZThn192_N28CAdvancedAudioPlayController15MapdGetBalanceLERi @ 359 NONAME
+	_ZThn192_N28CAdvancedAudioPlayController15MapdSetBalanceLEi @ 360 NONAME
+	_ZThn192_N28CAdvancedAudioPlayController17MapdGetMaxVolumeLERi @ 361 NONAME
+	_ZThn192_N28CAdvancedAudioPlayController18MapdSetVolumeRampLERK25TTimeIntervalMicroSeconds @ 362 NONAME
+	_ZThn196_N28CAdvancedAudioPlayController16MdcExecuteIntentEN13ContentAccess7TIntentE @ 363 NONAME
+	_ZThn196_N28CAdvancedAudioPlayController17MdcEvaluateIntentEN13ContentAccess7TIntentE @ 364 NONAME
+	_ZThn196_N28CAdvancedAudioPlayController19MdcSetAgentPropertyEN13ContentAccess14TAgentPropertyEi @ 365 NONAME
+	_ZThn196_N28CAdvancedAudioPlayController25MdcDisableAutomaticIntentEi @ 366 NONAME
+	_ZThn200_N28CAdvancedAudioPlayController28TrailingSilenceTimerCompleteEv @ 367 NONAME
 	_ZThn24_N24CAdvancedAudioController17SendEventToClientERK9TMMFEvent @ 368 NONAME
 	_ZThn24_N28CAdvancedAudioPlayController17SendEventToClientERK9TMMFEvent @ 369 NONAME
 	_ZThn28_N21CAdvancedAudioDecoder21HandleFrameTableEventEN11CFrameTable16TFrameTableEventE @ 370 NONAME
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Inc/AdvancedAudioController.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Inc/AdvancedAudioController.h	Fri Apr 16 15:29:42 2010 +0300
@@ -540,6 +540,7 @@
 		TInt iSharedBufferMaxNum;
 		// Max buffer size
 		TInt iSharedBufferMaxSize;
+		TInt iSharedBufferMaxSizeForNonSeekableSrc;
 		// Array of shared buffers
 		RPointerArray<CMMFDataBuffer> iSharedBuffers;
 		// Current index within iSharedBuffers
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Inc/AdvancedAudioResource.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Inc/AdvancedAudioResource.h	Fri Apr 16 15:29:42 2010 +0300
@@ -46,6 +46,7 @@
 	public:
 		TInt iSharedBufferMaxNum;		// Max number of shared buffer
 		TInt iSharedBufferMaxSize;		// Max buffer size
+		TInt iSharedBufferMaxSizeForNonSeekableSrc; // Max buffer size for Non Seekable source like prog download
 		TInt iSamplingRate;				// Default sampling rate
 		TInt iStereoSupport;			// Default channel number
 		TBool iMetaDataSupport;			// Meta Data support indicator
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Inc/AdvancedAudioResource.rh	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Inc/AdvancedAudioResource.rh	Fri Apr 16 15:29:42 2010 +0300
@@ -40,6 +40,7 @@
     {
     LONG	shared_buffer_max_num;
     LONG	shared_buffer_max_size;
+    LONG	shared_buffer_max_size_non_seekable_source;
     LONG	sampling_rate;
     LONG	stereo_support;
     LONG	metadata_support;
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioDecoder.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioDecoder.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -122,7 +122,7 @@
 
 	QueueThisBuffer(aIndex); // will set iNextBuffer (current buffer) and update iSharedBufferIndex (to next buffer)
 
-   	if(aSourceSampleRate != aSWConvertSampleRate)  // Sampling Rate Conversion is needed
+   	if(aSourceSampleRate != aSWConvertSampleRate && !IsHwAccelerated())  // Sampling Rate Conversion is needed
    		{
 	    if (!iChannelAndSampleRateConverterFactory)
 			{
@@ -421,7 +421,9 @@
     {
     CMMFBuffer* refillBuffer = NULL;
     // index is the next buffer, index-1 is current buffer, check 2 buffers back from the one being selected
-    TInt checkBufIndex = iSharedBufferIndex-2;
+// ou1cimx1#205863    
+    //TInt checkBufIndex = iSharedBufferIndex-2;
+    TInt checkBufIndex = iSharedBufferIndex- (iSharedBuffers->Count()-1) ;
     	
     if (checkBufIndex < 0)
     	{
@@ -430,11 +432,13 @@
     	
     if ((*iSharedBuffers)[checkBufIndex]->Status() == EBeingEmptied)
         {
-        if (iSharedBuffers->Count() <= 2)
+// ou1cimx1#205863
+/*        if (iSharedBuffers->Count() <= 2)
             {
             DP1(_L("CAdvancedAudioDecoder::NextSharedBufferL leave, EBeingEmptied is used on Count[%d]"), iSharedBuffers->Count());
             User::Leave(KErrAbort);
             }
+*/            
         DP2(_L("CAdvancedAudioDecoder::NextSharedBufferL, index[%d] [%x] is EBeingEmptied"), 
             	checkBufIndex, static_cast<CMMFDataBuffer*>((*iSharedBuffers)[checkBufIndex])->Data().Ptr() );
         refillBuffer = (*iSharedBuffers)[checkBufIndex];
@@ -488,9 +492,9 @@
     DP3(_L("CAdvancedAudioDecoder::HandleFillBufferL ptr[%x] iRenderEnabled[%d] Position[%d]"), static_cast<CMMFDataBuffer*>(iNextBuffer)->Data().Ptr(), iRenderEnabled, iNextBuffer->Position());
     DP3(_L("CAdvancedAudioDecoder::HandleFillBufferL frm#[%d] d0[%x] dp[%x]"), static_cast<CMMFDataBuffer*>(iNextBuffer)->FrameNumber(), static_cast<CMMFDataBuffer*>(iNextBuffer)->Data().Ptr()[0],
      static_cast<CMMFDataBuffer*>(iNextBuffer)->Data().Ptr()[iNextBuffer->Position()]);
-
-    iBufferToFill->SetPosition(0);
-	static_cast<CMMFDataBuffer*>(iBufferToFill)->Data().SetLength(0);
+// ou1cimx1#205863
+//    iBufferToFill->SetPosition(0);
+//	static_cast<CMMFDataBuffer*>(iBufferToFill)->Data().SetLength(0);
     iBufferToFill->SetLastBuffer(EFalse);
 
     TCodecProcessResult result;
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioPlayController.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioPlayController.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -684,6 +684,7 @@
     TRAP(err, DoPauseL(ETrue)); // this is a preemption pause
 	// In case of pre-emption we should only Pause ... but not Stop.
     SendEventToClient(TMMFEvent(KMMFEventCategoryPlaybackComplete, aError));
+    SendEventToClient(TMMFEvent(KStreamControlEventStateChangedPaused, aError));
     }
 
 // -----------------------------------------------------------------------------
@@ -783,6 +784,7 @@
     MDataSource& aSource)
     {
     DP1(_L("CAdvancedAudioPlayController::AddDataSourceL this[%x]"), this);
+    DP2(_L("CAdvancedAudioController::AddDataSourceL iSharedBufferMaxNum[%d] iSharedBufferMaxSize[%d]"), iSharedBufferMaxNum, iSharedBufferMaxSize);    
     iSourceUnreadable = EFalse;
     iEnablePrimedStateChangedEvent = EFalse;
     // source type is intended to not be needed by controllers
@@ -798,11 +800,6 @@
 		{
         User::Leave(KErrAlreadyExists);
         }
-    if (iSharedBufferMaxNum <= 2)
-        {
-        iSharedBufferMaxNum = 3;
-        }
-
 
 	// set iReadHeader here in case prime is not called before set position is used.
     // reset before adding data source
@@ -843,6 +840,17 @@
 
     // we need to block this until duration is calculated if using mmfplayutility
     iBlockDuration = EFalse;
+// ou1cimx1#205863
+    if (!iDataSourceAdapter->IsLocalPlayback()) 
+    	{
+	    DP0(_L("CAdvancedAudioPlayController::AddDataSourceL not file source"));        
+	    if (iSharedBufferMaxNum <= 2)
+	        {
+	        	iSharedBufferMaxNum = 3;
+	        }
+		 iSharedBufferMaxSize = iSharedBufferMaxSizeForNonSeekableSrc;
+	    DP2(_L("CAdvancedAudioPlayController::AddDataSourceL new iSharedBufferMaxNum[%d] iSharedBufferMaxSize[%d]"), iSharedBufferMaxNum, iSharedBufferMaxSize);
+    	}
     
     if ((!iEventsEnabled) && (!iDataSourceAdapter->OnlyHeaderPresent()))
         {
@@ -2240,11 +2248,17 @@
 	RArray<TInt>& codecConfigData = const_cast<RArray<TInt>&>(iAudioResource->CodecConfigParametersL());
 	// Override default values with values found from header, if available
 	GetCodecConfigData(codecConfigData);
-	iAudioOutput->ConfigureL(iSampleRate, iSinkNumChannels, iDataType, codecConfigData);
-    DP0(_L("CAdvancedAudioPlayController::DoInitializeSinkL, output configured"));
-	iAudioOutput->PrimeL();
-    DP0(_L("CAdvancedAudioPlayController::DoInitializeSinkL, output primed"));
-			    
+        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)
 		{
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioResource.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioResource.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -89,6 +89,7 @@
 
 	iProperties.iSharedBufferMaxNum = iResourceReader.ReadInt32();
 	iProperties.iSharedBufferMaxSize = iResourceReader.ReadInt32();
+	iProperties.iSharedBufferMaxSizeForNonSeekableSrc = iResourceReader.ReadInt32();
 	iProperties.iSamplingRate = iResourceReader.ReadInt32();
 	iProperties.iStereoSupport = iResourceReader.ReadInt32();
 	iProperties.iMetaDataSupport = iResourceReader.ReadInt32();
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DataSourceAdapter/Bwins/DataSourceAdapteru.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DataSourceAdapter/Bwins/DataSourceAdapteru.def	Fri Apr 16 15:29:42 2010 +0300
@@ -1,31 +1,32 @@
 EXPORTS
-	??0CDataSourceAdapter@@IAE@XZ @ 1 NONAME ; CDataSourceAdapter::CDataSourceAdapter(void)
-	??1CDataSourceAdapter@@UAE@XZ @ 2 NONAME ; CDataSourceAdapter::~CDataSourceAdapter(void)
-	?BufferEmptiedL@CDataSourceAdapter@@UAEXPAVCMMFBuffer@@@Z @ 3 NONAME ; void CDataSourceAdapter::BufferEmptiedL(class CMMFBuffer *)
-	?CanCreateSourceBuffer@CDataSourceAdapter@@UAEHXZ @ 4 NONAME ; int CDataSourceAdapter::CanCreateSourceBuffer(void)
-	?CreateSourceBufferL@CDataSourceAdapter@@UAEPAVCMMFBuffer@@VTMediaId@@AAH@Z @ 5 NONAME ; class CMMFBuffer * CDataSourceAdapter::CreateSourceBufferL(class TMediaId, int &)
-	?DataSourceType@CDataSourceAdapter@@UAE?AVTUid@@XZ @ 6 NONAME ; class TUid CDataSourceAdapter::DataSourceType(void)
-	?EvaluateIntent@CDataSourceAdapter@@UAEHW4TIntent@ContentAccess@@@Z @ 7 NONAME ; int CDataSourceAdapter::EvaluateIntent(enum ContentAccess::TIntent)
-	?Event@CDataSourceAdapter@@UAEXVTUid@@@Z @ 8 NONAME ; void CDataSourceAdapter::Event(class TUid)
-	?ExecuteIntent@CDataSourceAdapter@@UAEHW4TIntent@ContentAccess@@@Z @ 9 NONAME ; int CDataSourceAdapter::ExecuteIntent(enum ContentAccess::TIntent)
-	?FillBufferL@CDataSourceAdapter@@UAEXPAVCMMFBuffer@@PAVMDataSink@@VTMediaId@@@Z @ 10 NONAME ; void CDataSourceAdapter::FillBufferL(class CMMFBuffer *, class MDataSink *, class TMediaId)
-	?GetInterface@CDataSourceAdapter@@UAEHVTUid@@AAVTVersion@@AAPAX@Z @ 11 NONAME ; int CDataSourceAdapter::GetInterface(class TUid, class TVersion &, void * &)
-	?IsPositonSeekable@CDataSourceAdapter@@UAEHXZ @ 12 NONAME ; int CDataSourceAdapter::IsPositonSeekable(void)
-	?IsProtectedL@CDataSourceAdapter@@UAEHXZ @ 13 NONAME ; int CDataSourceAdapter::IsProtectedL(void)
-	?IsTimeSeekable@CDataSourceAdapter@@UAEHXZ @ 14 NONAME ; int CDataSourceAdapter::IsTimeSeekable(void)
-	?NewL@CDataSourceAdapter@@SAPAV1@XZ @ 15 NONAME ; class CDataSourceAdapter * CDataSourceAdapter::NewL(void)
-	?OnlyHeaderPresent@CDataSourceAdapter@@UAEHXZ @ 16 NONAME ; int CDataSourceAdapter::OnlyHeaderPresent(void)
-	?SeekToPosition@CDataSourceAdapter@@UAEHI@Z @ 17 NONAME ; int CDataSourceAdapter::SeekToPosition(unsigned int)
-	?SeekToTime@CDataSourceAdapter@@UAEHI@Z @ 18 NONAME ; int CDataSourceAdapter::SeekToTime(unsigned int)
-	?SeekToTime@CDataSourceAdapter@@UAEHIAAI@Z @ 19 NONAME ; int CDataSourceAdapter::SeekToTime(unsigned int, unsigned int &)
-	?SetAgentProperty@CDataSourceAdapter@@UAEHW4TAgentProperty@ContentAccess@@H@Z @ 20 NONAME ; int CDataSourceAdapter::SetAgentProperty(enum ContentAccess::TAgentProperty, int)
-	?SetDataSourceL@CDataSourceAdapter@@UAEXPAVMDataSource@@PAVMMultimediaDataSourceObserver@@PAVMAsyncEventHandler@@@Z @ 21 NONAME ; void CDataSourceAdapter::SetDataSourceL(class MDataSource *, class MMultimediaDataSourceObserver *, class MAsyncEventHandler *)
-	?SetSourcePrioritySettings@CDataSourceAdapter@@UAEXABVTMMFPrioritySettings@@@Z @ 22 NONAME ; void CDataSourceAdapter::SetSourcePrioritySettings(class TMMFPrioritySettings const &)
-	?SourcePlayL@CDataSourceAdapter@@UAEXXZ @ 23 NONAME ; void CDataSourceAdapter::SourcePlayL(void)
-	?SourcePrimeL@CDataSourceAdapter@@UAEXXZ @ 24 NONAME ; void CDataSourceAdapter::SourcePrimeL(void)
-	?SourceSize@CDataSourceAdapter@@UAEHXZ @ 25 NONAME ; int CDataSourceAdapter::SourceSize(void)
-	?SourceStopL@CDataSourceAdapter@@UAEXXZ @ 26 NONAME ; void CDataSourceAdapter::SourceStopL(void)
-	?SourceThreadLogoff@CDataSourceAdapter@@UAEXXZ @ 27 NONAME ; void CDataSourceAdapter::SourceThreadLogoff(void)
-	?SourceThreadLogon@CDataSourceAdapter@@UAEHAAVMAsyncEventHandler@@@Z @ 28 NONAME ; int CDataSourceAdapter::SourceThreadLogon(class MAsyncEventHandler &)
-	?SetAudioOutputControlUtil@CDataSourceAdapter@@QAEHPAVCAudioOutputControlUtility@@@Z @ 29 NONAME ; int CDataSourceAdapter::SetAudioOutputControlUtil(class CAudioOutputControlUtility *)
+	?SetAgentProperty@CDataSourceAdapter@@UAEHW4TAgentProperty@ContentAccess@@H@Z @ 1 NONAME ; int CDataSourceAdapter::SetAgentProperty(enum ContentAccess::TAgentProperty, int)
+	?BufferEmptiedL@CDataSourceAdapter@@UAEXPAVCMMFBuffer@@@Z @ 2 NONAME ; void CDataSourceAdapter::BufferEmptiedL(class CMMFBuffer *)
+	?SetSourcePrioritySettings@CDataSourceAdapter@@UAEXABVTMMFPrioritySettings@@@Z @ 3 NONAME ; void CDataSourceAdapter::SetSourcePrioritySettings(class TMMFPrioritySettings const &)
+	?SeekToTime@CDataSourceAdapter@@UAEHI@Z @ 4 NONAME ; int CDataSourceAdapter::SeekToTime(unsigned int)
+	??1CDataSourceAdapter@@UAE@XZ @ 5 NONAME ; CDataSourceAdapter::~CDataSourceAdapter(void)
+	?SetAudioOutputControlUtil@CDataSourceAdapter@@QAEHPAVCAudioOutputControlUtility@@@Z @ 6 NONAME ; int CDataSourceAdapter::SetAudioOutputControlUtil(class CAudioOutputControlUtility *)
+	?NewL@CDataSourceAdapter@@SAPAV1@XZ @ 7 NONAME ; class CDataSourceAdapter * CDataSourceAdapter::NewL(void)
+	?SourcePrimeL@CDataSourceAdapter@@UAEXXZ @ 8 NONAME ; void CDataSourceAdapter::SourcePrimeL(void)
+	?Event@CDataSourceAdapter@@UAEXVTUid@@@Z @ 9 NONAME ; void CDataSourceAdapter::Event(class TUid)
+	?SeekToTime@CDataSourceAdapter@@UAEHIAAI@Z @ 10 NONAME ; int CDataSourceAdapter::SeekToTime(unsigned int, unsigned int &)
+	?SourceThreadLogon@CDataSourceAdapter@@UAEHAAVMAsyncEventHandler@@@Z @ 11 NONAME ; int CDataSourceAdapter::SourceThreadLogon(class MAsyncEventHandler &)
+	?ExecuteIntent@CDataSourceAdapter@@UAEHW4TIntent@ContentAccess@@@Z @ 12 NONAME ; int CDataSourceAdapter::ExecuteIntent(enum ContentAccess::TIntent)
+	?DataSourceType@CDataSourceAdapter@@UAE?AVTUid@@XZ @ 13 NONAME ; class TUid CDataSourceAdapter::DataSourceType(void)
+	?IsProtectedL@CDataSourceAdapter@@UAEHXZ @ 14 NONAME ; int CDataSourceAdapter::IsProtectedL(void)
+	?FillBufferL@CDataSourceAdapter@@UAEXPAVCMMFBuffer@@PAVMDataSink@@VTMediaId@@@Z @ 15 NONAME ; void CDataSourceAdapter::FillBufferL(class CMMFBuffer *, class MDataSink *, class TMediaId)
+	?IsLocalPlayback@CDataSourceAdapter@@UAEHXZ @ 16 NONAME ; int CDataSourceAdapter::IsLocalPlayback(void)
+	?IsPositonSeekable@CDataSourceAdapter@@UAEHXZ @ 17 NONAME ; int CDataSourceAdapter::IsPositonSeekable(void)
+	?CanCreateSourceBuffer@CDataSourceAdapter@@UAEHXZ @ 18 NONAME ; int CDataSourceAdapter::CanCreateSourceBuffer(void)
+	?CreateSourceBufferL@CDataSourceAdapter@@UAEPAVCMMFBuffer@@VTMediaId@@AAH@Z @ 19 NONAME ; class CMMFBuffer * CDataSourceAdapter::CreateSourceBufferL(class TMediaId, int &)
+	?SourceStopL@CDataSourceAdapter@@UAEXXZ @ 20 NONAME ; void CDataSourceAdapter::SourceStopL(void)
+	?IsTimeSeekable@CDataSourceAdapter@@UAEHXZ @ 21 NONAME ; int CDataSourceAdapter::IsTimeSeekable(void)
+	?SetDataSourceL@CDataSourceAdapter@@UAEXPAVMDataSource@@PAVMMultimediaDataSourceObserver@@PAVMAsyncEventHandler@@@Z @ 22 NONAME ; void CDataSourceAdapter::SetDataSourceL(class MDataSource *, class MMultimediaDataSourceObserver *, class MAsyncEventHandler *)
+	?SeekToPosition@CDataSourceAdapter@@UAEHI@Z @ 23 NONAME ; int CDataSourceAdapter::SeekToPosition(unsigned int)
+	?GetInterface@CDataSourceAdapter@@UAEHVTUid@@AAVTVersion@@AAPAX@Z @ 24 NONAME ; int CDataSourceAdapter::GetInterface(class TUid, class TVersion &, void * &)
+	?EvaluateIntent@CDataSourceAdapter@@UAEHW4TIntent@ContentAccess@@@Z @ 25 NONAME ; int CDataSourceAdapter::EvaluateIntent(enum ContentAccess::TIntent)
+	?OnlyHeaderPresent@CDataSourceAdapter@@UAEHXZ @ 26 NONAME ; int CDataSourceAdapter::OnlyHeaderPresent(void)
+	?SourceSize@CDataSourceAdapter@@UAEHXZ @ 27 NONAME ; int CDataSourceAdapter::SourceSize(void)
+	?SourcePlayL@CDataSourceAdapter@@UAEXXZ @ 28 NONAME ; void CDataSourceAdapter::SourcePlayL(void)
+	?SourceThreadLogoff@CDataSourceAdapter@@UAEXXZ @ 29 NONAME ; void CDataSourceAdapter::SourceThreadLogoff(void)
+	??0CDataSourceAdapter@@IAE@XZ @ 30 NONAME ; CDataSourceAdapter::CDataSourceAdapter(void)
 
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DataSourceAdapter/EABI/DataSourceAdapteru.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DataSourceAdapter/EABI/DataSourceAdapteru.def	Fri Apr 16 15:29:42 2010 +0300
@@ -15,24 +15,25 @@
 	_ZN18CDataSourceAdapter14IsTimeSeekableEv @ 14 NONAME
 	_ZN18CDataSourceAdapter14SeekToPositionEj @ 15 NONAME
 	_ZN18CDataSourceAdapter14SetDataSourceLEP11MDataSourceP29MMultimediaDataSourceObserverP18MAsyncEventHandler @ 16 NONAME
-	_ZN18CDataSourceAdapter16SetAgentPropertyEN13ContentAccess14TAgentPropertyEi @ 17 NONAME
-	_ZN18CDataSourceAdapter17IsPositonSeekableEv @ 18 NONAME
-	_ZN18CDataSourceAdapter17OnlyHeaderPresentEv @ 19 NONAME
-	_ZN18CDataSourceAdapter17SourceThreadLogonER18MAsyncEventHandler @ 20 NONAME
-	_ZN18CDataSourceAdapter18SourceThreadLogoffEv @ 21 NONAME
-	_ZN18CDataSourceAdapter19CreateSourceBufferLE8TMediaIdRi @ 22 NONAME
-	_ZN18CDataSourceAdapter21CanCreateSourceBufferEv @ 23 NONAME
-	_ZN18CDataSourceAdapter25SetSourcePrioritySettingsERK20TMMFPrioritySettings @ 24 NONAME
-	_ZN18CDataSourceAdapter4NewLEv @ 25 NONAME
-	_ZN18CDataSourceAdapter5EventE4TUid @ 26 NONAME
-	_ZN18CDataSourceAdapterC1Ev @ 27 NONAME
-	_ZN18CDataSourceAdapterC2Ev @ 28 NONAME
-	_ZN18CDataSourceAdapterD0Ev @ 29 NONAME
-	_ZN18CDataSourceAdapterD1Ev @ 30 NONAME
-	_ZN18CDataSourceAdapterD2Ev @ 31 NONAME
-	_ZTI18CDataSourceAdapter @ 32 NONAME ; #<TI>#
-	_ZTIN18CDataSourceAdapter21CAsyncProxyFillBufferE @ 33 NONAME ; #<TI>#
-	_ZTV18CDataSourceAdapter @ 34 NONAME ; #<VT>#
-	_ZTVN18CDataSourceAdapter21CAsyncProxyFillBufferE @ 35 NONAME ; #<VT>#
-	_ZN18CDataSourceAdapter25SetAudioOutputControlUtilEP26CAudioOutputControlUtility @ 36 NONAME
+	_ZN18CDataSourceAdapter15IsLocalPlaybackEv @ 17 NONAME
+	_ZN18CDataSourceAdapter16SetAgentPropertyEN13ContentAccess14TAgentPropertyEi @ 18 NONAME
+	_ZN18CDataSourceAdapter17IsPositonSeekableEv @ 19 NONAME
+	_ZN18CDataSourceAdapter17OnlyHeaderPresentEv @ 20 NONAME
+	_ZN18CDataSourceAdapter17SourceThreadLogonER18MAsyncEventHandler @ 21 NONAME
+	_ZN18CDataSourceAdapter18SourceThreadLogoffEv @ 22 NONAME
+	_ZN18CDataSourceAdapter19CreateSourceBufferLE8TMediaIdRi @ 23 NONAME
+	_ZN18CDataSourceAdapter21CanCreateSourceBufferEv @ 24 NONAME
+	_ZN18CDataSourceAdapter25SetAudioOutputControlUtilEP26CAudioOutputControlUtility @ 25 NONAME
+	_ZN18CDataSourceAdapter25SetSourcePrioritySettingsERK20TMMFPrioritySettings @ 26 NONAME
+	_ZN18CDataSourceAdapter4NewLEv @ 27 NONAME
+	_ZN18CDataSourceAdapter5EventE4TUid @ 28 NONAME
+	_ZN18CDataSourceAdapterC1Ev @ 29 NONAME
+	_ZN18CDataSourceAdapterC2Ev @ 30 NONAME
+	_ZN18CDataSourceAdapterD0Ev @ 31 NONAME
+	_ZN18CDataSourceAdapterD1Ev @ 32 NONAME
+	_ZN18CDataSourceAdapterD2Ev @ 33 NONAME
+	_ZTI18CDataSourceAdapter @ 34 NONAME
+	_ZTIN18CDataSourceAdapter21CAsyncProxyFillBufferE @ 35 NONAME
+	_ZTV18CDataSourceAdapter @ 36 NONAME
+	_ZTVN18CDataSourceAdapter21CAsyncProxyFillBufferE @ 37 NONAME
 
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DataSourceAdapter/Inc/DataSourceAdapter.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DataSourceAdapter/Inc/DataSourceAdapter.h	Fri Apr 16 15:29:42 2010 +0300
@@ -106,6 +106,7 @@
 		
 		//sets the AudioOutputControlUtitlity reference and sets Datasource to AudioOutputContolUtility
 		IMPORT_C TInt SetAudioOutputControlUtil(CAudioOutputControlUtility* aAudioOutputControlUtility);
+		IMPORT_C virtual TBool IsLocalPlayback();
 	protected:
 
         /**
@@ -159,6 +160,7 @@
 		CMMFClip*		iClip;
 		CAsyncProxyFillBuffer*	iAsyncProxyFillBuffer;
 		TBool			iHeaderOnly;
+		TBool			iIsLocalPlayback;
 		CAudioOutputControlUtility* iAudioOutputControlUtility;  
     };
 
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DataSourceAdapter/Src/DataSourceAdapter.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DataSourceAdapter/Src/DataSourceAdapter.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -38,6 +38,7 @@
     iTimeSeekable = EFalse;
     iDataSource = NULL;
     iIsProtected = EFalse;
+    iIsLocalPlayback = EFalse;
     }
 
 // -----------------------------------------------------------------------------
@@ -109,6 +110,10 @@
         }
 	else if ((iSourceType == KUidMmfFileSource) || (iSourceType == KOldProgDLSourceUid))
     	{
+    	if (iSourceType == KUidMmfFileSource) 
+		{
+	    	iIsLocalPlayback = ETrue;
+		}
     	iPosSeekable = ETrue;
     	iDataSource->SourcePrimeL();
    		iIsProtected = static_cast<CMMFFile*>(iDataSource)->IsProtectedL();
@@ -400,6 +405,11 @@
 		}
 	}
 
+EXPORT_C TBool CDataSourceAdapter::IsLocalPlayback()
+	{
+	DP1(_L("CDataSourceAdapter::iIsLocalPlayback[%d]"), iIsLocalPlayback);
+	return iIsLocalPlayback;
+	}
 // -----------------------------------------------------------------------------
 // CDataSourceAdapter::CAsyncProxyFillBuffer
 // -----------------------------------------------------------------------------
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DevSoundAudioOutput/Src/DevSoundAudioOutput.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/DevSoundAudioOutput/Src/DevSoundAudioOutput.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -23,6 +23,7 @@
 #include <mmfpaniccodes.h>
 #include <ConfigurationComponentsFactory.h>
 #include <AudioOutputControlUtility.h>
+#include <S60FourCC.h>
 
 // CONSTANTS
 const TUint KSampleRate8000Hz       = 8000;
@@ -329,6 +330,19 @@
 				}
 			}
 
+		//aac HWcodec will downsample by 2, if it is greater than 48k 
+		//Hence devsound should be onfigured with that value
+		if(iSourceSampleRate > KSampleRate48000Hz && iSourceFourCC == KS60FourCCCodeEAAC && iAdvancedAudioDecoder->IsHwAccelerated())
+		    {
+            TUint samplerate = iSourceSampleRate/2;
+            for (; sampleRateIndex >= 0; sampleRateIndex--)
+                {
+                if(samplerate >= supportedSR[sampleRateIndex][0])
+                    {
+                    break;
+                    }
+                }
+		    }
 		// find the highest sink sample rate below the source rate
 		for (; sampleRateIndex >= 0; sampleRateIndex--)
 			{
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Data/AACAudioPlayControllerResource.rss	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Data/AACAudioPlayControllerResource.rss	Fri Apr 16 15:29:42 2010 +0300
@@ -30,8 +30,9 @@
 //
 RESOURCE ADVANCED_AUDIO_CONTROLLER_RESOURCE aacDecoder
     {
-    shared_buffer_max_num = 2;
-    shared_buffer_max_size = 40960;
+    shared_buffer_max_num = 1;
+    shared_buffer_max_size = 504000; // multiple of 72000
+    shared_buffer_max_size_non_seekable_source = 8192;
     sampling_rate = EAapSampleRate16000Hz;
     stereo_support = 2;
     metadata_support = EAapMetadataSupportTrue;
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Src/AACAudioPlayControllerHwDecoder.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Src/AACAudioPlayControllerHwDecoder.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -292,7 +292,6 @@
     iAccLen = 0;
 
 	iAacUtil->Config(iFrameLenConfig);
-	iEnabled = ETrue;
     DP0(_L ("CAACAudioPlayControllerDecoder::Reset - Exit"));
 	}
 	
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Src/AACAudioPlayControllerPlugin.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Src/AACAudioPlayControllerPlugin.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -61,7 +61,7 @@
     iSharedBufferMaxNum = aapProperties.iSharedBufferMaxNum;
     iSharedBufferMaxSize = aapProperties.iSharedBufferMaxSize;
     iMetaDataSupport = aapProperties.iMetaDataSupport;
-
+    iSharedBufferMaxSizeForNonSeekableSrc = aapProperties.iSharedBufferMaxSizeForNonSeekableSrc;
 	iAudioUtility = CEAACPlusAudioControllerUtility::NewL();
 	iDecoderBuilder = CAACAudioPlayControllerDecoderBuilder::NewL();
     }
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Data/AMRAudioPlayControllerResource.rss	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Data/AMRAudioPlayControllerResource.rss	Fri Apr 16 15:29:42 2010 +0300
@@ -30,8 +30,9 @@
 //
 RESOURCE ADVANCED_AUDIO_CONTROLLER_RESOURCE amrDecoder
     {
-    shared_buffer_max_num = 2;
-    shared_buffer_max_size = 8192;
+    shared_buffer_max_num = 1;
+    shared_buffer_max_size = 524288; // multiple of 1024
+    shared_buffer_max_size_non_seekable_source = 8192;
     sampling_rate = EAapSampleRate8000Hz;
     stereo_support = 0;
     metadata_support = EAapMetadataSupportFalse;
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Src/AMRAudioPlayControllerHwDecoder.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Src/AMRAudioPlayControllerHwDecoder.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -140,7 +140,6 @@
     iOutBufferPtr = iOutBuffer;
 
     iAccLen = 0;
-    iEnabled = ETrue;
 
     DP0(_L ("CAMRAudioPlayControllerDecoder::Reset - Exit"));
 	}
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Src/AMRAudioPlayControllerPlugin.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Src/AMRAudioPlayControllerPlugin.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -56,7 +56,7 @@
     iSharedBufferMaxNum = aapProperties.iSharedBufferMaxNum;
     iSharedBufferMaxSize = aapProperties.iSharedBufferMaxSize;
     iMetaDataSupport = aapProperties.iMetaDataSupport;
-
+    iSharedBufferMaxSizeForNonSeekableSrc = aapProperties.iSharedBufferMaxSizeForNonSeekableSrc;
 	iAudioUtility = CAMRAudioControllerUtility::NewL();
 	iDecoderBuilder = CAMRAudioPlayControllerDecoderBuilder::NewL();
     }
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudiorecordcontroller/Data/AMRAudioRecordControllerResource.rss	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudiorecordcontroller/Data/AMRAudioRecordControllerResource.rss	Fri Apr 16 15:29:42 2010 +0300
@@ -33,6 +33,7 @@
     {
     shared_buffer_max_num = 4;
     shared_buffer_max_size = 1024;
+    shared_buffer_max_size_non_seekable_source = 1024;
     sampling_rate = EAapSampleRate8000Hz;
     stereo_support = 0;
     metadata_support = EAapMetadataSupportFalse;
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudiorecordcontroller/Src/AMRAudioRecordControllerPlugin.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudiorecordcontroller/Src/AMRAudioRecordControllerPlugin.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -52,7 +52,7 @@
     TAapProperties aapProperties = iAudioResource->PropertiesL();
     iSharedBufferMaxNum = aapProperties.iSharedBufferMaxNum;
     iSharedBufferMaxSize = aapProperties.iSharedBufferMaxSize;
-
+    iSharedBufferMaxSizeForNonSeekableSrc = aapProperties.iSharedBufferMaxSizeForNonSeekableSrc;
 	iAudioUtility = CAMRAudioControllerUtility::NewL();
     }
 
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Data/AWBAudioPlayControllerResource.rss	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Data/AWBAudioPlayControllerResource.rss	Fri Apr 16 15:29:42 2010 +0300
@@ -30,8 +30,9 @@
 //
 RESOURCE ADVANCED_AUDIO_CONTROLLER_RESOURCE awbDecoder
     {
-    shared_buffer_max_num = 2;
-    shared_buffer_max_size = 8192;
+    shared_buffer_max_num = 1;
+    shared_buffer_max_size = 524288; // multiple of 1024
+    shared_buffer_max_size_non_seekable_source = 8192;
     sampling_rate = EAapSampleRate16000Hz;
     stereo_support = 0;
     metadata_support = EAapMetadataSupportFalse;
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Src/AWBAudioPlayControllerHwDecoder.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Src/AWBAudioPlayControllerHwDecoder.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -146,7 +146,7 @@
     iOutBufferPtr = iOutBuffer;
 
     iAccLen = 0;
-    iEnabled = ETrue;
+
     DP0(_L ("CAWBAudioPlayControllerDecoder::Reset - Exit"));
 	}
 
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Src/AWBAudioPlayControllerPlugin.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Src/AWBAudioPlayControllerPlugin.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -55,7 +55,7 @@
     iSharedBufferMaxNum = aapProperties.iSharedBufferMaxNum;
     iSharedBufferMaxSize = aapProperties.iSharedBufferMaxSize;
     iMetaDataSupport = aapProperties.iMetaDataSupport;
-
+    iSharedBufferMaxSizeForNonSeekableSrc = aapProperties.iSharedBufferMaxSizeForNonSeekableSrc;
 	iAudioUtility = CAWBAudioControllerUtility::NewL();
 	iDecoderBuilder = CAWBAudioPlayControllerDecoderBuilder::NewL();
     }
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Data/MP3AudioPlayControllerResource.rss	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Data/MP3AudioPlayControllerResource.rss	Fri Apr 16 15:29:42 2010 +0300
@@ -30,8 +30,9 @@
 //
 RESOURCE ADVANCED_AUDIO_CONTROLLER_RESOURCE mp3Decoder
     {
-    shared_buffer_max_num = 2;
-    shared_buffer_max_size = 40960;
+    shared_buffer_max_num = 1;
+    shared_buffer_max_size = 528000; // multiple of 48000
+    shared_buffer_max_size_non_seekable_source = 40960;
     sampling_rate = EAapSampleRate16000Hz;
     stereo_support = 2;
     metadata_support = EAapMetadataSupportTrue;
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Src/MP3AudioPlayControllerHwDecoder.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Src/MP3AudioPlayControllerHwDecoder.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -149,7 +149,7 @@
     iOutBufferPtr = iOutBuffer;
 
     iAccLen = 0;
-    iEnabled = ETrue; 
+
     DP0(_L ("CMP3AudioPlayControllerDecoder::Reset - Exit"));
 	}
 
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Src/MP3AudioPlayControllerPlugin.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Src/MP3AudioPlayControllerPlugin.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -53,7 +53,7 @@
     iSharedBufferMaxNum = aapProperties.iSharedBufferMaxNum;
     iSharedBufferMaxSize = aapProperties.iSharedBufferMaxSize;
     iMetaDataSupport = aapProperties.iMetaDataSupport;
-
+    iSharedBufferMaxSizeForNonSeekableSrc = aapProperties.iSharedBufferMaxSizeForNonSeekableSrc;
 	iAudioUtility = CMP3AudioControllerUtility::NewL();
 	iDecoderBuilder = CMP3AudioPlayControllerDecoderBuilder::NewL();
     }
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/10kbps 11khz cbr mono.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/128kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/12kbps 8khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/160kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/192kbps 48khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/256kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/320kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/96kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/data/mmc/wma/VBR Q98 44Khz stereo.wma has changed
--- a/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/conf/AudioPlaybackTestModule.cfg	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/conf/AudioPlaybackTestModule.cfg	Fri Apr 16 15:29:42 2010 +0300
@@ -2,135 +2,6 @@
 //*****************************************************************************************************************
 //* added new cases for CTC coverage improvement
 //*****************************************************************************************************************
-
-
-
-//**************************
-//* Play  (ID 100)
-//**************************
-
-//For 3rd PartyDRM CR-Req 102-5626
-
-[TestCase]
-id 100
-Title AudioPlayback.1 - For DRM File 133-mp3-160.odf
-SoundFile F:\download\133-mp3-160.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-[TestCase]
-id 100
-Title AudioPlayback.2 - For DRM File 132-allthatshewants.odf
-SoundFile F:\download\132-allthatshewants.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-
-[TestCase]
-id 100
-Title AudioPlayback.3 - For DRM File 66-WAV_64k_16b_signed_st_Test1.odf
-SoundFile F:\download\66-WAV_64k_16b_signed_st_Test1.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-[TestCase]
-id 100
-Title AudioPlayback.4 - For DRM File eAAC-48k-24kbps.odf
-SoundFile F:\download\eAAC-48k-24kbps.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-[TestCase]
-id 100
-Title AudioPlayback.5 - For DRM File AAC-mp4.odf
-SoundFile F:\download\AAC-mp4.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-[TestCase]
-id 100
-Title AudioPlayback.6 - For DRM File AAC-audio-3gpp.odf
-SoundFile F:\download\AAC-audio-3gpp.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-[TestCase]
-id 100
-Title AudioPlayback.7 - For DRM File AMR-WB-i-believe.odf
-SoundFile F:\download\AMR-WB-i-believe.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-//**************************
-//* Play  (ID 99)
-//**************************
-// Testing LoopPlay for 3rd Party DRM CR-Req 102-5626
-
-[TestCase]
-id 99
-Title AudioPlayback.1 - For DRM File 133-mp3-160.odf
-SoundFile F:\download\133-mp3-160.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-[TestCase]
-id 99
-Title AudioPlayback.2 - For DRM File 
-SoundFile F:\download\132-allthatshewants.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-
-[TestCase]
-id 99
-Title AudioPlayback.3 - For DRM File 66-WAV_64k_16b_signed_st_Test1.odf
-SoundFile F:\download\66-WAV_64k_16b_signed_st_Test1.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-[TestCase]
-id 99
-Title AudioPlayback.4 - For DRM File eAAC-48k-24kbps.odf
-SoundFile F:\download\eAAC-48k-24kbps.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-[TestCase]
-id 99
-Title AudioPlayback.5 - For DRM File AAC-mp4.odf
-SoundFile F:\download\AAC-mp4.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-[TestCase]
-id 99
-Title AudioPlayback.6 - For DRM File AAC-audio-3gpp.odf
-SoundFile F:\download\AAC-audio-3gpp.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-[TestCase]
-id 99
-Title AudioPlayback.7 - For DRM File AMR-WB-i-believe.odf
-SoundFile F:\download\AMR-WB-i-believe.odf
-Expected Duration 2 000 000
-ErrorRange 1 000 000
-[End_TestCase]
-
-
 //**************************
 //* Play  (ID 145)
 //**************************
@@ -144,54 +15,6 @@
 
 
 //**************************
-//* Play  (ID 136)
-//**************************
-//Testing NewL function for 3rd PartyDRM CR-Req 102-5626
-
-[TestCase]
-id 136
-Title AudioPlayback.1 - NewFilePlayerL 133-mp3-160.odf
-SoundFile F:\download\133-mp3-160.odf
-[End_TestCase]
-
-[TestCase]
-id 136
-Title AudioPlayback.2 - NewFilePlayerL testmidi.dcf
-SoundFile F:\download\132-allthatshewants.odf
-[End_TestCase]
-
-[TestCase]
-id 136
-Title AudioPlayback.3 - NewFilePlayerL 66-WAV_64k_16b_signed_st_Test1.odf
-SoundFile F:\download\66-WAV_64k_16b_signed_st_Test1.odf
-[End_TestCase]
-
-[TestCase]
-id 136
-Title AudioPlayback.4 - NewFilePlayerL eAAC-48k-24kbps.odf
-SoundFile F:\download\eAAC-48k-24kbps.odf
-[End_TestCase]
-
-[TestCase]
-id 136
-Title AudioPlayback.5 - NewFilePlayerL AAC-mp4.odf
-SoundFile F:\download\AAC-mp4.odf
-[End_TestCase]
-
-[TestCase]
-id 136
-Title AudioPlayback.6 - NewFilePlayerL AAC-audio-3gpp.odf
-SoundFile F:\download\AAC-audio-3gpp.odf
-[End_TestCase]
-
-[TestCase]
-id 136
-Title AudioPlayback.7 - For DRM File AMR-WB-i-believe.odf
-SoundFile F:\download\AMR-WB-i-believe.odf
-[End_TestCase]
-
-
-//**************************
 //* Play  (ID 152)
 //**************************
 
@@ -260,9 +83,8 @@
 
 [TestCase]
 id 143
-Title AudioPlayback.210 - CtrImpInfo Play AMR_WB_6.6kbps.awb
-SoundFile e:\testing\data\awb\AMR_WB_6.6kbps.awb
-Expected Duration 2 000 000
+Title AudioPlayback.210 - CtrImpInfo Play 10s_smooth.mp3
+SoundFile e:\testing\data\mp3\10s_smooth.mp3
 ErrorRange 1 000 000
 [End_TestCase]
 
@@ -298,22 +120,10 @@
 id 139
 Title AudioPlayback.214 - GetLoadPercentage_Play 10s_AMR_WB_15.85kbps.awb
 SoundFile e:\testing\data\awb\10s_AMR_WB_15.85kbps.awb
-Position 5 000 000
 ErrorRange 1 000 000
 [End_TestCase]
 
 
-//**************************
-//* Play - OpenUrlL (ID 106)  
-//*Real Hw 
-//*rtsp://63.108.142.51/TestContent/MediaContent/WCDMA/VideoContent/CBR/3GPP2/VideoContents/MPEG4/30k_MPEG4_3G2_176x144_15fps.3g2
-//**************************
-
-[TestCase]
-id 106
-Title AudioPlayback.215 - OpenUrlL 10s_smooth.mp3
-SoundFile rtsp://63.108.142.51/testing/data/mp3/10s_smooth.mp3
-[End_TestCase]
 
 //**************************
 //* Play - Priority (ID 135)
@@ -660,14 +470,6 @@
 [End_TestCase]
 
 
-// data file too big, comment out test case
-//[TestCase]
-//id 114
-//Title AudioPlayback.35 - DisplayFields FixYou_Coldplay.mp3
-//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
-//DontPlayAudioClip
-//[End_TestCase]
-
 [TestCase]
 id 114
 Title AudioPlayback.36 - DisplayFields DownUnder_remix.aac
@@ -698,14 +500,6 @@
 DontPlayAudioClip
 [End_TestCase]
 
-// data file too big, comment out test case
-//[TestCase]
-//id 133
-//Title AudioPlayback.40 - MetaDataCount FixYou_Coldplay.mp3
-//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
-//EntryCount 14
-//DontPlayAudioClip
-//[End_TestCase]
 
 [TestCase]
 id 133
@@ -939,118 +733,7 @@
 MetaDataData Dance
 [End_TestCase]
 
-// data file too big, comment out test case
-//[TestCase]
-//id 130
-//Title AudioPlayback.67 - MetaDataData SongTitle FixYou_Coldplay.mp3
-//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
-//DontPlayAudioClip
-//MetaDataName title
-//MetaDataData Fix You
-//[End_TestCase]
 
-// data file too big, comment out test case
-//[TestCase]
-//id 130
-//Title AudioPlayback.68 - MetaDataData Artist FixYou_Coldplay.mp3
-//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
-//DontPlayAudioClip
-//MetaDataName artist
-//MetaDataData Coldplay
-//[End_TestCase]
-
-
-// data file too big, comment out test case
-//[TestCase]
-//id 130
-//Title AudioPlayback.69 - MetaDataData Album FixYou_Coldplay.mp3
-//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
-//DontPlayAudioClip
-//MetaDataName album
-//MetaDataData X & Y
-//[End_TestCase]
-
-// data file too big, comment out test case
-//[TestCase]
-//id 130
-//Title AudioPlayback.70 - MetaDataData Year FixYou_Coldplay.mp3
-//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
-//DontPlayAudioClip
-//MetaDataName year
-//MetaDataData 2005
-//[End_TestCase]
-
-
-// data file too big, comment out test case
-//[TestCase]
-//id 130
-//Title AudioPlayback.71 - MetaDataData Comment FixYou_Coldplay.mp3
-//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
-//DontPlayAudioClip
-//MetaDataName comment
-//MetaDataData Soothing
-//[End_TestCase]
-
-// data file too big, comment out test case
-//[TestCase]
-//id 130
-//Title AudioPlayback.72 - MetaDataData AlbumTrack FixYou_Coldplay.mp3
-//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
-//DontPlayAudioClip
-//MetaDataName albumtrack
-//MetaDataData 4/13
-//[End_TestCase]
-
-// data file too big, comment out test case
-//[TestCase]
-//id 130
-//Title AudioPlayback.73 - MetaDataData Genre FixYou_Coldplay.mp3
-//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
-//DontPlayAudioClip
-//MetaDataName genre
-//MetaDataData Alternative
-//[End_TestCase]
-
-// data file too big, comment out test case
-//[TestCase]
-//id 130
-//Title AudioPlayback.74 - MetaDataData Composer FixYou_Coldplay.mp3
-//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
-//DontPlayAudioClip
-//MetaDataName composer
-//MetaDataData Chris Martin
-//[End_TestCase]
-
-// data file too big, comment out test case
-//[TestCase]
-//id 130
-//Title AudioPlayback.75 - MetaDataData Copyright FixYou_Coldplay.mp3
-//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
-//DontPlayAudioClip
-//MetaDataName copyright
-//MetaDataData EMI Records
-//[End_TestCase]
-
-// data file too big, comment out test case
-//[TestCase]
-//id 130
-//Title AudioPlayback.76 - MetaDataData OrigArtist FixYou_Coldplay.mp3
-//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
-//DontPlayAudioClip
-//MetaDataName originalartist
-//MetaDataData coldplay
-//[End_TestCase]
-
-
-// data file too big, comment out test case
-//[TestCase]
-//id 130
-//Title AudioPlayback.77 - MetaDataData UserUrl FixYou_Coldplay.mp3
-//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
-//DontPlayAudioClip
-//MetaDataName userdefinedurllinkframe
-//MetaDataData www.coldplay.com
-//[End_TestCase]
 
 //**************************
 //* Play AMR NB Modes 0-7 (ID 120)
@@ -1673,12 +1356,12 @@
 PlayDelay	15000000
 [End_TestCase]
 
-// Total duration of 37s_MID_Generic.mid is 37 seconds
+// Total duration of 30s_MID_Generic.mid is 37 seconds
 
 [TestCase]
 id 155
 Title AudioPlayback.152 - Repeat Pause MIDI
-SoundFile e:\testing\data\mid\37s_MID_Generic.mid
+SoundFile e:\testing\data\mid\30s_MID_Generic.mid
 RepeatTimes 3
 SilenceDuration 3 000 000
 PauseDelay	20000000
@@ -1769,7 +1452,7 @@
 [TestCase]
 id 156
 Title AudioPlayback.160 - Repeat PlayWindow MIDI
-SoundFile e:\testing\data\mid\37s_MID_Generic.mid
+SoundFile e:\testing\data\mid\30s_MID_Generic.mid
 RepeatTimes 3
 SilenceDuration 3 000 000
 StartPosition 	10 000 000
@@ -1868,12 +1551,12 @@
 PlayDelay	20000000
 [End_TestCase]
 
-// Total duration of 37s_MID_Generic.mid is 37 seconds
+// Total duration of 30s_MID_Generic.mid is 37 seconds
 
 [TestCase]
 id 157
 Title AudioPlayback.168 - Repeat Pause PlayWindow MIDI
-SoundFile e:\testing\data\mid\37s_MID_Generic.mid
+SoundFile e:\testing\data\mid\30s_MID_Generic.mid
 RepeatTimes 3
 SilenceDuration 3 000 000
 StartPosition 	10 000 000
@@ -2045,7 +1728,7 @@
 // [TestCase]
 // id 158
 // Title AudioPlayback.184 - Repeat PlayWindow forever MIDI
-// SoundFile e:\testing\data\mid\37s_MID_Generic.mid
+// SoundFile e:\testing\data\mid\30s_MID_Generic.mid
 // RepeatTimes -2
 // SilenceDuration 	3 000 000
 // StartPosition 	10 000 000
@@ -2081,3 +1764,137 @@
 // StartPosition 	3 000 000
 // EndPosition   	7 000 000
 // [End_TestCase]
+
+//**************************
+//* Play - OpenUrlL (ID 106)  
+//*Real Hw 
+//*rtsp://63.108.142.51/TestContent/MediaContent/WCDMA/VideoContent/CBR/3GPP2/VideoContents/MPEG4/30k_MPEG4_3G2_176x144_15fps.3g2
+//**************************
+
+//[TestCase]
+//id 106
+//Title AudioPlayback.215 - OpenUrlL 10s_smooth.mp3
+//SoundFile rtsp://63.108.142.51/testing/data/mp3/10s_smooth.mp3
+//SoundFile rtsp://10.58.104.43:554/aac64kbps44khzHint.mp4
+//[End_TestCase]
+
+// data file too big, comment out test case
+//[TestCase]
+//id 114
+//Title AudioPlayback.35 - DisplayFields FixYou_Coldplay.mp3
+//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
+//DontPlayAudioClip
+//[End_TestCase]
+
+// data file too big, comment out test case
+//[TestCase]
+//id 130
+//Title AudioPlayback.67 - MetaDataData SongTitle FixYou_Coldplay.mp3
+//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
+//DontPlayAudioClip
+//MetaDataName title
+//MetaDataData Fix You
+//[End_TestCase]
+
+// data file too big, comment out test case
+//[TestCase]
+//id 130
+//Title AudioPlayback.68 - MetaDataData Artist FixYou_Coldplay.mp3
+//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
+//DontPlayAudioClip
+//MetaDataName artist
+//MetaDataData Coldplay
+//[End_TestCase]
+
+
+// data file too big, comment out test case
+//[TestCase]
+//id 130
+//Title AudioPlayback.69 - MetaDataData Album FixYou_Coldplay.mp3
+//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
+//DontPlayAudioClip
+//MetaDataName album
+//MetaDataData X & Y
+//[End_TestCase]
+
+// data file too big, comment out test case
+//[TestCase]
+//id 130
+//Title AudioPlayback.70 - MetaDataData Year FixYou_Coldplay.mp3
+//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
+//DontPlayAudioClip
+//MetaDataName year
+//MetaDataData 2005
+//[End_TestCase]
+
+
+// data file too big, comment out test case
+//[TestCase]
+//id 130
+//Title AudioPlayback.71 - MetaDataData Comment FixYou_Coldplay.mp3
+//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
+//DontPlayAudioClip
+//MetaDataName comment
+//MetaDataData Soothing
+//[End_TestCase]
+
+// data file too big, comment out test case
+//[TestCase]
+//id 130
+//Title AudioPlayback.72 - MetaDataData AlbumTrack FixYou_Coldplay.mp3
+//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
+//DontPlayAudioClip
+//MetaDataName albumtrack
+//MetaDataData 4/13
+//[End_TestCase]
+
+// data file too big, comment out test case
+//[TestCase]
+//id 130
+//Title AudioPlayback.73 - MetaDataData Genre FixYou_Coldplay.mp3
+//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
+//DontPlayAudioClip
+//MetaDataName genre
+//MetaDataData Alternative
+//[End_TestCase]
+
+// data file too big, comment out test case
+//[TestCase]
+//id 130
+//Title AudioPlayback.74 - MetaDataData Composer FixYou_Coldplay.mp3
+//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
+//DontPlayAudioClip
+//MetaDataName composer
+//MetaDataData Chris Martin
+//[End_TestCase]
+
+// data file too big, comment out test case
+//[TestCase]
+//id 130
+//Title AudioPlayback.75 - MetaDataData Copyright FixYou_Coldplay.mp3
+//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
+//DontPlayAudioClip
+//MetaDataName copyright
+//MetaDataData EMI Records
+//[End_TestCase]
+
+// data file too big, comment out test case
+//[TestCase]
+//id 130
+//Title AudioPlayback.76 - MetaDataData OrigArtist FixYou_Coldplay.mp3
+//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
+//DontPlayAudioClip
+//MetaDataName originalartist
+//MetaDataData coldplay
+//[End_TestCase]
+
+
+// data file too big, comment out test case
+//[TestCase]
+//id 130
+//Title AudioPlayback.77 - MetaDataData UserUrl FixYou_Coldplay.mp3
+//SoundFile e:\testing\data\metadata\FixYou_Coldplay.mp3
+//DontPlayAudioClip
+//MetaDataName userdefinedurllinkframe
+//MetaDataData www.coldplay.com
+//[End_TestCase]
\ No newline at end of file
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/10kbps 11khz cbr mono.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/128kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/12kbps 8khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/160kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/192kbps 48khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/256kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/320kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/96kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/data/mmc/wma/VBR Q98 44Khz stereo.wma has changed
--- a/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/src/MmfTsPlay_core.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/src/MmfTsPlay_core.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -18,7 +18,7 @@
 // INCLUDE FILES
 #include <StifTestInterface.h>
 #include "MmfTsPlay.h"
-#include <mmcaf.h>
+#include <mmf/common/mmcaf.h>
 
 // Constants
 const TInt CMmfTsPlay::MAX_TESTCASE_ID = 160;
@@ -560,13 +560,11 @@
 		iLogger->Log(_L("Creating simple player with file [%S]"), &FileNamePtr);
 		CSimpleSoundPlayer *sndPlayer = CSimpleSoundPlayer::NewL( FileName, TestModuleIf() , *iLogger);
 
-		sndPlayer -> CtrImpInfo();
-
-
 		CleanupStack::PushL(sndPlayer);
 		iLogger->Log(_L("Starting scheduler"));
 
 		CActiveScheduler::Start();
+        sndPlayer -> CtrImpInfo();
 
 
 		iLogger->Log(_L("Returned from player, errorcode: %d"), sndPlayer->iFinalError );
@@ -951,7 +949,6 @@
 TInt CMmfTsPlay::TestCaseGetLoadPercentageL(CStifSectionParser *section, TTestResult & aResult)
 	{
 	TPtrC FileNamePtr;
-	TTimeIntervalMicroSeconds Position = KDefaultPosition;
 
 	if ( !section->GetLine(KTagSoundFile, FileNamePtr, ENoTag) )
 		{
@@ -960,55 +957,22 @@
 		CSimpleSoundPlayer *sndPlayer = CSimpleSoundPlayer::NewL( FileName, TestModuleIf() , *iLogger);
 		CleanupStack::PushL(sndPlayer);
 
-		TBool UsingDefault;
-		Position = GetTimeIntervalL(section, KTagPosition, UsingDefault, KDefaultPosition);
-
-		iLogger->Log(_L("Seting position to: %d"), Position.Int64());
-		if (UsingDefault) {iLogger->Log(_L("Using default position duration of: (%d)") , KDefaultPosition.Int64());}
-		sndPlayer->iPosition = Position;
-
-		TTimeIntervalMicroSeconds ErrorRange = GetTimeIntervalL(section, KTagErrorRange, UsingDefault, KDefaultErrorRange);
-		if (UsingDefault) {iLogger->Log(_L("Using default error range"));}
-		// * **************************************************************
-
-        sndPlayer -> GetLoad_Percentage();
-		iLogger->Log(_L("Starting scheduler"));
-		TTime StartTime,EndTime;
-		StartTime.HomeTime();
-		CActiveScheduler::Start();
-		EndTime.HomeTime();
-
-
-
-		TTimeIntervalMicroSeconds PerceivedDuration = EndTime.MicroSecondsFrom( StartTime );
-
+	    CActiveScheduler::Start();
+ 		sndPlayer -> GetLoad_Percentage();
+		
 		iLogger->Log(_L("Returned from player, errorcode: %d"), sndPlayer->iFinalError );
-		iLogger->Log(_L("Perceived duration: %d") , PerceivedDuration.Int64() );
-
-
-		TTimeIntervalMicroSeconds ExpectedDuration = TTimeIntervalMicroSeconds(I64INT(sndPlayer->GetDuration().Int64()) - I64INT(Position.Int64()));
-		iLogger->Log(_L("ExpectedDuration: %d") ,ExpectedDuration.Int64() );
-
-		if (  Abs(ExpectedDuration.Int64() - PerceivedDuration.Int64()) > ErrorRange.Int64() )
-			{	//Durations too different
-			iLogger->Log(_L("The clips duration is too different from the actual duration + position") );
-			aResult.iResult = KErrExpectedValueDifferent;
-			aResult.iResultDes.Copy(KTestCaseResultFailExpectedValueDifferent());
+    	aResult.iResult = sndPlayer->iFinalError;
+		if (aResult.iResult)
+	    	{
+		    iLogger->Log(_L("Test failed, error code %d"), aResult.iResult);
+			aResult.iResultDes.Copy(KTestCaseResultFail());
 			}
 		else
 			{
-			aResult.iResult = sndPlayer->iFinalError;
-			if (aResult.iResult)
-				{
-				iLogger->Log(_L("Test failed, error code %d"), aResult.iResult);
-				aResult.iResultDes.Copy(KTestCaseResultFail());
-				}
-			else
-				{
-				iLogger->Log(_L("Test was successful"));
-				aResult.iResultDes.Copy(KTestCaseResultSuccess());
-				}
+			iLogger->Log(_L("Test was successful"));
+			aResult.iResultDes.Copy(KTestCaseResultSuccess());
 			}
+			
 		CleanupStack::PopAndDestroy(sndPlayer);
 		return KErrExecuted;
 		}
--- a/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/src/SimpleSoundPlayer.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioPlaybackTestModule/src/SimpleSoundPlayer.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -692,7 +692,11 @@
 	{
 	TInt percentage;
 	iLogger.Log(_L("Trying to GetLoad_Percentage\n ") );
-	iMdaPlayer->GetAudioLoadingProgressL(percentage);
+	TRAPD(err,iMdaPlayer->GetAudioLoadingProgressL(percentage)); //Controller doesnt support GetAudioLoadingProgressL.
+	if( err == KErrNotSupported )
+	    {
+	    iFinalError = 0;
+	    }
 	iLogger.Log(_L("GetAudioLoadingProgressL (%d)") , percentage);
 	}
 
@@ -791,9 +795,9 @@
 
 void CSimpleSoundPlayer::CtrImpInfo()
 	{
-	iLogger.Log(_L("Trying to GetLoad_Percentage\n ") );
-	const CMMFControllerImplementationInformation& info = iMdaPlayer->ControllerImplementationInformationL();
-	iLogger.Log(_L("GetDRMCustomCommand() finished") );
+	iLogger.Log(_L("Trying to CtrImpInfo\n ") );
+    const CMMFControllerImplementationInformation& info = iMdaPlayer->ControllerImplementationInformationL();
+	iLogger.Log(_L("CtrImpInfo finished") );
 	}
 
 void CSimpleSoundPlayer::Set_Priority()
--- a/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/conf/AudioRecorderTestModule.cfg	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/conf/AudioRecorderTestModule.cfg	Fri Apr 16 15:29:42 2010 +0300
@@ -197,9 +197,9 @@
 [TestCase]
 Id 211
 Title AudioRecord.24 - SetPriority - amr
-File e:\testing\data\record\PriorityTest1-.amr 5 0 2 0 0
-File e:\testing\data\record\PriorityTest2-.amr 3 1 1 0 0 
-File e:\testing\data\record\PriorityTest3-.amr 8 0 8 0 0
+File e:\testing\data\record\PriorityTest1-.amr 5 0 6 0 0
+File e:\testing\data\record\PriorityTest2-.amr 3 1 2 0 0 
+File e:\testing\data\record\PriorityTest3-.amr 8 0 11 0 0
 RecTime 3 0 0 
 [End_TestCase]
 
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/10kbps 11khz cbr mono.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/128kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/12kbps 8khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/160kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/192kbps 48khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/256kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/320kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/96kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/data/mmc/wma/VBR Q98 44Khz stereo.wma has changed
--- a/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/inc/RecordOpen.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/inc/RecordOpen.h	Fri Apr 16 15:29:42 2010 +0300
@@ -25,7 +25,7 @@
 
 #include <MdaAudioSampleEditor.h>
 #include "TestCaseBase.h"
-#include <mmcaf.h>
+#include <mmf/common/mmcaf.h>
 
 class CRecordOpen : public CTestCaseBase, public MMdaObjectStateChangeObserver
 {
--- a/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/inc/RecordingBase.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/inc/RecordingBase.h	Fri Apr 16 15:29:42 2010 +0300
@@ -26,7 +26,7 @@
 #include <MdaAudioSampleEditor.h>
 #include "TestCaseBase.h"
 #include "MediaEvent.h"
-
+#include <f32file.h>
 class CRecordingBase;
 
 typedef CRecordingBase* recPtr;
@@ -76,6 +76,13 @@
 	bool isAmr;
 	bool isBitRateTest;
 
+	RFs iFs;
+
+	        /**
+	        * Pointer to a file manager object. Owned.
+	        */
+  CFileMan* iFileMan;
+
 	//To create an object of the derived class
 	static CRecordingBase* CreateObjectL(CTestModuleIf *aConsole, CStifLogger *aLogger);
 
--- a/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/AudioLoadingProgress.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/AudioLoadingProgress.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -176,7 +176,7 @@
 
 		TInt percentage;
 		TRAPD(err, recorder->GetAudioLoadingProgressL(percentage));
-		if (err != KErrNone)
+		if (err != KErrNotSupported)
 			{
 				logger->Log(_L("Error %d for GetAudioLoadingProgressL %d "),KErrProgressPect, percentage  );
 				callbackErr = KErrProgressPect;
--- a/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/MetaDataEntry.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/MetaDataEntry.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -167,7 +167,7 @@
 		TInt NumMetaDatas =0;
 		err = recorder->GetNumberOfMetaDataEntries(NumMetaDatas);
 
-		if ( err )
+		if ( err !=KErrNotSupported )
 		{	//Error getting meta data info
 			logger->Log(_L("Error getting meta data info %d"),err);
 			callbackErr = err;
@@ -186,7 +186,7 @@
 
 		CMMFMetaDataEntry *myMetaData = CMMFMetaDataEntry::NewL(myName, myValue);
 		TRAPD(err, recorder->AddMetaDataEntryL(*myMetaData));
-		if (err != KErrNone)
+		if (err != KErrNotSupported)
 		{
 			logger->Log(_L("Error %d for AddMetaDataEntryL"),err);
 			callbackErr = err;
@@ -197,7 +197,7 @@
 		CMMFMetaDataEntry *currentMetaData;
 		TRAPD(err1, (currentMetaData = recorder->GetMetaDataEntryL(0)));
 
-		if (err1 != KErrNone)
+		if (err1 != KErrNotSupported)
 			{
 				logger->Log(_L("Error %d for GetMetaDataEntryL"),err1);
 				callbackErr = err1;
@@ -212,13 +212,17 @@
 		    logger->Log(_L("getting meta data info %d"),currMetaDataIndex);
 		    CMMFMetaDataEntry *currMetaData;
 		    TRAPD(err2, (currMetaData = recorder->GetMetaDataEntryL(currMetaDataIndex)));
-		    if (err2 != KErrNone)
+		    if (err2 != KErrNotSupported)
 			{
 				logger->Log(_L("Error %d for GetMetaDataEntryL"),err2);
 				//delete currMetaData;
 				callbackErr = err2;
 				break;
 			}
+		    if( err2 != KErrNone)
+		        {
+		         break;
+		        }
 			if (currMetaData != NULL )
 			{
 				// check for jpeg image
@@ -233,7 +237,7 @@
 
 
 		TRAPD(err3, recorder->ReplaceMetaDataEntryL(0, *myMetaData););
-		if (err3 != KErrNone)
+		if (err3 != KErrNotSupported)
 		{
 			logger->Log(_L("Error %d for ReplaceMetaDataEntryL"),err3);
 			callbackErr = err3;
@@ -242,7 +246,7 @@
 		logger->Log(_L("ReplaceMetaDataEntryL CMMFMetaDataEntry."));
 
 		TRAPD(err4, recorder->RemoveMetaDataEntry(0));
-		if (err4 != KErrNone)
+		if (err4 != KErrNotSupported)
 		{
 			logger->Log(_L("Error %d for RemoveMetaDataEntry"),err4);
 			callbackErr = err4;
--- a/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/RecordingBase.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioRecorderTestModule/src/RecordingBase.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -41,8 +41,11 @@
 }
 
 CRecordingBase::~CRecordingBase()
-{
+{  
+	TInt err( iFileMan->Delete( recordingFileName ) );
 	if (recorder) delete recorder;
+	iFs.Close();
+	if(iFileMan) delete iFileMan;
 	recorder = NULL;
 }
 
@@ -113,6 +116,9 @@
 void CRecordingBase::ConstructL(TFileName* fileName)
 {
 	logger->Log(_L("Creating file: %S"),fileName);
+	User::LeaveIfError( iFs.Connect() );
+	iFileMan = CFileMan::NewL( iFs );
+
 	recorder = CMdaAudioRecorderUtility::NewL(*this);
 	if (recorder)
 	{
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/10kbps 11khz cbr mono.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/128kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/12kbps 8khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/160kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/192kbps 48khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/256kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/320kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/96kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioStreamTestModule/data/mmc/wma/VBR Q98 44Khz stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/10kbps 11khz cbr mono.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/128kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/12kbps 8khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/160kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/192kbps 48khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/256kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/320kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/96kbps 44khz cbr stereo.wma has changed
Binary file mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/AudioToneTestModule/data/mmc/wma/VBR Q98 44Khz stereo.wma has changed
--- a/mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientStreamControl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientStreamControl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -211,12 +211,17 @@
     {
     TInt status(KErrNotReady);
     // Get the observer from effect
-    CEffectControlBase* effectBase =
+    if(&aEffect)
+       {
+       CEffectControlBase* effectBase =
             dynamic_cast<CEffectControlBase*>(&aEffect);
 
     // Remove the effect from the array
     TInt index(KErrNotFound);
-    index = iAssociatedEffects.Find(effectBase);
+    if(effectBase)
+       {
+       index = iAssociatedEffects.Find(effectBase);
+        
     if (index != KErrNotFound)
         {
         MControlObserver* observer;
@@ -229,9 +234,11 @@
         iAssociatedEffects.Remove(index);
         status = effectBase->RemovedFromStreamControl(*this);
         RETURN_IF_ERROR( status );
+         }
         }
-
+       }
     return status;
+        
     }
 
 TInt CStreamControl::AddEffect(MEffectControl& aEffect)
@@ -525,7 +532,10 @@
     if (iSourceControl)
         {
         CSourceBase* sourcebase = dynamic_cast<CSourceBase*>(iSourceControl);
-        sourcebase->ServerSourceDeleted();
+        if (sourcebase)
+            sourcebase->ServerSourceDeleted();
+        else
+            return status;
         }
 
     SetStreamState(EStreamClosed, KErrNone);
@@ -627,10 +637,13 @@
             // seperate function and call function here...
 
             // Signal the source that server side source is unloaded
+        if (iSourceControl)
+            {
             CSourceBase* sourcebase =
                     dynamic_cast<CSourceBase*>(iSourceControl);
-            sourcebase->ServerSourceDeleted();
-
+             if (sourcebase)
+                 sourcebase->ServerSourceDeleted();
+            }
             if (iControllerEventMonitor)
                 {
                 iControllerEventMonitor->Cancel();
@@ -666,11 +679,18 @@
             // Save the uid of controller loaded.
             iControllerUid = aControllerUid;
             // Signal the source that server side source is loaded
-            CSourceBase* sourcebase =
+            if (iSourceControl)
+                {
+                CSourceBase* sourcebase =
                     dynamic_cast<CSourceBase*>(iSourceControl);
-            sourcebase->ServerSourceCreated( *iCMCustomCommand,
+               if (sourcebase)
+                   sourcebase->ServerSourceCreated( *iCMCustomCommand,
                     *aSourceHandle);
-
+              else
+                 {
+                 SetStreamState(EStreamClosed, aError);
+                 }
+                }
             if (iStreamState == EStreamOpening)
                 {
                 iPrimeController = ETrue;
@@ -699,7 +719,7 @@
 
 TInt CStreamControl::LaunchController()
     {
-    TInt status(KErrNone);
+    TInt status(KErrNotReady);
     // KUidMediaTypeAudio need to be part of source
     ConfigureControllerLoader(KUidMediaTypeAudio,
             CMMFFindAndOpenController::EPlayback);
@@ -707,9 +727,25 @@
 
     if (!iSourceControl || !iSinkControl)
         return KErrNotReady;
+   CSourceBase *sourceBase=(dynamic_cast<CSourceBase*>(iSourceControl));
+   TUid sourceUID ;
 
-    TUid sourceUID = (dynamic_cast<CSourceBase*>(iSourceControl))->GetSourceUid();
-    TUid sinkUID = (dynamic_cast<CSinkBase*>(iSinkControl))->GetSinkUid();
+   if (sourceBase)
+      {
+       sourceUID = sourceBase->GetSourceUid();
+      }
+   else
+       {
+       return KErrNotReady;
+       }
+
+   CSinkBase *sinkBase=(dynamic_cast<CSinkBase*>(iSinkControl));
+   TUid sinkUID;
+
+   if(sinkBase)
+      sinkUID = sinkBase ->GetSinkUid();
+   else
+      return KErrNotReady;
 
     if (iSourceControl->Type() == KDataBufferSourceControl)
         {
@@ -755,7 +791,7 @@
             HBufC8* mimeType = HBufC8::NewLC(KMaxMimeLength);
             TPtr8 mimeTypePtr = mimeType->Des();
 
-            TInt status = iSourceControl->GetMimeType(mimeTypePtr);
+            status = iSourceControl->GetMimeType(mimeTypePtr);
 
             iFindAndOpenController->ConfigureSourceSink(
                     TMMFileSource(fileNamePtr,
@@ -806,7 +842,7 @@
         HBufC8* mimeType = HBufC8::NewLC(KMaxMimeLength);
         TPtr8 mimeTypePtr = mimeType->Des();
 
-        TInt status = iSourceControl->GetMimeType(mimeTypePtr);
+        status = iSourceControl->GetMimeType(mimeTypePtr);
 
         iFindAndOpenController->ConfigureSourceSink(
                 CMMFFindAndOpenController::TSourceSink(sourceUID,
--- a/mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientStreamControl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientStreamControl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -23,7 +23,7 @@
 
 #include <e32base.h>
 #include <StreamControl.h>
-#include <mcustominterface.h>
+#include <MCustomInterface.h>
 #include <mmf/common/mmfcontroller.h>
 #include "ClientUtility.h"
 #include <Events.h>
--- a/mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientUtility.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientUtility.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  Definition of the ClientUtility class.
-*  Version     : %version: bh1mmcf#12 %
+*  Version     : %version: bh1mmcf#11 %
 *
 */
 
@@ -2325,7 +2325,7 @@
         }
     else if(iFileName.Length() != 0)  //need to check if file name exist
         {
-        TRAP(error, content = ContentAccess::CContent::NewL(iFileName,EContentShareReadWrite));
+        TRAP(error, content = ContentAccess::CContent::NewL(iFileName));
         if(error == KErrPermissionDenied)
             {
             aIsSecureDrmProcess = ETrue;
--- a/mmfenh/enhancedmediaclient/Plugins/DescriptorSource/group/ABLD.BAT	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-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 the License "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 OFF
-
-REM Bldmake-generated batch file - ABLD.BAT
-REM ** DO NOT EDIT **
-
-perl -S ABLD.PL "\s60\mw\mmenhs\audioenhancements\EnhancedMediaClient\Plugins\DescriptorSource\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
-if errorlevel==1 goto CheckPerl
-goto End
-
-:CheckPerl
-perl -v >NUL
-if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed?
-goto End
-
-:End
--- a/mmmw_info/mmmw_metadata/mmmw_metadata.mrp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_info/mmmw_metadata/mmmw_metadata.mrp	Fri Apr 16 15:29:42 2010 +0300
@@ -1,3 +1,19 @@
+#
+# 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: 
+#
+
 component           mmmw_metadata
 source   \sf\mw\mmmw\mmmw_info\mmmw_metadata 
 source   \sf\mw\mmmw\package_definition.xml
Binary file mmmw_plat/call_audio_control_api/tsrc/data/mmc/alarm 1.aac has changed
--- a/mmmw_plat/equalizer_ui_api/inc/EqualizerPresetsDialog.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/equalizer_ui_api/inc/EqualizerPresetsDialog.h	Fri Apr 16 15:29:42 2010 +0300
@@ -25,7 +25,7 @@
 #include <AknDialog.h> 
 #include <aknlists.h>
 #include <EqualizerConstants.h>
-#include <AudioEqualizerutility.h>
+#include <AudioEqualizerUtility.h>
 
 // CLASS DECLARATION
 class CEqualizerPresetListArray;
--- a/mmmw_plat/group/bld.inf	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/group/bld.inf	Fri Apr 16 15:29:42 2010 +0300
@@ -30,8 +30,6 @@
 #include "../emc_volume_effect_api/group/bld.inf"
 #include "../emc_balance_effect_api/group/bld.inf"
 #include "../emc_descriptor_source_api/group/bld.inf"
-#include "../mtp_wmdrm_api/group/bld.inf"
-#include "../mtp_keys_api/group/bld.inf"
 #include "../emc_drm_config_intfc_api/group/bld.inf"
 #include "../voip_audio_services_api/group/bld.inf"
 #include "../configuration_components_factory_api/group/bld.inf"
@@ -44,3 +42,4 @@
 #include "../radio_monitor_api/group/bld.inf"
 #include "../thumbnail_engine_api/group/bld.inf"
 #include "../telephony_multimedia_service_api/group/bld.inf"
+#include "../openmax_al_api/group/bld.inf"
--- a/mmmw_plat/mtp_keys_api/group/bld.inf	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 2006 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:   File that exports the files belonging to 
-:                MTP Keys API
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-../inc/MtpPrivateCRKeys.h     MW_LAYER_PLATFORM_EXPORT_PATH(MtpPrivateCRKeys.h)
-../inc/MtpPrivatePSKeys.h     MW_LAYER_PLATFORM_EXPORT_PATH(MtpPrivatePSKeys.h)
--- a/mmmw_plat/mtp_keys_api/inc/MtpPrivateCRKeys.h	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +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:   Header Information for MTP Private Cenrep Keys
-*
-*/
-
-
-#ifndef MTPPRIVATECRKEYS_H
-#define MTPPRIVATECRKEYS_H
-
-#include <e32cmn.h>
-
-// MTP Settings API
-const TUid KCRUIDMTPSettings = {0x101FFC53};    // MTP CenRep Key UID
-const TUint32 KMTPDeleteFlag = 0x00000001;      // MTP CenRep Key for Delete contents
-
-#endif // MTPPRIVATECRKEYS_H
--- a/mmmw_plat/mtp_keys_api/inc/MtpPrivatePSKeys.h	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +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:   Header Information for MTP Private Publish & Subsribe Keys
-*
-*/
-
-
-#ifndef MTPPRIVATEPSKEYS_H
-#define MTPPRIVATEPSKEYS_H
-
-// Security Code UI Originator API
-const TUid KMtpPSUid = {0x101FFC51};    // Mtp Key UID
-const TInt KMtpPSStatus = 1;            // Mtp UID
-
-enum TMtpPSStatus
-    {
-    EMtpPSStatusUninitialized = 0, 
-    EMtpPSStatusActive, 
-    EMtpPSStatusReadyToSync
-    };
-
-#endif // MTPPRIVATEPSKEYS_H
--- a/mmmw_plat/mtp_keys_api/mtp_keys_api.metaxml	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0" ?>
-<api id="eba779447f4b459225cbd374f504d422" dataversion="2.0">
-  <name>MTP Keys API</name>
-  <description>This API defines the Central Repository and Publish &amp; Subscribe keys defined by MTP.</description>
-  <type>c++</type>
-  <collection>mtp</collection>
-  <libs>
-  </libs>
-  <release category="platform"/>
-  <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
-  </attributes>
-</api>
--- a/mmmw_plat/mtp_wmdrm_api/group/bld.inf	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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:   File that exports the files belonging to 
-:                MTP WMDRM API
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-../inc/MMtpJanusDrmIf.h     MW_LAYER_PLATFORM_EXPORT_PATH(MMtpJanusDrmIf.h)
--- a/mmmw_plat/mtp_wmdrm_api/inc/MMtpJanusDrmIf.h	Tue Feb 02 01:08:46 2010 +0200
+++ /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:   Defines the interface for implementation of the Windows DRM commands for MTP
-*                An implementor should derive from the class contained in this header file and
-*                supply a DLL with a single export which returns a pointer to an instance of
-*                the MMtpJanusDrmIf class.  The ordinal 1 export may not be a leaving function
-*                - all memory allocation should be done on the ConstructL() function call,
-*                which may leave.
-*
-*/
-
-
-#ifndef MMTPJANUSDRMIF_H
-#define MMTPJANUSDRMIF_H
-
-#include <e32std.h>
-
-
-/**
- *  Interface class of Windows DRM for MTP
- *
- *  @lib MtpServer.lib
- *  @since S60 3.2
- */
-class MMtpJanusDrmIf
-    {
-    public:
-    
-        /**
-         * Second phase constructor. All allocation for the library should be performed at this call
-         *
-         * @since S60 3.2
-         */
-        virtual void ConstructL() = 0;
-        
-        /**
-         * Called before the library is unloaded. All destruction and clean-up should be performed at this call
-         *
-         * @since S60 3.2
-         */
-        virtual void Close() = 0;
-                
-        /**
-         * Gets a secure time challenge from the initiator
-         *
-         * @since S60 3.2
-         * @param aDataPhase Descriptor to populate with the challenge data (responder->initiator)
-         * @param aResponseParamOne Contains the DRM_RESULT (OUT)
-         * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes
-         */
-        virtual TInt GetSecureTimeChallenge(TDes8& aDataPhase, TUint32& aResponseParamOne) = 0;
-        
-        /**
-         * Sends a secure time response to the responder
-         *
-         * @since S60 3.2
-         * @param aDataPhase Descriptor containing the response data (initiator->responder)
-         * @param aResponseParamOne Contains the DRM_RESULT (OUT)
-         * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes
-         */
-        virtual TInt SetSecureTimeResponse(const TDesC8& aDataPhase, TUint32& aResponseParamOne) = 0;
-    
-        /**
-         * Sends a license response object to the responder
-         *
-         * @since S60 3.2
-         * @param aDataPhase Descriptor containing the license response data
-         * @param aResponseParamOne Contains the DRM_RESULT (OUT)
-         * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes
-         */
-        virtual TInt SetLicenseResponse(const TDesC8& aDataPhase, TUint32& aResponseParamOne) = 0;
-        
-        /**
-         * Sends a list of items to the initiator, based on the parameters in the query
-         *
-         * @since S60 3.2
-         * @param aDataPhase Descriptor containing the sync list requested (responder -> initiator)
-         * @param aParamOne Contains the maximum remaining count value for the query (IN) and the DRM_RESULT (OUT)
-         * @param aParamTwo Contains the maximum remaining song validity for the query (IN) and the next starting index (OUT)
-         * @param aParamThree Contains the starting index for the data phase (IN) and the number of items processed (OUT)
-         * @param aParamFour Contains the number of items that should be processed in this call (IN)
-         * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes
-         */
-        virtual TInt GetSyncList(TDes8& aDataPhase, TUint32& aParamOne, TUint32& aParamTwo, 
-                                 TUint32& aParamThree, TUint32 aParamFour) = 0;
-    
-        /**
-         * Sends a meter challenge query.
-         *
-         * @since S60 3.2
-         * @param aDataPhase Descriptor containing the meter challenge query (initiator -> responder)
-         * @param aResponseParamOne Contains the DRM_RESULT (OUT)
-         * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes
-         */
-        virtual TInt SendMeterChallengeQuery(const TDesC8& aDataPhase, TUint32& aResponseParamOne) = 0;
-        
-        /**
-         * Gets a meter challenge from the initiator
-         *
-         * @since S60 3.2
-         * @param aDataPhase Descriptor to populate with the challenge data (responder->initiator)
-         * @param aResponseParamOne Contains the DRM_RESULT (OUT)
-         * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes
-         */
-        virtual TInt GetMeterChallenge(TDes8& aDataPhase, TUint32& aResponseParamOne) = 0;
-        
-        /**
-         * Sends a meter response to the responder
-         *
-         * @since S60 3.2
-         * @param aDataPhase Descriptor containing the response data (initiator->responder)
-         * @param aResponseParamOne Contains the DRM_RESULT (OUT)
-         * @param aMeterResponseFlags Contains the bit mask of flags to be passed to the initiator
-         * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes
-         */
-        virtual TInt SetMeterResponse(const TDesC8& aDataPhase, TUint32& aResponseParamOne, TUint32& aMeterResponseFlags) = 0;
-        
-        /**
-         * Instructs the mobile device to clean the data store
-         *
-         * @since S60 3.2
-         * @param aParamOne Contains the cleaning flags bitmask (IN) and the DRM_RESULT (OUT)
-         * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes
-         */
-        virtual TInt CleanDataStore(TUint32& aParamOne) = 0;
-
-        /**
-         * Gets the state of the license requested in the data phase
-         *
-         * @since S60 3.2
-         * @param aDataPhase Descriptor containing the state query data
-         * @param aParamOne Contains the DRM_RESULT (OUT)
-         * @param aParamTwo Contains the category (OUT)
-         * @param aParamThree Contains the DRM license state (OUT)
-         * @param aParamFour Contains the DRM license state (OUT)
-         * @param aParamFive Contains reserved data (OUT)
-         * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes
-         */
-        virtual TInt GetLicenseState(const TDesC8& aDataPhase, TUint32& aParamOne, TUint32& aParamTwo, 
-                                     TUint32& aParamThree, TUint32& aParamFour, TUint32& aParamFive) = 0;
-                                 
-        /**
-         * Sends a WMDRM command to the portable device for processing
-         *
-         * @since S60 3.2
-         * @param aDataPhase Descriptor containing the command data phase (initiator -> responder)
-         * @param aParamOne Contains the operation code (IN) and the DRM_RESULT (OUT)
-         * @param aParamTwo Contains the first request argument (IN) and the first response result (OUT)
-         * @param aParamThree Contains the second request argument (IN) and the second response result (OUT)
-         * @param aParamFour Contains the third request argument (IN) and the third response result (OUT)
-         * @param aParamFive Contains the fourth request argument (IN) and the fourth response result (OUT)
-         * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes
-         */
-        virtual TInt SendWMDRMCommand(const TDesC8& aDataPhase, TUint32& aParamOne, TUint32& aParamTwo, 
-                                      TUint32& aParamThree, TUint32& aParamFour, TUint32& aParamFive) = 0;
-
-        /**
-         * Sends a WMDRM request to the portable device for processing
-         *
-         * @since S60 3.2
-         * @param aDataPhase Descriptor containing the command data phase (responder -> initiator)
-         * @param aParamOne Contains the operation code (IN) and the DRM_RESULT (OUT)
-         * @param aParamTwo Contains the first request argument (IN) and the first response result (OUT)
-         * @param aParamThree Contains the second request argument (IN) and the second response result (OUT)
-         * @param aParamFour Contains the third request argument (IN) and the third response result (OUT)
-         * @param aParamFive Contains the fourth request argument (IN) and the fourth response result (OUT)
-         * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes
-         */
-        virtual TInt SendWMDRMRequest(TDes8& aDataPhase, TUint32& aParamOne, TUint32& aParamTwo, 
-                                      TUint32& aParamThree, TUint32& aParamFour, TUint32& aParamFive) = 0;
-        
-        /**
-         * Get the device certificate to pass back as the device property. The descriptor returned should
-         * contain the device certificate information as required by the GetDeviceProperty MTP command for
-         * the MTP_PROPERTYCODE_JANUS_DEVICECERTIFICATE dataset. 
-         * Ownership of the descriptor is passed back
-         *
-         * @since S60 3.2
-         * @return A populated buffer of the device certificate dataset, or NULL in the case of an error
-         */
-        virtual HBufC* DeviceCertificate() = 0;
-
-        /**
-         * Get the secure time of the device.
-         * Ownership of the descriptor is passed back
-         *
-         * @since S60 3.2
-         * @return A populated buffer of the device secure time, or NULL in the case of an error
-         */
-//        virtual HBufC* SecureTime() = 0;
-    };
-
-#endif // MMTPJANUSDRMIF_H
--- a/mmmw_plat/mtp_wmdrm_api/mtp_wmdrm_api.metaxml	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0" ?>
-<api id="686aaf9587f8c50a32b406699fdcc640" dataversion="2.0">
-  <name>MTP WMDRM API</name>
-  <description>This API defines the API used by MTP for handling WMDRM commands.</description>
-  <type>c++</type>
-  <collection>mtp</collection>
-  <libs>
-  </libs>
-  <release category="platform"/>
-  <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
-  </attributes>
-</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/group/bld.inf	Fri Apr 16 15:29:42 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:  Exports OpenMAX AL headers
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+#ifdef FF_OPENMAX_AL
+../inc/OpenMAXAL.h              MW_LAYER_PLATFORM_EXPORT_PATH(khronos/OpenMAXAL.h)
+../inc/OpenMAXAL_Platform.h     MW_LAYER_PLATFORM_EXPORT_PATH(khronos/OpenMAXAL_Platform.h)
+../readme.txt                   MW_LAYER_PLATFORM_EXPORT_PATH(khronos/readme.txt)
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/inc/OpenMAXAL.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,3196 @@
+/*
+ * Copyright (c) 2007-2010 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and/or associated documentation files (the
+ * "Materials "), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to 
+ * the following conditions: 
+ *
+ * The above copyright notice and this permission notice shall be included 
+ * in all copies or substantial portions of the Materials. 
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ *
+ * OpenMAXAL.h - OpenMAX AL version 1.0.1
+ *
+ */
+
+/****************************************************************************/
+/* NOTE: This file is a standard OpenMAX AL header file and should not be   */
+/* modified in any way.                                                     */
+/****************************************************************************/
+
+#ifndef _OPENMAXAL_H_
+#define _OPENMAXAL_H_
+
+#include "OpenMAXAL_Platform.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+  /*****************************************************************/
+  /* TYPES                                                         */
+  /*****************************************************************/
+
+/* remap common types to XA types for clarity */
+typedef xa_int8_t   XAint8;   /* 8 bit signed integer    */
+typedef xa_uint8_t  XAuint8;  /* 8 bit unsigned integer  */
+typedef xa_int16_t  XAint16;  /* 16 bit signed integer   */
+typedef xa_uint16_t XAuint16; /* 16 bit unsigned integer */
+typedef xa_int32_t  XAint32;  /* 32 bit signed integer   */
+typedef xa_uint32_t XAuint32; /* 32 bit unsigned integer */
+typedef xa_uint64_t XAuint64; /* 64 bit unsigned integer */
+
+typedef XAuint32    XAboolean;
+typedef XAuint8     XAchar;
+typedef XAint16     XAmillibel;
+typedef XAuint32    XAmillisecond;
+typedef XAuint32    XAmilliHertz;
+typedef XAint32     XAmillimeter;
+typedef XAint32     XAmillidegree;
+typedef XAint16     XApermille;
+typedef XAuint32    XAmicrosecond;
+typedef XAuint64    XAtime;
+typedef XAuint32    XAresult;
+
+#define XA_BOOLEAN_FALSE                    ((XAuint32) 0x00000000)
+#define XA_BOOLEAN_TRUE                     ((XAuint32) 0x00000001)
+
+#define XA_MILLIBEL_MAX                     ((XAmillibel) 0x7FFF)
+#define XA_MILLIBEL_MIN                     ((XAmillibel) (-XA_MILLIBEL_MAX-1))
+
+#define XA_MILLIHERTZ_MAX                   ((XAmilliHertz) 0xFFFFFFFF)
+
+#define XA_MILLIMETER_MAX                   ((XAmillimeter) 0x7FFFFFFF)
+
+
+
+  /*****************************************************************/
+  /* RESULT CODES                                                  */
+  /*****************************************************************/
+
+#define XA_RESULT_SUCCESS                   ((XAuint32) 0x00000000)
+#define XA_RESULT_PRECONDITIONS_VIOLATED    ((XAuint32) 0x00000001)
+#define XA_RESULT_PARAMETER_INVALID         ((XAuint32) 0x00000002)
+#define XA_RESULT_MEMORY_FAILURE            ((XAuint32) 0x00000003)
+#define XA_RESULT_RESOURCE_ERROR            ((XAuint32) 0x00000004)
+#define XA_RESULT_RESOURCE_LOST             ((XAuint32) 0x00000005)
+#define XA_RESULT_IO_ERROR                  ((XAuint32) 0x00000006)
+#define XA_RESULT_BUFFER_INSUFFICIENT       ((XAuint32) 0x00000007)
+#define XA_RESULT_CONTENT_CORRUPTED         ((XAuint32) 0x00000008)
+#define XA_RESULT_CONTENT_UNSUPPORTED       ((XAuint32) 0x00000009)
+#define XA_RESULT_CONTENT_NOT_FOUND         ((XAuint32) 0x0000000A)
+#define XA_RESULT_PERMISSION_DENIED         ((XAuint32) 0x0000000B)
+#define XA_RESULT_FEATURE_UNSUPPORTED       ((XAuint32) 0x0000000C)
+#define XA_RESULT_INTERNAL_ERROR            ((XAuint32) 0x0000000D)
+#define XA_RESULT_UNKNOWN_ERROR             ((XAuint32) 0x0000000E)
+#define XA_RESULT_OPERATION_ABORTED         ((XAuint32) 0x0000000F)
+#define XA_RESULT_CONTROL_LOST              ((XAuint32) 0x00000010)
+
+
+
+  /*****************************************************************/
+  /* INTERFACE ID DEFINITION                                       */
+  /*****************************************************************/
+
+/* Interface ID defined as a UUID */
+typedef const struct XAInterfaceID_ {
+    XAuint32 time_low;
+    XAuint16 time_mid;
+    XAuint16 time_hi_and_version;
+    XAuint16 clock_seq;
+    XAuint8  node[6];
+} * XAInterfaceID;
+
+/* NULL Interface */
+XA_API extern const XAInterfaceID XA_IID_NULL;
+
+
+
+  /*****************************************************************/
+  /* GENERAL INTERFACES, STRUCTS AND DEFINES                       */
+  /*****************************************************************/
+
+/* OBJECT */
+
+#define XA_PRIORITY_LOWEST                      ((XAint32) (-0x7FFFFFFF-1))
+#define XA_PRIORITY_VERYLOW                     ((XAint32) -0x60000000)
+#define XA_PRIORITY_LOW                         ((XAint32) -0x40000000)
+#define XA_PRIORITY_BELOWNORMAL                 ((XAint32) -0x20000000)
+#define XA_PRIORITY_NORMAL                      ((XAint32) 0x00000000)
+#define XA_PRIORITY_ABOVENORMAL                 ((XAint32) 0x20000000)
+#define XA_PRIORITY_HIGH                        ((XAint32) 0x40000000)
+#define XA_PRIORITY_VERYHIGH                    ((XAint32) 0x60000000)
+#define XA_PRIORITY_HIGHEST                     ((XAint32) 0x7FFFFFFF)
+
+#define XA_OBJECT_EVENT_RUNTIME_ERROR           ((XAuint32) 0x00000001)
+#define XA_OBJECT_EVENT_ASYNC_TERMINATION       ((XAuint32) 0x00000002)
+#define XA_OBJECT_EVENT_RESOURCES_LOST          ((XAuint32) 0x00000003)
+#define XA_OBJECT_EVENT_RESOURCES_AVAILABLE     ((XAuint32) 0x00000004)
+#define XA_OBJECT_EVENT_ITF_CONTROL_TAKEN       ((XAuint32) 0x00000005)
+#define XA_OBJECT_EVENT_ITF_CONTROL_RETURNED    ((XAuint32) 0x00000006)
+#define XA_OBJECT_EVENT_ITF_PARAMETERS_CHANGED  ((XAuint32) 0x00000007)
+
+#define XA_OBJECT_STATE_UNREALIZED              ((XAuint32) 0x00000001)
+#define XA_OBJECT_STATE_REALIZED                ((XAuint32) 0x00000002)
+#define XA_OBJECT_STATE_SUSPENDED               ((XAuint32) 0x00000003)
+
+
+XA_API extern const XAInterfaceID XA_IID_OBJECT;
+
+struct XAObjectItf_;
+typedef const struct XAObjectItf_ * const * XAObjectItf;
+
+typedef void (XAAPIENTRY * xaObjectCallback) (
+    XAObjectItf caller,
+    const void * pContext,
+    XAuint32 event,
+    XAresult result,
+    XAuint32 param,
+    void * pInterface
+);
+
+struct XAObjectItf_ {
+    XAresult (*Realize) (
+        XAObjectItf self,
+        XAboolean async
+    );
+    XAresult (*Resume) (
+        XAObjectItf self,
+        XAboolean async
+    );
+    XAresult (*GetState) (
+        XAObjectItf self,
+        XAuint32 * pState
+    );
+    XAresult (*GetInterface) (
+        XAObjectItf self,
+        const XAInterfaceID iid,
+        void * pInterface
+    );
+    XAresult (*RegisterCallback) (
+        XAObjectItf self,
+        xaObjectCallback callback,
+        void * pContext
+    );
+    void (*AbortAsyncOperation) (
+        XAObjectItf self
+    );
+    void (*Destroy) (
+        XAObjectItf self
+    );
+    XAresult (*SetPriority) (
+        XAObjectItf self,
+        XAint32 priority,
+        XAboolean preemptable
+    );
+    XAresult (*GetPriority) (
+        XAObjectItf self,
+        XAint32 * pPriority,
+        XAboolean * pPreemptable
+    );
+    XAresult (*SetLossOfControlInterfaces) (
+        XAObjectItf self,
+        XAint16 numInterfaces,
+        XAInterfaceID * pInterfaceIDs,
+        XAboolean enabled
+    );
+};
+
+/* CONFIG EXTENSION */
+
+XA_API extern const XAInterfaceID XA_IID_CONFIGEXTENSION;
+
+struct XAConfigExtensionsItf_;
+typedef const struct XAConfigExtensionsItf_ 
+    * const * XAConfigExtensionsItf;
+
+struct XAConfigExtensionsItf_ {
+    XAresult (*SetConfiguration) (
+        XAConfigExtensionsItf self, 
+        const XAchar * configKey,
+        XAuint32 valueSize, 
+        const void * pConfigValue
+    );
+    XAresult (*GetConfiguration) (
+        XAConfigExtensionsItf self, 
+        const XAchar * configKey, 
+        XAuint32 * pValueSize,
+        void * pConfigValue
+    );
+};
+
+/* DYNAMIC INTERFACE MANAGEMENT */
+
+#define XA_DYNAMIC_ITF_EVENT_RUNTIME_ERROR              ((XAuint32) 0x00000001)
+#define XA_DYNAMIC_ITF_EVENT_ASYNC_TERMINATION          ((XAuint32) 0x00000002)
+#define XA_DYNAMIC_ITF_EVENT_RESOURCES_LOST             ((XAuint32) 0x00000003)
+#define XA_DYNAMIC_ITF_EVENT_RESOURCES_LOST_PERMANENTLY ((XAuint32) 0x00000004)
+#define XA_DYNAMIC_ITF_EVENT_RESOURCES_AVAILABLE        ((XAuint32) 0x00000005)
+
+XA_API extern const XAInterfaceID XA_IID_DYNAMICINTERFACEMANAGEMENT;
+
+struct XADynamicInterfaceManagementItf_;
+typedef const struct XADynamicInterfaceManagementItf_
+    * const * XADynamicInterfaceManagementItf;
+
+typedef void (XAAPIENTRY * xaDynamicInterfaceManagementCallback) (
+    XADynamicInterfaceManagementItf caller,
+    void * pContext,
+    XAuint32 event,
+    XAresult result,
+    const XAInterfaceID iid
+);
+
+struct XADynamicInterfaceManagementItf_ {
+    XAresult (*AddInterface) (
+        XADynamicInterfaceManagementItf self,
+        const XAInterfaceID iid,
+        XAboolean aysnc
+    );
+    XAresult (*RemoveInterface) (
+        XADynamicInterfaceManagementItf self,
+        const XAInterfaceID iid
+    );
+    XAresult (*ResumeInterface) (
+        XADynamicInterfaceManagementItf self,
+        const XAInterfaceID iid,
+        XAboolean aysnc
+    );
+    XAresult (*RegisterCallback) (
+        XADynamicInterfaceManagementItf self,
+        xaDynamicInterfaceManagementCallback callback,
+        void * pContext
+    );
+};
+
+/* DATA SOURCES/SINKS */
+
+#define XA_DATAFORMAT_MIME              ((XAuint32) 0x00000001)
+#define XA_DATAFORMAT_PCM               ((XAuint32) 0x00000002)
+#define XA_DATAFORMAT_RAWIMAGE          ((XAuint32) 0x00000003)
+
+#define XA_DATALOCATOR_URI              ((XAuint32) 0x00000001)
+#define XA_DATALOCATOR_ADDRESS          ((XAuint32) 0x00000002)
+#define XA_DATALOCATOR_IODEVICE         ((XAuint32) 0x00000003)
+#define XA_DATALOCATOR_OUTPUTMIX        ((XAuint32) 0x00000004)
+#define XA_DATALOCATOR_NATIVEDISPLAY    ((XAuint32) 0x00000005)
+#define XA_DATALOCATOR_RESERVED6        ((XAuint32) 0x00000006)
+#define XA_DATALOCATOR_RESERVED7        ((XAuint32) 0x00000007)
+
+typedef struct XADataSink_ {
+    void * pLocator;
+    void * pFormat;
+} XADataSink;
+
+typedef struct XADataSource_ {
+    void * pLocator;
+    void * pFormat;
+} XADataSource;
+
+#define XA_CONTAINERTYPE_UNSPECIFIED    ((XAuint32) 0x00000001)
+#define XA_CONTAINERTYPE_RAW            ((XAuint32) 0x00000002)
+#define XA_CONTAINERTYPE_ASF            ((XAuint32) 0x00000003)
+#define XA_CONTAINERTYPE_AVI            ((XAuint32) 0x00000004)
+#define XA_CONTAINERTYPE_BMP            ((XAuint32) 0x00000005)
+#define XA_CONTAINERTYPE_JPG            ((XAuint32) 0x00000006)
+#define XA_CONTAINERTYPE_JPG2000        ((XAuint32) 0x00000007)
+#define XA_CONTAINERTYPE_M4A            ((XAuint32) 0x00000008)
+#define XA_CONTAINERTYPE_MP3            ((XAuint32) 0x00000009)
+#define XA_CONTAINERTYPE_MP4            ((XAuint32) 0x0000000A)
+#define XA_CONTAINERTYPE_MPEG_ES        ((XAuint32) 0x0000000B)
+#define XA_CONTAINERTYPE_MPEG_PS        ((XAuint32) 0x0000000C)
+#define XA_CONTAINERTYPE_MPEG_TS        ((XAuint32) 0x0000000D)
+#define XA_CONTAINERTYPE_QT             ((XAuint32) 0x0000000E)
+#define XA_CONTAINERTYPE_WAV            ((XAuint32) 0x0000000F)
+#define XA_CONTAINERTYPE_XMF_0          ((XAuint32) 0x00000010)
+#define XA_CONTAINERTYPE_XMF_1          ((XAuint32) 0x00000011)
+#define XA_CONTAINERTYPE_XMF_2          ((XAuint32) 0x00000012)
+#define XA_CONTAINERTYPE_XMF_3          ((XAuint32) 0x00000013)
+#define XA_CONTAINERTYPE_XMF_GENERIC    ((XAuint32) 0x00000014)
+#define XA_CONTAINERTYPE_AMR            ((XAuint32) 0x00000015)
+#define XA_CONTAINERTYPE_AAC            ((XAuint32) 0x00000016)
+#define XA_CONTAINERTYPE_3GPP           ((XAuint32) 0x00000017)
+#define XA_CONTAINERTYPE_3GA            ((XAuint32) 0x00000018)
+#define XA_CONTAINERTYPE_RM             ((XAuint32) 0x00000019)
+#define XA_CONTAINERTYPE_DMF            ((XAuint32) 0x0000001A)
+#define XA_CONTAINERTYPE_SMF            ((XAuint32) 0x0000001B)
+#define XA_CONTAINERTYPE_MOBILE_DLS     ((XAuint32) 0x0000001C)
+#define XA_CONTAINERTYPE_OGG            ((XAuint32) 0x0000001D)
+
+typedef struct XADataFormat_MIME_ {
+    XAuint32 formatType;
+    XAchar * mimeType;
+    XAuint32 containerType;
+} XADataFormat_MIME;
+
+#define XA_BYTEORDER_BIGENDIAN          ((XAuint32) 0x00000001)
+#define XA_BYTEORDER_LITTLEENDIAN       ((XAuint32) 0x00000002)
+
+#define XA_SAMPLINGRATE_8               ((XAuint32)   8000000)
+#define XA_SAMPLINGRATE_11_025          ((XAuint32)  11025000)
+#define XA_SAMPLINGRATE_12              ((XAuint32)  12000000)
+#define XA_SAMPLINGRATE_16              ((XAuint32)  16000000)
+#define XA_SAMPLINGRATE_22_05           ((XAuint32)  22050000)
+#define XA_SAMPLINGRATE_24              ((XAuint32)  24000000)
+#define XA_SAMPLINGRATE_32              ((XAuint32)  32000000)
+#define XA_SAMPLINGRATE_44_1            ((XAuint32)  44100000)
+#define XA_SAMPLINGRATE_48              ((XAuint32)  48000000)
+#define XA_SAMPLINGRATE_64              ((XAuint32)  64000000)
+#define XA_SAMPLINGRATE_88_2            ((XAuint32)  88200000)
+#define XA_SAMPLINGRATE_96              ((XAuint32)  96000000)
+#define XA_SAMPLINGRATE_192             ((XAuint32) 192000000)
+
+#define XA_SPEAKER_FRONT_LEFT               ((XAuint32) 0x00000001)
+#define XA_SPEAKER_FRONT_RIGHT              ((XAuint32) 0x00000002)
+#define XA_SPEAKER_FRONT_CENTER             ((XAuint32) 0x00000004)
+#define XA_SPEAKER_LOW_FREQUENCY            ((XAuint32) 0x00000008)
+#define XA_SPEAKER_BACK_LEFT                ((XAuint32) 0x00000010)
+#define XA_SPEAKER_BACK_RIGHT               ((XAuint32) 0x00000020)
+#define XA_SPEAKER_FRONT_LEFT_OF_CENTER     ((XAuint32) 0x00000040)
+#define XA_SPEAKER_FRONT_RIGHT_OF_CENTER    ((XAuint32) 0x00000080)
+#define XA_SPEAKER_BACK_CENTER              ((XAuint32) 0x00000100)
+#define XA_SPEAKER_SIDE_LEFT                ((XAuint32) 0x00000200)
+#define XA_SPEAKER_SIDE_RIGHT               ((XAuint32) 0x00000400)
+#define XA_SPEAKER_TOP_CENTER               ((XAuint32) 0x00000800)
+#define XA_SPEAKER_TOP_FRONT_LEFT           ((XAuint32) 0x00001000)
+#define XA_SPEAKER_TOP_FRONT_CENTER         ((XAuint32) 0x00002000)
+#define XA_SPEAKER_TOP_FRONT_RIGHT          ((XAuint32) 0x00004000)
+#define XA_SPEAKER_TOP_BACK_LEFT            ((XAuint32) 0x00008000)
+#define XA_SPEAKER_TOP_BACK_CENTER          ((XAuint32) 0x00010000)
+#define XA_SPEAKER_TOP_BACK_RIGHT           ((XAuint32) 0x00020000)
+
+#define XA_PCMSAMPLEFORMAT_FIXED_8          ((XAuint16) 0x0008)
+#define XA_PCMSAMPLEFORMAT_FIXED_16         ((XAuint16) 0x0010)
+#define XA_PCMSAMPLEFORMAT_FIXED_20         ((XAuint16) 0x0014)
+#define XA_PCMSAMPLEFORMAT_FIXED_24         ((XAuint16) 0x0018)
+#define XA_PCMSAMPLEFORMAT_FIXED_28         ((XAuint16) 0x001C)
+#define XA_PCMSAMPLEFORMAT_FIXED_32         ((XAuint16) 0x0020)
+
+typedef struct XADataFormat_PCM_ {
+    XAuint32 formatType;
+    XAuint32 numChannels;
+    XAuint32 samplesPerSec;
+    XAuint32 bitsPerSample;
+    XAuint32 containerSize;
+    XAuint32 channelMask;
+    XAuint32 endianness;
+} XADataFormat_PCM;
+
+#define XA_COLORFORMAT_UNUSED                   ((XAuint32) 0x00000000)
+#define XA_COLORFORMAT_MONOCHROME               ((XAuint32) 0x00000001)
+#define XA_COLORFORMAT_8BITRGB332               ((XAuint32) 0x00000002)
+#define XA_COLORFORMAT_12BITRGB444              ((XAuint32) 0x00000003)
+#define XA_COLORFORMAT_16BITARGB4444            ((XAuint32) 0x00000004)
+#define XA_COLORFORMAT_16BITARGB1555            ((XAuint32) 0x00000005)
+#define XA_COLORFORMAT_16BITRGB565              ((XAuint32) 0x00000006)
+#define XA_COLORFORMAT_16BITBGR565              ((XAuint32) 0x00000007)
+#define XA_COLORFORMAT_18BITRGB666              ((XAuint32) 0x00000008)
+#define XA_COLORFORMAT_18BITARGB1665            ((XAuint32) 0x00000009)
+#define XA_COLORFORMAT_19BITARGB1666            ((XAuint32) 0x0000000A)
+#define XA_COLORFORMAT_24BITRGB888              ((XAuint32) 0x0000000B)
+#define XA_COLORFORMAT_24BITBGR888              ((XAuint32) 0x0000000C)
+#define XA_COLORFORMAT_24BITARGB1887            ((XAuint32) 0x0000000D)
+#define XA_COLORFORMAT_25BITARGB1888            ((XAuint32) 0x0000000E)
+#define XA_COLORFORMAT_32BITBGRA8888            ((XAuint32) 0x0000000F)
+#define XA_COLORFORMAT_32BITARGB8888            ((XAuint32) 0x00000010)
+#define XA_COLORFORMAT_YUV411PLANAR             ((XAuint32) 0x00000011)
+#define XA_COLORFORMAT_YUV420PLANAR             ((XAuint32) 0x00000013)
+#define XA_COLORFORMAT_YUV420SEMIPLANAR         ((XAuint32) 0x00000015)
+#define XA_COLORFORMAT_YUV422PLANAR             ((XAuint32) 0x00000016)
+#define XA_COLORFORMAT_YUV422SEMIPLANAR         ((XAuint32) 0x00000018)
+#define XA_COLORFORMAT_YCBYCR                   ((XAuint32) 0x00000019)
+#define XA_COLORFORMAT_YCRYCB                   ((XAuint32) 0x0000001A)
+#define XA_COLORFORMAT_CBYCRY                   ((XAuint32) 0x0000001B)
+#define XA_COLORFORMAT_CRYCBY                   ((XAuint32) 0x0000001C)
+#define XA_COLORFORMAT_YUV444INTERLEAVED        ((XAuint32) 0x0000001D)
+#define XA_COLORFORMAT_RAWBAYER8BIT             ((XAuint32) 0x0000001E)
+#define XA_COLORFORMAT_RAWBAYER10BIT            ((XAuint32) 0x0000001F)
+#define XA_COLORFORMAT_RAWBAYER8BITCOMPRESSED   ((XAuint32) 0x00000020)
+#define XA_COLORFORMAT_L2                       ((XAuint32) 0x00000021)
+#define XA_COLORFORMAT_L4                       ((XAuint32) 0x00000022)
+#define XA_COLORFORMAT_L8                       ((XAuint32) 0x00000023)
+#define XA_COLORFORMAT_L16                      ((XAuint32) 0x00000024)
+#define XA_COLORFORMAT_L24                      ((XAuint32) 0x00000025)
+#define XA_COLORFORMAT_L32                      ((XAuint32) 0x00000026)
+#define XA_COLORFORMAT_18BITBGR666              ((XAuint32) 0x00000029)
+#define XA_COLORFORMAT_24BITARGB6666            ((XAuint32) 0x0000002A)
+#define XA_COLORFORMAT_24BITABGR6666            ((XAuint32) 0x0000002B)
+
+typedef struct XADataFormat_RawImage_ {
+    XAuint32 formatType;
+    XAuint32 colorFormat;
+    XAuint32 height;
+    XAuint32 width;
+    XAuint32 stride;
+} XADataFormat_RawImage;
+
+typedef struct XADataLocator_Address_ {
+    XAuint32 locatorType;
+    void * pAddress;
+    XAuint32 length;
+} XADataLocator_Address;
+
+#define XA_IODEVICE_AUDIOINPUT          ((XAuint32) 0x00000001)
+#define XA_IODEVICE_LEDARRAY            ((XAuint32) 0x00000002)
+#define XA_IODEVICE_VIBRA               ((XAuint32) 0x00000003)
+#define XA_IODEVICE_CAMERA              ((XAuint32) 0x00000004)
+#define XA_IODEVICE_RADIO               ((XAuint32) 0x00000005)
+
+typedef struct XADataLocator_IODevice_ {
+    XAuint32 locatorType;
+    XAuint32 deviceType;
+    XAuint32 deviceID;
+    XAObjectItf device;
+} XADataLocator_IODevice;
+
+typedef void * XANativeHandle;
+
+typedef struct XADataLocator_NativeDisplay_{
+    XAuint32 locatorType;
+    XANativeHandle hWindow;
+    XANativeHandle hDisplay;
+} XADataLocator_NativeDisplay;
+
+typedef struct XADataLocator_OutputMix {
+    XAuint32 locatorType;
+    XAObjectItf outputMix;
+} XADataLocator_OutputMix;
+
+typedef struct XADataLocator_URI_ {
+    XAuint32 locatorType;
+    XAchar * URI;
+} XADataLocator_URI;
+
+
+/* ENGINE */
+
+#define XA_DEFAULTDEVICEID_AUDIOINPUT   ((XAuint32) 0xFFFFFFFF)
+#define XA_DEFAULTDEVICEID_AUDIOOUTPUT  ((XAuint32) 0xFFFFFFFE)
+#define XA_DEFAULTDEVICEID_LED          ((XAuint32) 0xFFFFFFFD)
+#define XA_DEFAULTDEVICEID_VIBRA        ((XAuint32) 0xFFFFFFFC)
+#define XA_DEFAULTDEVICEID_CAMERA       ((XAuint32) 0xFFFFFFFB)
+
+#define XA_ENGINEOPTION_THREADSAFE      ((XAuint32) 0x00000001)
+#define XA_ENGINEOPTION_LOSSOFCONTROL   ((XAuint32) 0x00000002)
+
+#define XA_OBJECTID_ENGINE              ((XAuint32) 0x00000001)
+#define XA_OBJECTID_LEDDEVICE           ((XAuint32) 0x00000002)
+#define XA_OBJECTID_VIBRADEVICE         ((XAuint32) 0x00000003)
+#define XA_OBJECTID_MEDIAPLAYER         ((XAuint32) 0x00000004)
+#define XA_OBJECTID_MEDIARECORDER       ((XAuint32) 0x00000005)
+#define XA_OBJECTID_RADIODEVICE         ((XAuint32) 0x00000006)
+#define XA_OBJECTID_OUTPUTMIX           ((XAuint32) 0x00000007)
+#define XA_OBJECTID_METADATAEXTRACTOR   ((XAuint32) 0x00000008)
+#define XA_OBJECTID_CAMERADEVICE        ((XAuint32) 0x00000009)
+
+#define XA_PROFILES_MEDIA_PLAYER            ((XAint16) 0x0001)
+#define XA_PROFILES_MEDIA_PLAYER_RECORDER   ((XAint16) 0x0002)
+#define XA_PROFILES_PLUS_MIDI               ((XAint16) 0x0004)
+
+typedef struct XAEngineOption_ {
+    XAuint32 feature;
+    XAuint32 data; 
+} XAEngineOption;
+
+XA_API XAresult XAAPIENTRY xaCreateEngine( 
+    XAObjectItf * pEngine,
+    XAuint32 numOptions,
+    const XAEngineOption * pEngineOptions,
+    XAuint32 numInterfaces,
+    const XAInterfaceID * pInterfaceIds,
+    const XAboolean * pInterfaceRequired
+);
+
+XA_API XAresult XAAPIENTRY xaQueryNumSupportedEngineInterfaces(
+    XAuint32 * pNumSupportedInterfaces
+);
+
+XA_API XAresult XAAPIENTRY xaQuerySupportedEngineInterfaces(
+    XAuint32 index,
+    XAInterfaceID * pInterfaceId
+);
+
+typedef struct XALEDDescriptor_ {
+    XAuint8 ledCount;
+    XAuint8 primaryLED;
+    XAuint32 colorMask;
+} XALEDDescriptor;
+
+typedef struct XAVibraDescriptor_ {
+    XAboolean supportsFrequency;
+    XAboolean supportsIntensity;
+    XAmilliHertz minFrequency;
+    XAmilliHertz maxFrequency;
+} XAVibraDescriptor;
+
+
+XA_API extern const XAInterfaceID XA_IID_ENGINE;
+
+struct XAEngineItf_;
+typedef const struct XAEngineItf_ * const * XAEngineItf;
+
+struct XAEngineItf_ {
+    XAresult (*CreateCameraDevice) (
+        XAEngineItf self,
+        XAObjectItf * pDevice,
+        XAuint32 deviceID,
+        XAuint32 numInterfaces,
+        const XAInterfaceID * pInterfaceIds,
+        const XAboolean * pInterfaceRequired
+    );
+    XAresult (*CreateRadioDevice) (
+        XAEngineItf self,
+        XAObjectItf * pDevice,
+        XAuint32 numInterfaces,
+        const XAInterfaceID * pInterfaceIds,
+        const XAboolean * pInterfaceRequired
+    );
+    XAresult (*CreateLEDDevice) (
+        XAEngineItf self,
+        XAObjectItf * pDevice,
+        XAuint32 deviceID,
+        XAuint32 numInterfaces,
+        const XAInterfaceID * pInterfaceIds,
+        const XAboolean * pInterfaceRequired
+    );
+       XAresult (*CreateVibraDevice) (
+        XAEngineItf self,
+        XAObjectItf * pDevice,
+        XAuint32 deviceID,
+        XAuint32 numInterfaces,
+        const XAInterfaceID * pInterfaceIds,
+        const XAboolean * pInterfaceRequired
+    );
+    XAresult (*CreateMediaPlayer) (
+        XAEngineItf self,
+        XAObjectItf * pPlayer,
+        XADataSource * pDataSrc,
+        XADataSource * pBankSrc,
+        XADataSink * pAudioSnk,
+        XADataSink * pImageVideoSnk,
+        XADataSink * pVibra,
+        XADataSink * pLEDArray,
+        XAuint32 numInterfaces,
+        const XAInterfaceID * pInterfaceIds,
+        const XAboolean * pInterfaceRequired
+    );
+    XAresult (*CreateMediaRecorder) (
+        XAEngineItf self,
+        XAObjectItf * pRecorder,
+        XADataSource * pAudioSrc,
+        XADataSource * pImageVideoSrc,
+        XADataSink * pDataSnk,
+        XAuint32 numInterfaces,
+        const XAInterfaceID * pInterfaceIds,
+        const XAboolean * pInterfaceRequired
+    );
+    XAresult (*CreateOutputMix) (
+        XAEngineItf self,
+        XAObjectItf * pMix,
+        XAuint32 numInterfaces,
+        const XAInterfaceID * pInterfaceIds,
+        const XAboolean * pInterfaceRequired
+    );
+    XAresult (*CreateMetadataExtractor) (
+        XAEngineItf self,
+        XAObjectItf * pMetadataExtractor,
+        XADataSource * pDataSource,
+        XAuint32 numInterfaces,
+        const XAInterfaceID * pInterfaceIds,
+        const XAboolean * pInterfaceRequired
+    );
+    XAresult (*CreateExtensionObject) (
+        XAEngineItf self,
+        XAObjectItf * pObject,
+        void * pParameters,
+        XAuint32 objectID,
+        XAuint32 numInterfaces,
+        const XAInterfaceID * pInterfaceIds,
+        const XAboolean * pInterfaceRequired
+    );
+    XAresult (*GetImplementationInfo) (
+        XAEngineItf self,
+        XAuint32 * pMajor,
+        XAuint32 * pMinor,
+        XAuint32 * pStep,
+        const XAchar * pImplementationText
+    );
+    XAresult (*QuerySupportedProfiles) (
+        XAEngineItf self,
+        XAint16 * pProfilesSupported
+    );
+    XAresult (*QueryNumSupportedInterfaces) (
+        XAEngineItf self,
+        XAuint32 objectID,
+        XAuint32 * pNumSupportedInterfaces
+    );
+    XAresult (*QuerySupportedInterfaces) (
+        XAEngineItf self,
+        XAuint32 objectID,
+        XAuint32 index, 
+        XAInterfaceID * pInterfaceId
+    );
+    XAresult (*QueryNumSupportedExtensions) (
+        XAEngineItf self,
+        XAuint32 * pNumExtensions
+    );
+    XAresult (*QuerySupportedExtension) (
+        XAEngineItf self, 
+        XAuint32 index,
+        XAchar * pExtensionName,
+        XAint16 * pNameLength
+    );
+    XAresult (*IsExtensionSupported) (
+        XAEngineItf self, 
+        const XAchar * pExtensionName,
+        XAboolean * pSupported
+    );
+    XAresult (*QueryLEDCapabilities) (
+        XAEngineItf self,
+        XAuint32 *pIndex,
+        XAuint32 * pLEDDeviceID,
+        XALEDDescriptor * pDescriptor
+    );
+    XAresult (*QueryVibraCapabilities) (
+        XAEngineItf self,
+        XAuint32 *pIndex,
+        XAuint32 * pVibraDeviceID,
+        XAVibraDescriptor * pDescriptor
+    );
+};
+
+/* THREAD SYNC */
+
+XA_API extern const XAInterfaceID XA_IID_THREADSYNC;
+
+struct XAThreadSyncItf_;
+typedef const struct XAThreadSyncItf_ * const * XAThreadSyncItf;
+
+struct XAThreadSyncItf_ {
+    XAresult (*EnterCriticalSection) (
+        XAThreadSyncItf self
+    );
+    XAresult (*ExitCriticalSection) (
+        XAThreadSyncItf self
+    );
+};
+
+
+
+  /*****************************************************************/
+  /* PLAYBACK RELATED INTERFACES, STRUCTS AND DEFINES              */
+  /*****************************************************************/
+
+/* PLAY */
+
+#define XA_TIME_UNKNOWN                     ((XAuint32) 0xFFFFFFFF)
+
+#define XA_PLAYEVENT_HEADATEND              ((XAuint32) 0x00000001)
+#define XA_PLAYEVENT_HEADATMARKER           ((XAuint32) 0x00000002)
+#define XA_PLAYEVENT_HEADATNEWPOS           ((XAuint32) 0x00000004)
+#define XA_PLAYEVENT_HEADMOVING             ((XAuint32) 0x00000008)
+#define XA_PLAYEVENT_HEADSTALLED            ((XAuint32) 0x00000010)
+
+#define XA_PLAYSTATE_STOPPED                ((XAuint32) 0x00000001)
+#define XA_PLAYSTATE_PAUSED                 ((XAuint32) 0x00000002)
+#define XA_PLAYSTATE_PLAYING                ((XAuint32) 0x00000003)
+
+#define XA_PREFETCHEVENT_STATUSCHANGE       ((XAuint32) 0x00000001)
+#define XA_PREFETCHEVENT_FILLLEVELCHANGE    ((XAuint32) 0x00000002)
+
+#define XA_PREFETCHSTATUS_UNDERFLOW         ((XAuint32) 0x00000001)
+#define XA_PREFETCHSTATUS_SUFFICIENTDATA    ((XAuint32) 0x00000002)
+#define XA_PREFETCHSTATUS_OVERFLOW          ((XAuint32) 0x00000003)
+
+#define XA_SEEKMODE_FAST                    ((XAuint32) 0x0001)
+#define XA_SEEKMODE_ACCURATE                ((XAuint32) 0x0002)
+
+XA_API extern const XAInterfaceID XA_IID_PLAY;
+
+struct XAPlayItf_;
+typedef const struct XAPlayItf_ * const * XAPlayItf;
+
+typedef void (XAAPIENTRY * xaPlayCallback) (
+    XAPlayItf caller,
+    void * pContext,
+    XAuint32 event
+);
+
+struct XAPlayItf_ {
+    XAresult (*SetPlayState) (
+        XAPlayItf self,
+        XAuint32 state
+    );
+    XAresult (*GetPlayState) (
+        XAPlayItf self,
+        XAuint32 * pState
+    );
+    XAresult (*GetDuration) (
+        XAPlayItf self, 
+        XAmillisecond * pMsec
+    );
+    XAresult (*GetPosition) (
+        XAPlayItf self, 
+        XAmillisecond * pMsec
+    );
+    XAresult (*RegisterCallback) (
+        XAPlayItf self,
+        xaPlayCallback callback,
+        void * pContext
+    );
+    XAresult (*SetCallbackEventsMask) (
+        XAPlayItf self,
+        XAuint32 eventFlags
+    );
+    XAresult (*GetCallbackEventsMask) (
+        XAPlayItf self,
+        XAuint32 * pEventFlags
+    );
+    XAresult (*SetMarkerPosition) (
+        XAPlayItf self,
+        XAmillisecond mSec
+    );
+    XAresult (*ClearMarkerPosition) (
+        XAPlayItf self
+    );
+    XAresult (*GetMarkerPosition) (
+        XAPlayItf self,
+        XAmillisecond * pMsec
+    );
+    XAresult (*SetPositionUpdatePeriod) (
+        XAPlayItf self,
+        XAmillisecond mSec
+    );
+    XAresult (*GetPositionUpdatePeriod) (
+        XAPlayItf self,
+        XAmillisecond * pMsec
+    );
+};
+
+/* PLAYBACK RATE */
+
+#define XA_RATEPROP_STAGGEREDVIDEO      ((XAuint32) 0x00000001)
+#define XA_RATEPROP_SMOOTHVIDEO         ((XAuint32) 0x00000002)
+#define XA_RATEPROP_SILENTAUDIO         ((XAuint32) 0x00000100)
+#define XA_RATEPROP_STAGGEREDAUDIO      ((XAuint32) 0x00000200)
+#define XA_RATEPROP_NOPITCHCORAUDIO     ((XAuint32) 0x00000400)
+#define XA_RATEPROP_PITCHCORAUDIO       ((XAuint32) 0x00000800)
+
+XA_API extern const XAInterfaceID XA_IID_PLAYBACKRATE;
+
+struct XAPlaybackRateItf_;
+typedef const struct XAPlaybackRateItf_ * const * XAPlaybackRateItf;
+
+struct XAPlaybackRateItf_ {
+    XAresult (*SetRate) (
+        XAPlaybackRateItf self,
+        XApermille rate
+    );
+    XAresult (*GetRate) (
+        XAPlaybackRateItf self,
+        XApermille * pRate
+    );
+    XAresult (*SetPropertyConstraints) (
+        XAPlaybackRateItf self,
+        XAuint32 constraints
+    );
+    XAresult (*GetProperties) (
+        XAPlaybackRateItf self,
+        XAuint32 * pProperties
+    );
+    XAresult (*GetCapabilitiesOfRate) (
+        XAPlaybackRateItf self,
+        XApermille rate,
+        XAuint32 * pCapabilities
+    );
+    XAresult (*GetRateRange) (
+        XAPlaybackRateItf self,
+        XAuint8 index,
+        XApermille * pMinRate,
+        XApermille * pMaxRate,
+        XApermille * pStepSize,
+        XAuint32 * pCapabilities
+    );
+};
+
+/* PREFETCH STATUS */
+
+XA_API extern const XAInterfaceID XA_IID_PREFETCHSTATUS;
+
+struct XAPrefetchStatusItf_;
+typedef const struct XAPrefetchStatusItf_ 
+    * const * XAPrefetchStatusItf;
+
+typedef void (XAAPIENTRY * xaPrefetchCallback) (
+    XAPrefetchStatusItf caller,
+    void * pContext,
+    XAuint32 event
+);
+
+struct XAPrefetchStatusItf_ {
+    XAresult (*GetPrefetchStatus) (
+        XAPrefetchStatusItf self, 
+        XAuint32 * pStatus
+    );
+    XAresult (*GetFillLevel) (
+        XAPrefetchStatusItf self, 
+        XApermille * pLevel
+    );
+    XAresult (*RegisterCallback) (
+        XAPrefetchStatusItf self,
+        xaPrefetchCallback callback,
+        void * pContext
+    );
+    XAresult (*SetCallbackEventsMask) (
+        XAPrefetchStatusItf self, 
+        XAuint32 eventFlags
+    );
+    XAresult (*GetCallbackEventsMask) (
+        XAPrefetchStatusItf self, 
+        XAuint32 * pEventFlags
+    );
+    XAresult (*SetFillUpdatePeriod) (
+        XAPrefetchStatusItf self, 
+        XApermille period
+    );
+    XAresult (*GetFillUpdatePeriod) (
+        XAPrefetchStatusItf self, 
+        XApermille * pPeriod
+    );
+};
+
+/* SEEK */
+
+XA_API extern const XAInterfaceID XA_IID_SEEK;
+
+struct XASeekItf_;
+typedef const struct XASeekItf_ * const * XASeekItf;
+
+struct XASeekItf_ {
+    XAresult (*SetPosition) (
+        XASeekItf self,
+        XAmillisecond pos,
+        XAuint32 seekMode
+    );
+    XAresult (*SetLoop) (
+        XASeekItf self,
+        XAboolean loopEnable,
+        XAmillisecond startPos,
+        XAmillisecond endPos
+    );
+    XAresult (*GetLoop) (
+        XASeekItf self,
+        XAboolean * pLoopEnabled,
+        XAmillisecond * pStartPos,
+        XAmillisecond * pEndPos
+    );
+};
+
+/* VOLUME */
+
+XA_API extern const XAInterfaceID XA_IID_VOLUME;
+
+struct XAVolumeItf_;
+typedef const struct XAVolumeItf_ * const * XAVolumeItf;
+
+struct XAVolumeItf_ {
+    XAresult (*SetVolumeLevel) (
+        XAVolumeItf self,
+        XAmillibel level
+    );
+    XAresult (*GetVolumeLevel) (
+        XAVolumeItf self,
+        XAmillibel * pLevel
+    );
+    XAresult (*GetMaxVolumeLevel) (
+        XAVolumeItf self,
+        XAmillibel * pMaxLevel
+    );
+    XAresult (*SetMute) (
+        XAVolumeItf self,
+        XAboolean mute
+    );
+    XAresult (*GetMute) (
+        XAVolumeItf self,
+        XAboolean * pMute
+    );
+    XAresult (*EnableStereoPosition) (
+        XAVolumeItf self,
+        XAboolean enable
+    );
+    XAresult (*IsEnabledStereoPosition) (
+        XAVolumeItf self,
+        XAboolean * pEnable
+    );
+    XAresult (*SetStereoPosition) (
+        XAVolumeItf self,
+        XApermille stereoPosition
+    );
+    XAresult (*GetStereoPosition) (
+        XAVolumeItf self,
+        XApermille * pStereoPosition
+    );
+};
+
+/* IMAGE CONTROL */
+
+XA_API extern const XAInterfaceID XA_IID_IMAGECONTROLS;
+
+struct XAImageControlsItf_;
+typedef const struct XAImageControlsItf_ * const * XAImageControlsItf;
+
+struct XAImageControlsItf_ {
+    XAresult (*SetBrightness) (
+        XAImageControlsItf self,
+        XAuint32 brightness
+    );
+    XAresult (*GetBrightness) (
+        XAImageControlsItf self,
+        XAuint32 * pBrightness
+    );
+    XAresult (*SetContrast) (
+        XAImageControlsItf self,
+        XAint32 contrast
+    );
+    XAresult (*GetContrast) (
+        XAImageControlsItf self,
+        XAint32 * pContrast
+    );
+    XAresult (*SetGamma) (
+        XAImageControlsItf self,
+        XApermille gamma
+    );
+    XAresult (*GetGamma) (
+        XAImageControlsItf self,
+        XApermille * pGamma
+    );
+    XAresult (*GetSupportedGammaSettings) (
+        XAImageControlsItf self,
+        XApermille * pMinValue,
+        XApermille * pMaxValue,
+        XAuint32 * pNumSettings,
+        XApermille ** ppSettings
+    );
+};
+
+/* IMAGE EFFECT */
+
+#define XA_IMAGEEFFECT_MONOCHROME       ((XAuint32) 0x00000001)
+#define XA_IMAGEEFFECT_NEGATIVE         ((XAuint32) 0x00000002)
+#define XA_IMAGEEFFECT_SEPIA            ((XAuint32) 0x00000003)
+#define XA_IMAGEEFFECT_EMBOSS           ((XAuint32) 0x00000004)
+#define XA_IMAGEEFFECT_PAINTBRUSH       ((XAuint32) 0x00000005)
+#define XA_IMAGEEFFECT_SOLARIZE         ((XAuint32) 0x00000006)
+#define XA_IMAGEEFFECT_CARTOON          ((XAuint32) 0x00000007)
+
+XA_API extern const XAInterfaceID XA_IID_IMAGEEFFECTS;
+
+struct XAImageEffectsItf_;
+typedef const struct XAImageEffectsItf_ * const * XAImageEffectsItf;
+
+struct XAImageEffectsItf_ {
+    XAresult (*QuerySupportedImageEffects) (
+        XAImageEffectsItf self, 
+        XAuint32 index, 
+        XAuint32 * pImageEffectId
+    );
+    XAresult (*EnableImageEffect) (
+        XAImageEffectsItf self, 
+        XAuint32 imageEffectID
+    );
+    XAresult (*DisableImageEffect) (
+        XAImageEffectsItf self, 
+        XAuint32 imageEffectID
+    );
+    XAresult (*IsImageEffectEnabled) (
+        XAImageEffectsItf self, 
+        XAuint32 imageEffectID,
+        XAboolean * pEnabled
+    );
+};
+
+/* VIDEO POST PROCESSING */
+
+#define XA_VIDEOMIRROR_NONE             ((XAuint32) 0x00000001)
+#define XA_VIDEOMIRROR_VERTICAL         ((XAuint32) 0x00000002)
+#define XA_VIDEOMIRROR_HORIZONTAL       ((XAuint32) 0x00000003)
+#define XA_VIDEOMIRROR_BOTH             ((XAuint32) 0x00000004)
+
+#define XA_VIDEOSCALE_STRETCH           ((XAuint32) 0x00000001)
+#define XA_VIDEOSCALE_FIT               ((XAuint32) 0x00000002)
+#define XA_VIDEOSCALE_CROP              ((XAuint32) 0x00000003)
+
+#define XA_RENDERINGHINT_NONE           ((XAuint32) 0x00000000)
+#define XA_RENDERINGHINT_ANTIALIASING   ((XAuint32) 0x00000001)
+
+typedef struct XARectangle_ {
+    XAuint32 left;
+    XAuint32 top;
+    XAuint32 width;
+    XAuint32 height;
+} XARectangle;
+
+XA_API extern const XAInterfaceID XA_IID_VIDEOPOSTPROCESSING;
+
+struct XAVideoPostProcessingItf_;
+typedef const struct XAVideoPostProcessingItf_ * const * XAVideoPostProcessingItf;
+
+struct XAVideoPostProcessingItf_ {
+    XAresult (*SetRotation) (
+        XAVideoPostProcessingItf self,
+        XAmillidegree rotation
+    );
+    XAresult (*IsArbitraryRotationSupported) (
+        XAVideoPostProcessingItf self,
+        XAboolean *pSupported
+    );
+    XAresult (*SetScaleOptions) (
+        XAVideoPostProcessingItf self,
+        XAuint32 scaleOptions,
+        XAuint32 backgroundColor,
+        XAuint32 renderingHints
+    );
+    XAresult (*SetSourceRectangle) (
+        XAVideoPostProcessingItf self,
+        const XARectangle *pSrcRect
+    );
+    XAresult (*SetDestinationRectangle) (
+        XAVideoPostProcessingItf self,
+        const XARectangle *pDestRect
+    );
+    XAresult (*SetMirror) (
+        XAVideoPostProcessingItf self,
+        XAuint32 mirror
+    );
+    XAresult (*Commit) (
+        XAVideoPostProcessingItf self
+    );
+};
+
+
+
+  /*****************************************************************/
+  /* CAPTURING INTERFACES, STRUCTS AND DEFINES                     */
+  /*****************************************************************/
+
+/* RECORD */
+
+#define XA_RECORDEVENT_HEADATLIMIT          ((XAuint32) 0x00000001)
+#define XA_RECORDEVENT_HEADATMARKER         ((XAuint32) 0x00000002)
+#define XA_RECORDEVENT_HEADATNEWPOS         ((XAuint32) 0x00000004)
+#define XA_RECORDEVENT_HEADMOVING           ((XAuint32) 0x00000008)
+#define XA_RECORDEVENT_HEADSTALLED          ((XAuint32) 0x00000010)
+#define XA_RECORDEVENT_BUFFER_FULL          ((XAuint32) 0x00000020)
+
+#define XA_RECORDSTATE_STOPPED          ((XAuint32) 0x00000001)
+#define XA_RECORDSTATE_PAUSED           ((XAuint32) 0x00000002)
+#define XA_RECORDSTATE_RECORDING        ((XAuint32) 0x00000003)
+
+XA_API extern const XAInterfaceID XA_IID_RECORD;
+
+struct XARecordItf_;
+typedef const struct XARecordItf_ * const * XARecordItf;
+
+typedef void (XAAPIENTRY * xaRecordCallback) (
+    XARecordItf caller,
+    void * pContext,
+    XAuint32 event
+);
+
+struct XARecordItf_ {
+    XAresult (*SetRecordState) (
+        XARecordItf self,
+        XAuint32 state
+    );
+    XAresult (*GetRecordState) (
+        XARecordItf self,
+        XAuint32 * pState
+    );
+    XAresult (*SetDurationLimit) (
+        XARecordItf self,
+        XAmillisecond msec
+    );
+    XAresult (*GetPosition) (
+        XARecordItf self,
+        XAmillisecond * pMsec
+    );
+    XAresult (*RegisterCallback) (
+        XARecordItf self,
+        xaRecordCallback callback,
+        void * pContext
+    );
+    XAresult (*SetCallbackEventsMask) (
+        XARecordItf self,
+        XAuint32 eventFlags
+    );
+    XAresult (*GetCallbackEventsMask) (
+        XARecordItf self,
+        XAuint32 * pEventFlags
+    );
+    XAresult (*SetMarkerPosition) (
+        XARecordItf self,
+        XAmillisecond mSec
+    );
+    XAresult (*ClearMarkerPosition) (
+        XARecordItf self
+    );
+    XAresult (*GetMarkerPosition) (
+        XARecordItf self,
+        XAmillisecond * pMsec
+    );
+    XAresult (*SetPositionUpdatePeriod) (
+        XARecordItf self,
+        XAmillisecond mSec
+    );
+    XAresult (*GetPositionUpdatePeriod) (
+        XARecordItf self,
+        XAmillisecond * pMsec
+    );
+};
+
+/* SNAPSHOT */
+
+XA_API extern const XAInterfaceID XA_IID_SNAPSHOT;
+
+struct XASnapshotItf_;
+typedef const struct XASnapshotItf_ * const * XASnapshotItf;
+
+typedef void (XAAPIENTRY * xaSnapshotInitiatedCallback) (
+    XASnapshotItf caller,
+    void * context
+);
+
+typedef void (XAAPIENTRY * xaSnapshotTakenCallback) (
+    XASnapshotItf caller,
+    void * context,
+    XAuint32 numberOfPicsTaken,
+    const XADataSink * image
+);
+
+struct XASnapshotItf_ {
+    XAresult (*InitiateSnapshot) (
+        XASnapshotItf self,
+        XAuint32 numberOfPictures,
+        XAuint32 fps,
+        XAboolean freezeViewFinder,
+        XADataSink sink,
+        xaSnapshotInitiatedCallback initiatedCallback, 
+        xaSnapshotTakenCallback takenCallback, 
+        void * pContext
+    );
+    XAresult (*TakeSnapshot) (
+        XASnapshotItf self
+    );
+    XAresult (*CancelSnapshot) (
+        XASnapshotItf self
+    );
+    XAresult (*ReleaseBuffers) (
+        XASnapshotItf self,
+        XADataSink * image
+    );
+    XAresult (*GetMaxPicsPerBurst) (
+        XASnapshotItf self,
+        XAuint32 * maxNumberOfPictures
+    );
+    XAresult (*GetBurstFPSRange) (
+        XASnapshotItf self,
+        XAuint32 * minFPS,
+        XAuint32 * maxFPS
+    );
+    XAresult (*SetShutterFeedback) (
+        XASnapshotItf self,
+        XAboolean enabled
+    );
+    XAresult (*GetShutterFeedback) (
+        XASnapshotItf self,
+        XAboolean * enabled
+    );
+};
+
+
+
+  /*****************************************************************/
+  /* METADATA RELATED INTERFACES, STRUCTS AND DEFINES              */
+  /*****************************************************************/
+
+/* METADATA (EXTRACTION, INSERTION, TRAVERSAL) */
+
+#define XA_NODE_PARENT                  ((XAuint32) 0xFFFFFFFF)
+
+#define XA_ROOT_NODE_ID                 ((XAint32) 0x7FFFFFFF)
+
+#define XA_NODETYPE_UNSPECIFIED         ((XAuint32) 0x00000001)
+#define XA_NODETYPE_AUDIO               ((XAuint32) 0x00000002)
+#define XA_NODETYPE_VIDEO               ((XAuint32) 0x00000003)
+#define XA_NODETYPE_IMAGE               ((XAuint32) 0x00000004)
+
+#define XA_CHARACTERENCODING_UNKNOWN            ((XAuint32) 0x00000000)
+#define XA_CHARACTERENCODING_BINARY             ((XAuint32) 0x00000001)
+#define XA_CHARACTERENCODING_ASCII              ((XAuint32) 0x00000002)
+#define XA_CHARACTERENCODING_BIG5               ((XAuint32) 0x00000003)
+#define XA_CHARACTERENCODING_CODEPAGE1252       ((XAuint32) 0x00000004)
+#define XA_CHARACTERENCODING_GB2312             ((XAuint32) 0x00000005)
+#define XA_CHARACTERENCODING_HZGB2312           ((XAuint32) 0x00000006)
+#define XA_CHARACTERENCODING_GB12345            ((XAuint32) 0x00000007)
+#define XA_CHARACTERENCODING_GB18030            ((XAuint32) 0x00000008)
+#define XA_CHARACTERENCODING_GBK                ((XAuint32) 0x00000009)
+#define XA_CHARACTERENCODING_IMAPUTF7           ((XAuint32) 0x0000000A)
+#define XA_CHARACTERENCODING_ISO2022JP          ((XAuint32) 0x0000000B)
+#define XA_CHARACTERENCODING_ISO2022JP1         ((XAuint32) 0x0000000B)
+#define XA_CHARACTERENCODING_ISO88591           ((XAuint32) 0x0000000C)
+#define XA_CHARACTERENCODING_ISO885910          ((XAuint32) 0x0000000D)
+#define XA_CHARACTERENCODING_ISO885913          ((XAuint32) 0x0000000E)
+#define XA_CHARACTERENCODING_ISO885914          ((XAuint32) 0x0000000F)
+#define XA_CHARACTERENCODING_ISO885915          ((XAuint32) 0x00000010)
+#define XA_CHARACTERENCODING_ISO88592           ((XAuint32) 0x00000011)
+#define XA_CHARACTERENCODING_ISO88593           ((XAuint32) 0x00000012)
+#define XA_CHARACTERENCODING_ISO88594           ((XAuint32) 0x00000013)
+#define XA_CHARACTERENCODING_ISO88595           ((XAuint32) 0x00000014)
+#define XA_CHARACTERENCODING_ISO88596           ((XAuint32) 0x00000015)
+#define XA_CHARACTERENCODING_ISO88597           ((XAuint32) 0x00000016)
+#define XA_CHARACTERENCODING_ISO88598           ((XAuint32) 0x00000017)
+#define XA_CHARACTERENCODING_ISO88599           ((XAuint32) 0x00000018)
+#define XA_CHARACTERENCODING_ISOEUCJP           ((XAuint32) 0x00000019)
+#define XA_CHARACTERENCODING_SHIFTJIS           ((XAuint32) 0x0000001A)
+#define XA_CHARACTERENCODING_SMS7BIT            ((XAuint32) 0x0000001B)
+#define XA_CHARACTERENCODING_UTF7               ((XAuint32) 0x0000001C)
+#define XA_CHARACTERENCODING_UTF8               ((XAuint32) 0x0000001D)
+#define XA_CHARACTERENCODING_JAVACONFORMANTUTF8 ((XAuint32) 0x0000001E)
+#define XA_CHARACTERENCODING_UTF16BE            ((XAuint32) 0x0000001F)
+#define XA_CHARACTERENCODING_UTF16LE            ((XAuint32) 0x00000020)
+
+#define XA_METADATA_FILTER_KEY          ((XAuint8) 0x01)
+#define XA_METADATA_FILTER_LANG         ((XAuint8) 0x02)
+#define XA_METADATA_FILTER_ENCODING     ((XAuint8) 0x04)
+
+#define XA_METADATATRAVERSALMODE_ALL    ((XAuint32) 0x00000001)
+#define XA_METADATATRAVERSALMODE_NODE   ((XAuint32) 0x00000002)
+
+#ifndef _KHRONOS_KEYS_
+#define _KHRONOS_KEYS_
+#define KHRONOS_TITLE                   "KhronosTitle"
+#define KHRONOS_ALBUM                   "KhronosAlbum"
+#define KHRONOS_TRACK_NUMBER            "KhronosTrackNumber"
+#define KHRONOS_ARTIST                  "KhronosArtist"
+#define KHRONOS_GENRE                   "KhronosGenre"
+#define KHRONOS_YEAR                    "KhronosYear"
+#define KHRONOS_COMMENT                 "KhronosComment"
+#define KHRONOS_ARTIST_URL              "KhronosArtistURL"
+#define KHRONOS_CONTENT_URL             "KhronosContentURL"
+#define KHRONOS_RATING                  "KhronosRating"
+#define KHRONOS_ALBUM_ART               "KhronosAlbumArt"
+#define KHRONOS_COPYRIGHT               "KhronosCopyright"
+#endif /* _KHRONOS_KEYS_ */
+
+
+typedef struct XAMetadataInfo_ {
+    XAuint32 size;
+    XAuint32 encoding;
+    const XAchar langCountry[16];
+    XAuint8 data[1];
+} XAMetadataInfo;
+
+XA_API extern const XAInterfaceID XA_IID_METADATAEXTRACTION;
+
+struct XAMetadataExtractionItf_;
+typedef const struct XAMetadataExtractionItf_
+    * const * XAMetadataExtractionItf;
+
+struct XAMetadataExtractionItf_ {
+    XAresult (*GetItemCount) (
+        XAMetadataExtractionItf self,
+        XAuint32 * pItemCount
+    );
+    XAresult (*GetKeySize) (
+        XAMetadataExtractionItf self,
+        XAuint32 index,
+        XAuint32 * pKeySize
+    );
+    XAresult (*GetKey) (
+        XAMetadataExtractionItf self,
+        XAuint32 index,
+        XAuint32 keySize,
+        XAMetadataInfo * pKey
+    );
+    XAresult (*GetValueSize) (
+        XAMetadataExtractionItf self,
+        XAuint32 index,
+        XAuint32 * pValueSize
+    );
+    XAresult (*GetValue) (
+        XAMetadataExtractionItf self,
+        XAuint32 index,
+        XAuint32 valueSize,
+        XAMetadataInfo * pValue
+    );
+    XAresult (*AddKeyFilter) (
+        XAMetadataExtractionItf self,
+        XAuint32 keySize,
+        const void * pKey,
+        XAuint32 keyEncoding,
+        const XAchar * pValueLangCountry,
+        XAuint32 valueEncoding,
+        XAuint8 filterMask
+    );
+    XAresult (*ClearKeyFilter) (
+        XAMetadataExtractionItf self
+    );
+};
+
+
+XA_API extern const XAInterfaceID XA_IID_METADATAINSERTION;
+
+struct XAMetadataInsertionItf_;
+typedef const struct XAMetadataInsertionItf_
+    * const * XAMetadataInsertionItf;
+
+typedef void (XAAPIENTRY * xaMetadataInsertionCallback) (
+    XAMetadataInsertionItf caller,
+    void * pContext,
+    XAMetadataInfo * pKey,
+    XAMetadataInfo * pValue,
+    XAint32 nodeID,
+    XAboolean result
+);
+
+struct XAMetadataInsertionItf_ {
+    XAresult (*CreateChildNode) (
+        XAMetadataInsertionItf self,
+        XAint32 parentNodeID, 
+        XAuint32 type,
+        XAchar * mimeType,
+        XAint32 * pChildNodeID
+    );
+    XAresult (*GetSupportedKeysCount) (
+        XAMetadataInsertionItf self,
+        XAint32 nodeID,
+        XAboolean * pFreeKeys,
+        XAuint32 * pKeyCount,
+        XAuint32 * pEncodingCount
+    );
+    XAresult (*GetKeySize) (
+        XAMetadataInsertionItf self,
+        XAint32 nodeID,
+        XAuint32 keyIndex,
+        XAuint32 * pKeySize
+    );
+    XAresult (*GetKey) (
+        XAMetadataInsertionItf self,
+        XAint32 nodeID,
+        XAuint32 keyIndex,
+        XAuint32 keySize,
+        XAMetadataInfo * pKey
+    );
+    XAresult (*GetFreeKeysEncoding) (
+        XAMetadataInsertionItf self,
+        XAint32 nodeID,
+        XAuint32 encodingIndex,
+        XAuint32 * pEncoding
+    );
+    XAresult (*InsertMetadataItem) (
+        XAMetadataInsertionItf self,
+        XAint32 nodeID,
+        XAMetadataInfo * pKey,
+        XAMetadataInfo * pValue,
+        XAboolean overwrite
+    );
+    XAresult (*RegisterCallback) (
+        XAMetadataInsertionItf self,
+        xaMetadataInsertionCallback callback,
+        void * pContext
+    );
+};
+
+
+XA_API extern const XAInterfaceID XA_IID_METADATATRAVERSAL;
+ 
+struct XAMetadataTraversalItf_;
+typedef const struct XAMetadataTraversalItf_
+    *  const *  XAMetadataTraversalItf;
+
+struct XAMetadataTraversalItf_ {
+    XAresult (*SetMode) (
+        XAMetadataTraversalItf self,
+        XAuint32 mode
+    );
+    XAresult (*GetChildCount) (
+        XAMetadataTraversalItf self,
+        XAuint32 * pCount
+    );
+    XAresult (*GetChildMIMETypeSize) (
+        XAMetadataTraversalItf self,
+        XAuint32 index,
+        XAuint32 * pSize
+    );
+    XAresult (*GetChildInfo) (
+        XAMetadataTraversalItf self,
+        XAuint32 index,
+        XAint32 * pNodeID,
+        XAuint32 * pType,
+        XAuint32 size,
+        XAchar * pMimeType
+    );
+    XAresult (*SetActiveNode) (
+        XAMetadataTraversalItf self,
+        XAuint32 index
+    );
+};
+
+/* DYNAMIC SOURCE */
+
+XA_API extern const XAInterfaceID XA_IID_DYNAMICSOURCE;
+
+struct XADynamicSourceItf_;
+typedef const struct XADynamicSourceItf_ * const * XADynamicSourceItf;
+
+struct XADynamicSourceItf_ {
+    XAresult (*SetSource) (
+        XADynamicSourceItf self,
+        XADataSource * pDataSource
+    );
+};
+
+
+
+  /*****************************************************************/
+  /*  I/O DEVICES RELATED INTERFACES, STRUCTS AND DEFINES          */
+  /*****************************************************************/
+
+/* CAMERA AND CAMERA CAPABILITIES */
+
+#define XA_CAMERA_APERTUREMODE_MANUAL               ((XAuint32) 0x00000001)
+#define XA_CAMERA_APERTUREMODE_AUTO                 ((XAuint32) 0x00000002)
+
+#define XA_CAMERA_AUTOEXPOSURESTATUS_SUCCESS        ((XAuint32) 0x00000001)
+#define XA_CAMERA_AUTOEXPOSURESTATUS_UNDEREXPOSURE  ((XAuint32) 0x00000002)
+#define XA_CAMERA_AUTOEXPOSURESTATUS_OVEREXPOSURE   ((XAuint32) 0x00000003)
+
+#define XA_CAMERACBEVENT_ROTATION                   ((XAuint32) 0x00000001)
+#define XA_CAMERACBEVENT_FLASHREADY                 ((XAuint32) 0x00000002)
+#define XA_CAMERACBEVENT_FOCUSSTATUS                ((XAuint32) 0x00000003)
+#define XA_CAMERACBEVENT_EXPOSURESTATUS             ((XAuint32) 0x00000004)
+#define XA_CAMERACBEVENT_WHITEBALANCELOCKED         ((XAuint32) 0x00000005)
+#define XA_CAMERACBEVENT_ZOOMSTATUS                 ((XAuint32) 0x00000006)
+
+#define XA_CAMERACAP_FLASH                          ((XAuint32) 0x00000001)
+#define XA_CAMERACAP_AUTOFOCUS                      ((XAuint32) 0x00000002)
+#define XA_CAMERACAP_CONTINUOUSAUTOFOCUS            ((XAuint32) 0x00000004)
+#define XA_CAMERACAP_MANUALFOCUS                    ((XAuint32) 0x00000008)
+#define XA_CAMERACAP_AUTOEXPOSURE                   ((XAuint32) 0x00000010)
+#define XA_CAMERACAP_MANUALEXPOSURE                 ((XAuint32) 0x00000020)
+#define XA_CAMERACAP_AUTOISOSENSITIVITY             ((XAuint32) 0x00000040)
+#define XA_CAMERACAP_MANUALISOSENSITIVITY           ((XAuint32) 0x00000080)
+#define XA_CAMERACAP_AUTOAPERTURE                   ((XAuint32) 0x00000100)
+#define XA_CAMERACAP_MANUALAPERTURE                 ((XAuint32) 0x00000200)
+#define XA_CAMERACAP_AUTOSHUTTERSPEED               ((XAuint32) 0x00000400)
+#define XA_CAMERACAP_MANUALSHUTTERSPEED             ((XAuint32) 0x00000800)
+#define XA_CAMERACAP_AUTOWHITEBALANCE               ((XAuint32) 0x00001000)
+#define XA_CAMERACAP_MANUALWHITEBALANCE             ((XAuint32) 0x00002000)
+#define XA_CAMERACAP_OPTICALZOOM                    ((XAuint32) 0x00004000)
+#define XA_CAMERACAP_DIGITALZOOM                    ((XAuint32) 0x00008000)
+#define XA_CAMERACAP_METERING                       ((XAuint32) 0x00010000)
+#define XA_CAMERACAP_BRIGHTNESS                     ((XAuint32) 0x00020000)
+#define XA_CAMERACAP_CONTRAST                       ((XAuint32) 0x00040000)
+#define XA_CAMERACAP_GAMMA                          ((XAuint32) 0x00080000)
+
+
+#define XA_CAMERA_EXPOSUREMODE_MANUAL               ((XAuint32) 0x00000001)
+#define XA_CAMERA_EXPOSUREMODE_AUTO                 ((XAuint32) 0x00000002)
+#define XA_CAMERA_EXPOSUREMODE_NIGHT                ((XAuint32) 0x00000004)
+#define XA_CAMERA_EXPOSUREMODE_BACKLIGHT            ((XAuint32) 0x00000008)
+#define XA_CAMERA_EXPOSUREMODE_SPOTLIGHT            ((XAuint32) 0x00000010)
+#define XA_CAMERA_EXPOSUREMODE_SPORTS               ((XAuint32) 0x00000020)
+#define XA_CAMERA_EXPOSUREMODE_SNOW                 ((XAuint32) 0x00000040)
+#define XA_CAMERA_EXPOSUREMODE_BEACH                ((XAuint32) 0x00000080)
+#define XA_CAMERA_EXPOSUREMODE_LARGEAPERTURE        ((XAuint32) 0x00000100)
+#define XA_CAMERA_EXPOSUREMODE_SMALLAPERTURE        ((XAuint32) 0x00000200)
+#define XA_CAMERA_EXPOSUREMODE_PORTRAIT             ((XAuint32) 0x0000400)
+#define XA_CAMERA_EXPOSUREMODE_NIGHTPORTRAIT        ((XAuint32) 0x00000800)
+
+#define XA_CAMERA_FLASHMODE_OFF                     ((XAuint32) 0x00000001)
+#define XA_CAMERA_FLASHMODE_ON                      ((XAuint32) 0x00000002)
+#define XA_CAMERA_FLASHMODE_AUTO                    ((XAuint32) 0x00000004)
+#define XA_CAMERA_FLASHMODE_REDEYEREDUCTION         ((XAuint32) 0x00000008)
+#define XA_CAMERA_FLASHMODE_REDEYEREDUCTION_AUTO    ((XAuint32) 0x00000010)
+#define XA_CAMERA_FLASHMODE_FILLIN                  ((XAuint32) 0x00000020)
+#define XA_CAMERA_FLASHMODE_TORCH                   ((XAuint32) 0x00000040)
+
+#define XA_CAMERA_FOCUSMODE_MANUAL                  ((XAuint32) 0x00000001)
+#define XA_CAMERA_FOCUSMODE_AUTO                    ((XAuint32) 0x00000002)
+#define XA_CAMERA_FOCUSMODE_CENTROID                ((XAuint32) 0x00000004)
+#define XA_CAMERA_FOCUSMODE_CONTINUOUS_AUTO         ((XAuint32) 0x00000008)
+#define XA_CAMERA_FOCUSMODE_CONTINUOUS_CENTROID     ((XAuint32) 0x00000010)
+
+#define XA_CAMERA_FOCUSMODESTATUS_OFF               ((XAuint32) 0x00000001)
+#define XA_CAMERA_FOCUSMODESTATUS_REQUEST           ((XAuint32) 0x00000002)
+#define XA_CAMERA_FOCUSMODESTATUS_REACHED           ((XAuint32) 0x00000003)
+#define XA_CAMERA_FOCUSMODESTATUS_UNABLETOREACH     ((XAuint32) 0x00000004)
+#define XA_CAMERA_FOCUSMODESTATUS_LOST              ((XAuint32) 0x00000005)
+
+#define XA_CAMERA_ISOSENSITIVITYMODE_MANUAL         ((XAuint32) 0x00000001)
+#define XA_CAMERA_ISOSENSITIVITYMODE_AUTO           ((XAuint32) 0x00000002)
+
+#define XA_CAMERA_LOCK_AUTOFOCUS                    ((XAuint32) 0x00000001)
+#define XA_CAMERA_LOCK_AUTOEXPOSURE                 ((XAuint32) 0x00000002)
+#define XA_CAMERA_LOCK_AUTOWHITEBALANCE             ((XAuint32) 0x00000004)
+
+#define XA_CAMERA_METERINGMODE_AVERAGE              ((XAuint32) 0x00000001)
+#define XA_CAMERA_METERINGMODE_SPOT                 ((XAuint32) 0x00000002)
+#define XA_CAMERA_METERINGMODE_MATRIX               ((XAuint32) 0x00000004)
+
+#define XA_CAMERA_SHUTTERSPEEDMODE_MANUAL           ((XAuint32) 0x00000001)
+#define XA_CAMERA_SHUTTERSPEEDMODE_AUTO             ((XAuint32) 0x00000002)
+
+#define XA_CAMERA_WHITEBALANCEMODE_MANUAL           ((XAuint32) 0x00000001)
+#define XA_CAMERA_WHITEBALANCEMODE_AUTO             ((XAuint32) 0x00000002)
+#define XA_CAMERA_WHITEBALANCEMODE_SUNLIGHT         ((XAuint32) 0x00000004)
+#define XA_CAMERA_WHITEBALANCEMODE_CLOUDY           ((XAuint32) 0x00000008)
+#define XA_CAMERA_WHITEBALANCEMODE_SHADE            ((XAuint32) 0x00000010)
+#define XA_CAMERA_WHITEBALANCEMODE_TUNGSTEN         ((XAuint32) 0x00000020)
+#define XA_CAMERA_WHITEBALANCEMODE_FLUORESCENT      ((XAuint32) 0x00000040)
+#define XA_CAMERA_WHITEBALANCEMODE_INCANDESCENT     ((XAuint32) 0x00000080)
+#define XA_CAMERA_WHITEBALANCEMODE_FLASH            ((XAuint32) 0x00000100)
+#define XA_CAMERA_WHITEBALANCEMODE_SUNSET           ((XAuint32) 0x00000200)
+
+#define XA_CAMERA_ZOOM_SLOW                         ((XAuint32) 50)
+#define XA_CAMERA_ZOOM_NORMAL                       ((XAuint32) 100)
+#define XA_CAMERA_ZOOM_FAST                         ((XAuint32) 200)
+#define XA_CAMERA_ZOOM_FASTEST                      ((XAuint32) 0xFFFFFFFF)
+
+#define XA_FOCUSPOINTS_ONE                          ((XAuint32) 0x00000001)
+#define XA_FOCUSPOINTS_THREE_3X1                    ((XAuint32) 0x00000002)
+#define XA_FOCUSPOINTS_FIVE_CROSS                   ((XAuint32) 0x00000003)
+#define XA_FOCUSPOINTS_SEVEN_CROSS                  ((XAuint32) 0x00000004)
+#define XA_FOCUSPOINTS_NINE_SQUARE                  ((XAuint32) 0x00000005)
+#define XA_FOCUSPOINTS_ELEVEN_CROSS                 ((XAuint32) 0x00000006)
+#define XA_FOCUSPOINTS_TWELVE_3X4                   ((XAuint32) 0x00000007)
+#define XA_FOCUSPOINTS_TWELVE_4X3                   ((XAuint32) 0x00000008)
+#define XA_FOCUSPOINTS_SIXTEEN_SQUARE               ((XAuint32) 0x00000009)
+#define XA_FOCUSPOINTS_CUSTOM                       ((XAuint32) 0x0000000A)
+
+typedef struct XAFocusPointPosition_ {
+    XAuint32 left;
+    XAuint32 top;
+    XAuint32 width;
+    XAuint32 height;
+} XAFocusPointPosition;
+
+#define XA_ORIENTATION_UNKNOWN                      ((XAuint32) 0x00000001)
+#define XA_ORIENTATION_OUTWARDS                     ((XAuint32) 0x00000002)
+#define XA_ORIENTATION_INWARDS                      ((XAuint32) 0x00000003)
+
+typedef struct XACameraDescriptor_ {
+    XAchar * name;
+    XAuint32 maxWidth;
+    XAuint32 maxHeight;
+    XAuint32 orientation;
+    XAuint32 featuresSupported;
+    XAuint32 exposureModesSupported;
+    XAuint32 flashModesSupported;
+    XAuint32 focusModesSupported;
+    XAuint32 meteringModesSupported;
+    XAuint32 whiteBalanceModesSupported;
+} XACameraDescriptor;
+
+XA_API extern const XAInterfaceID XA_IID_CAMERACAPABILITIES;
+
+struct XACameraCapabilitiesItf_;
+typedef const struct XACameraCapabilitiesItf_
+    * const * XACameraCapabilitiesItf;
+
+struct XACameraCapabilitiesItf_ {
+    XAresult (*GetCameraCapabilities) (
+        XACameraCapabilitiesItf self,
+        XAuint32 *pIndex,
+        XAuint32 * pCameraDeviceID,
+        XACameraDescriptor * pDescriptor
+    );
+    XAresult (*QueryFocusRegionPatterns) (
+        XACameraCapabilitiesItf self,
+        XAuint32 cameraDeviceID,
+        XAuint32 * pPatternID,
+        XAuint32 * pFocusPattern,
+        XAuint32 * pCustomPoints1,
+        XAuint32 * pCustomPoints2
+    );
+    XAresult (*GetSupportedAutoLocks) (
+        XACameraCapabilitiesItf self,
+        XAuint32 cameraDeviceID,
+        XAuint32 * pNumCombinations,
+        XAuint32 ** ppLocks
+    );
+    XAresult (*GetSupportedFocusManualSettings) (
+        XACameraCapabilitiesItf self,
+        XAuint32 cameraDeviceID,
+        XAboolean macroEnabled,
+        XAmillimeter * pMinValue,
+        XAmillimeter * pMaxValue,
+        XAuint32 * pNumSettings,
+        XAmillimeter ** ppSettings
+    );
+    XAresult (*GetSupportedISOSensitivitySettings) (
+        XACameraCapabilitiesItf self,
+        XAuint32 cameraDeviceID,
+        XAuint32 * pMinValue,
+        XAuint32 * pMaxValue,
+        XAuint32 * pNumSettings,
+        XAuint32 ** ppSettings
+    );
+    XAresult (*GetSupportedApertureManualSettings) (
+        XACameraCapabilitiesItf self,
+        XAuint32 cameraDeviceID,
+        XAuint32 * pMinValue,
+        XAuint32 * pMaxValue,
+        XAuint32 * pNumSettings,
+        XAuint32 ** ppSettings
+    );
+    XAresult (*GetSupportedShutterSpeedManualSettings) (
+        XACameraCapabilitiesItf self,
+        XAuint32 cameraDeviceID,
+        XAmicrosecond * pMinValue,
+        XAmicrosecond * pMaxValue,
+        XAuint32 * pNumSettings,
+        XAmicrosecond ** ppSettings
+    );
+    XAresult (*GetSupportedWhiteBalanceManualSettings) (
+        XACameraCapabilitiesItf self,
+        XAuint32 cameraDeviceID,
+        XAuint32 * pMinValue,
+        XAuint32 * pMaxValue,
+        XAuint32 * pNumSettings,
+        XAuint32 ** ppSettings
+    );
+    XAresult (*GetSupportedZoomSettings) (
+        XACameraCapabilitiesItf self,
+        XAuint32 cameraDeviceID,
+        XAboolean digitalEnabled,
+        XAboolean macroEnabled,
+        XApermille * pMaxValue,
+        XAuint32 * pNumSettings,
+        XApermille ** ppSettings,
+        XAboolean * pSpeedSupported
+
+    );
+};
+
+XA_API extern const XAInterfaceID XA_IID_CAMERA;
+
+struct XACameraItf_;
+typedef const struct XACameraItf_ * const * XACameraItf;
+
+typedef void (XAAPIENTRY * xaCameraCallback) (
+    XACameraItf caller,
+    void * pContext,
+    XAuint32 eventId,
+    XAuint32 eventData
+);
+
+struct XACameraItf_ {
+    XAresult (*RegisterCallback) (
+        XACameraItf self,
+        xaCameraCallback callback,
+        void * pContext
+    );
+    XAresult (*SetFlashMode) (
+        XACameraItf self, 
+        XAuint32 flashMode
+    );
+    XAresult (*GetFlashMode) (
+        XACameraItf self,
+        XAuint32 * pFlashMode
+    );
+    XAresult (*IsFlashReady) (
+        XACameraItf self,
+        XAboolean * pReady
+    );
+    XAresult (*SetFocusMode) (
+        XACameraItf self, 
+        XAuint32 focusMode, 
+        XAmillimeter manualSetting,
+        XAboolean macroEnabled
+    );
+    XAresult (*GetFocusMode) (
+        XACameraItf self,
+        XAuint32 * pFocusMode, 
+        XAmillimeter * pManualSetting,
+        XAboolean * pMacroEnabled
+    );
+    XAresult (*SetFocusRegionPattern) (
+        XACameraItf self, 
+        XAuint32 focusPattern,
+        XAuint32 activePoints1,
+        XAuint32 activePoints2
+    );
+    XAresult (*GetFocusRegionPattern) (
+        XACameraItf self,
+        XAuint32 * pFocusPattern,
+        XAuint32 * pActivePoints1,
+        XAuint32 * pActivePoints2
+    );
+    XAresult (*GetFocusRegionPositions) (
+        XACameraItf self,
+        XAuint32 * pNumPositionEntries,
+        XAFocusPointPosition * pFocusPosition
+    ); 
+    XAresult (*GetFocusModeStatus) (
+        XACameraItf self,
+        XAuint32 * pFocusStatus,
+        XAuint32 * pRegionStatus1,
+        XAuint32 * pRegionStatus2
+    );
+    XAresult (*SetMeteringMode) (
+        XACameraItf self, 
+        XAuint32 meteringMode
+    );
+    XAresult (*GetMeteringMode) (
+        XACameraItf self,
+        XAuint32 * pMeteringMode
+    );
+    XAresult (*SetExposureMode) (
+        XACameraItf self, 
+        XAuint32 exposure,
+        XAuint32 compensation
+    );
+    XAresult (*GetExposureMode) (
+        XACameraItf self,
+        XAuint32 * pExposure,
+        XAuint32 * pCompensation
+    );
+    XAresult (*SetISOSensitivity) (
+        XACameraItf self, 
+        XAuint32 isoSensitivity,
+        XAuint32 manualSetting
+    );
+    XAresult (*GetISOSensitivity) (
+        XACameraItf self,
+        XAuint32 * pIsoSensitivity,
+        XAuint32 * pManualSetting
+    );
+    XAresult (*SetAperture) (
+        XACameraItf self, 
+        XAuint32 aperture,
+        XAuint32 manualSetting
+    );
+    XAresult (*GetAperture) (
+        XACameraItf self,
+        XAuint32 * pAperture,
+        XAuint32 * pManualSetting
+    );
+    XAresult (*SetShutterSpeed) (
+        XACameraItf self, 
+        XAuint32 shutterSpeed,
+        XAmicrosecond manualSetting
+    );
+    XAresult (*GetShutterSpeed) (
+        XACameraItf self,
+        XAuint32 * pShutterSpeed,
+        XAmicrosecond * pManualSetting
+    );
+    XAresult (*SetWhiteBalance) (
+        XACameraItf self, 
+        XAuint32 whiteBalance,
+        XAuint32 manualSetting
+    );
+    XAresult (*GetWhiteBalance) (
+        XACameraItf self,
+        XAuint32 * pWhiteBalance,
+        XAuint32 * pManualSetting
+    );
+    XAresult (*SetAutoLocks) (
+        XACameraItf self,
+        XAuint32 locks
+    );
+    XAresult (*GetAutoLocks) (
+        XACameraItf self,
+        XAuint32 * locks
+    );
+    XAresult (*SetZoom) (
+        XACameraItf self,
+        XApermille zoom,
+        XAboolean digitalEnabled,
+        XAuint32 speed,
+        XAboolean async
+    );
+    XAresult (*GetZoom) (
+        XACameraItf self,
+        XApermille * pZoom,
+        XAboolean * pDigital
+    );
+};
+
+/* AUDIO I/O DEVICE CAPABILITIES */
+
+#define XA_DEVCONNECTION_INTEGRATED                 ((XAint16) 0x0001)
+#define XA_DEVCONNECTION_ATTACHED_WIRED             ((XAint16) 0x0100)
+#define XA_DEVCONNECTION_ATTACHED_WIRELESS          ((XAint16) 0x0200)
+#define XA_DEVCONNECTION_NETWORK                    ((XAint16) 0x0400)
+
+#define XA_DEVLOCATION_HANDSET                      ((XAint16) 0x0001)
+#define XA_DEVLOCATION_HEADSET                      ((XAint16) 0x0002)
+#define XA_DEVLOCATION_CARKIT                       ((XAint16) 0x0003)
+#define XA_DEVLOCATION_DOCK                         ((XAint16) 0x0004)
+#define XA_DEVLOCATION_REMOTE                       ((XAint16) 0x0005)
+
+#define XA_DEVSCOPE_UNKNOWN                         ((XAint16) 0x0001)
+#define XA_DEVSCOPE_ENVIRONMENT                     ((XAint16) 0x0002)
+#define XA_DEVSCOPE_USER                            ((XAint16) 0x0003)
+
+typedef struct XAAudioInputDescriptor_ {
+    XAchar * deviceName;
+    XAint16 deviceConnection;
+    XAint16 deviceScope;
+    XAint16 deviceLocation;
+    XAboolean isForTelephony;
+    XAmilliHertz minSampleRate;
+    XAmilliHertz maxSampleRate;
+    XAboolean isFreqRangeContinuous;
+    XAmilliHertz * samplingRatesSupported;
+    XAint16 numOfSamplingRatesSupported;
+    XAint16 maxChannels;
+} XAAudioInputDescriptor;
+
+typedef struct XAAudioOutputDescriptor_ {
+    XAchar *pDeviceName;
+    XAint16 deviceConnection;
+    XAint16 deviceScope;
+    XAint16 deviceLocation;
+    XAboolean isForTelephony;
+    XAmilliHertz minSampleRate; 
+    XAmilliHertz maxSampleRate;
+    XAboolean isFreqRangeContinuous;
+    XAmilliHertz *samplingRatesSupported;
+    XAint16 numOfSamplingRatesSupported;
+    XAint16 maxChannels;
+} XAAudioOutputDescriptor;
+
+XA_API extern const XAInterfaceID XA_IID_AUDIOIODEVICECAPABILITIES;
+
+struct XAAudioIODeviceCapabilitiesItf_;
+typedef const struct XAAudioIODeviceCapabilitiesItf_
+    * const * XAAudioIODeviceCapabilitiesItf;
+
+typedef void (XAAPIENTRY * xaAvailableAudioInputsChangedCallback) (
+    XAAudioIODeviceCapabilitiesItf caller,
+    void * pContext,
+    XAuint32 deviceID,
+    XAint32 numInputs,
+    XAboolean isNew
+);
+
+typedef void (XAAPIENTRY * xaAvailableAudioOutputsChangedCallback) (
+    XAAudioIODeviceCapabilitiesItf caller,
+    void * pContext,
+    XAuint32 deviceID,
+    XAint32 numOutputs,
+    XAboolean isNew
+);
+
+typedef void (XAAPIENTRY * xaDefaultDeviceIDMapChangedCallback) (
+    XAAudioIODeviceCapabilitiesItf caller,
+    void * pContext,
+	XAboolean isOutput,
+    XAint32 numDevices
+);
+
+struct XAAudioIODeviceCapabilitiesItf_ {
+    XAresult (*GetAvailableAudioInputs) (
+        XAAudioIODeviceCapabilitiesItf self, 
+        XAint32 * pNumInputs,
+        XAuint32 * pInputDeviceIDs
+    );
+    XAresult (*QueryAudioInputCapabilities) (
+        XAAudioIODeviceCapabilitiesItf self, 
+        XAuint32 deviceID, 
+        XAAudioInputDescriptor * pDescriptor
+    );
+    XAresult (*RegisterAvailableAudioInputsChangedCallback) (
+        XAAudioIODeviceCapabilitiesItf self,
+        xaAvailableAudioInputsChangedCallback callback,
+        void * pContext 
+    );
+    XAresult (*GetAvailableAudioOutputs) (
+        XAAudioIODeviceCapabilitiesItf self, 
+        XAint32 * pNumOutputs,
+        XAuint32 * pOutputDeviceIDs
+    );
+    XAresult (*QueryAudioOutputCapabilities) (
+        XAAudioIODeviceCapabilitiesItf self, 
+        XAuint32 deviceID, 
+        XAAudioOutputDescriptor * pDescriptor
+    );
+    XAresult (*RegisterAvailableAudioOutputsChangedCallback) (
+        XAAudioIODeviceCapabilitiesItf self,
+        xaAvailableAudioOutputsChangedCallback callback,
+        void * pContext 
+    );
+    XAresult (*RegisterDefaultDeviceIDMapChangedCallback) (
+        XAAudioIODeviceCapabilitiesItf self,
+        xaDefaultDeviceIDMapChangedCallback callback,
+        void * pContext
+    );
+    XAresult (*GetAssociatedAudioInputs) (
+        XAAudioIODeviceCapabilitiesItf self,
+        XAuint32 deviceID,
+        XAint32 * pNumAudioInputs,
+        XAuint32 * pAudioInputDeviceIDs
+    ); 
+    XAresult (*GetAssociatedAudioOutputs) (
+        XAAudioIODeviceCapabilitiesItf self,
+        XAuint32 deviceID,
+        XAint32 * pNumAudioOutputs,
+        XAuint32 * pAudioOutputDeviceIDs
+    );
+    XAresult (*GetDefaultAudioDevices) (
+        XAAudioIODeviceCapabilitiesItf self,
+        XAuint32 defaultDeviceID,
+        XAint32 *pNumAudioDevices,
+        XAuint32 *pAudioDeviceIDs
+    );
+    XAresult (*QuerySampleFormatsSupported) (
+        XAAudioIODeviceCapabilitiesItf self, 
+        XAuint32 deviceID,
+        XAmilliHertz samplingRate,
+        XAint32 *pSampleFormats,
+        XAint32 *pNumOfSampleFormats
+    );
+};
+
+/* DEVICE VOLUME */
+
+XA_API extern const XAInterfaceID XA_IID_DEVICEVOLUME;
+
+struct XADeviceVolumeItf_;
+typedef const struct XADeviceVolumeItf_ * const * XADeviceVolumeItf;
+
+struct XADeviceVolumeItf_ {
+    XAresult (*GetVolumeScale) (
+        XADeviceVolumeItf self,
+        XAuint32 deviceID,
+        XAint32 * pMinValue,
+        XAint32 * pMaxValue,
+        XAboolean * pIsMillibelScale
+    );
+    XAresult (*SetVolume) (
+        XADeviceVolumeItf self,
+        XAuint32 deviceID,
+        XAint32 volume
+    );
+    XAresult (*GetVolume) (
+        XADeviceVolumeItf self,
+        XAuint32 deviceID,
+        XAint32 * pVolume
+    );
+};
+
+/* EQUALIZER */
+
+#define XA_EQUALIZER_UNDEFINED    ((XAuint16) 0xFFFF)
+
+XA_API extern const XAInterfaceID XA_IID_EQUALIZER;
+
+struct XAEqualizerItf_;
+typedef const struct XAEqualizerItf_ * const * XAEqualizerItf;
+
+struct XAEqualizerItf_ {
+    XAresult (*SetEnabled) (
+        XAEqualizerItf self,
+        XAboolean enabled
+    );
+    XAresult (*IsEnabled) (
+        XAEqualizerItf self,
+        XAboolean * pEnabled
+    );
+    XAresult (*GetNumberOfBands) (
+        XAEqualizerItf self,
+        XAuint16 * pNumBands
+    );
+    XAresult (*GetBandLevelRange) (
+        XAEqualizerItf self,
+        XAmillibel * pMin,
+        XAmillibel * pMax
+    );
+    XAresult (*SetBandLevel) (
+        XAEqualizerItf self,
+        XAuint16 band,
+        XAmillibel level
+    );
+    XAresult (*GetBandLevel) (
+        XAEqualizerItf self,
+        XAuint16 band,
+        XAmillibel * pLevel
+    );
+    XAresult (*GetCenterFreq) (
+        XAEqualizerItf self,
+        XAuint16 band,
+        XAmilliHertz * pCenter
+    );
+    XAresult (*GetBandFreqRange) (
+        XAEqualizerItf self,
+        XAuint16 band,
+        XAmilliHertz * pMin,
+        XAmilliHertz * pMax
+    );
+    XAresult (*GetBand) (
+        XAEqualizerItf self,
+        XAmilliHertz frequency,
+        XAuint16 * pBand
+    );
+    XAresult (*GetCurrentPreset) (
+        XAEqualizerItf self,
+        XAuint16 * pPreset
+    );
+    XAresult (*UsePreset) (
+        XAEqualizerItf self,
+        XAuint16 index
+    );
+    XAresult (*GetNumberOfPresets) (
+        XAEqualizerItf self,
+        XAuint16 * pNumPresets
+    );
+    XAresult (*GetPresetName) (
+        XAEqualizerItf self,
+        XAuint16 index,
+        const XAchar ** ppName
+    );
+};
+
+/* OUTPUT MIX */
+
+XA_API extern const XAInterfaceID XA_IID_OUTPUTMIX;
+
+struct XAOutputMixItf_;
+typedef const struct XAOutputMixItf_ * const * XAOutputMixItf;
+
+typedef void (XAAPIENTRY * xaMixDeviceChangeCallback) (
+    XAOutputMixItf caller,
+    void * pContext
+);
+
+struct XAOutputMixItf_ {
+    XAresult (*GetDestinationOutputDeviceIDs) (
+        XAOutputMixItf self,
+        XAint32 * pNumDevices,
+        XAuint32 * pDeviceIDs
+    );
+    XAresult (*RegisterDeviceChangeCallback) (
+        XAOutputMixItf self,
+        xaMixDeviceChangeCallback callback,
+        void * pContext
+    );
+    XAresult (*ReRoute) (
+        XAOutputMixItf self,
+        XAint32 numOutputDevices,
+        XAuint32 * pOutputDeviceIDs
+    );
+};
+
+/* RADIO */
+
+#define XA_FREQRANGE_FMEUROAMERICA                  ((XAuint8) 0x01)
+#define XA_FREQRANGE_FMJAPAN                        ((XAuint8) 0x02)
+#define XA_FREQRANGE_AMLW                           ((XAuint8) 0x03)
+#define XA_FREQRANGE_AMMW                           ((XAuint8) 0x04)
+#define XA_FREQRANGE_AMSW                           ((XAuint8) 0x05)
+
+#define XA_RADIO_EVENT_ANTENNA_STATUS_CHANGED       ((XAuint32) 0x00000001)
+#define XA_RADIO_EVENT_FREQUENCY_CHANGED            ((XAuint32) 0x00000002)
+#define XA_RADIO_EVENT_FREQUENCY_RANGE_CHANGED      ((XAuint32) 0x00000003)
+#define XA_RADIO_EVENT_PRESET_CHANGED               ((XAuint32) 0x00000004)
+#define XA_RADIO_EVENT_SEEK_COMPLETED               ((XAuint32) 0x00000005)
+
+#define XA_STEREOMODE_MONO                          ((XAuint32) 0x00000000)
+#define XA_STEREOMODE_STEREO                        ((XAuint32) 0x00000001)
+#define XA_STEREOMODE_AUTO                          ((XAuint32) 0x00000002)
+
+XA_API extern const XAInterfaceID XA_IID_RADIO;
+
+struct XARadioItf_;
+typedef const struct XARadioItf_ * const * XARadioItf;
+
+typedef void (XAAPIENTRY * xaRadioCallback) (
+    XARadioItf caller,
+    void * pContext,
+    XAuint32 event,
+    XAuint32 eventIntData,
+    XAboolean eventBooleanData
+);
+
+struct XARadioItf_ {
+    XAresult (*SetFreqRange) (
+        XARadioItf self,
+        XAuint8 range
+    );
+    XAresult (*GetFreqRange) (
+        XARadioItf self,
+        XAuint8 * pRange
+    );
+    XAresult (*IsFreqRangeSupported) (
+        XARadioItf self,
+        XAuint8 range,
+        XAboolean * pSupported
+    );
+    XAresult (*GetFreqRangeProperties) (
+        XARadioItf self,
+        XAuint8 range,
+        XAuint32 * pMinFreq,
+        XAuint32 * pMaxFreq,
+        XAuint32 * pFreqInterval
+    );
+    XAresult (*SetFrequency) (
+        XARadioItf self,
+        XAuint32 freq
+    );
+    XAresult (*CancelSetFrequency) (
+        XARadioItf self
+    );
+    XAresult (*GetFrequency) (
+        XARadioItf self,
+        XAuint32 * pFreq
+    );
+    XAresult (*SetSquelch) (
+        XARadioItf self,
+        XAboolean squelch
+    );
+    XAresult (*GetSquelch) (
+        XARadioItf self,
+        XAboolean * pSquelch
+    );
+    XAresult (*SetStereoMode) (
+        XARadioItf self,
+        XAuint32 mode
+    );
+    XAresult (*GetStereoMode) (
+        XARadioItf self,
+        XAuint32 * pMode
+    );
+    XAresult (*GetSignalStrength) (
+        XARadioItf self,
+        XAuint32 * pStrength
+    );
+    XAresult (*Seek) (
+        XARadioItf self,
+        XAboolean upwards
+    );
+    XAresult (*StopSeeking) (
+        XARadioItf self
+    );
+    XAresult (*GetNumberOfPresets) (
+        XARadioItf self,
+        XAuint32 * pNumPresets
+    );
+    XAresult (*SetPreset) (
+        XARadioItf self,
+        XAuint32 preset,
+        XAuint32 freq,
+        XAuint8 range,
+        XAuint32 mode,
+        const XAchar * pName
+    );
+    XAresult (*GetPreset) (
+        XARadioItf self,
+        XAuint32 preset,
+        XAuint32 * pFreq,
+        XAuint8 * pRange,
+        XAuint32 * pMode,
+        XAchar * pName,
+        XAuint16 * pNameLength
+    );
+    XAresult (*RegisterRadioCallback) (
+        XARadioItf self,
+        xaRadioCallback callback, 
+        void * pContext
+    );
+};
+
+/* RDS */
+
+#define XA_RDS_EVENT_NEW_PI                         ((XAuint16) 0x0001)
+#define XA_RDS_EVENT_NEW_PTY                        ((XAuint16) 0x0002)
+#define XA_RDS_EVENT_NEW_PS                         ((XAuint16) 0x0004)
+#define XA_RDS_EVENT_NEW_RT                         ((XAuint16) 0x0008)
+#define XA_RDS_EVENT_NEW_RT_PLUS                    ((XAuint16) 0x0010)
+#define XA_RDS_EVENT_NEW_CT                         ((XAuint16) 0x0020)
+#define XA_RDS_EVENT_NEW_TA                         ((XAuint16) 0x0040)
+#define XA_RDS_EVENT_NEW_TP                         ((XAuint16) 0x0080)
+#define XA_RDS_EVENT_NEW_ALARM                      ((XAuint16) 0x0100)
+
+#define XA_RDSPROGRAMMETYPE_RDSPTY_NONE \
+    ((XAuint32) 0x00000000)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_NEWS \
+    ((XAuint32) 0x00000001)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_CURRENTAFFAIRS \
+    ((XAuint32) 0x00000002)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_INFORMATION \
+    ((XAuint32) 0x00000003)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_SPORT \
+    ((XAuint32) 0x00000004)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_EDUCATION \
+    ((XAuint32) 0x00000005)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_DRAMA \
+    ((XAuint32) 0x00000006)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_CULTURE \
+    ((XAuint32) 0x00000007)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_SCIENCE \
+    ((XAuint32) 0x00000008)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_VARIEDSPEECH \
+    ((XAuint32) 0x00000009)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_POPMUSIC \
+    ((XAuint32) 0x0000000A)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_ROCKMUSIC \
+    ((XAuint32) 0x0000000B)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_EASYLISTENING \
+    ((XAuint32) 0x0000000C)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_LIGHTCLASSICAL \
+    ((XAuint32) 0x0000000D)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_SERIOUSCLASSICAL \
+    ((XAuint32) 0x0000000E)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_OTHERMUSIC \
+    ((XAuint32) 0x0000000F)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_WEATHER \
+    ((XAuint32) 0x00000010)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_FINANCE \
+    ((XAuint32) 0x00000011)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_CHILDRENSPROGRAMMES \
+    ((XAuint32) 0x00000012)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_SOCIALAFFAIRS \
+    ((XAuint32) 0x00000013)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_RELIGION \
+    ((XAuint32) 0x00000014)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_PHONEIN \
+    ((XAuint32) 0x00000015)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_TRAVEL \
+    ((XAuint32) 0x00000016)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_LEISURE \
+    ((XAuint32) 0x00000017)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_JAZZMUSIC \
+    ((XAuint32) 0x00000018)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_COUNTRYMUSIC \
+    ((XAuint32) 0x00000019)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_NATIONALMUSIC \
+    ((XAuint32) 0x0000001A)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_OLDIESMUSIC \
+    ((XAuint32) 0x0000001B)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_FOLKMUSIC \
+    ((XAuint32) 0x0000001C)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_DOCUMENTARY \
+    ((XAuint32) 0x0000001D)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_ALARMTEST \
+    ((XAuint32) 0x0000001E)
+#define XA_RDSPROGRAMMETYPE_RDSPTY_ALARM \
+    ((XAuint32) 0x0000001F)
+
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_NONE \
+    ((XAuint32) 0x00000000)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_NEWS \
+    ((XAuint32) 0x00000001)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_INFORMATION \
+    ((XAuint32) 0x00000002)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_SPORTS \
+    ((XAuint32) 0x00000003)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_TALK \
+    ((XAuint32) 0x00000004)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_ROCK \
+    ((XAuint32) 0x00000005)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_CLASSICROCK \
+    ((XAuint32) 0x00000006)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_ADULTHITS \
+    ((XAuint32) 0x00000007)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_SOFTROCK \
+    ((XAuint32) 0x00000008)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_TOP40 \
+    ((XAuint32) 0x00000009)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_COUNTRY \
+    ((XAuint32) 0x0000000A)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_OLDIES \
+    ((XAuint32) 0x0000000B)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_SOFT \
+    ((XAuint32) 0x0000000C)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_NOSTALGIA \
+    ((XAuint32) 0x0000000D)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_JAZZ \
+    ((XAuint32) 0x0000000E)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_CLASSICAL \
+    ((XAuint32) 0x0000000F)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_RHYTHMANDBLUES \
+    ((XAuint32) 0x00000010)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_SOFTRHYTHMANDBLUES \
+    ((XAuint32) 0x00000011)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_LANGUAGE \
+    ((XAuint32) 0x00000012)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_RELIGIOUSMUSIC \
+    ((XAuint32) 0x00000013)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_RELIGIOUSTALK \
+    ((XAuint32) 0x00000014)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_PERSONALITY \
+    ((XAuint32) 0x00000015)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_PUBLIC \
+    ((XAuint32) 0x00000016)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_COLLEGE \
+    ((XAuint32) 0x00000017)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_UNASSIGNED1 \
+    ((XAuint32) 0x00000018)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_UNASSIGNED2 \
+    ((XAuint32) 0x00000019)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_UNASSIGNED3 \
+    ((XAuint32) 0x0000001A)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_UNASSIGNED4 \
+    ((XAuint32) 0x0000001B)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_UNASSIGNED5 \
+    ((XAuint32) 0x0000001C)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_WEATHER \
+    ((XAuint32) 0x0000001D)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_EMERGENCYTEST \
+    ((XAuint32) 0x0000001E)
+#define XA_RDSPROGRAMMETYPE_RBDSPTY_EMERGENCY \
+    ((XAuint32) 0x0000001F)
+
+#define XA_RDSRTPLUS_ITEMTITLE              ((XAuint8) 0x01)
+#define XA_RDSRTPLUS_ITEMALBUM              ((XAuint8) 0x02)
+#define XA_RDSRTPLUS_ITEMTRACKNUMBER        ((XAuint8) 0x03)
+#define XA_RDSRTPLUS_ITEMARTIST             ((XAuint8) 0x04)
+#define XA_RDSRTPLUS_ITEMCOMPOSITION        ((XAuint8) 0x05)
+#define XA_RDSRTPLUS_ITEMMOVEMENT           ((XAuint8) 0x06)
+#define XA_RDSRTPLUS_ITEMCONDUCTOR          ((XAuint8) 0x07)
+#define XA_RDSRTPLUS_ITEMCOMPOSER           ((XAuint8) 0x08)
+#define XA_RDSRTPLUS_ITEMBAND               ((XAuint8) 0x09)
+#define XA_RDSRTPLUS_ITEMCOMMENT            ((XAuint8) 0x0A)
+#define XA_RDSRTPLUS_ITEMGENRE              ((XAuint8) 0x0B)
+#define XA_RDSRTPLUS_INFONEWS               ((XAuint8) 0x0C)
+#define XA_RDSRTPLUS_INFONEWSLOCAL          ((XAuint8) 0x0D)
+#define XA_RDSRTPLUS_INFOSTOCKMARKET        ((XAuint8) 0x0E)
+#define XA_RDSRTPLUS_INFOSPORT              ((XAuint8) 0x0F)
+#define XA_RDSRTPLUS_INFOLOTTERY            ((XAuint8) 0x10)
+#define XA_RDSRTPLUS_INFOHOROSCOPE          ((XAuint8) 0x11)
+#define XA_RDSRTPLUS_INFODAILYDIVERSION     ((XAuint8) 0x12)
+#define XA_RDSRTPLUS_INFOHEALTH             ((XAuint8) 0x13)
+#define XA_RDSRTPLUS_INFOEVENT              ((XAuint8) 0x14)
+#define XA_RDSRTPLUS_INFOSZENE              ((XAuint8) 0x15)
+#define XA_RDSRTPLUS_INFOCINEMA             ((XAuint8) 0x16)
+#define XA_RDSRTPLUS_INFOTV                 ((XAuint8) 0x17)
+#define XA_RDSRTPLUS_INFODATETIME           ((XAuint8) 0x18)
+#define XA_RDSRTPLUS_INFOWEATHER            ((XAuint8) 0x19)
+#define XA_RDSRTPLUS_INFOTRAFFIC            ((XAuint8) 0x1A)
+#define XA_RDSRTPLUS_INFOALARM              ((XAuint8) 0x1B)
+#define XA_RDSRTPLUS_INFOADVISERTISEMENT    ((XAuint8) 0x1C)
+#define XA_RDSRTPLUS_INFOURL                ((XAuint8) 0x1D)
+#define XA_RDSRTPLUS_INFOOTHER              ((XAuint8) 0x1E)
+#define XA_RDSRTPLUS_STATIONNAMESHORT       ((XAuint8) 0x1F)
+#define XA_RDSRTPLUS_STATIONNAMELONG        ((XAuint8) 0x20)
+#define XA_RDSRTPLUS_PROGRAMNOW             ((XAuint8) 0x21)
+#define XA_RDSRTPLUS_PROGRAMNEXT            ((XAuint8) 0x22)
+#define XA_RDSRTPLUS_PROGRAMPART            ((XAuint8) 0x23)
+#define XA_RDSRTPLUS_PROGRAMHOST            ((XAuint8) 0x24)
+#define XA_RDSRTPLUS_PROFRAMEDITORIALSTAFF  ((XAuint8) 0x25)
+#define XA_RDSRTPLUS_PROGRAMFREQUENCY       ((XAuint8) 0x26)
+#define XA_RDSRTPLUS_PROGRAMHOMEPAGE        ((XAuint8) 0x27)
+#define XA_RDSRTPLUS_PROGRAMSUBCHANNEL      ((XAuint8) 0x28)
+#define XA_RDSRTPLUS_PHONEHOTLINE           ((XAuint8) 0x29)
+#define XA_RDSRTPLUS_PHONESTUDIO            ((XAuint8) 0x2A)
+#define XA_RDSRTPLUS_PHONEOTHER             ((XAuint8) 0x2B)
+#define XA_RDSRTPLUS_SMSSTUDIO              ((XAuint8) 0x2C)
+#define XA_RDSRTPLUS_SMSOTHER               ((XAuint8) 0x2D)
+#define XA_RDSRTPLUS_EMAILHOTLINE           ((XAuint8) 0x2E)
+#define XA_RDSRTPLUS_EMAILSTUDIO            ((XAuint8) 0x2F)
+#define XA_RDSRTPLUS_EMAILOTHER             ((XAuint8) 0x30)
+#define XA_RDSRTPLUS_MMSOTHER               ((XAuint8) 0x31)
+#define XA_RDSRTPLUS_CHAT                   ((XAuint8) 0x32)
+#define XA_RDSRTPLUS_CHATCENTER             ((XAuint8) 0x33)
+#define XA_RDSRTPLUS_VOTEQUESTION           ((XAuint8) 0x34)
+#define XA_RDSRTPLUS_VOTECENTER             ((XAuint8) 0x35)
+#define XA_RDSRTPLUS_OPENCLASS45            ((XAuint8) 0x36)
+#define XA_RDSRTPLUS_OPENCLASS55            ((XAuint8) 0x37)
+#define XA_RDSRTPLUS_OPENCLASS56            ((XAuint8) 0x38)
+#define XA_RDSRTPLUS_OPENCLASS57            ((XAuint8) 0x39)
+#define XA_RDSRTPLUS_OPENCLASS58            ((XAuint8) 0x3A)
+#define XA_RDSRTPLUS_PLACE                  ((XAuint8) 0x3B)
+#define XA_RDSRTPLUS_APPOINTMENT            ((XAuint8) 0x3C)
+#define XA_RDSRTPLUS_IDENTIFIER             ((XAuint8) 0x3D)
+#define XA_RDSRTPLUS_PURCHASE               ((XAuint8) 0x3E)
+#define XA_RDSRTPLUS_GETDATA                ((XAuint8) 0x3F)
+
+XA_API extern const XAInterfaceID XA_IID_RDS;
+
+struct XARDSItf_;
+typedef const struct XARDSItf_ * const * XARDSItf;
+
+typedef void (XAAPIENTRY * xaGetODAGroupCallback) (
+    XARadioItf caller,
+    void * pContext,
+    XAboolean success,
+    XAint16 group,
+    XAuint16 message
+);
+
+typedef void (XAAPIENTRY * xaNewODADataCallback) (
+    XARDSItf caller,
+    void * pContext,
+    XAint16 group,
+    XAuint64 data
+);
+
+typedef void (XAAPIENTRY * xaRDSCallback) (
+    XARDSItf caller,
+    void * pContext,
+    XAuint16 event,
+    XAuint8 eventData
+);
+
+struct XARDSItf_ {
+    XAresult (*QueryRDSSignal) (
+        XARDSItf self,
+        XAboolean * isSignal
+    );
+    XAresult (*GetProgrammeServiceName) (
+        XARDSItf self,
+        XAchar * ps
+    );
+    XAresult (*GetRadioText) (
+        XARDSItf self,
+        XAchar * rt
+    );
+    XAresult (*GetRadioTextPlus) (
+        XARDSItf self,
+        XAuint8 contentType,
+        XAchar * informationElement,
+        XAchar * descriptor,
+        XAuint8 * descriptorContentType
+    );
+    XAresult (*GetProgrammeType) (
+        XARDSItf self,
+        XAuint32 * pty
+    );
+    XAresult (*GetProgrammeTypeString) (
+        XARDSItf self,
+        XAboolean isLengthMax16,
+        XAchar * pty
+    );
+    XAresult (*GetProgrammeIdentificationCode) (
+        XARDSItf self,
+        XAint16 * pi
+    );
+    XAresult (*GetClockTime) (
+        XARDSItf self,
+        XAtime * dateAndTime
+    );
+    XAresult (*GetTrafficAnnouncement) (
+        XARDSItf self,
+        XAboolean * ta
+    );
+    XAresult (*GetTrafficProgramme) (
+        XARDSItf self,
+        XAboolean * tp
+    );
+    XAresult (*SeekByProgrammeType) (
+        XARDSItf self,
+        XAuint32 pty,
+        XAboolean upwards
+    );
+    XAresult (*SeekTrafficAnnouncement) (
+        XARDSItf self,
+        XAboolean upwards
+    );
+    XAresult (*SeekTrafficProgramme) (
+        XARDSItf self,
+        XAboolean upwards
+    );
+    XAresult (*SetAutomaticSwitching) (
+        XARDSItf self,
+        XAboolean automatic
+    );
+    XAresult (*GetAutomaticSwitching) (
+        XARDSItf self,
+        XAboolean * automatic
+    );
+    XAresult (*SetAutomaticTrafficAnnouncement) (
+        XARDSItf self,
+        XAboolean automatic
+    );
+    XAresult (*GetAutomaticTrafficAnnouncement) (
+        XARDSItf self,
+        XAboolean * automatic
+    );
+    XAresult (*GetODAGroup) (
+        XARDSItf self,
+        XAuint16 AID,
+        xaGetODAGroupCallback callback,
+        void * pContext
+    );
+    XAresult (*SubscribeODAGroup) (
+        XARDSItf self,
+        XAint16 group,
+        XAboolean useErrorCorrection
+    );
+    XAresult (*UnsubscribeODAGroup) (
+        XARDSItf self,
+        XAint16 group
+    );
+    XAresult (*ListODAGroupSubscriptions) (
+        XARDSItf self,
+        XAint16* pGroups,
+        XAuint32* pLength
+    );
+    XAresult (*RegisterRDSCallback) (
+        XARDSItf self,
+        xaRDSCallback callback, 
+        void * pContext
+    );
+    XAresult (*RegisterODADataCallback) (
+        XARDSItf self,
+        xaNewODADataCallback callback, 
+        void * pContext
+    );
+};
+
+/* VIBRA */
+
+XA_API extern const XAInterfaceID XA_IID_VIBRA;
+
+struct XAVibraItf_;
+typedef const struct XAVibraItf_ * const * XAVibraItf;
+
+struct XAVibraItf_ {
+    XAresult (*Vibrate) (
+        XAVibraItf self,
+        XAboolean vibrate
+    );
+    XAresult (*IsVibrating) (
+        XAVibraItf self,
+        XAboolean * pVibrating
+    );
+    XAresult (*SetFrequency) (
+        XAVibraItf self,
+        XAmilliHertz frequency
+    );
+    XAresult (*GetFrequency) (
+        XAVibraItf self,
+        XAmilliHertz * pFrequency
+    );
+    XAresult (*SetIntensity) (
+        XAVibraItf self,
+        XApermille intensity
+    );
+    XAresult (*GetIntensity) (
+        XAVibraItf self,
+        XApermille * pIntensity
+    );
+};
+
+/* LED ARRAY */
+
+typedef struct XAHSL_ {
+    XAmillidegree hue;
+    XApermille saturation;
+    XApermille lightness;
+} XAHSL;
+
+XA_API extern const XAInterfaceID XA_IID_LED;
+
+struct XALEDArrayItf_;
+typedef const struct XALEDArrayItf_ * const * XALEDArrayItf;
+
+struct XALEDArrayItf_ {
+    XAresult (*ActivateLEDArray) (
+        XALEDArrayItf self,
+        XAuint32 lightMask
+    );
+    XAresult (*IsLEDArrayActivated) (
+        XALEDArrayItf self,
+        XAuint32 * pLightMask
+    );
+    XAresult (*SetColor) (
+        XALEDArrayItf self,
+        XAuint8 index,
+        const XAHSL * pColor
+    );
+    XAresult (*GetColor) (
+        XALEDArrayItf self,
+        XAuint8 index,
+        XAHSL * pColor
+    );
+};
+
+
+
+  /*****************************************************************/
+  /* CODEC RELATED INTERFACES, STRUCTS AND DEFINES                 */
+  /*****************************************************************/
+
+/* AUDIO ENCODER AND AUDIO ENCODER/DECODER CAPABILITIES */
+
+#define XA_RATECONTROLMODE_CONSTANTBITRATE  ((XAuint32) 0x00000001)
+#define XA_RATECONTROLMODE_VARIABLEBITRATE  ((XAuint32) 0x00000002)
+
+#define XA_AUDIOCODEC_PCM                   ((XAuint32) 0x00000001)
+#define XA_AUDIOCODEC_MP3                   ((XAuint32) 0x00000002)
+#define XA_AUDIOCODEC_AMR                   ((XAuint32) 0x00000003)
+#define XA_AUDIOCODEC_AMRWB                 ((XAuint32) 0x00000004)
+#define XA_AUDIOCODEC_AMRWBPLUS             ((XAuint32) 0x00000005)
+#define XA_AUDIOCODEC_AAC                   ((XAuint32) 0x00000006)
+#define XA_AUDIOCODEC_WMA                   ((XAuint32) 0x00000007)
+#define XA_AUDIOCODEC_REAL                  ((XAuint32) 0x00000008)
+#define XA_AUDIOCODEC_VORBIS                ((XAuint32) 0x00000009)
+
+#define XA_AUDIOPROFILE_PCM                 ((XAuint32) 0x00000001)
+
+#define XA_AUDIOPROFILE_MPEG1_L3            ((XAuint32) 0x00000001)
+#define XA_AUDIOPROFILE_MPEG2_L3            ((XAuint32) 0x00000002)
+#define XA_AUDIOPROFILE_MPEG25_L3           ((XAuint32) 0x00000003)
+
+#define XA_AUDIOCHANMODE_MP3_MONO           ((XAuint32) 0x00000001)
+#define XA_AUDIOCHANMODE_MP3_STEREO         ((XAuint32) 0x00000002)
+#define XA_AUDIOCHANMODE_MP3_JOINTSTEREO    ((XAuint32) 0x00000003)
+#define XA_AUDIOCHANMODE_MP3_DUAL           ((XAuint32) 0x00000004)
+
+#define XA_AUDIOPROFILE_AMR                 ((XAuint32) 0x00000001)
+
+#define XA_AUDIOSTREAMFORMAT_CONFORMANCE    ((XAuint32) 0x00000001)
+#define XA_AUDIOSTREAMFORMAT_IF1            ((XAuint32) 0x00000002)
+#define XA_AUDIOSTREAMFORMAT_IF2            ((XAuint32) 0x00000003)
+#define XA_AUDIOSTREAMFORMAT_FSF            ((XAuint32) 0x00000004)
+#define XA_AUDIOSTREAMFORMAT_RTPPAYLOAD     ((XAuint32) 0x00000005)
+#define XA_AUDIOSTREAMFORMAT_ITU            ((XAuint32) 0x00000006)
+
+#define XA_AUDIOPROFILE_AMRWB               ((XAuint32) 0x00000001)
+
+#define XA_AUDIOPROFILE_AMRWBPLUS           ((XAuint32) 0x00000001)
+
+#define XA_AUDIOPROFILE_AAC_AAC             ((XAuint32) 0x00000001)
+
+#define XA_AUDIOMODE_AAC_MAIN               ((XAuint32) 0x00000001)
+#define XA_AUDIOMODE_AAC_LC                 ((XAuint32) 0x00000002)
+#define XA_AUDIOMODE_AAC_SSR                ((XAuint32) 0x00000003)
+#define XA_AUDIOMODE_AAC_LTP                ((XAuint32) 0x00000004)
+#define XA_AUDIOMODE_AAC_HE                 ((XAuint32) 0x00000005)
+#define XA_AUDIOMODE_AAC_SCALABLE           ((XAuint32) 0x00000006)
+#define XA_AUDIOMODE_AAC_ERLC               ((XAuint32) 0x00000007)
+#define XA_AUDIOMODE_AAC_LD                 ((XAuint32) 0x00000008)
+#define XA_AUDIOMODE_AAC_HE_PS              ((XAuint32) 0x00000009)
+#define XA_AUDIOMODE_AAC_HE_MPS             ((XAuint32) 0x0000000A)
+
+#define XA_AUDIOSTREAMFORMAT_MP2ADTS        ((XAuint32) 0x00000001)
+#define XA_AUDIOSTREAMFORMAT_MP4ADTS        ((XAuint32) 0x00000002)
+#define XA_AUDIOSTREAMFORMAT_MP4LOAS        ((XAuint32) 0x00000003)
+#define XA_AUDIOSTREAMFORMAT_MP4LATM        ((XAuint32) 0x00000004)
+#define XA_AUDIOSTREAMFORMAT_ADIF           ((XAuint32) 0x00000005)
+#define XA_AUDIOSTREAMFORMAT_MP4FF          ((XAuint32) 0x00000006)
+#define XA_AUDIOSTREAMFORMAT_RAW            ((XAuint32) 0x00000007)
+
+#define XA_AUDIOPROFILE_WMA7                ((XAuint32) 0x00000001)
+#define XA_AUDIOPROFILE_WMA8                ((XAuint32) 0x00000002)
+#define XA_AUDIOPROFILE_WMA9                ((XAuint32) 0x00000003)
+#define XA_AUDIOPROFILE_WMA10               ((XAuint32) 0x00000004)
+
+#define XA_AUDIOMODE_WMA_LEVEL1             ((XAuint32) 0x00000001)
+#define XA_AUDIOMODE_WMA_LEVEL2             ((XAuint32) 0x00000002)
+#define XA_AUDIOMODE_WMA_LEVEL3             ((XAuint32) 0x00000003)
+#define XA_AUDIOMODE_WMA_LEVEL4             ((XAuint32) 0x00000004)
+#define XA_AUDIOMODE_WMAPRO_LEVELM0         ((XAuint32) 0x00000005)
+#define XA_AUDIOMODE_WMAPRO_LEVELM1         ((XAuint32) 0x00000006)
+#define XA_AUDIOMODE_WMAPRO_LEVELM2         ((XAuint32) 0x00000007)
+#define XA_AUDIOMODE_WMAPRO_LEVELM3         ((XAuint32) 0x00000008)
+
+#define XA_AUDIOPROFILE_REALAUDIO           ((XAuint32) 0x00000001)
+
+#define XA_AUDIOMODE_REALAUDIO_G2           ((XAuint32) 0x00000001)
+#define XA_AUDIOMODE_REALAUDIO_8            ((XAuint32) 0x00000002)
+#define XA_AUDIOMODE_REALAUDIO_10           ((XAuint32) 0x00000003)
+#define XA_AUDIOMODE_REALAUDIO_SURROUND     ((XAuint32) 0x00000004)
+
+#define XA_AUDIOPROFILE_VORBIS              ((XAuint32) 0x00000001)
+
+#define XA_AUDIOMODE_VORBIS                 ((XAuint32) 0x00000001)
+
+
+typedef struct XAAudioCodecDescriptor_ {
+    XAuint32 maxChannels;
+    XAuint32 minBitsPerSample;
+    XAuint32 maxBitsPerSample;
+    XAmilliHertz minSampleRate;
+    XAmilliHertz maxSampleRate;
+    XAboolean isFreqRangeContinuous;
+    XAmilliHertz * pSampleRatesSupported;
+    XAuint32 numSampleRatesSupported;
+    XAuint32 minBitRate;
+    XAuint32 maxBitRate;
+    XAboolean isBitrateRangeContinuous;
+    XAuint32 * pBitratesSupported;
+    XAuint32 numBitratesSupported;
+    XAuint32 profileSetting;
+    XAuint32 modeSetting;
+} XAAudioCodecDescriptor;
+
+typedef struct XAAudioEncoderSettings_ {
+    XAuint32 encoderId;
+    XAuint32 channelsIn;
+    XAuint32 channelsOut;
+    XAmilliHertz sampleRate;
+    XAuint32 bitRate;
+    XAuint32 bitsPerSample;
+    XAuint32 rateControl;
+    XAuint32 profileSetting;
+    XAuint32 levelSetting;
+    XAuint32 channelMode;
+    XAuint32 streamFormat;
+    XAuint32 encodeOptions;
+    XAuint32 blockAlignment;
+} XAAudioEncoderSettings;
+
+XA_API extern const XAInterfaceID XA_IID_AUDIODECODERCAPABILITIES;
+
+struct XAAudioDecoderCapabilitiesItf_;
+typedef const struct XAAudioDecoderCapabilitiesItf_
+    * const * XAAudioDecoderCapabilitiesItf;
+
+struct XAAudioDecoderCapabilitiesItf_ {
+    XAresult (*GetAudioDecoders) (
+        XAAudioDecoderCapabilitiesItf self,
+        XAuint32 * pNumDecoders,
+        XAuint32 * pDecoderIds
+    );
+    XAresult (*GetAudioDecoderCapabilities) (
+        XAAudioDecoderCapabilitiesItf self,
+        XAuint32 decoderId,
+        XAuint32 * pIndex,
+        XAAudioCodecDescriptor * pDescriptor
+    );
+};
+
+XA_API extern const XAInterfaceID XA_IID_AUDIOENCODER;
+
+struct XAAudioEncoderItf_;
+typedef const struct XAAudioEncoderItf_ * const * XAAudioEncoderItf;
+
+struct XAAudioEncoderItf_ {
+    XAresult (*SetEncoderSettings) (
+        XAAudioEncoderItf self,
+        XAAudioEncoderSettings * pSettings
+    );
+    XAresult (*GetEncoderSettings) (
+        XAAudioEncoderItf self,
+        XAAudioEncoderSettings * pSettings
+    );
+};
+
+XA_API extern const XAInterfaceID XA_IID_AUDIOENCODERCAPABILITIES;
+
+struct XAAudioEncoderCapabilitiesItf_;
+typedef const struct XAAudioEncoderCapabilitiesItf_
+    * const * XAAudioEncoderCapabilitiesItf;
+
+struct XAAudioEncoderCapabilitiesItf_ {
+    XAresult (*GetAudioEncoders) (
+        XAAudioEncoderCapabilitiesItf self,
+        XAuint32 * pNumEncoders,
+        XAuint32 * pEncoderIds
+    );
+    XAresult (*GetAudioEncoderCapabilities) (
+        XAAudioEncoderCapabilitiesItf self,
+        XAuint32 encoderId,
+        XAuint32 * pIndex,
+        XAAudioCodecDescriptor * pDescriptor
+    );
+};
+
+/* IMAGE ENCODER AND IMAGE ENCODER/DECODER CAPABILITIES */
+
+#define XA_IMAGECODEC_JPEG              ((XAuint32) 0x00000001)
+#define XA_IMAGECODEC_GIF               ((XAuint32) 0x00000002)
+#define XA_IMAGECODEC_BMP               ((XAuint32) 0x00000003)
+#define XA_IMAGECODEC_PNG               ((XAuint32) 0x00000004)
+#define XA_IMAGECODEC_TIFF              ((XAuint32) 0x00000005)
+#define XA_IMAGECODEC_RAW               ((XAuint32) 0x00000006)
+
+typedef struct XAImageCodecDescriptor_ {
+    XAuint32 codecId;
+    XAuint32 maxWidth;
+    XAuint32 maxHeight;
+} XAImageCodecDescriptor;
+
+typedef struct XAImageSettings_ {
+    XAuint32 encoderId;
+    XAuint32 width;
+    XAuint32 height;
+    XApermille compressionLevel;
+    XAuint32 colorFormat;
+} XAImageSettings;
+
+XA_API extern const XAInterfaceID XA_IID_IMAGEENCODERCAPABILITIES;
+
+struct XAImageEncoderCapabilitiesItf_;
+typedef const struct XAImageEncoderCapabilitiesItf_
+    * const * XAImageEncoderCapabilitiesItf;
+
+struct XAImageEncoderCapabilitiesItf_ {
+    XAresult (*GetImageEncoderCapabilities) (
+        XAImageEncoderCapabilitiesItf self,
+        XAuint32 * pEncoderId,
+        XAImageCodecDescriptor * pDescriptor
+    );
+    XAresult (*QueryColorFormats) (
+        const XAImageEncoderCapabilitiesItf self,
+        XAuint32 * pIndex,
+        XAuint32 * pColorFormat
+    );
+};
+
+XA_API extern const XAInterfaceID XA_IID_IMAGEDECODERCAPABILITIES;
+
+struct XAImageDecoderCapabilitiesItf_;
+typedef const struct XAImageDecoderCapabilitiesItf_
+    * const * XAImageDecoderCapabilitiesItf;
+
+struct XAImageDecoderCapabilitiesItf_ {
+    XAresult (*GetImageDecoderCapabilities) (
+        XAImageDecoderCapabilitiesItf self,
+        XAuint32 * pDecoderId,
+        XAImageCodecDescriptor * pDescriptor
+    );
+    XAresult (*QueryColorFormats) (
+        const XAImageDecoderCapabilitiesItf self,
+        XAuint32 * pIndex,
+        XAuint32 * pColorFormat
+    );
+};
+
+XA_API extern const XAInterfaceID XA_IID_IMAGEENCODER;
+
+struct XAImageEncoderItf_;
+typedef const struct XAImageEncoderItf_ * const * XAImageEncoderItf;
+
+struct XAImageEncoderItf_ {
+    XAresult (*SetImageSettings) (
+        XAImageEncoderItf self,
+        const XAImageSettings * pSettings
+    );
+    XAresult (*GetImageSettings) (
+        XAImageEncoderItf self,
+        XAImageSettings * pSettings
+    );
+    XAresult (*GetSizeEstimate) (
+        XAImageEncoderItf self,
+        XAuint32 * pSize
+    );
+};
+
+/* VIDEO ENCODER AND VIDEO ENCODER/DECODER CAPABILITIES */
+
+#define XA_VIDEOCODEC_MPEG2                     ((XAuint32) 0x00000001)
+#define XA_VIDEOCODEC_H263                      ((XAuint32) 0x00000002)
+#define XA_VIDEOCODEC_MPEG4                     ((XAuint32) 0x00000003)
+#define XA_VIDEOCODEC_AVC                       ((XAuint32) 0x00000004)
+#define XA_VIDEOCODEC_VC1                       ((XAuint32) 0x00000005)
+
+#define XA_VIDEOPROFILE_MPEG2_SIMPLE            ((XAuint32) 0x00000001)
+#define XA_VIDEOPROFILE_MPEG2_MAIN              ((XAuint32) 0x00000002)
+#define XA_VIDEOPROFILE_MPEG2_422               ((XAuint32) 0x00000003)
+#define XA_VIDEOPROFILE_MPEG2_SNR               ((XAuint32) 0x00000004)
+#define XA_VIDEOPROFILE_MPEG2_SPATIAL           ((XAuint32) 0x00000005)
+#define XA_VIDEOPROFILE_MPEG2_HIGH              ((XAuint32) 0x00000006)
+
+#define XA_VIDEOLEVEL_MPEG2_LL                  ((XAuint32) 0x00000001)
+#define XA_VIDEOLEVEL_MPEG2_ML                  ((XAuint32) 0x00000002)
+#define XA_VIDEOLEVEL_MPEG2_H14                 ((XAuint32) 0x00000003)
+#define XA_VIDEOLEVEL_MPEG2_HL                  ((XAuint32) 0x00000004)
+
+#define XA_VIDEOPROFILE_H263_BASELINE           ((XAuint32) 0x00000001)
+#define XA_VIDEOPROFILE_H263_H320CODING         ((XAuint32) 0x00000002)
+#define XA_VIDEOPROFILE_H263_BACKWARDCOMPATIBLE ((XAuint32) 0x00000003)
+#define XA_VIDEOPROFILE_H263_ISWV2              ((XAuint32) 0x00000004)
+#define XA_VIDEOPROFILE_H263_ISWV3              ((XAuint32) 0x00000005)
+#define XA_VIDEOPROFILE_H263_HIGHCOMPRESSION    ((XAuint32) 0x00000006)
+#define XA_VIDEOPROFILE_H263_INTERNET           ((XAuint32) 0x00000007)
+#define XA_VIDEOPROFILE_H263_INTERLACE          ((XAuint32) 0x00000008)
+#define XA_VIDEOPROFILE_H263_HIGHLATENCY        ((XAuint32) 0x00000009)
+
+#define XA_VIDEOLEVEL_H263_10                   ((XAuint32) 0x00000001)
+#define XA_VIDEOLEVEL_H263_20                   ((XAuint32) 0x00000002)
+#define XA_VIDEOLEVEL_H263_30                   ((XAuint32) 0x00000003)
+#define XA_VIDEOLEVEL_H263_40                   ((XAuint32) 0x00000004)
+#define XA_VIDEOLEVEL_H263_45                   ((XAuint32) 0x00000005)
+#define XA_VIDEOLEVEL_H263_50                   ((XAuint32) 0x00000006)
+#define XA_VIDEOLEVEL_H263_60                   ((XAuint32) 0x00000007)
+#define XA_VIDEOLEVEL_H263_70                   ((XAuint32) 0x00000008)
+
+#define XA_VIDEOPROFILE_MPEG4_SIMPLE            ((XAuint32) 0x00000001)
+#define XA_VIDEOPROFILE_MPEG4_SIMPLESCALABLE    ((XAuint32) 0x00000002)
+#define XA_VIDEOPROFILE_MPEG4_CORE              ((XAuint32) 0x00000003)
+#define XA_VIDEOPROFILE_MPEG4_MAIN              ((XAuint32) 0x00000004)
+#define XA_VIDEOPROFILE_MPEG4_NBIT              ((XAuint32) 0x00000005)
+#define XA_VIDEOPROFILE_MPEG4_SCALABLETEXTURE   ((XAuint32) 0x00000006)
+#define XA_VIDEOPROFILE_MPEG4_SIMPLEFACE        ((XAuint32) 0x00000007)
+#define XA_VIDEOPROFILE_MPEG4_SIMPLEFBA         ((XAuint32) 0x00000008)
+#define XA_VIDEOPROFILE_MPEG4_BASICANIMATED     ((XAuint32) 0x00000009)
+#define XA_VIDEOPROFILE_MPEG4_HYBRID            ((XAuint32) 0x0000000A)
+#define XA_VIDEOPROFILE_MPEG4_ADVANCEDREALTIME  ((XAuint32) 0x0000000B)
+#define XA_VIDEOPROFILE_MPEG4_CORESCALABLE      ((XAuint32) 0x0000000C)
+#define XA_VIDEOPROFILE_MPEG4_ADVANCEDCODING    ((XAuint32) 0x0000000D)
+#define XA_VIDEOPROFILE_MPEG4_ADVANCEDCORE      ((XAuint32) 0x0000000E)
+#define XA_VIDEOPROFILE_MPEG4_ADVANCEDSCALABLE  ((XAuint32) 0x0000000F)
+
+#define XA_VIDEOLEVEL_MPEG4_0                   ((XAuint32) 0x00000001)
+#define XA_VIDEOLEVEL_MPEG4_0b                  ((XAuint32) 0x00000002)
+#define XA_VIDEOLEVEL_MPEG4_1                   ((XAuint32) 0x00000003)
+#define XA_VIDEOLEVEL_MPEG4_2                   ((XAuint32) 0x00000004)
+#define XA_VIDEOLEVEL_MPEG4_3                   ((XAuint32) 0x00000005)
+#define XA_VIDEOLEVEL_MPEG4_4                   ((XAuint32) 0x00000006)
+#define XA_VIDEOLEVEL_MPEG4_4a                  ((XAuint32) 0x00000007)
+#define XA_VIDEOLEVEL_MPEG4_5                   ((XAuint32) 0x00000008)
+
+#define XA_VIDEOPROFILE_AVC_BASELINE            ((XAuint32) 0x00000001)
+#define XA_VIDEOPROFILE_AVC_MAIN                ((XAuint32) 0x00000002)
+#define XA_VIDEOPROFILE_AVC_EXTENDED            ((XAuint32) 0x00000003)
+#define XA_VIDEOPROFILE_AVC_HIGH                ((XAuint32) 0x00000004)
+#define XA_VIDEOPROFILE_AVC_HIGH10              ((XAuint32) 0x00000005)
+#define XA_VIDEOPROFILE_AVC_HIGH422             ((XAuint32) 0x00000006)
+#define XA_VIDEOPROFILE_AVC_HIGH444             ((XAuint32) 0x00000007)
+
+#define XA_VIDEOLEVEL_AVC_1                     ((XAuint32) 0x00000001)
+#define XA_VIDEOLEVEL_AVC_1B                    ((XAuint32) 0x00000002)
+#define XA_VIDEOLEVEL_AVC_11                    ((XAuint32) 0x00000003)
+#define XA_VIDEOLEVEL_AVC_12                    ((XAuint32) 0x00000004)
+#define XA_VIDEOLEVEL_AVC_13                    ((XAuint32) 0x00000005)
+#define XA_VIDEOLEVEL_AVC_2                     ((XAuint32) 0x00000006)
+#define XA_VIDEOLEVEL_AVC_21                    ((XAuint32) 0x00000007)
+#define XA_VIDEOLEVEL_AVC_22                    ((XAuint32) 0x00000008)
+#define XA_VIDEOLEVEL_AVC_3                     ((XAuint32) 0x00000009)
+#define XA_VIDEOLEVEL_AVC_31                    ((XAuint32) 0x0000000A)
+#define XA_VIDEOLEVEL_AVC_32                    ((XAuint32) 0x0000000B)
+#define XA_VIDEOLEVEL_AVC_4                     ((XAuint32) 0x0000000C)
+#define XA_VIDEOLEVEL_AVC_41                    ((XAuint32) 0x0000000D)
+#define XA_VIDEOLEVEL_AVC_42                    ((XAuint32) 0x0000000E)
+#define XA_VIDEOLEVEL_AVC_5                     ((XAuint32) 0x0000000F)
+#define XA_VIDEOLEVEL_AVC_51                    ((XAuint32) 0x00000010)
+
+#define XA_VIDEOLEVEL_VC1_SIMPLE                ((XAuint32) 0x00000001)
+#define XA_VIDEOLEVEL_VC1_MAIN                  ((XAuint32) 0x00000002)
+#define XA_VIDEOLEVEL_VC1_ADVANCED              ((XAuint32) 0x00000003)
+
+#define XA_VIDEOLEVEL_VC1_LOW                   ((XAuint32) 0x00000001)
+#define XA_VIDEOLEVEL_VC1_MEDIUM                ((XAuint32) 0x00000002)
+#define XA_VIDEOLEVEL_VC1_HIGH                  ((XAuint32) 0x00000003)
+#define XA_VIDEOLEVEL_VC1_L0                    ((XAuint32) 0x00000004)
+#define XA_VIDEOLEVEL_VC1_L1                    ((XAuint32) 0x00000005)
+#define XA_VIDEOLEVEL_VC1_L2                    ((XAuint32) 0x00000006)
+#define XA_VIDEOLEVEL_VC1_L3                    ((XAuint32) 0x00000007)
+#define XA_VIDEOLEVEL_VC1_L4                    ((XAuint32) 0x00000008)
+
+typedef struct XAVideoCodecDescriptor_ {
+    XAuint32 codecId;
+    XAuint32 maxWidth;
+    XAuint32 maxHeight;
+    XAuint32 maxFrameRate;
+    XAuint32 maxBitRate;
+    XAuint32 rateControlSupported;
+    XAuint32 profileSetting;
+    XAuint32 levelSetting;
+} XAVideoCodecDescriptor;
+
+typedef struct XAVideoSettings_ {
+    XAuint32 encoderId;
+    XAuint32 width;
+    XAuint32 height;
+    XAuint32 frameRate;
+    XAuint32 bitRate;
+    XAuint32 rateControl;
+    XAuint32 profileSetting;
+    XAuint32 levelSetting;
+    XAuint32 keyFrameInterval;
+} XAVideoSettings;
+
+XA_API extern const XAInterfaceID XA_IID_VIDEODECODERCAPABILITIES;
+
+struct XAVideoDecoderCapabilitiesItf_;
+typedef const struct XAVideoDecoderCapabilitiesItf_
+    * const * XAVideoDecoderCapabilitiesItf;
+
+struct XAVideoDecoderCapabilitiesItf_ {
+    XAresult (*GetVideoDecoders) (
+        XAVideoDecoderCapabilitiesItf self,
+        XAuint32 * pNumDecoders,
+        XAuint32 * pDecoderIds
+    );
+    XAresult (*GetVideoDecoderCapabilities) (
+        XAVideoDecoderCapabilitiesItf self,
+        XAuint32 decoderId,
+        XAuint32 * pIndex,
+        XAVideoCodecDescriptor * pDescriptor
+    );
+};
+
+XA_API extern const XAInterfaceID XA_IID_VIDEOENCODER;
+
+XA_API extern const XAInterfaceID XA_IID_VIDEOENCODERCAPABILITIES;
+
+struct XAVideoEncoderCapabilitiesItf_;
+typedef const struct XAVideoEncoderCapabilitiesItf_
+    * const * XAVideoEncoderCapabilitiesItf;
+
+struct XAVideoEncoderCapabilitiesItf_ {
+    XAresult (*GetVideoEncoders) (
+        XAVideoEncoderCapabilitiesItf self,
+        XAuint32 * pNumEncoders,
+        XAuint32 * pEncoderIds
+    );
+    XAresult (*GetVideoEncoderCapabilities) (
+        XAVideoEncoderCapabilitiesItf self,
+        XAuint32 encoderId,
+        XAuint32 * pIndex,
+        XAVideoCodecDescriptor * pDescriptor
+    );
+};
+
+struct XAVideoEncoderItf_;
+typedef const struct XAVideoEncoderItf_ * const * XAVideoEncoderItf;
+
+struct XAVideoEncoderItf_ {
+    XAresult (*SetVideoSettings) (
+        XAVideoEncoderItf self,
+        XAVideoSettings * pSettings
+    );
+    XAresult (*GetVideoSettings) (
+        XAVideoEncoderItf self,
+        XAVideoSettings * pSettings
+    );
+};
+
+/* STREAM INFORMATION */
+
+#define XA_DOMAINTYPE_AUDIO     0x00000001
+#define XA_DOMAINTYPE_VIDEO     0x00000002
+#define XA_DOMAINTYPE_IMAGE     0x00000003
+#define XA_DOMAINTYPE_TIMEDTEXT 0x00000004
+#define XA_DOMAINTYPE_MIDI      0x00000005
+#define XA_DOMAINTYPE_VENDOR    0xFFFFFFFE
+#define XA_DOMAINTYPE_UNKNOWN   0xFFFFFFFF
+
+#define XA_MIDIBANK_DEVICE      0x00000001
+#define XA_MIDIBANK_CUSTOM      0x00000002
+
+#define XA_MIDI_UNKNOWN         0xFFFFFFFF
+
+#define XA_STREAMCBEVENT_PROPERTYCHANGE     ((XAuint32) 0x00000001)
+
+typedef struct XAMediaContainerInformation_ {
+    XAuint32 containerType;
+    XAmillisecond mediaDuration;
+    XAuint32 numStreams;
+} XAMediaContainerInformation;
+
+typedef struct XAVideoStreamInformation_ {
+    XAuint32 codecId;
+    XAuint32 width;
+    XAuint32 height;
+    XAuint32 frameRate;
+    XAuint32 bitRate;
+    XAmillisecond duration;
+} XAVideoStreamInformation;
+
+typedef struct XAAudioStreamInformation_ {
+    XAuint32 codecId;
+    XAuint32 channels;
+    XAmilliHertz sampleRate;
+    XAuint32 bitRate;
+    XAchar langCountry[16];
+    XAmillisecond duration;
+} XAAudioStreamInformation;
+
+typedef struct XAImageStreamInformation_ {
+    XAuint32 codecId;
+    XAuint32 width;
+    XAuint32 height;
+    XAmillisecond presentationDuration;
+} XAImageStreamInformation;
+
+typedef struct XATimedTextStreamInformation_ {
+    XAuint16 layer;
+    XAuint32 width;
+    XAuint32 height;
+    XAuint16 tx;
+    XAuint16 ty;
+    XAuint32 bitrate;
+    XAchar langCountry[16];
+    XAmillisecond duration;
+} XATimedTextStreamInformation;
+
+typedef struct XAMIDIStreamInformation_ {
+    XAuint32 channels;
+    XAuint32 tracks;
+    XAuint32 bankType;
+    XAchar langCountry[16];
+    XAmillisecond duration;
+} XAMIDIStreamInformation;
+
+typedef struct XAVendorStreamInformation_ {
+    void *VendorStreamInfo;
+} XAVendorStreamInformation;
+
+XA_API extern const XAInterfaceID XA_IID_STREAMINFORMATION;
+
+struct XAStreamInformationItf_;
+typedef const struct XAStreamInformationItf_ * const * XAStreamInformationItf;
+
+typedef void (XAAPIENTRY * xaStreamEventChangeCallback) (
+    XAStreamInformationItf caller,
+    XAuint32 eventId,
+    XAuint32 streamIndex,
+    void * pEventData,
+    void * pContext
+);
+
+struct XAStreamInformationItf_ {
+    XAresult (*QueryMediaContainerInformation) (
+        XAStreamInformationItf self,
+        XAMediaContainerInformation * info
+    );
+    XAresult (*QueryStreamType) (
+        XAStreamInformationItf self,
+        XAuint32 streamIndex,
+        XAuint32 *domain
+    );
+    XAresult (*QueryStreamInformation) (
+        XAStreamInformationItf self,
+        XAuint32 streamIndex,
+        void * info
+    );
+    XAresult (*QueryStreamName) (
+        XAStreamInformationItf self,
+        XAuint32 streamIndex,
+        XAuint16 * pNameSize,
+        XAchar * pName
+    );
+    XAresult (*RegisterStreamChangeCallback) (
+        XAStreamInformationItf self,
+        xaStreamEventChangeCallback callback,
+        void * pContext
+    );
+    XAresult (*QueryActiveStreams) (
+        XAStreamInformationItf self,
+        XAuint32 *numStreams,
+        XAboolean *activeStreams
+    );
+    XAresult (*SetActiveStream) (
+        XAStreamInformationItf self,
+        XAuint32   streamNum,
+        XAboolean  active,
+        XAboolean  commitNow
+    );
+};
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* _OPENMAXAL_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/inc/OpenMAXAL_Platform.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007-2010 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and/or associated documentation files (the
+ * "Materials "), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to 
+ * the following conditions: 
+ *
+ * The above copyright notice and this permission notice shall be included 
+ * in all copies or substantial portions of the Materials. 
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ *
+ * OpenMAXAL_Platform.h - OpenMAX AL version 1.0.1
+ *
+ */
+
+/****************************************************************************/
+/* NOTE: This file contains definitions for the base types and the          */
+/* XAAPIENTRY macro. This file **WILL NEED TO BE EDITED** to provide        */
+/* the correct definitions specific to the platform being used.             */
+/****************************************************************************/
+
+#ifndef _OPENMAXAL_PLATFORM_H_
+#define _OPENMAXAL_PLATFORM_H_
+
+typedef unsigned char               xa_uint8_t;
+typedef signed char                 xa_int8_t;
+typedef unsigned short              xa_uint16_t;
+typedef signed short                xa_int16_t;
+typedef unsigned long               xa_uint32_t;
+typedef signed long                 xa_int32_t;
+typedef unsigned long long          xa_uint64_t;
+
+#ifndef XAAPIENTRY
+#define XAAPIENTRY                 /* override per-platform */
+#endif
+
+/** The XA_API is platform specific definition used
+ *  to declare OMX function prototypes.  They are modified to meet the
+ *  requirements for a particular platform */
+#ifdef __SYMBIAN32__   
+#   define XA_API __declspec(dllimport) 
+#endif
+
+#endif /* _OPENMAXAL_PLATFORM_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/openmax_al_api.metaxml	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="45c92b615dd278c2bd3747727ec92434" dataversion="2.0">
+  <name>OpenMAX AL API</name>
+  <description>OpenMAX AL is a standard cross platform API for capturing and/or rendering audio, video, and images on embedded and mobile devices. http://www.khronos.org/openmax/.
+The current AL implementation not a complete implementation and it is not compliant to Khronos OpenMAX AL API v1.0.1 specification.</description>
+  <type>c</type>
+  <collection>khronosfws</collection>
+  <libs>
+    <lib name="openmaxal.lib"/>
+  </libs>
+  <release category="platform" sinceversion="0"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/readme.txt	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* 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: 
+*
+*/
+
+
+The partial implementation of the Khronos OpenMAX AL API in this distribution has implemented the following features:
+
+* Audio recording
+
+As such, it is NOT a *conformant* OpenMAX AL implementation, as defined by Khronos. That is, it has NOT passed the OpenMAX AL conformance tests. It is to be noted however, that Nokia has signed the Adopter's Agreement and paid the requisite adopter fees for OpenMAX AL v1.0. It is our intention to apply for conformance once we have a complete OpenMAX AL implementation in either the Media Player or Media Player/Recorder profiles.
+
+For now, Nokia has gone ahead with distribution of this partial implementation to facilitate use of this implementation by Symbian Foundation members for evaluation/prototyping purposes. Nokia will be adding to this partial implementation in the coming months, as more and more parts of OpenMAX AL are implemented. Our objective is to eventually have a fully conformant implementation of OpenMAX AL as part of the Symbian Foundation code base. 
+
+
+Useful Links:
+* Khronos Consortium: http://www.khronos.org
+* Khronos FAQ for API Adopters: http://www.khronos.org/faq/category/C80
+* OpenMAX AL: http://www.khronos.org/openmax
--- a/mmmw_plat/radio_preset_utilities_api/group/bld.inf	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/radio_preset_utilities_api/group/bld.inf	Fri Apr 16 15:29:42 2010 +0300
@@ -26,3 +26,6 @@
 
 ../inc/RadioFmPresetUtility.h     MW_LAYER_PLATFORM_EXPORT_PATH(RadioFmPresetUtility.h)
 ../inc/RadioPresetUtility.h     MW_LAYER_PLATFORM_EXPORT_PATH(RadioPresetUtility.h)
+../inc/preset.h     MW_LAYER_PLATFORM_EXPORT_PATH(preset.h)
+../inc/presetutility.h     MW_LAYER_PLATFORM_EXPORT_PATH(presetutility.h)
+../inc/presetutilityobserver.h     MW_LAYER_PLATFORM_EXPORT_PATH(presetutilityobserver.h)
\ No newline at end of file
--- a/mmmw_plat/radio_preset_utilities_api/inc/RadioFmPresetUtility.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/radio_preset_utilities_api/inc/RadioFmPresetUtility.h	Fri Apr 16 15:29:42 2010 +0300
@@ -22,9 +22,13 @@
 #ifndef C_RADIOFMPRESETUTILITY_H
 #define C_RADIOFMPRESETUTILITY_H
 
+#warning This file is deprecated and will be removed in future releases. Please use the new API
+
 #include <RadioPresetUtility.h>
+#include <presetutilityobserver.h>
 #include <e32base.h>
 
+class CPresetUtilityBody;
 
 /**
  *  This class provides an interface for controlling the preset for an FM tuner.
@@ -36,7 +40,8 @@
  */
 class CRadioFmPresetUtility : public CBase,
                               public MRadioPreset,
-                              public MRadioFmPreset
+                              public MRadioFmPreset,
+                              private MPresetUtilityObserver
     {
 public:
 
@@ -283,21 +288,42 @@
      */
     IMPORT_C void DeletePresetL( TInt aIndex );
 
+
 private:
 
+    // from base class MPresetUtilityObserver
+    /**
+    * From MPresetUtilityObserver
+    * Called when a preset changes.
+    *
+    * NOTE: EPresetDeleted with aIndex == 0, indicates that all presets have been deleted.
+    *
+    * @since S60 10.1
+    * @param aChange Change event type
+    * @param aIndex Index to the preset that has changed. Zero means all presets.
+    */
+    virtual void PresetChanged( TPresetChangeEvent aChange, TInt aIndex );
+
     CRadioFmPresetUtility( MRadioPresetObserver& aObserver );
 
     void ConstructL();
 
 private: // data
 
-    class CBody;
+    class CBody; // Dummy body that exists only for BC compatibility purposes
 
     /**
      * Preset utility implementation body
      * Own.
      */
-    CBody* iBody;
+    CPresetUtilityBody* iBody;
+    
+    /**
+     * Old observer
+     * Not owned.
+     */
+    MRadioPresetObserver& iObserver;
+    
     };
 
 #endif // C_RADIOFMPRESETUTILITY_H
--- a/mmmw_plat/radio_preset_utilities_api/inc/RadioPresetUtility.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/radio_preset_utilities_api/inc/RadioPresetUtility.h	Fri Apr 16 15:29:42 2010 +0300
@@ -24,6 +24,10 @@
 #define M_RADIOPRESETUTILITY_H
 
 #include <e32std.h>
+#include <presetutilityobserver.h>
+
+
+#warning This file is deprecated and will be removed in future releases. Please use the new API
 
 /** Preset name, 32 characters */
 typedef TBuf<32> TFmPresetName;
@@ -31,7 +35,6 @@
 typedef TBuf<64> TFmPresetUrl;
 
 
-
 /**
  *  This class provides the interface class to be implemented by object receiving events
  *  from preset control.
@@ -46,9 +49,9 @@
     /**  Preset event */
     enum TPresetChangeEvent
         {
-        EPresetAdded,
-        EPresetDeleted,
-        EPresetUpdated
+        EPresetAdded = MPresetUtilityObserver::EPresetAdded,
+        EPresetDeleted = MPresetUtilityObserver::EPresetDeleted,
+        EPresetUpdated = MPresetUtilityObserver::EPresetUpdated
         };
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/radio_preset_utilities_api/inc/preset.h	Fri Apr 16 15:29:42 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:  Preset base class.
+*
+*
+*/
+
+
+#ifndef TPRESET_H
+#define TPRESET_H
+
+#include <e32std.h>
+#include <babitflags.h>         // For TBitFlags
+
+// Forward declarations
+class RWriteStream;
+class RReadStream;
+
+const int KPresetNameLength = 32;
+typedef TBuf<KPresetNameLength> TPresetName;
+const int KUrlMaxLength = 50;
+typedef TBuf<KUrlMaxLength> TRadioUrl;
+
+/**
+ *  define preset structure.
+ */
+class TPreset
+    {
+public:
+
+    /**
+    * Default class constructor.
+    */
+    IMPORT_C TPreset();
+
+    /**
+    * Gives the preset name.
+    * @since Series 60 10.1
+    * @return the name of the preset
+    */
+    IMPORT_C TPtrC Name() const;
+
+    /**
+    * Gives the preset frequency
+    * @since Series 60 10.1
+    * @return the frequency
+    */
+    IMPORT_C TUint Frequency() const;
+
+    /**
+    * Set name.
+    * @since Series 60 10.1
+    * @param aStationName The name to be set.
+    * @return none
+    */
+    IMPORT_C void SetName( const TPresetName& aStationName );
+
+    /**
+    * Set the frequency value.
+    * @since Series 60 10.1
+    * @param aFrequency  The frequency to be set
+    */
+    IMPORT_C void SetFrequency( const TUint aFrequency );
+
+    /**
+    * Set URL.
+    * @since Series 60 10.1
+    * @param aStationName The URL to be set.
+    * @return none
+    */
+    IMPORT_C void SetUrl( const TRadioUrl& aUrl );
+
+    /**
+    * Get the URL.
+    * @since Series 60 10.1
+    * @return the URL
+    */
+    IMPORT_C TPtrC Url() const;
+
+    /**
+    * Set the Favorite status.
+    * @since Series 60 10.1
+    * @param aFavorite -  Favorite status.
+    * @return none
+    */
+    IMPORT_C void SetFavorite( TBool aFavorite );
+
+    /**
+    * Get the Favorite status.
+    * @since Series 60 10.1
+    * @return TBool ETrue if favorite, otherwise EFalse
+    */
+    IMPORT_C TBool Favorite() const;
+
+    /**
+    * Set the Local Station status.
+    * @since Series 60 10.1
+    * @param aLocalStation -  Local Station status.
+    * @return none
+    */
+    IMPORT_C void SetLocalStation( TBool aLocalStation );
+
+    /**
+    * Get the local station status.
+    * @since Series 60 10.1
+    * @return TBool ETrue if local station, otherwise EFalse
+    */
+    IMPORT_C TBool LocalStation() const;
+
+    /**
+    * Set the Set By User status.
+    * @since Series 60 10.1
+    * @param aRenamed -  Set By User status.
+    * @return none
+    */
+    IMPORT_C void SetRenamedByUser( TBool aRenamed );
+
+    /**
+    * Get the renamed by user status.
+    * @since Series 60 10.1
+    * @return TBool ETrue if renamed by user, otherwise EFalse
+    */
+    IMPORT_C TBool RenamedByUser() const;
+
+    /**
+    * Set PTY.
+    * @since Series 60 10.1
+    * @param aGenre The PTY to be set.
+    * @return none
+    */
+    IMPORT_C void SetGenre( TInt aGenre );
+
+    /**
+    * Get the PTY.
+    * @since Series 60 10.1
+    * @return the PTY
+    */
+    IMPORT_C TInt Genre() const;
+
+    /**
+    * Set PI.
+    * @since Series 60 10.1
+    * @param aGenre The PI to be set.
+    * @return none
+    */
+    IMPORT_C void SetPiCode( TInt aPiCode );
+
+    /**
+    * Get the PI.
+    * @since Series 60 10.1
+    * @return the PI
+    */
+    IMPORT_C TInt PiCode() const;
+
+    /**
+    * Externalize (ie. serialize) data.
+    * @param aStream -  Stream to where to serialize.
+    * @return none
+    */           
+    IMPORT_C virtual void ExternalizeL( RWriteStream & aStream ) const;
+
+    /**
+    * Internalize data.
+    * @param aStream -  Stream from where to internalize.
+    * @return none
+    */           
+    IMPORT_C virtual void InternalizeL( RReadStream& aStream );
+
+    /**
+    * Get the size (in bytes) of my externalized data.
+    * @since Series 60 10.1
+    * @return The size (in bytes) of my externalized data.
+    */
+   IMPORT_C virtual TUint MyExternalizedDataSize() const; 
+    
+private: // data
+
+    // Preset's name
+    TPresetName     iPresetName;
+
+    // Preset's frequency
+    TUint           iPresetFrequency;
+
+    // Preset's URL
+    TRadioUrl       iUrl;
+
+    // Program Type
+    TInt                iGenre;
+    // Program Identification
+    TInt                iPiCode;
+    // Bitwise flags
+    TBitFlags           iFlags;
+
+    };
+
+#endif // TPRESET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/radio_preset_utilities_api/inc/presetutility.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,136 @@
+/*
+* 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 class provides an interface for monitoring radio
+*               presets.
+*
+*
+*/
+
+#ifndef CPRESETUTILITY_H_
+#define CPRESETUTILITY_H_
+
+#include <e32base.h>
+
+class MPresetUtilityObserver;
+class TPreset;
+
+/**
+ *  This class provides an interface for controlling the presets for a radio tuner.
+ *  The maximum number of presets supported by this utility is pre-defined and the
+ *  client must first query it.
+ *
+ *  NOTE! The preset indexes start from 1
+ */
+NONSHARABLE_CLASS( CPresetUtility ) : public CBase
+    {
+public:
+
+    /**
+     * Factory function to create a new instance of the Preset Utility.
+     *
+     * @since S60 10.1
+     * @return A new Preset Utility object.
+     */
+    IMPORT_C static CPresetUtility* NewL();
+
+    IMPORT_C ~CPresetUtility();
+
+    /**
+     * Set the Radio Preset's observer pointer.
+     *
+     * @since S60 10.1
+     */
+    virtual void SetObserver( MPresetUtilityObserver* aObserver ) = 0;
+
+    /**
+     * Get the maximum number of presets supported by this utility.
+     * The numbering of presets starts from 1 and the largest preset number equals the value
+     * returned from this function.
+     *
+     * @since S60 10.1
+     * @return The maximum number of presets.
+     */
+    virtual TInt MaxNumberOfPresets() const = 0;
+
+    /**
+     * Get the number of presets already set by the client (i.e. contains data).
+     *
+     * @since S60 10.1
+     * @return The current number of presets, possible values from 1 to maximum
+     * number of presets.
+     */
+    virtual TInt PresetCount() const = 0;
+
+    /**
+     * Get the first preset index that has been set.
+     * Leaves with KErrNone if no preset exists.
+     *
+     * @since S60 10.1
+     * @return The index of first preset, possible values from 1 to maximum
+     * number of presets.
+     */
+    virtual TInt FirstPreset() const = 0;
+
+    /**
+     * Get the next preset index that has been set, given the current index.
+     * Returns -1 if no other preset exists.
+     *
+     * @since S60 10.1
+     * @param aFromIndex Current preset index.
+     * @return The index of next preset. -1 if no other preset exists.
+     * Otherwise possible values from 1 to maximum number of presets.
+     */
+    virtual TInt NextPreset( TInt aFromIndex ) const = 0;
+
+    /**
+     * Delete the specified preset.
+     * Has no effect if specified index contains no preset.
+     *
+     * NOTE: Specifying aIndex <= 0, will delete all presets.
+     *
+     * @since S60 10.1
+     * @param aIndex A preset index. If aIndex == -1, will delete all. 
+     * Otherwise legal values all used indexes from 0 to (maximum - 1)
+     * number of presets.
+     * @return A standard system error code.
+     */
+    virtual TInt DeletePreset( TInt aIndex ) = 0;
+
+    /**
+     * Save the given preset. Previous content in the specified index
+     * will be overwritten with the new information.
+     *
+     * @since S60 10.1
+     * @param aPreset Object containing all information of the preset.
+     * @param aIndex A preset index. Default value -1 means that a free index
+     * is allocated for the preset. Otherwise legal values from 0 to 
+     * (maximum - 1)number of presets.
+     * @return Given/Allocated index of the preset. Possible values from 1 to
+     * maximum number of presets.
+     */
+    virtual TInt SavePresetL( const TPreset& aPreset, TInt aIndex = -1 ) = 0;
+
+    /**
+     * Read the preset at the specified index.
+     * Leaves with KErrNotFound if invalid index is specified.
+     *
+     * @since S60 10.1
+     * @param aIndex A preset index. Legal values from 0 to (maximum - 1) number of presets.
+     * @param aPreset On return, this object is updated with given preset's information.
+     */
+    virtual void ReadPresetL( TInt aIndex, TPreset& aPreset ) = 0;
+
+    };
+
+#endif // CPRESETUTILITY_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/radio_preset_utilities_api/inc/presetutilityobserver.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* 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 class provides the interface class to be implemented by object
+*               receiving events from preset control.
+*
+*
+*/
+
+#ifndef MPRESETUTILITYOBSERVER_H_
+#define MPRESETUTILITYOBSERVER_H_
+
+/**
+ *  This class provides the interface class to be implemented by object receiving events
+ *  from preset control.
+ */
+NONSHARABLE_CLASS( MPresetUtilityObserver )
+    {
+public:
+
+    /**  Preset event */
+    enum TPresetChangeEvent
+        {
+        EPresetAdded,
+        EPresetDeleted,
+        EPresetUpdated
+        };
+
+    /**
+     * Called when a preset changes.
+     *
+     * NOTE: EPresetDeleted with aIndex == -1 (or < 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. aIndex == -1 means all presets.
+     */
+    virtual void PresetChanged( TPresetChangeEvent aChange, TInt aIndex ) = 0;
+
+    };
+
+#endif // MPRESETUTILITYOBSERVER_H_
--- a/mmmw_plat/radio_preset_utilities_api/radio_preset_utilities_api.metaxml	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/radio_preset_utilities_api/radio_preset_utilities_api.metaxml	Fri Apr 16 15:29:42 2010 +0300
@@ -1,18 +1,19 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="e75020a4654d3fa30e533cf100bb65ca" dataversion="2.0">
   <name>Radio Preset Utilities API</name>
   <description>An API for applications to access radio preset functionality.</description>
   <type>c++</type>
   <collection>radioutility</collection>
   <libs>
-    <lib name="FmPresetUtility.lib" />
+    <lib name="FmPresetUtility.lib"/>
+    <lib name="presetutility.lib"/>
   </libs>
-  <release category="platform"/>
+  <release category="platform" sinceversion=""/>
   <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
+    <!-- This indicates wether the api provedes separate html documentation -->
+    <!-- or is the additional documentation generated from headers. -->
+    <!-- If you are unsuere then the value is "no" -->
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
   </attributes>
 </api>
--- a/mmmw_plat/telephony_multimedia_service_api/group/bld.inf	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/telephony_multimedia_service_api/group/bld.inf	Fri Apr 16 15:29:42 2010 +0300
@@ -30,6 +30,8 @@
 ../inc/tmsclientsinkobsrvr.h    MW_LAYER_PLATFORM_EXPORT_PATH(tmsclientsinkobsrvr.h)
 ../inc/tmsclientsource.h        MW_LAYER_PLATFORM_EXPORT_PATH(tmsclientsource.h)
 ../inc/tmsclientsourceobsrvr.h  MW_LAYER_PLATFORM_EXPORT_PATH(tmsclientsourceobsrvr.h)
+../inc/tmsdtmf.h                MW_LAYER_PLATFORM_EXPORT_PATH(tmsdtmf.h)
+../inc/tmsdtmfobsrvr.h          MW_LAYER_PLATFORM_EXPORT_PATH(tmsdtmfobsrvr.h)
 ../inc/tmseffect.h              MW_LAYER_PLATFORM_EXPORT_PATH(tmseffect.h)
 ../inc/tmseffectobsrvr.h        MW_LAYER_PLATFORM_EXPORT_PATH(tmseffectobsrvr.h)
 ../inc/tmsfactory.h             MW_LAYER_PLATFORM_EXPORT_PATH(tmsfactory.h)
@@ -43,6 +45,8 @@
 ../inc/tmsglobalvoleffect.h     MW_LAYER_PLATFORM_EXPORT_PATH(tmsglobalvoleffect.h)
 ../inc/tmsilbcformat.h          MW_LAYER_PLATFORM_EXPORT_PATH(tmsilbcformat.h)
 ../inc/tmspcmformat.h           MW_LAYER_PLATFORM_EXPORT_PATH(tmspcmformat.h)
+../inc/tmsringtone.h            MW_LAYER_PLATFORM_EXPORT_PATH(tmsringtone.h)
+../inc/tmsringtoneobsrvr.h      MW_LAYER_PLATFORM_EXPORT_PATH(tmsringtoneobsrvr.h)
 ../inc/tmssink.h                MW_LAYER_PLATFORM_EXPORT_PATH(tmssink.h)
 ../inc/tmssource.h              MW_LAYER_PLATFORM_EXPORT_PATH(tmssource.h)
 ../inc/tmsstream.h              MW_LAYER_PLATFORM_EXPORT_PATH(tmsstream.h)
@@ -52,4 +56,6 @@
 ../inc/tmsmodemsink.h           MW_LAYER_PLATFORM_EXPORT_PATH(tmsmodemsink.h)
 ../inc/tmsmodemsource.h         MW_LAYER_PLATFORM_EXPORT_PATH(tmsmodemsource.h)
 ../inc/tmsspeakersink.h         MW_LAYER_PLATFORM_EXPORT_PATH(tmsspeakersink.h)
+../inc/tmsinbandtone.h          MW_LAYER_PLATFORM_EXPORT_PATH(tmsinbandtone.h)
+../inc/tmsinbandtoneobsrvr.h    MW_LAYER_PLATFORM_EXPORT_PATH(tmsinbandtoneobsrvr.h)
 
--- a/mmmw_plat/telephony_multimedia_service_api/inc/tms.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/telephony_multimedia_service_api/inc/tms.h	Fri Apr 16 15:29:42 2010 +0300
@@ -79,8 +79,11 @@
 #define TMS_EVENT_ROUTING_SET_OUTPUT_COMPLETE   ((gint)0x00000008)
 #define TMS_EVENT_RINGTONE_OPEN_COMPLETE        ((gint)0x00000009)
 #define TMS_EVENT_RINGTONE_PLAY_COMPLETE        ((gint)0x0000000A)
-#define TMS_EVENT_DTMF_TONE_STARTED             ((gint)0x0000000B)
-#define TMS_EVENT_DTMF_TONE_STOPPED             ((gint)0x0000000C)
+#define TMS_EVENT_RINGTONE_DEINIT_COMPLETE      ((gint)0x0000000B)
+#define TMS_EVENT_DTMF_TONE_STARTED             ((gint)0x0000000C)
+#define TMS_EVENT_DTMF_TONE_STOPPED             ((gint)0x0000000D)
+#define TMS_EVENT_INBAND_TONE_STARTED           ((gint)0x0000000E)
+#define TMS_EVENT_INBAND_TONE_STOPPED           ((gint)0x0000000F)
 
 // Stream states
 typedef gint TMSStreamState;
@@ -122,9 +125,17 @@
 #define TMS_FORMAT_G729                         ((gint)16)
 #define TMS_FORMAT_ILBC                         ((gint)17)
 
+typedef gint TMSRingToneType;
+#define TMS_RINGTONE_DEFAULT                    ((gint)0)
+#define TMS_RINGTONE_FILE                       ((gint)1)
+#define TMS_RINGTONE_SEQUENCE                   ((gint)2)
+#define TMS_RINGTONE_BEEP_ONCE                  ((gint)3)
+#define TMS_RINGTONE_SILENT                     ((gint)4)
+#define TMS_RINGTONE_UNSECURE_VOIP              ((gint)5)
+
 typedef gint TMSRTPSessionType;
-#define TMS_SESSION_RTP_PUSH                    ((gint)18)
-#define TMS_SESSION_RTP_PULL                    ((gint)19)
+#define TMS_SESSION_RTP_PULL                    ((gint)0)
+#define TMS_SESSION_RTP_PUSH                    ((gint)1)
 
 // TMS vectors
 typedef std::vector<TMSFormat*> FormatVector;
@@ -147,7 +158,7 @@
 #define TMS_ILBC_CODEC_MODE_20MS_FRAME          ((gint)0)
 #define TMS_ILBC_CODEC_MODE_30MS_FRAME          ((gint)1)
 
-// Oudio output types
+// Audio output types
 typedef gint TMSAudioOutput;
 #define TMS_AUDIO_OUTPUT_NONE                   ((gint)0)
 #define TMS_AUDIO_OUTPUT_PUBLIC                 ((gint)1)
@@ -157,6 +168,20 @@
 #define TMS_AUDIO_OUTPUT_WIRED_ACCESSORY        ((gint)5)
 #define TMS_AUDIO_OUTPUT_ACCESSORY              ((gint)6)
 #define TMS_AUDIO_OUTPUT_ETTY                   ((gint)7)
+#define TMS_AUDIO_OUTPUT_NOT_ACTIVE             ((gint)8)
+
+typedef gint TMSInbandToneType;
+#define TMS_INBAND_USER_BUSY                    ((gint)0)
+#define TMS_INBAND_RADIO_PATH_NOT_AVAIL         ((gint)1)
+#define TMS_INBAND_CONGESTION                   ((gint)2)
+#define TMS_INBAND_SPECIAL_INFO                 ((gint)3)
+#define TMS_INBAND_REORDER                      ((gint)4)
+#define TMS_INBAND_REMOTE_ALEARTING             ((gint)5)
+#define TMS_INBAND_CALL_WAITING                 ((gint)6)
+#define TMS_INBAND_DATA_CALL                    ((gint)7)
+#define TMS_INBAND_NO_SEQUENCE                  ((gint)8)
+#define TMS_INBAND_BEEP_SEQUENCE                ((gint)9)
+
 
 // TMSSignalEvent structure for callback notifications
 struct TMSSignalEvent
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsdtmf.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,144 @@
+/*
+ * 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 TMS_DTMF_H
+#define TMS_DTMF_H
+
+#include <glib.h>
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSDTMFBody;
+class TMSDTMFObserver;
+
+/**
+ * TMSDTMFclass
+*
+* This class provides DTMF playback capability to the TMS clients. Each
+* DTMF player session is associated either with an uplink or downlink stream.
+*
+* @lib tmsapi.lib
+*
+*/
+class TMSDTMF
+    {
+public:
+    /**
+     * Destructor
+     */
+    IMPORT_C virtual ~TMSDTMF();
+
+    /**
+     * Add client as an observer to TMSDTMF events.
+     *
+     * @param  obsrvr
+     *      Observer object to TMSDTMF events.
+     *
+     * @param  user_data
+     *      Any user data passed to the function.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *      TMS_RESULT_ALREADY_EXIST if the obsrvr is already in the list.
+     *
+     */
+    IMPORT_C gint AddObserver(TMSDTMFObserver& obsrvr, gpointer user_data);
+
+    /**
+     * Remove client as an observer to TMSDTMF events.
+     *
+     * @param  obsrvr
+     *      Observer object to TMSDTMF events.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the obsrvr is removed successfully from list.
+     *      TMS_RESULT_DOES_NOT_EXIST if obsrvr is not already in the list.
+     *
+     */
+    IMPORT_C gint RemoveObserver(TMSDTMFObserver& obsrvr);
+
+    /**
+     * Starts DTMF playback. In the case of downlink, the tone will be played
+     * locally. In case of uplink, the network will play tones.
+     *
+     * Common for CS and VOIP (uplink and downlink)
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *
+     */
+    IMPORT_C gint Start();
+
+    /**
+     * Stops DTMF playback.
+     * Common for CS and VOIP (Uplink and Downlink).
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *
+     */
+    IMPORT_C gint Stop();
+
+    /**
+     * Supply DTMF player with a string of tones to be played on local
+     * playback device or sent via the uplink.
+     *
+     * @param  string
+     *      String containing one or more DTMF digits.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *
+     */
+    IMPORT_C gint SetTone(GString* string);
+
+    /**
+     *  Allows a client to continue or cancel the sending of a DTMF string
+     *  when it was stopped by the use of ‘w’ char in the string.
+     *  The client will set sending param to true if it wishes to continue
+     *  the DTMF string sending and will set sending param to false if it
+     *  wishes to discard the rest of the DTMF string.
+     *  Reference: Multimode ETel API Design Document
+     *
+     *  For CS calltype
+     *
+     *  @param  sending
+     *      Boolean to continue sending DTMF string.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *
+     */
+    IMPORT_C gint ContinueDTMFStringSending(gboolean sending);
+
+protected:
+
+    /**
+     * Constructor
+     */
+    IMPORT_C TMSDTMF();
+
+protected:
+    TMSDTMFBody* iBody;
+    };
+
+} //namespace TMS
+
+#endif //__TMS_DTMF_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsdtmfobsrvr.h	Fri Apr 16 15:29:42 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
+ * This class provides callback mechanism for TMSDTMF listeners.
+ *
+ */
+
+#ifndef TMS_DTMF_OBSRVR_H
+#define TMS_DTMF_OBSRVR_H
+
+// Include files
+#include <glib.h>
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSDTMF;
+
+/**
+ * TMSDTMFObserver class
+ *
+ * This class provides callback mechanism for TMSDTMF listeners.
+ *
+ * Client class that wants to receive events from TMS must inherit from
+ * TMSDTMFObserver class and register itself with the TMSDTMF object.
+ *
+ * Functions declared in this class are called upon TMS events.
+ *
+ * The client must not do any blocking, or perform any CPU-intensive operations
+ * in the callback methods. It is recommended that the client saves event data,
+ * returns from this function immediately and if necessary, responds to
+ * the event in asynchronous way.
+ *
+ * @lib tmsapi.lib
+ *
+ */
+class TMSDTMFObserver
+    {
+public:
+    /**
+     * Notified events:
+     *  TMS_EVENT_DTMF_TONE_STARTED
+     *  TMS_EVENT_DTMF_TONE_STOPPED
+
+     * @param  dtmf
+     *      Pointer to the object that is being signaled.
+     *
+     * @param  event
+     *      Event descriptor.
+     */
+    virtual void DTMFEvent(TMSDTMF* dtmf, TMSSignalEvent event) = 0;
+    };
+
+} //namespace TMS
+
+#endif // TMS_DTMF_OBSRVR_H
+
+// End of file
--- a/mmmw_plat/telephony_multimedia_service_api/inc/tmsfactory.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsfactory.h	Fri Apr 16 15:29:42 2010 +0300
@@ -18,6 +18,7 @@
 #ifndef TMS_FACTORY_H
 #define TMS_FACTORY_H
 
+#include <w32std.h>
 #include <tms.h>
 
 namespace TMS {
@@ -35,6 +36,7 @@
 class TMSDTMF;
 class TMSRTPSession;
 class TMSRingTone;
+class TMSInbandTone;
 
 /**
  * TMSFactory class
@@ -422,7 +424,7 @@
     IMPORT_C gint DeleteRTPSession(TMSRTPSession*& rtpsession);
 
     /**
-     * Creates TMSRingTone player object.
+     * Creates TMSRingTone player object for audio ring tone.
      *
      * @param  rt
      *      RingTone player object to be created.
@@ -435,6 +437,26 @@
     IMPORT_C gint CreateRingTonePlayer(TMSRingTone*& rt);
 
     /**
+     * Creates TMSRingTone player object for video ring tone.
+     *
+     * @param  rt
+     *      Video RingTone player object to be created.
+     *
+     * @param window
+     *      A handle to window to which video should be rendered.
+     *
+     * @param scrid
+     *      An ID of the screen to which video should be rendered.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS when object is created successfully.
+     *      TMS_RESULT_INSUFFICIENT_MEMORY when object creation failed due to
+     *      insufficient memory.
+     */
+    IMPORT_C gint CreateRingTonePlayer(TMSRingTone*& rt, RWindow& window,
+            gint scrid);
+
+    /**
      * Deletes TMSRingTone object.
      *
      * @param  rt
@@ -446,6 +468,31 @@
      */
     IMPORT_C gint DeleteRingTonePlayer(TMSRingTone*& rt);
 
+    /**
+     * Creates TMSInbandTone player object.
+     *
+     * @param  inbandtone
+     *      InbandTone player object to be created.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS when object is created successfully.
+     *      TMS_RESULT_INSUFFICIENT_MEMORY when object creation failed due to
+     *      insufficient memory.
+     */
+    IMPORT_C gint CreateInbandTonePlayer(TMSInbandTone*& inbandtone);
+
+    /**
+     * Deletes TMSInbandTone object.
+     *
+     * @param  inbandtone
+     *      InbandTone player object to be deleted.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS when object is deleted successfully.
+     *      TMS_RESULT_INVALID_ARGUMENT if InbandTone player object is invalid.
+     */
+    IMPORT_C gint DeleteInbandTonePlayer(TMSInbandTone*& inbandtone);
+
 private:
     /**
      * Constructor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsinbandtone.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,111 @@
+/*
+ * 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 TMS_INBAND_TONE_H
+#define TMS_INBAND_TONE_H
+
+#include <tms.h>
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSInbandToneBody;
+class TMSInbandToneObserver;
+
+/**
+ * TMSInbandTone class
+*
+* This class provides Inband tone playback capability to the TMS clients. 
+*
+* @lib tmsapi.lib
+*
+*/
+class TMSInbandTone
+    {
+public:
+    /**
+     * Destructor
+     */
+    IMPORT_C virtual ~TMSInbandTone();
+
+    /**
+     * Add client as an observer to TMSInbandTone events.
+     *
+     * @param  obsrvr
+     *      Observer object to TMSInbandTone events.
+     *
+     * @param  user_data
+     *      Any user data passed to the function.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *      TMS_RESULT_ALREADY_EXIST if the obsrvr is already in the list.
+     *
+     */
+    IMPORT_C gint AddObserver(TMSInbandToneObserver& obsrvr, gpointer user_data);
+
+    /**
+     * Remove client as an observer to TMSInbandTone events.
+     *
+     * @param  obsrvr
+     *      Observer object to TMSInbandTone events.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the obsrvr is removed successfully from list.
+     *      TMS_RESULT_DOES_NOT_EXIST if obsrvr is not already in the list.
+     *
+     */
+    IMPORT_C gint RemoveObserver(TMSInbandToneObserver& obsrvr);
+
+    /**
+     * Starts the inband tone playback. The inband volume will correspond to
+     * the current downlink volume level. 
+     * 
+     * For CS calltype.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *
+     */
+    IMPORT_C gint Start(TMSInbandToneType inbandtonetype);
+
+    /**
+     * Stops the inband tone playback.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *
+     */
+    IMPORT_C gint Stop();
+
+
+protected:
+
+    /**
+     * Constructor
+     */
+    IMPORT_C TMSInbandTone();
+
+protected:
+    TMSInbandToneBody* iBody;
+    };
+
+} //namespace TMS
+
+#endif //__TMS_INBAND_TONE_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsinbandtoneobsrvr.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,68 @@
+/*
+ * 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 TMS_INBAND_OBSRVR_H
+#define TMS_INBAND_OBSRVR_H
+
+// Include files
+#include <glib.h>
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSInbandTone;
+
+/**
+ * TMSInbandToneObserver class
+ *
+ * This class provides callback mechanism for TMSInbandTone listeners.
+ *
+ * Client class that wants to receive events from TMS must inherit from
+ * TMSInbandToneObserver class and register itself with the TMSInbandTone object.
+ *
+ * Functions declared in this class are called upon TMS events.
+ *
+ * The client must not do any blocking, or perform any CPU-intensive operations
+ * in the callback methods. It is recommended that the client saves event data,
+ * returns from this function immediately and if necessary, responds to
+ * the event in asynchronous way.
+ *
+ * @lib tmsapi.lib
+ *
+ */
+class TMSInbandToneObserver
+    {
+public:
+    /**
+     * Notified events:
+     *  TMS_EVENT_INBAND_TONE_STARTED
+     *  TMS_EVENT_INBAND_TONE_STOPPED
+
+     * @param  inbandtone
+     *      Pointer to the object that is being signaled.
+     *
+     * @param  event
+     *      Event descriptor.
+     */
+    virtual void InbandToneEvent(TMSInbandTone* inbandtone, TMSSignalEvent event) = 0;
+    };
+
+} //namespace TMS
+
+#endif // TMS_INBAND_OBSRVR_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsringtone.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,167 @@
+/*
+ * 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 TMS_RINGTONE_H
+#define TMS_RINGTONE_H
+
+#include <tms.h>
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSRingToneImpl;
+class TMSRingToneBody;
+class TMSRingToneObserver;
+
+/**
+ * TMSRingTone class
+ *
+ * This class provides ring tone playback capability to the TMS clients.
+ *
+ * @lib tmsapi.lib
+ *
+ */
+class TMSRingTone
+    {
+public:
+    /**
+     * Destructor
+     */
+    IMPORT_C virtual ~TMSRingTone();
+
+    /**
+     * Add client as an observer to TMSRingTone events.
+     *
+     * @param  obsrvr
+     *      Observer object to TMSRingTone events.
+     *
+     * @param  user_data
+     *      Any user data passed to the function.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *      TMS_RESULT_ALREADY_EXIST if the obsrvr is already in the list.
+     *
+     */
+    IMPORT_C gint AddObserver(TMSRingToneObserver& obsrvr, gpointer user_data);
+
+    /**
+     * Remove client as an observer to TMSRingTone events.
+     *
+     * @param  obsrvr
+     *      Observer object to TMSRingTone events.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the obsrvr is removed successfully from list.
+     *      TMS_RESULT_DOES_NOT_EXIST if obsrvr is not already in the list.
+     *
+     */
+    IMPORT_C gint RemoveObserver(TMSRingToneObserver& obsrvr);
+
+    /**
+     * Init ring tone player to play supplied content based on its type.
+     *
+     * @param  type
+     *      Type of the content descriptor. Allowed types:
+     *          - TMS_RINGTONE_DEFAULT - use RT from current Profile
+     *          - TMS_RINGTONE_FILE  - A/V File
+     *          - TMS_RINGTONE_SEQUENCE - RNG sequence in the descriptor format
+     *          - TMS_RINGTONE_BEEP_ONCE - play a beep
+     *          - TMS_RINGTONE_SILENT - play silent tone
+     *          - TMS_RINGTONE_UNSECURE_VOIP - play tone for uncecure VoIP call
+     *
+     * @param  str
+     *      Content descriptor to play. String containing one of the following:
+     *          - File with folder name
+     *          - Nokia ring tone sequence in a descriptor format
+     *          - NULL - Will use current Profile.
+     *
+     * @param  tts
+     *      Text to be played. When added it will be played along with the
+     *      tone. TTS can only be played with TMS_RINGTONE_DEFAULT and
+     *      TMS_RINGTONE_FILE. Parameter will be ignored for all other types.
+     *          - NULL - Will use current Profile TTS setting - caller's name
+     *            will be played from the phone book (if available).
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *
+     */
+    IMPORT_C gint Init(const TMSRingToneType type = TMS_RINGTONE_DEFAULT,
+            GString* str = NULL, GString* tts = NULL);
+
+    /**
+     * Deinit ring tone player.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *
+     */
+    IMPORT_C gint Deinit();
+
+    /**
+     * Start ring tone playback.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *
+     */
+    IMPORT_C gint Play();
+
+    /**
+     * Stop ring tone playback.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *
+     */
+    IMPORT_C gint Stop();
+
+    /**
+     * Pause ring tone playback.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *
+     */
+    IMPORT_C gint Pause();
+
+    /**
+     * Mute ring tone playback.
+     *
+     * @return
+     *      TMS_RESULT_SUCCESS if the operation was successful.
+     *
+     */
+    IMPORT_C gint Mute();
+
+protected:
+    /**
+     * Constructor
+     */
+    IMPORT_C TMSRingTone();
+
+protected:
+    TMSRingToneBody *iBody;
+    };
+
+} //namespace TMS
+
+#endif //TMS_RINGTONE_H
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmsringtoneobsrvr.h	Fri Apr 16 15:29:42 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 TMS_RINGTONE_OBSRVR_H
+#define TMS_RINGTONE_OBSRVR_H
+
+// Include files
+#include <tms.h>
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSRingTone;
+
+/**
+ * TMSRingToneObserver class
+ *
+ * This class provides callback mechanism for TMSRingTone listeners.
+ *
+ * @lib tmsapi.lib
+ *
+ */
+class TMSRingToneObserver
+    {
+public:
+    /**
+     * This method is called when TMSRingTone event occurs.
+     *
+     * Notified events:
+     *  TMS_EVENT_RINGTONE_OPEN_COMPLETE
+     *  TMS_EVENT_RINGTONE_PLAY_COMPLETE
+     *
+     * @param  rt
+     *      Pointer to the object that is being signaled.
+     *
+     * @param  event
+     *      Event descriptor.
+     *
+     */
+    virtual void RingtoneEvent(TMSRingTone* rt, TMSSignalEvent event) = 0;
+    };
+
+} //namespace TMS
+
+#endif //TMS_RINGTONE_OBSRVR_H
+
+// End of file
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/Conf/TMSAudioServicesTestClass.cfg	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/Conf/TMSAudioServicesTestClass.cfg	Fri Apr 16 15:29:42 2010 +0300
@@ -1702,3 +1702,25 @@
 delete Tms
 [Endtest]
 
+//[Test]
+//title  09. TMSCall - 01. Create and Delete DTMF Dnlink
+//create TmsAudioServicesTestClass Tms
+//Tms CreateFactory
+//Tms CreateCall 2
+//allownextresult TMS_RESULT_FEATURE_NOT_SUPPORTED
+//Tms CreateDTMFTonePlayer Dnlink
+//Tms DeleteDTMFTonePlayer Dnlink
+//delete Tms
+//[Endtest]
+
+//[Test]
+//title  09. TMSCall - 02. Create and Delete DTMF Uplink
+//create TmsAudioServicesTestClass Tms
+//Tms CreateFactory
+//Tms CreateCall 2
+//allownextresult TMS_RESULT_FEATURE_NOT_SUPPORTED
+//Tms CreateDTMFTonePlayer Uplink
+//Tms DeleteDTMFTonePlayer Uplink
+//delete Tms
+//[Endtest]
+
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/group/TmsAudioServicesTestClass.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/group/TmsAudioServicesTestClass.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -38,7 +38,7 @@
 MW_LAYER_SYSTEMINCLUDE
 OS_LAYER_LIBC_SYSTEMINCLUDE
 OS_LAYER_GLIB_SYSTEMINCLUDE
-SYSTEMINCLUDE   /epoc32/include/stdapis/stlport
+OS_LAYER_STDCPP_SYSTEMINCLUDE
 
 LIBRARY         euser.lib
 LIBRARY         stiftestinterface.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/group/TmsAudioServicesTestClass.pkg	Fri Apr 16 15:29:42 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: Telephony Multimedia Service - STIF TEST
+;
+;
+
+;languages
+&EN
+
+;Header
+#{"TmsAudioServicesTestClass"},(0x10207C72),1,0,0
+
+;Localised Vendor name
+%{"TmsAudioServicesTestClass"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files to install
+
+"/epoc32/release/armv5/urel/TmsAudioServicesTestClass.dll" - "c:/Sys/Bin/TmsAudioServicesTestClass.dll"
+; If installation process fails, exclude testframework.ini from the sis file and
+; copy manually.
+"../../init/TestFramework.ini"-"c:/Testframework/TestFramework.ini"
+"../../init/TmsAudioServicesTestClass.ini"-"c:/Testframework/TmsAudioServicesTestClass.ini"
+"../../Conf/TMSAudioServicesTestClass.cfg"-"c:/Testframework/TMSAudioServicesTestClass.cfg"
+
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/inc/TMSAudioServicesTestClass.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/inc/TMSAudioServicesTestClass.h	Fri Apr 16 15:29:42 2010 +0300
@@ -27,28 +27,30 @@
 #include <e32base.h>
 #include <e32cons.h>
 #include <tms.h>
-#include <TmsFactory.h>
-#include <TmsCall.h>
-#include <TmsStream.h>
-#include <TmsFormat.h>
-#include <TmsClientSink.h>
-#include <TmsClientSource.h>
-#include <TmsClientSourceObsrvr.h>
-#include <TmsClientSinkObsrvr.h>
-#include <TmsVolumeEffect.h>
-#include <TmSGlobalVolEffect.h>
-#include <TmsGainEffect.h>
-#include <TmSGlobalGainEffect.h>
-#include <TmsEffectObsrvr.h>
-#include <TmsStreamObsrvr.h>
-#include <TmsBuffer.h>
-#include <TmsGlobalRouting.h>
-#include <TmsGlobalRoutingObsrvr.h>
-#include <TMSG711Format.h>
-#include <TMSG729Format.h>
-#include <TMSiLBCFormat.h>
-#include <TMSPCMFormat.h>
-#include <TMSAMRFormat.h>
+#include <tmsfactory.h>
+#include <tmscall.h>
+#include <tmsstream.h>
+#include <tmsformat.h>
+#include <tmsdtmf.h>
+#include <tmsringtone.h>
+#include <tmsclientsink.h>
+#include <tmsclientsource.h>
+#include <tmsclientsourceobsrvr.h>
+#include <tmsclientsinkobsrvr.h>
+#include <tmsvolumeeffect.h>
+#include <tmsglobalvoleffect.h>
+#include <tmsgaineffect.h>
+#include <tmsglobalgaineffect.h>
+#include <tmseffectobsrvr.h>
+#include <tmsstreamobsrvr.h>
+#include <tmsbuffer.h>
+#include <tmsglobalrouting.h>
+#include <tmsglobalroutingobsrvr.h>
+#include <tmsg711format.h>
+#include <tmsg729format.h>
+#include <tmsilbcformat.h>
+#include <tmspcmformat.h>
+#include <tmsamrformat.h>
 
 #include "TimeoutController.h"
 
@@ -331,9 +333,11 @@
     TInt GetDownlinkVersion(CStifItemParser& aItem);
     TInt CreateUplinkStream(CStifItemParser& aItem);
     TInt GetUplinkVersion(CStifItemParser& aItem);
+    TInt CreateDTMFTonePlayer(CStifItemParser& aItem);
+    TInt DeleteDTMFTonePlayer(CStifItemParser& aItem);
+    TInt CreateRingTonePlayer(CStifItemParser& aItem);
     TInt GetSupportedFormats(CStifItemParser& aItem);
     TInt IsCallTypeSupported(CStifItemParser& aItem);
-    //  TInt GetSupportedUplinkFormats( CStifItemParser& aItem );
     TInt SetDownlinkFormat(CStifItemParser& aItem);
     TInt SetUplinkFormat(CStifItemParser& aItem);
     TInt ReSetDownlinkFormat(CStifItemParser& aItem);
@@ -348,6 +352,17 @@
     TInt Gain(CStifItemParser& aItem);
     TInt Volume(CStifItemParser& aItem);
 
+    TInt InitDTMFTonePlayer(CStifItemParser& aItem);
+    TInt DTMFTonePlay(CStifItemParser& aItem);
+    TInt CloseDTMFPlayer(CStifItemParser& aItem);
+    TInt StopDTMFTonePlayer(CStifItemParser& aItem);
+
+    TInt InitRingTonePlayer(CStifItemParser& aItem);
+    TInt CloseRingTonePlayer(CStifItemParser& aItem);
+    TInt PlayRingTone(CStifItemParser& aItem);
+    TInt PauseRingTone(CStifItemParser& aItem);
+    TInt ResumeRingTone(CStifItemParser& aItem);
+    TInt StopRingTone(CStifItemParser& aItem);
     TInt GetBufferType(CStifItemParser& aItem);
 
     //  TInt GetSupportedBitrates( CStifItemParser& aItem );
@@ -417,12 +432,14 @@
     // reference to TestModuleIf
     CTestModuleIf& iTestModuleIf;
 
-    // Dn/Uplink
     TMSFactory* iFactory;
     TMSStream* iTmsDnlink;
     TMSCall* iTmsCall;
     TMSStream* iTmsUplink;
-    TMSAudioOutput device;
+    TMSDTMF* iDTMFTonePlayerDn;
+    TMSDTMF* iDTMFTonePlayerUp;
+    TMSRingTone* iRingTonePlayer;
+    TMSAudioOutput iDevice;
 
     // Codec format APIs
     TMSBuffer* iTmsBuffer;
@@ -456,25 +473,22 @@
     TBool iPlc;
     TBool iCng;
     TBool iVad;
-    //  TBool iFrameMode;
-    //  TBool iFrameModeReqEC;
-    //  TBool iSpkr;
     guint iMaxGain;
     guint iGain;
     guint iMaxVolume;
     guint iVolume;
     TUint currentBitrate;
-    //  RArray<TUint> iBitratesArray;
 
     // For streaming buffer control
     TMSBuffer* iPlayBuf;
     TMSBuffer* iRecBuf;
-    // TPtr8               iPlayBufPtr;
-    // TPtr8               iRecBufPtr;
-
     TBool iPlayBufReady;
     TBool iRecBufReady;
 
+    // For ring tone playback
+    RFile iRTFile;
+    RFs iFs;
+
     // Active object with a timer to timeout the test case
     CSimpleTimeout * iTimeoutController;
 
Binary file mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/RD.crt has changed
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/RD.key	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQC/TDP7KKIaf5+uW4OD2iVZuUMC2a+SeQTjf6srlKcOm+CpPNXn
-uLNm/8fdEnyOIuRXPRKmqhs1n0JkxEGHynELWMTuKXbQx9SRAGUXzyneGn+IJNnO
-vOKHWgKCouX2hfI8rtkdqJpqmO460gGsMgw+lsbeyWyW9lnfLxq+ZC7sqQIDAQAB
-AoGBALmUWZE8GBaQ3P4u9WUCSd3DJkkrmXIFSULSZeH/chlwCwDjbbhArHothVzo
-REE3hEFFlERvHbplZ+mNouzy7boduvgUzbksGrbGMLJ2qO1GzWWVwV+GzOWKd3ss
-/98Gwoy5R8pjnkqUE2wP1iJFw0FjvUTKcYv/z6t3LLJ0CsoBAkEA+c7ixvsviQ3J
-s0INytCKU2bf8fqFQJi1VI82ukxNsujGTQ9upVSjuvqPvWyDvvTdrUBHqO+3qPut
-sEh01Q8aiQJBAMQKDJPVRu4ud3mwUfEavzL5EjqwG1k9VCNGYsT4FwtrHcxu1oP/
-pk6M3rIZukqomoEEnHWPMwhrK3fhBqi0OSECQQDr40VXege4FnH5OI2Hj4afHMyp
-VdQQXGMWFyopnzXblFz0lXb43cTCIiorR9XcMqNFHybLypkWE5o+lRzlt55pAkBQ
-P/zeF5Sts//cpL0mgdh7OVKpC6ZmZaCnwAx2rUhhuDu+kDDoYCLoTOps5fNI1LRK
-1GRoC3LMo3Jr5IYhUYWBAkBpCpN6k4JU/mszq98EojHerQNxk8sPqvQKUzTutohT
-1gLX9yepGayB/TtT2EEJDkWOlnTy/dvN6W3vzbJYz97x
------END RSA PRIVATE KEY-----
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/TmsAudioServicesTestClass.pkg	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +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 - STIF TEST
-;
-;
-
-;languages
-&EN
-
-;Header
-#{"TmsAudioServicesTestClass"},(0x10207C72),1,0,0
-
-;Localised Vendor name
-%{"TmsAudioServicesTestClass"}
-
-;Unique Vendor name
-:"Nokia"
-
-;Files to install
-
-"/epoc32/release/armv5/urel/TmsAudioServicesTestClass.dll" - "c:/Sys/Bin/TmsAudioServicesTestClass.dll"
-; If installation process fails, exclude testframework.ini from the sis file and 
-; copy manually. 
-"../../init/TestFramework.ini"-"c:/Testframework/TestFramework.ini"
-"../../init/TmsAudioServicesTestClass.ini"-"c:/Testframework/TmsAudioServicesTestClass.ini"
-"../../Conf/TMSAudioServicesTestClass.cfg"-"c:/Testframework/TMSAudioServicesTestClass.cfg"
-
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/create_sis.bat	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-del TmsAudioServicesTestClass.sis*
-makesis TmsAudioServicesTestClass.pkg TmsAudioServicesTestClass.sis
-signsis TmsAudioServicesTestClass.sis TmsAudioServicesTestClass.sisx rd.crt rd.key
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TimeoutController.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TimeoutController.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -249,7 +249,7 @@
         if (iTestCaseTimeout > timeout)
             {
             RDebug::Print(
-                    _L( "Absolute timer still valid. Restaring timer. iStatus: %d" ),
+                    _L("Absolute timer still valid. Restaring timer. iStatus: %d"),
                     iStatus.Int());
             // Start new timer
             iStatus = KErrNone; // reset value
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocks.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocks.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -116,6 +116,10 @@
     iLog->Log(_L(""));
     iLog->Log(_L(""));
 
+    delete iRingTonePlayer;
+    delete iDTMFTonePlayerDn;
+    delete iDTMFTonePlayerUp;
+
     // delete iPlayBuf;
 
     if (iTmsDnlink)
@@ -171,6 +175,9 @@
         ENTRY( "GetEffectType", CTmsAudioServicesTestClass::GetEffectType ),
         ENTRY( "CreateDownlinkStream", CTmsAudioServicesTestClass::CreateDownlinkStream ),
         ENTRY( "CreateUplinkStream", CTmsAudioServicesTestClass::CreateUplinkStream ),
+        ENTRY( "CreateDTMFTonePlayer", CTmsAudioServicesTestClass::CreateDTMFTonePlayer ),
+        ENTRY( "DeleteDTMFTonePlayer", CTmsAudioServicesTestClass::DeleteDTMFTonePlayer ),
+        ENTRY( "CreateRingTonePlayer", CTmsAudioServicesTestClass::CreateRingTonePlayer ),
         ENTRY( "GetSupportedFormats", CTmsAudioServicesTestClass::GetSupportedFormats ),
         ENTRY( "IsCallTypeSupported", CTmsAudioServicesTestClass::IsCallTypeSupported ),
         ENTRY( "SetDownlinkFormat", CTmsAudioServicesTestClass::SetDownlinkFormat ),
@@ -193,8 +200,18 @@
         ENTRY( "GetBitRateList", CTmsAudioServicesTestClass::GetBitRateList ),
         ENTRY( "SetBitrates", CTmsAudioServicesTestClass::SetBitrates ),
         ENTRY( "GetBitrates", CTmsAudioServicesTestClass::GetBitrates ),
+        ENTRY( "InitDTMFTonePlayer", CTmsAudioServicesTestClass::InitDTMFTonePlayer ),
+        ENTRY( "DTMFTonePlay", CTmsAudioServicesTestClass::DTMFTonePlay ),
+        ENTRY( "CloseDTMFPlayer", CTmsAudioServicesTestClass::CloseDTMFPlayer ),
+        ENTRY( "StopDTMFPlayer", CTmsAudioServicesTestClass::StopDTMFTonePlayer ),
         ENTRY( "GetDownlinkVersion", CTmsAudioServicesTestClass::GetDownlinkVersion ),
         ENTRY( "GetUplinkVersion", CTmsAudioServicesTestClass::GetUplinkVersion ),
+        ENTRY( "InitRingTonePlayer", CTmsAudioServicesTestClass::InitRingTonePlayer ),
+        ENTRY( "CloseRingTonePlayer", CTmsAudioServicesTestClass::CloseRingTonePlayer ),
+        ENTRY( "PlayRingTone", CTmsAudioServicesTestClass::PlayRingTone ),
+        ENTRY( "PauseRingTone", CTmsAudioServicesTestClass::PauseRingTone ),
+        ENTRY( "ResumeRingTone", CTmsAudioServicesTestClass::ResumeRingTone ),
+        ENTRY( "StopRingTone", CTmsAudioServicesTestClass::StopRingTone ),
         ENTRY( "GetType", CTmsAudioServicesTestClass::GetType ),
         ENTRY( "GetVAD", CTmsAudioServicesTestClass::GetVAD ),
         ENTRY( "ToggleVAD", CTmsAudioServicesTestClass::ToggleVAD ),
@@ -1115,6 +1132,88 @@
     return error;
     }
 
+TInt CTmsAudioServicesTestClass::CreateDTMFTonePlayer(CStifItemParser& aItem)
+    {
+    iLog->Log(_L("CTmsAudioServicesTestClass::CreateDTMFTonePlayer"));
+    TInt error = KErrNone;
+    TPtrC StreamType;
+    error = aItem.GetNextString(StreamType);
+
+    if (error == KErrNone)
+        {
+        if (StreamType == KTagDnlink)
+            {
+            if (iTmsCall)
+                {
+                error = iFactory->CreateDTMF(0, iDTMFTonePlayerDn);
+                FTRACE(FPrint(_L("CreateDTMF Error [%d]"),error));
+                }
+            }
+        else if (StreamType == KTagUplink)
+            {
+            if (iTmsCall)
+                {
+                error = iFactory->CreateDTMF(0, iDTMFTonePlayerUp);
+                }
+            }
+        else
+            {
+            iLog->Log(KMsgBadTestParameters);
+            error = KErrBadTestParameter;}
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::CreateDTMFTonePlayer Error [%d]"),
+            error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::DeleteDTMFTonePlayer(CStifItemParser& aItem)
+    {
+    iLog->Log(_L("CTmsAudioServicesTestClass::DeleteDTMFTonePlayer"));
+    TInt error = KErrNone;
+    TPtrC StreamType;
+    error = aItem.GetNextString(StreamType);
+
+    if (error == KErrNone)
+        {
+        if (StreamType == KTagDnlink)
+            {
+            if (iTmsCall && iDTMFTonePlayerDn)
+                {
+                error = iFactory->DeleteDTMF(iDTMFTonePlayerDn);
+                FTRACE(FPrint(_L("DeleteDTMF Error [%d]"),error));
+                }
+            }
+        else if (StreamType == KTagUplink)
+            {
+            if (iTmsCall && iDTMFTonePlayerUp)
+                {
+                error = iFactory->DeleteDTMF(iDTMFTonePlayerUp);
+                }
+            }
+        else
+            {
+            iLog->Log(KMsgBadTestParameters);
+            error = KErrBadTestParameter;
+            }
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::DeleteDTMFTonePlayer Error [%d]"),
+            error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::CreateRingTonePlayer(CStifItemParser& /*aItem */)
+    {
+    iLog->Log(_L("CTmsAudioServicesTestClass::CreateRingTonePlayer"));
+    TInt error = KErrNone;
+    if (iFactory)
+        {
+        error = iFactory->CreateRingTonePlayer(iRingTonePlayer);
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::CreateRingTonePlayer Error [%d]"),
+            error);
+    return error;
+    }
+
 TInt CTmsAudioServicesTestClass::GetSupportedFormats(CStifItemParser& aItem)
     {
     iLog->Log(_L("CTmsAudioServicesTestClass::GetSupportedFormats"));
@@ -2001,11 +2100,10 @@
 
     if (iTmsGlobalRouting)
         {
-        error = iTmsGlobalRouting->GetOutput(device);
+        error = iTmsGlobalRouting->GetOutput(iDevice);
         iLog->Log(
-                _L("CTmsAudioServicesTestClass::GetOutput, error:[%d] device:[%d]"),
-                error, device);
-
+                _L("CTmsAudioServicesTestClass::GetOutput, error:[%d] iDevice:[%d]"),
+                error, iDevice);
         }
 
     if (error != KErrNone)
@@ -2019,7 +2117,7 @@
         {
         if (OutputType == KTagNone)
             {
-            if (device != TMS_AUDIO_OUTPUT_NONE)
+            if (iDevice != TMS_AUDIO_OUTPUT_NONE)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2029,7 +2127,7 @@
             }
         else if (OutputType == KTagPublic)
             {
-            if (device != TMS_AUDIO_OUTPUT_PUBLIC)
+            if (iDevice != TMS_AUDIO_OUTPUT_PUBLIC)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2039,7 +2137,7 @@
             }
         else if (OutputType == KTagPrivate)
             {
-            if (device != TMS_AUDIO_OUTPUT_PRIVATE)
+            if (iDevice != TMS_AUDIO_OUTPUT_PRIVATE)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2049,7 +2147,7 @@
             }
         else if (OutputType == KTagHandset)
             {
-            if (device != TMS_AUDIO_OUTPUT_HANDSET)
+            if (iDevice != TMS_AUDIO_OUTPUT_HANDSET)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2059,7 +2157,7 @@
             }
         else if (OutputType == KTagLoudspeaker)
             {
-            if (device != TMS_AUDIO_OUTPUT_LOUDSPEAKER)
+            if (iDevice != TMS_AUDIO_OUTPUT_LOUDSPEAKER)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2069,7 +2167,7 @@
             }
         else if (OutputType == KTagWiredAccessory)
             {
-            if (device != TMS_AUDIO_OUTPUT_WIRED_ACCESSORY)
+            if (iDevice != TMS_AUDIO_OUTPUT_WIRED_ACCESSORY)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2079,7 +2177,7 @@
             }
         else if (OutputType == KTagAccessory)
             {
-            if (device != TMS_AUDIO_OUTPUT_ACCESSORY)
+            if (iDevice != TMS_AUDIO_OUTPUT_ACCESSORY)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2089,7 +2187,7 @@
             }
         else if (OutputType == KTagTTY)
             {
-            if (device != TMS_AUDIO_OUTPUT_ETTY)
+            if (iDevice != TMS_AUDIO_OUTPUT_ETTY)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2114,7 +2212,7 @@
 
     if (iTmsGlobalRouting)
         {
-        error = iTmsGlobalRouting->GetPreviousOutput(device);
+        error = iTmsGlobalRouting->GetPreviousOutput(iDevice);
         iLog->Log(
                 _L("CTmsAudioServicesTestClass::GetPreviousOutput, error:[%d] "),
                 error);
@@ -2131,7 +2229,7 @@
         {
         if (OutputType == KTagNone)
             {
-            if (device != TMS_AUDIO_OUTPUT_NONE)
+            if (iDevice != TMS_AUDIO_OUTPUT_NONE)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2141,7 +2239,7 @@
             }
         else if (OutputType == KTagPublic)
             {
-            if (device != TMS_AUDIO_OUTPUT_PUBLIC)
+            if (iDevice != TMS_AUDIO_OUTPUT_PUBLIC)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2151,7 +2249,7 @@
             }
         else if (OutputType == KTagPrivate)
             {
-            if (device != TMS_AUDIO_OUTPUT_PRIVATE)
+            if (iDevice != TMS_AUDIO_OUTPUT_PRIVATE)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2161,7 +2259,7 @@
             }
         else if (OutputType == KTagHandset)
             {
-            if (device != TMS_AUDIO_OUTPUT_HANDSET)
+            if (iDevice != TMS_AUDIO_OUTPUT_HANDSET)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2171,7 +2269,7 @@
             }
         else if (OutputType == KTagLoudspeaker)
             {
-            if (device != TMS_AUDIO_OUTPUT_LOUDSPEAKER)
+            if (iDevice != TMS_AUDIO_OUTPUT_LOUDSPEAKER)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2181,7 +2279,7 @@
             }
         else if (OutputType == KTagWiredAccessory)
             {
-            if (device != TMS_AUDIO_OUTPUT_WIRED_ACCESSORY)
+            if (iDevice != TMS_AUDIO_OUTPUT_WIRED_ACCESSORY)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2191,7 +2289,7 @@
             }
         else if (OutputType == KTagAccessory)
             {
-            if (device != TMS_AUDIO_OUTPUT_ACCESSORY)
+            if (iDevice != TMS_AUDIO_OUTPUT_ACCESSORY)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2201,7 +2299,7 @@
             }
         else if (OutputType == KTagTTY)
             {
-            if (device != TMS_AUDIO_OUTPUT_ETTY)
+            if (iDevice != TMS_AUDIO_OUTPUT_ETTY)
                 {
                 error = KErrUnexpectedValue;
                 iLog->Log(
@@ -2251,6 +2349,92 @@
         {
         error = KErrNotReady;
         }
+
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::InitDTMFTonePlayer(CStifItemParser& /*aItem */)
+    {
+    FTRACE(FPrint(_L("CTmsAudioServicesTestClass::InitDTMFTonePlayer")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::InitDTMFTonePlayer"));
+    TInt error = KErrNone;
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::DTMFTonePlay(CStifItemParser& /*aItem */)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::DTMFTonePlay")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::DTMFTonePlay"));
+    TInt error = KErrNone;
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::CloseDTMFPlayer(CStifItemParser& /*aItem */)
+    {
+    FTRACE(FPrint(_L("CTmsAudioServicesTestClass::CloseDTMFPlayer")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::CloseDTMFPlayer"));
+    TInt error = KErrNone;
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::StopDTMFTonePlayer(CStifItemParser& /*aItem */)
+    {
+    FTRACE(FPrint(_L("CTmsAudioServicesTestClass::StopDTMFTonePlayer")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::StopDTMFTonePlay"));
+    TInt error = KErrNone;
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::InitRingTonePlayer(CStifItemParser& /*aItem */)
+    {
+    FTRACE(FPrint(_L("CTmsAudioServicesTestClass::InitRingTonePlayer")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::InitRingTonePlayer"));
+    TInt error = KErrNone;
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::CloseRingTonePlayer(CStifItemParser& /*aItem*/)
+    {
+    FTRACE(FPrint(_L("CTmsAudioServicesTestClass::CloseRingTonePlayer")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::CloseRingTonePlayer"));
+    TInt error = KErrNone;
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::PlayRingTone(CStifItemParser& /*aItem*/)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::PlayRingTone")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::PlayRingTone"));
+    TInt error = KErrNone;
+
+    if (iRingTonePlayer)
+        {
+        //iRingTonePlayer->Play();
+        AddExpectedEvent(EPlaybackComplete, KLongTimeout);
+        // Played ringing tone file has to be shorter than KLongTimeout
+        }
+    else
+        {
+        iLog->Log(_L("RT PLR Not Ready: error = %d"), KErrNotFound);
+        error = KErrNotFound;
+        }
+
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::PauseRingTone(CStifItemParser& /*aItem*/)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::PauseRingTone")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::PauseRingTone"));
+    TInt error = KErrNone;
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::ResumeRingTone(CStifItemParser& /*aItem*/)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::ResumeRingTone")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::ResumeRingTone"));
+    TInt error = KErrNone;
     return error;
     }
 
@@ -2675,6 +2859,24 @@
     return error;
     }
 
+TInt CTmsAudioServicesTestClass::StopRingTone(CStifItemParser& /*aItem*/)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::StopRingTone")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::StopRingTone"));
+    TInt error = KErrNone;
+    if (iRingTonePlayer)
+        {
+        //    iRingTonePlayer->Stop();
+        RemoveExpectedEvent(EPlaybackComplete);
+        }
+    else
+        {
+        iLog->Log(_L("RT PLR Not Ready: error = %d"), KErrNotFound);
+        error = KErrNotFound;
+        }
+    return error;
+    }
+
 TInt CTmsAudioServicesTestClass::GetBufferType(CStifItemParser& /*aItem*/)
     {
     FTRACE (FPrint(_L("CTmsAudioServicesTestClass::GetBufferType")));
--- a/mmmw_plat/voip_audio_services_api/inc/voipaudiocommon.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipaudiocommon.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,20 +1,19 @@
 /*
-* Copyright (c) 2008 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 set of common constants and enumerated lists.
-*
-*/
-
+ * Copyright (c) 2008 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 set of common constants and enumerated lists.
+ *
+ */
 
 #ifndef __VOIPAUDIOCOMMON_H
 #define __VOIPAUDIOCOMMON_H
@@ -26,7 +25,7 @@
 /**
  *  TVoIPCodecFormat
  *  ?description
- *  @since S60 v5.0
+ *
  */
 enum TVoIPCodecFormat
     {
@@ -41,5 +40,4 @@
 
 #endif //__VOIPAUDIOCOMMON_H
 
-
 // End of file
--- a/mmmw_plat/voip_audio_services_api/inc/voipdatabuffer.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipdatabuffer.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,43 +1,40 @@
 /*
-* Copyright (c) 2008 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 buffer type for VoIP data streaming.
-*
-*/
-
+ * Copyright (c) 2008 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 buffer type for VoIP data streaming.
+ *
+ */
 
 #ifndef __VOIPDATABUFFER_H
 #define __VOIPDATABUFFER_H
 
 #include <e32base.h>
 
-
 // FORWARD DECLARATIONS
 class CVoIPDataBufferImpl;
 class CVoIPJBDataBufferImpl;
 
-
 /**
  *  CVoIPDataBuffer
  *  ?description
- *  @since S60 v5.0
+ *
  */
 class CVoIPDataBuffer
     {
 public:
     /**
-    * Buffer types
-    */
+     * Buffer types
+     */
     enum TVoIPBufferType
         {
         EStandard,
@@ -101,15 +98,15 @@
     void ConstructL(CVoIPDataBufferImpl* aVoIPDataBufferImpl);
 
 private:
+
     CVoIPDataBufferImpl* iVoIPDataBufferImpl;
 
     };
 
-
 /**
  *  CVoIPJBDataBuffer
  *  ?description
- *  @since S60 v5.0
+ *
  */
 class CVoIPJBDataBuffer : public CVoIPDataBuffer
     {
@@ -161,11 +158,11 @@
     void ConstructL(CVoIPJBDataBufferImpl* aVoIPJBDataBufferImpl);
 
 private:
+
     CVoIPJBDataBufferImpl* iVoIPJBDataBufferImpl;
 
     };
 
 #endif //__VOIPDATABUFFER_H
 
-
 // End of file
--- a/mmmw_plat/voip_audio_services_api/inc/voipdownlinkstream.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipdownlinkstream.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,20 +1,19 @@
 /*
-* Copyright (c) 2008 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 VoIP downlink stream APIs.
-*
-*/
-
+ * Copyright (c) 2008 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 VoIP downlink stream APIs.
+ *
+ */
 
 #ifndef __VOIPDOWNLINKSTREAM_H
 #define __VOIPDOWNLINKSTREAM_H
@@ -22,7 +21,6 @@
 #include <voipaudiocommon.h>
 #include <voipdtmftoneplayer.h>
 
-
 // FORWARD DECLARATIONS
 class CVoIPAudioDownlinkStream;
 class CVoIPAudioDownlinkStreamImpl;
@@ -35,14 +33,14 @@
  *  ?more_complete_description
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class MVoIPDownlinkObserver
     {
 public:
-    static const TUint KOpenComplete       = 1;
-    static const TUint KDownlinkError      = 2;
-    static const TUint KDownlinkClosed     = 3;
+    static const TUint KOpenComplete = 1;
+    static const TUint KDownlinkError = 2;
+    static const TUint KDownlinkClosed = 3;
     static const TUint KAudioDeviceChanged = 4;
 
 public:
@@ -55,7 +53,7 @@
      * @return void
      */
     virtual void FillBuffer(const CVoIPAudioDownlinkStream& aSrc,
-                            CVoIPDataBuffer* aBuffer) = 0;
+            CVoIPDataBuffer* aBuffer) = 0;
     /**
      * ?description
      *
@@ -65,19 +63,17 @@
      * @param TInt - Status
      * @return void
      */
-    virtual void Event(const CVoIPAudioDownlinkStream& aSrc,
-                       TInt aEventType,
-                       TInt aError) = 0;
+    virtual void Event(const CVoIPAudioDownlinkStream& aSrc, TInt aEventType,
+            TInt aError) = 0;
     };
 
-
 /**
  *  CVoIPAudioDownlinkStream class
  *
  *  ?more_complete_description
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class CVoIPAudioDownlinkStream
     {
@@ -85,7 +81,7 @@
     /**
      *  TVoIPOutputDevice
      *  ?description
-     *  @since S60 v5.0
+ *
      */
     enum TVoIPOutputDevice
         {
@@ -158,7 +154,7 @@
      * @return TInt
      */
     IMPORT_C TInt SetFormat(TVoIPCodecFormat aFormat,
-                            CVoIPFormatIntfc*& aIntfc);
+            CVoIPFormatIntfc*& aIntfc);
 
     /**
      * ?description
@@ -232,8 +228,8 @@
      * @param none
      * @return TInt
      */
-     void ConstructL(
-          CVoIPAudioDownlinkStreamImpl* aVoIPAudioDownlinkStreamImpl);
+    void ConstructL(
+            CVoIPAudioDownlinkStreamImpl* aVoIPAudioDownlinkStreamImpl);
 
 private:
     /**
@@ -249,5 +245,4 @@
 
 #endif //__VOIPDOWNLINKSTREAM_H
 
-
 // End of file
--- a/mmmw_plat/voip_audio_services_api/inc/voipdtmftoneplayer.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipdtmftoneplayer.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,39 +1,36 @@
 /*
-* Copyright (c) 2008 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 VoIP DTMF tone player APIs.
-*
-*/
-
+ * Copyright (c) 2008 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 VoIP DTMF tone player APIs.
+ *
+ */
 
 #ifndef __VOIPDTMFTONEPLAYER_H
 #define __VOIPDTMFTONEPLAYER_H
 
-
 // FORWARD DECLARATIONS
 class CVoIPAudioUplinkStream;
 class CVoIPAudioDownlinkStream;
 class CDTMFTonePlayer;
 class CDTMFTonePlayerImpl;
 
-
 /**
  *  MDTMFToneObserver class
  *
  *  ?more_complete_description
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class MDTMFToneObserver
     {
@@ -51,19 +48,17 @@
      * @param TInt - Status
      * @return void
      */
-    virtual void Event(const CDTMFTonePlayer& aPlayer,
-                       TInt aEventType,
-                       TInt aError) = 0;
+    virtual void Event(const CDTMFTonePlayer& aPlayer, TInt aEventType,
+            TInt aError) = 0;
     };
 
-
 /**
  *  CDTMFTonePlayer class
  *
  *  DTMF Tone Player class
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class CDTMFTonePlayer
     {
@@ -149,7 +144,7 @@
      * @return TInt
      */
     IMPORT_C TInt RemoveVoIPAudioDownlinkStream(
-                  CVoIPAudioDownlinkStream& aStream);
+            CVoIPAudioDownlinkStream& aStream);
 
 protected:
 
@@ -179,5 +174,4 @@
 
 #endif //__VOIPDTMFTONEPLAYER_H
 
-
 // End of file
--- a/mmmw_plat/voip_audio_services_api/inc/voipformatintfc.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipformatintfc.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,46 +1,43 @@
 /*
-* Copyright (c) 2008 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 common to all supported codecs.
-*
-*/
-
+ * Copyright (c) 2008 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 common to all supported codecs.
+ *
+ */
 
 #ifndef __VOIPFORMATINTFC_H
 #define __VOIPFORMATINTFC_H
 
 #include <voipaudiocommon.h>
 
-
 // FORWARD DECLARATIONS
 class CVoIPFormatIntfc;
 class CVoIPFormatIntfcImpl;
 
-
 /**
  *  MVoIPFormatObserver class
  *
  *  ?more_complete_description
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class MVoIPFormatObserver
     {
 public:
-    static const TUint KSilenceBegin     = 1;
-    static const TUint KSilenceUpdate    = 2;
-    static const TUint KSilenceEnd       = 3;
+    static const TUint KSilenceBegin = 1;
+    static const TUint KSilenceUpdate = 2;
+    static const TUint KSilenceEnd = 3;
     static const TUint KObserverEventMax = 4;
 
 public:
@@ -55,14 +52,13 @@
     virtual void Event(const CVoIPFormatIntfc& aSrc, TInt aEventType) = 0;
     };
 
-
 /**
  *  CVoIPFormatIntfc class
  *
  *  Base class for codec format configuration
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class CVoIPFormatIntfc
     {
@@ -70,7 +66,7 @@
     /**
      *  TG711CodecMode
      *  ?description
-     *  @since S60 v5.0
+ *
      */
     enum TG711CodecMode
         {
@@ -81,7 +77,7 @@
     /**
      *  TILBCCodecMode
      *  ?description
-     *  @since S60 v5.0
+ *
      */
     enum TILBCCodecMode
         {
@@ -209,6 +205,7 @@
     void ConstructL(CVoIPFormatIntfcImpl* aVoIPFormatIntfcImpl);
 
 protected:
+
     CVoIPFormatIntfcImpl* iVoIPFormatIntfcImpl;
 
     };
--- a/mmmw_plat/voip_audio_services_api/inc/voipg711decoderintfc.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipg711decoderintfc.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,20 +1,19 @@
 /*
-* Copyright (c) 2008 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 specific to G.711 decoder.
-*
-*/
-
+ * Copyright (c) 2008 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 specific to G.711 decoder.
+ *
+ */
 
 #ifndef __VOIPG711DECFORMATINTFC_H
 #define __VOIPG711DECFORMATINTFC_H
@@ -22,18 +21,16 @@
 #include <voipaudiocommon.h>
 #include <voipformatintfc.h>
 
-
 // FORWARD DECLARATIONS
 class CVoIPG711DecoderIntfcImpl;
 
-
 /**
  *  CVoIPG711DecoderIntfc class
  *
  *  G.711 decoder configuration class
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class CVoIPG711DecoderIntfc : public CVoIPFormatIntfc
     {
@@ -125,7 +122,6 @@
 
     };
 
-
 #endif //__VOIPG711DECFORMATINTFC_H
 
 // End of file
--- a/mmmw_plat/voip_audio_services_api/inc/voipg711encoderintfc.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipg711encoderintfc.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,20 +1,19 @@
 /*
-* Copyright (c) 2008 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 specific to G.711 encoder.
-*
-*/
-
+ * Copyright (c) 2008 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 specific to G.711 encoder.
+ *
+ */
 
 #ifndef __VOIPG711ENCFORMATINTFC_H
 #define __VOIPG711ENCFORMATINTFC_H
@@ -22,18 +21,16 @@
 #include <voipaudiocommon.h>
 #include <voipformatintfc.h>
 
-
 // FORWARD DECLARATIONS
 class CVoIPG711EncoderIntfcImpl;
 
-
 /**
  *  CVoIPG711EncoderIntfc class
  *
  *  G.711 encoder configuration class
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class CVoIPG711EncoderIntfc : public CVoIPFormatIntfc
     {
@@ -89,7 +86,6 @@
 
     };
 
-
 #endif //__VOIPG711ENCFORMATINTFC_H
 
 // End of file
--- a/mmmw_plat/voip_audio_services_api/inc/voipg729decoderintfc.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipg729decoderintfc.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,20 +1,19 @@
 /*
-* Copyright (c) 2008 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 specific to G.729 decoder.
-*
-*/
-
+ * Copyright (c) 2008 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 specific to G.729 decoder.
+ *
+ */
 
 #ifndef __VOIPG729DECFORMATINTFC_H
 #define __VOIPG729DECFORMATINTFC_H
@@ -22,18 +21,16 @@
 #include <voipaudiocommon.h>
 #include <voipformatintfc.h>
 
-
 // FORWARD DECLARATIONS
 class CVoIPG729DecoderIntfcImpl;
 
-
 /**
  *  CVoIPG729DecoderIntfc class
  *
  *  G.729 decoder configuration class
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class CVoIPG729DecoderIntfc : public CVoIPFormatIntfc
     {
@@ -80,7 +77,6 @@
 
     };
 
-
 #endif //__VOIPG729DECFORMATINTFC_H
 
 // End of file
--- a/mmmw_plat/voip_audio_services_api/inc/voipilbcdecoderintfc.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipilbcdecoderintfc.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,20 +1,19 @@
 /*
-* Copyright (c) 2008 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 specific to iLBC decoder.
-*
-*/
-
+ * Copyright (c) 2008 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 specific to iLBC decoder.
+ *
+ */
 
 #ifndef __VOIPILBCDECFORMATINTFC_H
 #define __VOIPILBCDECFORMATINTFC_H
@@ -22,18 +21,16 @@
 #include <voipaudiocommon.h>
 #include <voipformatintfc.h>
 
-
 // FORWARD DECLARATIONS
 class CVoIPILBCDecoderIntfcImpl;
 
-
 /**
  *  CVoIPILBCDecoderIntfc class
  *
  *  iLBC decoder configuration class
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class CVoIPILBCDecoderIntfc : public CVoIPFormatIntfc
     {
@@ -107,7 +104,6 @@
 
     };
 
-
 #endif //__VOIPILBCDECFORMATINTFC_H
 
 // End of file
--- a/mmmw_plat/voip_audio_services_api/inc/voipilbcencoderintfc.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipilbcencoderintfc.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,20 +1,19 @@
 /*
-* Copyright (c) 2008 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 specific to iLBC encoder.
-*
-*/
-
+ * Copyright (c) 2008 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 specific to iLBC encoder.
+ *
+ */
 
 #ifndef __VOIPILBCENCFORMATINTFC_H
 #define __VOIPILBCENCFORMATINTFC_H
@@ -22,18 +21,16 @@
 #include <voipaudiocommon.h>
 #include <voipformatintfc.h>
 
-
 // FORWARD DECLARATIONS
 class CVoIPILBCEncoderIntfcImpl;
 
-
 /**
  *  CVoIPILBCEncoderIntfc class
  *
  *  iLBC encoder configuration class
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class CVoIPILBCEncoderIntfc : public CVoIPFormatIntfc
     {
@@ -89,7 +86,6 @@
 
     };
 
-
 #endif //__VOIPILBCENCFORMATINTFC_H
 
 // End of file
--- a/mmmw_plat/voip_audio_services_api/inc/voipjitterbufferintfc.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipjitterbufferintfc.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,20 +1,19 @@
 /*
-* Copyright (c) 2008 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 common to all supported codecs.
-*
-*/
-
+ * Copyright (c) 2008 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 common to all supported codecs.
+ *
+ */
 
 #ifndef __VOIPJITTERBUFFERINTFC_H
 #define __VOIPJITTERBUFFERINTFC_H
@@ -23,16 +22,14 @@
 #include <e32base.h>
 #include <voipaudiocommon.h>
 
-
 // FORWARD DECLARATIONS
 class CVoIPJitterBufferIntfc;
 class CVoIPJitterBufferIntfcImpl;
 
-
 /**
  *  TVoIPJBConfig
  *  ?description
- *  @since S60 v5.0
+ *
  */
 class TVoIPJBConfig
     {
@@ -62,14 +59,13 @@
     TUint iJBPlayToneDuration;
     };
 
-
 /**
  *  MVoIPJitterBufferObserver class
  *
  *  description
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class MVoIPJitterBufferObserver
     {
@@ -87,17 +83,16 @@
      * @return void
      */
     virtual void Event(const CVoIPJitterBufferIntfc& aSrc,
-                       TInt aEventType) = 0;
+            TInt aEventType) = 0;
     };
 
-
 /**
  *  CVoIPFormatIntfc class
  *
  *  Base class for codec format configuration
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class CVoIPJitterBufferIntfc
     {
@@ -120,7 +115,6 @@
      */
     IMPORT_C TInt SetObserver(MVoIPJitterBufferObserver& aObserver);
 
-
     /**
      * ConfigureJitterBuffer
      * @since S60 v5.0
@@ -162,7 +156,7 @@
      * @param none
      * @return none
      */
-      CVoIPJitterBufferIntfc();
+    CVoIPJitterBufferIntfc();
 
     /**
      * 2-nd phase constructor
@@ -180,5 +174,4 @@
 
 #endif  //__VOIPJITTERBUFFERINTFC_H
 
-
 // End of File
--- a/mmmw_plat/voip_audio_services_api/inc/voipringtonefactory.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipringtonefactory.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,37 +1,34 @@
 /*
-* Copyright (c) 2008 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 factory object for creating ring tone player.
-*
-*/
-
+ * Copyright (c) 2008 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 factory object for creating ring tone player.
+ *
+ */
 
 #ifndef __RINGTONEFACTORY_H
 #define __RINGTONEFACTORY_H
 
-
 // FORWARD DECLARATIONS
 class CRingTonePlayer;
 class CRingToneFactoryImpl;
 
-
 /**
  *  CRingToneFactory class
  *
  *  ?more_complete_description
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class CRingToneFactory
     {
--- a/mmmw_plat/voip_audio_services_api/inc/voipringtoneplayer.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipringtoneplayer.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,43 +1,40 @@
 /*
-* Copyright (c) 2008 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 for VoIP ring tone player.
-*
-*/
-
+ * Copyright (c) 2008 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 for VoIP ring tone player.
+ *
+ */
 
 #ifndef __RINGTONEPLAYER_H
 #define __RINGTONEPLAYER_H
 
-
 // FORWARD DECLARATIONS
 class RFile;
 class CRingTonePlayer;
 class CRingTonePlayerImpl;
 
-
 /**
  *  MRingToneObserver class
  *
  *  ?more_complete_description
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class MRingToneObserver
     {
 public:
-    static const TUint KOpenComplete     = 1;
+    static const TUint KOpenComplete = 1;
     static const TUint KPlaybackComplete = 2;
 
 public:
@@ -50,19 +47,17 @@
      * @param TInt - Status
      * @return void
      */
-    virtual void Event(const CRingTonePlayer& aSrc,
-                       TInt aEventType,
-                       TInt aError) = 0;
+    virtual void Event(const CRingTonePlayer& aSrc, TInt aEventType,
+            TInt aError) = 0;
     };
 
-
 /**
  *  CRingTonePlayer class
  *
  *  Ring Tone Player class
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class CRingTonePlayer
     {
@@ -94,8 +89,7 @@
      * @param TPtr
      * @return TInt
      */
-    IMPORT_C TInt Open(MRingToneObserver& aObserver,
-                       TPtr aFileName);
+    IMPORT_C TInt Open(MRingToneObserver& aObserver, TPtr aFileName);
 
     /**
      * ?description
@@ -105,8 +99,7 @@
      * @param RFile&
      * @return TInt
      */
-    IMPORT_C TInt Open(MRingToneObserver& aObserver,
-                       RFile& aFileHandle);
+    IMPORT_C TInt Open(MRingToneObserver& aObserver, RFile& aFileHandle);
 
     /**
      * ?description
@@ -117,9 +110,8 @@
      * @param TPtr8
      * @return TInt
      */
-    IMPORT_C TInt Open(MRingToneObserver& aObserver,
-                       TPtr8 aDesTone,
-                       TPtr8 aMimeType);
+    IMPORT_C TInt Open(MRingToneObserver& aObserver, TPtr8 aDesTone,
+            TPtr8 aMimeType);
 
     /**
      * ?description
--- a/mmmw_plat/voip_audio_services_api/inc/voipuplinkstream.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voipuplinkstream.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,20 +1,19 @@
 /*
-* Copyright (c) 2008 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 VoIP uplink stream APIs.
-*
-*/
-
+ * Copyright (c) 2008 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 VoIP uplink stream APIs.
+ *
+ */
 
 #ifndef __VOIPUPLINKSTREAM_H
 #define __VOIPUPLINKSTREAM_H
@@ -22,27 +21,25 @@
 #include <voipaudiocommon.h>
 #include <voipdtmftoneplayer.h>
 
-
 // FORWARD DECLARATIONS
 class CVoIPDataBuffer;
 class CVoIPFormatIntfc;
 class CVoIPAudioUplinkStream;
 class CVoIPAudioUplinkStreamImpl;
 
-
 /**
  *  MVoIPUplinkObserver class
  *
  *  ?more_complete_description
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class MVoIPUplinkObserver
     {
 public:
     static const TUint KOpenComplete = 1;
-    static const TUint KUplinkError  = 2;
+    static const TUint KUplinkError = 2;
     static const TUint KUplinkClosed = 3;
 
 public:
@@ -55,7 +52,7 @@
      * @return void
      */
     virtual void EmptyBuffer(const CVoIPAudioUplinkStream& aSrc,
-                             CVoIPDataBuffer* aBuffer) = 0;
+            CVoIPDataBuffer* aBuffer) = 0;
 
     /**
      * ?description
@@ -66,19 +63,17 @@
      * @param TInt - Status
      * @return void
      */
-    virtual void Event(const CVoIPAudioUplinkStream& aSrc,
-                       TInt aEventType,
-                       TInt aError) = 0;
+    virtual void Event(const CVoIPAudioUplinkStream& aSrc, TInt aEventType,
+            TInt aError) = 0;
     };
 
-
 /**
  *  CVoIPAudioUplinkStream class
  *
  *  ?more_complete_description
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class CVoIPAudioUplinkStream
     {
@@ -147,7 +142,7 @@
      * @return TInt
      */
     IMPORT_C TInt SetFormat(TVoIPCodecFormat aFormat,
-                            CVoIPFormatIntfc*& aIntfc);
+            CVoIPFormatIntfc*& aIntfc);
 
     /**
      * ?description
@@ -219,5 +214,4 @@
 
 #endif //__VOIPUPLINKSTREAM_H
 
-
 // End of file
--- a/mmmw_plat/voip_audio_services_api/inc/voiputilityfactory.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/inc/voiputilityfactory.h	Fri Apr 16 15:29:42 2010 +0300
@@ -1,21 +1,20 @@
 /*
-* Copyright (c) 2008 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 factory object for creating VoIP downlink and uplink
-*                streams as well as DTMF tone player.
-*
-*/
-
+ * Copyright (c) 2008 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 factory object for creating VoIP downlink and uplink
+ *                streams as well as DTMF tone player.
+ *
+ */
 
 #ifndef __VOIPUTILITYFACTORY_H
 #define __VOIPUTILITYFACTORY_H
@@ -30,14 +29,13 @@
 class CDTMFTonePlayer;
 class CVoIPJitterBufferIntfc;
 
-
 /**
  *  CVoIPUtilityFactory class
  *
  *  ?more_complete_description
  *
  *  @lib VoIPAudioIntfc.dll
- *  @since S60 v5.0
+ *
  */
 class CVoIPUtilityFactory
     {
@@ -45,7 +43,7 @@
     /**
      *  TVoIPCallType
      *  ?description
-     *  @since S60 v5.0
+ *
      */
     enum TVoIPCallType
         {
@@ -83,8 +81,7 @@
      * @return TInt
      */
     IMPORT_C TInt CreateDownlinkStream(const TVersion aVersion,
-                                       const TVoIPCallType aCallType,
-                                       CVoIPAudioDownlinkStream*& aDnLink);
+            const TVoIPCallType aCallType, CVoIPAudioDownlinkStream*& aDnLink);
 
     /**
      * ?description
@@ -96,8 +93,8 @@
      * @return TInt
      */
     IMPORT_C TInt CreateDownlinkStream(const TVersion aVersion,
-                                       CVoIPJitterBufferIntfc*& aJBIntfc,
-                                       CVoIPAudioDownlinkStream*& aDnLink);
+            CVoIPJitterBufferIntfc*& aJBIntfc,
+            CVoIPAudioDownlinkStream*& aDnLink);
 
     /**
      * ?description
@@ -109,8 +106,7 @@
      * @return TInt
      */
     IMPORT_C TInt CreateUplinkStream(const TVersion aVersion,
-                                     const TVoIPCallType aCallType,
-                                     CVoIPAudioUplinkStream*& aUpLink);
+            const TVoIPCallType aCallType, CVoIPAudioUplinkStream*& aUpLink);
 
     /**
      * ?description
@@ -132,8 +128,8 @@
      * @return TInt
      */
     IMPORT_C TInt CreateBuffer(CVoIPDataBuffer*& aBuffer,
-		           			   const CVoIPDataBuffer::TVoIPBufferType aType,
-        		   			   const TVoIPCodecFormat aCodecFormat = EG711);
+            const CVoIPDataBuffer::TVoIPBufferType aType,
+            const TVoIPCodecFormat aCodecFormat = EG711);
 
     /**
      * ?description
@@ -143,7 +139,7 @@
      * @return TInt -
      */
     IMPORT_C TInt GetSupportedDownlinkFormats(
-                  RArray<TVoIPCodecFormat>& aFormats);
+            RArray<TVoIPCodecFormat>& aFormats);
 
     /**
      * ?description
@@ -153,7 +149,7 @@
      * @return TInt -
      */
     IMPORT_C TInt GetSupportedUplinkFormats(
-                  RArray<TVoIPCodecFormat>& aFormats);
+            RArray<TVoIPCodecFormat>& aFormats);
 
 private:
 
--- a/mmmw_plat/voip_audio_services_api/tsrc/Group/bld.inf	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/tsrc/Group/bld.inf	Fri Apr 16 15:29:42 2010 +0300
@@ -1,20 +1,19 @@
 /*
-* Copyright (c) 2008 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: voip audio service -  .
-*
-*/
-
+ * 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: Voip Audio Service - STIF
+ *
+ */
 
 PRJ_PLATFORMS
 // Specify the platforms your component needs to be built for here.
Binary file mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/SignedVoIPTestClass_wClose.SIS has changed
Binary file mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/SignedVoIPTestClass_woClose.SIS has changed
--- a/mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/VoIPAudioServicesTestClass.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/VoIPAudioServicesTestClass.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -1,20 +1,19 @@
 /*
-* Copyright (c) 2002-2008 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: voip audio service -  
-*
-*/
-
+ * Copyright (c) 2002-2008 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: voip audio service -  
+ *
+ */
 
 #include <platform_paths.hrh>
 
@@ -22,15 +21,8 @@
 TARGETTYPE      dll
 UID             0x1000008D 0x101FB3E3
 
-#if defined(EKA2)
 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
-#endif
 
-//TARGETPATH      ?target_path
 DEFFILE         VoIPAudioServicesTestClass.def
 
 SOURCEPATH      ../src
@@ -39,38 +31,20 @@
 SOURCE          VoIPAudioServicesTestClassBlocksCallbacks.cpp
 SOURCE          TimeoutController.cpp
 
+USERINCLUDE     ../inc
 
-USERINCLUDE     ../inc
-//USERINCLUDE     ../../../../inc
-//USERINCLUDE     ../../../../../../inc_domain
-
-//SYSTEMINCLUDE   /epoc32/include
 MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE   /epoc32/include/mmf/common
 SYSTEMINCLUDE   /epoc32/include/mmf/server
 
 LIBRARY         euser.lib
 LIBRARY         stiftestinterface.lib
-
 LIBRARY         Orientationbase.lib
-LIBRARY         efsrv.lib               // File server session for database
-//LIBRARY         mmfserverbaseclasses.lib      // MMF Codec - for Voice Codecs
-//LIBRARY                   mediaclientaudio.lib
-//LIBRARY                   CustomInterfaceUtility.lib
-//LIBRARY                   CustomCommandUtility.lib
-
-LIBRARY             VoIPAudioIntfc.lib
-//LIBRARY           ConfigurationComponentsFactory.lib
-//LIBRARY               RestrictedAudioOutput.lib
-//LIBRARY               MmfDevSound.lib
+LIBRARY         efsrv.lib  // File server session for database
+LIBRARY         VoIPAudioIntfc.lib
 
 LANG            SC
 
-
-// Other possible keywords:
-
-// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
-
 SMPSAFE
 
 // End of File
--- a/mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/VoIPAudioServicesTestClass.pkg	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +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: voip audio service - Test App
-;
-
-;languages
-&EN
-
-;Header
-#{"VoIPAudioServicesTestClass"},(0x10005942),1,0,0
-
-;Localised Vendor name
-%{"VoIPAudioServicesTestClass"}
-
-;Unique Vendor name
-:"Vendor"
-
-;Files to install
-
-"\epoc32\release\armv5\urel\VoIPAudioServicesTestClass.dll"-"c:\Sys\Bin\VoIPAudioServicesTestClass.dll"
-"..\..\init\TestFramework.ini"-"c:\Testframework\TestFramework.ini"
-"..\..\conf\VoIPAudioServicesTestClass.cfg"-"c:\Testframework\VoIPAudioServicesTestClass.cfg"
-
-
-"..\..\data\mmc\alarm 1.aac"-"e:\testing\data\alarm 1.aac"
-"..\..\data\mmc\alarm.aac"-"e:\testing\data\alarm.aac"
-"..\..\data\mmc\test_8khz.wav"-"e:\testing\data\test_8khz.wav"
\ No newline at end of file
Binary file mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/VoIPAudioServicesTestClass.sis has changed
Binary file mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/VoIPAudioServicesTestClass.sisx has changed
--- a/mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/rd-key.pem	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXAIBAAKBgQDLRF+r1FGGkCwTrb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW4
-6Y+LWaA8HMlDdoHRB0FgASisYcFagwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh
-7W7Dt9F5FZij8F7/9Pi6+FhhxZFIf1DD+yry9D7+Sp+BgdNALe4XOpf25QIBAwKB
-gQCHgupyjYuvCsgNHn7PNtnvVxInrB5MQNoPli+O+uNJWUK/Q+57Rl+yO8AoEzDX
-pFaLWiuVVhsdloDnAgabT/FXzYncs6uOHyEUV+dSXb78vtLPJqAX+Fg2i3hOXreB
-yskcZ13/OsKVOu5wgrJkx2baZufkqMwOSytf5y9nwjEIKwJBAP+inobagVNrN62j
-KQva3cC+UN/6XnKdTc0CA6bHyLOaJoH1xiMwG/VS2PGjHI0tiSMNtLn/QPpHJ003
-iabGhdUCQQDLjp/9UjFT6K6CF66Chqf30pZXhx+GTSQZmv/gvZiMly7X9fX9BGX3
-2MbJohBC4yI21XKTbisWywkF73Hwh+TRAkEAqmxprzxWN5zPyRdwspHpKymLP/w+
-9xOJM1atGdqFzRFvAU6EF3Vn+OHl9my9s3OwwgkjJqorUYTE3iUGby8D4wJBAIe0
-aqjhdjfwdFa6dFcEb/qMZDpaFQQzbWZnVUB+ZbMPdI/5TqitmU/l2dvBYCyXbCSO
-TGJJcg8yBgP09qBamIsCQFL7j1tM0XPVQJQ89WpKCld7O9ORxRGVj1eG0tWijrH8
-mGbYh8SGCVoWV3vrKSS8GBrFVgQnqUaHuEdtM7tpCAQ=
------END RSA PRIVATE KEY-----
--- a/mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/rd.cer	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
------BEGIN CERTIFICATE-----
-MIICzDCCAjWgAwIBAgIBADANBgkqhkiG9w0BAQUFADArMRAwDgYDVQQKEwdSRCBD
-ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZTAeFw0wNDExMTUxMjQyMDZaFw0z
-NzA5MjMxMjQyMDZaMCsxEDAOBgNVBAoTB1JEIENlcnQxFzAVBgNVBAMTDlJEIENl
-cnRpZmljYXRlMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDLRF+r1FGGkCwT
-rb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW46Y+LWaA8HMlDdoHRB0FgASisYcFa
-gwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh7W7Dt9F5FZij8F7/9Pi6+FhhxZFI
-f1DD+yry9D7+Sp+BgdNALe4XOpf25QIBA6OCAQAwgf0wDAYDVR0TBAUwAwEB/zAL
-BgNVHQ8EBAMCAoQwHQYDVR0OBBYEFFi/kuGzxhVpjGxe9ZwlxC3fH9jFMFMGA1Ud
-IwRMMEqAFFi/kuGzxhVpjGxe9ZwlxC3fH9jFoS+kLTArMRAwDgYDVQQKEwdSRCBD
-ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZYIBADBsBgNVHSAEZTBjMGEGBFUd
-IAAwWTATBggrBgEFBQcCARYHaHR0cDovLzBCBggrBgEFBQcCAjA2GjRGb3IgUiZE
-IHVzYWdlIG9ubHkuIFRoaXMgY2VydGlmaWNhdGUgaXMgbm90IHRydXN0ZWQuMA0G
-CSqGSIb3DQEBBQUAA4GBAHGB4RQMAgBdeT2hxfOr6f2nA/dZm+M5yX5daUtZnET9
-Ed0A9sazLawfN2G1KFQT9kxEParAyoAkpbMAsRrnRz/9cM3OHgFm/NiKRnf50DpT
-7oCx0I/65mVD2kt+xXE62/Ii5KPnTufIkPi2uLvURCia1tTS8JmJ8dtxDGyQt8BR
------END CERTIFICATE-----
--- a/mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/inc/VoIPAudioServicesTestClass.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/inc/VoIPAudioServicesTestClass.h	Fri Apr 16 15:29:42 2010 +0300
@@ -106,9 +106,9 @@
 _LIT16(KTestFile3, "\\testing\\data\\test_8khz.wav");
 #else
 _LIT( KVoIPAudioServicesTestClassLogPath, "e:\\testing\\Log\\" );
-_LIT16(KTestFile1, "e:\\testing\\data\\alarm 1.aac");
-_LIT16(KTestFile2, "e:\\testing\\data\\alarm.aac");
-_LIT16(KTestFile3, "e:\\testing\\data\\test_8khz.wav");
+_LIT16(KTestFile1, "c:\\testing\\data\\alarm 1.aac");
+_LIT16(KTestFile2, "c:\\testing\\data\\alarm.aac");
+_LIT16(KTestFile3, "c:\\testing\\data\\test_8khz.wav");
 #endif
 
 // Log file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/sis/VoIPAudioServicesTestClass.pkg	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,37 @@
+;
+; 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: VoIP Audio Service - STIF Test
+;
+
+;languages
+&EN
+
+;Header
+#{"VoIPAudioServicesTestClass"},(0x10005942),1,0,0
+
+;Localised Vendor name
+%{"VoIPAudioServicesTestClass"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files to install
+
+"/epoc32/release/armv5/urel/VoIPAudioServicesTestClass.dll"-"c:/Sys/Bin/VoIPAudioServicesTestClass.dll"
+;"../../init/TestFramework.ini"-"c:/Testframework/TestFramework.ini"
+"../../conf/VoIPAudioServicesTestClass.cfg"-"c:/Testframework/VoIPAudioServicesTestClass.cfg"
+
+;"../../data/mmc/alarm 1.aac"-"e:/testing/data/alarm 1.aac"
+;"../../data/mmc/alarm.aac"-"e:/testing/data/alarm.aac"
+"../../data/mmc/test_8khz.wav"-"c:/testing/data/test_8khz.wav"
\ No newline at end of file
Binary file mmmw_plat/voip_audio_services_api/tsrc/data/mmc/alarm 1.aac has changed
--- a/mmmw_plat/voip_audio_services_api/tsrc/init/TestFramework.ini	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/tsrc/init/TestFramework.ini	Fri Apr 16 15:29:42 2010 +0300
@@ -1,5 +1,5 @@
 #
-# This is STIFTestFramework initialization file
+# This is STIF initialization file
 # Comment lines start with '#'-character.
 # See STIF TestFramework users guide.doc for instructions
 
@@ -22,6 +22,8 @@
 # 	- 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'.
+#   + XML, Test report will be xml type, for example 'TestReport.xml'.
+#          Note, that xml format is available only when output is set to FILE.
 #
 # 	- File output indicates output source of the test report.
 #		+ FILE, Test report logging to file.
@@ -41,25 +43,25 @@
 
 [Engine_Defaults]
 
-TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
-                                                               'TestCases' or 'FullReport'
+TestReportMode= FullReport    # Possible values are: 'Empty', 'Summary', 'Environment',
+                              #                      'TestCases' or 'FullReport'
 
-CreateTestReport= YES			# Possible values: YES or NO
+CreateTestReport= YES         # Possible values: YES or NO
 
-TestReportFilePath= c:\LOGS\TestFramework\
-TestReportFileName= TestReport_VoIPAudioServicesTestClass
+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
+TestReportFormat= TXT         # Possible values: TXT, HTML or XML
+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'
+DisableMeasurement= stifmeasurementdisablenone  # Possible values are:
+              # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
+              # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
+              # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
+              # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
 
 [End_Defaults]
 # -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
@@ -86,12 +88,9 @@
 # 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\VoIPAudioServicesTestClass.ini
 TestCaseFile= c:\testframework\VoIPAudioServicesTestClass.cfg
 [End_Module]
 
@@ -114,7 +113,7 @@
 
 
 # -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set STIFTestFramework logging overwrite parameters for Logger.
+# Set STIF 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.
 #	
@@ -174,24 +173,24 @@
 #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
+#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
+#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
+#HardwareFormat= HTML         # Possible values: TXT or HTML
+#HardwareOutput= FILE         # Possible values: FILE or RDEBUG
 
-#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+#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
+#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
+#FileUnicode= YES             # Possible values: YES or NO
 
 [End_Logger_Defaults]
 # -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--- a/mmmw_plat/voip_audio_services_api/tsrc/init/VoIPAudioServicesTestClass.ini	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmmw_plat/voip_audio_services_api/tsrc/init/VoIPAudioServicesTestClass.ini	Fri Apr 16 15:29:42 2010 +0300
@@ -1,4 +1,4 @@
 [general]
 logFileName VoIPAudioServicesTestClass.log
-logPath e:\testing\Log\
+logPath C:\Log\
 [general_end]
--- a/mmserv/callaudiocontrol/group/CallAudioControl.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/callaudiocontrol/group/CallAudioControl.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -24,7 +24,7 @@
 #include <platform_paths.hrh>
 #endif
 
-TARGET          CallAudioControl.dll
+TARGET          callaudiocontrol.dll
 TARGETTYPE      DLL
 UID             0x1000008D 0x10207BD2
 
@@ -46,7 +46,7 @@
 //SYSTEMINCLUDE	/epoc32/include/CallAudioControl
 
 LIBRARY         euser.lib
-LIBRARY		TelephonyAudioRouting.lib
+LIBRARY		telephonyaudiorouting.lib
 LIBRARY		centralrepository.lib
 
 #ifdef __SERIES60_31__
@@ -57,7 +57,7 @@
 #endif
 
 #ifndef __SERIES60_31__
-LIBRARY		PhoneClient.lib   // For setting mute
+LIBRARY		phoneclient.lib   // For setting mute
 #endif
 
 // End of file
--- a/mmserv/callaudiocontrol/group/bld.inf	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/callaudiocontrol/group/bld.inf	Fri Apr 16 15:29:42 2010 +0300
@@ -27,8 +27,8 @@
 
 PRJ_EXPORTS
 
-../data/CallAudioControl_Stub.sis   /epoc32/data/z/system/install/CallAudioControl_Stub.sis
-../data/backup_registration.xml     /epoc32/data/z/private/10207BD2/backup_registration.xml
+../data/CallAudioControl_Stub.sis   /epoc32/data/z/system/install/callaudiocontrol_stub.sis
+../data/backup_registration.xml     /epoc32/data/z/private/10207bd2/backup_registration.xml
 
 #ifdef __SERIES60_31__
 ../rom/CallAudioControl.iby  /epoc32/rom/include/CallAudioControl.iby
--- a/mmserv/callaudiocontrol/inc/CallAudioControlImpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/callaudiocontrol/inc/CallAudioControlImpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -33,7 +33,7 @@
 #include <PhCltExt.h>       // link against PhoneClientExt.lib
 #include <MediatorCommandInitiator.h>
 #else
-#include <CPhCltCommandHandler.h> // wasn't introduced until 3.2
+#include <cphcltcommandhandler.h> // wasn't introduced until 3.2
 #endif
 
 #include "CallAudioControlUtility.h"
--- a/mmserv/radioutility/fmpresetutility/BWINS/FmPresetUtilityU.DEF	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-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> &)
-
Binary file mmserv/radioutility/fmpresetutility/Conf/fmpresetutility.confml has changed
Binary file mmserv/radioutility/fmpresetutility/Conf/fmpresetutility_10207B87.crml has changed
--- a/mmserv/radioutility/fmpresetutility/EABI/FmPresetUtilityU.DEF	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-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 ; #<TI>#
-	_ZTI25CCentralRepositoryHandler @ 13 NONAME ; #<TI>#
-	_ZTIN21CRadioFmPresetUtility5CBodyE @ 14 NONAME ; #<TI>#
-	_ZTV21CRadioFmPresetUtility @ 15 NONAME ; #<VT>#
-	_ZTV25CCentralRepositoryHandler @ 16 NONAME ; #<VT>#
-	_ZTVN21CRadioFmPresetUtility5CBodyE @ 17 NONAME ; #<VT>#
-	_ZThn4_N21CRadioFmPresetUtility13DeletePresetLEi @ 18 NONAME ; #<thunk>#
-	_ZThn4_NK21CRadioFmPresetUtility14GetNextPresetLEiRi @ 19 NONAME ; #<thunk>#
-	_ZThn4_NK21CRadioFmPresetUtility15GetFirstPresetLERi @ 20 NONAME ; #<thunk>#
-	_ZThn4_NK21CRadioFmPresetUtility18GetNumberOfPresetsERi @ 21 NONAME ; #<thunk>#
-	_ZThn4_NK21CRadioFmPresetUtility21GetMaxNumberOfPresetsERi @ 22 NONAME ; #<thunk>#
-	_ZThn8_N21CRadioFmPresetUtility10GetPresetLEiR4TBufILi32EERi @ 23 NONAME ; #<thunk>#
-	_ZThn8_N21CRadioFmPresetUtility10SetPresetLEiRK4TBufILi32EEi @ 24 NONAME ; #<thunk>#
-	_ZN21CRadioFmPresetUtility14GetPresetNameLEiR4TBufILi32EE @ 25 NONAME
-	_ZN21CRadioFmPresetUtility19GetPresetFrequencyLEiRi @ 26 NONAME
-	_ZThn8_N21CRadioFmPresetUtility14GetPresetNameLEiR4TBufILi32EE @ 27 NONAME ; #<thunk>#
-	_ZThn8_N21CRadioFmPresetUtility19GetPresetFrequencyLEiRi @ 28 NONAME ; #<thunk>#
-	_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
-
Binary file mmserv/radioutility/fmpresetutility/cenrep/keys_fmpresetutility.xls has changed
--- a/mmserv/radioutility/fmpresetutility/group/FmPresetUtility.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* 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 file for 
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-TARGET        FmPresetUtility.dll
-TARGETTYPE    DLL
-CAPABILITY    CAP_GENERAL_DLL ReadUserData
-VENDORID      VID_DEFAULT
-UID           0x1000008D 0x10207B87 
-VERSION 10.1
-
-SOURCEPATH    ../src
-SOURCE	    RadioFmPresetUtility.cpp
-SOURCE	    RadioFmPresetUtilityBody.cpp
-SOURCE	    RadioFmPresetCentralRepositoryHandler.cpp
-SOURCE	    RadioFmPresetRadioSettings.cpp  
-SOURCE	    RadioFmPresetChannel.cpp
-
-
-USERINCLUDE   ../cenrep
-USERINCLUDE   ../src
-USERINCLUDE   ../inc
-USERINCLUDE   ../../inc
-
-MW_LAYER_SYSTEMINCLUDE
-
- 
-LIBRARY CenRepNotifHandler.lib 
-LIBRARY centralrepository.lib 
-LIBRARY euser.lib 
-LIBRARY Flogger.lib 
-LIBRARY estor.lib 
-LIBRARY dsclient.lib
-
-
--- a/mmserv/radioutility/fmpresetutility/group/backup_registration.xml	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<?xml version="1.0" standalone="yes"?>
-<backup_registration version="1.0">
-    <proxy_data_manager sid = "0x10202BE9" />
-    <restore requires_reboot = "no"/>
-</backup_registration>
-
--- a/mmserv/radioutility/fmpresetutility/group/bld.inf	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-* 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 build file for FMPresetUtility
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-// Platforms the component needs to be built on
-//
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-backup_registration.xml  z:/private/10207B87/backup_registration.xml
-
-// iby file
-../rom/FmPresetUtility.iby			CORE_MW_LAYER_IBY_EXPORT_PATH(FmPresetUtility.iby)
-
-// Generic configuration interface for component cenrep settings  
-// fmpresetutility_10207B87 implementation specifics for cenrep data
-../Conf/fmpresetutility.confml                  MW_LAYER_CONFML(fmpresetutility.confml)
-../Conf/fmpresetutility_10207B87.crml 	        MW_LAYER_CRML(fmpresetutility_10207B87.crml)
-
-PRJ_MMPFILES
-FmPresetUtility.mmp
-
-// End of file
--- a/mmserv/radioutility/fmpresetutility/rom/FmPresetUtility.iby	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* Copyright (c) 2005 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
-
-#ifdef __FM_RADIO
-
-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 //__FM_RADIO
-#endif // FMPRESETUTILITY_IBY
-
-//  End of File  
--- a/mmserv/radioutility/fmpresetutility/src/RadioFmPresetCRKeys.h	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
-* Copyright (c) 2005 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:  Definition of central repository keys for Fm Preset Utility.
-*
-*/
-
-
-#ifndef RADIOFMPRESETCRKEYS_H
-#define RADIOFMPRESETCRKEYS_H
-
-// FM Preset Utility UID
-const TUid KCRUidFmPresetUtility = {0x10207B87}; 
-
-// The first preset channel's location in central repository
-const TUint32 KFmRadioBookKeepingLocation = 0x00000001;
-const TUint32 KFmRadioPresetChannel1 = 0x00001000;
-const TUint32 KNbrOfParametersPerChannelSequence = 0x10;
-const TUint32 KChannelNameOffset = 0x0;
-const TUint32 KFrequencyOffset = 0x1;
-const TUint32 KUrlOffset = 0x2;
-const TUint32 KRestOfParametersOffset = 0xF;
-
-#endif      // RADIOFMPRESETCRKEYS_H
-
-// End of file
-
-
--- a/mmserv/radioutility/fmpresetutility/src/RadioFmPresetCentralRepositoryHandler.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,826 +0,0 @@
-/*
-* Copyright (c) 2005 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 CCentralRepositoryHandler class. 
-*
-*/
-
-
-//  INCLUDE FILES
-#include "RadioFmPresetCentralRepositoryHandler.h"
-#include "RadioFmPresetRadioSettings.h" 
-#include <centralrepository.h>
-#include "RadioFmPresetCRKeys.h"
-#include "RadioFmPresetUtilityBody.h"		
-#include "debug.h"
-#include <s32mem.h>
-
-
-// ============= STATIC FUNCTIONS ==============
-
-static TInt ChannelIndexL( const TInt aChannelIndex )
-    {
-    if ( ( KMaxNumberOfPresetStations <= aChannelIndex ) ||
-            ( 0 >  aChannelIndex ) )
-        {
-        User::Leave( KErrArgument );
-        }
-    return KFmRadioPresetChannel1 +
-        ( KNbrOfParametersPerChannelSequence * (aChannelIndex) );
-    }
-
-// ----------------------------------------------------
-// CalculateNameIndexL
-// Calculates key index for channel's name parameter for.
-// Returns: key index of channel name parameter
-// ----------------------------------------------------
-// 
-static TInt CalculateNameIndexL( TInt aChannelIndex )
-    {
-    return (ChannelIndexL( aChannelIndex ) + KChannelNameOffset);
-    }
-
-// ----------------------------------------------------
-// CalculateFrequencyIndexL
-// Calculates key index for channel's frequency parameter.
-// Returns: key index of channel frequency parameter
-// ----------------------------------------------------
-// 
-static TInt CalculateFrequencyIndexL( TInt aChannelIndex )
-    {
-    return (ChannelIndexL( aChannelIndex ) + KFrequencyOffset);
-    }
-
-// ----------------------------------------------------
-// CalculateUrlIndexL
-// Calculates key index for channel's URL parameter.
-// Returns: key index of channel URL parameter
-// ----------------------------------------------------
-// 
-static TInt CalculateUrlIndexL( TInt aChannelIndex )
-    {
-    return (ChannelIndexL( aChannelIndex ) + KUrlOffset);
-    }
-
-// ----------------------------------------------------
-// CalculateRestOfParametersIndexL
-// Calculates key index for channel's other parameters.
-// Returns: key index of channel other parameters
-// ----------------------------------------------------
-// 
-static TInt CalculateRestOfParametersIndexL( TInt aChannelIndex )
-    {
-    return (ChannelIndexL( aChannelIndex ) + KRestOfParametersOffset);
-    }
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::CCentralRepositoryHandler
-// Default class constructor.
-// ----------------------------------------------------
-//
-CCentralRepositoryHandler::CCentralRepositoryHandler(
-    TRadioSettings& aRadioSettings)  // a reference to aRadioSettings
-    :iRadioSettings(&aRadioSettings)
-    {
-    FTRACE(FPrint(_L("calling CCentralRepositoryHandler::NewL()")));
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::ConstructL
-// Second phase class constructor.
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::ConstructL()
-    {
-    RDebug::Print(_L("entering CCentralRepositoryHandler::ConstructL()"));
-    TRAPD (err, iCentralRepository = CRepository::NewL(KCRUidFmPresetUtility));
-    RDebug::Print(_L("err[%d]"), err);
-    RDebug::Print(_L("calling CCentralRepositoryHandler::RetrieveInitialSettings()"));
-    RetrieveInitialSettings();
-    RDebug::Print(_L("exiting CCentralRepositoryHandler::ConstructL()"));
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::NewL
-// Two-phased class constructor.
-// ----------------------------------------------------
-//
-CCentralRepositoryHandler* CCentralRepositoryHandler::NewL(
-    TRadioSettings& aRadioSettings)  // a reference to aRadioSettings
-    {
-    RDebug::Print(_L("entering CCentralRepositoryHandler::NewL()"));    	
-    CCentralRepositoryHandler *self = new(ELeave) CCentralRepositoryHandler(aRadioSettings);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::~CCentralRepositoryHandler
-// Destructor of CCentralRepositoryHandler class.
-// ----------------------------------------------------
-//
-CCentralRepositoryHandler::~CCentralRepositoryHandler()
-    {
-    iRadioSettings = NULL;
-	  if(iCentralRepository)
-	     {
-	     delete iCentralRepository;
-	     }
-    }
-
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::RetrieveInitialSettings
-// Retrieves persistent settings from shared data.
-// Returns: None
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::RetrieveInitialSettings()
-    {
-    
-    
-
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::RetrievePresetFrequency
-// Retrieve the preset frequency from shared data
-// Returns: None
-// ----------------------------------------------------
-//
-TInt CCentralRepositoryHandler::RetrievePresetFrequencyL(
-    TInt aIndex) const  // the preset index
-    {
-    TInt tempFrequency( KErrNotFound );
-    // Read frequency from its own key in the key sequence
-    iCentralRepository->Get( CalculateFrequencyIndexL( aIndex ), tempFrequency );
-    return tempFrequency;
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::RetrievePresetName
-// Retrieve the preset name from shared data
-// Returns: None
-// ----------------------------------------------------
-//
-TFmPresetName CCentralRepositoryHandler::RetrievePresetNameL(
-    TInt aIndex) const  // the preset channel index
-    {
-    // Read name from its own key in the key sequence
-    TInt nameIndex( CalculateNameIndexL( aIndex ) );
-    TFmPresetName tempChannelName;
-    iCentralRepository->Get(nameIndex, tempChannelName );
-    return tempChannelName;
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::RetrievePresetUrl
-// Retrieve the preset Url from shared data
-// Returns: None
-// ----------------------------------------------------
-//
-TFmPresetUrl CCentralRepositoryHandler::RetrievePresetUrlL(
-    TInt aIndex) const  // the preset channel index
-    {    
-    // Read url from its own key in the key sequence
-    TInt urlIndex( CalculateUrlIndexL( aIndex ) );
-    TFmPresetUrl tempUrlName;
-    iCentralRepository->Get(urlIndex, tempUrlName );   
-    return tempUrlName;     //ownership moves to the caller
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::RetrievePresetPTYL
-// Retrieve the preset PTY from shared data
-// Returns: tempPTY: the channel PTY
-// ----------------------------------------------------
-//
-TUint CCentralRepositoryHandler::RetrievePresetPTYL(
-    TInt aIndex) const  // the preset index
-    {
-    TUint tempPTY = KDefaultRadioPTY;
-    HBufC8* buf = HBufC8::NewLC( sizeof(TPresetChannel) );
-    TPtr8 bufPtr = buf->Des();
-    TInt tempChannelIndex( CalculateRestOfParametersIndexL( aIndex ) );
-    TInt errCode = iCentralRepository->Get( tempChannelIndex, bufPtr );
-    if(KErrNone == errCode)
-        {
-        if (bufPtr.Length() != 0)
-            {
-            tempPTY = ConvertStringToChannelPTYL(bufPtr);
-            }
-        } 
-    CleanupStack::PopAndDestroy(buf);
-    return tempPTY;
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::RetrievePresetPIL
-// Retrieve the preset PI from shared data
-// Returns: tempPI: the channel PI
-// ----------------------------------------------------
-//
-TUint CCentralRepositoryHandler::RetrievePresetPIL(
-    TInt aIndex) const  // the preset index
-    {
-    TUint tempPI = KDefaultRadioPI;
-    HBufC8* buf = HBufC8::NewLC( sizeof(TPresetChannel) );
-    TPtr8 bufPtr = buf->Des();
-    TInt tempChannelIndex( CalculateRestOfParametersIndexL( aIndex ) );
-    TInt errCode = iCentralRepository->Get( tempChannelIndex, bufPtr );
-    if(KErrNone == errCode)
-        {
-        if (bufPtr.Length() != 0)
-            {
-            tempPI = ConvertStringToChannelPIL(bufPtr);
-            }
-        } 
-    CleanupStack::PopAndDestroy(buf);
-    return tempPI;
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::RetrievePresetFavouriteL
-// Retrieve the preset favourite information from shared data
-// Returns: tempFav: the channel local station flag
-// ----------------------------------------------------
-//
-TBool CCentralRepositoryHandler::RetrievePresetFavouriteL(
-    TInt aIndex) const  // the preset index
-    {
-    TBool tempFav = EFalse;
-    HBufC8* buf = HBufC8::NewLC(sizeof(TPresetChannel));
-    TPtr8 bufPtr = buf->Des();
-    TInt tempChannelIndex( CalculateRestOfParametersIndexL( aIndex ) );
-    TInt errCode = iCentralRepository->Get(tempChannelIndex, bufPtr);
-    if(KErrNone == errCode)
-    {
-    if (bufPtr.Length() != 0)
-        {
-        tempFav = ConvertStringToChannelFavouriteL(bufPtr);
-        }
-    } 
-    CleanupStack::PopAndDestroy(buf);
-    return tempFav;
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::RetrievePresetUserRenameL
-// Retrieve the preset user rename information from shared data
-// Returns: tempRen: the channel user rename flag
-// ----------------------------------------------------
-//
-TBool CCentralRepositoryHandler::RetrievePresetUserRenameL(
-    TInt aIndex) const  // the preset index
-    {
-    TBool tempRen = EFalse;
-    HBufC8* buf = HBufC8::NewLC(sizeof(TPresetChannel));
-    TPtr8 bufPtr = buf->Des();
-    TInt tempChannelIndex( CalculateRestOfParametersIndexL( aIndex ) );
-    TInt errCode = iCentralRepository->Get(tempChannelIndex, bufPtr);
-    if(KErrNone == errCode)
-        {
-        if (bufPtr.Length() != 0)
-            {
-            tempRen = ConvertStringToChannelUserRenameL(bufPtr);
-            }
-        } 
-    CleanupStack::PopAndDestroy(buf);
-    return tempRen;
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::SavePresetFrequency
-// Save channel preset info back to shared data
-// Returns: None
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::SavePresetFrequencyL(
-    TInt aIndex,   // preset channel index
-    TInt aFrequency)  //new frequency
-    {    
-    TInt frequencyIndex( CalculateFrequencyIndexL( aIndex ) );
-    User::LeaveIfError( iCentralRepository->Set(frequencyIndex, aFrequency ) );
-    if ( 0 >= aFrequency )
-        {
-        // aFrequency values 0, -1(Or <=0) means that it is better to destroy
-        // rest of parameters and also URL
-        iCentralRepository->Delete( CalculateRestOfParametersIndexL( aIndex ) );
-        iCentralRepository->Delete( CalculateUrlIndexL( aIndex ) );
-        }
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::SavePresetName
-// Save channel preset name back to shared data
-// Returns: None
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::SavePresetNameL(
-    TInt aIndex,  //the preset channel index
-    const TFmPresetName& aStationName )  //preset channel name
-    {
-    TInt nameIndex( CalculateNameIndexL(aIndex) );
-    TPtrC namePtr( aStationName );
-    User::LeaveIfError( iCentralRepository->Set( nameIndex, namePtr) );
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::SavePresetUrlL
-// Save channel preset url back to shared data
-// Returns: None
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::SavePresetUrlL(
-    TInt aIndex,  //the preset channel index
-    const TFmPresetUrl& aStationUrl )  //preset Url
-    {
-    TInt urlIndex( CalculateUrlIndexL(aIndex) );
-    TPtrC urlPtr( aStationUrl );
-    User::LeaveIfError( iCentralRepository->Set( urlIndex, urlPtr ) );
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::SavePresetPIL
-// Save channel PI code back to shared data
-// Returns: None
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::SavePresetPIL(
-    TInt aIndex,   // preset channel index
-    TUint aPI)     // new programme identification code
-    {    
-    TPresetChannel presetChannel;
-    TInt restOfParametersIndex( CalculateRestOfParametersIndexL( aIndex ) );
-    HBufC8* buf = HBufC8::NewLC(sizeof(TPresetChannel));
-    TPtr8 bufPtr = buf->Des();
-    UpdateChannelObjectWithPIL(aIndex, presetChannel, aPI); 
-    ExternalizeToStreamL(presetChannel, bufPtr); 
-    User::LeaveIfError( iCentralRepository->Set(restOfParametersIndex, bufPtr ) );
-    CleanupStack::PopAndDestroy(buf);
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::SavePresetPTYL
-// Save channel PTY code back to shared data
-// Returns: None
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::SavePresetPTYL(
-    TInt aIndex,   // preset channel index
-    TUint aPTY)    // new programme identification code
-    {
-    TPresetChannel presetChannel;
-    TInt restOfParametersIndex( CalculateRestOfParametersIndexL( aIndex ) );
-    HBufC8* buf = HBufC8::NewLC(sizeof(TPresetChannel));
-    TPtr8 bufPtr = buf->Des();
-    UpdateChannelObjectWithPTYL(aIndex, presetChannel, aPTY); 
-    ExternalizeToStreamL(presetChannel, bufPtr); 
-    User::LeaveIfError( iCentralRepository->Set(restOfParametersIndex, bufPtr ) );
-    CleanupStack::PopAndDestroy(buf);
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::SavePresetFavouriteInfoL
-// Save channel favourite station info back to shared data
-// Returns: None
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::SavePresetFavouriteInfoL(
-    TInt aIndex,   // preset channel index
-    TBool aFav)    // new programme favourite status
-    {
-    TPresetChannel presetChannel ;
-    TInt restOfParametersIndex( CalculateRestOfParametersIndexL( aIndex ) );
-    HBufC8* buf = HBufC8::NewLC(sizeof(TPresetChannel));
-    TPtr8 bufPtr = buf->Des();
-    UpdateChannelObjectWithFavouriteInfoL(aIndex, presetChannel, aFav); 
-    ExternalizeToStreamL(presetChannel, bufPtr); 
-    User::LeaveIfError( iCentralRepository->Set(restOfParametersIndex, bufPtr ) );
-    CleanupStack::PopAndDestroy(buf);
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::SavePresetUserRenameInfoL
-// Save channel favourite station info back to shared data
-// Returns: None
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::SavePresetUserRenameInfoL(
-    TInt aIndex,   // preset channel index
-    TBool aUR)     // new programme user rename status
-    {
-    TPresetChannel presetChannel;
-    TInt restOfParametersIndex( CalculateRestOfParametersIndexL( aIndex ) );
-    HBufC8* buf = HBufC8::NewLC(sizeof(TPresetChannel));
-    TPtr8 bufPtr = buf->Des();
-    UpdateChannelObjectWithUserRenameInfoL(aIndex, presetChannel, aUR); 
-    ExternalizeToStreamL(presetChannel, bufPtr); 
-    User::LeaveIfError( iCentralRepository->Set(restOfParametersIndex, bufPtr ) );
-    CleanupStack::PopAndDestroy(buf);
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::SaveFmPresetSettings
-// Save all FmPreset related persistent info back to shared data
-// Returns: None
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::SaveFmPresetSettings()
-    {
- /* DEPRECATED. Not used anymore    
-    iCentralRepository->Set( KFmRadioFrequency, iRadioSettings->Frequency() );
-    iCentralRepository->Set( KFmRadioChannel, iRadioSettings->CurrentPreset() );
-    */
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::ConvertStringToChannelPTYL
-// Get the channel programme type code from the externalized stream
-// Returns: tempPTY: the channel PTY
-//          ?value_n: ?description
-//                    ?description
-// ----------------------------------------------------
-//
-TUint CCentralRepositoryHandler::ConvertStringToChannelPTYL(
-    const TDesC8& aString) const  // a reference to the raw string
-    {
-RDebug::Print (_L ("Entering CCentralRepositoryHandler::ConvertStringToChannelPTYL"));        
-    TUint tempPTY = KDefaultRadioPTY;
-    TPresetChannel tempPresetChannel;
-    RDesReadStream inStream;
-    inStream.Open(aString);
-    CleanupClosePushL(inStream);
-    tempPresetChannel.InternalizeL(inStream);
-    CleanupStack::PopAndDestroy(&inStream);
-    tempPTY = tempPresetChannel.ChannelPty();
-RDebug::Print (_L ("Exiting CCentralRepositoryHandler::ConvertStringToChannelPTYL"));             
-    return tempPTY;
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::ConvertStringToChannelPIL
-// Get the channel programme identification code from the externalized stream
-// Returns: tempPI: the channel PI
-//          ?value_n: ?description
-//                    ?description
-// ----------------------------------------------------
-//
-TUint CCentralRepositoryHandler::ConvertStringToChannelPIL(
-    const TDesC8& aString) const  // a reference to the raw string
-    {
-RDebug::Print (_L ("Entering CCentralRepositoryHandler::ConvertStringToChannelPIL"));        
-    TUint tempPI = KDefaultRadioPI;
-    TPresetChannel tempPresetChannel;
-    RDesReadStream inStream;
-    inStream.Open(aString);
-    CleanupClosePushL(inStream);
-    tempPresetChannel.InternalizeL(inStream);
-    CleanupStack::PopAndDestroy(&inStream);
-    tempPI = tempPresetChannel.ChannelPI();
-RDebug::Print (_L ("Exiting CCentralRepositoryHandler::ConvertStringToChannelPIL"));             
-    return tempPI;
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::ConvertStringToChannelFavouriteL
-// Get the channel favourite flag from the externalized stream
-// Returns: tempFav: the channel favourite flag
-//          ?value_n: ?description
-//                    ?description
-// ----------------------------------------------------
-//
-TBool CCentralRepositoryHandler::ConvertStringToChannelFavouriteL(
-    const TDesC8& aString) const  // a reference to the raw string
-    {
-RDebug::Print (_L ("Entering CCentralRepositoryHandler::ConvertStringToChannelFavouriteL"));        
-    TBool tempFav = EFalse;
-    TPresetChannel tempPresetChannel;
-    RDesReadStream inStream;
-    inStream.Open(aString);
-    CleanupClosePushL(inStream);
-    tempPresetChannel.InternalizeL(inStream);
-    CleanupStack::PopAndDestroy(&inStream);
-    tempFav = tempPresetChannel.ChannelFavouriteInfo();
-RDebug::Print (_L ("Exiting CCentralRepositoryHandler::ConvertStringToChannelFavouriteL"));             
-    return tempFav;
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::ConvertStringToChannelUserRenameL
-// Get the channel user rename flag from the externalized stream
-// Returns: tempRen: the channel favourite flag
-//          ?value_n: ?description
-//                    ?description
-// ----------------------------------------------------
-//
-TBool CCentralRepositoryHandler::ConvertStringToChannelUserRenameL(
-    const TDesC8& aString) const  // a reference to the raw string
-    {
-RDebug::Print (_L ("Entering CCentralRepositoryHandler::ConvertStringToChannelUserRenameL"));        
-    TBool tempRen = EFalse;
-    TPresetChannel tempPresetChannel;
-    RDesReadStream inStream;
-    inStream.Open(aString);
-    CleanupClosePushL(inStream);
-    tempPresetChannel.InternalizeL(inStream);
-    CleanupStack::PopAndDestroy(&inStream);
-    tempRen = tempPresetChannel.ChannelUserRenameInfo();
-RDebug::Print (_L ("Exiting CCentralRepositoryHandler::ConvertStringToChannelUserRenameL"));             
-    return tempRen;
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::UpdateChannelObjectWithPIL
-// Update the current preset channel's PI code 
-// Returns: none
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::UpdateChannelObjectWithPIL (
-    TInt aIndex,   //the channel index
-    TPresetChannel& aPresetChannel, // reference to channel object
-    TUint aPI) // new frequency
-    {
-    //Initialize the channel object with correct information.
-    GetPresetL( aIndex, aPresetChannel );    
-    aPresetChannel.SetChannelPI(aPI);
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::UpdateChannelObjectWithPTYL
-// Update the current preset channel's PTY code 
-// Returns: none
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::UpdateChannelObjectWithPTYL (
-    TInt aIndex,   //the channel index
-    TPresetChannel& aPresetChannel, // reference to channel object
-    TUint aPTY) // new PTY
-    {
-    //Initialize the channel object with correct information.
-    GetPresetL( aIndex, aPresetChannel );    
-    aPresetChannel.SetChannelPty(aPTY);
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::UpdateChannelObjectWithFavouriteInfoL
-// Update the current preset channel's favourite status 
-// Returns: none
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::UpdateChannelObjectWithFavouriteInfoL (
-    TInt aIndex,   //the channel index
-    TPresetChannel& aPresetChannel, // reference to channel object
-    TBool aFav) // new favourite info
-    {
-    GetPresetL(aIndex, aPresetChannel);
-    aPresetChannel.SetChannelFavouriteInfo(aFav);
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::UpdateChannelObjectWithUserRenameInfoL
-// Update the current preset channel's user rename status 
-// Returns: none
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::UpdateChannelObjectWithUserRenameInfoL (
-    TInt aIndex,   //the channel index
-    TPresetChannel& aPresetChannel, // reference to channel object
-    TBool aUR) // new user rename info
-    {
-    //Initialize the channel object with correct information.
-    GetPresetL( aIndex, aPresetChannel );    
-    aPresetChannel.SetChannelUserRenameInfo(aUR);
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::DeletePresetL
-// Delete the current preset
-// Returns: none
-// ----------------------------------------------------
-//   
-void CCentralRepositoryHandler::DeletePresetL(TInt aIndex)
-	{
-    
-    if ( 0 > aIndex )
-    	{ //Delete all presets
-    	for(TInt i = 0;i<KMaxNumberOfPresetStations;i++)
-    		{
-            iCentralRepository->Delete( CalculateNameIndexL( i ) );    
-            iCentralRepository->Delete( CalculateFrequencyIndexL( i ) );   
-            iCentralRepository->Delete( CalculateUrlIndexL( i ) );
-            iCentralRepository->Delete( CalculateRestOfParametersIndexL( i ) );
-    		}
-    	}
-    else
-    	{
-        iCentralRepository->Delete( CalculateNameIndexL( aIndex ) );    
-        iCentralRepository->Delete( CalculateFrequencyIndexL( aIndex ) );   
-        iCentralRepository->Delete( CalculateUrlIndexL( aIndex ) );
-        iCentralRepository->Delete( CalculateRestOfParametersIndexL( aIndex ) );
-    	}		
-	}
-    
-// ----------------------------------------------------
-// CCentralRepositoryHandler::GetNumberOfPresets
-// Get the current number of presets
-// Returns: number of valid presets in cenrep  
-// ----------------------------------------------------
-//  
-void CCentralRepositoryHandler::GetNumberOfPresetsL(TInt& aNum)
-	{
-    TInt count = 0;
-    const TInt KMinAcceptableRadioFrequency = 76000000;
-    const TInt KMaxAcceptableRadioFrequency = 108000000;
-    TInt err( KErrNone );
-    TInt frequencyIndex( 0 );
-    TInt frequency( 0 );
-    
-    for(TInt index = 0;index < KMaxNumberOfPresetStations;index++)
-    	{
-        frequencyIndex = CalculateFrequencyIndexL( index );
-        err = iCentralRepository->Get( frequencyIndex, frequency );
-    	if(KErrNone == err )
-        	{
-            //Check validity of preset entries
-            if ( ( KMinAcceptableRadioFrequency <= frequency ) && ( KMaxAcceptableRadioFrequency > frequency ) )
-                {
-                count++;
-                if(count == 1)
-                    {
-                    iFirstPreset = index;
-                    }
-                }
-        	} 
-    	}
-    aNum = count;
-	}
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::GetFirstPreset
-// Gets the first preset
-// Returns: none
-// ----------------------------------------------------
-// 
-void CCentralRepositoryHandler::GetFirstPresetL(TInt& aNum)
-    {
-    TInt count   = 0;
-    iFirstPreset = 0;
-
-    GetNumberOfPresetsL(count);     //this updates iFirstPreset
-
-	if(count)
-		{
-		aNum = iFirstPreset;
-		}
-	}
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::GetNextPreset
-// Get the next preset index that has been set, 
-// given the current index
-// Returns: none
-// ----------------------------------------------------
-// 
-void CCentralRepositoryHandler::GetNextPresetL(TInt aIndex,TInt& aNextIndex)
-    {
-    TInt next = 0;
-    TInt err( KErrNone );
-    TInt frequencyIndex( 0 );
-    TInt frequency( 0 );
-    //start search on next one
-    aIndex = aIndex + 1;
-    for(TInt index = aIndex ;index < KMaxNumberOfPresetStations;index++)
-    	{
-        frequencyIndex = CalculateFrequencyIndexL( index );
-        err = iCentralRepository->Get( frequencyIndex, frequency );
-    	if( KErrNone == err && frequency != KErrNotFound )
-        	{
-            next = index;
-            break;
-        	} 
-    	}
-    aNextIndex = next;	
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::ExternalizeToStream
-// Externalize the string in the aBuffer
-// Returns: none
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::ExternalizeToStreamL(
-    const TPresetChannel& aPresetChannel, // reference to channel object
-    TDes8& aBuffer)  // buffer for externalize stream
-    {
-    RDesWriteStream outStream(aBuffer);
-    CleanupClosePushL(outStream);
-    aPresetChannel.ExternalizeL(outStream);
-    outStream.CommitL();
-    CleanupStack::PopAndDestroy(&outStream);    
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::InternalizeFromStream
-// Internalize a preset from string
-// Returns: none
-// ----------------------------------------------------
-//
-void CCentralRepositoryHandler::InternalizeFromStreamL(
-    TPresetChannel& aPresetChannel, // reference to channel object
-    TDes8& aBuffer)  // buffer for externalize stream
-    {
-    RDesReadStream inStream(aBuffer);
-    CleanupClosePushL(inStream);
-    aPresetChannel.InternalizeL(inStream);
-    CleanupStack::PopAndDestroy(&inStream);    
-    }
-
-// ----------------------------------------------------
-// CCentralRepositoryHandler::GetPreset
-// Returns: KErrNone if no errors, otherwise system errors.
-// ----------------------------------------------------
-//
-TInt CCentralRepositoryHandler::GetPresetL(TInt aIndex, TPresetChannel& aPreset)
-    {
-    TInt ret = KErrNotFound;
-    // Read name from its own key in the key sequence
-    TInt nameIndex( CalculateNameIndexL( aIndex ) );
-    TFmPresetName tempChannelName;
-    HBufC* nameBuf = HBufC::NewLC( tempChannelName.MaxSize() );
-    TPtr nameBufPtr = nameBuf->Des();
-    ret = iCentralRepository->Get(nameIndex, nameBufPtr );
-    if( KErrNone == ret )
-        {
-        if (nameBufPtr.Length() != 0)
-            {
-            tempChannelName.Copy( nameBufPtr );
-            }
-        aPreset.SetChannelName( tempChannelName );
-        }
-    else
-        {
-        User::Leave( ret );
-        }
-    CleanupStack::PopAndDestroy(nameBuf);                       
-
-    // Read frequency from its own key in the key sequence
-    TInt frequency( 0 );
-    User::LeaveIfError( iCentralRepository->Get( CalculateFrequencyIndexL( aIndex ), frequency ) );
-    aPreset.SaveChannelFrequency( frequency );
-
-    // Read url from its own key in the key sequence
-    TInt urlIndex( CalculateUrlIndexL( aIndex ) );
-    TFmPresetUrl tempUrlName;
-    HBufC* urlBuf = HBufC::NewLC( tempUrlName.MaxSize() );
-    TPtr urlBufPtr = urlBuf->Des();
-    ret = iCentralRepository->Get(urlIndex, urlBufPtr );
-    if ( KErrNone == ret )
-        {        
-        if (urlBufPtr.Length() != 0)
-            {
-            tempUrlName.Copy( urlBufPtr );
-            }
-        aPreset.SetChannelUrl( tempUrlName );
-        }
-    else if ( KErrNotFound == ret )
-        {
-        // This is an optional parameter.
-        }
-    else
-        {
-        User::Leave( ret );
-        }
-    CleanupStack::PopAndDestroy(urlBuf);
-                      
-
-    HBufC8* buf = HBufC8::NewLC( sizeof(TPresetChannel) );
-    TPtr8 bufPtr = buf->Des();
-    TInt restOfParametersIndex( CalculateRestOfParametersIndexL( aIndex ) );
-    if(KErrNone == iCentralRepository->Get(restOfParametersIndex, bufPtr ))
-        {
-        if (bufPtr.Length() != 0)
-            {
-            TRAPD(err, InternalizeFromStreamL( aPreset, bufPtr );)
-            ret = err;
-            }
-        }
-    CleanupStack::PopAndDestroy(buf);                       
-    return ret;
-    }
-    
-// end of file
--- a/mmserv/radioutility/fmpresetutility/src/RadioFmPresetCentralRepositoryHandler.h	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,315 +0,0 @@
-/*
-* Copyright (c) 2005 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 <RadioFmPresetUtility.h>
-#include <RadioPresetUtility.h>
-#include "RadioFmPresetChannel.h"
-
-// CONSTANTS
-const TInt KBufferLength = 20;
-const TInt KStreamBufferSize = 100;
-
-// Forward declare implementation class
-class TRadioSettings;
-class CRepository;
-
-// 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.
-      	* @param aRadioSettings  pointer to the CRadioSettings class
-      	*/
-        static CCentralRepositoryHandler* NewL(TRadioSettings& aRadioSettings);
-      	/**
-      	* Destructor of CCentralRepositoryHandler class.
-      	*/
-        virtual ~CCentralRepositoryHandler();
-    public:
-      	/**
-      	* Retrieve the preset frequency from Central Repository
-        * @since Series 60 3.0
-      	* @param aIndex  the index of which preset to retrieve
-      	* @return the frequency stored in Central Repository
-      	*/
-        TInt RetrievePresetFrequencyL(TInt aIndex) const;
-
-        /**
-      	* Save channel preset info back to Central Repository
-        * @since Series 60 3.0
-      	* @param aIndex  the index of which preset to save
-      	* @param aFrequency  the frequency to be saved
-      	*/
-        void SavePresetFrequencyL(TInt aIndex, TInt aFrequency);
-
-        /**
-      	* Retrieve the preset name from Central Repository
-        * @since Series 60 3.0
-      	* @param aIndex  the index of which preset to retrieve
-      	* @return the name of the preset stored in Central Repository
-      	*/
-        TFmPresetName RetrievePresetNameL(TInt aIndex) const;
-
-        /**
-        * Retrieve the preset URL from Central Repository
-        * @since Series 60 5.2
-        * @param aIndex  the index of which preset to retrieve
-        * @return the URL of the preset stored in Central Repository
-        */
-        TFmPresetUrl RetrievePresetUrlL(TInt aIndex) const;
-
-        /**
-        * Retrieve the preset PTY (programme type) from Central Repository
-        * @since Series 60 5.2
-        * @param aIndex  the index of which preset to retrieve
-        * @return the PTY of the preset stored in Central Repository
-        */
-        TUint RetrievePresetPTYL(TInt aIndex) const;
-
-        /**
-        * Retrieve the preset PI code (programme identification) from Central Repository
-        * @since Series 60 5.2
-        * @param aIndex  the index of which preset to retrieve
-        * @return the PI code of the preset stored in Central Repository
-        */        
-        TUint RetrievePresetPIL(TInt aIndex) const;
-
-        /**
-        * Retrieve the preset favourite information from Central Repository
-        * @since Series 60 5.2
-        * @param aIndex  the index of which preset to retrieve
-        * @return the favourite info of the preset stored in Central Repository
-        */
-        TBool RetrievePresetFavouriteL(TInt aIndex) const;
-        
-        /**
-        * Retrieve the preset user rename information from Central Repository
-        * @since Series 60 5.2
-        * @param aIndex  the index of which preset to retrieve
-        * @return the user rename info of the preset stored in Central Repository
-        */        
-        TBool RetrievePresetUserRenameL(TInt aIndex) const;
-        
-        /**
-      	* Save channel preset name back to Central Repository
-        * @since Series 60 3.0
-      	* @param aIndex the index of which preset to save
-      	* @param aStationName the preset name to be saved
-      	* @return none
-      	*/
-        void SavePresetNameL(TInt aIndex, const TFmPresetName& aStationName );
-
-        /**
-        * Save channel URL name back to Central Repository
-        * @since Series 60 5.2
-        * @param aIndex the index of which preset to save
-        * @param aStationUrl the preset URL to be saved
-        * @return none
-        */
-        void SavePresetUrlL(TInt aIndex, const TFmPresetUrl& aStationUrl);
-        
-        /**
-        * Save channel PI code back to Central Repository
-        * @since Series 60 5.2
-        * @param aIndex the index of which preset to save
-        * @param aPI the preset programme identification to be saved
-        * @return none
-        */
-        void SavePresetPIL(TInt aIndex, TUint aPI);
-
-        /**
-        * Save channel PTY (genre) back to Central Repository
-        * @since Series 60 5.2
-        * @param aIndex the index of which preset to save
-        * @param aPTY the preset programme type to be saved
-        * @return none
-        */
-        void SavePresetPTYL(TInt aIndex, TUint aPTY);
-
-        /**
-        * Save channel favourite info back to Central Repository
-        * @since Series 60 5.2
-        * @param aIndex the index of which preset to save
-        * @param aFav the preset favourite info to be saved
-        * @return none
-        */
-        void SavePresetFavouriteInfoL(TInt aIndex, TBool aFav);
-
-        /**
-        * Save channel user rename info back to Central Repository
-        * @since Series 60 5.2
-        * @param aIndex the index of which preset to save
-        * @param aUR the preset user rename info to be saved
-        * @return none
-        */
-        void SavePresetUserRenameInfoL(TInt aIndex, TBool aUR);
-        
-        /**
-      	* Save all FmPreset related persistent info back to Central Repository
-        * @since Series 60 3.0
-      	* @param aIndex - the index of which preset to save
-      	* @return none
-      	*/
-        void SaveFmPresetSettings();
-
-        /**
-        * Delete the specified preset.
-        * Specifying aIndex == 0, will delete all presets.
-        * Has no effect if specified index contains no preset.
-        */
-        void DeletePresetL(TInt aIndex);
-        
-        /**
-        * Get the current number of presets.
-      	* @param aNum - the number of presets.
-      	* @return none
-        */
-        void GetNumberOfPresetsL(TInt& aNum);
-        
-        /**
-        * Get the index of first preset.
-      	* @param aIndex - the first preset index.
-      	* @return none
-        */        
-        void GetFirstPresetL(TInt& aIndex);
-
-        /**
-        * Get the index of the next preset.
-      	* @param aIndex -  the first preset index.
-      	* @param aNextIndex - the next preset index.
-      	* @return none
-        */           
-        void GetNextPresetL(TInt aIndex,TInt& aNextIndex);
-        
-              
-    private:
-      	/**
-      	* Default class constructor.
-      	* @param aFmPreset - pointer to the CRadioFmPresetUtility instance (used for callbacks)
-      	* @param aRadioSettings - pointer to the CRadioSettings class
-      	*/
-        CCentralRepositoryHandler(TRadioSettings& aRadioSettings);
-       	/**
-     	* Second phase class constructor.
-     	*/
-        void ConstructL();
-     	/**
-     	* Retrieves persistent settings from Central Repository.
-     	*/
-        void RetrieveInitialSettings();
-
-        /**
-        * Get the channel PTY from the externalized stream.
-        * @param aString - the raw data received from Central Repository
-        */        
-        TUint ConvertStringToChannelPTYL(const TDesC8& aString) const;
-        
-        /**
-        * Get the channel PI code from the externalized stream.
-        * @param aString - the raw data received from Central Repository
-        */
-        TUint ConvertStringToChannelPIL(const TDesC8& aString) const;
-
-        /**
-        * Get the channel favourite info from the externalized stream.
-        * @param aString - the raw data received from Central Repository
-        */
-        TBool ConvertStringToChannelFavouriteL(const TDesC8& aString) const;
-        
-        /**
-        * Get the channel user rename info from the externalized stream.
-        * @param aString - the raw data received from Central Repository
-        */
-        TBool ConvertStringToChannelUserRenameL(const TDesC8& aString) const;
-        
-        /**
-        * Update the current preset channel's PI code (programme identification).
-        * @param aIndex - the index of which preset's channel name to be updated
-        * @param aPresetChannel - reference to the CRadioSettings class
-        * @param aPI - the new channel PI code to be updated to the preset channel
-        */ 
-        void UpdateChannelObjectWithPIL (TInt aIndex, TPresetChannel& aPresetChannel, TUint aPI);
-        
-        /**
-        * Update the current preset channel's PTY (programme type).
-        * @param aIndex - the index of which preset's channel name to be updated
-        * @param aPresetChannel - reference to the CRadioSettings class
-        * @param aPTY - the new channel PTY (genre) to be updated to the preset channel
-        */ 
-        void UpdateChannelObjectWithPTYL (TInt aIndex, TPresetChannel& aPresetChannel, TUint aPTY);
-        
-        /**
-        * Update the current preset channel's favourite information.
-        * @param aIndex - the index of which preset's channel name to be updated
-        * @param aPresetChannel - reference to the CRadioSettings class
-        * @param aFav - the new channel favourite info to be updated to the preset channel
-        */
-        void UpdateChannelObjectWithFavouriteInfoL (TInt aIndex, TPresetChannel& aPresetChannel, TBool aFav);
-
-        /**
-        * Update the current preset channel's user rename information.
-        * @param aIndex - the index of which preset's channel name to be updated
-        * @param aPresetChannel - reference to the CRadioSettings class
-        * @param aUR - the new channel user rename info to be updated to the preset channel
-        */
-        void UpdateChannelObjectWithUserRenameInfoL (TInt aIndex, TPresetChannel& aPresetChannel, TBool aUR);
-        /**
-       	* Externalize the string in the aBuffer.
-       	* @param aPresetChannel - reference to the RadioSettings class
-       	* @param aBuffer - the buffer to be externalized
-       	*/     
-       	void ExternalizeToStreamL(const TPresetChannel& aPresetChannel, TDes8& aBuffer);
-        /**
-        * Internalize TPresetChannel from the aBuffer.
-        * @param aPresetChannel - reference to the RadioSettings class
-        * @param aBuffer - the buffer where to internalize from
-        */            	
-       	void InternalizeFromStreamL(TPresetChannel& aPresetChannel, TDes8& aBuffer);       	
-
-       	/**
-       	 * Gets stored information of given index and internalizes the stream to aPreset
-       	 * @param aIndex the index of the stored preset to be read
-       	 * @param aPreset a reference to TPresetChannel where to internalize from
-       	 * @return KErrNone if no errors
-       	 */
-       	TInt GetPresetL(TInt aIndex, TPresetChannel& aPreset);
-       	
-        // Handle to Central Repository server
-        CRepository* iCentralRepository; 
-        // Reference to RadioSetting object     
-        TRadioSettings* iRadioSettings;
-        
-        TInt iFirstPreset;
-    };
-
-#endif  // RADIOFMPRESETCENTRALREPOSITORYHANDLER_H
-
-// end of file
--- a/mmserv/radioutility/fmpresetutility/src/RadioFmPresetChannel.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,240 +0,0 @@
-/*
-* Copyright (c) 2005 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 TPresetChannel class, which holds 
-*                       the FmRadioUtility settings.
-*
-*/
-
-
-//  INCLUDES
-#include <s32mem.h>
-#include <RadioFmPresetUtility.h>
-#include "RadioFmPresetUtilityBody.h"
-#include <RadioPresetUtility.h>
-#include "RadioFmPresetChannel.h"
-#include "debug.h"
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// ----------------------------------------------------
-// TPresetChannel::TPresetChannel
-// Default class constructor.
-// Returns: None
-// ----------------------------------------------------
-//
-TPresetChannel::TPresetChannel():
-	iPresetChannelFrequency( KDefaultRadioFrequency ),
-	iPresetChannelPTY(0),
-	iPresetChannelPI(0)
-    {
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::GetChannelFrequency
-// retrieve current frequency
-// Returns: iPresetChannelFrequency: the preset channel frequency
-// ----------------------------------------------------
-//
-TInt TPresetChannel::GetChannelFrequency() const
-    {
-    return iPresetChannelFrequency;
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::GetChannelName
-// set the current preset
-// Returns: iPresetChannelName: preset channel name
-// ----------------------------------------------------
-//
-TFmPresetName TPresetChannel::GetChannelName() const
-    {
-    return iPresetChannelName;
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::SetChannelName
-// set the current preset
-// Returns: None
-// ----------------------------------------------------
-//
-void TPresetChannel::SetChannelName(
-    const TFmPresetName& aStationName )  //new channel name to be set
-    {
-    iPresetChannelName = aStationName;
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::SetChannelName
-// set the current preset
-// Returns: None
-// ----------------------------------------------------
-//
-void TPresetChannel::SetChannelUrl(
-    const TFmPresetUrl& aStationUrl )  //new channel name to be set
-    {
-    iPresetChannelUrl = aStationUrl;
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::GetChannelUrl
-// Get the current preset's Url
-// Returns: iPresetChannelUrl: preset channel Url
-// ----------------------------------------------------
-//
-TFmPresetUrl TPresetChannel::ChannelUrl() const
-    {
-    return iPresetChannelUrl;
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::SetChannelPty
-// Set the current preset's PTY
-// Returns: none
-// ----------------------------------------------------
-//
-void TPresetChannel::SetChannelPty(const TUint aPTY)
-    {
-    iPresetChannelPTY = aPTY;
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::GetChannelPty
-// Get the current preset's PTY
-// Returns: iPresetChannelPTY: preset channel PTY
-// ----------------------------------------------------
-//
-TUint TPresetChannel::ChannelPty() const
-    {
-    return iPresetChannelPTY;
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::SetChannelPI
-// Set the current preset's PI-code
-// Returns: none
-// ----------------------------------------------------
-//
-void TPresetChannel::SetChannelPI(const TUint aPI)
-    {
-    iPresetChannelPI = aPI;
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::GetChannelPI
-// Get the current preset's PI-code
-// Returns: iPresetChannelPI: preset channel PI
-// ----------------------------------------------------
-//
-TUint TPresetChannel::ChannelPI() const
-    {
-    return iPresetChannelPI;
-    }
-
-// ----------------------------------------------------
-// ----------------------------------------------------
-// TPresetChannel::SetChannelFavouriteInfo
-// Set the current preset's favourite status bit
-// Returns: none
-// ----------------------------------------------------
-//
-void TPresetChannel::SetChannelFavouriteInfo(const TBool aFavourite)
-    {
-    iPresetChannelMisc.Assign( MiscInfo::Favourite, aFavourite );
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::GetChannelFavouriteInfo
-// Get the current preset's favourite status bit
-// Returns: iPresetChannelMisc: favourite status bit
-// ----------------------------------------------------
-//
-TBool TPresetChannel::ChannelFavouriteInfo() const
-    {
-    TBool ret = EFalse;
-    if (iPresetChannelMisc[ MiscInfo::Favourite ])
-        {
-        ret = ETrue;
-        }
-    return ret;
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::SetChannelUserRenameInfo
-// Set the current preset's user rename status bit
-// Returns: none
-// ----------------------------------------------------
-//
-void TPresetChannel::SetChannelUserRenameInfo(const TBool aUserRename)
-    {
-    iPresetChannelMisc.Assign( MiscInfo::UserRename, aUserRename );
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::GetChannelUserRenameInfo
-// Get the current preset's user rename status bit
-// Returns: iPresetChannelMisc: user rename status bit
-// ----------------------------------------------------
-//
-TBool TPresetChannel::ChannelUserRenameInfo() const
-    {
-    TBool ret = EFalse;
-    if (iPresetChannelMisc[ MiscInfo::UserRename ])
-        {
-        ret = ETrue;
-        }
-    return ret;
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::SaveChannelFrequency
-// Set the current preset frequency
-// Returns: None
-// ----------------------------------------------------
-//
-void TPresetChannel::SaveChannelFrequency(
-    const TInt aFrequency )  //new preset channel frequency
-    {
-    iPresetChannelFrequency = aFrequency;
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::ExternalizeL
-// Externalize data from buffer to stream
-// Returns: None
-// ----------------------------------------------------
-//
-void TPresetChannel::ExternalizeL(
-    RWriteStream & aStream ) const  // a reference to a RDesWriteStream
-    {
-	aStream.WriteUint32L(iPresetChannelPTY);
-	aStream.WriteUint32L(iPresetChannelPI);
-	aStream.WriteUint32L(iPresetChannelMisc.Value());
-    }
-
-// ----------------------------------------------------
-// TPresetChannel::InternalizeL
-// Returns: None
-// Interalize the stream
-// ----------------------------------------------------
-//
-void TPresetChannel::InternalizeL(
-    RReadStream & aStream )  // a reference to a RDesReadStream
-    {
-    iPresetChannelPTY = aStream.ReadInt32L();
-    iPresetChannelPI = aStream.ReadInt32L();
-    iPresetChannelMisc = aStream.ReadInt32L();    
-    }
-
-//  End of File  
--- a/mmserv/radioutility/fmpresetutility/src/RadioFmPresetChannel.h	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-/*
-* Copyright (c) 2005 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 radio channel's structure.
-*
-*/
-
-#ifndef RADIOFMPRESETCHANNEL_H
-#define RADIOFMPRESETCHANNEL_H
-
-#include <babitflags.h>
-
-// Forward declare implementation class.
-class CRadioFmPresetUtility;
-class RWriteStream;
-class RReadStream;
-
-namespace MiscInfo
-{
-    enum DataIds
-    {
-        Local = 0,
-        Favourite = 1,
-        UserRename = 2
-    };
-}
-
-// CLASS DECLARATION
-/**
-*  define preset channel structure.
-*
-*  @lib FmPresetUtility.lib
-*  @since Series 60 3.0
-*/
-class TPresetChannel
-    {
-    public:
-        /**
-        * default constructor.
-        */	
-        TPresetChannel();
-        /**
-        * Get channel Name.
-        * @since Series 60 3.0
-        * @return channel name
-        */
-       TFmPresetName GetChannelName() const;
-        /**
-        * Get channel frequency.
-        * @since Series 60 3.0
-        * @return channel frequency
-        */
-        TInt GetChannelFrequency() const;
-        /**
-        * set channel name.
-        * @since Series 60 3.0
-        * @param aStationName new channel name
-        * @return none
-        */    
-        void SetChannelName(const TFmPresetName& aStationName );
-        /**
-        * Set channel url.
-        * @since Series 60 5.2
-        * @param aStationUrl new channel Url
-        * @return none
-        */
-        void SetChannelUrl(const TFmPresetUrl& aStationUrl );
-        /**
-        * Get channel url.
-        * @since Series 60 5.2
-        * @return channel url
-        */        
-        TFmPresetUrl ChannelUrl() const;
-        /**
-        * Set channel programme type.
-        * @since Series 60 5.2
-        * @param aPTY new channel PTY
-        * @return none
-        */        
-        void SetChannelPty(const TUint aPTY);
-        /**
-        * Get channel programme type.
-        * @since Series 60 5.2
-        * @return channel PTY
-        */      
-		TUint ChannelPty() const;
-        /**
-        * Set channel programme identification code.
-        * @since Series 60 5.2
-        * @param aPI - the new channel PI-code
-        * @return none
-        */
-        void SetChannelPI(const TUint aPI);
-        /**
-        * Get channel programme identification code.
-        * @since Series 60 5.2
-        * @return channel PI-code
-        */      
-        TUint ChannelPI() const;        
-        /**
-        * Set or clear channel favourite info.
-        * @since Series 60 5.2
-        * @param aFavourite - the new channel favourite info
-        * @return none
-        */
-        void SetChannelFavouriteInfo(const TBool aFavourite);
-        /**
-        * Get channel favourite info.
-        * @since Series 60 5.2
-        * @return channel favourite info
-        */      
-        TBool ChannelFavouriteInfo() const;        
-        
-        /**
-        * Set or clear channel user rename info.
-        * @since Series 60 5.2
-        * @param aUserRename - the new channel favourite info
-        * @return none
-        */
-        void SetChannelUserRenameInfo(const TBool aUserRename);
-        /**
-        * Get channel user rename info.
-        * @since Series 60 5.2
-        * @return channel user rename
-        */      
-        TBool ChannelUserRenameInfo() const;
-        /**
-        * Save channel frequency.
-        * @since Series 60 3.0
-        * @param aFrequency - the new channel frequency
-        * @return none
-        */
-        void SaveChannelFrequency(const TInt aFrequency );	
-        /**
-        * Serialize the data to stream.
-        * @since Series 60 3.0
-        * @param aStream - used for write stream
-        * @return none
-        */
-        void ExternalizeL(RWriteStream & aStream ) const;
-        /**
-        * Deserialize the data out of stream.
-        * @since Series 60 3.0
-    	* @param aStream  used for read stream	
-        * @return none
-        */
-        void InternalizeL(RReadStream & aStream );
-      
-    private:
-        //the preset channel name
-		TFmPresetName iPresetChannelName;
-		//the preset channel url
-		TFmPresetUrl iPresetChannelUrl;
-		//the preset channel frequency
-		TInt iPresetChannelFrequency;
-		//the preset channel Program Type
-		TUint iPresetChannelPTY;
-		//the preset channel Programme Identification code
-		TUint iPresetChannelPI;
-        //the preset channel local, favourite and user renamed info
-		TBitFlags32 iPresetChannelMisc;
-    };
-
-#endif  // RADIOFMPRESETCHANNEL_H
-
-// End of File
--- a/mmserv/radioutility/fmpresetutility/src/RadioFmPresetRadioSettings.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/*
-* Copyright (c) 2005 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 TRadioSettings class, which holds 
-*                       the RadioFmPresetUtility settings.
-*
-*/
-
-
-//  INCLUDES
-#include <RadioFmPresetUtility.h>
-#include <RadioPresetUtility.h>
-#include "RadioFmPresetUtilityBody.h"
-#include "RadioFmPresetRadioSettings.h"
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// ----------------------------------------------------
-// TRadioSettings::TRadioSettings
-// Default class constructor.
-// ----------------------------------------------------
-//
-TRadioSettings::TRadioSettings():
-                    iCurrentPreset(0),
-                    iFrequency(KDefaultRadioFrequency),
-                    iRadioOn(EFalse)
-    {
-    }
-
-// ----------------------------------------------------
-// TRadioSettings::CurrentPreset
-// retrieve currently selected channel
-// Returns: iCurrentPreset: current preset index number
-// ----------------------------------------------------
-//
-TInt TRadioSettings::CurrentPreset() const
-    {
-    return iCurrentPreset;
-    }
-
-// ----------------------------------------------------
-// TRadioSettings::Frequency
-// retrieve current frequency
-// Returns: iFrequency: current frequency
-// ----------------------------------------------------
-//
-TInt TRadioSettings::Frequency() const
-    {
-    return iFrequency;
-    }
-
-// ----------------------------------------------------
-// TRadioSettings::IsRadioOn
-// retrieve current radio on state (on/off)
-// Returns: iRadioOn: a flag indicating radio on/off
-// ----------------------------------------------------
-//
-TBool TRadioSettings::IsRadioOn() const
-    {
-    return iRadioOn;
-    }
-
-// ----------------------------------------------------
-// TRadioSettings::SetCurrentPreset
-// set the current preset
-// Returns: none
-// ----------------------------------------------------
-//
-void TRadioSettings::SetCurrentPreset(
-    const TInt aChannel) //new channel to be set
-    {
-    iCurrentPreset = aChannel;
-    }
-
-// ----------------------------------------------------
-// TRadioSettings::SetFrequency
-// set the current frequency
-// Returns: none
-// ----------------------------------------------------
-//
-void TRadioSettings::SetFrequency(
-    const TInt aFrequency) // new frequency
-    {
-    iFrequency = aFrequency;
-    }
-
-// ----------------------------------------------------
-// TRadioSettings::SetRadioOn
-// set radio state to "on"
-// Returns: none
-// ----------------------------------------------------
-//
-void TRadioSettings::SetRadioOn()
-    {
-    iRadioOn = ETrue;
-    }
-
-// ----------------------------------------------------
-// TRadioSettings::SetRadioOff
-// set radio state to "off"
-// Returns: none
-// ----------------------------------------------------
-//
-void TRadioSettings::SetRadioOff()
-    {
-    iRadioOn = EFalse;
-    }
-
-
-
-// end of file
-
--- a/mmserv/radioutility/fmpresetutility/src/RadioFmPresetRadioSettings.h	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
-* Copyright (c) 2005 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 TRadioSettings class, which holds 
-*                       the RadioFmPresetUtility settings.
-*
-*/
-
-
-#ifndef RADIOFMPRESETRADIOSETTINGS_H
-#define RADIOFMPRESETRADIOSETTINGS_H
-
-
-// CLASS DECLARATION
-class CRadioFmPresetUtility;
-
-
-/**
-*  TRadioSettings class.
-*  Maintain the radio setting data.
-* 
-*/
-class TRadioSettings
-    {
-    public:
-        /**  
-        * default constructor.
-        */
-       TRadioSettings();
-   
-        /**
-        * return current preset number.
-        * @since Series 60 2.7
-        * @return current preset number
-        */
-       TInt CurrentPreset() const; 
-        /**
-        * return current frequency.
-        * @since Series 60 2.7
-        * @return current frequency
-        */
-       TInt Frequency() const; 
-        /**
-        * check if radio is on.
-        * @since Series 60 2.7
-        * @return true/false
-        */
-       TBool IsRadioOn() const;
-        /**
-        * Set current preset number.
-        * @since Series 60 2.7
-        * @return current preset number
-        */
-       void SetCurrentPreset(const TInt aChannel);
-        /**
-        * set current frequency .
-        * @since Series 60 2.7
-        * @param aFrequency the frequency to be set
-        * @return none
-        */
-       void SetFrequency(const TInt aFrequency);
-        /**
-        * set radio on.
-        * @since Series 60 2.7
-        * @return none
-        */
-       void SetRadioOn();
-        /**
-        * set radio off.
-        * @since Series 60 2.7
-        * @return none
-        */
-       void SetRadioOff();
- 
-    private: 
-        TInt iCurrentPreset; 
-        /// current frequency
-        TInt iFrequency; 
-        //  radio on/off flag
-        TBool iRadioOn;
-    };
-
-#endif  // FMPRESETRADIOSETTINGS_H
-
-// End of File
--- a/mmserv/radioutility/fmpresetutility/src/RadioFmPresetUtility.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,251 +0,0 @@
-/*
-* 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:  Contains implementation of the CRadioFmPresetUtility class,
-*             	which controlls the presets for an FM tuner.
-*
-*/
-
- 
-#include <RadioPresetUtility.h>
-#include <RadioFmPresetUtility.h>
-#include "RadioFmPresetUtilityBody.h"
-
-EXPORT_C CRadioFmPresetUtility* CRadioFmPresetUtility::NewL( MRadioPresetObserver& aObserver )
-	{
-	CRadioFmPresetUtility* self = new(ELeave) CRadioFmPresetUtility(aObserver);
-	CleanupStack::PushL(self);
-	self->iBody = CRadioFmPresetUtility::CBody::NewL( aObserver );
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-// Destructor
-EXPORT_C CRadioFmPresetUtility::~CRadioFmPresetUtility()
-	{
-		delete iBody;
-	}
-
-CRadioFmPresetUtility::CRadioFmPresetUtility(MRadioPresetObserver& /*aObserver*/)
-	{
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::SetPresetL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CRadioFmPresetUtility::SetPresetL( TInt aIndex, const TFmPresetName& aName, TInt aFrequency )
-	{	
-	iBody->SetPresetL(aIndex,aName,aFrequency);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::SetPresetUrlL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CRadioFmPresetUtility::SetPresetUrlL( TInt aIndex, const TFmPresetUrl& aUrl )
-    {
-    iBody->SetPresetUrlL(aIndex, aUrl);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::SetPresetPtyL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CRadioFmPresetUtility::SetPresetPtyL( TInt aIndex, TUint aPty )
-    {
-    iBody->SetPresetPtyL(aIndex, aPty);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::SetPresetPICodeL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CRadioFmPresetUtility::SetPresetPICodeL( TInt aIndex, TUint aPICode )
-    {
-    iBody->SetPresetPICodeL(aIndex, aPICode);
-    }
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::SetPresetFavouriteInfoL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CRadioFmPresetUtility::SetPresetFavouriteInfoL( TInt aIndex, TBool aFavourite )
-    {
-    iBody->SetPresetFavouriteInfoL(aIndex, aFavourite);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::SetPresetUserRenameInfoL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CRadioFmPresetUtility::SetPresetUserRenameInfoL( TInt aIndex, TBool aRename )
-    {
-    iBody->SetPresetUserRenameInfoL(aIndex, aRename);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::GetPresetL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//	
-EXPORT_C void CRadioFmPresetUtility::GetPresetL( TInt aIndex, TFmPresetName& aName, TInt& aFrequency )
-	{
-    iBody->GetPresetL(aIndex,aName,aFrequency);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::GetPresetNameL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//	
-EXPORT_C void CRadioFmPresetUtility::GetPresetNameL( TInt aIndex, TFmPresetName& aName)
-	{
-    iBody->GetPresetNameL(aIndex,aName);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::GetPresetUrlL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//	
-EXPORT_C void CRadioFmPresetUtility::GetPresetUrlL( TInt aIndex, TFmPresetUrl& aUrl)
-	{
-    iBody->GetPresetUrlL(aIndex,aUrl);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::GetPresetPtyL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//  
-EXPORT_C void CRadioFmPresetUtility::GetPresetPtyL( TInt aIndex, TUint& aPty)
-    {
-    iBody->GetPresetPtyL(aIndex,aPty);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::GetPresetPICodeL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//  
-EXPORT_C void CRadioFmPresetUtility::GetPresetPICodeL( TInt aIndex, TUint& aPICode)
-    {
-    iBody->GetPresetPICodeL(aIndex,aPICode);
-    }
-
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::GetPresetFavouriteInfoL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//  
-EXPORT_C void CRadioFmPresetUtility::GetPresetFavouriteInfoL( TInt aIndex, TBool& aFavourite)
-    {
-    iBody->GetPresetFavouriteInfoL(aIndex,aFavourite);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::GetPresetUserRenameInfoL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//  
-EXPORT_C void CRadioFmPresetUtility::GetPresetUserRenameInfoL( TInt aIndex, TBool& aRename)
-    {
-    iBody->GetPresetUserRenameInfoL(aIndex,aRename);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::GetPresetFrequencyL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//	
-EXPORT_C void CRadioFmPresetUtility::GetPresetFrequencyL( TInt aIndex, TInt& aFrequency)
-	{
-    iBody->GetPresetFrequencyL(aIndex,aFrequency);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::GetMaxNumberOfPresets
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C TInt CRadioFmPresetUtility::GetMaxNumberOfPresets( TInt& aMaxNumOfPresets ) const
-	{
-	return iBody->GetMaxNumberOfPresets(aMaxNumOfPresets);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::GetNumberOfPresets
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//	
-EXPORT_C TInt CRadioFmPresetUtility::GetNumberOfPresets( TInt& aNumOfPresets ) const
-	{
-	return iBody->GetNumberOfPresets(aNumOfPresets);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::GetFirstPresetL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CRadioFmPresetUtility::GetFirstPresetL( TInt& aIndex) const
-	{
-    iBody->GetFirstPresetL(aIndex);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::GetNextPresetL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CRadioFmPresetUtility::GetNextPresetL( TInt aIndex, TInt& aNextIndex ) const
-	{
-    iBody->GetNextPresetL(aIndex,aNextIndex);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::DeletePresetL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//	
-EXPORT_C void CRadioFmPresetUtility::DeletePresetL( TInt aIndex )
-	{
-    iBody->DeletePresetL(aIndex);
-	}
-// End of File
--- a/mmserv/radioutility/fmpresetutility/src/RadioFmPresetUtilityBody.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,300 +0,0 @@
-/*
-* 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:  Contains implementation of the CRadioFmPresetUtility::CBody
-*             	class, which controlls the presets for an FM tuner. 
-*
-*/
-
-
-
-#include "RadioFmPresetUtilityBody.h"
-#include "debug.h"
-#include "RadioFmPresetRadioSettings.h"
-#include "RadioFmPresetCentralRepositoryHandler.h"
-#include "RadioFmPresetCRKeys.h"
-#include <e32Property.h>
-
-
-
-CRadioFmPresetUtility::CBody* CRadioFmPresetUtility::CBody::NewL( MRadioPresetObserver& aObserver )
-	{
-	CRadioFmPresetUtility::CBody* s = new(ELeave) CRadioFmPresetUtility::CBody();
-	s->iRadioPresetClient = &aObserver;
-	CleanupStack::PushL(s);
-	s->ConstructL();
-	CleanupStack::Pop(s);
-	return s;
-	}
-
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::CBody
-// -----------------------------------------------------------------------------
-//
-CRadioFmPresetUtility::CBody::CBody()
-    {
-    }	
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::~CBody
-// -----------------------------------------------------------------------------
-//
-CRadioFmPresetUtility::CBody::~CBody()
-    {
-    delete iRadioSettings;
-    delete iCentralRepositoryHandler;
-    }
-	
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::ConstructL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-void CRadioFmPresetUtility::CBody::ConstructL()
-	{  
-    iRadioSettings = new(ELeave) TRadioSettings;
-    iCentralRepositoryHandler = CCentralRepositoryHandler::NewL(*iRadioSettings);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::SetPresetL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CRadioFmPresetUtility::CBody::SetPresetL( TInt aIndex, const TFmPresetName& aName, TInt aFrequency )
-	{
-	iCentralRepositoryHandler->SavePresetFrequencyL(aIndex,aFrequency);
-	iCentralRepositoryHandler->SavePresetNameL(aIndex,aName);	
-	iRadioPresetClient->MrpeoPresetChanged(MRadioPresetObserver::EPresetAdded,aIndex);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::SetPresetUrlL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CRadioFmPresetUtility::CBody::SetPresetUrlL( TInt aIndex, const TFmPresetUrl& aUrl )
-	{
-	iCentralRepositoryHandler->SavePresetUrlL(aIndex, aUrl);
-	iRadioPresetClient->MrpeoPresetChanged(MRadioPresetObserver::EPresetUpdated,aIndex);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::SetPresetPtyL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CRadioFmPresetUtility::CBody::SetPresetPtyL( TInt aIndex, TUint aPty )
-    {
-    iCentralRepositoryHandler->SavePresetPTYL(aIndex, aPty);
-    iRadioPresetClient->MrpeoPresetChanged(MRadioPresetObserver::EPresetUpdated,aIndex);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::SetPresetPICodeL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CRadioFmPresetUtility::CBody::SetPresetPICodeL( TInt aIndex, TUint aPICode )
-    {
-    iCentralRepositoryHandler->SavePresetPIL(aIndex, aPICode);
-    iRadioPresetClient->MrpeoPresetChanged(MRadioPresetObserver::EPresetUpdated,aIndex);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::SetPresetFavouriteInfoL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CRadioFmPresetUtility::CBody::SetPresetFavouriteInfoL( TInt aIndex, TBool aFavourite )
-    {
-    iCentralRepositoryHandler->SavePresetFavouriteInfoL(aIndex, aFavourite);
-    iRadioPresetClient->MrpeoPresetChanged(MRadioPresetObserver::EPresetUpdated,aIndex);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::SetPresetUserRenameInfoL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CRadioFmPresetUtility::CBody::SetPresetUserRenameInfoL( TInt aIndex, TBool aRename )
-    {
-    iCentralRepositoryHandler->SavePresetUserRenameInfoL(aIndex, aRename);
-    iRadioPresetClient->MrpeoPresetChanged(MRadioPresetObserver::EPresetUpdated,aIndex);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::GetPresetL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//	
-void CRadioFmPresetUtility::CBody::GetPresetL( TInt aIndex, TFmPresetName& aName, TInt& aFrequency )
-    {	
-    aFrequency = iCentralRepositoryHandler->RetrievePresetFrequencyL(aIndex);
-    aName      = iCentralRepositoryHandler->RetrievePresetNameL(aIndex);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::GetPresetNameL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//	
-void CRadioFmPresetUtility::CBody::GetPresetNameL( TInt aIndex, TFmPresetName& aName )
-	{
-   	aName = iCentralRepositoryHandler->RetrievePresetNameL(aIndex);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::GetPresetUrlL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CRadioFmPresetUtility::CBody::GetPresetUrlL( TInt aIndex, TFmPresetUrl& aUrl )
-    {
-    aUrl = iCentralRepositoryHandler->RetrievePresetUrlL(aIndex);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::GetPresetPtyL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//  
-void CRadioFmPresetUtility::CBody::GetPresetPtyL( TInt aIndex, TUint& aPty )
-    {
-    aPty = iCentralRepositoryHandler->RetrievePresetPTYL(aIndex);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::GetPresetPICodeL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//  
-void CRadioFmPresetUtility::CBody::GetPresetPICodeL( TInt aIndex, TUint& aPICode )
-    {
-    aPICode = iCentralRepositoryHandler->RetrievePresetPIL(aIndex);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::RetrievePresetFavouriteL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//  
-void CRadioFmPresetUtility::CBody::GetPresetFavouriteInfoL( TInt aIndex, TBool& aFavourite )
-    {
-    aFavourite = iCentralRepositoryHandler->RetrievePresetFavouriteL(aIndex);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::GetPresetUserRenameInfoL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//  
-void CRadioFmPresetUtility::CBody::GetPresetUserRenameInfoL( TInt aIndex, TBool& aRename )
-    {
-    aRename = iCentralRepositoryHandler->RetrievePresetUserRenameL(aIndex);
-    }
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::GetPresetFrequencyL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//	
-void CRadioFmPresetUtility::CBody::GetPresetFrequencyL( TInt aIndex, TInt& aFrequency )
-	{
-    aFrequency = iCentralRepositoryHandler->RetrievePresetFrequencyL(aIndex);
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::GetMaxNumberOfPresets
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TInt CRadioFmPresetUtility::CBody::GetMaxNumberOfPresets( TInt& aMaxNumOfPresets ) const
-	{
-	aMaxNumOfPresets = KMaxNumberOfPresetStations;
-	return KErrNone;
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::GetNumberOfPresets
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//	
-TInt CRadioFmPresetUtility::CBody::GetNumberOfPresets( TInt& aNumOfPresets ) const
-	{	 
-	TInt count = 0;
-	TInt error = KErrNone;
-	
-	TRAP_IGNORE(iCentralRepositoryHandler->GetNumberOfPresetsL(count);)
-    
-    aNumOfPresets = count;
-	return error;
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::GetFirstPresetL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CRadioFmPresetUtility::CBody::GetFirstPresetL( TInt& aIndex ) const
-	{
-    TInt firstPresetsIndex = 0;
-    iCentralRepositoryHandler->GetFirstPresetL(firstPresetsIndex);
-    aIndex = firstPresetsIndex;    
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::GetNextPresetL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CRadioFmPresetUtility::CBody::GetNextPresetL( TInt aIndex, TInt& aNextIndex ) const
-	{
-     
-    iCentralRepositoryHandler->GetNextPresetL(aIndex,aNextIndex); 
-    
-	}
-
-// -----------------------------------------------------------------------------
-// CRadioFmPresetUtility::CBody::DeletePresetL
-// 
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//	
-void CRadioFmPresetUtility::CBody::DeletePresetL( TInt aIndex )
-	{
-    iCentralRepositoryHandler->DeletePresetL(aIndex);
-    
-    iRadioPresetClient->MrpeoPresetChanged(MRadioPresetObserver::EPresetDeleted,aIndex);
-    
-	}
-
-// End of File
--- a/mmserv/radioutility/fmpresetutility/src/RadioFmPresetUtilityBody.h	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,306 +0,0 @@
-/*
-* Copyright (c) 2006 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 class provides an interface for controlling the presets
-*                for an FM tuner.
-*
-*
-*/
-
- 
-
-#ifndef C_RADIOFMPRESETUTILITYBODY_H
-#define C_RADIOFMPRESETUTILITYBODY_H
-
-#include <RadioPresetUtility.h>
-#include <RadioFmPresetUtility.h>
-#include "RadioFmPresetRadioSettings.h"
-#include "RadioFmPresetCentralRepositoryHandler.h"
-#include <e32base.h> 
-
-const TInt KDefaultRadioFrequency = 87500000;
-const TInt KMaxNumberOfPresetStations = 100;
-const TUint KDefaultRadioPTY = 0;
-const TUint KDefaultRadioPI = 0;
-
-/**
- *  This class provides an interface for controlling the preset for an FM tuner.
- *  The maximum number of presets supported by this utility is pre-defined and the
- *  client must first query it.
- *
- *  @lib RadioPresetUtility.lib
- *  @since S60 3.2
- */
-class CRadioFmPresetUtility::CBody : public CBase,
-                              public MRadioPreset,
-                              public MRadioFmPreset
-    {
-public:
-
-    /**
-     * Factory function to create a new instance of the FM tuner.
-     *
-     * @since S60 3.2
-     * @param aObserver The observer object
-     * @return A new FM tuner utility object.
-     */
-    static CBody* NewL( MRadioPresetObserver& aObserver );
-
-    ~CBody();
-    
-	// from base class MRadioFmPreset
-
-     /**
-      * From MRadioFmPresetUtility
-      * Set the preset with specified frequency and name. Previous content in the specified index
-      * will be overwritten with the new information.
-      *
-      * The maximum length for the preset name is 32 characters. Names longer than 32 characters
-      * will be truncated.
-      *
-      * @since S60 3.2
-      * @param aIndex A preset index.
-      * @param aName Preset name.
-      * @param aFrequency Frequency in Hz.
-      */
-     void SetPresetL( TInt aIndex, const TFmPresetName& aName, TInt aFrequency );
-
-     /**
-      * From MRadioFmPresetUtility
-      * Set the preset with specified URL. Previous content in the specified index
-      * will be overwritten with the new information.
-      *
-      * The maximum length for the preset URL is 64 characters. URLs longer than 32 characters
-      * will be truncated.
-      *
-      * @since S60 5.2
-      * @param aIndex A preset index.
-      * @param aUrl Preset URL.
-      */     
-     void SetPresetUrlL( TInt aIndex, const TFmPresetUrl& aUrl );
- 
-     /**
-      * From MRadioFmPresetUtility
-      * Set the preset with specified PTY. Previous content in the specified index
-      * will be overwritten with the new information.
-      *
-      * @since S60 5.2
-      * @param aIndex A preset index.
-      * @param aPty Preset PTY (programme type).
-      */
-     void SetPresetPtyL( TInt aIndex, TUint aPty );
-
-     /**
-      * From MRadioFmPresetUtility
-      * Set the preset with specified PI code. Previous content in the specified index
-      * will be overwritten with the new information.
-      *
-      * @since S60 5.2
-      * @param aIndex A preset index.
-      * @param aPICode Preset PI (programme identification).
-      */
-     void SetPresetPICodeL( TInt aIndex, TUint aPICode );
-
-     /**
-      * From MRadioFmPresetUtility
-      * Set the preset with specified favourite information. Previous content in the specified index
-      * will be overwritten with the new information.
-      *
-      * @since S60 5.2
-      * @param aIndex A preset index.
-      * @param aFavourite Preset favourite info.
-      */     
-     void SetPresetFavouriteInfoL( TInt aIndex, TBool aFavourite );
-
-     /**
-      * From MRadioFmPresetUtility
-      * Set the preset with specified user rename information. Previous content in the specified index
-      * will be overwritten with the new information.
-      *
-      * @since S60 5.2
-      * @param aIndex A preset index.
-      * @param aRename Preset user rename info.
-      */     
-     void SetPresetUserRenameInfoL( TInt aIndex, TBool aRename );
-
-     /**
-      * From MRadioFmPreset
-      * Get the preset name and frequency at the specified index.
-      * Leaves with KErrNotFound if invalid index is specified.
-      *
-      * Preset name is maximum of 32 characters. Client must allocate buffer big
-      * enough to hold the 32 characters. If not, characters will be truncated to fit the
-      * buffer.
-      *
-      * @since S60 3.2
-      * @param aIndex A preset index.
-      * @param aFrequency On return, contains the preset name.
-      * @param Frequency On return, contains frequency in Hz.
-      */
-     void GetPresetL( TInt aIndex, TFmPresetName& aName, TInt& aFrequency );
-
-     /**
-      * From MRadioFmPreset      
-      * Get the preset name at the specified index.
-      * Leaves with KErrNotFound if invalid index is specified.
-      *
-      * Preset name is maximum of 32 characters. Client must allocate buffer big
-      * enough to hold the 32 characters. If not, characters will be truncated to fit the
-      * buffer.
-      *
-      * @since S60 5.1
-      * @param aIndex A preset index.
-      * @param aName On return, contains the preset name.
-      */
-     void GetPresetNameL( TInt aIndex, TFmPresetName& aName );
-
-     /**
-      * From MRadioFmPresetUtility      
-      * Get the preset URL at the specified index.
-      * Leaves with KErrNotFound if invalid index is specified.
-      *
-      * Preset URL is maximum of 64 characters. Client must allocate buffer big
-      * enough to hold the 64 characters. If not, characters will be truncated to fit the
-      * buffer.
-      *
-      * @since S60 5.2
-      * @param aIndex A preset index.
-      * @param aUrl On return, contains the preset name.
-      */
-     void GetPresetUrlL( TInt aIndex, TFmPresetUrl& aUrl );
-
-     /**
-      * From MRadioFmPresetUtility
-      * Get the preset PTY (programme type) at the specified index.
-      * Leaves with KErrNotFound if invalid index is specified.
-      *
-      * @since S60 5.2
-      * @param aIndex A preset index.
-      * @param aPty On return, contains the preset PTY.
-      */
-     void GetPresetPtyL( TInt aIndex, TUint& aPty );
-     
-     /**
-      * From MRadioFmPresetUtility
-      * Get the preset PI code (programme identification) at the specified index.
-      * Leaves with KErrNotFound if invalid index is specified.
-      *
-      * @since S60 5.2
-      * @param aIndex A preset index.
-      * @param aPICode On return, contains the preset programme identification.
-      */
-     void GetPresetPICodeL( TInt aIndex, TUint& aPICode );
-     
-     /**
-      * From MRadioFmPresetUtility
-      * Get the preset favourite info at the specified index.
-      * Leaves with KErrNotFound if invalid index is specified.
-      *
-      * @since S60 5.2
-      * @param aIndex A preset index.
-      * @param aFavourite On return, contains the preset favourite info.
-      */
-     void GetPresetFavouriteInfoL( TInt aIndex, TBool& aFavourite );
-
-     /**
-      * From MRadioFmPresetUtility
-      * Get the preset user rename info at the specified index.
-      * Leaves with KErrNotFound if invalid index is specified.
-      *
-      * @since S60 5.2
-      * @param aIndex A preset index.
-      * @param aRename On return, contains the preset rename info.
-      */     
-     void GetPresetUserRenameInfoL( TInt aIndex, TBool& aRename );
-      
-     /**
-      * Get the preset frequency at the specified index.
-      * Leaves with KErrNotFound if invalid index is specified.
-      *
-      * @since S60 5.1
-      * @param aIndex A preset index.
-      * @param aFrequency On return, contains the preset name.
-      */
-     void GetPresetFrequencyL( TInt aIndex, TInt& aFrequency );
-	       
-// from base class MRadioPreset
-
-    /**
-     * From MRadioPreset
-     * Get the maximum number of presets supported by this utility.
-     * The numbering of presets starts from 1 and the largest preset number equals the value
-     * returned from this function.
-     *
-     * @since S60 3.2
-     * @param aMaxNumOfPresets On return contains the maximum number of presets.
-     * @return A standard system error code.
-     */
-     TInt GetMaxNumberOfPresets( TInt& aMaxNumOfPresets ) const;
-
-    /**
-     * From MRadioPreset
-     * Get the number of presets already set by the client (i.e. contains data).
-     *
-     * @since S60 3.2
-     * @param aNumOfPresets On return contains the current number of presets.
-     * @return A standard system error code.
-     */
-     TInt GetNumberOfPresets( TInt& aNumOfPresets ) const;
-
-    /**
-     * From MRadioPreset
-     * Get the first preset index that has been set.
-     * Leaves with KErrNone if no preset exists.
-     *
-     * @since S60 3.2
-     * @param aIndex On return contains the index of the first preset.
-     */
-     void GetFirstPresetL( TInt& aIndex ) const;
-
-    /**
-     * From MRadioPreset
-     * Get the next preset index that has been set, given the current index.
-     * Leaves with KErrNone if no other preset exists.
-     *
-     * @since S60 3.2
-     * @param aIndex Current preset index.
-     * @param aNextIndex On return contains the index of next preset.
-     */
-     void GetNextPresetL( TInt aIndex, TInt& aNextIndex ) const;
-
-    /**
-     * From MRadioPreset
-     * Reset the specified preset.
-     * Has not effect if specified index contains no preset.
-     *
-     * NOTE: Specifying aIndex == 0, will reset all presets.
-     *
-     * @since S60 3.2
-     * @param aIndex A preset index.
-     */
-     void DeletePresetL( TInt aIndex );
-
-private:
-    CBody();
-    void ConstructL();
-    
-    
-private:
-
-	MRadioPresetObserver* 	iRadioPresetClient;
-	TRadioSettings*         iRadioSettings;
-	CCentralRepositoryHandler* iCentralRepositoryHandler;
-
-    };
-
-#endif // C_RADIOFMPRESETUTILITY_H
--- a/mmserv/radioutility/fmpresetutility/src/debug.h	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* Copyright (c) 2005 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:  Central place for nice debug-type macros & functions
-*
-*/
-
-
-#ifndef DEBUG_H
-#define DEBUG_H
-
-//INCLUDES
-#include <f32file.h>
-#define FTRACE(a) {a;}
-    /**
-    * Declare the FPrint function
-    * @since Series 60 2.7
-    * @return none
-    */
-inline void FPrint(const TRefByValue<const TDesC> aFmt, ...)
-   {
-   VA_LIST list;
-   VA_START(list,aFmt);
-   TInt tmpInt = VA_ARG(list, TInt);
-   TInt tmpInt2 = VA_ARG(list, TInt);
-   TInt tmpInt3 = VA_ARG(list, TInt);
-   VA_END(list);
-   #ifdef _DEBUG
-   RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3);
-   #endif
-   }
-
-#endif // DEBUG_H
-
-// End of File
--- a/mmserv/radioutility/group/bld.inf	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/radioutility/group/bld.inf	Fri Apr 16 15:29:42 2010 +0300
@@ -24,9 +24,9 @@
 ../sis/radioutility/radioutility_stub.sis /epoc32/data/z/system/install/radioutility_stub.sis
 
 PRJ_MMPFILES
-#include "../radioserver/group/bld.inf"
+#include "../radioserver/Group/bld.inf"
 #include "../radio_utility/group/bld.inf"
-#include "../fmpresetutility/group/bld.inf"
+#include "../presetutility/group/bld.inf"
 
 //  End of File  
 
--- a/mmserv/radioutility/inc/RadioSession.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/radioutility/inc/RadioSession.h	Fri Apr 16 15:29:42 2010 +0300
@@ -26,7 +26,7 @@
 //  INCLUDES
 #include <mmf/common/mmfbase.h>
 #include <mmf/common/mmfcontrollerframework.h>
-#include <mcustomcommand.h>
+#include <MCustomCommand.h>
 
 #include "RadioServerData.h"
 
--- a/mmserv/radioutility/radio_utility/src/RadioFmTunerUtilityBody.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/radioutility/radio_utility/src/RadioFmTunerUtilityBody.h	Fri Apr 16 15:29:42 2010 +0300
@@ -21,7 +21,7 @@
 #ifndef C_RADIOFMTUENRUTILITYBODY_H
 #define C_RADIOFMTUENRUTILITYBODY_H
 
-#include <radiofmtunerutility.h>
+#include <RadioFmTunerUtility.h>
 
 class RRadioSession;
 
--- a/mmserv/radioutility/radio_utility/src/RadioMonitorBody.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/radioutility/radio_utility/src/RadioMonitorBody.h	Fri Apr 16 15:29:42 2010 +0300
@@ -23,7 +23,7 @@
 
 #include <e32base.h>
 #include <e32property.h>
-#include <radiomonitor.h>
+#include <RadioMonitor.h>
 
 /**
  *  This class encapsulates the implementation body of CRadioMonitor interface.
--- a/mmserv/radioutility/radio_utility/src/RadioPlayerUtilityBody.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/radioutility/radio_utility/src/RadioPlayerUtilityBody.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 
-#include <custominterfaceutility.h>
+#include <CustomInterfaceUtility.h>
 #include "RadioServerData.h"
 #include "RadioPlayerUtilityBody.h"
 #include "RadioSession.h"
--- a/mmserv/radioutility/radio_utility/src/RadioPlayerUtilityBody.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/radioutility/radio_utility/src/RadioPlayerUtilityBody.h	Fri Apr 16 15:29:42 2010 +0300
@@ -21,7 +21,7 @@
 #define C_RADIOPLAYERUTILITYBODY_H
 
 #include <RadioPlayerUtility.h>
-#include <mcustominterface.h>
+#include <MCustomInterface.h>
 
 class RRadioSession;
 
--- a/mmserv/radioutility/radio_utility/src/RadioRdsUtilityBody.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/radioutility/radio_utility/src/RadioRdsUtilityBody.h	Fri Apr 16 15:29:42 2010 +0300
@@ -20,8 +20,8 @@
 #ifndef C_RADIORDSUTILITYBODY_H
 #define C_RADIORDSUTILITYBODY_H
 
-#include <radiordsutility.h>
-#include "radioutilitybody.h"
+#include <RadioRdsUtility.h>
+#include "RadioUtilityBody.h"
 
 class RRadioSession;
 class CRadioUtility;
--- a/mmserv/radioutility/radio_utility/src/RadioUtility.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/radioutility/radio_utility/src/RadioUtility.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 
-#include "radioutilitybody.h"
+#include "RadioUtilityBody.h"
 
 
 // ======== MEMBER FUNCTIONS ========
--- a/mmserv/radioutility/radioserver/Server/Src/RadioServer.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/radioutility/radioserver/Server/Src/RadioServer.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -20,14 +20,14 @@
 // INCLUDE FILES
 #include    <mmf/common/mmfstandardcustomcommands.h>
 #include    <centralrepository.h>
-#include    <coreapplicationuissdkcrkeys.h>
-#include    <audiopreference.h>
+#include    <CoreApplicationUIsSDKCRKeys.h>
+#include    <AudioPreference.h>
 
 #include    "RadioServer.h"
 #include    "RadioServerSession.h"
 #include    "RadioServerShutdown.h"
 #include    "RadioServerSettings.h"
-#include    "RadioServerFmTuner.h"
+#include    "RadioServerFMTuner.h"
 #include    "RadioDebug.h"
 
 // CONSTANTS
@@ -70,7 +70,8 @@
         iMaxSigStrength(0),
         iEnableTunerInOffline(EFalse),
         iSquelch(EFalse),
-        iPreEmpted(EFalse)
+        iPreEmpted(EFalse),
+        iSchedulerWait( NULL )
     {
     }
 
@@ -127,6 +128,8 @@
     iMapper = CTspClientMapper::NewL();
     iTspState = CTspClientMapper::ERegisteredClients;
 #endif // RD_TSP_CLIENT_MAPPER
+    
+    iSchedulerWait  = new (ELeave) CActiveSchedulerWait;
 
     RADIO_RDEBUG(_L("[RADIO-SVR] ConstructL() - End"));
     }
@@ -166,6 +169,7 @@
     delete iTunerControl;
     delete iTunerControlObserver;
     delete iAsyncRequest;
+    delete iSchedulerWait;
 
     ClearQueue();
     iRdsNotifyClientIdArray.Close();
@@ -619,6 +623,11 @@
                 }
             break;
         case EStateTunerOff:
+            if( iSchedulerWait->IsStarted() )
+                {
+                // let the PlayError() continue after this callback
+                iSchedulerWait->AsyncStop();
+                }
             if ( iAsyncRequest && iAsyncRequest->iType == ERadioServSetFrequencyRange )
                 {
                 if ( aError == KErrNone )
@@ -639,6 +648,14 @@
                     CompleteAsyncRequest(aError);
                     }
                 }
+            else
+                {
+                if( aError == KRadioServErrDuplicateRequest )
+                    {
+                    // tuner off and duplicate request going on, trace it out
+                    RADIO_RDEBUG(_L("[RADIO-SVR] TunerOffComplete() - EStateTunerOff - KRadioServErrDuplicateRequest"));
+                    }
+                }
             break;
         default:
             // should never happen
@@ -1387,7 +1404,7 @@
                 iDevSound->SetVolume(iSettings->Volume());
                 iSquelch = EFalse;
                 }
-            CompleteAsyncRequest(KRadioServErrTuning);
+            // do not yet complete async request with KRadioServErrTuning
             }
 
         // We are being pre-empted by another application with higher priority.
@@ -1395,8 +1412,18 @@
         iState = EStateTunerOff;
         iPreEmpted = ETrue;
         iSettings->SetRadioOff(aError);
-        iTunerControl->TunerOff();
+        iTunerControl->TunerOff();		//The adaptation is expected to call TunerOffComplete() upon completion
+        // wait for TunerOffComplete callback
+        iSchedulerWait->Start();
         SetTspTargetClient( ERsPlayerIdle );
+        
+        if ( iAsyncRequest && ( (iAsyncRequest->iType == ERadioServStationSeek) ||
+                                (iAsyncRequest->iType == ERadioServStationSeekByPTY) ||
+                                (iAsyncRequest->iType == ERadioServStationSeekByTA) ||
+                                (iAsyncRequest->iType == ERadioServStationSeekByTP) ) )
+            {
+            CompleteAsyncRequest(KRadioServErrTuning);
+            }
         }
     }
 
@@ -1901,6 +1928,7 @@
             {
             // Client has requested stop only if the requesting client is the only primary client.
             // There are other clients, so don't stop the audio in this case.
+            CompleteAsyncRequest(KErrNone);         //the request needs to be completed though 
             return;
             }
         iState = EStateTunerOn;
--- a/mmserv/radioutility/radioserver/Server/Src/RadioServer.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/radioutility/radioserver/Server/Src/RadioServer.h	Fri Apr 16 15:29:42 2010 +0300
@@ -32,7 +32,7 @@
 #endif // RD_TSP_CLIENT_MAPPER
 #include "RadioServerData.h"
 #include "RadioClientServer.h"
-#include "RadioServerFmTuner.h"
+#include "RadioServerFMTuner.h"
 
 // DATA TYPES
 struct TRadioMessageRequestData
@@ -727,6 +727,8 @@
 	TInt iRdsNotifyCount;
 	// Array to keep track of clients requesting to be notified of RDS Data
 	RArray<TUint> iRdsNotifyClientIdArray;
+	// Wait logic implementation towards adaptation
+	CActiveSchedulerWait* iSchedulerWait;
 
 #ifdef RD_TSP_CLIENT_MAPPER
     // Process Id of the client
--- a/mmserv/radioutility/radioserver/Server/Src/RadioServerFMTuner.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/radioutility/radioserver/Server/Src/RadioServerFMTuner.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -18,7 +18,7 @@
 
 
 // INCLUDE FILES
-#include    "RadioServerFmTuner.h"
+#include    "RadioServerFMTuner.h"
 #include    "RadioDebug.h"
 
 // ============================ MEMBER FUNCTIONS ===============================
--- a/mmserv/radioutility/radioserver/Server/Src/RadioServerSession.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/radioutility/radioserver/Server/Src/RadioServerSession.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -18,8 +18,8 @@
 
 
 // INCLUDE FILES
-#include 	<custominterfacebuilder.h>
-#include 	<custominterfacecustomcommandparser.h>
+#include 	<CustomInterfaceBuilder.h>
+#include 	<CustomInterfaceCustomCommandParser.h>
 #include    <mmf/common/mmfcustomcommandparsermanager.h>
 #include    <mmf/common/mmfcontrollerframework.h>
 #include    <mmf/common/mmfipcserver.h>
--- a/mmserv/radioutility/radioserver/Server/Src/RadioServerSession.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/radioutility/radioserver/Server/Src/RadioServerSession.h	Fri Apr 16 15:29:42 2010 +0300
@@ -22,7 +22,7 @@
 
 //  INCLUDES
 
-#include <mcustominterfacecustomcommandimplementor.h>
+#include <MCustomInterfaceCustomCommandImplementor.h>
 
 #include "RadioServerData.h"
 
--- a/mmserv/thumbnailengine/Group/HXTNEEngine.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/thumbnailengine/Group/HXTNEEngine.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -42,7 +42,7 @@
 
 SOURCEPATH      ../TneProcessorSrc
 SOURCE          yuv2rgb12.cpp
-SOURCE          yuv2rgb16.cpp
+SOURCE          Yuv2rgb16.cpp
 SOURCE          yuv2rgb24.cpp
 
 SOURCEPATH      ../ImaamiSrc
@@ -59,7 +59,7 @@
 SYSTEMINCLUDE   /epoc32/include/mmf/common
 SYSTEMINCLUDE   /epoc32/include/mmf/devvideo
 
-USERINCLUDE	../../Inc
+USERINCLUDE	../../inc
 USERINCLUDE     ../TneAPIInc
 USERINCLUDE     ../TneProcessorInc
 USERINCLUDE     ../ImaamiInc
--- a/mmserv/thumbnailengine/Group/bld.inf	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/thumbnailengine/Group/bld.inf	Fri Apr 16 15:29:42 2010 +0300
@@ -31,7 +31,7 @@
 //
 //  Export stub sis file to eclipse files in the rom image
 //
-../data/vtne_stub.sis      /epoc32/data/z/system/install/vtne_stub.sis
+../data/vtne_stub.SIS     /epoc32/data/z/system/install/vtne_stub.sis
 
 #define HELIX_TNE_ENGINE 1
 
--- a/mmserv/thumbnailengine/ImaamiSrc/DCDigitalZoom.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/thumbnailengine/ImaamiSrc/DCDigitalZoom.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -207,6 +207,16 @@
 									 TInt allShiftX, TInt allShiftY,
 									 TInt newShiftX, TInt newShiftY)
 {
+	// We don't waste time if request ZOOM 1x without Pan
+    if(aZoomX==1 && aZoomY==1)
+    {
+		if(allShiftX==0 && allShiftY==0 && newShiftX ==0 && newShiftX == 0)
+  	  	{
+  	  		TInt handle = aOriPtr->Handle();
+  	  	        aOutPtr->Duplicate(handle);
+  	  	        return;
+  	  	}
+  	}
 	TInt32
 		divider,
 		xPos, yPos, tmpline,
@@ -571,7 +581,7 @@
 			yEndRem = (TUint32)(tmpEnd & REMAINDER);
 
 			//Read a new line from the source image if needed
-			while (yEndInt > LastLine && LastLine < aOriSizeY-1)
+			while (yEndInt > LastLine && LastLine < aOriSizeY)
 			{
 				LastLine++;
 				tmpline = lines[0];
@@ -696,7 +706,7 @@
 				{
 					// Line number
 					if(yStaInt < 0)		   		 outFlag = 1;
-					else if(yStaInt >= aOriSizeY) outFlag = 1;
+					else if(yStaInt > aOriSizeY) outFlag = 1;
 					else
 					{
 						// Initialise line result
@@ -735,11 +745,10 @@
 						}
 
 						// Last pixel in first line
-						if(xEndWei != 0)
+						if(xEndWei != 0 && xEndInt < aOriSizeX)
 						{
 							// Column number
 							if(xEndInt < 0)				 outFlag = 1;
-							else if(xEndInt >= aOriSizeX) outFlag = 1;
 							else
 							{
 								// Pixel weighting to line result
@@ -762,7 +771,7 @@
 				{
 					// Line number 
 					if(j < 0)			   outFlag = 1;
-					else if(j >= aOriSizeY) outFlag = 1;
+					else if(j > aOriSizeY) outFlag = 1;
 					else
 					{
 						// Initialise line result
@@ -801,11 +810,10 @@
 						}
 
 						// Last pixel in middle lines
-						if(xEndWei != 0)
+						if(xEndWei != 0 && xEndInt < aOriSizeX)
 						{
 							// Column number
 							if(xEndInt < 0)				 outFlag = 1;
-							else if(xEndInt >= aOriSizeX) outFlag = 1;
 							else
 							{
 								// Pixel weighting to line result
@@ -829,7 +837,7 @@
 				{
 					// Line number 
 					if(yEndInt < 0)				 outFlag = 1;
-					else if(yEndInt >= aOriSizeY) outFlag = 1;
+					else if(yEndInt > aOriSizeY) outFlag = 1;
 					else
 					{
 						// Initialise line result
@@ -866,11 +874,10 @@
 						}
 
 						// Last pixel in last line
-						if(xEndWei != 0)
+						if(xEndWei != 0 && xEndInt < aOriSizeX)
 						{
 							// Column number
 							if(xEndInt < 0)				 outFlag = 1;
-							else if(xEndInt >= aOriSizeX) outFlag = 1;
 							else
 							{
 								tmpB = (TInt)(tmpB + (*(linePtrs[lines[LineNum]] + 3 * xEndInt    )) * xEndWei);
--- a/mmserv/thumbnailengine/TneAPIInc/HXTneclientservercommon.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/thumbnailengine/TneAPIInc/HXTneclientservercommon.h	Fri Apr 16 15:29:42 2010 +0300
@@ -21,8 +21,8 @@
 #define  _HX_TNE_Client_Server_Common_H_
 
 #include <e32base.h>
-#include <GDI.H>
-#include <FBS.H>
+#include <gdi.h>
+#include <fbs.h>
 
 
 // server name
--- a/mmserv/tms/inc/tmsamrformatimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsamrformatimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -24,14 +24,11 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSCallProxy;
-
 // TMSAMRFormatImpl class
 class TMSAMRFormatImpl : public TMSAMRFormat
     {
 public:
-    ~TMSAMRFormatImpl();
+    virtual ~TMSAMRFormatImpl();
     static gint Create(TMSFormat*& tmsfmt);
     gint SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsbufferimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsbufferimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -29,9 +29,13 @@
 class TMSBufferImpl
     {
 public:
+    ~TMSBufferImpl();
     IMPORT_C static gint Create(TMSBufferType ctype, guint size,
             TMSBuffer*& tmsbuffer);
     IMPORT_C static gint Delete(TMSBuffer*& tmsbuffer);
+
+private:
+    TMSBufferImpl();
     };
 
 } //namespace TMS
--- a/mmserv/tms/inc/tmscallimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmscallimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -27,11 +27,10 @@
 class TMSCallImpl : public TMSCall
     {
 public:
-    ~TMSCallImpl();
-    // We don't have to export this if factory impl is part of tmsimpl.lib
-    // TO DO stop exporting this function
+    virtual ~TMSCallImpl();
     IMPORT_C static gint Create(TMSCallType ctype, TMSCall*& tmscall,
             guint ctxid);
+    IMPORT_C static gint Delete(TMSCall*& tmscall);
 
 private:
     TMSCallImpl();
--- a/mmserv/tms/inc/tmscallserverstartparam.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmscallserverstartparam.h	Fri Apr 16 15:29:42 2010 +0300
@@ -18,13 +18,14 @@
 #ifndef TMSCALLSERVERSTARTPARAM_H
 #define TMSCALLSERVERSTARTPARAM_H
 
+#include <glib.h>
 #include <e32std.h>
 
 namespace TMS {
 
-const TInt KTMSCallServerStackSize = 0x5000; //  20 KB
-const TInt KTMSCallServerInitHeapSize = 0x500000; // 5.2 MB
-const TInt KTMSCallServerMaxHeapSize = 0x1800000; //  25 MB
+const gint KTMSCallServerStackSize = 0x5000; //  20 KB
+const gint KTMSCallServerInitHeapSize = 0x500000; // 5.2 MB
+const gint KTMSCallServerMaxHeapSize = 0x1800000; //  25 MB
 
 // FORWARD DECLARATIONS
 class TMSServer;
--- a/mmserv/tms/inc/tmsclientserver.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsclientserver.h	Fri Apr 16 15:29:42 2010 +0300
@@ -47,17 +47,24 @@
     ETMSStartGlobalEffectNotifier,
     ETMSCancelGlobalEffectNotifier,
     ETMSSetMsgQueueHandle,
-    ETMSRingToneInitDefaultProfile,
+    ETMSRingToneInitDefault,
     ETMSRingToneInitFile,
-    ETMSRingToneInitMimeContent,
+    ETMSRingToneInitSequence,
+    ETMSRingToneInitBeepOnce,
+    ETMSRingToneInitSilent,
+    ETMSRingToneInitUnsecureVoIP,
     ETMSRingToneDeinit,
     ETMSRingTonePlay,
     ETMSRingTonePause,
     ETMSRingToneStop,
+    ETMSRingToneMute,
     ETMSStartDTMFNotifier,
     ETMSCancelDTMFNotifier,
     ETMSStartDTMF,
-    ETMSStopDTMF
+    ETMSStopDTMF,
+    ETMSContinueDTMF,
+    ETMSStartInbandTone,
+    ETMSStopInbandTone
     };
 
 // Ring tone open methods
@@ -85,7 +92,8 @@
     EMsgQueueDTMFType,
     EMsgQueueGlobalRoutingType,
     EMsgQueueGlobalVolumeType,
-    EMsgQueueGlobalGainType
+    EMsgQueueGlobalGainType,
+    EMsgQueueInbandToneType
     };
 
 // CONSTANTS
--- a/mmserv/tms/inc/tmsclientsinkimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsclientsinkimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -30,7 +30,7 @@
 class TMSClientSinkImpl : public TMSClientSink
     {
 public:
-    ~TMSClientSinkImpl();
+    virtual ~TMSClientSinkImpl();
     static gint Create(TMSSink*& tmssink);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsclientsourceimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsclientsourceimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -30,8 +30,7 @@
 class TMSClientSourceImpl : public TMSClientSource
     {
 public:
-    ~TMSClientSourceImpl();
-
+    virtual ~TMSClientSourceImpl();
     static gint Create(TMSSource*& tmssource);
     gint SetProxy(TMSCallProxy* aProxy, gint strmid, gpointer queuehandler);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/inc/tmsdtmfbody.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,44 @@
+/*
+ * 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 TMS_DTMF_BODY_H
+#define TMS_DTMF_BODY_H
+
+#include <tms.h>
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSDTMFObserver;
+
+// CLASS DECLARATION
+class TMSDTMFBody
+    {
+public:
+    virtual ~TMSDTMFBody() {}
+
+    virtual gint AddObserver(TMSDTMFObserver& obsrvr, gpointer user_data) = 0;
+    virtual gint RemoveObserver(TMSDTMFObserver& obsrvr) = 0;
+    virtual gint Start() = 0;
+    virtual gint Stop() = 0;
+    virtual gint SetTone(GString* string) = 0;
+    virtual gint ContinueDTMFStringSending(gboolean aContinue) = 0;
+    };
+
+} //namespace TMS
+
+#endif //TMS_GLOBAL_ROUTING_BODY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/inc/tmsdtmfimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,45 @@
+/*
+ * 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 TMS_DTMF_IMPL_H
+#define TMS_DTMF_IMPL_H
+
+#include <tms.h>
+#include <tmsdtmf.h>
+
+namespace TMS {
+
+// TMSDTMFImpl class
+class TMSDTMFImpl : public TMSDTMF
+    {
+public:
+    virtual ~TMSDTMFImpl();
+    IMPORT_C static gint Create(TMSStreamType streamtype, TMSDTMF*& dtmf);
+    IMPORT_C static gint Delete(TMSDTMF*& dtmf);
+
+private:
+    TMSDTMFImpl(TMSStreamType streamtype);
+    gint PostConstruct();
+    gint SetParent(TMSDTMF*& parent);
+
+private:
+    TMSStreamType iStreamType;
+    };
+
+} //namespace TMS
+
+#endif //TMS_DTMF_IMPL_H
--- a/mmserv/tms/inc/tmseffectimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmseffectimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -29,9 +29,13 @@
 class TMSEffectImpl
     {
 public:
+    ~TMSEffectImpl();
     IMPORT_C static gint Create(TMSEffectType effecttype,
             TMSEffect*& tmseffect);
     IMPORT_C static gint Delete(TMSEffect*& tmseffect);
+
+private:
+    TMSEffectImpl();
     };
 
 } //namespace TMS
--- a/mmserv/tms/inc/tmsformatimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsformatimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -30,6 +30,7 @@
 class TMSFormatImpl : public TMSFormat
     {
 public:
+    virtual ~TMSFormatImpl();
     IMPORT_C static gint Create(TMSFormatType formattype,
             TMSFormat*& tmsformat);
     IMPORT_C static gint Delete(TMSFormat*& tmsformat);
--- a/mmserv/tms/inc/tmsg711formatimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsg711formatimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -23,15 +23,11 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSCallProxy;
-
 // TMSG711FormatImpl class
 class TMSG711FormatImpl : public TMSG711Format
     {
 public:
-    ~TMSG711FormatImpl();
-
+    virtual ~TMSG711FormatImpl();
     static gint Create(TMSFormat*& tmsfmt);
     gint SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsg729formatimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsg729formatimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -23,15 +23,11 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSCallProxy;
-
 // TMSG729FormatImpl class
 class TMSG729FormatImpl : public TMSG729Format
     {
 public:
-    ~TMSG729FormatImpl();
-
+    virtual ~TMSG729FormatImpl();
     static gint Create(TMSFormat*& tmsfmt);
     gint SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsgaineffectimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsgaineffectimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -30,19 +30,17 @@
 class TMSGainEffectImpl : public TMSGainEffect
     {
 public:
-    ~TMSGainEffectImpl();
-
+    virtual ~TMSGainEffectImpl();
     static gint Create(TMSEffect*& tmseffect);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
-    gint SetParentEffect(TMSEffect*& parenteffect);
 
 private:
     TMSGainEffectImpl();
     gint PostConstruct();
+    gint SetParent(TMSEffect*& parent);
     };
 
 } //namespace TMS
 
 #endif // TMS_GAIN_EFFECT_IMPL_H
 
-// End of file
--- a/mmserv/tms/inc/tmsglobalgaineffectimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsglobalgaineffectimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -23,25 +23,20 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSProxy;
-
 // TMSGlobalGainEffectImpl class
 class TMSGlobalGainEffectImpl : public TMSGlobalGainEffect
     {
 public:
-    ~TMSGlobalGainEffectImpl();
-
+    virtual ~TMSGlobalGainEffectImpl();
     static gint Create(TMSEffect*& tmseffect);
-    gint SetParentEffect(TMSEffect*& parenteffect);
 
 private:
     TMSGlobalGainEffectImpl();
     gint PostConstruct();
+    gint SetParent(TMSEffect*& parent);
     };
 
 } //namespace TMS
 
 #endif // TMS_GLOBAL_GAIN_EFFECT_IMPL_H
 
-// End of file
--- a/mmserv/tms/inc/tmsglobalroutingimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsglobalroutingimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -23,25 +23,21 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSProxy;
-
 // TMSGlobalRoutingImpl class
 class TMSGlobalRoutingImpl : public TMSGlobalRouting
     {
 public:
-    ~TMSGlobalRoutingImpl();
-
+    virtual ~TMSGlobalRoutingImpl();
     IMPORT_C static gint Create(TMSGlobalRouting*& globrouting);
     IMPORT_C static gint Delete(TMSGlobalRouting*& globrouting);
 
 private:
     TMSGlobalRoutingImpl();
     gint PostConstruct();
+    gint SetParent(TMSGlobalRouting*& parent);
     };
 
 } //namespace TMS
 
 #endif // TMS_GLOBAL_ROUTING_IMPL_H
 
-// End of file
--- a/mmserv/tms/inc/tmsglobalvoleffectimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsglobalvoleffectimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -23,24 +23,20 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSProxy;
-
 // TMSGlobalVolEffectImpl class
 class TMSGlobalVolEffectImpl : public TMSGlobalVolEffect
     {
 public:
-    ~TMSGlobalVolEffectImpl();
+    virtual ~TMSGlobalVolEffectImpl();
     static gint Create(TMSEffect*& tmseffect);
 
 private:
     TMSGlobalVolEffectImpl();
     gint PostConstruct();
-    gint SetParentEffect(TMSEffect*& parenteffect);
+    gint SetParent(TMSEffect*& parent);
     };
 
 } //namespace TMS
 
 #endif // TMS_GLOBAL_VOLUME_EFFECT_IMPL_H
 
-// End of file
--- a/mmserv/tms/inc/tmsilbcformatimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsilbcformatimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -23,16 +23,12 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSCallProxy;
-
 // TMSILBCFormatImpl class
 class TMSILBCFormatImpl : public TMSILBCFormat
     {
 public:
 
-    ~TMSILBCFormatImpl();
-
+    virtual ~TMSILBCFormatImpl();
     static gint Create(TMSFormat*& tmsfmt);
     gint SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/inc/tmsinbandtonebody.h	Fri Apr 16 15:29:42 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: Telephony Multimedia Service
+ *
+ */
+
+#ifndef TMS_INBAND_BODY_H
+#define TMS_INBAND_BODY_H
+
+#include <tms.h>
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSInbandToneObserver;
+
+// CLASS DECLARATION
+class TMSInbandToneBody
+    {
+public:
+    virtual ~TMSInbandToneBody() {}
+
+    virtual gint AddObserver(TMSInbandToneObserver& obsrvr, gpointer user_data) = 0;
+    virtual gint RemoveObserver(TMSInbandToneObserver& obsrvr) = 0;
+    virtual gint Start(TMSInbandToneType inbandtype) = 0;
+    virtual gint Stop() = 0;
+
+    };
+
+} //namespace TMS
+
+#endif //TMS_INBAND_BODY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/inc/tmsinbandtoneimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,45 @@
+/*
+ * 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 TMS_INBAND_IMPL_H
+#define TMS_INBAND_IMPL_H
+
+#include <tms.h>
+#include <tmsinbandtone.h>
+
+namespace TMS {
+
+// TMSDTMFImpl class
+class TMSInbandToneImpl : public TMSInbandTone
+    {
+public:
+    virtual ~TMSInbandToneImpl();
+    IMPORT_C static gint Create(TMSInbandTone*& inbandtone);
+    IMPORT_C static gint Delete(TMSInbandTone*& inbandtone);
+
+private:
+    TMSInbandToneImpl();
+    gint PostConstruct();
+    gint SetParent(TMSInbandTone*& parent);
+
+private:
+    TMSInbandToneType iInbandToneType;
+    };
+
+} //namespace TMS
+
+#endif
--- a/mmserv/tms/inc/tmsmembuffer.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsmembuffer.h	Fri Apr 16 15:29:42 2010 +0300
@@ -26,8 +26,11 @@
 class TMSMemBuffer : public TMSBuffer
     {
 public:
-    ~TMSMemBuffer();
+    virtual ~TMSMemBuffer();
 
+    /**
+     * Factory methods
+     */
     static gint Create(guint size, TMSBuffer*& tmsbuffer);
     static gint Create(guint size, guint8* dataptr, TMSBuffer*& tmsbuffer);
 
--- a/mmserv/tms/inc/tmsmicsourceimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsmicsourceimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -30,7 +30,7 @@
 class TMSMicSourceImpl : public TMSMicSource
     {
 public:
-    ~TMSMicSourceImpl();
+    virtual ~TMSMicSourceImpl();
     static gint Create(TMSSource*& tmssource);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsmodemsinkimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsmodemsinkimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -30,7 +30,7 @@
 class TMSModemSinkImpl : public TMSModemSink
     {
 public:
-    ~TMSModemSinkImpl();
+    virtual ~TMSModemSinkImpl();
     static gint Create(TMSSink*& tmssink);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsmodemsourceimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsmodemsourceimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -30,7 +30,7 @@
 class TMSModemSourceImpl : public TMSModemSource
     {
 public:
-    ~TMSModemSourceImpl();
+    virtual ~TMSModemSourceImpl();
     static gint Create(TMSSource*& tmssource);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmspcmformatimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmspcmformatimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -23,15 +23,11 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSCallProxy;
-
 // TMSPCMFormatImpl class
 class TMSPCMFormatImpl : public TMSPCMFormat
     {
 public:
-
-    ~TMSPCMFormatImpl();
+    virtual ~TMSPCMFormatImpl();
     static gint Create(TMSFormat*& tmsfmt);
     gint SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsproxy.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsproxy.h	Fri Apr 16 15:29:42 2010 +0300
@@ -32,6 +32,12 @@
 class TMSEffectObserver;
 class TMSGlobalRouting;
 class TMSGlobalRoutingObserver;
+class TMSDTMF;
+class TMSDTMFObserver;
+class TMSRingTone;
+class TMSRingToneObserver;
+class TMSInbandTone;
+class TMSInbandToneObserver;
 
 // TMSProxy class
 class TMSProxy : public RSessionBase,
@@ -77,6 +83,24 @@
     IMPORT_C gint GetMaxGain(guint& level);
     IMPORT_C gint SetGain(guint level);
 
+    // Ringtone
+    IMPORT_C gint InitRT(const TMSRingToneType type, GString* str,
+            GString* tts);
+    IMPORT_C gint DeinitRT();
+    IMPORT_C gint PlayRT();
+    IMPORT_C gint StopRT();
+    IMPORT_C gint PauseRT();
+    IMPORT_C gint MuteRT();
+
+    // TMSDTMF
+    IMPORT_C gint StartDTMF(TMSStreamType streamtype, GString* tone);
+    IMPORT_C gint StopDTMF(TMSStreamType streamtype);
+    IMPORT_C gint ContinueDTMFStringSending(TBool continuesending);
+
+    // TMSInbandTone
+    IMPORT_C gint StartInbandTone(TMSInbandToneType inbandtonetype);
+    IMPORT_C gint StopInbandTone();
+
     // Global notifiers
     IMPORT_C gint StartDTMFNotifier();
     IMPORT_C gint CancelDTMFNotifier();
@@ -105,20 +129,38 @@
     gint AddRoutingObserver(TMSGlobalRoutingObserver& obsrvr,
             TMSGlobalRouting& parent, gint clientid);
     gint RemoveRoutingObserver(TMSGlobalRoutingObserver& obsrvr);
+    gint AddRingToneObserver(TMSRingToneObserver& obsrvr, TMSRingTone& parent,
+            gint clientid);
+    gint RemoveRingToneObserver(TMSRingToneObserver& obsrvr);
+    gint AddDTMFObserver(TMSDTMFObserver& obsrvr, TMSDTMF& parent,
+            gint clientid);
+    gint RemoveDTMFObserver(TMSDTMFObserver& obsrvr);
+    gint AddInbandToneObserver(TMSInbandToneObserver& obsrvr,
+            TMSInbandTone& parent, gint clientid);
+    gint RemoveInbandToneObserver(TMSInbandToneObserver& obsrvr);
 
     gint CreateQueue(const gint aNumSlots);
     void ReceiveMsgQHandlerEventsL();
+    void ResetObjectLists();
 
 private:
     TRoutingMsgBufPckg ipckg;
+
     RPointerArray<TMSEffectObserver> iEffectsObsrvrList;
+    RPointerArray<TMSGlobalRoutingObserver> iRoutingObsrvrList;
+    RPointerArray<TMSRingToneObserver> iRingToneObsrvrList;
+    RPointerArray<TMSDTMFObserver> iDTMFObsrvrList;
+    RPointerArray<TMSInbandToneObserver> iInbandToneObsrvrList;
+
     RPointerArray<TMSEffect> iEffectsParentList;
-    RPointerArray<TMSGlobalRoutingObserver> iRoutingObsrvrList;
     RPointerArray<TMSGlobalRouting> iRoutingParentList;
+    RPointerArray<TMSRingTone> iRingToneParentList;
+    RPointerArray<TMSDTMF> iDTMFParentList;
+    RPointerArray<TMSInbandTone> iInbandToneParentList;
 
     // Message queue and the handler
     RMsgQueue<TmsMsgBuf> iMsgQueue;
-    CQueueHandler* iMsgQHandler;
+    TMSQueueHandler* iMsgQHandler;
     };
 
 } //namespace TMS
--- a/mmserv/tms/inc/tmsqueuehandler.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsqueuehandler.h	Fri Apr 16 15:29:42 2010 +0300
@@ -37,13 +37,13 @@
 class MQueueHandlerObserver
     {
 public:
-    virtual void QueueEvent(TInt aEventType, TInt aError, void* user_data) = 0;
+    virtual void QueueEvent(gint aEventType, gint aError, void* user_data) = 0;
     };
 
 /**
- *  CQueueHandler class
+ *  TMSQueueHandler class
  */
-NONSHARABLE_CLASS(CQueueHandler) : public CActive
+NONSHARABLE_CLASS(TMSQueueHandler) : public CActive
     {
 public:
 
@@ -52,13 +52,13 @@
      * Contructor
      *
      */
-    static CQueueHandler* NewL(RMsgQueue<TmsMsgBuf>* aMsgQueue,
+    static TMSQueueHandler* NewL(RMsgQueue<TmsMsgBuf>* aMsgQueue,
             TMSGlobalContext* glblCtx);
 
     /**
      * destructor
      */
-    virtual ~CQueueHandler();
+    virtual ~TMSQueueHandler();
 
     /**
      * Start
@@ -72,15 +72,15 @@
      */
     TRequestStatus* Status();
 
-    TInt AddObserver(MQueueHandlerObserver& obsvr, TInt aClientId);
-    TInt RemoveObserver(MQueueHandlerObserver& obsvr);
+    gint AddObserver(MQueueHandlerObserver& obsvr, gint aClientId);
+    gint RemoveObserver(MQueueHandlerObserver& obsvr);
 
 private:
 
     /**
      * constructor
      */
-    CQueueHandler(RMsgQueue<TmsMsgBuf>* aMsgQueue,
+    TMSQueueHandler(RMsgQueue<TmsMsgBuf>* aMsgQueue,
             TMSGlobalContext* glblCtx);
 
     void ConstructL();
@@ -89,19 +89,20 @@
     void DoCancel();
     void RunL();
     TInt RunError(TInt aError);
-    void DoFillBuffer(TInt aBufLen, TInt aStatus, TBool flag, TUint32 key);
-    void DoEmptyBuffer(TInt aBufLen, TInt aStatus, TBool flag, TUint32 key);
-    TInt FindStreamInList();
-    TInt FindGainEffectInList();
-    TInt FindVolEffectInList();
-    TMSStreamState ConvertToStreamState(TInt request);
+
+    void DoFillBuffer(gint aBufLen, gint aStatus, gboolean flag, guint32 key);
+    void DoEmptyBuffer(gint aBufLen, gint aStatus, gboolean flag, guint32 key);
+    gint FindStreamInList();
+    gint FindGainEffectInList();
+    gint FindVolEffectInList();
+    TMSStreamState ConvertToStreamState(gint request);
 
 private:
     // data
 
     RPointerArray<MQueueHandlerObserver> iObserversList; // (not owned)
     MQueueHandlerObserver* iObserver; //not owned
-    RArray<TInt> iClientList;
+    RArray<gint> iClientList;
     RMsgQueue<TmsMsgBuf>* iMsgQueue;
 
     RChunk iChunk;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/inc/tmsringtonebody.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,48 @@
+/*
+ * 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 TMS_RINGTONE_BODY_H
+#define TMS_RINGTONE_BODY_H
+
+#include <tms.h>
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSRingToneObserver;
+
+// TMSRingToneBody class
+class TMSRingToneBody
+    {
+public:
+    virtual ~TMSRingToneBody() {}
+
+    virtual gint AddObserver(TMSRingToneObserver& obsrvr,
+            gpointer user_data) = 0;
+    virtual gint RemoveObserver(TMSRingToneObserver& obsrvr) = 0;
+    virtual gint Init(const TMSRingToneType type, GString* str,
+            GString* tts) = 0;
+    virtual gint Deinit() = 0;
+    virtual gint Play() = 0;
+    virtual gint Stop() = 0;
+    virtual gint Pause() = 0;
+    virtual gint Mute() = 0;
+    };
+
+} //namespace TMS
+
+#endif //TMS_RINGTONE_BODY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/inc/tmsringtoneimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,47 @@
+/*
+ * 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 TMS_RINGTONEIMPL_H_
+#define TMS_RINGTONEIMPL_H_
+
+#include <w32std.h>
+#include <tms.h>
+#include <tmsringtone.h>
+
+namespace TMS {
+
+// TMSRingToneImpl class
+class TMSRingToneImpl : public TMSRingTone
+    {
+public:
+    virtual ~TMSRingToneImpl();
+
+    IMPORT_C static gint Create(TMSRingTone*& tmsrt);
+    IMPORT_C static gint Create(TMSRingTone*& tmsrt, RWindow& window,
+            gint scrid);
+    IMPORT_C static gint Delete(TMSRingTone*& tmsrt);
+
+private:
+    TMSRingToneImpl();
+    gint PostConstruct();
+    gint PostConstruct(RWindow& window, gint scrid);
+    gint SetParent(TMSRingTone*& parent);
+    };
+
+} //namespace TMS
+
+#endif //TMS_RINGTONEIMPL_H_
--- a/mmserv/tms/inc/tmsshared.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsshared.h	Fri Apr 16 15:29:42 2010 +0300
@@ -27,19 +27,19 @@
 namespace TMS {
 
 // CONSTANTS
-const TUint KQueueCreateWaitTime = 10; //10ms
+const guint KQueueCreateWaitTime = 10; //10ms
 
-const TUint KTMSG711FrameLen10ms = 82; //10ms ->  80 + 2 for header
-const TUint KTMSG711FrameLen20ms = 162; //20ms -> 160 + 2 for header
+const guint KTMSG711FrameLen10ms = 82;  //10ms ->  80 + 2 for header
+const guint KTMSG711FrameLen20ms = 162; //20ms -> 160 + 2 for header
 
-const TInt KTMSAMRNBFrameLen   = 14; //frame-mode OFF
-const TInt KTMSAMRNBFrameLenFM = 32; //frame-mode ON
+const gint KTMSAMRNBFrameLen   = 14; //frame-mode OFF
+const gint KTMSAMRNBFrameLenFM = 32; //frame-mode ON
 
-const TInt KTMSILBCFrameLen20ms = 40; //20ms
-const TInt KTMSILBCFrameLen30ms = 52; //30ms
+const gint KTMSILBCFrameLen20ms = 40; //20ms
+const gint KTMSILBCFrameLen30ms = 52; //30ms
 
-const TInt KTMSG729FrameLen   = 24; //10 octets + 2 for header
-const TUint KTMSPCM16FrameLen = 4096;
+const gint KTMSG729FrameLen   = 24; //10 octets + 2 for header
+const guint KTMSPCM16FrameLen = 4096;
 
 // ENUMERATIONS
 
@@ -119,10 +119,13 @@
     ECmdDTMFTonePlayFinished,
     ECmdRingToneOpenComplete,
     ECmdRingTonePlayComplete,
+    ECmdRingToneDeinitComplete,
     ECmdDownlinkClosed,
     ECmdUplinkClosed,
     ECmdGlobalRoutingChange,
-    ECmdGlobalEffectChange
+    ECmdGlobalEffectChange,
+    ECmdInbandToneStarted,
+    ECmdInbandToneStopped
     };
 
 // -----------------------------------------------------------------------------
@@ -150,7 +153,7 @@
     gboolean iFrameMode;
     gboolean iFrameModeReqForEC;
     guint iBitrate;
-    RArray<TUint> iArrBitrates;
+    RArray<guint> iArrBitrates;
     };
 
 // -----------------------------------------------------------------------------
--- a/mmserv/tms/inc/tmssinkimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmssinkimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -29,8 +29,12 @@
 class TMSSinkImpl
     {
 public:
+    ~TMSSinkImpl();
     IMPORT_C static gint Create(TMSSinkType sinktype, TMSSink*& tmssink);
     IMPORT_C static gint Delete(TMSSink*& tmssink);
+
+private:
+    TMSSinkImpl();
     };
 
 } //namespace TMS
--- a/mmserv/tms/inc/tmssourceimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmssourceimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -29,9 +29,13 @@
 class TMSSourceImpl
     {
 public:
+    ~TMSSourceImpl();
     IMPORT_C static gint Create(TMSSourceType sourcetype,
             TMSSource*& tmssource);
     IMPORT_C static gint Delete(TMSSource*& tmssource);
+
+private:
+    TMSSourceImpl();
     };
 
 } //namespace TMS
--- a/mmserv/tms/inc/tmsspeakersinkimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsspeakersinkimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -30,7 +30,7 @@
 class TMSSpeakerSinkImpl : public TMSSpeakerSink
     {
 public:
-    ~TMSSpeakerSinkImpl();
+    virtual ~TMSSpeakerSinkImpl();
     static gint Create(TMSSink*& tmssink);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsstreamimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsstreamimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -30,9 +30,10 @@
 class TMSStreamImpl : public TMSStream
     {
 public:
-    ~TMSStreamImpl();
+    virtual ~TMSStreamImpl();
     static gint Create(TMSCallType callType, TMSStreamType ctype,
             TMSCallProxy* proxy, TMSStream*& tmsstream);
+    static gint Delete(TMSStream*& tmsrt);
 
 private:
     TMSStreamImpl();
--- a/mmserv/tms/inc/tmsutility.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsutility.h	Fri Apr 16 15:29:42 2010 +0300
@@ -63,11 +63,15 @@
 #define TOFOURCC(format) TMSUtility::ToFourCC(format)
 #define TOTMSFORMAT(fourcc) TMSUtility::FourCCToTMSFormat(fourcc)
 
+_LIT(KTMSPanic, "TMS Panic!" );
+#define PANIC(reason) User::Panic(KTMSPanic, reason)
+
 // TMSUtility class
 class TMSUtility
     {
 public:
     IMPORT_C static gint TMSResult(const gint error);
+    IMPORT_C static gint EtelToTMSResult(const gint error);
     IMPORT_C static TMSAudioOutput ToTMSOutput(
             CTelephonyAudioRouting::TAudioOutput taroutput);
     IMPORT_C static CTelephonyAudioRouting::TAudioOutput ToTAROutput(
--- a/mmserv/tms/inc/tmsvolumeeffectimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/inc/tmsvolumeeffectimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -30,19 +30,17 @@
 class TMSVolumeEffectImpl : public TMSVolumeEffect
     {
 public:
-    ~TMSVolumeEffectImpl();
-
+    virtual ~TMSVolumeEffectImpl();
     static gint Create(TMSEffect*& tmseffect);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
-    gint SetParentEffect(TMSEffect*& parenteffect);
 
 private:
     TMSVolumeEffectImpl();
     gint PostConstruct();
+    gint SetParent(TMSEffect*& parent);
     };
 
 } //namespace TMS
 
 #endif // TMS_VOLUME_EFFECT_IMPL_H
 
-// End of file
Binary file mmserv/tms/sis/10207C80.cre has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/sis/tms_cenrep.pkg	Fri Apr 16 15:29:42 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:	Package file for Project TMS Cenrep.
+;
+; Languages
+&EN
+
+; Header
+#{ "TMS CenRep INI file"}, (0x10202BE9), 1, 0, 0, TYPE=SP
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Vendor"
+
+; CenRep ini file
+"10207c80.cre" - "$:\private\10202be9\10207c80.cre"
--- a/mmserv/tms/tmsapi/bwins/tmsapi.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsapi/bwins/tmsapi.def	Fri Apr 16 15:29:42 2010 +0300
@@ -1,128 +1,152 @@
 EXPORTS
 	??1TMSClientSource@TMS@@UAE@XZ @ 1 NONAME ; TMS::TMSClientSource::~TMSClientSource(void)
-	?GetType@TMSMicSource@TMS@@UAEHAAH@Z @ 2 NONAME ; int TMS::TMSMicSource::GetType(int &)
-	?GetMaxLevel@TMSGainEffect@TMS@@QAEHAAI@Z @ 3 NONAME ; int TMS::TMSGainEffect::GetMaxLevel(unsigned int &)
-	?DeleteStream@TMSCall@TMS@@QAEHAAPAVTMSStream@2@@Z @ 4 NONAME ; int TMS::TMSCall::DeleteStream(class TMS::TMSStream * &)
+	?Start@TMSInbandTone@TMS@@QAEHH@Z @ 2 NONAME ; int TMS::TMSInbandTone::Start(int)
+	?DeleteStream@TMSCall@TMS@@QAEHAAPAVTMSStream@2@@Z @ 3 NONAME ; int TMS::TMSCall::DeleteStream(class TMS::TMSStream * &)
+	?Stop@TMSRingTone@TMS@@QAEHXZ @ 4 NONAME ; int TMS::TMSRingTone::Stop(void)
 	?SetCNG@TMSILBCFormat@TMS@@QAEHH@Z @ 5 NONAME ; int TMS::TMSILBCFormat::SetCNG(int)
 	?GetMode@TMSILBCFormat@TMS@@QAEHAAH@Z @ 6 NONAME ; int TMS::TMSILBCFormat::GetMode(int &)
 	?GetCNG@TMSG711Format@TMS@@QAEHAAH@Z @ 7 NONAME ; int TMS::TMSG711Format::GetCNG(int &)
 	?GetLevel@TMSGlobalVolEffect@TMS@@QAEHAAI@Z @ 8 NONAME ; int TMS::TMSGlobalVolEffect::GetLevel(unsigned int &)
 	?Deinit@TMSStream@TMS@@QAEXXZ @ 9 NONAME ; void TMS::TMSStream::Deinit(void)
-	??0TMSMicSource@TMS@@IAE@XZ @ 10 NONAME ; TMS::TMSMicSource::TMSMicSource(void)
-	?Stop@TMSStream@TMS@@QAEHXZ @ 11 NONAME ; int TMS::TMSStream::Stop(void)
-	?AddObserver@TMSGlobalVolEffect@TMS@@QAEHAAVTMSEffectObserver@2@PAX@Z @ 12 NONAME ; int TMS::TMSGlobalVolEffect::AddObserver(class TMS::TMSEffectObserver &, void *)
-	?GetType@TMSSpeakerSink@TMS@@UAEHAAH@Z @ 13 NONAME ; int TMS::TMSSpeakerSink::GetType(int &)
-	??1TMSPCMFormat@TMS@@UAE@XZ @ 14 NONAME ; TMS::TMSPCMFormat::~TMSPCMFormat(void)
-	??1TMSStream@TMS@@QAE@XZ @ 15 NONAME ; TMS::TMSStream::~TMSStream(void)
-	?Start@TMSStream@TMS@@QAEHXZ @ 16 NONAME ; int TMS::TMSStream::Start(void)
-	?RemoveObserver@TMSGlobalGainEffect@TMS@@QAEHAAVTMSEffectObserver@2@@Z @ 17 NONAME ; int TMS::TMSGlobalGainEffect::RemoveObserver(class TMS::TMSEffectObserver &)
-	?AddObserver@TMSGlobalRouting@TMS@@QAEHAAVTMSGlobalRoutingObserver@2@PAX@Z @ 18 NONAME ; int TMS::TMSGlobalRouting::AddObserver(class TMS::TMSGlobalRoutingObserver &, void *)
-	?AddObserver@TMSClientSource@TMS@@QAEHAAVTMSClientSourceObserver@2@PAX@Z @ 19 NONAME ; int TMS::TMSClientSource::AddObserver(class TMS::TMSClientSourceObserver &, void *)
-	??0TMSModemSink@TMS@@IAE@XZ @ 20 NONAME ; TMS::TMSModemSink::TMSModemSink(void)
-	?RemoveSink@TMSStream@TMS@@QAEHPAVTMSSink@2@@Z @ 21 NONAME ; int TMS::TMSStream::RemoveSink(class TMS::TMSSink *)
-	?RemoveObserver@TMSGainEffect@TMS@@QAEHAAVTMSEffectObserver@2@@Z @ 22 NONAME ; int TMS::TMSGainEffect::RemoveObserver(class TMS::TMSEffectObserver &)
-	??0TMSModemSource@TMS@@IAE@XZ @ 23 NONAME ; TMS::TMSModemSource::TMSModemSource(void)
-	??1TMSAMRFormat@TMS@@UAE@XZ @ 24 NONAME ; TMS::TMSAMRFormat::~TMSAMRFormat(void)
-	?GetType@TMSClientSource@TMS@@UAEHAAH@Z @ 25 NONAME ; int TMS::TMSClientSource::GetType(int &)
-	??0TMSClientSink@TMS@@IAE@XZ @ 26 NONAME ; TMS::TMSClientSink::TMSClientSink(void)
-	??0TMSFormat@TMS@@IAE@XZ @ 27 NONAME ; TMS::TMSFormat::TMSFormat(void)
-	?SetLevel@TMSVolumeEffect@TMS@@QAEHI@Z @ 28 NONAME ; int TMS::TMSVolumeEffect::SetLevel(unsigned int)
-	??1TMSClientSink@TMS@@UAE@XZ @ 29 NONAME ; TMS::TMSClientSink::~TMSClientSink(void)
-	?SetOutput@TMSGlobalRouting@TMS@@QAEHH@Z @ 30 NONAME ; int TMS::TMSGlobalRouting::SetOutput(int)
-	?GetType@TMSVolumeEffect@TMS@@UAEHAAH@Z @ 31 NONAME ; int TMS::TMSVolumeEffect::GetType(int &)
-	?AddEffect@TMSStream@TMS@@QAEHPAVTMSEffect@2@@Z @ 32 NONAME ; int TMS::TMSStream::AddEffect(class TMS::TMSEffect *)
-	?GetType@TMSModemSink@TMS@@UAEHAAH@Z @ 33 NONAME ; int TMS::TMSModemSink::GetType(int &)
-	?RemoveObserver@TMSGlobalRouting@TMS@@QAEHAAVTMSGlobalRoutingObserver@2@@Z @ 34 NONAME ; int TMS::TMSGlobalRouting::RemoveObserver(class TMS::TMSGlobalRoutingObserver &)
-	?CreateStream@TMSCall@TMS@@QAEHHAAPAVTMSStream@2@@Z @ 35 NONAME ; int TMS::TMSCall::CreateStream(int, class TMS::TMSStream * &)
-	?BufferFilled@TMSClientSource@TMS@@QAEHAAVTMSBuffer@2@@Z @ 36 NONAME ; int TMS::TMSClientSource::BufferFilled(class TMS::TMSBuffer &)
-	?Pause@TMSStream@TMS@@QAEHXZ @ 37 NONAME ; int TMS::TMSStream::Pause(void)
-	?GetType@TMSGainEffect@TMS@@UAEHAAH@Z @ 38 NONAME ; int TMS::TMSGainEffect::GetType(int &)
-	?GetCNG@TMSILBCFormat@TMS@@QAEHAAH@Z @ 39 NONAME ; int TMS::TMSILBCFormat::GetCNG(int &)
-	?SetBitRate@TMSFormat@TMS@@QAEHI@Z @ 40 NONAME ; int TMS::TMSFormat::SetBitRate(unsigned int)
-	?SetLevel@TMSGlobalGainEffect@TMS@@QAEHI@Z @ 41 NONAME ; int TMS::TMSGlobalGainEffect::SetLevel(unsigned int)
-	??0TMSGlobalRouting@TMS@@IAE@XZ @ 42 NONAME ; TMS::TMSGlobalRouting::TMSGlobalRouting(void)
-	?AddObserver@TMSStream@TMS@@QAEHAAVTMSStreamObserver@2@PAX@Z @ 43 NONAME ; int TMS::TMSStream::AddObserver(class TMS::TMSStreamObserver &, void *)
-	?GetLevel@TMSGainEffect@TMS@@QAEHAAI@Z @ 44 NONAME ; int TMS::TMSGainEffect::GetLevel(unsigned int &)
-	??0TMSG729Format@TMS@@IAE@XZ @ 45 NONAME ; TMS::TMSG729Format::TMSG729Format(void)
-	??0TMSPCMFormat@TMS@@IAE@XZ @ 46 NONAME ; TMS::TMSPCMFormat::TMSPCMFormat(void)
-	??1TMSG729Format@TMS@@UAE@XZ @ 47 NONAME ; TMS::TMSG729Format::~TMSG729Format(void)
-	?SetLevel@TMSGainEffect@TMS@@QAEHI@Z @ 48 NONAME ; int TMS::TMSGainEffect::SetLevel(unsigned int)
-	?AddObserver@TMSGainEffect@TMS@@QAEHAAVTMSEffectObserver@2@PAX@Z @ 49 NONAME ; int TMS::TMSGainEffect::AddObserver(class TMS::TMSEffectObserver &, void *)
-	?RemoveObserver@TMSVolumeEffect@TMS@@QAEHAAVTMSEffectObserver@2@@Z @ 50 NONAME ; int TMS::TMSVolumeEffect::RemoveObserver(class TMS::TMSEffectObserver &)
-	?GetType@TMSGlobalVolEffect@TMS@@UAEHAAH@Z @ 51 NONAME ; int TMS::TMSGlobalVolEffect::GetType(int &)
-	??1TMSSpeakerSink@TMS@@UAE@XZ @ 52 NONAME ; TMS::TMSSpeakerSink::~TMSSpeakerSink(void)
-	?SetVADMode@TMSG729Format@TMS@@QAEHH@Z @ 53 NONAME ; int TMS::TMSG729Format::SetVADMode(int)
-	?GetVADMode@TMSG729Format@TMS@@QAEHAAH@Z @ 54 NONAME ; int TMS::TMSG729Format::GetVADMode(int &)
-	?GetPreviousOutput@TMSGlobalRouting@TMS@@QAEHAAH@Z @ 55 NONAME ; int TMS::TMSGlobalRouting::GetPreviousOutput(int &)
-	?GetMaxLevel@TMSVolumeEffect@TMS@@QAEHAAI@Z @ 56 NONAME ; int TMS::TMSVolumeEffect::GetMaxLevel(unsigned int &)
-	??0TMSCall@TMS@@IAE@XZ @ 57 NONAME ; TMS::TMSCall::TMSCall(void)
-	?SetPlc@TMSG711Format@TMS@@QAEHH@Z @ 58 NONAME ; int TMS::TMSG711Format::SetPlc(int)
-	?GetStreamType@TMSStream@TMS@@QAEHXZ @ 59 NONAME ; int TMS::TMSStream::GetStreamType(void)
-	?AddSource@TMSStream@TMS@@QAEHPAVTMSSource@2@@Z @ 60 NONAME ; int TMS::TMSStream::AddSource(class TMS::TMSSource *)
-	??0TMSAMRFormat@TMS@@IAE@XZ @ 61 NONAME ; TMS::TMSAMRFormat::TMSAMRFormat(void)
-	?GetOutput@TMSGlobalRouting@TMS@@QAEHAAH@Z @ 62 NONAME ; int TMS::TMSGlobalRouting::GetOutput(int &)
-	??0TMSGlobalVolEffect@TMS@@IAE@XZ @ 63 NONAME ; TMS::TMSGlobalVolEffect::TMSGlobalVolEffect(void)
-	?SetVADMode@TMSG711Format@TMS@@QAEHH@Z @ 64 NONAME ; int TMS::TMSG711Format::SetVADMode(int)
-	?GetType@TMSModemSource@TMS@@UAEHAAH@Z @ 65 NONAME ; int TMS::TMSModemSource::GetType(int &)
-	??0TMSG711Format@TMS@@IAE@XZ @ 66 NONAME ; TMS::TMSG711Format::TMSG711Format(void)
-	?GetStreamId@TMSStream@TMS@@QAEHXZ @ 67 NONAME ; int TMS::TMSStream::GetStreamId(void)
-	?GetState@TMSStream@TMS@@QAEHXZ @ 68 NONAME ; int TMS::TMSStream::GetState(void)
-	??0TMSVolumeEffect@TMS@@IAE@XZ @ 69 NONAME ; TMS::TMSVolumeEffect::TMSVolumeEffect(void)
-	??1TMSG711Format@TMS@@UAE@XZ @ 70 NONAME ; TMS::TMSG711Format::~TMSG711Format(void)
-	??1TMSGlobalVolEffect@TMS@@UAE@XZ @ 71 NONAME ; TMS::TMSGlobalVolEffect::~TMSGlobalVolEffect(void)
-	?AddSink@TMSStream@TMS@@QAEHPAVTMSSink@2@@Z @ 72 NONAME ; int TMS::TMSStream::AddSink(class TMS::TMSSink *)
-	?ResetFormat@TMSStream@TMS@@QAEHPAVTMSFormat@2@@Z @ 73 NONAME ; int TMS::TMSStream::ResetFormat(class TMS::TMSFormat *)
-	?GetType@TMSClientSink@TMS@@UAEHAAH@Z @ 74 NONAME ; int TMS::TMSClientSink::GetType(int &)
-	??1TMSGlobalGainEffect@TMS@@UAE@XZ @ 75 NONAME ; TMS::TMSGlobalGainEffect::~TMSGlobalGainEffect(void)
-	?AddObserver@TMSVolumeEffect@TMS@@QAEHAAVTMSEffectObserver@2@PAX@Z @ 76 NONAME ; int TMS::TMSVolumeEffect::AddObserver(class TMS::TMSEffectObserver &, void *)
-	?SetMode@TMSG711Format@TMS@@QAEHH@Z @ 77 NONAME ; int TMS::TMSG711Format::SetMode(int)
-	?RemoveEffect@TMSStream@TMS@@QAEHPAVTMSEffect@2@@Z @ 78 NONAME ; int TMS::TMSStream::RemoveEffect(class TMS::TMSEffect *)
-	?RemoveObserver@TMSClientSink@TMS@@QAEHAAVTMSClientSinkObserver@2@@Z @ 79 NONAME ; int TMS::TMSClientSink::RemoveObserver(class TMS::TMSClientSinkObserver &)
-	?GetVADMode@TMSG711Format@TMS@@QAEHAAH@Z @ 80 NONAME ; int TMS::TMSG711Format::GetVADMode(int &)
-	??1TMSGlobalRouting@TMS@@UAE@XZ @ 81 NONAME ; TMS::TMSGlobalRouting::~TMSGlobalRouting(void)
-	??0TMSILBCFormat@TMS@@IAE@XZ @ 82 NONAME ; TMS::TMSILBCFormat::TMSILBCFormat(void)
-	??1TMSCall@TMS@@UAE@XZ @ 83 NONAME ; TMS::TMSCall::~TMSCall(void)
-	?GetPlc@TMSG711Format@TMS@@QAEHAAH@Z @ 84 NONAME ; int TMS::TMSG711Format::GetPlc(int &)
-	??1TMSILBCFormat@TMS@@UAE@XZ @ 85 NONAME ; TMS::TMSILBCFormat::~TMSILBCFormat(void)
-	?SetFormat@TMSStream@TMS@@QAEHPAVTMSFormat@2@@Z @ 86 NONAME ; int TMS::TMSStream::SetFormat(class TMS::TMSFormat *)
-	?GetType@TMSGlobalGainEffect@TMS@@UAEHAAH@Z @ 87 NONAME ; int TMS::TMSGlobalGainEffect::GetType(int &)
-	?GetLevel@TMSVolumeEffect@TMS@@QAEHAAI@Z @ 88 NONAME ; int TMS::TMSVolumeEffect::GetLevel(unsigned int &)
-	??0TMSGainEffect@TMS@@IAE@XZ @ 89 NONAME ; TMS::TMSGainEffect::TMSGainEffect(void)
-	?GetCallType@TMSCall@TMS@@QAEHXZ @ 90 NONAME ; int TMS::TMSCall::GetCallType(void)
-	?GetType@TMSFormat@TMS@@UAEHAAH@Z @ 91 NONAME ; int TMS::TMSFormat::GetType(int &)
-	?GetMaxLevel@TMSGlobalGainEffect@TMS@@QAEHAAI@Z @ 92 NONAME ; int TMS::TMSGlobalGainEffect::GetMaxLevel(unsigned int &)
-	?SetCNG@TMSG711Format@TMS@@QAEHH@Z @ 93 NONAME ; int TMS::TMSG711Format::SetCNG(int)
-	??1TMSGainEffect@TMS@@UAE@XZ @ 94 NONAME ; TMS::TMSGainEffect::~TMSGainEffect(void)
-	?GetMaxLevel@TMSGlobalVolEffect@TMS@@QAEHAAI@Z @ 95 NONAME ; int TMS::TMSGlobalVolEffect::GetMaxLevel(unsigned int &)
-	??0TMSClientSource@TMS@@IAE@XZ @ 96 NONAME ; TMS::TMSClientSource::TMSClientSource(void)
-	??1TMSFormat@TMS@@UAE@XZ @ 97 NONAME ; TMS::TMSFormat::~TMSFormat(void)
-	??1TMSModemSource@TMS@@UAE@XZ @ 98 NONAME ; TMS::TMSModemSource::~TMSModemSource(void)
-	?GetAvailableOutputs@TMSGlobalRouting@TMS@@QAEHAAV?$vector@IV?$allocator@I@std@@@std@@@Z @ 99 NONAME ; int TMS::TMSGlobalRouting::GetAvailableOutputs(class std::vector<unsigned int, class std::allocator<unsigned int> > &)
-	?GetBitRate@TMSFormat@TMS@@QAEHAAI@Z @ 100 NONAME ; int TMS::TMSFormat::GetBitRate(unsigned int &)
-	?AddObserver@TMSClientSink@TMS@@QAEHAAVTMSClientSinkObserver@2@PAX@Z @ 101 NONAME ; int TMS::TMSClientSink::AddObserver(class TMS::TMSClientSinkObserver &, void *)
-	?RemoveSource@TMSStream@TMS@@QAEHPAVTMSSource@2@@Z @ 102 NONAME ; int TMS::TMSStream::RemoveSource(class TMS::TMSSource *)
-	??0TMSGlobalGainEffect@TMS@@IAE@XZ @ 103 NONAME ; TMS::TMSGlobalGainEffect::TMSGlobalGainEffect(void)
-	?AddObserver@TMSGlobalGainEffect@TMS@@QAEHAAVTMSEffectObserver@2@PAX@Z @ 104 NONAME ; int TMS::TMSGlobalGainEffect::AddObserver(class TMS::TMSEffectObserver &, void *)
-	?GetLevel@TMSGlobalGainEffect@TMS@@QAEHAAI@Z @ 105 NONAME ; int TMS::TMSGlobalGainEffect::GetLevel(unsigned int &)
-	?SetLevel@TMSGlobalVolEffect@TMS@@QAEHI@Z @ 106 NONAME ; int TMS::TMSGlobalVolEffect::SetLevel(unsigned int)
-	?RemoveObserver@TMSStream@TMS@@QAEHAAVTMSStreamObserver@2@@Z @ 107 NONAME ; int TMS::TMSStream::RemoveObserver(class TMS::TMSStreamObserver &)
-	?RemoveObserver@TMSGlobalVolEffect@TMS@@QAEHAAVTMSEffectObserver@2@@Z @ 108 NONAME ; int TMS::TMSGlobalVolEffect::RemoveObserver(class TMS::TMSEffectObserver &)
-	?GetMode@TMSG711Format@TMS@@QAEHAAH@Z @ 109 NONAME ; int TMS::TMSG711Format::GetMode(int &)
-	??1TMSVolumeEffect@TMS@@UAE@XZ @ 110 NONAME ; TMS::TMSVolumeEffect::~TMSVolumeEffect(void)
-	?SetEnqueueMode@TMSClientSource@TMS@@QAEHH@Z @ 111 NONAME ; int TMS::TMSClientSource::SetEnqueueMode(int)
-	?SetVADMode@TMSILBCFormat@TMS@@QAEHH@Z @ 112 NONAME ; int TMS::TMSILBCFormat::SetVADMode(int)
-	??1TMSMicSource@TMS@@UAE@XZ @ 113 NONAME ; TMS::TMSMicSource::~TMSMicSource(void)
-	??0TMSStream@TMS@@IAE@XZ @ 114 NONAME ; TMS::TMSStream::TMSStream(void)
-	?GetVADMode@TMSILBCFormat@TMS@@QAEHAAH@Z @ 115 NONAME ; int TMS::TMSILBCFormat::GetVADMode(int &)
-	?BufferProcessed@TMSClientSink@TMS@@QAEHPAVTMSBuffer@2@@Z @ 116 NONAME ; int TMS::TMSClientSink::BufferProcessed(class TMS::TMSBuffer *)
-	?GetCallContextId@TMSCall@TMS@@QAEHAAI@Z @ 117 NONAME ; int TMS::TMSCall::GetCallContextId(unsigned int &)
-	?RemoveObserver@TMSClientSource@TMS@@QAEHAAVTMSClientSourceObserver@2@@Z @ 118 NONAME ; int TMS::TMSClientSource::RemoveObserver(class TMS::TMSClientSourceObserver &)
-	??0TMSSpeakerSink@TMS@@IAE@XZ @ 119 NONAME ; TMS::TMSSpeakerSink::TMSSpeakerSink(void)
-	?ProcessBuffer@TMSClientSource@TMS@@QAEHPAVTMSBuffer@2@@Z @ 120 NONAME ; int TMS::TMSClientSource::ProcessBuffer(class TMS::TMSBuffer *)
-	?GetSupportedBitRates@TMSFormat@TMS@@QAEHAAV?$vector@IV?$allocator@I@std@@@std@@@Z @ 121 NONAME ; int TMS::TMSFormat::GetSupportedBitRates(class std::vector<unsigned int, class std::allocator<unsigned int> > &)
-	?SetMode@TMSILBCFormat@TMS@@QAEHH@Z @ 122 NONAME ; int TMS::TMSILBCFormat::SetMode(int)
-	?GetEnqueueMode@TMSClientSource@TMS@@QAEHAAH@Z @ 123 NONAME ; int TMS::TMSClientSource::GetEnqueueMode(int &)
-	??1TMSModemSink@TMS@@UAE@XZ @ 124 NONAME ; TMS::TMSModemSink::~TMSModemSink(void)
-	?Init@TMSStream@TMS@@QAEHXZ @ 125 NONAME ; int TMS::TMSStream::Init(void)
-	?Flush@TMSClientSource@TMS@@QAEHXZ @ 126 NONAME ; int TMS::TMSClientSource::Flush(void)
+	?Stop@TMSStream@TMS@@QAEHXZ @ 10 NONAME ; int TMS::TMSStream::Stop(void)
+	?Pause@TMSRingTone@TMS@@QAEHXZ @ 11 NONAME ; int TMS::TMSRingTone::Pause(void)
+	??1TMSPCMFormat@TMS@@UAE@XZ @ 12 NONAME ; TMS::TMSPCMFormat::~TMSPCMFormat(void)
+	??0TMSRingTone@TMS@@IAE@XZ @ 13 NONAME ; TMS::TMSRingTone::TMSRingTone(void)
+	?RemoveObserver@TMSGlobalGainEffect@TMS@@QAEHAAVTMSEffectObserver@2@@Z @ 14 NONAME ; int TMS::TMSGlobalGainEffect::RemoveObserver(class TMS::TMSEffectObserver &)
+	??0TMSModemSink@TMS@@IAE@XZ @ 15 NONAME ; TMS::TMSModemSink::TMSModemSink(void)
+	?RemoveSink@TMSStream@TMS@@QAEHPAVTMSSink@2@@Z @ 16 NONAME ; int TMS::TMSStream::RemoveSink(class TMS::TMSSink *)
+	?GetType@TMSClientSource@TMS@@UAEHAAH@Z @ 17 NONAME ; int TMS::TMSClientSource::GetType(int &)
+	??0TMSClientSink@TMS@@IAE@XZ @ 18 NONAME ; TMS::TMSClientSink::TMSClientSink(void)
+	?AddEffect@TMSStream@TMS@@QAEHPAVTMSEffect@2@@Z @ 19 NONAME ; int TMS::TMSStream::AddEffect(class TMS::TMSEffect *)
+	?GetType@TMSModemSink@TMS@@UAEHAAH@Z @ 20 NONAME ; int TMS::TMSModemSink::GetType(int &)
+	?CreateStream@TMSCall@TMS@@QAEHHAAPAVTMSStream@2@@Z @ 21 NONAME ; int TMS::TMSCall::CreateStream(int, class TMS::TMSStream * &)
+	?GetType@TMSGainEffect@TMS@@UAEHAAH@Z @ 22 NONAME ; int TMS::TMSGainEffect::GetType(int &)
+	?GetCNG@TMSILBCFormat@TMS@@QAEHAAH@Z @ 23 NONAME ; int TMS::TMSILBCFormat::GetCNG(int &)
+	?AddObserver@TMSStream@TMS@@QAEHAAVTMSStreamObserver@2@PAX@Z @ 24 NONAME ; int TMS::TMSStream::AddObserver(class TMS::TMSStreamObserver &, void *)
+	??0TMSG729Format@TMS@@IAE@XZ @ 25 NONAME ; TMS::TMSG729Format::TMSG729Format(void)
+	?RemoveObserver@TMSVolumeEffect@TMS@@QAEHAAVTMSEffectObserver@2@@Z @ 26 NONAME ; int TMS::TMSVolumeEffect::RemoveObserver(class TMS::TMSEffectObserver &)
+	?GetType@TMSGlobalVolEffect@TMS@@UAEHAAH@Z @ 27 NONAME ; int TMS::TMSGlobalVolEffect::GetType(int &)
+	??1TMSSpeakerSink@TMS@@UAE@XZ @ 28 NONAME ; TMS::TMSSpeakerSink::~TMSSpeakerSink(void)
+	?GetPreviousOutput@TMSGlobalRouting@TMS@@QAEHAAH@Z @ 29 NONAME ; int TMS::TMSGlobalRouting::GetPreviousOutput(int &)
+	?GetMaxLevel@TMSVolumeEffect@TMS@@QAEHAAI@Z @ 30 NONAME ; int TMS::TMSVolumeEffect::GetMaxLevel(unsigned int &)
+	?SetPlc@TMSG711Format@TMS@@QAEHH@Z @ 31 NONAME ; int TMS::TMSG711Format::SetPlc(int)
+	?GetStreamType@TMSStream@TMS@@QAEHXZ @ 32 NONAME ; int TMS::TMSStream::GetStreamType(void)
+	?AddSource@TMSStream@TMS@@QAEHPAVTMSSource@2@@Z @ 33 NONAME ; int TMS::TMSStream::AddSource(class TMS::TMSSource *)
+	??0TMSAMRFormat@TMS@@IAE@XZ @ 34 NONAME ; TMS::TMSAMRFormat::TMSAMRFormat(void)
+	??1TMSDTMF@TMS@@UAE@XZ @ 35 NONAME ; TMS::TMSDTMF::~TMSDTMF(void)
+	?AddObserver@TMSRingTone@TMS@@QAEHAAVTMSRingToneObserver@2@PAX@Z @ 36 NONAME ; int TMS::TMSRingTone::AddObserver(class TMS::TMSRingToneObserver &, void *)
+	?AddObserver@TMSDTMF@TMS@@QAEHAAVTMSDTMFObserver@2@PAX@Z @ 37 NONAME ; int TMS::TMSDTMF::AddObserver(class TMS::TMSDTMFObserver &, void *)
+	??0TMSGlobalVolEffect@TMS@@IAE@XZ @ 38 NONAME ; TMS::TMSGlobalVolEffect::TMSGlobalVolEffect(void)
+	??0TMSInbandTone@TMS@@IAE@XZ @ 39 NONAME ; TMS::TMSInbandTone::TMSInbandTone(void)
+	?GetType@TMSModemSource@TMS@@UAEHAAH@Z @ 40 NONAME ; int TMS::TMSModemSource::GetType(int &)
+	??0TMSVolumeEffect@TMS@@IAE@XZ @ 41 NONAME ; TMS::TMSVolumeEffect::TMSVolumeEffect(void)
+	??1TMSG711Format@TMS@@UAE@XZ @ 42 NONAME ; TMS::TMSG711Format::~TMSG711Format(void)
+	??1TMSGlobalVolEffect@TMS@@UAE@XZ @ 43 NONAME ; TMS::TMSGlobalVolEffect::~TMSGlobalVolEffect(void)
+	?GetType@TMSClientSink@TMS@@UAEHAAH@Z @ 44 NONAME ; int TMS::TMSClientSink::GetType(int &)
+	?AddObserver@TMSVolumeEffect@TMS@@QAEHAAVTMSEffectObserver@2@PAX@Z @ 45 NONAME ; int TMS::TMSVolumeEffect::AddObserver(class TMS::TMSEffectObserver &, void *)
+	?SetMode@TMSG711Format@TMS@@QAEHH@Z @ 46 NONAME ; int TMS::TMSG711Format::SetMode(int)
+	?Play@TMSRingTone@TMS@@QAEHXZ @ 47 NONAME ; int TMS::TMSRingTone::Play(void)
+	?RemoveObserver@TMSClientSink@TMS@@QAEHAAVTMSClientSinkObserver@2@@Z @ 48 NONAME ; int TMS::TMSClientSink::RemoveObserver(class TMS::TMSClientSinkObserver &)
+	?GetVADMode@TMSG711Format@TMS@@QAEHAAH@Z @ 49 NONAME ; int TMS::TMSG711Format::GetVADMode(int &)
+	??1TMSGlobalRouting@TMS@@UAE@XZ @ 50 NONAME ; TMS::TMSGlobalRouting::~TMSGlobalRouting(void)
+	??1TMSCall@TMS@@UAE@XZ @ 51 NONAME ; TMS::TMSCall::~TMSCall(void)
+	??1TMSILBCFormat@TMS@@UAE@XZ @ 52 NONAME ; TMS::TMSILBCFormat::~TMSILBCFormat(void)
+	??0TMSGainEffect@TMS@@IAE@XZ @ 53 NONAME ; TMS::TMSGainEffect::TMSGainEffect(void)
+	?GetMaxLevel@TMSGlobalVolEffect@TMS@@QAEHAAI@Z @ 54 NONAME ; int TMS::TMSGlobalVolEffect::GetMaxLevel(unsigned int &)
+	??1TMSFormat@TMS@@UAE@XZ @ 55 NONAME ; TMS::TMSFormat::~TMSFormat(void)
+	??1TMSModemSource@TMS@@UAE@XZ @ 56 NONAME ; TMS::TMSModemSource::~TMSModemSource(void)
+	?GetBitRate@TMSFormat@TMS@@QAEHAAI@Z @ 57 NONAME ; int TMS::TMSFormat::GetBitRate(unsigned int &)
+	?GetLevel@TMSGlobalGainEffect@TMS@@QAEHAAI@Z @ 58 NONAME ; int TMS::TMSGlobalGainEffect::GetLevel(unsigned int &)
+	?AddObserver@TMSGlobalGainEffect@TMS@@QAEHAAVTMSEffectObserver@2@PAX@Z @ 59 NONAME ; int TMS::TMSGlobalGainEffect::AddObserver(class TMS::TMSEffectObserver &, void *)
+	?RemoveObserver@TMSDTMF@TMS@@QAEHAAVTMSDTMFObserver@2@@Z @ 60 NONAME ; int TMS::TMSDTMF::RemoveObserver(class TMS::TMSDTMFObserver &)
+	??1TMSVolumeEffect@TMS@@UAE@XZ @ 61 NONAME ; TMS::TMSVolumeEffect::~TMSVolumeEffect(void)
+	?Start@TMSDTMF@TMS@@QAEHXZ @ 62 NONAME ; int TMS::TMSDTMF::Start(void)
+	??0TMSStream@TMS@@IAE@XZ @ 63 NONAME ; TMS::TMSStream::TMSStream(void)
+	?GetVADMode@TMSILBCFormat@TMS@@QAEHAAH@Z @ 64 NONAME ; int TMS::TMSILBCFormat::GetVADMode(int &)
+	?GetCallContextId@TMSCall@TMS@@QAEHAAI@Z @ 65 NONAME ; int TMS::TMSCall::GetCallContextId(unsigned int &)
+	?RemoveObserver@TMSClientSource@TMS@@QAEHAAVTMSClientSourceObserver@2@@Z @ 66 NONAME ; int TMS::TMSClientSource::RemoveObserver(class TMS::TMSClientSourceObserver &)
+	??0TMSSpeakerSink@TMS@@IAE@XZ @ 67 NONAME ; TMS::TMSSpeakerSink::TMSSpeakerSink(void)
+	?ProcessBuffer@TMSClientSource@TMS@@QAEHPAVTMSBuffer@2@@Z @ 68 NONAME ; int TMS::TMSClientSource::ProcessBuffer(class TMS::TMSBuffer *)
+	?Stop@TMSDTMF@TMS@@QAEHXZ @ 69 NONAME ; int TMS::TMSDTMF::Stop(void)
+	??1TMSRingTone@TMS@@UAE@XZ @ 70 NONAME ; TMS::TMSRingTone::~TMSRingTone(void)
+	?SetMode@TMSILBCFormat@TMS@@QAEHH@Z @ 71 NONAME ; int TMS::TMSILBCFormat::SetMode(int)
+	?GetEnqueueMode@TMSClientSource@TMS@@QAEHAAH@Z @ 72 NONAME ; int TMS::TMSClientSource::GetEnqueueMode(int &)
+	??1TMSModemSink@TMS@@UAE@XZ @ 73 NONAME ; TMS::TMSModemSink::~TMSModemSink(void)
+	?Init@TMSStream@TMS@@QAEHXZ @ 74 NONAME ; int TMS::TMSStream::Init(void)
+	?Flush@TMSClientSource@TMS@@QAEHXZ @ 75 NONAME ; int TMS::TMSClientSource::Flush(void)
+	?GetType@TMSMicSource@TMS@@UAEHAAH@Z @ 76 NONAME ; int TMS::TMSMicSource::GetType(int &)
+	?GetMaxLevel@TMSGainEffect@TMS@@QAEHAAI@Z @ 77 NONAME ; int TMS::TMSGainEffect::GetMaxLevel(unsigned int &)
+	??0TMSMicSource@TMS@@IAE@XZ @ 78 NONAME ; TMS::TMSMicSource::TMSMicSource(void)
+	?Init@TMSRingTone@TMS@@QAEHHPAU_GString@@0@Z @ 79 NONAME ; int TMS::TMSRingTone::Init(int, struct _GString *, struct _GString *)
+	?AddObserver@TMSGlobalVolEffect@TMS@@QAEHAAVTMSEffectObserver@2@PAX@Z @ 80 NONAME ; int TMS::TMSGlobalVolEffect::AddObserver(class TMS::TMSEffectObserver &, void *)
+	?GetType@TMSSpeakerSink@TMS@@UAEHAAH@Z @ 81 NONAME ; int TMS::TMSSpeakerSink::GetType(int &)
+	??1TMSStream@TMS@@QAE@XZ @ 82 NONAME ; TMS::TMSStream::~TMSStream(void)
+	?Start@TMSStream@TMS@@QAEHXZ @ 83 NONAME ; int TMS::TMSStream::Start(void)
+	?AddObserver@TMSClientSource@TMS@@QAEHAAVTMSClientSourceObserver@2@PAX@Z @ 84 NONAME ; int TMS::TMSClientSource::AddObserver(class TMS::TMSClientSourceObserver &, void *)
+	?AddObserver@TMSGlobalRouting@TMS@@QAEHAAVTMSGlobalRoutingObserver@2@PAX@Z @ 85 NONAME ; int TMS::TMSGlobalRouting::AddObserver(class TMS::TMSGlobalRoutingObserver &, void *)
+	?RemoveObserver@TMSGainEffect@TMS@@QAEHAAVTMSEffectObserver@2@@Z @ 86 NONAME ; int TMS::TMSGainEffect::RemoveObserver(class TMS::TMSEffectObserver &)
+	??0TMSModemSource@TMS@@IAE@XZ @ 87 NONAME ; TMS::TMSModemSource::TMSModemSource(void)
+	??1TMSAMRFormat@TMS@@UAE@XZ @ 88 NONAME ; TMS::TMSAMRFormat::~TMSAMRFormat(void)
+	??0TMSFormat@TMS@@IAE@XZ @ 89 NONAME ; TMS::TMSFormat::TMSFormat(void)
+	?SetLevel@TMSVolumeEffect@TMS@@QAEHI@Z @ 90 NONAME ; int TMS::TMSVolumeEffect::SetLevel(unsigned int)
+	??1TMSClientSink@TMS@@UAE@XZ @ 91 NONAME ; TMS::TMSClientSink::~TMSClientSink(void)
+	??0TMSDTMF@TMS@@IAE@XZ @ 92 NONAME ; TMS::TMSDTMF::TMSDTMF(void)
+	?ContinueDTMFStringSending@TMSDTMF@TMS@@QAEHH@Z @ 93 NONAME ; int TMS::TMSDTMF::ContinueDTMFStringSending(int)
+	?SetOutput@TMSGlobalRouting@TMS@@QAEHH@Z @ 94 NONAME ; int TMS::TMSGlobalRouting::SetOutput(int)
+	?GetType@TMSVolumeEffect@TMS@@UAEHAAH@Z @ 95 NONAME ; int TMS::TMSVolumeEffect::GetType(int &)
+	?BufferFilled@TMSClientSource@TMS@@QAEHAAVTMSBuffer@2@@Z @ 96 NONAME ; int TMS::TMSClientSource::BufferFilled(class TMS::TMSBuffer &)
+	?RemoveObserver@TMSGlobalRouting@TMS@@QAEHAAVTMSGlobalRoutingObserver@2@@Z @ 97 NONAME ; int TMS::TMSGlobalRouting::RemoveObserver(class TMS::TMSGlobalRoutingObserver &)
+	?Pause@TMSStream@TMS@@QAEHXZ @ 98 NONAME ; int TMS::TMSStream::Pause(void)
+	?SetBitRate@TMSFormat@TMS@@QAEHI@Z @ 99 NONAME ; int TMS::TMSFormat::SetBitRate(unsigned int)
+	?SetLevel@TMSGlobalGainEffect@TMS@@QAEHI@Z @ 100 NONAME ; int TMS::TMSGlobalGainEffect::SetLevel(unsigned int)
+	??0TMSGlobalRouting@TMS@@IAE@XZ @ 101 NONAME ; TMS::TMSGlobalRouting::TMSGlobalRouting(void)
+	?SetTone@TMSDTMF@TMS@@QAEHPAU_GString@@@Z @ 102 NONAME ; int TMS::TMSDTMF::SetTone(struct _GString *)
+	?RemoveObserver@TMSRingTone@TMS@@QAEHAAVTMSRingToneObserver@2@@Z @ 103 NONAME ; int TMS::TMSRingTone::RemoveObserver(class TMS::TMSRingToneObserver &)
+	?GetLevel@TMSGainEffect@TMS@@QAEHAAI@Z @ 104 NONAME ; int TMS::TMSGainEffect::GetLevel(unsigned int &)
+	??0TMSPCMFormat@TMS@@IAE@XZ @ 105 NONAME ; TMS::TMSPCMFormat::TMSPCMFormat(void)
+	??1TMSG729Format@TMS@@UAE@XZ @ 106 NONAME ; TMS::TMSG729Format::~TMSG729Format(void)
+	?SetLevel@TMSGainEffect@TMS@@QAEHI@Z @ 107 NONAME ; int TMS::TMSGainEffect::SetLevel(unsigned int)
+	?AddObserver@TMSGainEffect@TMS@@QAEHAAVTMSEffectObserver@2@PAX@Z @ 108 NONAME ; int TMS::TMSGainEffect::AddObserver(class TMS::TMSEffectObserver &, void *)
+	?SetVADMode@TMSG729Format@TMS@@QAEHH@Z @ 109 NONAME ; int TMS::TMSG729Format::SetVADMode(int)
+	??0TMSCall@TMS@@IAE@XZ @ 110 NONAME ; TMS::TMSCall::TMSCall(void)
+	?GetVADMode@TMSG729Format@TMS@@QAEHAAH@Z @ 111 NONAME ; int TMS::TMSG729Format::GetVADMode(int &)
+	?GetOutput@TMSGlobalRouting@TMS@@QAEHAAH@Z @ 112 NONAME ; int TMS::TMSGlobalRouting::GetOutput(int &)
+	?SetVADMode@TMSG711Format@TMS@@QAEHH@Z @ 113 NONAME ; int TMS::TMSG711Format::SetVADMode(int)
+	??1TMSInbandTone@TMS@@UAE@XZ @ 114 NONAME ; TMS::TMSInbandTone::~TMSInbandTone(void)
+	??0TMSG711Format@TMS@@IAE@XZ @ 115 NONAME ; TMS::TMSG711Format::TMSG711Format(void)
+	?GetState@TMSStream@TMS@@QAEHXZ @ 116 NONAME ; int TMS::TMSStream::GetState(void)
+	?GetStreamId@TMSStream@TMS@@QAEHXZ @ 117 NONAME ; int TMS::TMSStream::GetStreamId(void)
+	?AddSink@TMSStream@TMS@@QAEHPAVTMSSink@2@@Z @ 118 NONAME ; int TMS::TMSStream::AddSink(class TMS::TMSSink *)
+	?ResetFormat@TMSStream@TMS@@QAEHPAVTMSFormat@2@@Z @ 119 NONAME ; int TMS::TMSStream::ResetFormat(class TMS::TMSFormat *)
+	??1TMSGlobalGainEffect@TMS@@UAE@XZ @ 120 NONAME ; TMS::TMSGlobalGainEffect::~TMSGlobalGainEffect(void)
+	?RemoveEffect@TMSStream@TMS@@QAEHPAVTMSEffect@2@@Z @ 121 NONAME ; int TMS::TMSStream::RemoveEffect(class TMS::TMSEffect *)
+	??0TMSILBCFormat@TMS@@IAE@XZ @ 122 NONAME ; TMS::TMSILBCFormat::TMSILBCFormat(void)
+	?GetPlc@TMSG711Format@TMS@@QAEHAAH@Z @ 123 NONAME ; int TMS::TMSG711Format::GetPlc(int &)
+	?SetFormat@TMSStream@TMS@@QAEHPAVTMSFormat@2@@Z @ 124 NONAME ; int TMS::TMSStream::SetFormat(class TMS::TMSFormat *)
+	?GetLevel@TMSVolumeEffect@TMS@@QAEHAAI@Z @ 125 NONAME ; int TMS::TMSVolumeEffect::GetLevel(unsigned int &)
+	?GetType@TMSGlobalGainEffect@TMS@@UAEHAAH@Z @ 126 NONAME ; int TMS::TMSGlobalGainEffect::GetType(int &)
+	?GetCallType@TMSCall@TMS@@QAEHXZ @ 127 NONAME ; int TMS::TMSCall::GetCallType(void)
+	?GetMaxLevel@TMSGlobalGainEffect@TMS@@QAEHAAI@Z @ 128 NONAME ; int TMS::TMSGlobalGainEffect::GetMaxLevel(unsigned int &)
+	?GetType@TMSFormat@TMS@@UAEHAAH@Z @ 129 NONAME ; int TMS::TMSFormat::GetType(int &)
+	?RemoveObserver@TMSInbandTone@TMS@@QAEHAAVTMSInbandToneObserver@2@@Z @ 130 NONAME ; int TMS::TMSInbandTone::RemoveObserver(class TMS::TMSInbandToneObserver &)
+	??1TMSGainEffect@TMS@@UAE@XZ @ 131 NONAME ; TMS::TMSGainEffect::~TMSGainEffect(void)
+	?SetCNG@TMSG711Format@TMS@@QAEHH@Z @ 132 NONAME ; int TMS::TMSG711Format::SetCNG(int)
+	??0TMSClientSource@TMS@@IAE@XZ @ 133 NONAME ; TMS::TMSClientSource::TMSClientSource(void)
+	?GetAvailableOutputs@TMSGlobalRouting@TMS@@QAEHAAV?$vector@IV?$allocator@I@std@@@std@@@Z @ 134 NONAME ; int TMS::TMSGlobalRouting::GetAvailableOutputs(class std::vector<unsigned int, class std::allocator<unsigned int> > &)
+	?Deinit@TMSRingTone@TMS@@QAEHXZ @ 135 NONAME ; int TMS::TMSRingTone::Deinit(void)
+	?AddObserver@TMSClientSink@TMS@@QAEHAAVTMSClientSinkObserver@2@PAX@Z @ 136 NONAME ; int TMS::TMSClientSink::AddObserver(class TMS::TMSClientSinkObserver &, void *)
+	?RemoveSource@TMSStream@TMS@@QAEHPAVTMSSource@2@@Z @ 137 NONAME ; int TMS::TMSStream::RemoveSource(class TMS::TMSSource *)
+	??0TMSGlobalGainEffect@TMS@@IAE@XZ @ 138 NONAME ; TMS::TMSGlobalGainEffect::TMSGlobalGainEffect(void)
+	?SetLevel@TMSGlobalVolEffect@TMS@@QAEHI@Z @ 139 NONAME ; int TMS::TMSGlobalVolEffect::SetLevel(unsigned int)
+	?RemoveObserver@TMSStream@TMS@@QAEHAAVTMSStreamObserver@2@@Z @ 140 NONAME ; int TMS::TMSStream::RemoveObserver(class TMS::TMSStreamObserver &)
+	?Mute@TMSRingTone@TMS@@QAEHXZ @ 141 NONAME ; int TMS::TMSRingTone::Mute(void)
+	?RemoveObserver@TMSGlobalVolEffect@TMS@@QAEHAAVTMSEffectObserver@2@@Z @ 142 NONAME ; int TMS::TMSGlobalVolEffect::RemoveObserver(class TMS::TMSEffectObserver &)
+	?GetMode@TMSG711Format@TMS@@QAEHAAH@Z @ 143 NONAME ; int TMS::TMSG711Format::GetMode(int &)
+	?SetEnqueueMode@TMSClientSource@TMS@@QAEHH@Z @ 144 NONAME ; int TMS::TMSClientSource::SetEnqueueMode(int)
+	?SetVADMode@TMSILBCFormat@TMS@@QAEHH@Z @ 145 NONAME ; int TMS::TMSILBCFormat::SetVADMode(int)
+	??1TMSMicSource@TMS@@UAE@XZ @ 146 NONAME ; TMS::TMSMicSource::~TMSMicSource(void)
+	?BufferProcessed@TMSClientSink@TMS@@QAEHPAVTMSBuffer@2@@Z @ 147 NONAME ; int TMS::TMSClientSink::BufferProcessed(class TMS::TMSBuffer *)
+	?GetSupportedBitRates@TMSFormat@TMS@@QAEHAAV?$vector@IV?$allocator@I@std@@@std@@@Z @ 148 NONAME ; int TMS::TMSFormat::GetSupportedBitRates(class std::vector<unsigned int, class std::allocator<unsigned int> > &)
+	?Stop@TMSInbandTone@TMS@@QAEHXZ @ 149 NONAME ; int TMS::TMSInbandTone::Stop(void)
+	?AddObserver@TMSInbandTone@TMS@@QAEHAAVTMSInbandToneObserver@2@PAX@Z @ 150 NONAME ; int TMS::TMSInbandTone::AddObserver(class TMS::TMSInbandToneObserver &, void *)
 
--- a/mmserv/tms/tmsapi/eabi/tmsapi.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsapi/eabi/tmsapi.def	Fri Apr 16 15:29:42 2010 +0300
@@ -1,220 +1,259 @@
 EXPORTS
-	_ZN3TMS12TMSAMRFormatC1Ev @ 1 NONAME
-	_ZN3TMS12TMSAMRFormatC2Ev @ 2 NONAME
-	_ZN3TMS12TMSAMRFormatD0Ev @ 3 NONAME
-	_ZN3TMS12TMSAMRFormatD1Ev @ 4 NONAME
-	_ZN3TMS12TMSAMRFormatD2Ev @ 5 NONAME
-	_ZN3TMS12TMSMicSource7GetTypeERi @ 6 NONAME
-	_ZN3TMS12TMSMicSourceC1Ev @ 7 NONAME
-	_ZN3TMS12TMSMicSourceC2Ev @ 8 NONAME
-	_ZN3TMS12TMSMicSourceD0Ev @ 9 NONAME
-	_ZN3TMS12TMSMicSourceD1Ev @ 10 NONAME
-	_ZN3TMS12TMSMicSourceD2Ev @ 11 NONAME
-	_ZN3TMS12TMSModemSink7GetTypeERi @ 12 NONAME
-	_ZN3TMS12TMSModemSinkC1Ev @ 13 NONAME
-	_ZN3TMS12TMSModemSinkC2Ev @ 14 NONAME
-	_ZN3TMS12TMSModemSinkD0Ev @ 15 NONAME
-	_ZN3TMS12TMSModemSinkD1Ev @ 16 NONAME
-	_ZN3TMS12TMSModemSinkD2Ev @ 17 NONAME
-	_ZN3TMS12TMSPCMFormatC1Ev @ 18 NONAME
-	_ZN3TMS12TMSPCMFormatC2Ev @ 19 NONAME
-	_ZN3TMS12TMSPCMFormatD0Ev @ 20 NONAME
-	_ZN3TMS12TMSPCMFormatD1Ev @ 21 NONAME
-	_ZN3TMS12TMSPCMFormatD2Ev @ 22 NONAME
-	_ZN3TMS13TMSClientSink11AddObserverERNS_21TMSClientSinkObserverEPv @ 23 NONAME
-	_ZN3TMS13TMSClientSink14RemoveObserverERNS_21TMSClientSinkObserverE @ 24 NONAME
-	_ZN3TMS13TMSClientSink15BufferProcessedEPNS_9TMSBufferE @ 25 NONAME
-	_ZN3TMS13TMSClientSink7GetTypeERi @ 26 NONAME
-	_ZN3TMS13TMSClientSinkC1Ev @ 27 NONAME
-	_ZN3TMS13TMSClientSinkC2Ev @ 28 NONAME
-	_ZN3TMS13TMSClientSinkD0Ev @ 29 NONAME
-	_ZN3TMS13TMSClientSinkD1Ev @ 30 NONAME
-	_ZN3TMS13TMSClientSinkD2Ev @ 31 NONAME
-	_ZN3TMS13TMSG711Format10GetVADModeERi @ 32 NONAME
-	_ZN3TMS13TMSG711Format10SetVADModeEi @ 33 NONAME
-	_ZN3TMS13TMSG711Format6GetCNGERi @ 34 NONAME
-	_ZN3TMS13TMSG711Format6GetPlcERi @ 35 NONAME
-	_ZN3TMS13TMSG711Format6SetCNGEi @ 36 NONAME
-	_ZN3TMS13TMSG711Format6SetPlcEi @ 37 NONAME
-	_ZN3TMS13TMSG711Format7GetModeERi @ 38 NONAME
-	_ZN3TMS13TMSG711Format7SetModeEi @ 39 NONAME
-	_ZN3TMS13TMSG711FormatC1Ev @ 40 NONAME
-	_ZN3TMS13TMSG711FormatC2Ev @ 41 NONAME
-	_ZN3TMS13TMSG711FormatD0Ev @ 42 NONAME
-	_ZN3TMS13TMSG711FormatD1Ev @ 43 NONAME
-	_ZN3TMS13TMSG711FormatD2Ev @ 44 NONAME
-	_ZN3TMS13TMSG729Format10GetVADModeERi @ 45 NONAME
-	_ZN3TMS13TMSG729Format10SetVADModeEi @ 46 NONAME
-	_ZN3TMS13TMSG729FormatC1Ev @ 47 NONAME
-	_ZN3TMS13TMSG729FormatC2Ev @ 48 NONAME
-	_ZN3TMS13TMSG729FormatD0Ev @ 49 NONAME
-	_ZN3TMS13TMSG729FormatD1Ev @ 50 NONAME
-	_ZN3TMS13TMSG729FormatD2Ev @ 51 NONAME
-	_ZN3TMS13TMSGainEffect11AddObserverERNS_17TMSEffectObserverEPv @ 52 NONAME
-	_ZN3TMS13TMSGainEffect11GetMaxLevelERj @ 53 NONAME
-	_ZN3TMS13TMSGainEffect14RemoveObserverERNS_17TMSEffectObserverE @ 54 NONAME
-	_ZN3TMS13TMSGainEffect7GetTypeERi @ 55 NONAME
-	_ZN3TMS13TMSGainEffect8GetLevelERj @ 56 NONAME
-	_ZN3TMS13TMSGainEffect8SetLevelEj @ 57 NONAME
-	_ZN3TMS13TMSGainEffectC1Ev @ 58 NONAME
-	_ZN3TMS13TMSGainEffectC2Ev @ 59 NONAME
-	_ZN3TMS13TMSGainEffectD0Ev @ 60 NONAME
-	_ZN3TMS13TMSGainEffectD1Ev @ 61 NONAME
-	_ZN3TMS13TMSGainEffectD2Ev @ 62 NONAME
-	_ZN3TMS13TMSILBCFormat10GetVADModeERi @ 63 NONAME
-	_ZN3TMS13TMSILBCFormat10SetVADModeEi @ 64 NONAME
-	_ZN3TMS13TMSILBCFormat6GetCNGERi @ 65 NONAME
-	_ZN3TMS13TMSILBCFormat6SetCNGEi @ 66 NONAME
-	_ZN3TMS13TMSILBCFormat7GetModeERi @ 67 NONAME
-	_ZN3TMS13TMSILBCFormat7SetModeEi @ 68 NONAME
-	_ZN3TMS13TMSILBCFormatC1Ev @ 69 NONAME
-	_ZN3TMS13TMSILBCFormatC2Ev @ 70 NONAME
-	_ZN3TMS13TMSILBCFormatD0Ev @ 71 NONAME
-	_ZN3TMS13TMSILBCFormatD1Ev @ 72 NONAME
-	_ZN3TMS13TMSILBCFormatD2Ev @ 73 NONAME
-	_ZN3TMS14TMSModemSource7GetTypeERi @ 74 NONAME
-	_ZN3TMS14TMSModemSourceC1Ev @ 75 NONAME
-	_ZN3TMS14TMSModemSourceC2Ev @ 76 NONAME
-	_ZN3TMS14TMSModemSourceD0Ev @ 77 NONAME
-	_ZN3TMS14TMSModemSourceD1Ev @ 78 NONAME
-	_ZN3TMS14TMSModemSourceD2Ev @ 79 NONAME
-	_ZN3TMS14TMSSpeakerSink7GetTypeERi @ 80 NONAME
-	_ZN3TMS14TMSSpeakerSinkC1Ev @ 81 NONAME
-	_ZN3TMS14TMSSpeakerSinkC2Ev @ 82 NONAME
-	_ZN3TMS14TMSSpeakerSinkD0Ev @ 83 NONAME
-	_ZN3TMS14TMSSpeakerSinkD1Ev @ 84 NONAME
-	_ZN3TMS14TMSSpeakerSinkD2Ev @ 85 NONAME
-	_ZN3TMS15TMSClientSource11AddObserverERNS_23TMSClientSourceObserverEPv @ 86 NONAME
-	_ZN3TMS15TMSClientSource12BufferFilledERNS_9TMSBufferE @ 87 NONAME
-	_ZN3TMS15TMSClientSource13ProcessBufferEPNS_9TMSBufferE @ 88 NONAME
-	_ZN3TMS15TMSClientSource14GetEnqueueModeERi @ 89 NONAME
-	_ZN3TMS15TMSClientSource14RemoveObserverERNS_23TMSClientSourceObserverE @ 90 NONAME
-	_ZN3TMS15TMSClientSource14SetEnqueueModeEi @ 91 NONAME
-	_ZN3TMS15TMSClientSource5FlushEv @ 92 NONAME
-	_ZN3TMS15TMSClientSource7GetTypeERi @ 93 NONAME
-	_ZN3TMS15TMSClientSourceC1Ev @ 94 NONAME
-	_ZN3TMS15TMSClientSourceC2Ev @ 95 NONAME
-	_ZN3TMS15TMSClientSourceD0Ev @ 96 NONAME
-	_ZN3TMS15TMSClientSourceD1Ev @ 97 NONAME
-	_ZN3TMS15TMSClientSourceD2Ev @ 98 NONAME
-	_ZN3TMS15TMSVolumeEffect11AddObserverERNS_17TMSEffectObserverEPv @ 99 NONAME
-	_ZN3TMS15TMSVolumeEffect11GetMaxLevelERj @ 100 NONAME
-	_ZN3TMS15TMSVolumeEffect14RemoveObserverERNS_17TMSEffectObserverE @ 101 NONAME
-	_ZN3TMS15TMSVolumeEffect7GetTypeERi @ 102 NONAME
-	_ZN3TMS15TMSVolumeEffect8GetLevelERj @ 103 NONAME
-	_ZN3TMS15TMSVolumeEffect8SetLevelEj @ 104 NONAME
-	_ZN3TMS15TMSVolumeEffectC1Ev @ 105 NONAME
-	_ZN3TMS15TMSVolumeEffectC2Ev @ 106 NONAME
-	_ZN3TMS15TMSVolumeEffectD0Ev @ 107 NONAME
-	_ZN3TMS15TMSVolumeEffectD1Ev @ 108 NONAME
-	_ZN3TMS15TMSVolumeEffectD2Ev @ 109 NONAME
-	_ZN3TMS16TMSGlobalRouting11AddObserverERNS_24TMSGlobalRoutingObserverEPv @ 110 NONAME
-	_ZN3TMS16TMSGlobalRouting14RemoveObserverERNS_24TMSGlobalRoutingObserverE @ 111 NONAME
-	_ZN3TMS16TMSGlobalRouting17GetPreviousOutputERi @ 112 NONAME
-	_ZN3TMS16TMSGlobalRouting19GetAvailableOutputsERSt6vectorIjSaIjEE @ 113 NONAME
-	_ZN3TMS16TMSGlobalRouting9GetOutputERi @ 114 NONAME
-	_ZN3TMS16TMSGlobalRouting9SetOutputEi @ 115 NONAME
-	_ZN3TMS16TMSGlobalRoutingC1Ev @ 116 NONAME
-	_ZN3TMS16TMSGlobalRoutingC2Ev @ 117 NONAME
-	_ZN3TMS16TMSGlobalRoutingD0Ev @ 118 NONAME
-	_ZN3TMS16TMSGlobalRoutingD1Ev @ 119 NONAME
-	_ZN3TMS16TMSGlobalRoutingD2Ev @ 120 NONAME
-	_ZN3TMS18TMSGlobalVolEffect11AddObserverERNS_17TMSEffectObserverEPv @ 121 NONAME
-	_ZN3TMS18TMSGlobalVolEffect11GetMaxLevelERj @ 122 NONAME
-	_ZN3TMS18TMSGlobalVolEffect14RemoveObserverERNS_17TMSEffectObserverE @ 123 NONAME
-	_ZN3TMS18TMSGlobalVolEffect7GetTypeERi @ 124 NONAME
-	_ZN3TMS18TMSGlobalVolEffect8GetLevelERj @ 125 NONAME
-	_ZN3TMS18TMSGlobalVolEffect8SetLevelEj @ 126 NONAME
-	_ZN3TMS18TMSGlobalVolEffectC1Ev @ 127 NONAME
-	_ZN3TMS18TMSGlobalVolEffectC2Ev @ 128 NONAME
-	_ZN3TMS18TMSGlobalVolEffectD0Ev @ 129 NONAME
-	_ZN3TMS18TMSGlobalVolEffectD1Ev @ 130 NONAME
-	_ZN3TMS18TMSGlobalVolEffectD2Ev @ 131 NONAME
-	_ZN3TMS19TMSGlobalGainEffect11AddObserverERNS_17TMSEffectObserverEPv @ 132 NONAME
-	_ZN3TMS19TMSGlobalGainEffect11GetMaxLevelERj @ 133 NONAME
-	_ZN3TMS19TMSGlobalGainEffect14RemoveObserverERNS_17TMSEffectObserverE @ 134 NONAME
-	_ZN3TMS19TMSGlobalGainEffect7GetTypeERi @ 135 NONAME
-	_ZN3TMS19TMSGlobalGainEffect8GetLevelERj @ 136 NONAME
-	_ZN3TMS19TMSGlobalGainEffect8SetLevelEj @ 137 NONAME
-	_ZN3TMS19TMSGlobalGainEffectC1Ev @ 138 NONAME
-	_ZN3TMS19TMSGlobalGainEffectC2Ev @ 139 NONAME
-	_ZN3TMS19TMSGlobalGainEffectD0Ev @ 140 NONAME
-	_ZN3TMS19TMSGlobalGainEffectD1Ev @ 141 NONAME
-	_ZN3TMS19TMSGlobalGainEffectD2Ev @ 142 NONAME
-	_ZN3TMS7TMSCall11GetCallTypeEv @ 143 NONAME
-	_ZN3TMS7TMSCall12CreateStreamEiRPNS_9TMSStreamE @ 144 NONAME
-	_ZN3TMS7TMSCall12DeleteStreamERPNS_9TMSStreamE @ 145 NONAME
-	_ZN3TMS7TMSCall16GetCallContextIdERj @ 146 NONAME
-	_ZN3TMS7TMSCallC1Ev @ 147 NONAME
-	_ZN3TMS7TMSCallC2Ev @ 148 NONAME
-	_ZN3TMS7TMSCallD0Ev @ 149 NONAME
-	_ZN3TMS7TMSCallD1Ev @ 150 NONAME
-	_ZN3TMS7TMSCallD2Ev @ 151 NONAME
-	_ZN3TMS9TMSFormat10GetBitRateERj @ 152 NONAME
-	_ZN3TMS9TMSFormat10SetBitRateEj @ 153 NONAME
-	_ZN3TMS9TMSFormat20GetSupportedBitRatesERSt6vectorIjSaIjEE @ 154 NONAME
-	_ZN3TMS9TMSFormat7GetTypeERi @ 155 NONAME
-	_ZN3TMS9TMSFormatC1Ev @ 156 NONAME
-	_ZN3TMS9TMSFormatC2Ev @ 157 NONAME
-	_ZN3TMS9TMSFormatD0Ev @ 158 NONAME
-	_ZN3TMS9TMSFormatD1Ev @ 159 NONAME
-	_ZN3TMS9TMSFormatD2Ev @ 160 NONAME
-	_ZN3TMS9TMSStream10RemoveSinkEPNS_7TMSSinkE @ 161 NONAME
-	_ZN3TMS9TMSStream11AddObserverERNS_17TMSStreamObserverEPv @ 162 NONAME
-	_ZN3TMS9TMSStream11GetStreamIdEv @ 163 NONAME
-	_ZN3TMS9TMSStream11ResetFormatEPNS_9TMSFormatE @ 164 NONAME
-	_ZN3TMS9TMSStream12RemoveEffectEPNS_9TMSEffectE @ 165 NONAME
-	_ZN3TMS9TMSStream12RemoveSourceEPNS_9TMSSourceE @ 166 NONAME
-	_ZN3TMS9TMSStream13GetStreamTypeEv @ 167 NONAME
-	_ZN3TMS9TMSStream14RemoveObserverERNS_17TMSStreamObserverE @ 168 NONAME
-	_ZN3TMS9TMSStream4InitEv @ 169 NONAME
-	_ZN3TMS9TMSStream4StopEv @ 170 NONAME
-	_ZN3TMS9TMSStream5PauseEv @ 171 NONAME
-	_ZN3TMS9TMSStream5StartEv @ 172 NONAME
-	_ZN3TMS9TMSStream6DeinitEv @ 173 NONAME
-	_ZN3TMS9TMSStream7AddSinkEPNS_7TMSSinkE @ 174 NONAME
-	_ZN3TMS9TMSStream8GetStateEv @ 175 NONAME
-	_ZN3TMS9TMSStream9AddEffectEPNS_9TMSEffectE @ 176 NONAME
-	_ZN3TMS9TMSStream9AddSourceEPNS_9TMSSourceE @ 177 NONAME
-	_ZN3TMS9TMSStream9SetFormatEPNS_9TMSFormatE @ 178 NONAME
-	_ZN3TMS9TMSStreamC1Ev @ 179 NONAME
-	_ZN3TMS9TMSStreamC2Ev @ 180 NONAME
-	_ZN3TMS9TMSStreamD1Ev @ 181 NONAME
-	_ZN3TMS9TMSStreamD2Ev @ 182 NONAME
-	_ZTIN3TMS12TMSAMRFormatE @ 183 NONAME
-	_ZTIN3TMS12TMSMicSourceE @ 184 NONAME
-	_ZTIN3TMS12TMSModemSinkE @ 185 NONAME
-	_ZTIN3TMS12TMSPCMFormatE @ 186 NONAME
-	_ZTIN3TMS13TMSClientSinkE @ 187 NONAME
-	_ZTIN3TMS13TMSG711FormatE @ 188 NONAME
-	_ZTIN3TMS13TMSG729FormatE @ 189 NONAME
-	_ZTIN3TMS13TMSGainEffectE @ 190 NONAME
-	_ZTIN3TMS13TMSILBCFormatE @ 191 NONAME
-	_ZTIN3TMS14TMSModemSourceE @ 192 NONAME
-	_ZTIN3TMS14TMSSpeakerSinkE @ 193 NONAME
-	_ZTIN3TMS15TMSClientSourceE @ 194 NONAME
-	_ZTIN3TMS15TMSVolumeEffectE @ 195 NONAME
-	_ZTIN3TMS16TMSGlobalRoutingE @ 196 NONAME
-	_ZTIN3TMS18TMSGlobalVolEffectE @ 197 NONAME
-	_ZTIN3TMS19TMSGlobalGainEffectE @ 198 NONAME
-	_ZTIN3TMS7TMSCallE @ 199 NONAME
-	_ZTIN3TMS9TMSFormatE @ 200 NONAME
-	_ZTVN3TMS12TMSAMRFormatE @ 201 NONAME
-	_ZTVN3TMS12TMSMicSourceE @ 202 NONAME
-	_ZTVN3TMS12TMSModemSinkE @ 203 NONAME
-	_ZTVN3TMS12TMSPCMFormatE @ 204 NONAME
-	_ZTVN3TMS13TMSClientSinkE @ 205 NONAME
-	_ZTVN3TMS13TMSG711FormatE @ 206 NONAME
-	_ZTVN3TMS13TMSG729FormatE @ 207 NONAME
-	_ZTVN3TMS13TMSGainEffectE @ 208 NONAME
-	_ZTVN3TMS13TMSILBCFormatE @ 209 NONAME
-	_ZTVN3TMS14TMSModemSourceE @ 210 NONAME
-	_ZTVN3TMS14TMSSpeakerSinkE @ 211 NONAME
-	_ZTVN3TMS15TMSClientSourceE @ 212 NONAME
-	_ZTVN3TMS15TMSVolumeEffectE @ 213 NONAME
-	_ZTVN3TMS16TMSGlobalRoutingE @ 214 NONAME
-	_ZTVN3TMS18TMSGlobalVolEffectE @ 215 NONAME
-	_ZTVN3TMS19TMSGlobalGainEffectE @ 216 NONAME
-	_ZTVN3TMS7TMSCallE @ 217 NONAME
-	_ZTVN3TMS9TMSFormatE @ 218 NONAME
+	_ZN3TMS11TMSRingTone11AddObserverERNS_19TMSRingToneObserverEPv @ 1 NONAME
+	_ZN3TMS11TMSRingTone14RemoveObserverERNS_19TMSRingToneObserverE @ 2 NONAME
+	_ZN3TMS11TMSRingTone4InitEiP8_GStringS2_ @ 3 NONAME
+	_ZN3TMS11TMSRingTone4MuteEv @ 4 NONAME
+	_ZN3TMS11TMSRingTone4PlayEv @ 5 NONAME
+	_ZN3TMS11TMSRingTone4StopEv @ 6 NONAME
+	_ZN3TMS11TMSRingTone5PauseEv @ 7 NONAME
+	_ZN3TMS11TMSRingTone6DeinitEv @ 8 NONAME
+	_ZN3TMS11TMSRingToneC1Ev @ 9 NONAME
+	_ZN3TMS11TMSRingToneC2Ev @ 10 NONAME
+	_ZN3TMS11TMSRingToneD0Ev @ 11 NONAME
+	_ZN3TMS11TMSRingToneD1Ev @ 12 NONAME
+	_ZN3TMS11TMSRingToneD2Ev @ 13 NONAME
+	_ZN3TMS12TMSAMRFormatC1Ev @ 14 NONAME
+	_ZN3TMS12TMSAMRFormatC2Ev @ 15 NONAME
+	_ZN3TMS12TMSAMRFormatD0Ev @ 16 NONAME
+	_ZN3TMS12TMSAMRFormatD1Ev @ 17 NONAME
+	_ZN3TMS12TMSAMRFormatD2Ev @ 18 NONAME
+	_ZN3TMS12TMSMicSource7GetTypeERi @ 19 NONAME
+	_ZN3TMS12TMSMicSourceC1Ev @ 20 NONAME
+	_ZN3TMS12TMSMicSourceC2Ev @ 21 NONAME
+	_ZN3TMS12TMSMicSourceD0Ev @ 22 NONAME
+	_ZN3TMS12TMSMicSourceD1Ev @ 23 NONAME
+	_ZN3TMS12TMSMicSourceD2Ev @ 24 NONAME
+	_ZN3TMS12TMSModemSink7GetTypeERi @ 25 NONAME
+	_ZN3TMS12TMSModemSinkC1Ev @ 26 NONAME
+	_ZN3TMS12TMSModemSinkC2Ev @ 27 NONAME
+	_ZN3TMS12TMSModemSinkD0Ev @ 28 NONAME
+	_ZN3TMS12TMSModemSinkD1Ev @ 29 NONAME
+	_ZN3TMS12TMSModemSinkD2Ev @ 30 NONAME
+	_ZN3TMS12TMSPCMFormatC1Ev @ 31 NONAME
+	_ZN3TMS12TMSPCMFormatC2Ev @ 32 NONAME
+	_ZN3TMS12TMSPCMFormatD0Ev @ 33 NONAME
+	_ZN3TMS12TMSPCMFormatD1Ev @ 34 NONAME
+	_ZN3TMS12TMSPCMFormatD2Ev @ 35 NONAME
+	_ZN3TMS13TMSClientSink11AddObserverERNS_21TMSClientSinkObserverEPv @ 36 NONAME
+	_ZN3TMS13TMSClientSink14RemoveObserverERNS_21TMSClientSinkObserverE @ 37 NONAME
+	_ZN3TMS13TMSClientSink15BufferProcessedEPNS_9TMSBufferE @ 38 NONAME
+	_ZN3TMS13TMSClientSink7GetTypeERi @ 39 NONAME
+	_ZN3TMS13TMSClientSinkC1Ev @ 40 NONAME
+	_ZN3TMS13TMSClientSinkC2Ev @ 41 NONAME
+	_ZN3TMS13TMSClientSinkD0Ev @ 42 NONAME
+	_ZN3TMS13TMSClientSinkD1Ev @ 43 NONAME
+	_ZN3TMS13TMSClientSinkD2Ev @ 44 NONAME
+	_ZN3TMS13TMSG711Format10GetVADModeERi @ 45 NONAME
+	_ZN3TMS13TMSG711Format10SetVADModeEi @ 46 NONAME
+	_ZN3TMS13TMSG711Format6GetCNGERi @ 47 NONAME
+	_ZN3TMS13TMSG711Format6GetPlcERi @ 48 NONAME
+	_ZN3TMS13TMSG711Format6SetCNGEi @ 49 NONAME
+	_ZN3TMS13TMSG711Format6SetPlcEi @ 50 NONAME
+	_ZN3TMS13TMSG711Format7GetModeERi @ 51 NONAME
+	_ZN3TMS13TMSG711Format7SetModeEi @ 52 NONAME
+	_ZN3TMS13TMSG711FormatC1Ev @ 53 NONAME
+	_ZN3TMS13TMSG711FormatC2Ev @ 54 NONAME
+	_ZN3TMS13TMSG711FormatD0Ev @ 55 NONAME
+	_ZN3TMS13TMSG711FormatD1Ev @ 56 NONAME
+	_ZN3TMS13TMSG711FormatD2Ev @ 57 NONAME
+	_ZN3TMS13TMSG729Format10GetVADModeERi @ 58 NONAME
+	_ZN3TMS13TMSG729Format10SetVADModeEi @ 59 NONAME
+	_ZN3TMS13TMSG729FormatC1Ev @ 60 NONAME
+	_ZN3TMS13TMSG729FormatC2Ev @ 61 NONAME
+	_ZN3TMS13TMSG729FormatD0Ev @ 62 NONAME
+	_ZN3TMS13TMSG729FormatD1Ev @ 63 NONAME
+	_ZN3TMS13TMSG729FormatD2Ev @ 64 NONAME
+	_ZN3TMS13TMSGainEffect11AddObserverERNS_17TMSEffectObserverEPv @ 65 NONAME
+	_ZN3TMS13TMSGainEffect11GetMaxLevelERj @ 66 NONAME
+	_ZN3TMS13TMSGainEffect14RemoveObserverERNS_17TMSEffectObserverE @ 67 NONAME
+	_ZN3TMS13TMSGainEffect7GetTypeERi @ 68 NONAME
+	_ZN3TMS13TMSGainEffect8GetLevelERj @ 69 NONAME
+	_ZN3TMS13TMSGainEffect8SetLevelEj @ 70 NONAME
+	_ZN3TMS13TMSGainEffectC1Ev @ 71 NONAME
+	_ZN3TMS13TMSGainEffectC2Ev @ 72 NONAME
+	_ZN3TMS13TMSGainEffectD0Ev @ 73 NONAME
+	_ZN3TMS13TMSGainEffectD1Ev @ 74 NONAME
+	_ZN3TMS13TMSGainEffectD2Ev @ 75 NONAME
+	_ZN3TMS13TMSILBCFormat10GetVADModeERi @ 76 NONAME
+	_ZN3TMS13TMSILBCFormat10SetVADModeEi @ 77 NONAME
+	_ZN3TMS13TMSILBCFormat6GetCNGERi @ 78 NONAME
+	_ZN3TMS13TMSILBCFormat6SetCNGEi @ 79 NONAME
+	_ZN3TMS13TMSILBCFormat7GetModeERi @ 80 NONAME
+	_ZN3TMS13TMSILBCFormat7SetModeEi @ 81 NONAME
+	_ZN3TMS13TMSILBCFormatC1Ev @ 82 NONAME
+	_ZN3TMS13TMSILBCFormatC2Ev @ 83 NONAME
+	_ZN3TMS13TMSILBCFormatD0Ev @ 84 NONAME
+	_ZN3TMS13TMSILBCFormatD1Ev @ 85 NONAME
+	_ZN3TMS13TMSILBCFormatD2Ev @ 86 NONAME
+	_ZN3TMS13TMSInbandTone11AddObserverERNS_21TMSInbandToneObserverEPv @ 87 NONAME
+	_ZN3TMS13TMSInbandTone14RemoveObserverERNS_21TMSInbandToneObserverE @ 88 NONAME
+	_ZN3TMS13TMSInbandTone4StopEv @ 89 NONAME
+	_ZN3TMS13TMSInbandTone5StartEi @ 90 NONAME
+	_ZN3TMS13TMSInbandToneC1Ev @ 91 NONAME
+	_ZN3TMS13TMSInbandToneC2Ev @ 92 NONAME
+	_ZN3TMS13TMSInbandToneD0Ev @ 93 NONAME
+	_ZN3TMS13TMSInbandToneD1Ev @ 94 NONAME
+	_ZN3TMS13TMSInbandToneD2Ev @ 95 NONAME
+	_ZN3TMS14TMSModemSource7GetTypeERi @ 96 NONAME
+	_ZN3TMS14TMSModemSourceC1Ev @ 97 NONAME
+	_ZN3TMS14TMSModemSourceC2Ev @ 98 NONAME
+	_ZN3TMS14TMSModemSourceD0Ev @ 99 NONAME
+	_ZN3TMS14TMSModemSourceD1Ev @ 100 NONAME
+	_ZN3TMS14TMSModemSourceD2Ev @ 101 NONAME
+	_ZN3TMS14TMSSpeakerSink7GetTypeERi @ 102 NONAME
+	_ZN3TMS14TMSSpeakerSinkC1Ev @ 103 NONAME
+	_ZN3TMS14TMSSpeakerSinkC2Ev @ 104 NONAME
+	_ZN3TMS14TMSSpeakerSinkD0Ev @ 105 NONAME
+	_ZN3TMS14TMSSpeakerSinkD1Ev @ 106 NONAME
+	_ZN3TMS14TMSSpeakerSinkD2Ev @ 107 NONAME
+	_ZN3TMS15TMSClientSource11AddObserverERNS_23TMSClientSourceObserverEPv @ 108 NONAME
+	_ZN3TMS15TMSClientSource12BufferFilledERNS_9TMSBufferE @ 109 NONAME
+	_ZN3TMS15TMSClientSource13ProcessBufferEPNS_9TMSBufferE @ 110 NONAME
+	_ZN3TMS15TMSClientSource14GetEnqueueModeERi @ 111 NONAME
+	_ZN3TMS15TMSClientSource14RemoveObserverERNS_23TMSClientSourceObserverE @ 112 NONAME
+	_ZN3TMS15TMSClientSource14SetEnqueueModeEi @ 113 NONAME
+	_ZN3TMS15TMSClientSource5FlushEv @ 114 NONAME
+	_ZN3TMS15TMSClientSource7GetTypeERi @ 115 NONAME
+	_ZN3TMS15TMSClientSourceC1Ev @ 116 NONAME
+	_ZN3TMS15TMSClientSourceC2Ev @ 117 NONAME
+	_ZN3TMS15TMSClientSourceD0Ev @ 118 NONAME
+	_ZN3TMS15TMSClientSourceD1Ev @ 119 NONAME
+	_ZN3TMS15TMSClientSourceD2Ev @ 120 NONAME
+	_ZN3TMS15TMSVolumeEffect11AddObserverERNS_17TMSEffectObserverEPv @ 121 NONAME
+	_ZN3TMS15TMSVolumeEffect11GetMaxLevelERj @ 122 NONAME
+	_ZN3TMS15TMSVolumeEffect14RemoveObserverERNS_17TMSEffectObserverE @ 123 NONAME
+	_ZN3TMS15TMSVolumeEffect7GetTypeERi @ 124 NONAME
+	_ZN3TMS15TMSVolumeEffect8GetLevelERj @ 125 NONAME
+	_ZN3TMS15TMSVolumeEffect8SetLevelEj @ 126 NONAME
+	_ZN3TMS15TMSVolumeEffectC1Ev @ 127 NONAME
+	_ZN3TMS15TMSVolumeEffectC2Ev @ 128 NONAME
+	_ZN3TMS15TMSVolumeEffectD0Ev @ 129 NONAME
+	_ZN3TMS15TMSVolumeEffectD1Ev @ 130 NONAME
+	_ZN3TMS15TMSVolumeEffectD2Ev @ 131 NONAME
+	_ZN3TMS16TMSGlobalRouting11AddObserverERNS_24TMSGlobalRoutingObserverEPv @ 132 NONAME
+	_ZN3TMS16TMSGlobalRouting14RemoveObserverERNS_24TMSGlobalRoutingObserverE @ 133 NONAME
+	_ZN3TMS16TMSGlobalRouting17GetPreviousOutputERi @ 134 NONAME
+	_ZN3TMS16TMSGlobalRouting19GetAvailableOutputsERSt6vectorIjSaIjEE @ 135 NONAME
+	_ZN3TMS16TMSGlobalRouting9GetOutputERi @ 136 NONAME
+	_ZN3TMS16TMSGlobalRouting9SetOutputEi @ 137 NONAME
+	_ZN3TMS16TMSGlobalRoutingC1Ev @ 138 NONAME
+	_ZN3TMS16TMSGlobalRoutingC2Ev @ 139 NONAME
+	_ZN3TMS16TMSGlobalRoutingD0Ev @ 140 NONAME
+	_ZN3TMS16TMSGlobalRoutingD1Ev @ 141 NONAME
+	_ZN3TMS16TMSGlobalRoutingD2Ev @ 142 NONAME
+	_ZN3TMS18TMSGlobalVolEffect11AddObserverERNS_17TMSEffectObserverEPv @ 143 NONAME
+	_ZN3TMS18TMSGlobalVolEffect11GetMaxLevelERj @ 144 NONAME
+	_ZN3TMS18TMSGlobalVolEffect14RemoveObserverERNS_17TMSEffectObserverE @ 145 NONAME
+	_ZN3TMS18TMSGlobalVolEffect7GetTypeERi @ 146 NONAME
+	_ZN3TMS18TMSGlobalVolEffect8GetLevelERj @ 147 NONAME
+	_ZN3TMS18TMSGlobalVolEffect8SetLevelEj @ 148 NONAME
+	_ZN3TMS18TMSGlobalVolEffectC1Ev @ 149 NONAME
+	_ZN3TMS18TMSGlobalVolEffectC2Ev @ 150 NONAME
+	_ZN3TMS18TMSGlobalVolEffectD0Ev @ 151 NONAME
+	_ZN3TMS18TMSGlobalVolEffectD1Ev @ 152 NONAME
+	_ZN3TMS18TMSGlobalVolEffectD2Ev @ 153 NONAME
+	_ZN3TMS19TMSGlobalGainEffect11AddObserverERNS_17TMSEffectObserverEPv @ 154 NONAME
+	_ZN3TMS19TMSGlobalGainEffect11GetMaxLevelERj @ 155 NONAME
+	_ZN3TMS19TMSGlobalGainEffect14RemoveObserverERNS_17TMSEffectObserverE @ 156 NONAME
+	_ZN3TMS19TMSGlobalGainEffect7GetTypeERi @ 157 NONAME
+	_ZN3TMS19TMSGlobalGainEffect8GetLevelERj @ 158 NONAME
+	_ZN3TMS19TMSGlobalGainEffect8SetLevelEj @ 159 NONAME
+	_ZN3TMS19TMSGlobalGainEffectC1Ev @ 160 NONAME
+	_ZN3TMS19TMSGlobalGainEffectC2Ev @ 161 NONAME
+	_ZN3TMS19TMSGlobalGainEffectD0Ev @ 162 NONAME
+	_ZN3TMS19TMSGlobalGainEffectD1Ev @ 163 NONAME
+	_ZN3TMS19TMSGlobalGainEffectD2Ev @ 164 NONAME
+	_ZN3TMS7TMSCall11GetCallTypeEv @ 165 NONAME
+	_ZN3TMS7TMSCall12CreateStreamEiRPNS_9TMSStreamE @ 166 NONAME
+	_ZN3TMS7TMSCall12DeleteStreamERPNS_9TMSStreamE @ 167 NONAME
+	_ZN3TMS7TMSCall16GetCallContextIdERj @ 168 NONAME
+	_ZN3TMS7TMSCallC1Ev @ 169 NONAME
+	_ZN3TMS7TMSCallC2Ev @ 170 NONAME
+	_ZN3TMS7TMSCallD0Ev @ 171 NONAME
+	_ZN3TMS7TMSCallD1Ev @ 172 NONAME
+	_ZN3TMS7TMSCallD2Ev @ 173 NONAME
+	_ZN3TMS7TMSDTMF11AddObserverERNS_15TMSDTMFObserverEPv @ 174 NONAME
+	_ZN3TMS7TMSDTMF14RemoveObserverERNS_15TMSDTMFObserverE @ 175 NONAME
+	_ZN3TMS7TMSDTMF25ContinueDTMFStringSendingEi @ 176 NONAME
+	_ZN3TMS7TMSDTMF4StopEv @ 177 NONAME
+	_ZN3TMS7TMSDTMF5StartEv @ 178 NONAME
+	_ZN3TMS7TMSDTMF7SetToneEP8_GString @ 179 NONAME
+	_ZN3TMS7TMSDTMFC1Ev @ 180 NONAME
+	_ZN3TMS7TMSDTMFC2Ev @ 181 NONAME
+	_ZN3TMS7TMSDTMFD0Ev @ 182 NONAME
+	_ZN3TMS7TMSDTMFD1Ev @ 183 NONAME
+	_ZN3TMS7TMSDTMFD2Ev @ 184 NONAME
+	_ZN3TMS9TMSFormat10GetBitRateERj @ 185 NONAME
+	_ZN3TMS9TMSFormat10SetBitRateEj @ 186 NONAME
+	_ZN3TMS9TMSFormat20GetSupportedBitRatesERSt6vectorIjSaIjEE @ 187 NONAME
+	_ZN3TMS9TMSFormat7GetTypeERi @ 188 NONAME
+	_ZN3TMS9TMSFormatC1Ev @ 189 NONAME
+	_ZN3TMS9TMSFormatC2Ev @ 190 NONAME
+	_ZN3TMS9TMSFormatD0Ev @ 191 NONAME
+	_ZN3TMS9TMSFormatD1Ev @ 192 NONAME
+	_ZN3TMS9TMSFormatD2Ev @ 193 NONAME
+	_ZN3TMS9TMSStream10RemoveSinkEPNS_7TMSSinkE @ 194 NONAME
+	_ZN3TMS9TMSStream11AddObserverERNS_17TMSStreamObserverEPv @ 195 NONAME
+	_ZN3TMS9TMSStream11GetStreamIdEv @ 196 NONAME
+	_ZN3TMS9TMSStream11ResetFormatEPNS_9TMSFormatE @ 197 NONAME
+	_ZN3TMS9TMSStream12RemoveEffectEPNS_9TMSEffectE @ 198 NONAME
+	_ZN3TMS9TMSStream12RemoveSourceEPNS_9TMSSourceE @ 199 NONAME
+	_ZN3TMS9TMSStream13GetStreamTypeEv @ 200 NONAME
+	_ZN3TMS9TMSStream14RemoveObserverERNS_17TMSStreamObserverE @ 201 NONAME
+	_ZN3TMS9TMSStream4InitEv @ 202 NONAME
+	_ZN3TMS9TMSStream4StopEv @ 203 NONAME
+	_ZN3TMS9TMSStream5PauseEv @ 204 NONAME
+	_ZN3TMS9TMSStream5StartEv @ 205 NONAME
+	_ZN3TMS9TMSStream6DeinitEv @ 206 NONAME
+	_ZN3TMS9TMSStream7AddSinkEPNS_7TMSSinkE @ 207 NONAME
+	_ZN3TMS9TMSStream8GetStateEv @ 208 NONAME
+	_ZN3TMS9TMSStream9AddEffectEPNS_9TMSEffectE @ 209 NONAME
+	_ZN3TMS9TMSStream9AddSourceEPNS_9TMSSourceE @ 210 NONAME
+	_ZN3TMS9TMSStream9SetFormatEPNS_9TMSFormatE @ 211 NONAME
+	_ZN3TMS9TMSStreamC1Ev @ 212 NONAME
+	_ZN3TMS9TMSStreamC2Ev @ 213 NONAME
+	_ZN3TMS9TMSStreamD1Ev @ 214 NONAME
+	_ZN3TMS9TMSStreamD2Ev @ 215 NONAME
+	_ZTIN3TMS11TMSRingToneE @ 216 NONAME
+	_ZTIN3TMS12TMSAMRFormatE @ 217 NONAME
+	_ZTIN3TMS12TMSMicSourceE @ 218 NONAME
+	_ZTIN3TMS12TMSModemSinkE @ 219 NONAME
+	_ZTIN3TMS12TMSPCMFormatE @ 220 NONAME
+	_ZTIN3TMS13TMSClientSinkE @ 221 NONAME
+	_ZTIN3TMS13TMSG711FormatE @ 222 NONAME
+	_ZTIN3TMS13TMSG729FormatE @ 223 NONAME
+	_ZTIN3TMS13TMSGainEffectE @ 224 NONAME
+	_ZTIN3TMS13TMSILBCFormatE @ 225 NONAME
+	_ZTIN3TMS13TMSInbandToneE @ 226 NONAME
+	_ZTIN3TMS14TMSModemSourceE @ 227 NONAME
+	_ZTIN3TMS14TMSSpeakerSinkE @ 228 NONAME
+	_ZTIN3TMS15TMSClientSourceE @ 229 NONAME
+	_ZTIN3TMS15TMSVolumeEffectE @ 230 NONAME
+	_ZTIN3TMS16TMSGlobalRoutingE @ 231 NONAME
+	_ZTIN3TMS18TMSGlobalVolEffectE @ 232 NONAME
+	_ZTIN3TMS19TMSGlobalGainEffectE @ 233 NONAME
+	_ZTIN3TMS7TMSCallE @ 234 NONAME
+	_ZTIN3TMS7TMSDTMFE @ 235 NONAME
+	_ZTIN3TMS9TMSFormatE @ 236 NONAME
+	_ZTVN3TMS11TMSRingToneE @ 237 NONAME
+	_ZTVN3TMS12TMSAMRFormatE @ 238 NONAME
+	_ZTVN3TMS12TMSMicSourceE @ 239 NONAME
+	_ZTVN3TMS12TMSModemSinkE @ 240 NONAME
+	_ZTVN3TMS12TMSPCMFormatE @ 241 NONAME
+	_ZTVN3TMS13TMSClientSinkE @ 242 NONAME
+	_ZTVN3TMS13TMSG711FormatE @ 243 NONAME
+	_ZTVN3TMS13TMSG729FormatE @ 244 NONAME
+	_ZTVN3TMS13TMSGainEffectE @ 245 NONAME
+	_ZTVN3TMS13TMSILBCFormatE @ 246 NONAME
+	_ZTVN3TMS13TMSInbandToneE @ 247 NONAME
+	_ZTVN3TMS14TMSModemSourceE @ 248 NONAME
+	_ZTVN3TMS14TMSSpeakerSinkE @ 249 NONAME
+	_ZTVN3TMS15TMSClientSourceE @ 250 NONAME
+	_ZTVN3TMS15TMSVolumeEffectE @ 251 NONAME
+	_ZTVN3TMS16TMSGlobalRoutingE @ 252 NONAME
+	_ZTVN3TMS18TMSGlobalVolEffectE @ 253 NONAME
+	_ZTVN3TMS19TMSGlobalGainEffectE @ 254 NONAME
+	_ZTVN3TMS7TMSCallE @ 255 NONAME
+	_ZTVN3TMS7TMSDTMFE @ 256 NONAME
+	_ZTVN3TMS9TMSFormatE @ 257 NONAME
 
--- a/mmserv/tms/tmsapi/group/tmsapi.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsapi/group/tmsapi.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -30,7 +30,7 @@
 MW_LAYER_SYSTEMINCLUDE
 OS_LAYER_LIBC_SYSTEMINCLUDE
 OS_LAYER_GLIB_SYSTEMINCLUDE
-SYSTEMINCLUDE /epoc32/include/stdapis/stlport
+OS_LAYER_STDCPP_SYSTEMINCLUDE
 
 USERINCLUDE ../inc
 USERINCLUDE ../../inc
@@ -55,6 +55,9 @@
 SOURCE      tmsspeakersink.cpp
 SOURCE      tmsmodemsource.cpp
 SOURCE      tmsmicsource.cpp
+SOURCE      tmsringtone.cpp
+SOURCE      tmsdtmf.cpp
+SOURCE      tmsinbandtone.cpp
 
 LIBRARY     euser.lib
 LIBRARY     libglib.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsapi/src/tmsdtmf.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,93 @@
+/*
+ * 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 "tmsdtmfbody.h"
+#include "tmsdtmf.h"
+#include "tmsdtmfobsrvr.h"
+
+using namespace TMS;
+
+
+EXPORT_C TMSDTMF::TMSDTMF(void) :
+    iBody(NULL)
+    {
+    }
+
+EXPORT_C TMSDTMF::~TMSDTMF(void)
+    {
+    delete iBody;
+    }
+
+EXPORT_C gint TMSDTMF::AddObserver(TMSDTMFObserver& obsrvr, gpointer user_data)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->AddObserver(obsrvr, user_data);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSDTMF::RemoveObserver(TMSDTMFObserver& obsrvr)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->RemoveObserver(obsrvr);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSDTMF::Start()
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->Start();
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSDTMF::Stop()
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->Stop();
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSDTMF::SetTone(GString* string)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->SetTone(string);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSDTMF::ContinueDTMFStringSending(gboolean aContinue)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->ContinueDTMFStringSending(aContinue);
+        }
+    return status;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsapi/src/tmsinbandtone.cpp	Fri Apr 16 15:29:42 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: Telephony Multimedia Service
+ *
+ */
+
+#include "tmsinbandtonebody.h"
+#include "tmsinbandtone.h"
+#include "tmsinbandtoneobsrvr.h"
+
+using namespace TMS;
+
+
+EXPORT_C TMSInbandTone::TMSInbandTone(void) :
+    iBody(NULL)
+    {
+    }
+
+EXPORT_C TMSInbandTone::~TMSInbandTone(void)
+    {
+    delete iBody;
+    }
+
+EXPORT_C gint TMSInbandTone::AddObserver(TMSInbandToneObserver& obsrvr, gpointer user_data)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->AddObserver(obsrvr, user_data);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSInbandTone::RemoveObserver(TMSInbandToneObserver& obsrvr)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->RemoveObserver(obsrvr);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSInbandTone::Start(TMSInbandToneType inbandtonetype)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->Start(inbandtonetype);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSInbandTone::Stop()
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->Stop();
+        }
+    return status;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsapi/src/tmsringtone.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,116 @@
+/*
+ * 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 <tmsringtoneobsrvr.h>
+#include <tmsringtone.h>
+#include "tmsringtonebody.h"
+
+using namespace TMS;
+
+EXPORT_C TMSRingTone::TMSRingTone() :
+    iBody(NULL)
+    {
+    }
+
+EXPORT_C TMSRingTone::~TMSRingTone()
+    {
+    delete iBody;
+    }
+
+EXPORT_C gint TMSRingTone::AddObserver(TMSRingToneObserver& obsrvr,
+        gpointer user_data)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->AddObserver(obsrvr, user_data);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSRingTone::RemoveObserver(TMSRingToneObserver& obsrvr)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->RemoveObserver(obsrvr);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSRingTone::Init(const TMSRingToneType type, GString* str,
+        GString* tts)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->Init(type, str, tts);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSRingTone::Deinit()
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->Deinit();
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSRingTone::Play()
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->Play();
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSRingTone::Stop()
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->Stop();
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSRingTone::Pause()
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->Pause();
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSRingTone::Mute()
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (iBody)
+        {
+        status = iBody->Mute();
+        }
+    return status;
+    }
+
+// End of file
--- a/mmserv/tms/tmscallproxy/group/tmscallproxy.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallproxy/group/tmscallproxy.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -31,8 +31,8 @@
 MW_LAYER_SYSTEMINCLUDE
 OS_LAYER_LIBC_SYSTEMINCLUDE
 OS_LAYER_GLIB_SYSTEMINCLUDE
+OS_LAYER_STDCPP_SYSTEMINCLUDE
 SYSTEMINCLUDE   /epoc32/include/mmf/common
-SYSTEMINCLUDE   /epoc32/include/stdapis/stlport
 
 USERINCLUDE     ../../inc
 SOURCEPATH      ../src
--- a/mmserv/tms/tmscallproxy/src/tmscallproxy.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallproxy/src/tmscallproxy.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -24,8 +24,6 @@
 
 using namespace TMS;
 
-// CONSTANTS
-
 // -----------------------------------------------------------------------------
 // TMSCallProxy::TMSCallProxy
 //
@@ -34,7 +32,6 @@
 EXPORT_C TMSCallProxy::TMSCallProxy() :
     iTMSProxy(NULL)
     {
-    // No impl
     }
 
 // -----------------------------------------------------------------------------
@@ -285,7 +282,7 @@
     inPckg().StreamId = strmId;
     status = RSessionBase::SendReceive(TMS_DATA_XFER_BUFFER_EMPTIED,
             TIpcArgs(&inPckg));
-    
+
     TRACE_PRN_FN_EXT;
     return TMSRESULT(status);
     }
--- a/mmserv/tms/tmscallserver/eabi/tmscallserver.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/eabi/tmscallserver.def	Fri Apr 16 15:29:42 2010 +0300
@@ -1,23 +1,33 @@
 EXPORTS
 	_ZN3TMS13TMSCallServer11StartThreadEPv @ 1 NONAME
-	_ZTIN3TMS10CallCSAdptE @ 2 NONAME
-	_ZTIN3TMS10CallIPAdptE @ 3 NONAME
-	_ZTIN3TMS11TarSettingsE @ 4 NONAME
-	_ZTIN3TMS13TMSCallServerE @ 5 NONAME
-	_ZTIN3TMS13TMSVoIPUplinkE @ 6 NONAME
-	_ZTIN3TMS14TMSCallSessionE @ 7 NONAME
-	_ZTIN3TMS15TMSVoIPDownlinkE @ 8 NONAME
-	_ZTIN3TMS16IPCallStreamBaseE @ 9 NONAME
-	_ZTIN3TMS17TMSCallDelayTimerE @ 10 NONAME
-	_ZTIN3TMS8CallAdptE @ 11 NONAME
-	_ZTVN3TMS10CallCSAdptE @ 12 NONAME
-	_ZTVN3TMS10CallIPAdptE @ 13 NONAME
-	_ZTVN3TMS11TarSettingsE @ 14 NONAME
-	_ZTVN3TMS13TMSCallServerE @ 15 NONAME
-	_ZTVN3TMS13TMSVoIPUplinkE @ 16 NONAME
-	_ZTVN3TMS14TMSCallSessionE @ 17 NONAME
-	_ZTVN3TMS15TMSVoIPDownlinkE @ 18 NONAME
-	_ZTVN3TMS16IPCallStreamBaseE @ 19 NONAME
-	_ZTVN3TMS17TMSCallDelayTimerE @ 20 NONAME
-	_ZTVN3TMS8CallAdptE @ 21 NONAME
+	_ZTIN3TMS11TMSCallAdptE @ 2 NONAME
+	_ZTIN3TMS11TMSIPUplinkE @ 3 NONAME
+	_ZTIN3TMS13TMSCallCSAdptE @ 4 NONAME
+	_ZTIN3TMS13TMSCallIPAdptE @ 5 NONAME
+	_ZTIN3TMS13TMSCallServerE @ 6 NONAME
+	_ZTIN3TMS13TMSIPDownlinkE @ 7 NONAME
+	_ZTIN3TMS14TMSCallSessionE @ 8 NONAME
+	_ZTIN3TMS14TMSTarSettingsE @ 9 NONAME
+	_ZTIN3TMS15TMSDTMFProviderE @ 10 NONAME
+	_ZTIN3TMS15TMSDtmfNotifierE @ 11 NONAME
+	_ZTIN3TMS17TMSCallDelayTimerE @ 12 NONAME
+	_ZTIN3TMS18TMSEtelDtmfMonitorE @ 13 NONAME
+	_ZTIN3TMS19TMSIPCallStreamBaseE @ 14 NONAME
+	_ZTIN3TMS22TMSAudioDtmfTonePlayerE @ 15 NONAME
+	_ZTIN3TMS22TMSEtelDtmfStopMonitorE @ 16 NONAME
+	_ZTVN3TMS11TMSCallAdptE @ 17 NONAME
+	_ZTVN3TMS11TMSIPUplinkE @ 18 NONAME
+	_ZTVN3TMS13TMSCallCSAdptE @ 19 NONAME
+	_ZTVN3TMS13TMSCallIPAdptE @ 20 NONAME
+	_ZTVN3TMS13TMSCallServerE @ 21 NONAME
+	_ZTVN3TMS13TMSIPDownlinkE @ 22 NONAME
+	_ZTVN3TMS14TMSCallSessionE @ 23 NONAME
+	_ZTVN3TMS14TMSTarSettingsE @ 24 NONAME
+	_ZTVN3TMS15TMSDTMFProviderE @ 25 NONAME
+	_ZTVN3TMS15TMSDtmfNotifierE @ 26 NONAME
+	_ZTVN3TMS17TMSCallDelayTimerE @ 27 NONAME
+	_ZTVN3TMS18TMSEtelDtmfMonitorE @ 28 NONAME
+	_ZTVN3TMS19TMSIPCallStreamBaseE @ 29 NONAME
+	_ZTVN3TMS22TMSAudioDtmfTonePlayerE @ 30 NONAME
+	_ZTVN3TMS22TMSEtelDtmfStopMonitorE @ 31 NONAME
 
--- a/mmserv/tms/tmscallserver/group/tmscallserver.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/group/tmscallserver.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -52,6 +52,11 @@
 SOURCE          csdownlink.cpp
 SOURCE          csuplink.cpp
 SOURCE          tarsettings.cpp
+SOURCE          cpeaudiodtmftoneplayer.cpp
+SOURCE          cspdtmfprovider.cpp
+SOURCE          cspeteldtmfmonitor.cpp
+SOURCE          cspeteldtmfstopmonitor.cpp
+SOURCE          dtmfnotifier.cpp
 
 USERINCLUDE     ../inc
 USERINCLUDE     ../../inc
@@ -62,17 +67,17 @@
 MW_LAYER_SYSTEMINCLUDE
 OS_LAYER_LIBC_SYSTEMINCLUDE
 OS_LAYER_GLIB_SYSTEMINCLUDE
-
+OS_LAYER_STDCPP_SYSTEMINCLUDE
 SYSTEMINCLUDE   /epoc32/include/mmf/server
 SYSTEMINCLUDE   /epoc32/include/mda/common
 SYSTEMINCLUDE   /epoc32/include/mmf/common
-SYSTEMINCLUDE   /epoc32/include/stdapis/stlport
 
 #ifdef __USE_GSTREAMER__
-SYSTEMINCLUDE   /sf/mw/gstreamer/include/gstreamer
-SYSTEMINCLUDE   /sf/mw/gstreamer/include/gstreamer/gst
-SYSTEMINCLUDE   /sf/mw/gstreamer/include/gstreamer/gst/app
-SYSTEMINCLUDE   /epoc32/include/stdapis/glib-2.0/gobject
+MW_LAYER_GSTREAMER_SYSTEMINCLUDE
+//SYSTEMINCLUDE   /sf/mw/gstreamer/include/gstreamer
+//SYSTEMINCLUDE   /sf/mw/gstreamer/include/gstreamer/gst
+//SYSTEMINCLUDE   /sf/mw/gstreamer/include/gstreamer/gst/app
+//SYSTEMINCLUDE   /epoc32/include/stdapis/glib-2.0/gobject
 
 LIBRARY         libgobject.lib
 LIBRARY         libgstreamer.lib
@@ -100,6 +105,10 @@
 LIBRARY         profileengine.lib
 LIBRARY         telephonyaudiorouting.lib
 LIBRARY         tmsutility.lib
+// Libraries for ETel
+LIBRARY         etelmm.lib
+LIBRARY         etel.lib
+LIBRARY         customapi.lib
 
 DEFFILE         tmscallserver.def
 NOSTRICTDEF
--- a/mmserv/tms/tmscallserver/inc/calladpt.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/inc/calladpt.h	Fri Apr 16 15:29:42 2010 +0300
@@ -23,12 +23,12 @@
 
 namespace TMS {
 
-// CallAdpt class
-class CallAdpt
+// TMSCallAdpt class
+class TMSCallAdpt
     {
 public:
-    static gint CreateCallL(gint callType, CallAdpt*& callAdpt);
-    virtual ~CallAdpt();
+    static gint CreateCallL(gint callType, TMSCallAdpt*& callAdpt);
+    virtual ~TMSCallAdpt();
     virtual gint CreateStream(TMSCallType callType,
             TMSStreamType strmType, gint& outStrmId) = 0;
     virtual gint InitStreamL(TMSCallType callType,
@@ -84,9 +84,12 @@
     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:
-    CallAdpt();
+    TMSCallAdpt();
     virtual gint PostConstruct();
 
 protected:
--- a/mmserv/tms/tmscallserver/inc/callcsadpt.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/inc/callcsadpt.h	Fri Apr 16 15:29:42 2010 +0300
@@ -21,28 +21,36 @@
 #include <TelephonyAudioRouting.h>
 #include <MTelephonyAudioRoutingObserver.h>
 #include <e32msgqueue.h>
+#include <etelmm.h>
+#include <rmmcustomapi.h>
 #include "tmsclientserver.h"
+#include "dtmftoneplayerobserver.h"
 #include "calladpt.h"
 #include "mcspdevsoundobserver.h"
+#include "mccpdtmfobserver.h"
 
 namespace TMS {
 
 // FORWARD DECLARATIONS
-class CSUplink;
-class CSDownlink;
-class TarSettings;
+class TMSCSUplink;
+class TMSCSDownlink;
+class TMSTarSettings;
+class TMSAudioDtmfTonePlayer;
+class TMSDTMFProvider;
+class TMSDtmfNotifier;
 
 /*
  * CallCSAdapt class
  */
-class CallCSAdpt : public CBase,
-                   public CallAdpt,
-                   public MCSPDevSoundObserver,
-                   public MTelephonyAudioRoutingObserver
+class TMSCallCSAdpt : public TMSCallAdpt,
+                      public TMSCSPDevSoundObserver,
+                      public MTelephonyAudioRoutingObserver,
+                      public TMSDTMFTonePlayerObserver,
+                      public TMSCCPDTMFObserver
     {
 public:
-    CallCSAdpt();
-    virtual ~CallCSAdpt();
+    TMSCallCSAdpt();
+    virtual ~TMSCallCSAdpt();
     virtual gint PostConstruct();
 
     virtual gint CreateStream(TMSCallType callType, TMSStreamType strmType,
@@ -98,11 +106,14 @@
     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 MCSPDevSoundObserver
+    //From TMSCSPDevSoundObserver
     void DownlinkInitCompleted(TInt status);
     void UplinkInitCompleted(TInt status);
     void UplinkActivatedSuccessfully();
@@ -110,6 +121,14 @@
     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);
@@ -121,10 +140,13 @@
 private:
     gint iNextStreamId;
 
-    CSUplink* iCSUplink;
-    CSDownlink* iCSDownlink;
+    TMSCSUplink* iCSUplink;
+    TMSCSDownlink* iCSDownlink;
     CTelephonyAudioRouting* iRouting;
-    TarSettings* iTarSettings;
+    TMSTarSettings* iTarSettings;
+    TMSAudioDtmfTonePlayer* iDTMFDnlinkPlayer;
+    TMSDtmfNotifier* iDTMFNotifier;
+    TMSDTMFProvider* iDTMFUplinkPlayer;
     TMSStreamType iStrmtype;
 
     RMsgQueue<TmsMsgBuf> iMsgQueueUp;
--- a/mmserv/tms/tmscallserver/inc/callipadpt.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/inc/callipadpt.h	Fri Apr 16 15:29:42 2010 +0300
@@ -24,21 +24,24 @@
 #include "tmsclientserver.h"
 #include "tmsshared.h"
 #include "calladpt.h"
+#include "cpeaudiodtmftoneplayer.h"
+#include "dtmfnotifier.h"
 
 namespace TMS {
 
 // FORWARD DECLARATIONS
-class TMSVoIPDownlink;
-class TMSVoIPUplink;
+class TMSIPDownlink;
+class TMSIPUplink;
 
-// CallIPAdpt class
-class CallIPAdpt : public CallAdpt
+// TMSCallIPAdpt class
+class TMSCallIPAdpt : public TMSCallAdpt,
+                      public TMSDTMFTonePlayerObserver
     {
 public:
     // Constractor
-    static CallIPAdpt* NewL();
+    static TMSCallIPAdpt* NewL();
 
-    virtual ~CallIPAdpt();
+    virtual ~TMSCallIPAdpt();
     virtual gint PostConstruct();
 
     virtual gint CreateStream(TMSCallType callType, TMSStreamType strmType,
@@ -96,6 +99,10 @@
     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);
@@ -115,9 +122,13 @@
     gint GetDataXferChunkHndl(const TMSStreamType strmType,
             const TUint32 key, RChunk& chunk);
 
+    //From DTMFTonePlayerObserver
+     void DTMFInitCompleted(TInt error);
+     void DTMFToneFinished(TInt error);
+
 private:
     void ConstructL();
-    CallIPAdpt();
+    TMSCallIPAdpt();
 
     void NotifyClient(const gint strmId, const TInt aCommand,
             const TInt aStatus = KErrNone, const TInt64 aInt64 = TInt64(0));
@@ -131,8 +142,8 @@
     gboolean iDnlinkInitialized;
     gint iDnlinkStreamId;
 
-    TMSVoIPDownlink* iVoIPDownlink;
-    TMSVoIPUplink* iVoIPUplink;
+    TMSIPDownlink* iIPDownlink;
+    TMSIPUplink* iIPUplink;
 
     // Message queues for communication and data transfer back to the client
     RMsgQueue<TmsMsgBuf> iMsgQueueUp;
@@ -148,6 +159,9 @@
     RArray<TFourCC> iCodecs;
     TInt iCodecsCount;
 
+    TMSAudioDtmfTonePlayer* iDTMFDnlinkPlayer;
+    TMSAudioDtmfTonePlayer* iDTMFUplinkPlayer;
+    TMSDtmfNotifier* iDTMFNotifier;
     };
 
 } //namespace TMS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmscallserver/inc/cpeaudiodtmftoneplayer.h	Fri Apr 16 15:29:42 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 CPEAUDIODTMFTONEPLAYER_H
+#define CPEAUDIODTMFTONEPLAYER_H
+
+// INCLUDES
+#include <glib.h>
+#include <sounddevice.h>
+#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
--- a/mmserv/tms/tmscallserver/inc/csdownlink.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/inc/csdownlink.h	Fri Apr 16 15:29:42 2010 +0300
@@ -24,19 +24,19 @@
 namespace TMS {
 
 //
-class MCSPDevSoundObserver;
+class TMSCSPDevSoundObserver;
 
 /**
  *  Provides Downlink functionality.
  *
  */
-NONSHARABLE_CLASS(CSDownlink) : public CSPDevSound
+NONSHARABLE_CLASS(TMSCSDownlink) : public TMSCSPDevSound
     {
 public:
 
-    static CSDownlink* NewL(MCSPDevSoundObserver& aObserver);
+    static TMSCSDownlink* NewL(TMSCSPDevSoundObserver& aObserver);
 
-    virtual ~CSDownlink();
+    virtual ~TMSCSDownlink();
 
     /**
      * Sets volume.
@@ -82,7 +82,7 @@
 
 protected:
 
-    CSDownlink(MCSPDevSoundObserver& aObserver);
+    TMSCSDownlink(TMSCSPDevSoundObserver& aObserver);
 
     void ConstructL();
     };
--- a/mmserv/tms/tmscallserver/inc/cspdevsound.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/inc/cspdevsound.h	Fri Apr 16 15:29:42 2010 +0300
@@ -22,24 +22,24 @@
 
 namespace TMS {
 
-class MCSPDevSoundObserver;
+class TMSCSPDevSoundObserver;
 
 /**
  *  Wrapper for CMMFDevSound
  *
  */
-NONSHARABLE_CLASS(CSPDevSound) : public CBase,
-                                 public MDevSoundObserver
+NONSHARABLE_CLASS(TMSCSPDevSound) : public CBase,
+                                    public MDevSoundObserver
     {
 public:
 
     /**
      * Destructor.
      */
-    virtual ~CSPDevSound();
+    virtual ~TMSCSPDevSound();
 
     /**
-     * Activates the dev sound stream. MCSPDevSoundObserver methods are called
+     * 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.
      */
@@ -118,7 +118,7 @@
 
 protected:
 
-    CSPDevSound(MCSPDevSoundObserver& aObserver);
+    TMSCSPDevSound(TMSCSPDevSoundObserver& aObserver);
 
     void ConstructL(TMMFState aMode, gint aAudioPreference,
             gint aAudioPriority);
@@ -155,7 +155,7 @@
      * Observer for successfull activation.
      * Not own.
      */
-    MCSPDevSoundObserver& iObserver;
+    TMSCSPDevSoundObserver& iObserver;
 
     };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmscallserver/inc/cspdtmfprovider.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,182 @@
+/*
+ * 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 <e32base.h>
+#include <mccpdtmfprovider.h>
+#include <mccpdtmfobserver.h>
+#include <etelmm.h>
+#include <rmmcustomapi.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 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<TMSCCPDTMFObserver> 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmscallserver/inc/cspeteldtmfmonitor.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,105 @@
+/*
+ * 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 <e32base.h>
+#include <etelmm.h>
+#include <rmmcustomapi.h>
+
+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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmscallserver/inc/cspeteldtmfstopmonitor.h	Fri Apr 16 15:29:42 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 CSPETELDTMFSTOPMONITOR_H
+#define CSPETELDTMFSTOPMONITOR_H
+
+#include <e32base.h>
+#include <etelmm.h>
+
+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
+
--- a/mmserv/tms/tmscallserver/inc/csuplink.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/inc/csuplink.h	Fri Apr 16 15:29:42 2010 +0300
@@ -27,13 +27,13 @@
  *  Provides uplink functionality.
  *
  */
-NONSHARABLE_CLASS(CSUplink) : public CSPDevSound
+NONSHARABLE_CLASS(TMSCSUplink) : public TMSCSPDevSound
     {
 public:
 
-    static CSUplink* NewL(MCSPDevSoundObserver& aObserver);
+    static TMSCSUplink* NewL(TMSCSPDevSoundObserver& aObserver);
 
-    virtual ~CSUplink();
+    virtual ~TMSCSUplink();
 
     /**
      * Determines mic mute state.
@@ -95,7 +95,7 @@
 
 protected:
 
-    CSUplink(MCSPDevSoundObserver& aObserver);
+    TMSCSUplink(TMSCSPDevSoundObserver& aObserver);
     void ConstructL();
     };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmscallserver/inc/dtmfnotifier.h	Fri Apr 16 15:29:42 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 <e32property.h>
+#include <sounddevice.h>
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmscallserver/inc/dtmftoneplayerobserver.h	Fri Apr 16 15:29:42 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
+
--- a/mmserv/tms/tmscallserver/inc/ipcallstream.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/inc/ipcallstream.h	Fri Apr 16 15:29:42 2010 +0300
@@ -39,8 +39,8 @@
 #include "gstg729decoderinterface.h"
 #else //__USE_GSTREAMER__
 #include <sounddevice.h>
-#include <VoIPDownlinkStream.h>
-#include <VoIPUplinkStream.h>
+#include <voipdownlinkstream.h>
+#include <voipuplinkstream.h>
 
 // FORWARD DECLARATIONS
 class CAudioOutput;
@@ -57,13 +57,13 @@
 namespace TMS {
 
 // -----------------------------------------------------------------------------
-//  Class Name:  IPCallStreamBase
+//  Class Name:  TMSIPCallStreamBase
 //
 //  Base abstract class for creating VoIP uplink and downlink streams.
 // -----------------------------------------------------------------------------
-class IPCallStreamBase : public CBase
+class TMSIPCallStreamBase : public CBase
 #ifndef __USE_GSTREAMER__
-                       , public MDevSoundObserver
+                          , public MDevSoundObserver
 #endif //__USE_GSTREAMER__
     {
 public:
@@ -76,7 +76,7 @@
         };
 
 public:
-    virtual ~IPCallStreamBase();
+    virtual ~TMSIPCallStreamBase();
 
     virtual void Start() = 0;
     virtual void Stop() = 0;
@@ -132,22 +132,22 @@
     };
 
 // -----------------------------------------------------------------------------
-//  Class Name:  TMSVoIPDownlink
+//  Class Name:  TMSIPDownlink
 //
 //  Class handling VoIP downlink stream object.
 // -----------------------------------------------------------------------------
-class TMSVoIPDownlink : public IPCallStreamBase
+class TMSIPDownlink : public TMSIPCallStreamBase
     {
 public:
-    virtual ~TMSVoIPDownlink();
+    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 TMSVoIPDownlink* NewL(const guint32 codecID,
+    static TMSIPDownlink* NewL(const guint32 codecID,
             const TMMFPrioritySettings priority);
-    TMSVoIPDownlink();
+    TMSIPDownlink();
     void ConstructL(const guint32 codecID,
             const TMMFPrioritySettings priority);
 
@@ -229,22 +229,22 @@
     };
 
 // -----------------------------------------------------------------------------
-//  Class Name:  TMSVoIPUplink
+//  Class Name:  TMSIPUplink
 //
 //  Class handling VoIP uplink stream.
 // -----------------------------------------------------------------------------
-class TMSVoIPUplink : public IPCallStreamBase
+class TMSIPUplink : public TMSIPCallStreamBase
     {
 public:
-    virtual ~TMSVoIPUplink();
+    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 TMSVoIPUplink* NewL(const guint32 codecID,
+    static TMSIPUplink* NewL(const guint32 codecID,
             const TMMFPrioritySettings priority);
-    TMSVoIPUplink();
+    TMSIPUplink();
     void ConstructL(const guint32 codecID,
             const TMMFPrioritySettings priority);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmscallserver/inc/mccpdtmfobserver.h	Fri Apr 16 15:29:42 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 MCCPDTMFOBSERVER_H
+#define MCCPDTMFOBSERVER_H
+
+#include <e32base.h>
+
+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
--- a/mmserv/tms/tmscallserver/inc/mcspdevsoundobserver.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/inc/mcspdevsoundobserver.h	Fri Apr 16 15:29:42 2010 +0300
@@ -25,7 +25,7 @@
  *  successfully ramped up.
  *
  */
-class MCSPDevSoundObserver
+class TMSCSPDevSoundObserver
     {
 public:
     virtual void DownlinkInitCompleted(TInt x) = 0;
--- a/mmserv/tms/tmscallserver/inc/tarsettings.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/inc/tarsettings.h	Fri Apr 16 15:29:42 2010 +0300
@@ -27,7 +27,7 @@
 namespace TMS {
 
 // CLASS DECLARATION
-class TarSettings : public CBase
+class TMSTarSettings
     {
 public:
     // Constructors and destructor
@@ -35,12 +35,12 @@
     /**
      * Two-phased constructor.
      */
-    static TarSettings* NewL();
+    static TMSTarSettings* NewL();
 
     /**
      * Destructor.
      */
-    virtual ~TarSettings();
+    virtual ~TMSTarSettings();
 
 public:
     // New functions
@@ -52,7 +52,7 @@
     /**
      * C++ default constructor.
      */
-    TarSettings();
+    TMSTarSettings();
 
     /**
      * By default Symbian 2nd phase constructor is private.
@@ -60,7 +60,7 @@
     void ConstructL();
 
 private:
-    TInt iVolume; //Volume
+    gint iVolume; //Volume
     };
 
 } //namespace TMS
--- a/mmserv/tms/tmscallserver/inc/tmscallsession.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/inc/tmscallsession.h	Fri Apr 16 15:29:42 2010 +0300
@@ -26,7 +26,7 @@
 
 // FORWARD DECLARATIONS
 class TMSCallServer;
-class CallAdpt;
+class TMSCallAdpt;
 
 /*
  * Class Name:  TMSCallSession
@@ -88,9 +88,13 @@
     void HandleRoutingGetPreviousOutputL(const RMessage2& aMessage);
     void HandleRoutingGetAvailableOutputsL(const RMessage2& aMessage);
 
+    void HandleDTMFStart(const RMessage2& aMessage);
+    void HandleDTMFStop(const RMessage2& aMessage);
+    void HandleDTMFContinue(const RMessage2& aMessage);
+
 private:
     TMSCallServer& iTMSCallServer;
-    CallAdpt* iCallAdpt;
+    TMSCallAdpt* iCallAdpt;
     gint iGlobalVol;
     gint iGlobalGain;
     };
--- a/mmserv/tms/tmscallserver/src/calladpt.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/calladpt.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -24,42 +24,42 @@
 using namespace TMS;
 
 // -----------------------------------------------------------------------------
-// CallAdpt::CallAdpt
+// TMSCallAdpt::TMSCallAdpt
 //
 // -----------------------------------------------------------------------------
 //
-CallAdpt::CallAdpt()
+TMSCallAdpt::TMSCallAdpt()
     {
     TRACE_PRN_FN_ENT;
     TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
-// CallAdpt::~CallAdpt
+// TMSCallAdpt::~TMSCallAdpt
 //
 // -----------------------------------------------------------------------------
 //
-CallAdpt::~CallAdpt()
+TMSCallAdpt::~TMSCallAdpt()
     {
     TRACE_PRN_FN_ENT;
     TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
-// CallAdpt::CreateCallL
+// TMSCallAdpt::CreateCallL
 //
 // -----------------------------------------------------------------------------
 //
-gint CallAdpt::CreateCallL(gint callType, CallAdpt*& callAdpt)
+gint TMSCallAdpt::CreateCallL(gint callType, TMSCallAdpt*& callAdpt)
     {
     TRACE_PRN_FN_ENT;
-    CallAdpt* self(NULL);
+    TMSCallAdpt* self(NULL);
     gint retVal(TMS_RESULT_SUCCESS);
     switch (callType)
         {
         case TMS_CALL_IP:
             retVal = TMS_RESULT_INSUFFICIENT_MEMORY;
-            self = CallIPAdpt::NewL();
+            self = TMSCallIPAdpt::NewL();
             if (self)
                 {
                 retVal = self->PostConstruct();
@@ -73,7 +73,7 @@
 
         case TMS_CALL_CS:
             retVal = TMS_RESULT_INSUFFICIENT_MEMORY;
-            self = new CallCSAdpt();
+            self = new TMSCallCSAdpt();
             if (self)
                 {
                 retVal = self->PostConstruct();
@@ -94,14 +94,12 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallAdpt::PostConstruct
+// TMSCallAdpt::PostConstruct
 //
 // -----------------------------------------------------------------------------
 //
-gint CallAdpt::PostConstruct()
+gint TMSCallAdpt::PostConstruct()
     {
-    TRACE_PRN_FN_ENT;
-    TRACE_PRN_FN_EXT;
     return TMS_RESULT_SUCCESS;
     }
 
--- a/mmserv/tms/tmscallserver/src/callcsadpt.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/callcsadpt.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -26,37 +26,46 @@
 #include "tmsshared.h"
 #include "tmsclientserver.h"
 #include "tarsettings.h"
+#include "cpeaudiodtmftoneplayer.h"
+#include "cspdtmfprovider.h"
+#include "dtmfnotifier.h"
 
 using namespace TMS;
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::CallCSAdpt
+// TMSCallCSAdpt::TMSCallCSAdpt
 //
 // -----------------------------------------------------------------------------
 //
-CallCSAdpt::CallCSAdpt()
+TMSCallCSAdpt::TMSCallCSAdpt()
     {
     TRACE_PRN_FN_ENT;
 
     iCSDownlink = NULL;
     iCSUplink = NULL;
     iRouting = NULL;
+    iDTMFDnlinkPlayer = NULL;
+    iDTMFUplinkPlayer = NULL;
+    iDTMFNotifier = NULL;
 
     TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::~CallCSAdpt
+// TMSCallCSAdpt::~TMSCallCSAdpt
 //
 // -----------------------------------------------------------------------------
 //
-CallCSAdpt::~CallCSAdpt()
+TMSCallCSAdpt::~TMSCallCSAdpt()
     {
     TRACE_PRN_FN_ENT;
     delete iCSDownlink;
     delete iCSUplink;
     delete iRouting;
     delete iTarSettings;
+    delete iDTMFDnlinkPlayer;
+    delete iDTMFUplinkPlayer;
+    delete iDTMFNotifier;
 
     if (iMsgQueueUp.Handle() > 0)
         {
@@ -72,11 +81,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::PostConstruct
+// TMSCallCSAdpt::PostConstruct
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::PostConstruct()
+gint TMSCallCSAdpt::PostConstruct()
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
@@ -89,11 +98,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::CreateStream
+// TMSCallCSAdpt::CreateStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::CreateStream(TMSCallType /*callType*/,
+gint TMSCallCSAdpt::CreateStream(TMSCallType /*callType*/,
         TMSStreamType strmType, gint& outStrmId)
     {
     TRACE_PRN_FN_ENT;
@@ -133,11 +142,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::InitStream
+// TMSCallCSAdpt::InitStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::InitStreamL(TMSCallType /*callType*/,
+gint TMSCallCSAdpt::InitStreamL(TMSCallType /*callType*/,
         TMSStreamType strmType, gint strmId, TMSFormatType /*frmtType*/,
         const RMessage2& aMessage)
     {
@@ -157,7 +166,17 @@
                     }
                 if (status == TMS_RESULT_SUCCESS)
                     {
-                    TRAP(status, iCSUplink = CSUplink::NewL(*this));
+                    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;
                 }
@@ -177,14 +196,25 @@
                     }
                 if (status == TMS_RESULT_SUCCESS)
                     {
-                    TRAP(status, iCSDownlink = CSDownlink::NewL(*this));
+                    TRAP(status, iCSDownlink = TMSCSDownlink::NewL(*this));
                     if (status == TMS_RESULT_SUCCESS)
                         {
                         TRAP(status, iRouting =
                              CTelephonyAudioRouting::NewL(*this));
                         if (status == TMS_RESULT_SUCCESS)
                             {
-                            iTarSettings = TarSettings::NewL();
+                            iTarSettings = TMSTarSettings::NewL();
+                            }
+                        if (status == TMS_RESULT_SUCCESS)
+                            {
+                            TRAP(status, iDTMFDnlinkPlayer =
+                                 TMSAudioDtmfTonePlayer::NewL(*this,
+                                 KAudioPrefKeyDownDTMF,
+                                 KAudioPriorityDtmfKeyPress));
+                            if(!iDTMFNotifier)
+                                {
+                                iDTMFNotifier = TMSDtmfNotifier::NewL();
+                                }
                             }
                         }
                     }
@@ -206,11 +236,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::StartStream
+// TMSCallCSAdpt::StartStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::StartStream(TMSCallType /*callType*/,
+gint TMSCallCSAdpt::StartStream(TMSCallType /*callType*/,
         TMSStreamType strmType, gint strmId)
     {
     TRACE_PRN_FN_ENT;
@@ -238,11 +268,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::PauseStream
+// TMSCallCSAdpt::PauseStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::PauseStream(TMSCallType /*callType*/,
+gint TMSCallCSAdpt::PauseStream(TMSCallType /*callType*/,
         TMSStreamType /*strmType*/, gint /*strmId*/)
     {
     TRACE_PRN_FN_ENT;
@@ -252,11 +282,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::StopStream
+// TMSCallCSAdpt::StopStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::StopStream(TMSCallType /*callType*/, TMSStreamType strmType,
+gint TMSCallCSAdpt::StopStream(TMSCallType /*callType*/, TMSStreamType strmType,
         gint strmId)
     {
     TRACE_PRN_FN_ENT;
@@ -288,11 +318,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::DeinitStream
+// TMSCallCSAdpt::DeinitStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::DeinitStream(TMSCallType /*callType*/,
+gint TMSCallCSAdpt::DeinitStream(TMSCallType /*callType*/,
         TMSStreamType strmType, gint strmId)
     {
     TRACE_PRN_FN_ENT;
@@ -326,11 +356,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::DeleteStream
+// TMSCallCSAdpt::DeleteStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::DeleteStream(TMSCallType /*callType*/,
+gint TMSCallCSAdpt::DeleteStream(TMSCallType /*callType*/,
         TMSStreamType strmType, gint strmId)
     {
     TRACE_PRN_FN_ENT;
@@ -360,11 +390,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::DataXferBufferEmptied
+// TMSCallCSAdpt::DataXferBufferEmptied
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::DataXferBufferEmptied(TMSCallType /*callType*/,
+gint TMSCallCSAdpt::DataXferBufferEmptied(TMSCallType /*callType*/,
         TMSStreamType /*strmType*/, gint /*strmId*/)
     {
     TRACE_PRN_FN_ENT;
@@ -374,11 +404,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::DataXferBufferFilled
+// TMSCallCSAdpt::DataXferBufferFilled
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::DataXferBufferFilled(TMSCallType /*callType*/,
+gint TMSCallCSAdpt::DataXferBufferFilled(TMSCallType /*callType*/,
         TMSStreamType /*strmType*/, gint /*strmId*/, guint /*datasize*/)
     {
     TRACE_PRN_FN_ENT;
@@ -388,11 +418,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetDataXferBufferHndl
+// TMSCallCSAdpt::GetDataXferBufferHndl
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetDataXferBufferHndl(const TMSCallType /*callType*/,
+gint TMSCallCSAdpt::GetDataXferBufferHndl(const TMSCallType /*callType*/,
         const TMSStreamType /*strmType*/, const gint /*strmId*/,
         const guint32 /*key*/, RChunk& /*chunk*/)
     {
@@ -403,11 +433,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetMaxVolume
+// TMSCallCSAdpt::GetMaxVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetMaxVolume(guint& volume)
+gint TMSCallCSAdpt::GetMaxVolume(guint& volume)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_ILLEGAL_OPERATION);
@@ -421,11 +451,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::SetVolume
+// TMSCallCSAdpt::SetVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::SetVolume(const guint volume)
+gint TMSCallCSAdpt::SetVolume(const guint volume)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_ILLEGAL_OPERATION);
@@ -440,11 +470,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetVolume
+// TMSCallCSAdpt::GetVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetVolume(guint& volume)
+gint TMSCallCSAdpt::GetVolume(guint& volume)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_ILLEGAL_OPERATION);
@@ -459,11 +489,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetMaxGain
+// TMSCallCSAdpt::GetMaxGain
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetMaxGain(guint& gain)
+gint TMSCallCSAdpt::GetMaxGain(guint& gain)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_ILLEGAL_OPERATION);
@@ -477,11 +507,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::SetGain
+// TMSCallCSAdpt::SetGain
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::SetGain(const guint gain)
+gint TMSCallCSAdpt::SetGain(const guint gain)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_ILLEGAL_OPERATION);
@@ -496,11 +526,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetGain
+// TMSCallCSAdpt::GetGain
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetGain(guint& gain)
+gint TMSCallCSAdpt::GetGain(guint& gain)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_ILLEGAL_OPERATION);
@@ -514,11 +544,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetGlobalMaxVolume
+// TMSCallCSAdpt::GetGlobalMaxVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetGlobalMaxVolume(guint& volume)
+gint TMSCallCSAdpt::GetGlobalMaxVolume(guint& volume)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_ILLEGAL_OPERATION);
@@ -532,11 +562,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::SetGlobalVolume
+// TMSCallCSAdpt::SetGlobalVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::SetGlobalVolume(const guint volume)
+gint TMSCallCSAdpt::SetGlobalVolume(const guint volume)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
@@ -552,11 +582,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetGlobalVolume
+// TMSCallCSAdpt::GetGlobalVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetGlobalVolume(guint& volume)
+gint TMSCallCSAdpt::GetGlobalVolume(guint& volume)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_ILLEGAL_OPERATION);
@@ -571,11 +601,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetMaxGain
+// TMSCallCSAdpt::GetMaxGain
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetGlobalMaxGain(guint& gain)
+gint TMSCallCSAdpt::GetGlobalMaxGain(guint& gain)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_ILLEGAL_OPERATION);
@@ -589,11 +619,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::SetGain
+// TMSCallCSAdpt::SetGain
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::SetGlobalGain(const guint gain)
+gint TMSCallCSAdpt::SetGlobalGain(const guint gain)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
@@ -609,11 +639,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetGlobalGain
+// TMSCallCSAdpt::GetGlobalGain
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetGlobalGain(guint& gain)
+gint TMSCallCSAdpt::GetGlobalGain(guint& gain)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_ILLEGAL_OPERATION);
@@ -627,11 +657,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetCodecMode
+// TMSCallCSAdpt::GetCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetCodecMode(const TMSFormatType /*fmttype*/,
+gint TMSCallCSAdpt::GetCodecMode(const TMSFormatType /*fmttype*/,
         const TMSStreamType /*strmtype*/, gint& /*mode*/)
     {
     TRACE_PRN_FN_ENT;
@@ -641,11 +671,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::SetCodecMode
+// TMSCallCSAdpt::SetCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::SetCodecMode(const TMSFormatType /*fmttype*/,
+gint TMSCallCSAdpt::SetCodecMode(const TMSFormatType /*fmttype*/,
         const TMSStreamType /*strmtype*/, const gint /*mode*/)
     {
     TRACE_PRN_FN_ENT;
@@ -655,11 +685,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetSupportedBitRatesCount
+// TMSCallCSAdpt::GetSupportedBitRatesCount
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetSupportedBitRatesCount(guint& /*count*/)
+gint TMSCallCSAdpt::GetSupportedBitRatesCount(guint& /*count*/)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
@@ -668,11 +698,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetSupportedBitRates
+// TMSCallCSAdpt::GetSupportedBitRates
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetSupportedBitRates(CBufFlat*& brbuffer)
+gint TMSCallCSAdpt::GetSupportedBitRates(CBufFlat*& brbuffer)
     {
     TRACE_PRN_FN_ENT;
     TRAPD(status, GetSupportedBitRatesL(brbuffer));
@@ -681,22 +711,22 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetSupportedBitRatesL
+// TMSCallCSAdpt::GetSupportedBitRatesL
 //
 // GetSupportedBitRates implementation which can leave.
 // -----------------------------------------------------------------------------
 //
-void CallCSAdpt::GetSupportedBitRatesL(CBufFlat*& /*brbuffer*/)
+void TMSCallCSAdpt::GetSupportedBitRatesL(CBufFlat*& /*brbuffer*/)
     {
     User::Leave(TMS_RESULT_FEATURE_NOT_SUPPORTED);
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetBitRate
+// TMSCallCSAdpt::GetBitRate
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetBitRate(guint& /*bitrate*/)
+gint TMSCallCSAdpt::GetBitRate(guint& /*bitrate*/)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
@@ -705,11 +735,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::SetBitRate
+// TMSCallCSAdpt::SetBitRate
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::SetBitRate(const guint /*bitrate*/)
+gint TMSCallCSAdpt::SetBitRate(const guint /*bitrate*/)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
@@ -718,11 +748,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetVAD
+// TMSCallCSAdpt::GetVAD
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetVAD(const TMSFormatType /*fmttype*/, gboolean& /*vad*/)
+gint TMSCallCSAdpt::GetVAD(const TMSFormatType /*fmttype*/, gboolean& /*vad*/)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
@@ -731,11 +761,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::SetVAD
+// TMSCallCSAdpt::SetVAD
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::SetVAD(const TMSFormatType /*fmttype*/, const gboolean /*vad*/)
+gint TMSCallCSAdpt::SetVAD(const TMSFormatType /*fmttype*/, const gboolean /*vad*/)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
@@ -744,11 +774,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetCNG
+// TMSCallCSAdpt::GetCNG
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetCNG(const TMSFormatType /*fmttype*/, gboolean& /*cng*/)
+gint TMSCallCSAdpt::GetCNG(const TMSFormatType /*fmttype*/, gboolean& /*cng*/)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
@@ -757,11 +787,12 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::SetCNG
+// TMSCallCSAdpt::SetCNG
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::SetCNG(const TMSFormatType /*fmttype*/, const gboolean /*cng*/)
+gint TMSCallCSAdpt::SetCNG(const TMSFormatType /*fmttype*/,
+        const gboolean /*cng*/)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
@@ -770,11 +801,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetPlc
+// TMSCallCSAdpt::GetPlc
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetPlc(const TMSFormatType /*fmttype*/, gboolean& /*plc*/)
+gint TMSCallCSAdpt::GetPlc(const TMSFormatType /*fmttype*/, gboolean& /*plc*/)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
@@ -783,11 +814,12 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::SetPlc
+// TMSCallCSAdpt::SetPlc
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::SetPlc(const TMSFormatType /*fmttype*/, const gboolean /*plc*/)
+gint TMSCallCSAdpt::SetPlc(const TMSFormatType /*fmttype*/,
+        const gboolean /*plc*/)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
@@ -796,11 +828,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::SetOutput
+// TMSCallCSAdpt::SetOutput
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::SetOutput(TMSAudioOutput output)
+gint TMSCallCSAdpt::SetOutput(TMSAudioOutput output)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
@@ -824,11 +856,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetOutput
+// TMSCallCSAdpt::GetOutput
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetOutput(TMSAudioOutput& output)
+gint TMSCallCSAdpt::GetOutput(TMSAudioOutput& output)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
@@ -846,11 +878,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetPreviousOutput
+// TMSCallCSAdpt::GetPreviousOutput
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetPreviousOutput(TMSAudioOutput& output)
+gint TMSCallCSAdpt::GetPreviousOutput(TMSAudioOutput& output)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
@@ -867,11 +899,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::GetAvailableOutputsL
+// TMSCallCSAdpt::GetAvailableOutputsL
 //
 // -----------------------------------------------------------------------------
 //
-gint CallCSAdpt::GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuffer)
+gint TMSCallCSAdpt::GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuffer)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
@@ -903,15 +935,205 @@
     return status;
     }
 
+// -----------------------------------------------------------------------------
+// TMSCallCSAdpt::StartDTMF
+//
+// -----------------------------------------------------------------------------
+//
+gint TMSCallCSAdpt::StartDTMF(TMSStreamType strmtype, TDes& dtmfstring)
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_SUCCESS);
 
-// From MCSPDevSoundObserver
+    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;
+    }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::DownlinkInitCompleted
+// 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 CallCSAdpt::DownlinkInitCompleted(TInt status)
+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);
@@ -919,11 +1141,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::UplinkInitCompleted
+// TMSCallCSAdpt::UplinkInitCompleted
 //
 // -----------------------------------------------------------------------------
 //
-void CallCSAdpt::UplinkInitCompleted(TInt status)
+void TMSCallCSAdpt::UplinkInitCompleted(TInt status)
     {
     TRACE_PRN_FN_ENT;
     NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status, 0);
@@ -931,11 +1153,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::UplinkActivatedSuccessfully
+// TMSCallCSAdpt::UplinkActivatedSuccessfully
 //
 // -----------------------------------------------------------------------------
 //
-void CallCSAdpt::UplinkActivatedSuccessfully()
+void TMSCallCSAdpt::UplinkActivatedSuccessfully()
     {
     TRACE_PRN_FN_ENT;
     NotifyClient(iUplinkStreamId, ECmdUplinkStarted, KErrNone, 0);
@@ -943,11 +1165,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::DownlinkActivatedSuccessfully
+// TMSCallCSAdpt::DownlinkActivatedSuccessfully
 //
 // -----------------------------------------------------------------------------
 //
-void CallCSAdpt::DownlinkActivatedSuccessfully()
+void TMSCallCSAdpt::DownlinkActivatedSuccessfully()
     {
     TRACE_PRN_FN_ENT;
     NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, KErrNone, 0);
@@ -955,11 +1177,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::UplinkActivationFailed
+// TMSCallCSAdpt::UplinkActivationFailed
 //
 // -----------------------------------------------------------------------------
 //
-void CallCSAdpt::UplinkActivationFailed()
+void TMSCallCSAdpt::UplinkActivationFailed()
     {
     TRACE_PRN_FN_ENT;
     NotifyClient(iUplinkStreamId, ECmdUplinkStarted, TMS_RESULT_FATAL_ERROR, 0);
@@ -967,11 +1189,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::DownlinkActivationFailed
+// TMSCallCSAdpt::DownlinkActivationFailed
 //
 // -----------------------------------------------------------------------------
 //
-void CallCSAdpt::DownlinkActivationFailed()
+void TMSCallCSAdpt::DownlinkActivationFailed()
     {
     TRACE_PRN_FN_ENT;
     NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted,
@@ -980,11 +1202,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::AvailableOutputsChanged
+// TMSCallCSAdpt::AvailableOutputsChanged
 //
 // -----------------------------------------------------------------------------
 //
-void CallCSAdpt::AvailableOutputsChanged(
+void TMSCallCSAdpt::AvailableOutputsChanged(
         CTelephonyAudioRouting& /*aTelephonyAudioRouting*/)
     {
     TRACE_PRN_FN_ENT;
@@ -995,11 +1217,12 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::OutputChanged
+// TMSCallCSAdpt::OutputChanged
 //
 // -----------------------------------------------------------------------------
 //
-void CallCSAdpt::OutputChanged(CTelephonyAudioRouting& aTelephonyAudioRouting)
+void TMSCallCSAdpt::OutputChanged(
+        CTelephonyAudioRouting& aTelephonyAudioRouting)
     {
     TRACE_PRN_FN_ENT;
     TRoutingMsgBufPckg pckg;
@@ -1010,11 +1233,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::SetOutputComplete
+// TMSCallCSAdpt::SetOutputComplete
 //
 // -----------------------------------------------------------------------------
 //
-void CallCSAdpt::SetOutputComplete(
+void TMSCallCSAdpt::SetOutputComplete(
         CTelephonyAudioRouting& aTelephonyAudioRouting, gint /*aError*/)
     {
     TRACE_PRN_FN_ENT;
@@ -1030,11 +1253,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallCSAdpt::NotifyClient
+// TMSCallCSAdpt::NotifyClient
 //
 // -----------------------------------------------------------------------------
 //
-void CallCSAdpt::NotifyClient(const gint strmId, const gint aCommand,
+void TMSCallCSAdpt::NotifyClient(const gint strmId, const gint aCommand,
         const gint aStatus, const gint64 /*aInt64*/)
     {
     iMsgBuffer.iRequest = aCommand;
--- a/mmserv/tms/tmscallserver/src/callipadpt.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/callipadpt.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -25,13 +25,13 @@
 using namespace TMS;
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::NewL
+// TMSCallIPAdpt::NewL
 // Symbian constructor.
 // -----------------------------------------------------------------------------
 //
-CallIPAdpt* CallIPAdpt::NewL()
+TMSCallIPAdpt* TMSCallIPAdpt::NewL()
     {
-    CallIPAdpt* self = new (ELeave) CallIPAdpt();
+    TMSCallIPAdpt* self = new (ELeave) TMSCallIPAdpt();
     CleanupStack::PushL(self);
     self->ConstructL();
     CleanupStack::Pop(self);
@@ -39,42 +39,47 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::ConstructL
+// TMSCallIPAdpt::ConstructL
 // 2-nd phase constructor.
 // -----------------------------------------------------------------------------
 //
-void CallIPAdpt::ConstructL()
+void TMSCallIPAdpt::ConstructL()
     {
     TRACE_PRN_FN_ENT;
-    iVoIPUplink = NULL;
-    iVoIPDownlink = NULL;
+    iIPUplink = NULL;
+    iIPDownlink = NULL;
+    iDTMFDnlinkPlayer = NULL;
+    iDTMFUplinkPlayer = NULL;
+    iDTMFNotifier = NULL;
     TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::CallIPAdpt
+// TMSCallIPAdpt::TMSCallIPAdpt
 //
 // -----------------------------------------------------------------------------
 //
-CallIPAdpt::CallIPAdpt()
+TMSCallIPAdpt::TMSCallIPAdpt()
     {
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::~CallIPAdpt
+// TMSCallIPAdpt::~TMSCallIPAdpt
 //
 // -----------------------------------------------------------------------------
 //
-CallIPAdpt::~CallIPAdpt()
+TMSCallIPAdpt::~TMSCallIPAdpt()
     {
     TRACE_PRN_FN_ENT;
 
     iCodecs.Reset();
     iCodecs.Close();
     iArrBitrates.Reset();
-
-    delete iVoIPUplink;
-    delete iVoIPDownlink;
+    delete iDTMFUplinkPlayer;
+    delete iDTMFDnlinkPlayer;
+    delete iDTMFNotifier;
+    delete iIPUplink;
+    delete iIPDownlink;
 
     if (iMsgQueueUp.Handle() > 0)
         {
@@ -89,11 +94,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::PostConstruct
+// TMSCallIPAdpt::PostConstruct
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::PostConstruct()
+gint TMSCallIPAdpt::PostConstruct()
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
@@ -106,11 +111,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::CreateStream
+// TMSCallIPAdpt::CreateStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::CreateStream(TMSCallType /*callType*/,
+gint TMSCallIPAdpt::CreateStream(TMSCallType /*callType*/,
         TMSStreamType strmType, gint& outStrmId)
     {
     TRACE_PRN_FN_ENT;
@@ -154,11 +159,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::InitStream
+// TMSCallIPAdpt::InitStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::InitStreamL(TMSCallType /*callType*/,
+gint TMSCallIPAdpt::InitStreamL(TMSCallType /*callType*/,
         TMSStreamType strmType, gint strmId, TMSFormatType frmtType,
         const RMessage2& aMessage)
     {
@@ -180,6 +185,16 @@
                 {
                 SetFormat(iUplinkStreamId, fourCC);
                 status = OpenUplinkL(aMessage);
+
+                iDTMFUplinkPlayer = TMSAudioDtmfTonePlayer::NewL(*this,
+                        KAudioPrefUnknownVoipAudioUplink,
+                        KAudioPriorityUnknownVoipAudioUplink);
+
+                if(!iDTMFNotifier)
+                    {
+                    iDTMFNotifier = TMSDtmfNotifier::NewL();
+                    }
+
                 NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
                 }
             break;
@@ -191,6 +206,16 @@
                 {
                 SetFormat(iDnlinkStreamId, fourCC);
                 status = OpenDownlinkL(aMessage);
+
+                iDTMFDnlinkPlayer = TMSAudioDtmfTonePlayer::NewL(*this,
+                        KAudioPrefUnknownVoipAudioDownlink,
+                        KAudioPriorityUnknownVoipAudioDownlink);
+
+                if(!iDTMFNotifier)
+                    {
+                    iDTMFNotifier = TMSDtmfNotifier::NewL();
+                    }
+
                 NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status);
                 }
             break;
@@ -208,12 +233,12 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::StartStream
+// TMSCallIPAdpt::StartStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::StartStream(TMSCallType /*callType*/, TMSStreamType strmType,
-        gint strmId)
+gint TMSCallIPAdpt::StartStream(TMSCallType /*callType*/,
+        TMSStreamType strmType, gint strmId)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
@@ -221,9 +246,9 @@
         {
         case TMS_STREAM_UPLINK:
             {
-            if (strmId == iUplinkStreamId && iVoIPUplink)
+            if (strmId == iUplinkStreamId && iIPUplink)
                 {
-                iVoIPUplink->Start();
+                iIPUplink->Start();
                 status = TMS_RESULT_SUCCESS;
                 NotifyClient(iUplinkStreamId, ECmdUplinkStarted, status);
                 }
@@ -231,9 +256,9 @@
             }
         case TMS_STREAM_DOWNLINK:
             {
-            if (strmId == iDnlinkStreamId && iVoIPDownlink)
+            if (strmId == iDnlinkStreamId && iIPDownlink)
                 {
-                iVoIPDownlink->Start();
+                iIPDownlink->Start();
                 status = TMS_RESULT_SUCCESS;
                 NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, status);
                 }
@@ -250,12 +275,12 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::PauseStream
+// TMSCallIPAdpt::PauseStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::PauseStream(TMSCallType /*callType*/, TMSStreamType strmType,
-        gint strmId)
+gint TMSCallIPAdpt::PauseStream(TMSCallType /*callType*/,
+        TMSStreamType strmType, gint strmId)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
@@ -263,9 +288,9 @@
         {
         case TMS_STREAM_UPLINK:
             {
-            if (strmId == iUplinkStreamId && iVoIPUplink)
+            if (strmId == iUplinkStreamId && iIPUplink)
                 {
-                iVoIPUplink->Stop();
+                iIPUplink->Stop();
                 status = TMS_RESULT_SUCCESS;
                 NotifyClient(iUplinkStreamId, ECmdUplinkPaused, status);
                 }
@@ -273,9 +298,9 @@
             }
         case TMS_STREAM_DOWNLINK:
             {
-            if (strmId == iDnlinkStreamId && iVoIPDownlink)
+            if (strmId == iDnlinkStreamId && iIPDownlink)
                 {
-                iVoIPDownlink->Stop();
+                iIPDownlink->Stop();
                 status = TMS_RESULT_SUCCESS;
                 NotifyClient(iDnlinkStreamId, ECmdDownlinkPaused, status);
                 }
@@ -292,11 +317,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::StopStream
+// TMSCallIPAdpt::StopStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::StopStream(TMSCallType /*callType*/, TMSStreamType strmType,
+gint TMSCallIPAdpt::StopStream(TMSCallType /*callType*/, TMSStreamType strmType,
         gint strmId)
     {
     TRACE_PRN_FN_ENT;
@@ -306,9 +331,9 @@
         {
         case TMS_STREAM_UPLINK:
             {
-            if (strmId == iUplinkStreamId && iVoIPUplink)
+            if (strmId == iUplinkStreamId && iIPUplink)
                 {
-                iVoIPUplink->Stop();
+                iIPUplink->Stop();
                 status = TMS_RESULT_SUCCESS;
                 NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
                 }
@@ -316,9 +341,9 @@
             }
         case TMS_STREAM_DOWNLINK:
             {
-            if (strmId == iDnlinkStreamId && iVoIPDownlink)
+            if (strmId == iDnlinkStreamId && iIPDownlink)
                 {
-                iVoIPDownlink->Stop();
+                iIPDownlink->Stop();
                 status = TMS_RESULT_SUCCESS;
                 NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status);
                 }
@@ -335,12 +360,12 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::DeinitStream
+// TMSCallIPAdpt::DeinitStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::DeinitStream(TMSCallType /*callType*/, TMSStreamType strmType,
-        gint strmId)
+gint TMSCallIPAdpt::DeinitStream(TMSCallType /*callType*/,
+        TMSStreamType strmType, gint strmId)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
@@ -349,9 +374,9 @@
         {
         case TMS_STREAM_UPLINK:
             {
-            if (strmId == iUplinkStreamId && iVoIPUplink)
+            if (strmId == iUplinkStreamId && iIPUplink)
                 {
-                iVoIPUplink->Stop();
+                iIPUplink->Stop();
                 //iUplinkStreamId = -1;
                 iUplinkInitialized = FALSE;
                 status = TMS_RESULT_SUCCESS;
@@ -362,9 +387,9 @@
             }
         case TMS_STREAM_DOWNLINK:
             {
-            if (strmId == iDnlinkStreamId && iVoIPDownlink)
+            if (strmId == iDnlinkStreamId && iIPDownlink)
                 {
-                iVoIPDownlink->Stop();
+                iIPDownlink->Stop();
                 //iDnlinkStreamId = -1;
                 iDnlinkInitialized = FALSE;
                 status = TMS_RESULT_SUCCESS;
@@ -385,11 +410,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::DeleteStream
+// TMSCallIPAdpt::DeleteStream
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::DeleteStream(TMSCallType /*callType*/,
+gint TMSCallIPAdpt::DeleteStream(TMSCallType /*callType*/,
         TMSStreamType strmType, gint strmId)
     {
     TRACE_PRN_FN_ENT;
@@ -427,11 +452,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::DataXferBufferEmptied
+// TMSCallIPAdpt::DataXferBufferEmptied
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::DataXferBufferEmptied(TMSCallType /*callType*/,
+gint TMSCallIPAdpt::DataXferBufferEmptied(TMSCallType /*callType*/,
         TMSStreamType strmType, gint strmId)
     {
     TRACE_PRN_FN_ENT;
@@ -458,11 +483,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::DataXferBufferFilled
+// TMSCallIPAdpt::DataXferBufferFilled
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::DataXferBufferFilled(TMSCallType /*callType*/,
+gint TMSCallIPAdpt::DataXferBufferFilled(TMSCallType /*callType*/,
         TMSStreamType strmType, gint strmId, guint datasize)
     {
     TRACE_PRN_FN_ENT;
@@ -487,11 +512,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetDataXferBufferHndl
+// TMSCallIPAdpt::GetDataXferBufferHndl
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetDataXferBufferHndl(const TMSCallType /*callType*/,
+gint TMSCallIPAdpt::GetDataXferBufferHndl(const TMSCallType /*callType*/,
         const TMSStreamType strmType, const gint strmId, const guint32 key,
         RChunk& chunk)
     {
@@ -524,20 +549,20 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetMaxVolume
+// TMSCallIPAdpt::GetMaxVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetMaxVolume(guint& volume)
+gint TMSCallIPAdpt::GetMaxVolume(guint& volume)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
 
-    if (iDnlinkInitialized && iVoIPDownlink)
+    if (iDnlinkInitialized && iIPDownlink)
         {
-        status = iVoIPDownlink->GetMaxVolume(volume);
+        status = iIPDownlink->GetMaxVolume(volume);
         iMaxVolume = volume;
-        TRACE_PRN_N1(_L("TMS->CallIPAdpt: GetMaxVolume [%d]"), iMaxVolume);
+        TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: GetMaxVolume [%d]"), iMaxVolume);
         }
 
     TRACE_PRN_FN_EXT;
@@ -545,17 +570,17 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::SetVolume
+// TMSCallIPAdpt::SetVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::SetVolume(const guint volume)
+gint TMSCallIPAdpt::SetVolume(const guint volume)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iDnlinkInitialized && iVoIPDownlink)
+    if (iDnlinkInitialized && iIPDownlink)
         {
-        status = iVoIPDownlink->SetVolume(volume);
+        status = iIPDownlink->SetVolume(volume);
         NotifyClient(iDnlinkStreamId, ECmdSetVolume, status);
         }
     TRACE_PRN_FN_EXT;
@@ -563,53 +588,53 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetVolume
+// TMSCallIPAdpt::GetVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetVolume(guint& volume)
+gint TMSCallIPAdpt::GetVolume(guint& volume)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iDnlinkInitialized && iVoIPDownlink)
+    if (iDnlinkInitialized && iIPDownlink)
         {
-        status = iVoIPDownlink->GetVolume(volume);
+        status = iIPDownlink->GetVolume(volume);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetMaxGain
+// TMSCallIPAdpt::GetMaxGain
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetMaxGain(guint& gain)
+gint TMSCallIPAdpt::GetMaxGain(guint& gain)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iUplinkInitialized && iVoIPUplink)
+    if (iUplinkInitialized && iIPUplink)
         {
-        status = iVoIPUplink->GetMaxGain(gain);
+        status = iIPUplink->GetMaxGain(gain);
         iMaxGain = gain;
-        TRACE_PRN_N1(_L("TMS->CallIPAdpt::GetMaxGain [%d]"), iMaxGain);
+        TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetMaxGain [%d]"), iMaxGain);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::SetGain
+// TMSCallIPAdpt::SetGain
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::SetGain(const guint gain)
+gint TMSCallIPAdpt::SetGain(const guint gain)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iUplinkInitialized && iVoIPUplink)
+    if (iUplinkInitialized && iIPUplink)
         {
-        status = iVoIPUplink->SetGain(gain);
+        status = iIPUplink->SetGain(gain);
         NotifyClient(iUplinkStreamId, ECmdSetGain, status);
         }
     TRACE_PRN_FN_EXT;
@@ -617,134 +642,134 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetGain
+// TMSCallIPAdpt::GetGain
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetGain(guint& gain)
+gint TMSCallIPAdpt::GetGain(guint& gain)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iUplinkInitialized && iVoIPUplink)
+    if (iUplinkInitialized && iIPUplink)
         {
-        status = iVoIPUplink->GetGain(gain);
+        status = iIPUplink->GetGain(gain);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetGlobalMaxVolume
+// TMSCallIPAdpt::GetGlobalMaxVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetGlobalMaxVolume(guint& volume)
+gint TMSCallIPAdpt::GetGlobalMaxVolume(guint& volume)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iDnlinkInitialized && iVoIPDownlink)
+    if (iDnlinkInitialized && iIPDownlink)
         {
-        status = iVoIPDownlink->GetMaxVolume(volume);
+        status = iIPDownlink->GetMaxVolume(volume);
         iMaxVolume = volume;
-        TRACE_PRN_N1(_L("TMS->CallIPAdpt: GetMaxVolume [%d]"), iMaxVolume);
+        TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: GetMaxVolume [%d]"), iMaxVolume);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::SetGlobalVolume
+// TMSCallIPAdpt::SetGlobalVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::SetGlobalVolume(const guint volume)
+gint TMSCallIPAdpt::SetGlobalVolume(const guint volume)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iDnlinkInitialized && iVoIPDownlink)
+    if (iDnlinkInitialized && iIPDownlink)
         {
-        status = iVoIPDownlink->SetVolume(volume);
+        status = iIPDownlink->SetVolume(volume);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetGlobalVolume
+// TMSCallIPAdpt::GetGlobalVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetGlobalVolume(guint& volume)
+gint TMSCallIPAdpt::GetGlobalVolume(guint& volume)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iDnlinkInitialized && iVoIPDownlink)
+    if (iDnlinkInitialized && iIPDownlink)
         {
-        status = iVoIPDownlink->GetVolume(volume);
+        status = iIPDownlink->GetVolume(volume);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetGlobalMaxGain
+// TMSCallIPAdpt::GetGlobalMaxGain
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetGlobalMaxGain(guint& gain)
+gint TMSCallIPAdpt::GetGlobalMaxGain(guint& gain)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iUplinkInitialized && iVoIPUplink)
+    if (iUplinkInitialized && iIPUplink)
         {
-        status = iVoIPUplink->GetMaxGain(gain);
+        status = iIPUplink->GetMaxGain(gain);
         iMaxGain = gain;
-        TRACE_PRN_N1(_L("TMS->CallIPAdpt::GetMaxGain [%d]"), iMaxGain);
+        TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetMaxGain [%d]"), iMaxGain);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::SetGlobalGain
+// TMSCallIPAdpt::SetGlobalGain
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::SetGlobalGain(const guint gain)
+gint TMSCallIPAdpt::SetGlobalGain(const guint gain)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iUplinkInitialized && iVoIPUplink)
+    if (iUplinkInitialized && iIPUplink)
         {
-        status = iVoIPUplink->SetGain(gain);
+        status = iIPUplink->SetGain(gain);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetGlobalGain
+// TMSCallIPAdpt::GetGlobalGain
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetGlobalGain(guint& gain)
+gint TMSCallIPAdpt::GetGlobalGain(guint& gain)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iUplinkInitialized && iVoIPUplink)
+    if (iUplinkInitialized && iIPUplink)
         {
-        status = iVoIPUplink->GetGain(gain);
+        status = iIPUplink->GetGain(gain);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetCodecMode
+// TMSCallIPAdpt::GetCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetCodecMode(const TMSFormatType fmttype,
+gint TMSCallIPAdpt::GetCodecMode(const TMSFormatType fmttype,
         const TMSStreamType strmtype, gint& mode)
     {
     TRACE_PRN_FN_ENT;
@@ -766,11 +791,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::SetCodecMode
+// TMSCallIPAdpt::SetCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::SetCodecMode(const TMSFormatType fmttype,
+gint TMSCallIPAdpt::SetCodecMode(const TMSFormatType fmttype,
         const TMSStreamType strmtype, const gint mode)
     {
     TRACE_PRN_FN_ENT;
@@ -792,17 +817,17 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetSupportedBitRatesCount
+// TMSCallIPAdpt::GetSupportedBitRatesCount
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetSupportedBitRatesCount(guint& count)
+gint TMSCallIPAdpt::GetSupportedBitRatesCount(guint& count)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iVoIPUplink)
+    if (iIPUplink)
         {
-        status = iVoIPUplink->GetSupportedBitrates(iArrBitrates);
+        status = iIPUplink->GetSupportedBitrates(iArrBitrates);
         count = iArrBitrates.Count();
         }
     TRACE_PRN_FN_EXT;
@@ -810,26 +835,26 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetSupportedBitRates
+// 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 CallIPAdpt::GetSupportedBitRates(CBufFlat*& brbuffer)
+gint TMSCallIPAdpt::GetSupportedBitRates(CBufFlat*& brbuffer)
     {
     TRAPD(status, GetSupportedBitRatesL(brbuffer));
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetSupportedBitRatesL
+// TMSCallIPAdpt::GetSupportedBitRatesL
 //
 // GetSupportedBitRates implementation which can leave.
 // -----------------------------------------------------------------------------
 //
-void CallIPAdpt::GetSupportedBitRatesL(CBufFlat*& brbuffer)
+void TMSCallIPAdpt::GetSupportedBitRatesL(CBufFlat*& brbuffer)
     {
     TRACE_PRN_FN_ENT;
     RBufWriteStream stream;
@@ -840,7 +865,7 @@
     for (guint i = 0; i < numOfItems; i++)
         {
         stream.WriteUint32L(iArrBitrates[i]);
-        //TRACE_PRN_N1(_L("TMS->CallIPAdpt: BR: [%d]"), iArrBitrates[i]);
+        //TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: BR: [%d]"), iArrBitrates[i]);
         }
 
     CleanupStack::PopAndDestroy(&stream);
@@ -848,162 +873,163 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetBitRate
+// TMSCallIPAdpt::GetBitRate
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetBitRate(guint& bitrate)
+gint TMSCallIPAdpt::GetBitRate(guint& bitrate)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iVoIPUplink)
+    if (iIPUplink)
         {
-        status = iVoIPUplink->GetBitrate(bitrate);
+        status = iIPUplink->GetBitrate(bitrate);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::SetBitRate
+// TMSCallIPAdpt::SetBitRate
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::SetBitRate(const guint bitrate)
+gint TMSCallIPAdpt::SetBitRate(const guint bitrate)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iVoIPUplink)
+    if (iIPUplink)
         {
-        status = iVoIPUplink->SetBitrate(bitrate);
+        status = iIPUplink->SetBitrate(bitrate);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetVAD
+// TMSCallIPAdpt::GetVAD
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetVAD(const TMSFormatType fmttype, gboolean& vad)
+gint TMSCallIPAdpt::GetVAD(const TMSFormatType fmttype, gboolean& vad)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iVoIPUplink)
+    if (iIPUplink)
         {
-        status = iVoIPUplink->GetVad(fmttype, vad);
+        status = iIPUplink->GetVad(fmttype, vad);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::SetVAD
+// TMSCallIPAdpt::SetVAD
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::SetVAD(const TMSFormatType fmttype, const gboolean vad)
+gint TMSCallIPAdpt::SetVAD(const TMSFormatType fmttype, const gboolean vad)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iVoIPUplink)
+    if (iIPUplink)
         {
-        status = iVoIPUplink->SetVad(fmttype, vad);
+        status = iIPUplink->SetVad(fmttype, vad);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetCNG
+// TMSCallIPAdpt::GetCNG
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetCNG(const TMSFormatType fmttype, gboolean& cng)
+gint TMSCallIPAdpt::GetCNG(const TMSFormatType fmttype, gboolean& cng)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iVoIPDownlink)
+    if (iIPDownlink)
         {
-        status = iVoIPDownlink->GetCng(fmttype, cng);
+        status = iIPDownlink->GetCng(fmttype, cng);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::SetCNG
+// TMSCallIPAdpt::SetCNG
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::SetCNG(const TMSFormatType fmttype, const gboolean cng)
+gint TMSCallIPAdpt::SetCNG(const TMSFormatType fmttype, const gboolean cng)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iVoIPDownlink)
+    if (iIPDownlink)
         {
-        status = iVoIPDownlink->SetCng(fmttype, cng);
+        status = iIPDownlink->SetCng(fmttype, cng);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetPlc
+// TMSCallIPAdpt::GetPlc
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetPlc(const TMSFormatType fmttype, gboolean& plc)
+gint TMSCallIPAdpt::GetPlc(const TMSFormatType fmttype, gboolean& plc)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iVoIPDownlink)
+    if (iIPDownlink)
         {
-        status = iVoIPDownlink->GetPlc(fmttype, plc);
+        status = iIPDownlink->GetPlc(fmttype, plc);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::SetPlc
+// TMSCallIPAdpt::SetPlc
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::SetPlc(const TMSFormatType fmttype, const gboolean plc)
+gint TMSCallIPAdpt::SetPlc(const TMSFormatType fmttype, const gboolean plc)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iVoIPDownlink)
+    if (iIPDownlink)
         {
-        status = iVoIPDownlink->SetPlc(fmttype, plc);
+        status = iIPDownlink->SetPlc(fmttype, plc);
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::OpenDownlinkL
+// TMSCallIPAdpt::OpenDownlinkL
 // Method for player initialization.
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::OpenDownlinkL(const RMessage2& aMessage)
+gint TMSCallIPAdpt::OpenDownlinkL(const RMessage2& aMessage)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
 
-    // Ensure clients have MultimediaDD capability to use this priority/pref
-    // TODO: TMS must monitor for emergency call now
-    iPriority.iPref = TMdaPriorityPreference(KAudioPrefVoipAudioDownlink);
-    iPriority.iPriority = TMdaPriority(KAudioPriorityVoipAudioDownlink);
+    // 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 (!iVoIPDownlink)
+    if (!iIPDownlink)
         {
-        iVoIPDownlink = TMSVoIPDownlink::NewL(iDnFourCC, iPriority);
+        iIPDownlink = TMSIPDownlink::NewL(iDnFourCC, iPriority);
         }
 
-    if (iVoIPDownlink)
+    if (iIPDownlink)
         {
         // Open message queue for handling server notifications to the client
         if (iMsgQueueDn.Handle() <= 0)
@@ -1015,7 +1041,7 @@
         if (status == TMS_RESULT_SUCCESS)
             {
             // For transfer data buffer processing
-            iVoIPDownlink->SetMsgQueue(iMsgQueueDn);
+            iIPDownlink->SetMsgQueue(iMsgQueueDn);
             }
         }
 
@@ -1025,25 +1051,25 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::OpenUplinkL
+// TMSCallIPAdpt::OpenUplinkL
 // Method for recorder initialization.
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::OpenUplinkL(const RMessage2& aMessage)
+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 = TMdaPriorityPreference(KAudioPrefVoipAudioUplink);
-    iPriority.iPriority = TMdaPriority(KAudioPriorityVoipAudioUplink);
+    iPriority.iPref = KAudioPrefVoipAudioUplink;
+    iPriority.iPriority = KAudioPriorityVoipAudioUplink;
 
-    if (!iVoIPUplink)
+    if (!iIPUplink)
         {
-        iVoIPUplink = TMSVoIPUplink::NewL(iUpFourCC, iPriority);
+        iIPUplink = TMSIPUplink::NewL(iUpFourCC, iPriority);
         }
 
-    if (iVoIPUplink)
+    if (iIPUplink)
         {
         // Open message queue for handling server notifications to the client
         if (iMsgQueueUp.Handle() <= 0)
@@ -1055,7 +1081,7 @@
         if (status == TMS_RESULT_SUCCESS)
             {
             // For transfer data buffer processing
-            iVoIPUplink->SetMsgQueue(iMsgQueueUp);
+            iIPUplink->SetMsgQueue(iMsgQueueUp);
             }
         }
 
@@ -1065,11 +1091,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::SetFormat
+// TMSCallIPAdpt::SetFormat
 //
 // -----------------------------------------------------------------------------
 //
-void CallIPAdpt::SetFormat(const gint strmId, const TUint32 aFormat)
+void TMSCallIPAdpt::SetFormat(const gint strmId, const TUint32 aFormat)
     {
     if (strmId == iUplinkStreamId)
         {
@@ -1082,37 +1108,37 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::BufferFilled
+// TMSCallIPAdpt::BufferFilled
 //
 // -----------------------------------------------------------------------------
 //
-void CallIPAdpt::BufferFilledL(TUint dataSize)
+void TMSCallIPAdpt::BufferFilledL(TUint dataSize)
     {
-    if (iVoIPDownlink)
+    if (iIPDownlink)
         {
-        iVoIPDownlink->BufferFilled(dataSize);
+        iIPDownlink->BufferFilled(dataSize);
         }
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::BufferEmptied
+// TMSCallIPAdpt::BufferEmptied
 //
 // -----------------------------------------------------------------------------
 //
-void CallIPAdpt::BufferEmptiedL()
+void TMSCallIPAdpt::BufferEmptiedL()
     {
-    if (iVoIPUplink)
+    if (iIPUplink)
         {
-        iVoIPUplink->BufferEmptied();
+        iIPUplink->BufferEmptied();
         }
     }
 
-// ----------------------------------------------------------------------------
-// CallIPAdpt::GetDataXferChunkHndl
+// -----------------------------------------------------------------------------
+// TMSCallIPAdpt::GetDataXferChunkHndl
 //
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetDataXferChunkHndl(const TMSStreamType strmType,
+gint TMSCallIPAdpt::GetDataXferChunkHndl(const TMSStreamType strmType,
         const TUint32 key, RChunk& chunk)
     {
     TRACE_PRN_FN_ENT;
@@ -1122,17 +1148,17 @@
         {
         case TMS_STREAM_DOWNLINK:
             {
-            if (iVoIPDownlink)
+            if (iIPDownlink)
                 {
-                status = iVoIPDownlink->GetDataXferChunkHndl(key, chunk);
+                status = iIPDownlink->GetDataXferChunkHndl(key, chunk);
                 }
             break;
             }
         case TMS_STREAM_UPLINK:
             {
-            if (iVoIPUplink)
+            if (iIPUplink)
                 {
-                status = iVoIPUplink->GetDataXferChunkHndl(key, chunk);
+                status = iIPUplink->GetDataXferChunkHndl(key, chunk);
                 }
             break;
             }
@@ -1146,26 +1172,27 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::SetIlbcCodecMode
+// TMSCallIPAdpt::SetIlbcCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::SetIlbcCodecMode(const gint mode, const TMSStreamType strmtype)
+gint TMSCallIPAdpt::SetIlbcCodecMode(const gint mode,
+        const TMSStreamType strmtype)
     {
     gint status(TMS_RESULT_INVALID_ARGUMENT);
 
     if (strmtype == TMS_STREAM_DOWNLINK)
         {
-        if (iDnlinkInitialized && iVoIPDownlink)
+        if (iDnlinkInitialized && iIPDownlink)
             {
-            status = iVoIPDownlink->SetIlbcCodecMode(mode);
+            status = iIPDownlink->SetIlbcCodecMode(mode);
             }
         }
     else if (strmtype == TMS_STREAM_UPLINK)
         {
-        if (iUplinkInitialized && iVoIPUplink)
+        if (iUplinkInitialized && iIPUplink)
             {
-            status = iVoIPUplink->SetIlbcCodecMode(mode);
+            status = iIPUplink->SetIlbcCodecMode(mode);
             }
         }
 
@@ -1173,26 +1200,26 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetIlbcCodecMode
+// TMSCallIPAdpt::GetIlbcCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetIlbcCodecMode(gint& mode, const TMSStreamType strmtype)
+gint TMSCallIPAdpt::GetIlbcCodecMode(gint& mode, const TMSStreamType strmtype)
     {
     gint status(TMS_RESULT_INVALID_ARGUMENT);
 
     if (strmtype == TMS_STREAM_DOWNLINK)
         {
-        if (iDnlinkInitialized && iVoIPDownlink)
+        if (iDnlinkInitialized && iIPDownlink)
             {
-            status = iVoIPDownlink->GetIlbcCodecMode(mode);
+            status = iIPDownlink->GetIlbcCodecMode(mode);
             }
         }
     else if (strmtype == TMS_STREAM_UPLINK)
         {
-        if (iUplinkInitialized && iVoIPUplink)
+        if (iUplinkInitialized && iIPUplink)
             {
-            status = iVoIPUplink->GetIlbcCodecMode(mode);
+            status = iIPUplink->GetIlbcCodecMode(mode);
             }
         }
 
@@ -1200,26 +1227,27 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::SetG711CodecMode
+// TMSCallIPAdpt::SetG711CodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::SetG711CodecMode(const gint mode, const TMSStreamType strmtype)
+gint TMSCallIPAdpt::SetG711CodecMode(const gint mode,
+        const TMSStreamType strmtype)
     {
     gint status(TMS_RESULT_INVALID_ARGUMENT);
 
     if (strmtype == TMS_STREAM_DOWNLINK)
         {
-        if (iDnlinkInitialized && iVoIPDownlink)
+        if (iDnlinkInitialized && iIPDownlink)
             {
-            status = iVoIPDownlink->SetG711CodecMode(mode);
+            status = iIPDownlink->SetG711CodecMode(mode);
             }
         }
     else if (strmtype == TMS_STREAM_UPLINK)
         {
-        if (iUplinkInitialized && iVoIPUplink)
+        if (iUplinkInitialized && iIPUplink)
             {
-            status = iVoIPUplink->SetG711CodecMode(mode);
+            status = iIPUplink->SetG711CodecMode(mode);
             }
         }
 
@@ -1227,26 +1255,26 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetG711CodecMode
+// TMSCallIPAdpt::GetG711CodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetG711CodecMode(gint& mode, const TMSStreamType strmtype)
+gint TMSCallIPAdpt::GetG711CodecMode(gint& mode, const TMSStreamType strmtype)
     {
     gint status(TMS_RESULT_INVALID_ARGUMENT);
 
     if (strmtype == TMS_STREAM_DOWNLINK)
         {
-        if (iDnlinkInitialized && iVoIPDownlink)
+        if (iDnlinkInitialized && iIPDownlink)
             {
-            status = iVoIPDownlink->GetG711CodecMode(mode);
+            status = iIPDownlink->GetG711CodecMode(mode);
             }
         }
     else if (strmtype == TMS_STREAM_UPLINK)
         {
-        if (iUplinkInitialized && iVoIPUplink)
+        if (iUplinkInitialized && iIPUplink)
             {
-            status = iVoIPUplink->GetG711CodecMode(mode);
+            status = iIPUplink->GetG711CodecMode(mode);
             }
         }
 
@@ -1254,132 +1282,242 @@
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::FrameModeRequiredForEC
+// TMSCallIPAdpt::FrameModeRequiredForEC
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::FrameModeRqrdForEC(gboolean& frmodereq)
+gint TMSCallIPAdpt::FrameModeRqrdForEC(gboolean& frmodereq)
     {
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iVoIPDownlink)
+    if (iIPDownlink)
         {
-        status = iVoIPDownlink->FrameModeRqrdForEC(frmodereq);
+        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;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::SetFrameMode
+// TMSCallIPAdpt::GetFrameMode
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::SetFrameMode(const gboolean frmode)
+gint TMSCallIPAdpt::GetFrameMode(gboolean& frmode)
     {
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iVoIPDownlink)
+    if (iIPDownlink)
         {
-        status = iVoIPDownlink->SetFrameMode(frmode);
+        status = iIPDownlink->GetFrameMode(frmode);
         }
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetFrameMode
-//
+// TMSCallIPAdpt::ConcealErrorForNextBuffer
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetFrameMode(gboolean& frmode)
+gint TMSCallIPAdpt::ConcealErrorForNextBuffer()
     {
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iVoIPDownlink)
+    if (iIPDownlink)
         {
-        status = iVoIPDownlink->GetFrameMode(frmode);
+        status = iIPDownlink->ConcealErrorForNextBuffer();
         }
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::ConcealErrorForNextBuffer
+// TMSCallIPAdpt::BadLsfNextBuffer
+//
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::ConcealErrorForNextBuffer()
+gint TMSCallIPAdpt::BadLsfNextBuffer()
     {
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iVoIPDownlink)
+    if (iIPDownlink)
         {
-        status = iVoIPDownlink->ConcealErrorForNextBuffer();
+        status = iIPDownlink->BadLsfNextBuffer();
         }
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::BadLsfNextBuffer
+// TMSCallIPAdpt::SetOutput
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::BadLsfNextBuffer()
+gint TMSCallIPAdpt::SetOutput(TMSAudioOutput output)
     {
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iVoIPDownlink)
+    if (iDnlinkInitialized && iIPDownlink)
         {
-        status = iVoIPDownlink->BadLsfNextBuffer();
-        }
-    return status;
-    }
-
-// -----------------------------------------------------------------------------
-// CallIPAdpt::SetOutput
-//
-// -----------------------------------------------------------------------------
-//
-gint CallIPAdpt::SetOutput(TMSAudioOutput output)
-    {
-    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iDnlinkInitialized && iVoIPDownlink)
-        {
-        TRAP(status, iVoIPDownlink->SetAudioDeviceL(output));
+        TRAP(status, iIPDownlink->SetAudioDeviceL(output));
         }
     return status;
     }
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetOutput
+// TMSCallIPAdpt::GetOutput
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetOutput(TMSAudioOutput& output)
+gint TMSCallIPAdpt::GetOutput(TMSAudioOutput& output)
     {
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iDnlinkInitialized && iVoIPDownlink)
+    if (iDnlinkInitialized && iIPDownlink)
         {
-        TRAP(status, iVoIPDownlink->GetAudioDeviceL(output));
+        TRAP(status, iIPDownlink->GetAudioDeviceL(output));
         }
     return status;
     }
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetPreviousOutput
+// TMSCallIPAdpt::GetPreviousOutput
 //
 // -----------------------------------------------------------------------------
 //
-gint CallIPAdpt::GetPreviousOutput(TMSAudioOutput& /*output*/)
+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;
     }
 
 // -----------------------------------------------------------------------------
-// CallIPAdpt::GetAvailableOutputsL
+// 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 CallIPAdpt::GetAvailableOutputsL(gint& /*count*/, CBufFlat*& /*outputsbuffer*/)
+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
 // -----------------------------------------------------------------------------
-// CallIPAdpt::NotifyClient
+// TMSCallIPAdpt::DTMFInitCompleted
+//
+// -----------------------------------------------------------------------------
+//
+void TMSCallIPAdpt::DTMFInitCompleted(TInt /*error*/)
+    {
+    //DTMF init status
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCallIPAdpt::DTMFToneFinished
+//
 // -----------------------------------------------------------------------------
 //
-void CallIPAdpt::NotifyClient(const gint strmId, const TInt aCommand,
+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;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmscallserver/src/cpeaudiodtmftoneplayer.cpp	Fri Apr 16 15:29:42 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 <mdaaudiotoneplayer.h>
+#include <AudioPreference.h>
+#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<KBufSize> 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
--- a/mmserv/tms/tmscallserver/src/csdownlink.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/csdownlink.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -28,9 +28,9 @@
 // Static constructor
 // -----------------------------------------------------------------------------
 //
-CSDownlink* CSDownlink::NewL(MCSPDevSoundObserver& aObserver)
+TMSCSDownlink* TMSCSDownlink::NewL(TMSCSPDevSoundObserver& aObserver)
     {
-    CSDownlink* self = new (ELeave) CSDownlink(aObserver);
+    TMSCSDownlink* self = new (ELeave) TMSCSDownlink(aObserver);
     CleanupStack::PushL(self);
     self->ConstructL();
     CleanupStack::Pop(self);
@@ -41,7 +41,7 @@
 // Destructor.
 // -----------------------------------------------------------------------------
 //
-CSDownlink::~CSDownlink()
+TMSCSDownlink::~TMSCSDownlink()
     {
     }
 
@@ -49,7 +49,7 @@
 // Sets volume
 // -----------------------------------------------------------------------------
 //
-void CSDownlink::SetVolume(gint aVolume)
+void TMSCSDownlink::SetVolume(gint aVolume)
     {
     if (iDevSound)
         {
@@ -64,7 +64,7 @@
 // Gives volume
 // -----------------------------------------------------------------------------
 //
-gint CSDownlink::Volume()
+gint TMSCSDownlink::Volume()
     {
     gint vol = 0;
     if (iDevSound)
@@ -78,7 +78,7 @@
 // Gives max volume
 // -----------------------------------------------------------------------------
 //
-gint CSDownlink::MaxVolume()
+gint TMSCSDownlink::MaxVolume()
     {
     gint vol = 0;
     if (iDevSound)
@@ -93,9 +93,9 @@
 // Downlink stream has been activated successfully.
 // -----------------------------------------------------------------------------
 //
-void CSDownlink::BufferToBeFilled(CMMFBuffer* /*aBuffer*/)
+void TMSCSDownlink::BufferToBeFilled(CMMFBuffer* /*aBuffer*/)
     {
-    //CSPLOGSTRING( CSPINT, "CSDownlink:: activated" );
+    //CSPLOGSTRING( CSPINT, "TMSCSDownlink:: activated" );
     // We dont react to devsound messages unless we are activating.
     if (IsActivationOngoing())
         {
@@ -110,14 +110,14 @@
 // Downlink stream activation failed
 // -----------------------------------------------------------------------------
 //
-void CSDownlink::PlayError(TInt aError)
+void TMSCSDownlink::PlayError(TInt aError)
     {
-    //CSPLOGSTRING( CSPINT, "CSDownlink::PlayError" );
+    //CSPLOGSTRING( CSPINT, "TMSCSDownlink::PlayError" );
 
     // We dont react to devsound messages unless we are activating.
     if (IsActivationOngoing())
         {
-        //CSPLOGSTRING( CSPINT, "CSDownlink::PlayError activation failed" );
+        //CSPLOGSTRING( CSPINT, "TMSCSDownlink::PlayError activation failed" );
         if (aError == KErrAccessDenied)
             {
             iActivationOngoing = EFalse;
@@ -131,7 +131,7 @@
 // Tries to activate Downlink stream.
 // -----------------------------------------------------------------------------
 //
-void CSDownlink::DoActivateL()
+void TMSCSDownlink::DoActivateL()
     {
     if (iDevSound)
         {
@@ -143,8 +143,8 @@
 // Constructor
 // -----------------------------------------------------------------------------
 //
-CSDownlink::CSDownlink(MCSPDevSoundObserver& aObserver) :
-    CSPDevSound(aObserver)
+TMSCSDownlink::TMSCSDownlink(TMSCSPDevSoundObserver& aObserver) :
+    TMSCSPDevSound(aObserver)
     {
     }
 
@@ -152,9 +152,9 @@
 // Second phase constructor
 // -----------------------------------------------------------------------------
 //
-void CSDownlink::ConstructL()
+void TMSCSDownlink::ConstructL()
     {
-    CSPDevSound::ConstructL(EMMFStatePlaying, KAudioPrefCSCallDownlink,
+    TMSCSPDevSound::ConstructL(EMMFStatePlaying, KAudioPrefCSCallDownlink,
             KAudioPriorityCSCallDownlink);
 
     if (iDevSound)
--- a/mmserv/tms/tmscallserver/src/cspdevsound.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/cspdevsound.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -23,20 +23,20 @@
 
 using namespace TMS;
 
-// ---------------------------------------------------------------------------
-// CSPDevSound
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+// TMSCSPDevSound
+// -----------------------------------------------------------------------------
 //
-CSPDevSound::CSPDevSound(MCSPDevSoundObserver& aObserver) :
+TMSCSPDevSound::TMSCSPDevSound(TMSCSPDevSoundObserver& aObserver) :
     iObserver(aObserver)
     {
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // ConstructL
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSPDevSound::ConstructL(TMMFState aMode, gint aAudioPreference,
+void TMSCSPDevSound::ConstructL(TMMFState aMode, gint aAudioPreference,
         gint aAudioPriority)
     {
     TMMFPrioritySettings audioPriority;
@@ -58,21 +58,21 @@
         }
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // From class MDevSoundObserver
 // Not implemented
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-CSPDevSound::~CSPDevSound()
+TMSCSPDevSound::~TMSCSPDevSound()
     {
     delete iDevSound;
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // Tries to activate the audio stream if not active or activating
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSPDevSound::Activate()
+void TMSCSPDevSound::Activate()
     {
     if (!IsActive() && !IsActivationOngoing())
         {
@@ -82,11 +82,11 @@
         }
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // Deactivates the audio device.
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSPDevSound::Deactivate()
+void TMSCSPDevSound::Deactivate()
     {
     if (iDevSound && (IsActive() || IsActivationOngoing()))
         {
@@ -96,39 +96,39 @@
         }
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // ActivationOngoing
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-TBool CSPDevSound::IsActivationOngoing() const
+TBool TMSCSPDevSound::IsActivationOngoing() const
     {
     return iActivationOngoing;
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // IsActive
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-TBool CSPDevSound::IsActive() const
+TBool TMSCSPDevSound::IsActive() const
     {
     return iActive;
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // DevSound
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-CMMFDevSound& CSPDevSound::DevSound()
+CMMFDevSound& TMSCSPDevSound::DevSound()
     {
     return *iDevSound;
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // From class MDevSoundObserver
 // Not implemented
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSPDevSound::InitializeComplete(TInt aError)
+void TMSCSPDevSound::InitializeComplete(TInt aError)
     {
     if (iStreamType == KAudioPrefCSCallDownlink)
         {
@@ -140,66 +140,67 @@
         }
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // From class MDevSoundObserver
 // Not implemented
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSPDevSound::BufferToBeFilled(CMMFBuffer* /*aBuffer*/)
+void TMSCSPDevSound::BufferToBeFilled(CMMFBuffer* /*aBuffer*/)
     {
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // From class MDevSoundObserver
 // Not implemented
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSPDevSound::PlayError(TInt /*aError*/)
+void TMSCSPDevSound::PlayError(TInt /*aError*/)
     {
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // From class MDevSoundObserver
 // Not implemented
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSPDevSound::ToneFinished(TInt /*aError*/)
+void TMSCSPDevSound::ToneFinished(TInt /*aError*/)
     {
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // From class MDevSoundObserver
 // Not implemented
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSPDevSound::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/)
+void TMSCSPDevSound::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/)
     {
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // From class MDevSoundObserver
 // Not implemented
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSPDevSound::RecordError(TInt /*aError*/)
+void TMSCSPDevSound::RecordError(TInt /*aError*/)
     {
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // From class MDevSoundObserver
 // Not implemented
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSPDevSound::ConvertError(TInt /*aError*/)
+void TMSCSPDevSound::ConvertError(TInt /*aError*/)
     {
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // From class MDevSoundObserver
 // Not implemented
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSPDevSound::DeviceMessage(TUid /*aMessageType*/, const TDesC8& /*aMsg*/)
+void TMSCSPDevSound::DeviceMessage(TUid /*aMessageType*/,
+        const TDesC8& /*aMsg*/)
     {
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmscallserver/src/cspdtmfprovider.cpp	Fri Apr 16 15:29:42 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
+ *
+ */
+
+#include <etelmm.h>
+#include <mccpdtmfprovider.h>
+#include <mccpdtmfobserver.h>
+#include <rmmcustomapi.h>
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmscallserver/src/cspeteldtmfmonitor.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,169 @@
+/*
+ * 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 <mccpdtmfobserver.h>
+#include <rmmcustomapi.h>
+#include <gsmerror.h>
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmscallserver/src/cspeteldtmfstopmonitor.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,131 @@
+/*
+ * 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 <mccpdtmfobserver.h>
+#include <gsmerror.h>
+#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
--- a/mmserv/tms/tmscallserver/src/csuplink.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/csuplink.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -24,32 +24,32 @@
 // Mute value
 const gint KSetMuteToDevSound = 0;
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // Static constructor.
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-CSUplink* CSUplink::NewL(MCSPDevSoundObserver& aObserver)
+TMSCSUplink* TMSCSUplink::NewL(TMSCSPDevSoundObserver& aObserver)
     {
-    CSUplink* self = new (ELeave) CSUplink(aObserver);
+    TMSCSUplink* self = new (ELeave) TMSCSUplink(aObserver);
     CleanupStack::PushL(self);
     self->ConstructL();
     CleanupStack::Pop(self);
     return self;
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // Destructor
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-CSUplink::~CSUplink()
+TMSCSUplink::~TMSCSUplink()
     {
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // Gives mic mute state
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-TBool CSUplink::IsMuted()
+TBool TMSCSUplink::IsMuted()
     {
     TBool isMuted = EFalse;
     gint gain = 0;
@@ -62,15 +62,15 @@
         // Mute is on
         isMuted = ETrue;
         }
-    //   CSPLOGSTRING( CSPINT, "CSUplink::IsMuted" );
+    //   CSPLOGSTRING( CSPINT, "TMSCSUplink::IsMuted" );
     return isMuted;
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // Set mic muted.
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSUplink::SetMuted()
+void TMSCSUplink::SetMuted()
     {
     if (iDevSound)
         {
@@ -78,11 +78,11 @@
         }
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // Set mic unmuted
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSUplink::SetUnmuted()
+void TMSCSUplink::SetUnmuted()
     {
     if (iDevSound)
         {
@@ -90,11 +90,11 @@
         }
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // Sets gain
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSUplink::SetGain(gint aGain)
+void TMSCSUplink::SetGain(gint aGain)
     {
     if (iDevSound)
         {
@@ -102,11 +102,11 @@
         }
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // Gives volume
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-gint CSUplink::Gain()
+gint TMSCSUplink::Gain()
     {
     gint gain = 0;
     if (iDevSound)
@@ -116,11 +116,11 @@
     return gain;
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // Gives max gain
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-gint CSUplink::MaxGain()
+gint TMSCSUplink::MaxGain()
     {
     gint gain = 0;
     if (iDevSound)
@@ -130,14 +130,14 @@
     return gain;
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // From class MDevSoundObserver
 // Activation was successfull.
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSUplink::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/)
+void TMSCSUplink::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/)
     {
-    //  CSPLOGSTRING( CSPINT, "CSUplink::BufferToBeEmptied" );
+    //  CSPLOGSTRING( CSPINT, "TMSCSUplink::BufferToBeEmptied" );
 
     // We dont react to devsound messages unless we are activating.
     if (IsActivationOngoing())
@@ -148,14 +148,14 @@
         }
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // From class MDevSoundObserver
 // Activation feiled
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSUplink::RecordError(TInt aError)
+void TMSCSUplink::RecordError(TInt aError)
     {
-    //  CSPLOGSTRING( CSPINT, "CSUplink::RecordError" );
+    //  CSPLOGSTRING( CSPINT, "TMSCSUplink::RecordError" );
 
     // We dont react to devsound messages unless we are activating.
     if (IsActivationOngoing())
@@ -168,13 +168,13 @@
         }
     }
 
-// ---------------------------------------------------------------------------
-// From class CSPDevSound
+// -----------------------------------------------------------------------------
+// From class TMSCSPDevSound
 // Tries to activate mic stream. Stream becomes active when BufferToBeFilled
 // gets called.
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSUplink::DoActivateL()
+void TMSCSUplink::DoActivateL()
     {
     if (iDevSound)
         {
@@ -182,22 +182,22 @@
         }
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // Constructor
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-CSUplink::CSUplink(MCSPDevSoundObserver& aObserver) :
-    CSPDevSound(aObserver)
+TMSCSUplink::TMSCSUplink(TMSCSPDevSoundObserver& aObserver) :
+    TMSCSPDevSound(aObserver)
     {
     }
 
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 // Second phase constructor
-// ---------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CSUplink::ConstructL()
+void TMSCSUplink::ConstructL()
     {
-    CSPDevSound::ConstructL(EMMFStateRecording, KAudioPrefCSCallUplink,
+    TMSCSPDevSound::ConstructL(EMMFStateRecording, KAudioPrefCSCallUplink,
             KAudioPriorityCSCallUplink);
     }
 
--- a/mmserv/tms/tmscallserver/src/delaytimer.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/delaytimer.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -87,6 +87,7 @@
     TRACE_PRN_FN_ENT;
     if (!IsActive())
         {
+        iStatus = KRequestPending;
         SetActive();
         iShutDownTimer.After(iStatus, aDelay);
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmscallserver/src/dtmfnotifier.cpp	Fri Apr 16 15:29:42 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 "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
--- a/mmserv/tms/tmscallserver/src/ipcalldownlink.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/ipcalldownlink.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -28,7 +28,7 @@
 
 using namespace TMS;
 
-static TMSVoIPDownlink* iSelfDn;
+static TMSIPDownlink* iSelfDn;
 #ifdef _DEBUG
 static TInt iHeap;
 #endif //_DEBUG
@@ -41,10 +41,10 @@
 #endif
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::cb_raw_playback_handoff
+// TMSIPDownlink::cb_raw_playback_handoff
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::cb_raw_playback_handoff(GstElement* /*appsrc*/,
+void TMSIPDownlink::cb_raw_playback_handoff(GstElement* /*appsrc*/,
         guint size)
     {
     TRACE_PRN_N(_L("TMS->DNL: cb_raw_playback_handoff"));
@@ -63,10 +63,10 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::bus_call
+// TMSIPDownlink::bus_call
 // -----------------------------------------------------------------------------
 //
-gboolean TMSVoIPDownlink::bus_call(GstBus* /*bus*/, GstMessage* msg,
+gboolean TMSIPDownlink::bus_call(GstBus* /*bus*/, GstMessage* msg,
         gpointer /*data*/)
     {
     switch (GST_MESSAGE_TYPE(msg))
@@ -97,10 +97,10 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::gst_initialize_play
+// TMSIPDownlink::gst_initialize_play
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::gst_initialize_play()
+gint TMSIPDownlink::gst_initialize_play()
     {
     TRACE_PRN_FN_ENT;
 
@@ -119,7 +119,7 @@
         }
 
     iBusPlay = gst_pipeline_get_bus(GST_PIPELINE(iPipelinePlay));
-    gst_bus_add_watch(iBusPlay, TMSVoIPDownlink::bus_call, NULL);
+    gst_bus_add_watch(iBusPlay, TMSIPDownlink::bus_call, NULL);
     gst_object_unref(iBusPlay);
 
     iMaxBufLen = ConfigureMedia(iCodecID);
@@ -160,10 +160,10 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::gst_play_raw
+// TMSIPDownlink::gst_play_raw
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::gst_play_raw()
+gint TMSIPDownlink::gst_play_raw()
     {
     TRACE_PRN_FN_ENT;
 
@@ -179,21 +179,21 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::TMSVoIPDownlink
+// TMSIPDownlink::TMSIPDownlink
 // Standard Constructor
 // -----------------------------------------------------------------------------
 //
-TMSVoIPDownlink::TMSVoIPDownlink()
+TMSIPDownlink::TMSIPDownlink()
     {
     iSelfDn = this;
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::~TMSVoIPDownlink
+// TMSIPDownlink::~TMSIPDownlink
 // Standard Constructor
 // -----------------------------------------------------------------------------
 //
-TMSVoIPDownlink::~TMSVoIPDownlink()
+TMSIPDownlink::~TMSIPDownlink()
     {
     TRACE_PRN_FN_ENT;
 
@@ -216,14 +216,14 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::NewL
+// TMSIPDownlink::NewL
 // Symbian two-phase constructor
 // -----------------------------------------------------------------------------
 //
-TMSVoIPDownlink* TMSVoIPDownlink::NewL(const guint32 codecID,
+TMSIPDownlink* TMSIPDownlink::NewL(const guint32 codecID,
         const TMMFPrioritySettings priority)
     {
-    TMSVoIPDownlink* self = new (ELeave) TMSVoIPDownlink();
+    TMSIPDownlink* self = new (ELeave) TMSIPDownlink();
     CleanupStack::PushL(self);
     self->ConstructL(codecID, priority);
     CleanupStack::Pop(self);
@@ -231,11 +231,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::ConstructL
+// TMSIPDownlink::ConstructL
 // Part two of Symbian two phase construction
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::ConstructL(const guint32 codecID,
+void TMSIPDownlink::ConstructL(const guint32 codecID,
         const TMMFPrioritySettings priority)
     {
     TRACE_PRN_FN_ENT;
@@ -279,11 +279,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::Start
+// TMSIPDownlink::Start
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::Start()
+void TMSIPDownlink::Start()
     {
     TRACE_PRN_FN_ENT;
 
@@ -294,11 +294,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::Stop
+// TMSIPDownlink::Stop
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::Stop()
+void TMSIPDownlink::Stop()
     {
     TRACE_PRN_FN_ENT;
 
@@ -322,10 +322,10 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::BufferToBeFilled
+// TMSIPDownlink::BufferToBeFilled
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::BufferToBeFilled()
+void TMSIPDownlink::BufferToBeFilled()
     {
     TRACE_PRN_N1(_L("TMS->DNL->BTBF: requestBufLen[%d]"), requestBufLen);
 
@@ -366,11 +366,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::BufferFilled
+// TMSIPDownlink::BufferFilled
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::BufferFilled(const guint buflen)
+void TMSIPDownlink::BufferFilled(const guint buflen)
     {
 #ifndef __PLAY_WAV_FROM_FILE__
     gstDnlBuffer = gst_buffer_new();
@@ -418,22 +418,22 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetCodecCi
+// TMSIPDownlink::SetCodecCi
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetCodecCi()
+gint TMSIPDownlink::SetCodecCi()
     {
     TRAPD(err, SetCodecCiL());
     return err;
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetCodecCiL
+// TMSIPDownlink::SetCodecCiL
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::SetCodecCiL()
+void TMSIPDownlink::SetCodecCiL()
     {
     TRACE_PRN_FN_ENT;
 
@@ -489,11 +489,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetVolume
+// TMSIPDownlink::SetVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetVolume(const guint volume)
+gint TMSIPDownlink::SetVolume(const guint volume)
     {
     g_object_set(G_OBJECT(iSink), "volume", volume, NULL);
     TRACE_PRN_N1(_L("TMS->DNL: SetVolume [%d]"), volume);
@@ -501,11 +501,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetVolume
+// TMSIPDownlink::GetVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetVolume(guint& volume)
+gint TMSIPDownlink::GetVolume(guint& volume)
     {
     g_object_get(G_OBJECT(iSink), "volume", &volume, NULL);
     TRACE_PRN_N1(_L("TMS->DNL: GetVolume [%d]"), volume);
@@ -513,11 +513,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetMaxVolume
+// TMSIPDownlink::GetMaxVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetMaxVolume(guint& volume)
+gint TMSIPDownlink::GetMaxVolume(guint& volume)
     {
     g_object_get(G_OBJECT(iSink), "maxvolume", &volume, NULL);
     TRACE_PRN_N1(_L("TMS->DNL: MaxVolume [%d]"), volume);
@@ -525,11 +525,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetDataXferChunkHndl
+// TMSIPDownlink::GetDataXferChunkHndl
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk)
+gint TMSIPDownlink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk)
     {
     gint status = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -553,11 +553,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetIlbcCodecMode
+// TMSIPDownlink::SetIlbcCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetIlbcCodecMode(gint mode)
+gint TMSIPDownlink::SetIlbcCodecMode(gint mode)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -585,11 +585,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetIlbcCodecMode
+// TMSIPDownlink::GetIlbcCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetIlbcCodecMode(gint& mode)
+gint TMSIPDownlink::GetIlbcCodecMode(gint& mode)
     {
     // not available through CIs -> return cashed value
     mode = iILBCDecodeMode;
@@ -598,11 +598,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetG711CodecMode
+// TMSIPDownlink::SetG711CodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetG711CodecMode(gint mode)
+gint TMSIPDownlink::SetG711CodecMode(gint mode)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -630,11 +630,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetG711CodecMode
+// TMSIPDownlink::GetG711CodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetG711CodecMode(gint& mode)
+gint TMSIPDownlink::GetG711CodecMode(gint& mode)
     {
     // not available through CIs -> return cached value
     mode = iG711DecodeMode;
@@ -643,11 +643,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::FrameModeRqrdForEC
+// TMSIPDownlink::FrameModeRqrdForEC
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::FrameModeRqrdForEC(gboolean& frmodereq)
+gint TMSIPDownlink::FrameModeRqrdForEC(gboolean& frmodereq)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -665,11 +665,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetFrameMode
+// TMSIPDownlink::SetFrameMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetFrameMode(const gboolean frmode)
+gint TMSIPDownlink::SetFrameMode(const gboolean frmode)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -689,11 +689,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetFrameMode
+// TMSIPDownlink::GetFrameMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetFrameMode(gboolean& frmode)
+gint TMSIPDownlink::GetFrameMode(gboolean& frmode)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -710,11 +710,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::ConcealErrorForNextBuffer
+// TMSIPDownlink::ConcealErrorForNextBuffer
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::ConcealErrorForNextBuffer()
+gint TMSIPDownlink::ConcealErrorForNextBuffer()
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -729,11 +729,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetCng
+// TMSIPDownlink::SetCng
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetCng(const TMSFormatType fmttype, const gboolean cng)
+gint TMSIPDownlink::SetCng(const TMSFormatType fmttype, const gboolean cng)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -756,11 +756,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetCng
+// TMSIPDownlink::GetCng
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetCng(const TMSFormatType fmttype, gboolean& cng)
+gint TMSIPDownlink::GetCng(const TMSFormatType fmttype, gboolean& cng)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -783,11 +783,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetPlc
+// TMSIPDownlink::SetPlc
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetPlc(const TMSFormatType fmttype, const gboolean plc)
+gint TMSIPDownlink::SetPlc(const TMSFormatType fmttype, const gboolean plc)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -806,11 +806,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetPlc
+// TMSIPDownlink::GetPlc
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetPlc(const TMSFormatType fmttype, gboolean& plc)
+gint TMSIPDownlink::GetPlc(const TMSFormatType fmttype, gboolean& plc)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -827,11 +827,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::BadLsfNextBuffer
+// TMSIPDownlink::BadLsfNextBuffer
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::BadLsfNextBuffer()
+gint TMSIPDownlink::BadLsfNextBuffer()
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -849,10 +849,10 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetAudioDeviceL
+// TMSIPDownlink::SetAudioDeviceL
 //
 // -----------------------------------------------------------------------------
-void TMSVoIPDownlink::SetAudioDeviceL(TMSAudioOutput output)
+void TMSIPDownlink::SetAudioDeviceL(TMSAudioOutput output)
     {
     gint outputDev;
 
@@ -877,11 +877,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetAudioDeviceL
+// TMSIPDownlink::GetAudioDeviceL
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::GetAudioDeviceL(TMSAudioOutput& output)
+void TMSIPDownlink::GetAudioDeviceL(TMSAudioOutput& output)
     {
     TRACE_PRN_FN_ENT;
 
--- a/mmserv/tms/tmscallserver/src/ipcalldownlinkds.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/ipcalldownlinkds.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -28,20 +28,20 @@
 using namespace TMS;
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::TMSVoIPDownlink
+// TMSIPDownlink::TMSIPDownlink
 // Standard Constructor
 // -----------------------------------------------------------------------------
 //
-TMSVoIPDownlink::TMSVoIPDownlink()
+TMSIPDownlink::TMSIPDownlink()
     {
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::~TMSVoIPDownlink
+// TMSIPDownlink::~TMSIPDownlink
 // Standard Constructor
 // -----------------------------------------------------------------------------
 //
-TMSVoIPDownlink::~TMSVoIPDownlink()
+TMSIPDownlink::~TMSIPDownlink()
     {
     TRACE_PRN_FN_ENT;
 
@@ -57,14 +57,14 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::NewL
+// TMSIPDownlink::NewL
 // Symbian two-phase constructor
 // -----------------------------------------------------------------------------
 //
-TMSVoIPDownlink* TMSVoIPDownlink::NewL(const guint32 codecID,
+TMSIPDownlink* TMSIPDownlink::NewL(const guint32 codecID,
         const TMMFPrioritySettings priority)
     {
-    TMSVoIPDownlink* self = new (ELeave) TMSVoIPDownlink();
+    TMSIPDownlink* self = new (ELeave) TMSIPDownlink();
     CleanupStack::PushL(self);
     self->ConstructL(codecID, priority);
     CleanupStack::Pop(self);
@@ -72,11 +72,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::ConstructL
+// TMSIPDownlink::ConstructL
 // Part two of Symbian two phase construction
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::ConstructL(const guint32 codecID,
+void TMSIPDownlink::ConstructL(const guint32 codecID,
         const TMMFPrioritySettings priority)
     {
     TRACE_PRN_FN_ENT;
@@ -100,11 +100,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::Start
+// TMSIPDownlink::Start
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::Start()
+void TMSIPDownlink::Start()
     {
     TRACE_PRN_FN_ENT;
 
@@ -128,11 +128,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::Stop
+// TMSIPDownlink::Stop
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::Stop()
+void TMSIPDownlink::Stop()
     {
     TRACE_PRN_FN_ENT;
 
@@ -146,14 +146,14 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::BufferToBeFilled
+// 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 TMSVoIPDownlink::BufferToBeFilled(CMMFBuffer* aBuffer)
+void TMSIPDownlink::BufferToBeFilled(CMMFBuffer* aBuffer)
     {
     // Store pointer to the received buffer
     iDevSoundBufPtr = static_cast<CMMFDataBuffer*> (aBuffer);
@@ -200,11 +200,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::BufferFilled
+// TMSIPDownlink::BufferFilled
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::BufferFilled(const guint buflen)
+void TMSIPDownlink::BufferFilled(const guint buflen)
     {
     TRACE_PRN_N1(_L("TMS->DNL->BF: LEN[%d]"), buflen);
 
@@ -230,22 +230,22 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetCodecCi
+// TMSIPDownlink::SetCodecCi
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetCodecCi()
+gint TMSIPDownlink::SetCodecCi()
     {
     TRAPD(err, SetCodecCiL());
     return err;
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetCodecCiL
+// TMSIPDownlink::SetCodecCiL
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::SetCodecCiL()
+void TMSIPDownlink::SetCodecCiL()
     {
     TRACE_PRN_FN_ENT;
 
@@ -296,11 +296,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetVolume
+// TMSIPDownlink::SetVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetVolume(const guint volume)
+gint TMSIPDownlink::SetVolume(const guint volume)
     {
     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
     if (iDevSound)
@@ -313,11 +313,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetVolume
+// TMSIPDownlink::GetVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetVolume(guint& volume)
+gint TMSIPDownlink::GetVolume(guint& volume)
     {
     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
     if (iDevSound)
@@ -330,11 +330,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetMaxVolume
+// TMSIPDownlink::GetMaxVolume
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetMaxVolume(guint& volume)
+gint TMSIPDownlink::GetMaxVolume(guint& volume)
     {
     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
     if (iDevSound)
@@ -347,11 +347,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetDataXferChunkHndl
+// TMSIPDownlink::GetDataXferChunkHndl
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk)
+gint TMSIPDownlink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk)
     {
     gint status = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -375,11 +375,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetIlbcCodecMode
+// TMSIPDownlink::SetIlbcCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetIlbcCodecMode(gint mode)
+gint TMSIPDownlink::SetIlbcCodecMode(gint mode)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -409,11 +409,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetIlbcCodecMode
+// TMSIPDownlink::GetIlbcCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetIlbcCodecMode(gint& mode)
+gint TMSIPDownlink::GetIlbcCodecMode(gint& mode)
     {
     // not available through CIs -> return cashed value
     mode = iILBCDecodeMode;
@@ -422,11 +422,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetG711CodecMode
+// TMSIPDownlink::SetG711CodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetG711CodecMode(gint mode)
+gint TMSIPDownlink::SetG711CodecMode(gint mode)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -456,11 +456,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetG711CodecMode
+// TMSIPDownlink::GetG711CodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetG711CodecMode(gint& mode)
+gint TMSIPDownlink::GetG711CodecMode(gint& mode)
     {
     // not available through CIs -> return cached value
     mode = iG711DecodeMode;
@@ -469,11 +469,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::FrameModeRqrdForEC
+// TMSIPDownlink::FrameModeRqrdForEC
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::FrameModeRqrdForEC(gboolean& frmodereq)
+gint TMSIPDownlink::FrameModeRqrdForEC(gboolean& frmodereq)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -491,11 +491,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetFrameMode
+// TMSIPDownlink::SetFrameMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetFrameMode(const gboolean frmode)
+gint TMSIPDownlink::SetFrameMode(const gboolean frmode)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -515,11 +515,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetFrameMode
+// TMSIPDownlink::GetFrameMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetFrameMode(gboolean& frmode)
+gint TMSIPDownlink::GetFrameMode(gboolean& frmode)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -536,11 +536,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::ConcealErrorForNextBuffer
+// TMSIPDownlink::ConcealErrorForNextBuffer
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::ConcealErrorForNextBuffer()
+gint TMSIPDownlink::ConcealErrorForNextBuffer()
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -555,11 +555,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetCng
+// TMSIPDownlink::SetCng
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetCng(const TMSFormatType fmttype, const gboolean cng)
+gint TMSIPDownlink::SetCng(const TMSFormatType fmttype, const gboolean cng)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -582,11 +582,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetCng
+// TMSIPDownlink::GetCng
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetCng(const TMSFormatType fmttype, gboolean& cng)
+gint TMSIPDownlink::GetCng(const TMSFormatType fmttype, gboolean& cng)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -609,11 +609,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetPlc
+// TMSIPDownlink::SetPlc
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::SetPlc(const TMSFormatType fmttype, const gboolean plc)
+gint TMSIPDownlink::SetPlc(const TMSFormatType fmttype, const gboolean plc)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -632,11 +632,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetPlc
+// TMSIPDownlink::GetPlc
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::GetPlc(const TMSFormatType fmttype, gboolean& plc)
+gint TMSIPDownlink::GetPlc(const TMSFormatType fmttype, gboolean& plc)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -653,11 +653,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::BadLsfNextBuffer
+// TMSIPDownlink::BadLsfNextBuffer
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPDownlink::BadLsfNextBuffer()
+gint TMSIPDownlink::BadLsfNextBuffer()
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -675,10 +675,10 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::SetAudioDeviceL
+// TMSIPDownlink::SetAudioDeviceL
 //
 // -----------------------------------------------------------------------------
-void TMSVoIPDownlink::SetAudioDeviceL(TMSAudioOutput output)
+void TMSIPDownlink::SetAudioDeviceL(TMSAudioOutput output)
     {
     TRACE_PRN_FN_ENT;
 
@@ -715,11 +715,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::GetAudioDeviceL
+// TMSIPDownlink::GetAudioDeviceL
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::GetAudioDeviceL(TMSAudioOutput& output)
+void TMSIPDownlink::GetAudioDeviceL(TMSAudioOutput& output)
     {
     TRACE_PRN_FN_ENT;
 
@@ -756,14 +756,14 @@
 // CALLBACKS
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::InitializeComplete
+// 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 TMSVoIPDownlink::InitializeComplete(TInt aError)
+void TMSIPDownlink::InitializeComplete(TInt aError)
     {
     TRACE_PRN_FN_ENT;
 
@@ -801,13 +801,13 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPDownlink::PlayError
+// TMSIPDownlink::PlayError
 // From MDevSoundObserver
 // Record error is send to client over comm channel.
 // The state of recorder is rolled back to EReady.
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPDownlink::PlayError(TInt /*aError*/)
+void TMSIPDownlink::PlayError(TInt /*aError*/)
     {
     //TRACE_PRN_IF_ERR(aError);
 
--- a/mmserv/tms/tmscallserver/src/ipcallstreambase.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/ipcallstreambase.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -24,11 +24,11 @@
 using namespace TMS;
 
 // -----------------------------------------------------------------------------
-// IPCallStreamBase::~IPCallStreamBase
+// TMSIPCallStreamBase::~TMSIPCallStreamBase
 // Destructor
 // -----------------------------------------------------------------------------
 //
-IPCallStreamBase::~IPCallStreamBase()
+TMSIPCallStreamBase::~TMSIPCallStreamBase()
     {
     TRACE_PRN_FN_ENT;
 
@@ -45,11 +45,11 @@
 
 #ifndef __USE_GSTREAMER__
 // -----------------------------------------------------------------------------
-// IPCallStreamBase::InitDevSoundL
+// TMSIPCallStreamBase::InitDevSoundL
 //
 // -----------------------------------------------------------------------------
 //
-void IPCallStreamBase::InitDevSoundL(const TMMFState aDevSoundState,
+void TMSIPCallStreamBase::InitDevSoundL(const TMMFState aDevSoundState,
         const TMMFPrioritySettings priority)
     {
     TRACE_PRN_FN_ENT;
@@ -69,21 +69,21 @@
 #endif //__USE_GSTREAMER__
 
 // -----------------------------------------------------------------------------
-// IPCallStreamBase::SetMsgQueue
+// TMSIPCallStreamBase::SetMsgQueue
 //
 // -----------------------------------------------------------------------------
 //
-void IPCallStreamBase::SetMsgQueue(const RMsgQueue<TmsMsgBuf> aMsgQueue)
+void TMSIPCallStreamBase::SetMsgQueue(const RMsgQueue<TmsMsgBuf> aMsgQueue)
     {
     iMsgQueue = aMsgQueue;
     }
 
 // -----------------------------------------------------------------------------
-// IPCallStreamBase::ConfigureMedia
+// TMSIPCallStreamBase::ConfigureMedia
 //
 // -----------------------------------------------------------------------------
 //
-gint IPCallStreamBase::ConfigureMedia(const guint32 aCodecID)
+gint TMSIPCallStreamBase::ConfigureMedia(const guint32 aCodecID)
     {
     gint framelen = 0;
 
@@ -130,11 +130,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// IPCallStreamBase::DoChunk
+// TMSIPCallStreamBase::DoChunk
 // Checks, adjusts and creates global RChunk.
 // -----------------------------------------------------------------------------
 //
-gint IPCallStreamBase::DoChunk(const gint aDataLen, TmsMsgBuf& aMsgBuffer)
+gint TMSIPCallStreamBase::DoChunk(const gint aDataLen, TmsMsgBuf& aMsgBuffer)
     {
     gint status(KErrNone);
 
--- a/mmserv/tms/tmscallserver/src/ipcalluplink.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/ipcalluplink.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -23,17 +23,17 @@
 
 using namespace TMS;
 
-static TMSVoIPUplink* iSelfUp;
+static TMSIPUplink* iSelfUp;
 GstBuffer* gstUplBuffer;
 #ifdef _DEBUG
 //static TInt iHeapUp;
 #endif //_DEBUG
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::cb_record_raw_handoff
+// TMSIPUplink::cb_record_raw_handoff
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::cb_record_raw_handoff(GstElement *sink)
+void TMSIPUplink::cb_record_raw_handoff(GstElement *sink)
     {
     TRACE_PRN_N(_L("TMS->UPL: cb_record_raw_handoff Enter"));
 
@@ -51,10 +51,10 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::bus_call
+// TMSIPUplink::bus_call
 // -----------------------------------------------------------------------------
 //
-gboolean TMSVoIPUplink::bus_call(GstBus* /*bus*/, GstMessage* msg,
+gboolean TMSIPUplink::bus_call(GstBus* /*bus*/, GstMessage* msg,
         gpointer /*data*/)
     {
     switch (GST_MESSAGE_TYPE(msg))
@@ -84,10 +84,10 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::gst_initialize_record
+// TMSIPUplink::gst_initialize_record
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::gst_initialize_record()
+gint TMSIPUplink::gst_initialize_record()
     {
     TRACE_PRN_FN_ENT;
 
@@ -117,7 +117,7 @@
                                         NULL);
 
     iBusRec = gst_pipeline_get_bus(GST_PIPELINE(iPipelineRec));
-    gst_bus_add_watch(iBusRec, (TMSVoIPUplink::bus_call), NULL);
+    gst_bus_add_watch(iBusRec, (TMSIPUplink::bus_call), NULL);
     gst_object_unref(iBusRec);
 
     // add objects to the main iPipelineRec
@@ -161,10 +161,10 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::gst_record_raw
+// TMSIPUplink::gst_record_raw
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::gst_record_raw()
+gint TMSIPUplink::gst_record_raw()
     {
     // start recording
     gst_element_set_state(iPipelineRec, GST_STATE_PLAYING);
@@ -172,21 +172,21 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::TMSVoIPUplink
+// TMSIPUplink::TMSIPUplink
 // Standard Constructor
 // -----------------------------------------------------------------------------
 //
-TMSVoIPUplink::TMSVoIPUplink()
+TMSIPUplink::TMSIPUplink()
     {
     iSelfUp = this;
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::~TMSVoIPUplink
+// TMSIPUplink::~TMSIPUplink
 // Standard Constructor
 // -----------------------------------------------------------------------------
 //
-TMSVoIPUplink::~TMSVoIPUplink()
+TMSIPUplink::~TMSIPUplink()
     {
     TRACE_PRN_FN_ENT;
 
@@ -203,14 +203,14 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::NewL
+// TMSIPUplink::NewL
 // Symbian two-phase constructor
 // -----------------------------------------------------------------------------
 //
-TMSVoIPUplink* TMSVoIPUplink::NewL(const guint32 codecID,
+TMSIPUplink* TMSIPUplink::NewL(const guint32 codecID,
         const TMMFPrioritySettings priority)
     {
-    TMSVoIPUplink* self = new (ELeave) TMSVoIPUplink();
+    TMSIPUplink* self = new (ELeave) TMSIPUplink();
     CleanupStack::PushL(self);
     self->ConstructL(codecID, priority);
     CleanupStack::Pop(self);
@@ -218,11 +218,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::ConstructL
+// TMSIPUplink::ConstructL
 // Part two of Symbian two phase construction
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::ConstructL(const guint32 codecID,
+void TMSIPUplink::ConstructL(const guint32 codecID,
         const TMMFPrioritySettings priority)
     {
     TRACE_PRN_FN_ENT;
@@ -248,11 +248,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::Start
+// TMSIPUplink::Start
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::Start()
+void TMSIPUplink::Start()
     {
     TRACE_PRN_FN_ENT;
 
@@ -263,11 +263,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::Stop
+// TMSIPUplink::Stop
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::Stop()
+void TMSIPUplink::Stop()
     {
     TRACE_PRN_FN_ENT;
 
@@ -296,11 +296,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::BufferToBeEmptied
+// TMSIPUplink::BufferToBeEmptied
 // From MDevSoundObserver
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::BufferToBeEmptied()
+void TMSIPUplink::BufferToBeEmptied()
     {
     TInt buflen = GST_BUFFER_SIZE(gstUplBuffer);
     TRACE_PRN_N1(_L("TMS->UPL: BTBE->LEN [%d]"), buflen);
@@ -345,32 +345,32 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::BufferEmptied
+// TMSIPUplink::BufferEmptied
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::BufferEmptied()
+void TMSIPUplink::BufferEmptied()
     {
     //TRACE_PRN_N(_L("TMS->UPL->BE"));
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetCodecCi
+// TMSIPUplink::SetCodecCi
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::SetCodecCi()
+gint TMSIPUplink::SetCodecCi()
     {
     TRAPD(err, SetCodecCiL());
     return err;
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetCodecCiL
+// TMSIPUplink::SetCodecCiL
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::SetCodecCiL()
+void TMSIPUplink::SetCodecCiL()
     {
     TRACE_PRN_FN_ENT;
 
@@ -420,11 +420,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetGain
+// TMSIPUplink::SetGain
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::SetGain(const guint gain)
+gint TMSIPUplink::SetGain(const guint gain)
     {
     g_object_set(G_OBJECT(iSource), "gain", gain, NULL);
     TRACE_PRN_N1(_L("TMS->UPL: SetGain [%d]"), gain);
@@ -432,11 +432,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetGain
+// TMSIPUplink::GetGain
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetGain(guint& gain)
+gint TMSIPUplink::GetGain(guint& gain)
     {
     g_object_get(G_OBJECT(iSource), "gain", &gain, NULL);
     TRACE_PRN_N1(_L("TMS->UPL: GetGain [%d]"), gain);
@@ -444,11 +444,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetMaxGain
+// TMSIPUplink::GetMaxGain
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetMaxGain(guint& gain)
+gint TMSIPUplink::GetMaxGain(guint& gain)
     {
     g_object_get(G_OBJECT(iSource), "maxgain", &gain, NULL);
     TRACE_PRN_N1(_L("TMS->UPL: MaxGain [%d]"), gain);
@@ -456,11 +456,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetDataXferChunkHndl
+// TMSIPUplink::GetDataXferChunkHndl
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk)
+gint TMSIPUplink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk)
     {
     gint status = TMS_RESULT_SUCCESS;
 
@@ -482,11 +482,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetIlbcCodecMode
+// TMSIPUplink::SetIlbcCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::SetIlbcCodecMode(const gint mode)
+gint TMSIPUplink::SetIlbcCodecMode(const gint mode)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -514,11 +514,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetIlbcCodecMode
+// TMSIPUplink::GetIlbcCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetIlbcCodecMode(gint& mode)
+gint TMSIPUplink::GetIlbcCodecMode(gint& mode)
     {
     // not available through CIs -> return cached value
     mode = iILBCEncodeMode;
@@ -527,11 +527,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetG711CodecMode
+// TMSIPUplink::SetG711CodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::SetG711CodecMode(const gint mode)
+gint TMSIPUplink::SetG711CodecMode(const gint mode)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -559,11 +559,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetG711CodecMode
+// TMSIPUplink::GetG711CodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetG711CodecMode(gint& mode)
+gint TMSIPUplink::GetG711CodecMode(gint& mode)
     {
     // not available through CIs -> return cached value
     mode = iG711EncodeMode;
@@ -572,11 +572,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetSupportedBitrates
+// TMSIPUplink::GetSupportedBitrates
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetSupportedBitrates(RArray<guint>& bitrates)
+gint TMSIPUplink::GetSupportedBitrates(RArray<guint>& bitrates)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
     bitrates.Reset();
@@ -604,11 +604,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetBitrate
+// TMSIPUplink::SetBitrate
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::SetBitrate(guint bitrate)
+gint TMSIPUplink::SetBitrate(guint bitrate)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -623,11 +623,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetBitrate
+// TMSIPUplink::GetBitrate
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetBitrate(guint& bitrate)
+gint TMSIPUplink::GetBitrate(guint& bitrate)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -642,11 +642,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetVad
+// TMSIPUplink::SetVad
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::SetVad(const TMSFormatType fmttype, const gboolean vad)
+gint TMSIPUplink::SetVad(const TMSFormatType fmttype, const gboolean vad)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -699,11 +699,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetVad
+// TMSIPUplink::GetVad
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetVad(const TMSFormatType fmttype, gboolean& vad)
+gint TMSIPUplink::GetVad(const TMSFormatType fmttype, gboolean& vad)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
--- a/mmserv/tms/tmscallserver/src/ipcalluplinkds.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/ipcalluplinkds.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -27,20 +27,20 @@
 using namespace TMS;
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::TMSVoIPUplink
+// TMSIPUplink::TMSIPUplink
 // Standard Constructor
 // -----------------------------------------------------------------------------
 //
-TMSVoIPUplink::TMSVoIPUplink()
+TMSIPUplink::TMSIPUplink()
     {
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::~TMSVoIPUplink
+// TMSIPUplink::~TMSIPUplink
 // Standard Constructor
 // -----------------------------------------------------------------------------
 //
-TMSVoIPUplink::~TMSVoIPUplink()
+TMSIPUplink::~TMSIPUplink()
     {
     TRACE_PRN_FN_ENT;
 
@@ -55,14 +55,14 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::NewL
+// TMSIPUplink::NewL
 // Symbian two-phase constructor
 // -----------------------------------------------------------------------------
 //
-TMSVoIPUplink* TMSVoIPUplink::NewL(const guint32 codecID,
+TMSIPUplink* TMSIPUplink::NewL(const guint32 codecID,
         const TMMFPrioritySettings priority)
     {
-    TMSVoIPUplink* self = new (ELeave) TMSVoIPUplink();
+    TMSIPUplink* self = new (ELeave) TMSIPUplink();
     CleanupStack::PushL(self);
     self->ConstructL(codecID, priority);
     CleanupStack::Pop(self);
@@ -70,11 +70,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::ConstructL
+// TMSIPUplink::ConstructL
 // Part two of Symbian two phase construction
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::ConstructL(const guint32 codecID,
+void TMSIPUplink::ConstructL(const guint32 codecID,
         const TMMFPrioritySettings priority)
     {
     TRACE_PRN_FN_ENT;
@@ -98,11 +98,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::Start
+// TMSIPUplink::Start
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::Start()
+void TMSIPUplink::Start()
     {
     TRACE_PRN_FN_ENT;
 
@@ -131,11 +131,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::Stop
+// TMSIPUplink::Stop
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::Stop()
+void TMSIPUplink::Stop()
     {
     TRACE_PRN_FN_ENT;
 
@@ -152,11 +152,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::BufferToBeEmptied
+// TMSIPUplink::BufferToBeEmptied
 // From MDevSoundObserver
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::BufferToBeEmptied(CMMFBuffer* aBuffer)
+void TMSIPUplink::BufferToBeEmptied(CMMFBuffer* aBuffer)
     {
     iDevSoundBufPtr = static_cast<CMMFDataBuffer*> (aBuffer);
     TDes8& data = iDevSoundBufPtr->Data();
@@ -201,11 +201,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::BufferEmptied
+// TMSIPUplink::BufferEmptied
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::BufferEmptied()
+void TMSIPUplink::BufferEmptied()
     {
     //TRACE_PRN_N(_L("TMS->UPL->BE"));
     if (iDevSound)
@@ -215,22 +215,22 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetCodecCi
+// TMSIPUplink::SetCodecCi
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::SetCodecCi()
+gint TMSIPUplink::SetCodecCi()
     {
     TRAPD(err, SetCodecCiL());
     return err;
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetCodecCiL
+// TMSIPUplink::SetCodecCiL
 //
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::SetCodecCiL()
+void TMSIPUplink::SetCodecCiL()
     {
     TRACE_PRN_FN_ENT;
 
@@ -281,11 +281,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetGain
+// TMSIPUplink::SetGain
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::SetGain(const guint gain)
+gint TMSIPUplink::SetGain(const guint gain)
     {
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
     if (iDevSound)
@@ -298,11 +298,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetGain
+// TMSIPUplink::GetGain
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetGain(guint& gain)
+gint TMSIPUplink::GetGain(guint& gain)
     {
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
     if (iDevSound)
@@ -315,11 +315,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetMaxGain
+// TMSIPUplink::GetMaxGain
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetMaxGain(guint& gain)
+gint TMSIPUplink::GetMaxGain(guint& gain)
     {
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
     if (iDevSound)
@@ -332,11 +332,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetDataXferChunkHndl
+// TMSIPUplink::GetDataXferChunkHndl
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk)
+gint TMSIPUplink::GetDataXferChunkHndl(const TUint32 key, RChunk& chunk)
     {
     gint status = TMS_RESULT_SUCCESS;
 
@@ -358,11 +358,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetIlbcCodecMode
+// TMSIPUplink::SetIlbcCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::SetIlbcCodecMode(const gint mode)
+gint TMSIPUplink::SetIlbcCodecMode(const gint mode)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -392,11 +392,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetIlbcCodecMode
+// TMSIPUplink::GetIlbcCodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetIlbcCodecMode(gint& mode)
+gint TMSIPUplink::GetIlbcCodecMode(gint& mode)
     {
     // not available through CIs -> return cached value
     mode = iILBCEncodeMode;
@@ -405,11 +405,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetG711CodecMode
+// TMSIPUplink::SetG711CodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::SetG711CodecMode(const gint mode)
+gint TMSIPUplink::SetG711CodecMode(const gint mode)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -439,11 +439,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetG711CodecMode
+// TMSIPUplink::GetG711CodecMode
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetG711CodecMode(gint& mode)
+gint TMSIPUplink::GetG711CodecMode(gint& mode)
     {
     // not available through CIs -> return cached value
     mode = iG711EncodeMode;
@@ -452,11 +452,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetSupportedBitrates
+// TMSIPUplink::GetSupportedBitrates
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetSupportedBitrates(RArray<guint>& bitrates)
+gint TMSIPUplink::GetSupportedBitrates(RArray<guint>& bitrates)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
     bitrates.Reset();
@@ -471,11 +471,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetBitrate
+// TMSIPUplink::SetBitrate
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::SetBitrate(guint bitrate)
+gint TMSIPUplink::SetBitrate(guint bitrate)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -490,11 +490,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetBitrate
+// TMSIPUplink::GetBitrate
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetBitrate(guint& bitrate)
+gint TMSIPUplink::GetBitrate(guint& bitrate)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -509,11 +509,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::SetVad
+// TMSIPUplink::SetVad
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::SetVad(const TMSFormatType fmttype, const gboolean vad)
+gint TMSIPUplink::SetVad(const TMSFormatType fmttype, const gboolean vad)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -566,11 +566,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::GetVad
+// TMSIPUplink::GetVad
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSVoIPUplink::GetVad(const TMSFormatType fmttype, gboolean& vad)
+gint TMSIPUplink::GetVad(const TMSFormatType fmttype, gboolean& vad)
     {
     gint err = TMS_RESULT_DOES_NOT_EXIST;
 
@@ -623,14 +623,14 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::InitializeComplete
+// 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 TMSVoIPUplink::InitializeComplete(TInt aError)
+void TMSIPUplink::InitializeComplete(TInt aError)
     {
     TRACE_PRN_FN_ENT;
 
@@ -668,13 +668,13 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSVoIPUplink::RecordError
+// TMSIPUplink::RecordError
 // From MDevSoundObserver
 // Recording error is send to the main thread.
 // The state of recorder is rolled back to EReady.
 // -----------------------------------------------------------------------------
 //
-void TMSVoIPUplink::RecordError(TInt /*aError*/)
+void TMSIPUplink::RecordError(TInt /*aError*/)
     {
     //TRACE_PRN_IF_ERR(aError);
 
--- a/mmserv/tms/tmscallserver/src/tarsettings.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/tarsettings.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -27,21 +27,21 @@
 _LIT_SECURITY_POLICY_C1(KTMSServerWritePolicy, ECapabilityWriteUserData);
 
 // -----------------------------------------------------------------------------
-// TarSettings::TarSettings
+// TMSTarSettings::TMSTarSettings
 // C++ default constructor can NOT contain any code, that
 // might leave.
 // -----------------------------------------------------------------------------
 //
-TarSettings::TarSettings()
+TMSTarSettings::TMSTarSettings()
     {
     }
 
 // -----------------------------------------------------------------------------
-// TarSettings::ConstructL
+// TMSTarSettings::ConstructL
 // Symbian 2nd phase constructor can leave.
 // -----------------------------------------------------------------------------
 //
-void TarSettings::ConstructL()
+void TMSTarSettings::ConstructL()
     {
     TRACE_PRN_FN_ENT;
     TInt err = RProperty::Define(ERoutingPs, RProperty::EByteArray,
@@ -56,13 +56,13 @@
     }
 
 // -----------------------------------------------------------------------------
-// TarSettings::NewL
+// TMSTarSettings::NewL
 // Two-phased constructor.
 // -----------------------------------------------------------------------------
 //
-TarSettings* TarSettings::NewL()
+TMSTarSettings* TMSTarSettings::NewL()
     {
-    TarSettings* self = new (ELeave) TarSettings();
+    TMSTarSettings* self = new (ELeave) TMSTarSettings();
     CleanupStack::PushL(self);
     self->ConstructL();
     CleanupStack::Pop(self);
@@ -70,19 +70,19 @@
     }
 
 // Destructor
-TarSettings::~TarSettings()
+TMSTarSettings::~TMSTarSettings()
     {
     TRACE_PRN_FN_ENT;
     TInt err = RProperty::Delete(KTMSPropertyCategory, ERoutingPs);
-    TRACE_PRN_N1(_L("TarSetting::~TarSettings err:%d"),err);
+    TRACE_PRN_N1(_L("TarSetting::~TMSTarSettings err:%d"),err);
     TRACE_PRN_FN_ENT;
     }
 
 // -----------------------------------------------------------------------------
-// TarSettings::SetVolume
+// TMSTarSettings::SetVolume
 // -----------------------------------------------------------------------------
 //
-void TarSettings::SetTar(TRoutingMsgBufPckg rountingpckg, TBool aPublish)
+void TMSTarSettings::SetTar(TRoutingMsgBufPckg rountingpckg, TBool aPublish)
     {
     TRACE_PRN_FN_ENT;
     //    TInt err(KErrNone);
--- a/mmserv/tms/tmscallserver/src/tmscallsession.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/tmscallsession.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -224,6 +224,15 @@
         case TMS_ROUTING_AVAILABLE_OUTPUT_GET:
             HandleRoutingGetAvailableOutputsL(aMessage);
             break;
+        case TMS_DTMF_START:
+            HandleDTMFStart(aMessage);
+            break;
+        case TMS_DTMF_STOP:
+            HandleDTMFStop(aMessage);
+            break;
+        case TMS_DTMF_CONTINUE:
+            HandleDTMFContinue(aMessage);
+            break;
         default:
             User::Leave(TMS_RESULT_ILLEGAL_OPERATION);
             break;
@@ -244,7 +253,7 @@
         {
         // Get Call type
         gint callType = aMessage.Int0();
-        status = CallAdpt::CreateCallL(callType, iCallAdpt);
+        status = TMSCallAdpt::CreateCallL(callType, iCallAdpt);
         }
     aMessage.Complete(status);
     TRACE_PRN_FN_EXT;
@@ -1109,4 +1118,68 @@
     aMessage.Complete(status);
     }
 
+void TMSCallSession::HandleDTMFStart(const RMessage2& aMessage)
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_DOES_NOT_EXIST);
+
+    if (iCallAdpt)
+        {
+        TMSStreamType strmtype;
+        gint len = 0;
+        strmtype = (TMSStreamType) aMessage.Int0();
+        len = aMessage.GetDesLength(1);
+        HBufC* tone(NULL);
+        if (len > 0)
+            {
+            delete tone;
+            tone = NULL;
+            TRAP(status,tone = HBufC::NewL(len));
+            if (status == KErrNone)
+                {
+                TPtr ptr = tone->Des();
+                status = aMessage.Read(1, ptr);
+                TRACE_PRN_N(ptr);
+                if (status == KErrNone)
+                    {
+                    status = iCallAdpt->StartDTMF(strmtype, ptr);
+                    }
+                }
+            delete tone;
+            tone = NULL;
+            }
+        }
+
+    aMessage.Complete(status);
+    TRACE_PRN_FN_EXT;
+    }
+
+void TMSCallSession::HandleDTMFStop(const RMessage2& aMessage)
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_DOES_NOT_EXIST);
+    if (iCallAdpt)
+        {
+        TMSStreamType streamtype;
+        streamtype = (TMSStreamType) aMessage.Int0();
+        status = iCallAdpt->StopDTMF(streamtype);
+        }
+    aMessage.Complete(status);
+    TRACE_PRN_FN_EXT;
+    }
+
+void TMSCallSession::HandleDTMFContinue(const RMessage2& aMessage)
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_DOES_NOT_EXIST);
+    if (iCallAdpt)
+        {
+        TBool continuesending;
+        continuesending = (TBool) aMessage.Int0();
+        status = iCallAdpt->ContinueDTMF(continuesending);
+        }
+    aMessage.Complete(status);
+    TRACE_PRN_FN_EXT;
+    }
+
 // End of file
--- a/mmserv/tms/tmsfactory/bwins/tmsfactory.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsfactory/bwins/tmsfactory.def	Fri Apr 16 15:29:42 2010 +0300
@@ -1,20 +1,27 @@
 EXPORTS
-	?CreateSink@TMSFactory@TMS@@QAEHHAAPAVTMSSink@2@@Z @ 1 NONAME ; int TMS::TMSFactory::CreateSink(int, class TMS::TMSSink * &)
-	?DeleteFormat@TMSFactory@TMS@@QAEHAAPAVTMSFormat@2@@Z @ 2 NONAME ; int TMS::TMSFactory::DeleteFormat(class TMS::TMSFormat * &)
-	?CreateFactory@TMSFactory@TMS@@SAHAAPAV12@AAVTMSVer@2@@Z @ 3 NONAME ; int TMS::TMSFactory::CreateFactory(class TMS::TMSFactory * &, class TMS::TMSVer &)
-	?DeleteSource@TMSFactory@TMS@@QAEHAAPAVTMSSource@2@@Z @ 4 NONAME ; int TMS::TMSFactory::DeleteSource(class TMS::TMSSource * &)
-	?DeleteEffect@TMSFactory@TMS@@QAEHAAPAVTMSEffect@2@@Z @ 5 NONAME ; int TMS::TMSFactory::DeleteEffect(class TMS::TMSEffect * &)
+	?DeleteFormat@TMSFactory@TMS@@QAEHAAPAVTMSFormat@2@@Z @ 1 NONAME ; int TMS::TMSFactory::DeleteFormat(class TMS::TMSFormat * &)
+	?DeleteDTMF@TMSFactory@TMS@@QAEHAAPAVTMSDTMF@2@@Z @ 2 NONAME ; int TMS::TMSFactory::DeleteDTMF(class TMS::TMSDTMF * &)
+	?DeleteSource@TMSFactory@TMS@@QAEHAAPAVTMSSource@2@@Z @ 3 NONAME ; int TMS::TMSFactory::DeleteSource(class TMS::TMSSource * &)
+	?DeleteEffect@TMSFactory@TMS@@QAEHAAPAVTMSEffect@2@@Z @ 4 NONAME ; int TMS::TMSFactory::DeleteEffect(class TMS::TMSEffect * &)
+	?CreateInbandTonePlayer@TMSFactory@TMS@@QAEHAAPAVTMSInbandTone@2@@Z @ 5 NONAME ; int TMS::TMSFactory::CreateInbandTonePlayer(class TMS::TMSInbandTone * &)
 	?CreateBuffer@TMSFactory@TMS@@QAEHHIAAPAVTMSBuffer@2@@Z @ 6 NONAME ; int TMS::TMSFactory::CreateBuffer(int, unsigned int, class TMS::TMSBuffer * &)
 	?CreateEffect@TMSFactory@TMS@@QAEHHAAPAVTMSEffect@2@@Z @ 7 NONAME ; int TMS::TMSFactory::CreateEffect(int, class TMS::TMSEffect * &)
-	?DeleteSink@TMSFactory@TMS@@QAEHAAPAVTMSSink@2@@Z @ 8 NONAME ; int TMS::TMSFactory::DeleteSink(class TMS::TMSSink * &)
+	?CreateRingTonePlayer@TMSFactory@TMS@@QAEHAAPAVTMSRingTone@2@@Z @ 8 NONAME ; int TMS::TMSFactory::CreateRingTonePlayer(class TMS::TMSRingTone * &)
 	?IsCallTypeSupported@TMSFactory@TMS@@QAEHHAAH@Z @ 9 NONAME ; int TMS::TMSFactory::IsCallTypeSupported(int, int &)
-	?GetSupportedFormats@TMSFactory@TMS@@QAEHHAAV?$vector@PAVTMSFormat@TMS@@V?$allocator@PAVTMSFormat@TMS@@@std@@@std@@@Z @ 10 NONAME ; int TMS::TMSFactory::GetSupportedFormats(int, class std::vector<class TMS::TMSFormat *, class std::allocator<class TMS::TMSFormat *> > &)
-	?DeleteBuffer@TMSFactory@TMS@@QAEHAAPAVTMSBuffer@2@@Z @ 11 NONAME ; int TMS::TMSFactory::DeleteBuffer(class TMS::TMSBuffer * &)
-	?CreateCall@TMSFactory@TMS@@QAEHHAAPAVTMSCall@2@I@Z @ 12 NONAME ; int TMS::TMSFactory::CreateCall(int, class TMS::TMSCall * &, unsigned int)
-	?CreateSource@TMSFactory@TMS@@QAEHHAAPAVTMSSource@2@@Z @ 13 NONAME ; int TMS::TMSFactory::CreateSource(int, class TMS::TMSSource * &)
-	?CreateGlobalRouting@TMSFactory@TMS@@QAEHAAPAVTMSGlobalRouting@2@@Z @ 14 NONAME ; int TMS::TMSFactory::CreateGlobalRouting(class TMS::TMSGlobalRouting * &)
-	?DeleteGlobalRouting@TMSFactory@TMS@@QAEHAAPAVTMSGlobalRouting@2@@Z @ 15 NONAME ; int TMS::TMSFactory::DeleteGlobalRouting(class TMS::TMSGlobalRouting * &)
-	??1TMSFactory@TMS@@UAE@XZ @ 16 NONAME ; TMS::TMSFactory::~TMSFactory(void)
-	?DeleteCall@TMSFactory@TMS@@QAEHAAPAVTMSCall@2@@Z @ 17 NONAME ; int TMS::TMSFactory::DeleteCall(class TMS::TMSCall * &)
-	?CreateFormat@TMSFactory@TMS@@QAEHHAAPAVTMSFormat@2@@Z @ 18 NONAME ; int TMS::TMSFactory::CreateFormat(int, class TMS::TMSFormat * &)
+	?DeleteBuffer@TMSFactory@TMS@@QAEHAAPAVTMSBuffer@2@@Z @ 10 NONAME ; int TMS::TMSFactory::DeleteBuffer(class TMS::TMSBuffer * &)
+	?CreateCall@TMSFactory@TMS@@QAEHHAAPAVTMSCall@2@I@Z @ 11 NONAME ; int TMS::TMSFactory::CreateCall(int, class TMS::TMSCall * &, unsigned int)
+	?CreateSource@TMSFactory@TMS@@QAEHHAAPAVTMSSource@2@@Z @ 12 NONAME ; int TMS::TMSFactory::CreateSource(int, class TMS::TMSSource * &)
+	?CreateGlobalRouting@TMSFactory@TMS@@QAEHAAPAVTMSGlobalRouting@2@@Z @ 13 NONAME ; int TMS::TMSFactory::CreateGlobalRouting(class TMS::TMSGlobalRouting * &)
+	?CreateDTMF@TMSFactory@TMS@@QAEHHAAPAVTMSDTMF@2@@Z @ 14 NONAME ; int TMS::TMSFactory::CreateDTMF(int, class TMS::TMSDTMF * &)
+	?DeleteCall@TMSFactory@TMS@@QAEHAAPAVTMSCall@2@@Z @ 15 NONAME ; int TMS::TMSFactory::DeleteCall(class TMS::TMSCall * &)
+	?CreateSink@TMSFactory@TMS@@QAEHHAAPAVTMSSink@2@@Z @ 16 NONAME ; int TMS::TMSFactory::CreateSink(int, class TMS::TMSSink * &)
+	?CreateFactory@TMSFactory@TMS@@SAHAAPAV12@AAVTMSVer@2@@Z @ 17 NONAME ; int TMS::TMSFactory::CreateFactory(class TMS::TMSFactory * &, class TMS::TMSVer &)
+	?CreateRingTonePlayer@TMSFactory@TMS@@QAEHAAPAVTMSRingTone@2@AAVRWindow@@H@Z @ 18 NONAME ; int TMS::TMSFactory::CreateRingTonePlayer(class TMS::TMSRingTone * &, class RWindow &, int)
+	?DeleteInbandTonePlayer@TMSFactory@TMS@@QAEHAAPAVTMSInbandTone@2@@Z @ 19 NONAME ; int TMS::TMSFactory::DeleteInbandTonePlayer(class TMS::TMSInbandTone * &)
+	?DeleteSink@TMSFactory@TMS@@QAEHAAPAVTMSSink@2@@Z @ 20 NONAME ; int TMS::TMSFactory::DeleteSink(class TMS::TMSSink * &)
+	?GetSupportedFormats@TMSFactory@TMS@@QAEHHAAV?$vector@PAVTMSFormat@TMS@@V?$allocator@PAVTMSFormat@TMS@@@std@@@std@@@Z @ 21 NONAME ; int TMS::TMSFactory::GetSupportedFormats(int, class std::vector<class TMS::TMSFormat *, class std::allocator<class TMS::TMSFormat *> > &)
+	??1TMSFactory@TMS@@UAE@XZ @ 22 NONAME ; TMS::TMSFactory::~TMSFactory(void)
+	?DeleteGlobalRouting@TMSFactory@TMS@@QAEHAAPAVTMSGlobalRouting@2@@Z @ 23 NONAME ; int TMS::TMSFactory::DeleteGlobalRouting(class TMS::TMSGlobalRouting * &)
+	?DeleteRingTonePlayer@TMSFactory@TMS@@QAEHAAPAVTMSRingTone@2@@Z @ 24 NONAME ; int TMS::TMSFactory::DeleteRingTonePlayer(class TMS::TMSRingTone * &)
+	?CreateFormat@TMSFactory@TMS@@QAEHHAAPAVTMSFormat@2@@Z @ 25 NONAME ; int TMS::TMSFactory::CreateFormat(int, class TMS::TMSFormat * &)
 
--- a/mmserv/tms/tmsfactory/eabi/tmsfactory.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsfactory/eabi/tmsfactory.def	Fri Apr 16 15:29:42 2010 +0300
@@ -1,26 +1,33 @@
 EXPORTS
 	_ZN3TMS10TMSFactory10CreateCallEiRPNS_7TMSCallEj @ 1 NONAME
-	_ZN3TMS10TMSFactory10CreateSinkEiRPNS_7TMSSinkE @ 2 NONAME
-	_ZN3TMS10TMSFactory10DeleteCallERPNS_7TMSCallE @ 3 NONAME
-	_ZN3TMS10TMSFactory10DeleteSinkERPNS_7TMSSinkE @ 4 NONAME
-	_ZN3TMS10TMSFactory12CreateBufferEijRPNS_9TMSBufferE @ 5 NONAME
-	_ZN3TMS10TMSFactory12CreateEffectEiRPNS_9TMSEffectE @ 6 NONAME
-	_ZN3TMS10TMSFactory12CreateFormatEiRPNS_9TMSFormatE @ 7 NONAME
-	_ZN3TMS10TMSFactory12CreateSourceEiRPNS_9TMSSourceE @ 8 NONAME
-	_ZN3TMS10TMSFactory12DeleteBufferERPNS_9TMSBufferE @ 9 NONAME
-	_ZN3TMS10TMSFactory12DeleteEffectERPNS_9TMSEffectE @ 10 NONAME
-	_ZN3TMS10TMSFactory12DeleteFormatERPNS_9TMSFormatE @ 11 NONAME
-	_ZN3TMS10TMSFactory12DeleteSourceERPNS_9TMSSourceE @ 12 NONAME
-	_ZN3TMS10TMSFactory13CreateFactoryERPS0_RNS_6TMSVerE @ 13 NONAME
-	_ZN3TMS10TMSFactory19CreateGlobalRoutingERPNS_16TMSGlobalRoutingE @ 14 NONAME
-	_ZN3TMS10TMSFactory19DeleteGlobalRoutingERPNS_16TMSGlobalRoutingE @ 15 NONAME
-	_ZN3TMS10TMSFactory19GetSupportedFormatsEiRSt6vectorIPNS_9TMSFormatESaIS3_EE @ 16 NONAME
-	_ZN3TMS10TMSFactory19IsCallTypeSupportedEiRi @ 17 NONAME
-	_ZN3TMS10TMSFactoryD0Ev @ 18 NONAME
-	_ZN3TMS10TMSFactoryD1Ev @ 19 NONAME
-	_ZN3TMS10TMSFactoryD2Ev @ 20 NONAME
-	_ZTIN3TMS10TMSFactoryE @ 21 NONAME
-	_ZTIN3TMS14TMSFactoryImplE @ 22 NONAME
-	_ZTVN3TMS10TMSFactoryE @ 23 NONAME
-	_ZTVN3TMS14TMSFactoryImplE @ 24 NONAME
+	_ZN3TMS10TMSFactory10CreateDTMFEiRPNS_7TMSDTMFE @ 2 NONAME
+	_ZN3TMS10TMSFactory10CreateSinkEiRPNS_7TMSSinkE @ 3 NONAME
+	_ZN3TMS10TMSFactory10DeleteCallERPNS_7TMSCallE @ 4 NONAME
+	_ZN3TMS10TMSFactory10DeleteDTMFERPNS_7TMSDTMFE @ 5 NONAME
+	_ZN3TMS10TMSFactory10DeleteSinkERPNS_7TMSSinkE @ 6 NONAME
+	_ZN3TMS10TMSFactory12CreateBufferEijRPNS_9TMSBufferE @ 7 NONAME
+	_ZN3TMS10TMSFactory12CreateEffectEiRPNS_9TMSEffectE @ 8 NONAME
+	_ZN3TMS10TMSFactory12CreateFormatEiRPNS_9TMSFormatE @ 9 NONAME
+	_ZN3TMS10TMSFactory12CreateSourceEiRPNS_9TMSSourceE @ 10 NONAME
+	_ZN3TMS10TMSFactory12DeleteBufferERPNS_9TMSBufferE @ 11 NONAME
+	_ZN3TMS10TMSFactory12DeleteEffectERPNS_9TMSEffectE @ 12 NONAME
+	_ZN3TMS10TMSFactory12DeleteFormatERPNS_9TMSFormatE @ 13 NONAME
+	_ZN3TMS10TMSFactory12DeleteSourceERPNS_9TMSSourceE @ 14 NONAME
+	_ZN3TMS10TMSFactory13CreateFactoryERPS0_RNS_6TMSVerE @ 15 NONAME
+	_ZN3TMS10TMSFactory19CreateGlobalRoutingERPNS_16TMSGlobalRoutingE @ 16 NONAME
+	_ZN3TMS10TMSFactory19DeleteGlobalRoutingERPNS_16TMSGlobalRoutingE @ 17 NONAME
+	_ZN3TMS10TMSFactory19GetSupportedFormatsEiRSt6vectorIPNS_9TMSFormatESaIS3_EE @ 18 NONAME
+	_ZN3TMS10TMSFactory19IsCallTypeSupportedEiRi @ 19 NONAME
+	_ZN3TMS10TMSFactory20CreateRingTonePlayerERPNS_11TMSRingToneE @ 20 NONAME
+	_ZN3TMS10TMSFactory20CreateRingTonePlayerERPNS_11TMSRingToneER7RWindowi @ 21 NONAME
+	_ZN3TMS10TMSFactory20DeleteRingTonePlayerERPNS_11TMSRingToneE @ 22 NONAME
+	_ZN3TMS10TMSFactory22CreateInbandTonePlayerERPNS_13TMSInbandToneE @ 23 NONAME
+	_ZN3TMS10TMSFactory22DeleteInbandTonePlayerERPNS_13TMSInbandToneE @ 24 NONAME
+	_ZN3TMS10TMSFactoryD0Ev @ 25 NONAME
+	_ZN3TMS10TMSFactoryD1Ev @ 26 NONAME
+	_ZN3TMS10TMSFactoryD2Ev @ 27 NONAME
+	_ZTIN3TMS10TMSFactoryE @ 28 NONAME
+	_ZTIN3TMS14TMSFactoryImplE @ 29 NONAME
+	_ZTVN3TMS10TMSFactoryE @ 30 NONAME
+	_ZTVN3TMS14TMSFactoryImplE @ 31 NONAME
 
--- a/mmserv/tms/tmsfactory/group/tmsfactory.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsfactory/group/tmsfactory.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -33,7 +33,7 @@
 MW_LAYER_SYSTEMINCLUDE
 OS_LAYER_LIBC_SYSTEMINCLUDE
 OS_LAYER_GLIB_SYSTEMINCLUDE
-SYSTEMINCLUDE   /epoc32/include/stdapis/stlport
+OS_LAYER_STDCPP_SYSTEMINCLUDE
 SYSTEMINCLUDE   /epoc32/include/mmf/common
 
 SOURCEPATH      ../src
--- a/mmserv/tms/tmsfactory/inc/tmsfactoryimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsfactory/inc/tmsfactoryimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -19,6 +19,7 @@
 #define TMSFACTORYIMPL_H_
 
 #include <e32cmn.h>
+#include <w32std.h>
 #include <tms.h>
 
 namespace TMS {
@@ -31,6 +32,8 @@
 class TMSSource;
 class TMSSink;
 class TMSGlobalRouting;
+class TMSDTMF;
+class TMSInbandTone;
 
 // CLASS DECLARATION
 class TMSFactoryImpl
@@ -57,6 +60,13 @@
     gint DeleteSink(TMSSink*& tmssink);
     gint CreateGlobalRouting(TMSGlobalRouting*& globrouting);
     gint DeleteGlobalRouting(TMSGlobalRouting*& globrouting);
+    gint CreateDTMF(TMSStreamType streamid, TMSDTMF*& dtmf);
+    gint DeleteDTMF(TMSDTMF*& dtmf);
+    gint CreateRingTonePlayer(TMSRingTone*& rt);
+    gint CreateRingTonePlayer(TMSRingTone*& rt, RWindow& window, gint scrid);
+    gint DeleteRingTonePlayer(TMSRingTone*& rt);
+    gint CreateInbandTonePlayer(TMSInbandTone*& inbandtone);
+    gint DeleteInbandTonePlayer(TMSInbandTone*& inbandtone);
 
 private:
     gint QueryDevice(const TMSStreamType strmtype);
@@ -68,4 +78,5 @@
 
 } //namespace TMS
 
-#endif
+#endif //TMSFACTORYIMPL_H_
+
--- a/mmserv/tms/tmsfactory/src/tmsfactory.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsfactory/src/tmsfactory.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -30,7 +30,8 @@
     delete impl;
     }
 
-EXPORT_C gint TMSFactory::CreateFactory(TMSFactory*& tmsfactory, TMSVer& /*ver*/)
+EXPORT_C gint TMSFactory::CreateFactory(TMSFactory*& tmsfactory,
+        TMSVer& /*ver*/)
     {
     TMSFactory* self = new TMSFactory();
     tmsfactory = self;
@@ -58,7 +59,8 @@
     return status;
     }
 
-EXPORT_C gint TMSFactory::IsCallTypeSupported(TMSCallType ctype, gboolean& flag)
+EXPORT_C gint TMSFactory::IsCallTypeSupported(TMSCallType ctype,
+        gboolean& flag)
     {
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
     if (impl)
@@ -203,3 +205,74 @@
     return status;
     }
 
+EXPORT_C gint TMSFactory::CreateDTMF(TMSStreamType streamtype, TMSDTMF*& dtmf)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (impl)
+        {
+        status = impl->CreateDTMF(streamtype, dtmf);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSFactory::DeleteDTMF(TMSDTMF*& dtmf)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (impl)
+        {
+        status = impl->DeleteDTMF(dtmf);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSFactory::CreateRingTonePlayer(TMSRingTone*& rt)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (impl)
+        {
+        status = impl->CreateRingTonePlayer(rt);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSFactory::CreateRingTonePlayer(TMSRingTone*& rt,
+        RWindow& window, gint scrid)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (impl)
+        {
+        status = impl->CreateRingTonePlayer(rt, window, scrid);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSFactory::DeleteRingTonePlayer(TMSRingTone*& rt)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (impl)
+        {
+        status = impl->DeleteRingTonePlayer(rt);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSFactory::CreateInbandTonePlayer(TMSInbandTone*& inbandtone)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (impl)
+        {
+        status = impl->CreateInbandTonePlayer(inbandtone);
+        }
+    return status;
+    }
+
+EXPORT_C gint TMSFactory::DeleteInbandTonePlayer(TMSInbandTone*& inbandtone)
+    {
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    if (impl)
+        {
+        status = impl->DeleteInbandTonePlayer(inbandtone);
+        }
+    return status;
+    }
+
--- a/mmserv/tms/tmsfactory/src/tmsfactoryimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsfactory/src/tmsfactoryimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,15 +15,6 @@
  *
  */
 
-#include <tms.h>
-#include <tmscall.h>
-#include <tmsformat.h>
-#include <tmseffect.h>
-#include <tmsbuffer.h>
-#include <tmssource.h>
-#include <tmssink.h>
-#include "tmsutility.h"
-#include "tmsproxy.h"
 #include "tmscallimpl.h"
 #include "tmsformatimpl.h"
 #include "tmseffectimpl.h"
@@ -31,6 +22,13 @@
 #include "tmssourceimpl.h"
 #include "tmssinkimpl.h"
 #include "tmsglobalroutingimpl.h"
+#include "tmsringtoneimpl.h"
+#include "tmsdtmfimpl.h"
+#include "tmsinbandtoneimpl.h"
+//#include "tmsrtpsessionimpl.h"
+
+#include "tmsutility.h"
+#include "tmsproxy.h"
 #include "tmsfactoryimpl.h"
 
 using namespace TMS;
@@ -57,9 +55,7 @@
 gint TMSFactoryImpl::DeleteCall(TMSCall*& tmscall)
     {
     gint ret(TMS_RESULT_SUCCESS);
-    // TODO put the delete in the impl
-    delete tmscall; //iTMSCall
-    tmscall = NULL;
+    ret = TMSCallImpl::Delete(tmscall);
     return ret;
     }
 
@@ -200,6 +196,56 @@
     return ret;
     }
 
+gint TMSFactoryImpl::CreateDTMF(TMSStreamType streamtype, TMSDTMF*& dtmf)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    ret = TMSDTMFImpl::Create(streamtype, dtmf);
+    return ret;
+    }
+
+gint TMSFactoryImpl::DeleteDTMF(TMSDTMF*& dtmf)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    ret = TMSDTMFImpl::Delete(dtmf);
+    return ret;
+    }
+
+gint TMSFactoryImpl::CreateRingTonePlayer(TMSRingTone*& rt)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    ret = TMSRingToneImpl::Create(rt);
+    return ret;
+    }
+
+gint TMSFactoryImpl::CreateRingTonePlayer(TMSRingTone*& rt, RWindow& window,
+        gint scrid)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    ret = TMSRingToneImpl::Create(rt, window, scrid);
+    return ret;
+    }
+
+gint TMSFactoryImpl::DeleteRingTonePlayer(TMSRingTone*& rt)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    ret = TMSRingToneImpl::Delete(rt);
+    return ret;
+    }
+
+gint TMSFactoryImpl::CreateInbandTonePlayer(TMSInbandTone*& inbandtone)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    ret = TMSInbandToneImpl::Create(inbandtone);
+    return ret;
+    }
+
+gint TMSFactoryImpl::DeleteInbandTonePlayer(TMSInbandTone*& inbandtone)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    ret = TMSInbandToneImpl::Delete(inbandtone);
+    return ret;
+    }
+
 gint TMSFactoryImpl::QueryDevice(const TMSStreamType strmtype)
     {
     gint ret(TMS_RESULT_SUCCESS);
--- a/mmserv/tms/tmsimpl/bwins/tmsimpl.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/bwins/tmsimpl.def	Fri Apr 16 15:29:42 2010 +0300
@@ -1,15 +1,23 @@
 EXPORTS
-	?Delete@TMSGlobalRoutingImpl@TMS@@SAHAAPAVTMSGlobalRouting@2@@Z @ 1 NONAME ; int TMS::TMSGlobalRoutingImpl::Delete(class TMS::TMSGlobalRouting * &)
-	?Create@TMSEffectImpl@TMS@@SAHHAAPAVTMSEffect@2@@Z @ 2 NONAME ; int TMS::TMSEffectImpl::Create(int, class TMS::TMSEffect * &)
-	?Create@TMSSinkImpl@TMS@@SAHHAAPAVTMSSink@2@@Z @ 3 NONAME ; int TMS::TMSSinkImpl::Create(int, class TMS::TMSSink * &)
+	?Create@TMSEffectImpl@TMS@@SAHHAAPAVTMSEffect@2@@Z @ 1 NONAME ; int TMS::TMSEffectImpl::Create(int, class TMS::TMSEffect * &)
+	?Create@TMSDTMFImpl@TMS@@SAHHAAPAVTMSDTMF@2@@Z @ 2 NONAME ; int TMS::TMSDTMFImpl::Create(int, class TMS::TMSDTMF * &)
+	?Delete@TMSDTMFImpl@TMS@@SAHAAPAVTMSDTMF@2@@Z @ 3 NONAME ; int TMS::TMSDTMFImpl::Delete(class TMS::TMSDTMF * &)
 	?Create@TMSSourceImpl@TMS@@SAHHAAPAVTMSSource@2@@Z @ 4 NONAME ; int TMS::TMSSourceImpl::Create(int, class TMS::TMSSource * &)
-	?Delete@TMSFormatImpl@TMS@@SAHAAPAVTMSFormat@2@@Z @ 5 NONAME ; int TMS::TMSFormatImpl::Delete(class TMS::TMSFormat * &)
-	?Create@TMSFormatImpl@TMS@@SAHHAAPAVTMSFormat@2@@Z @ 6 NONAME ; int TMS::TMSFormatImpl::Create(int, class TMS::TMSFormat * &)
-	?Delete@TMSSinkImpl@TMS@@SAHAAPAVTMSSink@2@@Z @ 7 NONAME ; int TMS::TMSSinkImpl::Delete(class TMS::TMSSink * &)
-	?Delete@TMSBufferImpl@TMS@@SAHAAPAVTMSBuffer@2@@Z @ 8 NONAME ; int TMS::TMSBufferImpl::Delete(class TMS::TMSBuffer * &)
-	?Delete@TMSSourceImpl@TMS@@SAHAAPAVTMSSource@2@@Z @ 9 NONAME ; int TMS::TMSSourceImpl::Delete(class TMS::TMSSource * &)
-	?Delete@TMSEffectImpl@TMS@@SAHAAPAVTMSEffect@2@@Z @ 10 NONAME ; int TMS::TMSEffectImpl::Delete(class TMS::TMSEffect * &)
-	?Create@TMSGlobalRoutingImpl@TMS@@SAHAAPAVTMSGlobalRouting@2@@Z @ 11 NONAME ; int TMS::TMSGlobalRoutingImpl::Create(class TMS::TMSGlobalRouting * &)
-	?Create@TMSBufferImpl@TMS@@SAHHIAAPAVTMSBuffer@2@@Z @ 12 NONAME ; int TMS::TMSBufferImpl::Create(int, unsigned int, class TMS::TMSBuffer * &)
-	?Create@TMSCallImpl@TMS@@SAHHAAPAVTMSCall@2@I@Z @ 13 NONAME ; int TMS::TMSCallImpl::Create(int, class TMS::TMSCall * &, unsigned int)
+	?Delete@TMSRingToneImpl@TMS@@SAHAAPAVTMSRingTone@2@@Z @ 5 NONAME ; int TMS::TMSRingToneImpl::Delete(class TMS::TMSRingTone * &)
+	?Create@TMSRingToneImpl@TMS@@SAHAAPAVTMSRingTone@2@@Z @ 6 NONAME ; int TMS::TMSRingToneImpl::Create(class TMS::TMSRingTone * &)
+	?Delete@TMSFormatImpl@TMS@@SAHAAPAVTMSFormat@2@@Z @ 7 NONAME ; int TMS::TMSFormatImpl::Delete(class TMS::TMSFormat * &)
+	?Delete@TMSCallImpl@TMS@@SAHAAPAVTMSCall@2@@Z @ 8 NONAME ; int TMS::TMSCallImpl::Delete(class TMS::TMSCall * &)
+	?Delete@TMSSinkImpl@TMS@@SAHAAPAVTMSSink@2@@Z @ 9 NONAME ; int TMS::TMSSinkImpl::Delete(class TMS::TMSSink * &)
+	?Delete@TMSBufferImpl@TMS@@SAHAAPAVTMSBuffer@2@@Z @ 10 NONAME ; int TMS::TMSBufferImpl::Delete(class TMS::TMSBuffer * &)
+	?Delete@TMSSourceImpl@TMS@@SAHAAPAVTMSSource@2@@Z @ 11 NONAME ; int TMS::TMSSourceImpl::Delete(class TMS::TMSSource * &)
+	?Delete@TMSEffectImpl@TMS@@SAHAAPAVTMSEffect@2@@Z @ 12 NONAME ; int TMS::TMSEffectImpl::Delete(class TMS::TMSEffect * &)
+	?Create@TMSBufferImpl@TMS@@SAHHIAAPAVTMSBuffer@2@@Z @ 13 NONAME ; int TMS::TMSBufferImpl::Create(int, unsigned int, class TMS::TMSBuffer * &)
+	?Create@TMSCallImpl@TMS@@SAHHAAPAVTMSCall@2@I@Z @ 14 NONAME ; int TMS::TMSCallImpl::Create(int, class TMS::TMSCall * &, unsigned int)
+	?Delete@TMSGlobalRoutingImpl@TMS@@SAHAAPAVTMSGlobalRouting@2@@Z @ 15 NONAME ; int TMS::TMSGlobalRoutingImpl::Delete(class TMS::TMSGlobalRouting * &)
+	?Create@TMSRingToneImpl@TMS@@SAHAAPAVTMSRingTone@2@AAVRWindow@@H@Z @ 16 NONAME ; int TMS::TMSRingToneImpl::Create(class TMS::TMSRingTone * &, class RWindow &, int)
+	?Delete@TMSInbandToneImpl@TMS@@SAHAAPAVTMSInbandTone@2@@Z @ 17 NONAME ; int TMS::TMSInbandToneImpl::Delete(class TMS::TMSInbandTone * &)
+	?Create@TMSSinkImpl@TMS@@SAHHAAPAVTMSSink@2@@Z @ 18 NONAME ; int TMS::TMSSinkImpl::Create(int, class TMS::TMSSink * &)
+	?Create@TMSInbandToneImpl@TMS@@SAHAAPAVTMSInbandTone@2@@Z @ 19 NONAME ; int TMS::TMSInbandToneImpl::Create(class TMS::TMSInbandTone * &)
+	?Create@TMSFormatImpl@TMS@@SAHHAAPAVTMSFormat@2@@Z @ 20 NONAME ; int TMS::TMSFormatImpl::Create(int, class TMS::TMSFormat * &)
+	?Create@TMSGlobalRoutingImpl@TMS@@SAHAAPAVTMSGlobalRouting@2@@Z @ 21 NONAME ; int TMS::TMSGlobalRoutingImpl::Create(class TMS::TMSGlobalRouting * &)
 
--- a/mmserv/tms/tmsimpl/eabi/tmsimpl.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/eabi/tmsimpl.def	Fri Apr 16 15:29:42 2010 +0300
@@ -1,93 +1,117 @@
 EXPORTS
 	_ZN3TMS11TMSCallImpl6CreateEiRPNS_7TMSCallEj @ 1 NONAME
-	_ZN3TMS11TMSSinkImpl6CreateEiRPNS_7TMSSinkE @ 2 NONAME
-	_ZN3TMS11TMSSinkImpl6DeleteERPNS_7TMSSinkE @ 3 NONAME
-	_ZN3TMS13TMSBufferImpl6CreateEijRPNS_9TMSBufferE @ 4 NONAME
-	_ZN3TMS13TMSBufferImpl6DeleteERPNS_9TMSBufferE @ 5 NONAME
-	_ZN3TMS13TMSEffectImpl6CreateEiRPNS_9TMSEffectE @ 6 NONAME
-	_ZN3TMS13TMSEffectImpl6DeleteERPNS_9TMSEffectE @ 7 NONAME
-	_ZN3TMS13TMSFormatImpl6CreateEiRPNS_9TMSFormatE @ 8 NONAME
-	_ZN3TMS13TMSFormatImpl6DeleteERPNS_9TMSFormatE @ 9 NONAME
-	_ZN3TMS13TMSSourceImpl6CreateEiRPNS_9TMSSourceE @ 10 NONAME
-	_ZN3TMS13TMSSourceImpl6DeleteERPNS_9TMSSourceE @ 11 NONAME
-	_ZN3TMS20TMSGlobalRoutingImpl6CreateERPNS_16TMSGlobalRoutingE @ 12 NONAME
-	_ZN3TMS20TMSGlobalRoutingImpl6DeleteERPNS_16TMSGlobalRoutingE @ 13 NONAME
-	_ZTIN3TMS11TMSCallImplE @ 14 NONAME
-	_ZTIN3TMS12TMSMemBufferE @ 15 NONAME
-	_ZTIN3TMS15TMSCallBodyImplE @ 16 NONAME
-	_ZTIN3TMS16TMSAMRFormatImplE @ 17 NONAME
-	_ZTIN3TMS16TMSMicSourceImplE @ 18 NONAME
-	_ZTIN3TMS16TMSModemSinkImplE @ 19 NONAME
-	_ZTIN3TMS16TMSPCMFormatImplE @ 20 NONAME
-	_ZTIN3TMS17TMSCSCallBodyImplE @ 21 NONAME
-	_ZTIN3TMS17TMSClientSinkImplE @ 22 NONAME
-	_ZTIN3TMS17TMSFormatBodyImplE @ 23 NONAME
-	_ZTIN3TMS17TMSG711FormatImplE @ 24 NONAME
-	_ZTIN3TMS17TMSG729FormatImplE @ 25 NONAME
-	_ZTIN3TMS17TMSGainEffectImplE @ 26 NONAME
-	_ZTIN3TMS17TMSILBCFormatImplE @ 27 NONAME
-	_ZTIN3TMS17TMSIPCallBodyImplE @ 28 NONAME
-	_ZTIN3TMS17TMSStreamBodyImplE @ 29 NONAME
-	_ZTIN3TMS18TMSModemSourceImplE @ 30 NONAME
-	_ZTIN3TMS18TMSSpeakerSinkImplE @ 31 NONAME
-	_ZTIN3TMS19TMSClientSourceImplE @ 32 NONAME
-	_ZTIN3TMS19TMSVolumeEffectImplE @ 33 NONAME
-	_ZTIN3TMS20TMSAMRFormatBodyImplE @ 34 NONAME
-	_ZTIN3TMS20TMSGlobalRoutingImplE @ 35 NONAME
-	_ZTIN3TMS20TMSMicSourceBodyImplE @ 36 NONAME
-	_ZTIN3TMS20TMSModemSinkBodyImplE @ 37 NONAME
-	_ZTIN3TMS20TMSPCMFormatBodyImplE @ 38 NONAME
-	_ZTIN3TMS21TMSClientSinkBodyImplE @ 39 NONAME
-	_ZTIN3TMS21TMSG711FormatBodyImplE @ 40 NONAME
-	_ZTIN3TMS21TMSG729FormatBodyImplE @ 41 NONAME
-	_ZTIN3TMS21TMSGainEffectBodyImplE @ 42 NONAME
-	_ZTIN3TMS21TMSILBCFormatBodyImplE @ 43 NONAME
-	_ZTIN3TMS22TMSGlobalVolEffectImplE @ 44 NONAME
-	_ZTIN3TMS22TMSModemSourceBodyImplE @ 45 NONAME
-	_ZTIN3TMS22TMSSpeakerSinkBodyImplE @ 46 NONAME
-	_ZTIN3TMS23TMSClientSourceBodyImplE @ 47 NONAME
-	_ZTIN3TMS23TMSGlobalGainEffectImplE @ 48 NONAME
-	_ZTIN3TMS23TMSVolumeEffectBodyImplE @ 49 NONAME
-	_ZTIN3TMS24TMSGlobalRoutingBodyImplE @ 50 NONAME
-	_ZTIN3TMS26TMSGlobalVolEffectBodyImplE @ 51 NONAME
-	_ZTIN3TMS27TMSGlobalGainEffectBodyImplE @ 52 NONAME
-	_ZTVN3TMS11TMSCallImplE @ 53 NONAME
-	_ZTVN3TMS12TMSMemBufferE @ 54 NONAME
-	_ZTVN3TMS15TMSCallBodyImplE @ 55 NONAME
-	_ZTVN3TMS16TMSAMRFormatImplE @ 56 NONAME
-	_ZTVN3TMS16TMSMicSourceImplE @ 57 NONAME
-	_ZTVN3TMS16TMSModemSinkImplE @ 58 NONAME
-	_ZTVN3TMS16TMSPCMFormatImplE @ 59 NONAME
-	_ZTVN3TMS17TMSCSCallBodyImplE @ 60 NONAME
-	_ZTVN3TMS17TMSClientSinkImplE @ 61 NONAME
-	_ZTVN3TMS17TMSFormatBodyImplE @ 62 NONAME
-	_ZTVN3TMS17TMSG711FormatImplE @ 63 NONAME
-	_ZTVN3TMS17TMSG729FormatImplE @ 64 NONAME
-	_ZTVN3TMS17TMSGainEffectImplE @ 65 NONAME
-	_ZTVN3TMS17TMSILBCFormatImplE @ 66 NONAME
-	_ZTVN3TMS17TMSIPCallBodyImplE @ 67 NONAME
-	_ZTVN3TMS17TMSStreamBodyImplE @ 68 NONAME
-	_ZTVN3TMS18TMSModemSourceImplE @ 69 NONAME
-	_ZTVN3TMS18TMSSpeakerSinkImplE @ 70 NONAME
-	_ZTVN3TMS19TMSClientSourceImplE @ 71 NONAME
-	_ZTVN3TMS19TMSVolumeEffectImplE @ 72 NONAME
-	_ZTVN3TMS20TMSAMRFormatBodyImplE @ 73 NONAME
-	_ZTVN3TMS20TMSGlobalRoutingImplE @ 74 NONAME
-	_ZTVN3TMS20TMSMicSourceBodyImplE @ 75 NONAME
-	_ZTVN3TMS20TMSModemSinkBodyImplE @ 76 NONAME
-	_ZTVN3TMS20TMSPCMFormatBodyImplE @ 77 NONAME
-	_ZTVN3TMS21TMSClientSinkBodyImplE @ 78 NONAME
-	_ZTVN3TMS21TMSG711FormatBodyImplE @ 79 NONAME
-	_ZTVN3TMS21TMSG729FormatBodyImplE @ 80 NONAME
-	_ZTVN3TMS21TMSGainEffectBodyImplE @ 81 NONAME
-	_ZTVN3TMS21TMSILBCFormatBodyImplE @ 82 NONAME
-	_ZTVN3TMS22TMSGlobalVolEffectImplE @ 83 NONAME
-	_ZTVN3TMS22TMSModemSourceBodyImplE @ 84 NONAME
-	_ZTVN3TMS22TMSSpeakerSinkBodyImplE @ 85 NONAME
-	_ZTVN3TMS23TMSClientSourceBodyImplE @ 86 NONAME
-	_ZTVN3TMS23TMSGlobalGainEffectImplE @ 87 NONAME
-	_ZTVN3TMS23TMSVolumeEffectBodyImplE @ 88 NONAME
-	_ZTVN3TMS24TMSGlobalRoutingBodyImplE @ 89 NONAME
-	_ZTVN3TMS26TMSGlobalVolEffectBodyImplE @ 90 NONAME
-	_ZTVN3TMS27TMSGlobalGainEffectBodyImplE @ 91 NONAME
+	_ZN3TMS11TMSCallImpl6DeleteERPNS_7TMSCallE @ 2 NONAME
+	_ZN3TMS11TMSDTMFImpl6CreateEiRPNS_7TMSDTMFE @ 3 NONAME
+	_ZN3TMS11TMSDTMFImpl6DeleteERPNS_7TMSDTMFE @ 4 NONAME
+	_ZN3TMS11TMSSinkImpl6CreateEiRPNS_7TMSSinkE @ 5 NONAME
+	_ZN3TMS11TMSSinkImpl6DeleteERPNS_7TMSSinkE @ 6 NONAME
+	_ZN3TMS13TMSBufferImpl6CreateEijRPNS_9TMSBufferE @ 7 NONAME
+	_ZN3TMS13TMSBufferImpl6DeleteERPNS_9TMSBufferE @ 8 NONAME
+	_ZN3TMS13TMSEffectImpl6CreateEiRPNS_9TMSEffectE @ 9 NONAME
+	_ZN3TMS13TMSEffectImpl6DeleteERPNS_9TMSEffectE @ 10 NONAME
+	_ZN3TMS13TMSFormatImpl6CreateEiRPNS_9TMSFormatE @ 11 NONAME
+	_ZN3TMS13TMSFormatImpl6DeleteERPNS_9TMSFormatE @ 12 NONAME
+	_ZN3TMS13TMSSourceImpl6CreateEiRPNS_9TMSSourceE @ 13 NONAME
+	_ZN3TMS13TMSSourceImpl6DeleteERPNS_9TMSSourceE @ 14 NONAME
+	_ZN3TMS15TMSRingToneImpl6CreateERPNS_11TMSRingToneE @ 15 NONAME
+	_ZN3TMS15TMSRingToneImpl6CreateERPNS_11TMSRingToneER7RWindowi @ 16 NONAME
+	_ZN3TMS15TMSRingToneImpl6DeleteERPNS_11TMSRingToneE @ 17 NONAME
+	_ZN3TMS17TMSInbandToneImpl6CreateERPNS_13TMSInbandToneE @ 18 NONAME
+	_ZN3TMS17TMSInbandToneImpl6DeleteERPNS_13TMSInbandToneE @ 19 NONAME
+	_ZN3TMS20TMSGlobalRoutingImpl6CreateERPNS_16TMSGlobalRoutingE @ 20 NONAME
+	_ZN3TMS20TMSGlobalRoutingImpl6DeleteERPNS_16TMSGlobalRoutingE @ 21 NONAME
+	_ZTIN3TMS11TMSCallImplE @ 22 NONAME
+	_ZTIN3TMS11TMSDTMFImplE @ 23 NONAME
+	_ZTIN3TMS12TMSMemBufferE @ 24 NONAME
+	_ZTIN3TMS13TMSFormatImplE @ 25 NONAME
+	_ZTIN3TMS13TMSStreamImplE @ 26 NONAME
+	_ZTIN3TMS15TMSCallBodyImplE @ 27 NONAME
+	_ZTIN3TMS15TMSDTMFBodyImplE @ 28 NONAME
+	_ZTIN3TMS15TMSRingToneImplE @ 29 NONAME
+	_ZTIN3TMS16TMSAMRFormatImplE @ 30 NONAME
+	_ZTIN3TMS16TMSMicSourceImplE @ 31 NONAME
+	_ZTIN3TMS16TMSModemSinkImplE @ 32 NONAME
+	_ZTIN3TMS16TMSPCMFormatImplE @ 33 NONAME
+	_ZTIN3TMS17TMSCSCallBodyImplE @ 34 NONAME
+	_ZTIN3TMS17TMSClientSinkImplE @ 35 NONAME
+	_ZTIN3TMS17TMSFormatBodyImplE @ 36 NONAME
+	_ZTIN3TMS17TMSG711FormatImplE @ 37 NONAME
+	_ZTIN3TMS17TMSG729FormatImplE @ 38 NONAME
+	_ZTIN3TMS17TMSGainEffectImplE @ 39 NONAME
+	_ZTIN3TMS17TMSILBCFormatImplE @ 40 NONAME
+	_ZTIN3TMS17TMSIPCallBodyImplE @ 41 NONAME
+	_ZTIN3TMS17TMSInbandToneImplE @ 42 NONAME
+	_ZTIN3TMS17TMSStreamBodyImplE @ 43 NONAME
+	_ZTIN3TMS18TMSModemSourceImplE @ 44 NONAME
+	_ZTIN3TMS18TMSSpeakerSinkImplE @ 45 NONAME
+	_ZTIN3TMS19TMSClientSourceImplE @ 46 NONAME
+	_ZTIN3TMS19TMSRingToneBodyImplE @ 47 NONAME
+	_ZTIN3TMS19TMSVolumeEffectImplE @ 48 NONAME
+	_ZTIN3TMS20TMSAMRFormatBodyImplE @ 49 NONAME
+	_ZTIN3TMS20TMSGlobalRoutingImplE @ 50 NONAME
+	_ZTIN3TMS20TMSMicSourceBodyImplE @ 51 NONAME
+	_ZTIN3TMS20TMSModemSinkBodyImplE @ 52 NONAME
+	_ZTIN3TMS20TMSPCMFormatBodyImplE @ 53 NONAME
+	_ZTIN3TMS21TMSClientSinkBodyImplE @ 54 NONAME
+	_ZTIN3TMS21TMSG711FormatBodyImplE @ 55 NONAME
+	_ZTIN3TMS21TMSG729FormatBodyImplE @ 56 NONAME
+	_ZTIN3TMS21TMSGainEffectBodyImplE @ 57 NONAME
+	_ZTIN3TMS21TMSILBCFormatBodyImplE @ 58 NONAME
+	_ZTIN3TMS21TMSInbandToneBodyImplE @ 59 NONAME
+	_ZTIN3TMS22TMSGlobalVolEffectImplE @ 60 NONAME
+	_ZTIN3TMS22TMSModemSourceBodyImplE @ 61 NONAME
+	_ZTIN3TMS22TMSSpeakerSinkBodyImplE @ 62 NONAME
+	_ZTIN3TMS23TMSClientSourceBodyImplE @ 63 NONAME
+	_ZTIN3TMS23TMSGlobalGainEffectImplE @ 64 NONAME
+	_ZTIN3TMS23TMSVolumeEffectBodyImplE @ 65 NONAME
+	_ZTIN3TMS24TMSGlobalRoutingBodyImplE @ 66 NONAME
+	_ZTIN3TMS26TMSGlobalVolEffectBodyImplE @ 67 NONAME
+	_ZTIN3TMS27TMSGlobalGainEffectBodyImplE @ 68 NONAME
+	_ZTVN3TMS11TMSCallImplE @ 69 NONAME
+	_ZTVN3TMS11TMSDTMFImplE @ 70 NONAME
+	_ZTVN3TMS12TMSMemBufferE @ 71 NONAME
+	_ZTVN3TMS13TMSFormatImplE @ 72 NONAME
+	_ZTVN3TMS13TMSStreamImplE @ 73 NONAME
+	_ZTVN3TMS15TMSCallBodyImplE @ 74 NONAME
+	_ZTVN3TMS15TMSDTMFBodyImplE @ 75 NONAME
+	_ZTVN3TMS15TMSRingToneImplE @ 76 NONAME
+	_ZTVN3TMS16TMSAMRFormatImplE @ 77 NONAME
+	_ZTVN3TMS16TMSMicSourceImplE @ 78 NONAME
+	_ZTVN3TMS16TMSModemSinkImplE @ 79 NONAME
+	_ZTVN3TMS16TMSPCMFormatImplE @ 80 NONAME
+	_ZTVN3TMS17TMSCSCallBodyImplE @ 81 NONAME
+	_ZTVN3TMS17TMSClientSinkImplE @ 82 NONAME
+	_ZTVN3TMS17TMSFormatBodyImplE @ 83 NONAME
+	_ZTVN3TMS17TMSG711FormatImplE @ 84 NONAME
+	_ZTVN3TMS17TMSG729FormatImplE @ 85 NONAME
+	_ZTVN3TMS17TMSGainEffectImplE @ 86 NONAME
+	_ZTVN3TMS17TMSILBCFormatImplE @ 87 NONAME
+	_ZTVN3TMS17TMSIPCallBodyImplE @ 88 NONAME
+	_ZTVN3TMS17TMSInbandToneImplE @ 89 NONAME
+	_ZTVN3TMS17TMSStreamBodyImplE @ 90 NONAME
+	_ZTVN3TMS18TMSModemSourceImplE @ 91 NONAME
+	_ZTVN3TMS18TMSSpeakerSinkImplE @ 92 NONAME
+	_ZTVN3TMS19TMSClientSourceImplE @ 93 NONAME
+	_ZTVN3TMS19TMSRingToneBodyImplE @ 94 NONAME
+	_ZTVN3TMS19TMSVolumeEffectImplE @ 95 NONAME
+	_ZTVN3TMS20TMSAMRFormatBodyImplE @ 96 NONAME
+	_ZTVN3TMS20TMSGlobalRoutingImplE @ 97 NONAME
+	_ZTVN3TMS20TMSMicSourceBodyImplE @ 98 NONAME
+	_ZTVN3TMS20TMSModemSinkBodyImplE @ 99 NONAME
+	_ZTVN3TMS20TMSPCMFormatBodyImplE @ 100 NONAME
+	_ZTVN3TMS21TMSClientSinkBodyImplE @ 101 NONAME
+	_ZTVN3TMS21TMSG711FormatBodyImplE @ 102 NONAME
+	_ZTVN3TMS21TMSG729FormatBodyImplE @ 103 NONAME
+	_ZTVN3TMS21TMSGainEffectBodyImplE @ 104 NONAME
+	_ZTVN3TMS21TMSILBCFormatBodyImplE @ 105 NONAME
+	_ZTVN3TMS21TMSInbandToneBodyImplE @ 106 NONAME
+	_ZTVN3TMS22TMSGlobalVolEffectImplE @ 107 NONAME
+	_ZTVN3TMS22TMSModemSourceBodyImplE @ 108 NONAME
+	_ZTVN3TMS22TMSSpeakerSinkBodyImplE @ 109 NONAME
+	_ZTVN3TMS23TMSClientSourceBodyImplE @ 110 NONAME
+	_ZTVN3TMS23TMSGlobalGainEffectImplE @ 111 NONAME
+	_ZTVN3TMS23TMSVolumeEffectBodyImplE @ 112 NONAME
+	_ZTVN3TMS24TMSGlobalRoutingBodyImplE @ 113 NONAME
+	_ZTVN3TMS26TMSGlobalVolEffectBodyImplE @ 114 NONAME
+	_ZTVN3TMS27TMSGlobalGainEffectBodyImplE @ 115 NONAME
 
--- a/mmserv/tms/tmsimpl/group/tmsimpl.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/group/tmsimpl.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -34,7 +34,7 @@
 MW_LAYER_SYSTEMINCLUDE
 OS_LAYER_LIBC_SYSTEMINCLUDE
 OS_LAYER_GLIB_SYSTEMINCLUDE
-SYSTEMINCLUDE   /epoc32/include/stdapis/stlport
+OS_LAYER_STDCPP_SYSTEMINCLUDE
 SYSTEMINCLUDE   /epoc32/include/mmf/common
 
 SOURCEPATH      ../src
@@ -84,6 +84,12 @@
 SOURCE          tmsmicsourceimpl.cpp
 SOURCE          tmsmodemsourcebodyimpl.cpp
 SOURCE          tmsmodemsourceimpl.cpp
+SOURCE          tmsringtonebodyimpl.cpp
+SOURCE          tmsringtoneimpl.cpp
+SOURCE          tmsdtmfbodyimpl.cpp
+SOURCE          tmsdtmfimpl.cpp
+SOURCE          tmsinbandtonebodyimpl.cpp
+SOURCE          tmsinbandtoneimpl.cpp
 
 LIBRARY         euser.lib
 LIBRARY         libglib.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsimpl/inc/tmsdtmfbodyimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,66 @@
+/*
+ * 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 TMS_DTMF_BODY_IMPL_H
+#define TMS_DTMF_BODY_IMPL_H
+
+#include <tms.h>
+#include "tmsdtmfbody.h"
+#include "tmsclientserver.h"
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSDTMFObserver;
+class TMSDTMF;
+class TMSProxy;
+
+// TMSDTMFBodyImpl class
+class TMSDTMFBodyImpl : public TMSDTMFBody
+    {
+public:
+    static gint Create(TMSStreamType streamtype, TMSDTMFBody*& bodyimpl);
+    virtual ~TMSDTMFBodyImpl();
+
+    // From TMSDTMFBody begins
+    virtual gint AddObserver(TMSDTMFObserver& obsrvr, gpointer user_data);
+    virtual gint RemoveObserver(TMSDTMFObserver& obsrvr);
+    virtual gint Start();
+    virtual gint Stop();
+    virtual gint SetTone(GString* string);
+    virtual gint ContinueDTMFStringSending(gboolean aContinue);
+
+    void SetParent(TMSDTMF*& parent);
+
+private:
+    TMSDTMFBodyImpl();
+    gint PostConstruct();
+
+private:
+    TMSDTMFObserver* iObserver;
+    gint iClientId;
+    gpointer iUserData;
+    TMSProxy* iProxy;
+    TMSDTMF* iParent;
+    GString* iString;
+    TMSStreamType iStreamType;
+    };
+
+} //namespace TMS
+
+#endif // TMS_DTMF_BODY_IMPL_H
+
--- a/mmserv/tms/tmsimpl/inc/tmsformatbodyimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsformatbodyimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -32,7 +32,7 @@
 class TMSFormatBodyImpl : public TMSFormatBody
     {
 public:
-    ~TMSFormatBodyImpl();
+    virtual ~TMSFormatBodyImpl();
 
     gint GetSupportedBitRates(BitRateVector& aVector);
     gint SetBitRate(const guint aBitrate);
--- a/mmserv/tms/tmsimpl/inc/tmsgaineffectbodyimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsgaineffectbodyimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -35,9 +35,9 @@
     {
 public:
     static gint Create(TMSGainEffectBody*& bodyimpl);
+    virtual ~TMSGainEffectBodyImpl();
 
     // From TMSGainEffectBody
-    virtual ~TMSGainEffectBodyImpl();
     virtual gint AddObserver(TMSEffectObserver& obsrvr, gpointer user_data);
     virtual gint RemoveObserver(TMSEffectObserver& obsrvr);
     virtual gint SetLevel(const guint level);
@@ -48,7 +48,7 @@
     // From MQueueHandlerObserver
     virtual void QueueEvent(TInt aEventType, TInt aError, void* user_data);
 
-    gint SetParentEffect(TMSEffect*& parenteffect);
+    void SetParent(TMSEffect*& parent);
     void SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
 private:
@@ -59,11 +59,10 @@
     TMSEffectObserver* iObserver;
     gpointer iUserData;
     TMSCallProxy* iProxy;
-    TMSEffect* iParentEffect;
+    TMSEffect* iParent;
     };
 
 } //namespace TMS
 
 #endif // TMS_GAIN_EFFECT_BODY_IMPL_H
 
-// End of file
--- a/mmserv/tms/tmsimpl/inc/tmsglobalgaineffectbodyimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsglobalgaineffectbodyimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -43,7 +43,7 @@
     virtual gint GetMaxLevel(guint& level);
     virtual gint GetType(TMSEffectType& effecttype);
 
-    void SetParentEffect(TMSEffect*& parenteffect);
+    void SetParent(TMSEffect*& parent);
 
 private:
     TMSGlobalGainEffectBodyImpl();
@@ -54,11 +54,10 @@
     gint iClientId;
     gpointer iUserData;
     TMSProxy* iProxy;
-    TMSEffect* iGlobalEffect;
+    TMSEffect* iParent;
     };
 
 } //namespace TMS
 
 #endif // TMS_GLOBAL_GAIN_EFFECT_BODY_IMPL_H
 
-// End of file
--- a/mmserv/tms/tmsimpl/inc/tmsglobalroutingbodyimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsglobalroutingbodyimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -27,6 +27,7 @@
 
 // FORWARD DECLARATIONS
 class TMSGlobalRoutingObserver;
+class TMSGlobalRouting;
 class TMSProxy;
 
 // TMSGlobalRoutingBodyImpl class
@@ -34,9 +35,9 @@
     {
 public:
     static gint Create(TMSGlobalRoutingBody*& bodyimpl);
+    virtual ~TMSGlobalRoutingBodyImpl();
 
     // From TMSGlobalRoutingBody
-    virtual ~TMSGlobalRoutingBodyImpl();
     virtual gint AddObserver(TMSGlobalRoutingObserver& obsrvr,
             gpointer user_data);
     virtual gint RemoveObserver(TMSGlobalRoutingObserver& obsrvr);
@@ -45,6 +46,8 @@
     virtual gint GetPreviousOutput(TMSAudioOutput& output);
     virtual gint GetAvailableOutputs(OutputVector& outputs);
 
+    void SetParent(TMSGlobalRouting*& parent);
+
 private:
     TMSGlobalRoutingBodyImpl();
     gint PostConstruct();
@@ -56,10 +59,10 @@
     RPointerArray<TMSGlobalRoutingObserver> iObserversList; // (not owned)
     gpointer iUserData;
     TMSProxy* iProxy;
+    TMSGlobalRouting* iParent;
     };
 
 } //namespace TMS
 
 #endif // TMS_GLOBAL_ROUTING_BODY_IMPL_H
 
-// End of file
--- a/mmserv/tms/tmsimpl/inc/tmsglobalvoleffectbodyimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsglobalvoleffectbodyimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -33,9 +33,9 @@
     {
 public:
     static gint Create(TMSGlobalVolEffectBody*& bodyimpl);
+    virtual ~TMSGlobalVolEffectBodyImpl();
 
     // From TMSVolumeEffectBody
-    virtual ~TMSGlobalVolEffectBodyImpl();
     virtual gint AddObserver(TMSEffectObserver& obsrvr, gpointer user_data);
     virtual gint RemoveObserver(TMSEffectObserver& obsrvr);
     virtual gint SetLevel(const guint level);
@@ -43,7 +43,7 @@
     virtual gint GetMaxLevel(guint& level);
     virtual gint GetType(TMSEffectType& effecttype);
 
-    void SetParentEffect(TMSEffect*& parenteffect);
+    void SetParent(TMSEffect*& parent);
 
 private:
     TMSGlobalVolEffectBodyImpl();
@@ -54,11 +54,10 @@
     gint iClientId;
     gpointer iUserData;
     TMSProxy* iProxy;
-    TMSEffect* iGlobalEffect;
+    TMSEffect* iParent;
     };
 
 } //namespace TMS
 
 #endif // TMS_GLOBAL_VOLUME_EFFECT_BODY_IMPL_H
 
-// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsimpl/inc/tmsinbandtonebodyimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,63 @@
+/*
+ * 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 TMS_INBAND_BODY_IMPL_H
+#define TMS_INBAND_BODY_IMPL_H
+
+#include <tms.h>
+#include "tmsinbandtonebody.h"
+#include "tmsclientserver.h"
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSInbandToneObserver;
+class TMSInbandTone;
+class TMSProxy;
+
+// TMSInbandBodyImpl class
+class TMSInbandToneBodyImpl : public TMSInbandToneBody
+    {
+public:
+    static gint Create(TMSInbandToneBody*& bodyimpl);
+    virtual ~TMSInbandToneBodyImpl();
+
+    // From TMSInbandToneBody begins
+    virtual gint AddObserver(TMSInbandToneObserver& obsrvr, gpointer user_data);
+    virtual gint RemoveObserver(TMSInbandToneObserver& obsrvr);
+    virtual gint Start(TMSInbandToneType inbandtone);
+    virtual gint Stop();
+
+    void SetParent(TMSInbandTone*& parent);
+
+private:
+    TMSInbandToneBodyImpl();
+    gint PostConstruct();
+
+private:
+    TMSInbandToneObserver* iObserver;
+    gint iClientId;
+    gpointer iUserData;
+    TMSProxy* iProxy;
+    TMSInbandTone* iParent;
+    TMSInbandToneType iInbandType;
+    };
+
+} //namespace TMS
+
+#endif // TMS_DTMF_BODY_IMPL_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsimpl/inc/tmsringtonebodyimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,71 @@
+/*
+ * 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 TMSRINGTONEBODYIMPL_H
+#define TMSRINGTONEBODYIMPL_H
+
+#include <w32std.h>
+#include <tms.h>
+#include "tmsringtonebody.h"
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSRingToneObserver;
+class TMSProxy;
+class TMSRingTone;
+
+// TMSRingToneBodyImpl class
+class TMSRingToneBodyImpl : public TMSRingToneBody
+    {
+public:
+    static gint Create(TMSRingToneBody*& bodyimpl);
+    static gint Create(TMSRingToneBody*& bodyimpl, RWindow& window, gint scrid);
+    virtual ~TMSRingToneBodyImpl();
+
+    // From TMSRingToneBody
+    virtual gint AddObserver(TMSRingToneObserver& obsrvr, gpointer user_data);
+    virtual gint RemoveObserver(TMSRingToneObserver& obsrvr);
+    virtual gint Init(const TMSRingToneType type, GString* str, GString* tts);
+    virtual gint Deinit();
+    virtual gint Play();
+    virtual gint Stop();
+    virtual gint Pause();
+    virtual gint Mute();
+
+    void SetParent(TMSRingTone*& parent);
+
+private:
+    TMSRingToneBodyImpl();
+    gint PostConstruct();
+
+private:
+    TMSRingToneObserver* iObserver;
+    gpointer iUserData;
+    TMSProxy* iProxy;
+    TMSRingTone* iParent;
+    guint iClientId;
+    gint iScreenID;
+    //RWindow iWindow;
+    };
+
+} //namespace TMS
+
+#endif //TMSRINGTONEBODYIMPL_H
+
+// End of file
+
--- a/mmserv/tms/tmsimpl/inc/tmsstreambodyimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsstreambodyimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -49,8 +49,7 @@
 
 public:
     static gint Create(TMSCallType callType, TMSStreamType stype,
-            TMSCallProxy* proxy, TMSStream& parent,
-            TMSStreamBody*& bodyimpl);
+            TMSCallProxy* proxy, TMSStream& parent, TMSStreamBody*& bodyimpl);
     virtual ~TMSStreamBodyImpl();
 
     // From TMSStreamBody
@@ -83,7 +82,7 @@
 
     gint CreateQueue(const gint aNumSlots);
     void ReceiveMsgQHandlerEventsL();
-    
+
     gint ValidateStream();
     gint ValidateSource(TMSSource* source);
     gint ValidateSink(TMSSink* sink);
@@ -102,7 +101,7 @@
 
     // Message queue and the handler
     RMsgQueue<TmsMsgBuf> iMsgQueue;
-    CQueueHandler* iMsgQHandler;
+    TMSQueueHandler* iMsgQHandler;
 
     // Need to make this a list
     TMSStreamObserver* iObserver;
--- a/mmserv/tms/tmsimpl/inc/tmsvolumeeffectbodyimpl.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsvolumeeffectbodyimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -48,7 +48,7 @@
     // From MQueueHandlerObserver
     virtual void QueueEvent(TInt aEventType, TInt aError, void* user_data);
 
-    gint SetParentEffect(TMSEffect*& parenteffect);
+    void SetParent(TMSEffect*& parent);
     void SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
 private:
@@ -59,11 +59,10 @@
     TMSEffectObserver* iObserver;
     gpointer iUserData;
     TMSCallProxy* iProxy;
-    TMSEffect* iParentEffect;
+    TMSEffect* iParent;
     };
 
 } //namespace TMS
 
 #endif // TMS_VOLUME_EFFECT_BODY_IMPL_H
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsamrbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsamrbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -74,7 +74,7 @@
         iProxy = context->CallProxy;
         iStreamType = context->StreamType;
         TMSFormatBodyImpl::SetProxy(iProxy, queuehandler);
-        ((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_AMR);
+        ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_AMR);
         }
     }
 
--- a/mmserv/tms/tmsimpl/src/tmsamrimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsamrimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsamrbodyimpl.h"
 #include "tmsamrformatimpl.h"
--- a/mmserv/tms/tmsimpl/src/tmsbufferimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsbufferimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,13 +15,24 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsmembuffer.h"
 #include "tmsbufferimpl.h"
 
 using namespace TMS;
 
+TMSBufferImpl::TMSBufferImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSBufferImpl::~TMSBufferImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
 EXPORT_C gint TMSBufferImpl::Create(TMSBufferType buffertype, guint size,
         TMSBuffer*& tmsbuffer)
     {
--- a/mmserv/tms/tmsimpl/src/tmscallimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmscallimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsipcallbodyimpl.h"
 #include "tmscscallbodyimpl.h"
@@ -63,7 +62,6 @@
     return ret;
     }
 
-// TO DO stop exporting this function
 EXPORT_C gint TMSCallImpl::Create(TMSCallType ctype, TMSCall*& tmscall,
         guint ctxid)
     {
@@ -85,4 +83,13 @@
     return ret;
     }
 
-// End of file
+EXPORT_C gint TMSCallImpl::Delete(TMSCall*& tmscall)
+    {
+    TRACE_PRN_FN_ENT;
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    delete (TMSCallImpl*) (tmscall);
+    tmscall = NULL;
+    TRACE_PRN_FN_EXT;    
+    return ret;
+    }
+
--- a/mmserv/tms/tmsimpl/src/tmsclientsinkbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsclientsinkbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -120,7 +120,7 @@
     iProxy = aProxy;
     if (queuehandler)
         {
-        ((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_SINK_CLIENT);
+        ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_SINK_CLIENT);
         }
     }
 
--- a/mmserv/tms/tmsimpl/src/tmsclientsinkimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsclientsinkimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsclientsinkimpl.h"
 #include "tmsclientsinkbodyimpl.h"
--- a/mmserv/tms/tmsimpl/src/tmsclientsourcebodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsclientsourcebodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -161,7 +161,7 @@
     {
     iProxy = aProxy;
     iStreamId = strmid;
-    ((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_SOURCE_CLIENT);
+    ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_SOURCE_CLIENT);
     }
 
 void TMSClientSourceBodyImpl::QueueEvent(TInt aEventType, TInt aError,
--- a/mmserv/tms/tmsimpl/src/tmsclientsourceimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsclientsourceimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsclientsourcebodyimpl.h"
 #include "tmsclientsourceimpl.h"
@@ -24,10 +23,14 @@
 
 TMSClientSourceImpl::TMSClientSourceImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSClientSourceImpl::~TMSClientSourceImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSClientSourceImpl::PostConstruct()
@@ -45,7 +48,6 @@
     return ret;
     }
 
-// TO DO stop exporting this function
 gint TMSClientSourceImpl::Create(TMSSource*& tmssource)
     {
     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
--- a/mmserv/tms/tmsimpl/src/tmscscallbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmscscallbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -197,9 +197,7 @@
         // will point to the next item (if available); so, do NOT attempt
         // deleting itStrm here! (Will result in KERN-EXEC)
         iStreamsVector.erase(itStrm); // Remove from array
-        delete strm; // Free memory
-        strm = NULL;
-        ret = TMS_RESULT_SUCCESS;
+        ret = TMSStreamImpl::Delete(strm);
         }
     TRACE_PRN_FN_EXT;
     return ret;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsimpl/src/tmsdtmfbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,205 @@
+/*
+ * 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 <tms.h>
+#include <tmsdtmfobsrvr.h>
+#include "tmsutility.h"
+#include "tmsproxy.h"
+#include "tmsdtmfbodyimpl.h"
+
+using namespace TMS;
+
+TMSDTMFBodyImpl::TMSDTMFBodyImpl() :
+    iObserver(NULL),
+    iProxy(NULL),
+    iParent(NULL),
+    iString(NULL)
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSDTMFBodyImpl::~TMSDTMFBodyImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    if (iProxy)
+        {
+        iProxy->Close();
+        delete iProxy;
+        iProxy = NULL;
+        }
+    if (iString)
+        {
+        g_string_free(iString, TRUE);
+        }
+    iObserver = NULL;
+    iParent = NULL;
+    iUserData = NULL;
+    TRACE_PRN_FN_EXT;
+    }
+
+gint TMSDTMFBodyImpl::Create(TMSStreamType streamtype, TMSDTMFBody*& bodyimpl)
+    {
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    TMSDTMFBodyImpl* self = new TMSDTMFBodyImpl();
+    if (self)
+        {
+        ret = self->PostConstruct();
+        if (ret != TMS_RESULT_SUCCESS)
+            {
+            delete self;
+            self = NULL;
+            }
+        self->iStreamType = streamtype;
+        }
+    bodyimpl = self;
+    return ret;
+    }
+
+gint TMSDTMFBodyImpl::PostConstruct()
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    iClientId = 1;
+    iProxy = new TMSProxy;
+    if (!iProxy)
+        {
+        ret = TMS_RESULT_INSUFFICIENT_MEMORY;
+        }
+    RET_REASON_IF_ERR(ret);
+
+    if (iProxy->Connect() != TMS_RESULT_SUCCESS)
+        {
+        delete iProxy;
+        iProxy = NULL;
+        ret = TMS_RESULT_FATAL_ERROR;
+        }
+    RET_REASON_IF_ERR(ret);
+    return ret;
+    }
+
+gint TMSDTMFBodyImpl::AddObserver(TMSDTMFObserver& obsrvr,
+        gpointer user_data)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (!iObserver)
+        {
+        iObserver = &obsrvr;
+        iUserData = user_data;
+        if (iProxy)
+            {
+            ret = iProxy->SetMsgQueueNotifier(EMsgQueueDTMFType, iObserver,
+                    iParent, iClientId);
+            if (ret == TMS_RESULT_SUCCESS)
+                {
+                ret = iProxy->StartDTMFNotifier();
+                }
+            }
+        else
+            {
+            ret = TMS_RESULT_DOES_NOT_EXIST;
+            }
+        }
+    else
+        {
+        ret = TMS_RESULT_ALREADY_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSDTMFBodyImpl::RemoveObserver(TMSDTMFObserver& obsrvr)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (iProxy && (&obsrvr == iObserver))
+        {
+        ret = iProxy->RemoveMsgQueueNotifier(EMsgQueueDTMFType, iObserver);
+        iObserver = NULL;
+        iProxy->CancelDTMFNotifier();
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSDTMFBodyImpl::Start()
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (iProxy)
+        {
+        if (iString->len)
+            {
+            ret = iProxy->StartDTMF(iStreamType, iString);
+            }
+        else
+            {
+            ret = TMS_RESULT_INVALID_ARGUMENT;
+            }
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSDTMFBodyImpl::Stop()
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (iProxy)
+        {
+        ret = iProxy->StopDTMF(iStreamType);
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSDTMFBodyImpl::SetTone(GString* string)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+
+    if (iString && iString->len)
+        {
+        g_string_free(iString, TRUE);
+        }
+
+    iString = g_string_new_len(string->str, string->len);
+    return ret;
+    }
+
+gint TMSDTMFBodyImpl::ContinueDTMFStringSending(gboolean aContinue)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (iProxy)
+        {
+        ret = iProxy->ContinueDTMFStringSending(aContinue);
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+void TMSDTMFBodyImpl::SetParent(TMSDTMF*& parent)
+    {
+    iParent = parent;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsimpl/src/tmsdtmfimpl.cpp	Fri Apr 16 15:29:42 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: Telephony Multimedia Service
+ *
+ */
+
+#include "tmsutility.h"
+#include "tmsdtmfbodyimpl.h"
+#include "tmsdtmfimpl.h"
+
+using namespace TMS;
+
+TMSDTMFImpl::TMSDTMFImpl(TMSStreamType streamtype)
+    {
+    TRACE_PRN_FN_ENT;
+    iStreamType = streamtype;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSDTMFImpl::~TMSDTMFImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+gint TMSDTMFImpl::PostConstruct()
+    {
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    TMSDTMFBody* bodyimpl(NULL);
+    TRACE_PRN_FN_ENT;
+    ret = TMSDTMFBodyImpl::Create(iStreamType, bodyimpl);
+
+    if (ret == TMS_RESULT_SUCCESS)
+        {
+        this->iBody = bodyimpl;
+        }
+    TRACE_PRN_FN_EXT;
+    return ret;
+    }
+
+EXPORT_C gint TMSDTMFImpl::Create(TMSStreamType streamtype, TMSDTMF*& dtmf)
+    {
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    TMSDTMFImpl *self = new TMSDTMFImpl(streamtype);
+
+    TRACE_PRN_FN_ENT;
+    if (self)
+        {
+        ret = self->PostConstruct();
+        if (ret != TMS_RESULT_SUCCESS)
+            {
+            delete self;
+            self = NULL;
+            }
+        }
+    if (self && ret == TMS_RESULT_SUCCESS)
+        {
+        dtmf = self;
+        ret = self->SetParent(dtmf);
+        }
+    TRACE_PRN_FN_EXT;
+    return ret;
+    }
+
+EXPORT_C gint TMSDTMFImpl::Delete(TMSDTMF*& dtmf)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    TRACE_PRN_FN_ENT;
+    delete (TMSDTMFImpl*) (dtmf);
+    dtmf = NULL;
+    TRACE_PRN_FN_EXT;
+    return ret;
+    }
+
+gint TMSDTMFImpl::SetParent(TMSDTMF*& parent)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (this->iBody)
+        {
+        ((TMSDTMFBodyImpl*) this->iBody)->SetParent(parent);
+        }
+    else
+        {
+        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
+        }
+    return ret;
+    }
+
--- a/mmserv/tms/tmsimpl/src/tmseffectimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmseffectimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsvolumeeffectimpl.h"
 #include "tmsgaineffectimpl.h"
 #include "tmsglobalvoleffectimpl.h"
@@ -25,6 +24,18 @@
 
 using namespace TMS;
 
+TMSEffectImpl::TMSEffectImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSEffectImpl::~TMSEffectImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
 EXPORT_C gint TMSEffectImpl::Create(TMSEffectType effecttype,
         TMSEffect*& tmseffect)
     {
--- a/mmserv/tms/tmsimpl/src/tmsformatbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsformatbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -77,7 +77,7 @@
 void TMSFormatBodyImpl::SetProxy(TMSCallProxy* aProxy, gpointer /*queuehandler*/)
     {
     iProxy = aProxy;
-    //  ((CQueueHandler*)queuehandler)->AddObserver(*this,TMS_FORMAT_TYPE);
+    //  ((TMSQueueHandler*)queuehandler)->AddObserver(*this,TMS_FORMAT_TYPE);
     }
 
 // End of file
--- a/mmserv/tms/tmsimpl/src/tmsformatimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsformatimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsamrformatimpl.h"
 #include "tmsg711formatimpl.h"
@@ -29,6 +28,14 @@
 
 TMSFormatImpl::TMSFormatImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSFormatImpl::~TMSFormatImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 EXPORT_C gint TMSFormatImpl::Create(TMSFormatType fmttype, TMSFormat*& tmsfmt)
--- a/mmserv/tms/tmsimpl/src/tmsg711bodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsg711bodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -154,7 +154,7 @@
         iProxy = context->CallProxy;
         iStreamType = context->StreamType;
         TMSFormatBodyImpl::SetProxy(iProxy, queuehandler);
-        ((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_G711);
+        ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_G711);
         }
     }
 
--- a/mmserv/tms/tmsimpl/src/tmsg711impl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsg711impl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsg711bodyimpl.h"
 #include "tmsg711formatimpl.h"
--- a/mmserv/tms/tmsimpl/src/tmsg729bodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsg729bodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -94,7 +94,7 @@
         iProxy = context->CallProxy;
         iStreamType = context->StreamType;
         TMSFormatBodyImpl::SetProxy(iProxy, queuehandler);
-        ((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_G729);
+        ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_G729);
         }
     }
 
--- a/mmserv/tms/tmsimpl/src/tmsg729impl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsg729impl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsg729bodyimpl.h"
 #include "tmsutility.h"
 #include "tmsg729formatimpl.h"
--- a/mmserv/tms/tmsimpl/src/tmsgaineffectbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsgaineffectbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -17,6 +17,7 @@
 
 #include <tms.h>
 #include <tmseffectobsrvr.h>
+#include "tmsutility.h"
 #include "tmscallproxy.h"
 #include "tmsqueuehandler.h"
 #include "tmsgaineffectbodyimpl.h"
@@ -26,12 +27,14 @@
 TMSGainEffectBodyImpl::TMSGainEffectBodyImpl() :
     iObserver(NULL),
     iProxy(NULL),
-    iParentEffect(NULL)
+    iParent(NULL)
     {
     }
 
 TMSGainEffectBodyImpl::~TMSGainEffectBodyImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSGainEffectBodyImpl::Create(TMSGainEffectBody*& bodyimpl)
@@ -73,21 +76,6 @@
     return ret;
     }
 
-/**
- * Remove a stream observer from this stream.
- *
- * This function can be called at any time. It is recommended to remove
- * observer after calling Deinit() on stream. Else observer may receive
- * a callback that is alread dispatched.
- *
- * @param  obsrvr
- *      The listener to remove.
- *
- * @return
- *      TMS_RESULT_SUCCESS if the obsrvr is removed successfully from list.
- *      TMS_RESULT_DOES_NOT_EXIST if obsrvr is not already in the list.
- *
- */
 gint TMSGainEffectBodyImpl::RemoveObserver(TMSEffectObserver& obsrvr)
     {
     gint ret(TMS_RESULT_SUCCESS);
@@ -151,26 +139,25 @@
     return ret;
     }
 
-gint TMSGainEffectBodyImpl::SetParentEffect(TMSEffect*& parenteffect)
+void TMSGainEffectBodyImpl::SetParent(TMSEffect*& parent)
     {
-    gint ret(TMS_RESULT_SUCCESS);
-    iParentEffect = NULL;
-    iParentEffect = parenteffect;
-    return ret;
+    iParent = parent;
     }
 
 void TMSGainEffectBodyImpl::SetProxy(TMSCallProxy* aProxy,
         gpointer queuehandler)
     {
     iProxy = aProxy;
-    ((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_EFFECT_GAIN);
+    if (queuehandler)
+        {
+        ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_EFFECT_GAIN);
+        }
     }
 
 void TMSGainEffectBodyImpl::QueueEvent(TInt aEventType, TInt aError,
         void* /*user_data*/)
     {
     TMSSignalEvent event;
-
     event.type = TMS_EVENT_EFFECT_GAIN_CHANGED;
     event.reason = aError;
 
@@ -178,9 +165,9 @@
         {
         case TMS_EVENT_EFFECT_GAIN_CHANGED:
             {
-            if (iObserver && iParentEffect)
+            if (iObserver && iParent)
                 {
-                iObserver->EffectsEvent(iParentEffect, event);
+                iObserver->EffectsEvent(iParent, event);
                 }
             }
             break;
@@ -189,4 +176,3 @@
         }
     }
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsgaineffectimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsgaineffectimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,9 +15,8 @@
  *
  */
 
-#include <tms.h>
+#include "tmsutility.h"
 #include "tmsgaineffectbodyimpl.h"
-#include "tmsutility.h"
 #include "tmsgaineffectimpl.h"
 
 using namespace TMS;
@@ -64,30 +63,15 @@
             self = NULL;
             }
         }
-
     if (self && ret == TMS_RESULT_SUCCESS)
         {
         tmseffect = self;
-        ret = self->SetParentEffect(tmseffect);
+        ret = self->SetParent(tmseffect);
         }
     TRACE_PRN_FN_EXT;
     return ret;
     }
 
-gint TMSGainEffectImpl::SetParentEffect(TMSEffect*& parenteffect)
-    {
-    gint  ret(TMS_RESULT_SUCCESS);
-    if (this->iBody)
-        {
-        ((TMSGainEffectBodyImpl*) this->iBody)->SetParentEffect(parenteffect);
-        }
-    else
-        {
-        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
-        }
-    return ret;
-    }
-
 gint TMSGainEffectImpl::SetProxy(TMSCallProxy* aProxy, gpointer queuehandler)
     {
     gint ret(TMS_RESULT_SUCCESS);
@@ -102,4 +86,17 @@
     return ret;
     }
 
-// End of file
+gint TMSGainEffectImpl::SetParent(TMSEffect*& parent)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (this->iBody)
+        {
+        ((TMSGainEffectBodyImpl*) this->iBody)->SetParent(parent);
+        }
+    else
+        {
+        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
+        }
+    return ret;
+    }
+
--- a/mmserv/tms/tmsimpl/src/tmsglobalgaineffectbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsglobalgaineffectbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -26,7 +26,7 @@
 TMSGlobalGainEffectBodyImpl::TMSGlobalGainEffectBodyImpl() :
     iObserver(NULL),
     iProxy(NULL),
-    iGlobalEffect(NULL)
+    iParent(NULL)
     {
     }
 
@@ -39,7 +39,7 @@
         iProxy = NULL;
         }
     iObserver = NULL;
-    iGlobalEffect = NULL;
+    iParent = NULL;
     iUserData = NULL;
     }
 
@@ -65,35 +65,43 @@
     gint ret(TMS_RESULT_SUCCESS);
     iClientId = 1;
     iProxy = new TMSProxy;
-
-    if (iProxy)
+    if (!iProxy)
         {
-        if (iProxy->Connect() != TMS_RESULT_SUCCESS)
-            {
-            delete iProxy;
-            iProxy = NULL;
-            ret = TMS_RESULT_FATAL_ERROR;
-            }
+        ret = TMS_RESULT_INSUFFICIENT_MEMORY;
+        }
+    RET_REASON_IF_ERR(ret);
+
+    if (iProxy->Connect() != TMS_RESULT_SUCCESS)
+        {
+        delete iProxy;
+        iProxy = NULL;
+        ret = TMS_RESULT_FATAL_ERROR;
         }
     else
         {
-        ret = TMS_RESULT_INSUFFICIENT_MEMORY;
+        // Starts TAR if not started already;
+        ret = iProxy->StartRoutingNotifier();
         }
+    RET_REASON_IF_ERR(ret);
     return ret;
     }
 
 gint TMSGlobalGainEffectBodyImpl::AddObserver(TMSEffectObserver& obsrvr,
-        gpointer /*user_data*/)
+        gpointer user_data)
     {
     gint ret(TMS_RESULT_SUCCESS);
     if (!iObserver)
         {
         iObserver = &obsrvr;
-        //iUserData = user_data;
+        iUserData = user_data;
         if (iProxy)
             {
             ret = iProxy->SetMsgQueueNotifier(EMsgQueueGlobalGainType,
-                    iObserver, iGlobalEffect, iClientId);
+                    iObserver, iParent, iClientId);
+            if (ret == TMS_RESULT_SUCCESS)
+                {
+                ret = iProxy->StartGlobalEffectNotifier();
+                }
             }
         else
             {
@@ -104,19 +112,19 @@
         {
         ret = TMS_RESULT_ALREADY_EXIST;
         }
-
     return ret;
     }
 
 gint TMSGlobalGainEffectBodyImpl::RemoveObserver(TMSEffectObserver& obsrvr)
     {
     gint ret(TMS_RESULT_SUCCESS);
-
     if (iProxy && (&obsrvr == iObserver))
         {
         ret = iProxy->RemoveMsgQueueNotifier(EMsgQueueGlobalGainType,
                 iObserver);
         iObserver = NULL;
+        ret = iProxy->CancelGlobalEffectNotifier();
+        ret = iProxy->CancelRoutingNotifier();
         }
     else
         {
@@ -174,10 +182,8 @@
     return ret;
     }
 
-void TMSGlobalGainEffectBodyImpl::SetParentEffect(TMSEffect*& parenteffect)
+void TMSGlobalGainEffectBodyImpl::SetParent(TMSEffect*& parent)
     {
-    iGlobalEffect = NULL;
-    iGlobalEffect = parenteffect;
+    iParent = parent;
     }
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsglobalgaineffectimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsglobalgaineffectimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,9 +15,8 @@
  *
  */
 
-#include <tms.h>
+#include "tmsutility.h"
 #include "tmsglobalgaineffectbodyimpl.h"
-#include "tmsutility.h"
 #include "tmsglobalgaineffectimpl.h"
 
 using namespace TMS;
@@ -67,19 +66,18 @@
     if (self && ret == TMS_RESULT_SUCCESS)
         {
         tmseffect = self;
-        self->SetParentEffect(tmseffect);
+        ret = self->SetParent(tmseffect);
         }
     TRACE_PRN_FN_EXT;
     return ret;
     }
 
-gint TMSGlobalGainEffectImpl::SetParentEffect(TMSEffect*& parenteffect)
+gint TMSGlobalGainEffectImpl::SetParent(TMSEffect*& parent)
     {
     gint ret(TMS_RESULT_SUCCESS);
     if (this->iBody)
         {
-        ((TMSGlobalGainEffectBodyImpl*) this->iBody)->SetParentEffect(
-                parenteffect);
+        ((TMSGlobalGainEffectBodyImpl*) this->iBody)->SetParent(parent);
         }
     else
         {
@@ -88,4 +86,3 @@
     return ret;
     }
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsglobalroutingbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsglobalroutingbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -25,7 +25,8 @@
 
 TMSGlobalRoutingBodyImpl::TMSGlobalRoutingBodyImpl() :
     iObserver(NULL),
-    iProxy(NULL)
+    iProxy(NULL),
+    iParent(NULL)
     {
     }
 
@@ -38,6 +39,7 @@
         iProxy = NULL;
         }
     iObserver = NULL;
+    iParent = NULL;
     iUserData = NULL;
     }
 
@@ -63,38 +65,38 @@
     gint ret(TMS_RESULT_SUCCESS);
     iClientId = 1;
     iProxy = new TMSProxy;
-    if (iProxy)
+    if (!iProxy)
         {
-        if (iProxy->Connect() != TMS_RESULT_SUCCESS)
-            {
-            delete iProxy;
-            iProxy = NULL;
-            ret = TMS_RESULT_FATAL_ERROR;
-            }
-        else
-            {
-            ret = iProxy->StartRoutingNotifier(); //starts TAR
-            }
+        ret = TMS_RESULT_INSUFFICIENT_MEMORY;
+        }
+    RET_REASON_IF_ERR(ret);
+
+    if (iProxy->Connect() != TMS_RESULT_SUCCESS)
+        {
+        delete iProxy;
+        iProxy = NULL;
+        ret = TMS_RESULT_FATAL_ERROR;
         }
     else
         {
-        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
+        ret = iProxy->StartRoutingNotifier(); //starts TAR
         }
+    RET_REASON_IF_ERR(ret);
     return ret;
     }
 
 gint TMSGlobalRoutingBodyImpl::AddObserver(TMSGlobalRoutingObserver& obsrvr,
-        gpointer /*user_data*/)
+        gpointer user_data)
     {
     gint ret(TMS_RESULT_SUCCESS);
     if (!iObserver)
         {
         iObserver = &obsrvr;
-        //iUserData = user_data;
+        iUserData = user_data;
         if (iProxy)
             {
             ret = iProxy->SetMsgQueueNotifier(EMsgQueueGlobalRoutingType,
-                    iObserver, NULL, iClientId);
+                    iObserver, iParent, iClientId);
             }
         else
             {
@@ -113,9 +115,10 @@
     gint ret(TMS_RESULT_SUCCESS);
     if (iProxy && (&obsrvr == iObserver))
         {
-        iProxy->RemoveMsgQueueNotifier(EMsgQueueGlobalRoutingType, iObserver);
+        ret = iProxy->RemoveMsgQueueNotifier(EMsgQueueGlobalRoutingType,
+                iObserver);
+        iObserver = NULL;
         ret = iProxy->CancelRoutingNotifier();
-        iObserver = NULL;
         }
     else
         {
@@ -180,4 +183,8 @@
     return ret;
     }
 
-// End of file
+void TMSGlobalRoutingBodyImpl::SetParent(TMSGlobalRouting*& parent)
+    {
+    iParent = parent;
+    }
+
--- a/mmserv/tms/tmsimpl/src/tmsglobalroutingimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsglobalroutingimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsglobalroutingbodyimpl.h"
 #include "tmsglobalroutingimpl.h"
@@ -49,7 +48,6 @@
     return ret;
     }
 
-// TO DO stop exporting this function
 EXPORT_C gint TMSGlobalRoutingImpl::Create(TMSGlobalRouting*& globrouting)
     {
     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
@@ -65,7 +63,11 @@
             self = NULL;
             }
         }
-    globrouting = self;
+    if (self && ret == TMS_RESULT_SUCCESS)
+        {
+        globrouting = self;
+        ret = self->SetParent(globrouting);
+        }
     TRACE_PRN_FN_EXT;
     return ret;
     }
@@ -80,4 +82,17 @@
     return ret;
     }
 
-// End of file
+gint TMSGlobalRoutingImpl::SetParent(TMSGlobalRouting*& parent)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (this->iBody)
+        {
+        ((TMSGlobalRoutingBodyImpl*) this->iBody)->SetParent(parent);
+        }
+    else
+        {
+        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
+        }
+    return ret;
+    }
+
--- a/mmserv/tms/tmsimpl/src/tmsglobalvoleffectbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsglobalvoleffectbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -26,7 +26,7 @@
 TMSGlobalVolEffectBodyImpl::TMSGlobalVolEffectBodyImpl() :
     iObserver(NULL),
     iProxy(NULL),
-    iGlobalEffect(NULL)
+    iParent(NULL)
     {
     }
 
@@ -39,7 +39,7 @@
         iProxy = NULL;
         }
     iObserver = NULL;
-    iGlobalEffect = NULL;
+    iParent = NULL;
     iUserData = NULL;
     }
 
@@ -65,34 +65,39 @@
     gint ret(TMS_RESULT_SUCCESS);
     iClientId = 1;
     iProxy = new TMSProxy;
-    if (iProxy)
+    if (!iProxy)
         {
-        if (iProxy->Connect() != TMS_RESULT_SUCCESS)
-            {
-            delete iProxy;
-            iProxy = NULL;
-            ret = TMS_RESULT_FATAL_ERROR;
-            }
+        ret = TMS_RESULT_INSUFFICIENT_MEMORY;
+        }
+    RET_REASON_IF_ERR(ret);
+
+    if (iProxy->Connect() != TMS_RESULT_SUCCESS)
+        {
+        delete iProxy;
+        iProxy = NULL;
+        ret = TMS_RESULT_FATAL_ERROR;
         }
     else
         {
-        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
+        // Starts TAR if not started already;
+        ret = iProxy->StartRoutingNotifier();
         }
+    RET_REASON_IF_ERR(ret);
     return ret;
     }
 
 gint TMSGlobalVolEffectBodyImpl::AddObserver(TMSEffectObserver& obsrvr,
-        gpointer /*user_data*/)
+        gpointer user_data)
     {
     gint ret(TMS_RESULT_SUCCESS);
     if (!iObserver)
         {
         iObserver = &obsrvr;
-        //iUserData = user_data;
+        iUserData = user_data;
         if (iProxy)
             {
             ret = iProxy->SetMsgQueueNotifier(EMsgQueueGlobalVolumeType,
-                    iObserver, iGlobalEffect, iClientId);
+                    iObserver, iParent, iClientId);
             if (ret == TMS_RESULT_SUCCESS)
                 {
                 ret = iProxy->StartGlobalEffectNotifier();
@@ -113,12 +118,13 @@
 gint TMSGlobalVolEffectBodyImpl::RemoveObserver(TMSEffectObserver& obsrvr)
     {
     gint ret(TMS_RESULT_SUCCESS);
-
     if (iProxy && (&obsrvr == iObserver))
         {
-        iProxy->RemoveMsgQueueNotifier(EMsgQueueGlobalVolumeType, iObserver);
+        ret = iProxy->RemoveMsgQueueNotifier(EMsgQueueGlobalVolumeType,
+            iObserver);
         iObserver = NULL;
-        //ret = iProxy->StopEffectNotifier(obsrvr);
+        ret = iProxy->CancelGlobalEffectNotifier();
+        ret = iProxy->CancelRoutingNotifier();
         }
     else
         {
@@ -176,10 +182,8 @@
     return ret;
     }
 
-void TMSGlobalVolEffectBodyImpl::SetParentEffect(TMSEffect*& parenteffect)
+void TMSGlobalVolEffectBodyImpl::SetParent(TMSEffect*& parent)
     {
-    iGlobalEffect = NULL;
-    iGlobalEffect = parenteffect;
+    iParent = parent;
     }
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsglobalvoleffectimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsglobalvoleffectimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,9 +15,8 @@
  *
  */
 
-#include <tms.h>
+#include "tmsutility.h"
 #include "tmsglobalvoleffectbodyimpl.h"
-#include "tmsutility.h"
 #include "tmsglobalvoleffectimpl.h"
 
 using namespace TMS;
@@ -45,7 +44,6 @@
         {
         this->iBody = bodyimpl;
         }
-
     TRACE_PRN_FN_EXT;
     return ret;
     }
@@ -65,23 +63,21 @@
             self = NULL;
             }
         }
-
     if (self && ret == TMS_RESULT_SUCCESS)
         {
         tmseffect = self;
-        ret = self->SetParentEffect(tmseffect);
+        ret = self->SetParent(tmseffect);
         }
-
     TRACE_PRN_FN_EXT;
     return ret;
     }
 
-gint TMSGlobalVolEffectImpl::SetParentEffect(TMSEffect*& parenteffect)
+gint TMSGlobalVolEffectImpl::SetParent(TMSEffect*& parent)
     {
-    gint  ret(TMS_RESULT_SUCCESS);
+    gint ret(TMS_RESULT_SUCCESS);
     if (this->iBody)
         {
-        ((TMSGlobalVolEffectBodyImpl*) this->iBody)->SetParentEffect(parenteffect);
+        ((TMSGlobalVolEffectBodyImpl*) this->iBody)->SetParent(parent);
         }
     else
         {
@@ -90,4 +86,3 @@
     return ret;
     }
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsilbcbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsilbcbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -134,7 +134,7 @@
         iProxy = context->CallProxy;
         iStreamType = context->StreamType;
         TMSFormatBodyImpl::SetProxy(iProxy, queuehandler);
-        ((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_ILBC);
+        ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_ILBC);
         }
     }
 
--- a/mmserv/tms/tmsimpl/src/tmsilbcimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsilbcimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsilbcbodyimpl.h"
 #include "tmsilbcformatimpl.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsimpl/src/tmsinbandtonebodyimpl.cpp	Fri Apr 16 15:29:42 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
+ *
+ */
+
+#include <tms.h>
+#include <tmsinbandtoneobsrvr.h>
+#include "tmsutility.h"
+#include "tmsproxy.h"
+#include "tmsinbandtonebodyimpl.h"
+
+using namespace TMS;
+
+TMSInbandToneBodyImpl::TMSInbandToneBodyImpl() :
+    iObserver(NULL),
+    iProxy(NULL),
+    iParent(NULL)
+    {
+    }
+
+TMSInbandToneBodyImpl::~TMSInbandToneBodyImpl()
+    {
+    if (iProxy)
+        {
+        iProxy->Close();
+        delete iProxy;
+        iProxy = NULL;
+        }
+    iObserver = NULL;
+    iParent = NULL;
+    iUserData = NULL;
+    }
+
+gint TMSInbandToneBodyImpl::Create(TMSInbandToneBody*& bodyimpl)
+    {
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    TMSInbandToneBodyImpl* self = new TMSInbandToneBodyImpl();
+    if (self)
+        {
+        ret = self->PostConstruct();
+        if (ret != TMS_RESULT_SUCCESS)
+            {
+            delete self;
+            self = NULL;
+            }
+        }
+    bodyimpl = self;
+    return ret;
+    }
+
+gint TMSInbandToneBodyImpl::PostConstruct()
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    iClientId = 1;
+    iProxy = new TMSProxy;
+
+    if (!iProxy)
+        {
+        ret = TMS_RESULT_INSUFFICIENT_MEMORY;
+        }
+    RET_REASON_IF_ERR(ret);
+
+    if (iProxy->Connect() != TMS_RESULT_SUCCESS)
+        {
+        delete iProxy;
+        iProxy = NULL;
+        ret = TMS_RESULT_FATAL_ERROR;
+        }
+    RET_REASON_IF_ERR(ret);
+    return ret;
+    }
+
+gint TMSInbandToneBodyImpl::AddObserver(TMSInbandToneObserver& obsrvr,
+        gpointer user_data)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (!iObserver)
+        {
+        iObserver = &obsrvr;
+        iUserData = user_data;
+        if (iProxy)
+            {
+            ret = iProxy->SetMsgQueueNotifier(EMsgQueueInbandToneType,
+                    iObserver, iParent, iClientId);
+            if (ret == TMS_RESULT_SUCCESS)
+                {
+                //ret = iProxy->StartInbandToneNotifier();
+                }
+            }
+        else
+            {
+            ret = TMS_RESULT_DOES_NOT_EXIST;
+            }
+        }
+    else
+        {
+        ret = TMS_RESULT_ALREADY_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSInbandToneBodyImpl::RemoveObserver(TMSInbandToneObserver& obsrvr)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (iProxy && (&obsrvr == iObserver))
+        {
+        ret = iProxy->RemoveMsgQueueNotifier(EMsgQueueInbandToneType,
+                iObserver);
+        iObserver = NULL;
+        //iProxy->CancelInbandToneNotifier();
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSInbandToneBodyImpl::Start(TMSInbandToneType inbandtone)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+
+    if (iProxy)
+        {
+        ret = iProxy->StartInbandTone(inbandtone);
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSInbandToneBodyImpl::Stop()
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (iProxy)
+        {
+        ret = iProxy->StopInbandTone();
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+void TMSInbandToneBodyImpl::SetParent(TMSInbandTone*& parent)
+    {
+    iParent = parent;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsimpl/src/tmsinbandtoneimpl.cpp	Fri Apr 16 15:29:42 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 "tmsutility.h"
+#include "tmsinbandtonebodyimpl.h"
+#include "tmsinbandtoneimpl.h"
+
+using namespace TMS;
+
+TMSInbandToneImpl::TMSInbandToneImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSInbandToneImpl::~TMSInbandToneImpl(void)
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+gint TMSInbandToneImpl::PostConstruct()
+    {
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    TMSInbandToneBody* bodyimpl(NULL);
+    TRACE_PRN_FN_ENT;
+    ret = TMSInbandToneBodyImpl::Create(bodyimpl);
+
+    if (ret == TMS_RESULT_SUCCESS)
+        {
+        this->iBody = bodyimpl;
+        }
+    TRACE_PRN_FN_EXT;
+    return ret;
+    }
+
+EXPORT_C gint TMSInbandToneImpl::Create(TMSInbandTone*& inbandtone)
+    {
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    TMSInbandToneImpl *self = new TMSInbandToneImpl();
+
+    TRACE_PRN_FN_ENT;
+    if (self)
+        {
+        ret = self->PostConstruct();
+        if (ret != TMS_RESULT_SUCCESS)
+            {
+            delete self;
+            self = NULL;
+            }
+        }
+    if (self && ret == TMS_RESULT_SUCCESS)
+        {
+        inbandtone = self;
+        ret = self->SetParent(inbandtone);
+        }
+    TRACE_PRN_FN_EXT;
+    return ret;
+    }
+
+EXPORT_C gint TMSInbandToneImpl::Delete(TMSInbandTone*& inbandtone)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    TRACE_PRN_FN_ENT;
+    delete (TMSInbandToneImpl*) (inbandtone);
+    inbandtone = NULL;
+    TRACE_PRN_FN_EXT;
+    return ret;
+    }
+
+gint TMSInbandToneImpl::SetParent(TMSInbandTone*& parent)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (this->iBody)
+        {
+        ((TMSInbandToneBodyImpl*) this->iBody)->SetParent(parent);
+        }
+    else
+        {
+        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
+        }
+    return ret;
+    }
+
--- a/mmserv/tms/tmsimpl/src/tmsipcallbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsipcallbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -125,7 +125,7 @@
             if (ret == TMS_RESULT_SUCCESS)
                 {
                 ret = AddStreamToList(strm);
-                }           
+                }
             //TODO:Need longer term fix to not destory everything
             //if more the one stream is trying to be created.
             else if (ret == TMS_RESULT_ALREADY_EXIST)
@@ -194,10 +194,9 @@
     if (itStrm)
         {
         iStreamsVector.erase(itStrm); // Remove from array
-        // Don't delete itStrm as it is now pointing to the next item on the list
-        delete strm; // Free memory
-        strm = NULL;
-        ret = TMS_RESULT_SUCCESS;
+        // Don't delete itStrm as the iterator advanced to the next 
+        // item on the list
+        ret = TMSStreamImpl::Delete(strm);
         }
     TRACE_PRN_FN_EXT;
     return ret;
--- a/mmserv/tms/tmsimpl/src/tmsmicsourcebodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsmicsourcebodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -64,7 +64,7 @@
         gpointer /*queuehandler*/)
     {
     iProxy = aProxy;
-    //((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_SOURCE_MIC);
+    //((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_SOURCE_MIC);
     }
 
 // End of file
--- a/mmserv/tms/tmsimpl/src/tmsmicsourceimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsmicsourceimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsmicsourcebodyimpl.h"
 #include "tmsmicsourceimpl.h"
@@ -24,10 +23,14 @@
 
 TMSMicSourceImpl::TMSMicSourceImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSMicSourceImpl::~TMSMicSourceImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSMicSourceImpl::PostConstruct()
--- a/mmserv/tms/tmsimpl/src/tmsmodemsinkbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsmodemsinkbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -64,7 +64,7 @@
         gpointer /*queuehandler*/)
     {
     iProxy = aProxy;
-    //((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_SINK_MODEM);
+    //((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_SINK_MODEM);
     }
 
 // End of file
--- a/mmserv/tms/tmsimpl/src/tmsmodemsinkimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsmodemsinkimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsmodemsinkimpl.h"
 #include "tmsmodemsinkbodyimpl.h"
@@ -24,10 +23,14 @@
 
 TMSModemSinkImpl::TMSModemSinkImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSModemSinkImpl::~TMSModemSinkImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSModemSinkImpl::PostConstruct()
--- a/mmserv/tms/tmsimpl/src/tmsmodemsourcebodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsmodemsourcebodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -64,7 +64,7 @@
         gpointer /*queuehandler*/)
     {
     iProxy = aProxy;
-    //((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_SOURCE_MODEM);
+    //((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_SOURCE_MODEM);
     }
 
 // End of file
--- a/mmserv/tms/tmsimpl/src/tmsmodemsourceimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsmodemsourceimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsmodemsourceimpl.h"
 #include "tmsmodemsourcebodyimpl.h"
@@ -24,10 +23,14 @@
 
 TMSModemSourceImpl::TMSModemSourceImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSModemSourceImpl::~TMSModemSourceImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSModemSourceImpl::PostConstruct()
--- a/mmserv/tms/tmsimpl/src/tmspcmbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmspcmbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -74,7 +74,7 @@
         iProxy = context->CallProxy;
         iStreamType = context->StreamType;
         TMSFormatBodyImpl::SetProxy(iProxy, queuehandler);
-        ((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_PCM);
+        ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_PCM);
         }
     }
 
--- a/mmserv/tms/tmsimpl/src/tmspcmimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmspcmimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmspcmbodyimpl.h"
 #include "tmspcmformatimpl.h"
@@ -24,10 +23,14 @@
 
 TMSPCMFormatImpl::TMSPCMFormatImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSPCMFormatImpl::~TMSPCMFormatImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSPCMFormatImpl::PostConstruct()
--- a/mmserv/tms/tmsimpl/src/tmsqueuehandler.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsqueuehandler.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -26,36 +26,36 @@
 
 using namespace TMS;
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::NewL
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::NewL
 // Symbian constructor
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-CQueueHandler* CQueueHandler::NewL(RMsgQueue<TmsMsgBuf>* aMsgQueue,
+TMSQueueHandler* TMSQueueHandler::NewL(RMsgQueue<TmsMsgBuf>* aMsgQueue,
         TMSGlobalContext* glblCtx)
     {
-    CQueueHandler* self = new (ELeave) CQueueHandler(aMsgQueue, glblCtx);
+    TMSQueueHandler* self = new (ELeave) TMSQueueHandler(aMsgQueue, glblCtx);
     CleanupStack::PushL(self);
     self->ConstructL();
     CleanupStack::Pop(self);
     return self;
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::ConstructL
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::ConstructL
 // Second phase constructor.
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CQueueHandler::ConstructL()
+void TMSQueueHandler::ConstructL()
     {
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::~CQueueHandler
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::~TMSQueueHandler
 // Destructor.
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-CQueueHandler::~CQueueHandler()
+TMSQueueHandler::~TMSQueueHandler()
     {
     Cancel();
     iObserversList.Reset();
@@ -64,12 +64,12 @@
     delete iBuffer;
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::CQueueHandler
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::TMSQueueHandler
 // Constructor.
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-CQueueHandler::CQueueHandler(RMsgQueue<TmsMsgBuf>* aMsgQueue,
+TMSQueueHandler::TMSQueueHandler(RMsgQueue<TmsMsgBuf>* aMsgQueue,
         TMSGlobalContext* glblCtx) :
     CActive(CActive::EPriorityStandard),
     iMsgQueue(aMsgQueue),
@@ -79,25 +79,31 @@
     iTMSGlobalContext = glblCtx;
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::Start
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::Start
 // Start listening for events on queue 0.
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CQueueHandler::Start()
+void TMSQueueHandler::Start()
     {
     if (!IsActive() && iMsgQueue)
         {
+        iStatus = KRequestPending;
         iMsgQueue->NotifyDataAvailable(iStatus);
         SetActive();
         }
     }
 
-TInt CQueueHandler::AddObserver(MQueueHandlerObserver& aObserver,
-        TInt aClientId)
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::AddObserver
+//
+// -----------------------------------------------------------------------------
+//
+gint TMSQueueHandler::AddObserver(MQueueHandlerObserver& aObserver,
+        gint aClientId)
     {
     // Add to list if observer is not already added
-    TInt status = iObserversList.Find(&aObserver);
+    gint status = iObserversList.Find(&aObserver);
     if (status == KErrNotFound)
         {
         status = iObserversList.Append(&aObserver);
@@ -105,37 +111,41 @@
         }
     else
         {
-        status = KErrAlreadyExists;
+        status = TMS_RESULT_ALREADY_EXIST;
         }
     return status;
     }
 
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::RemoveObserver
 // Marks observer as inactive in the list
-TInt CQueueHandler::RemoveObserver(MQueueHandlerObserver& aObserver)
+// -----------------------------------------------------------------------------
+//
+gint TMSQueueHandler::RemoveObserver(MQueueHandlerObserver& aObserver)
     {
-    TInt status(KErrNone);
-    TInt index = iObserversList.Find(&aObserver);
+    gint status(TMS_RESULT_SUCCESS);
+    gint index = iObserversList.Find(&aObserver);
     // If found status has index to observer in the array
     // else it would contain KErrNotFound
     if (index >= 0)
         {
         iObserversList.Remove(index);
         iClientList.Remove(index);
-        status = KErrNone;
+        status = TMS_RESULT_SUCCESS;
         }
     else
         {
-        status = KErrNotFound;
+        status = TMS_RESULT_DOES_NOT_EXIST;
         }
     return status;
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::DoCancel
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::DoCancel
 // Cancel outstanding request
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CQueueHandler::DoCancel()
+void TMSQueueHandler::DoCancel()
     {
     if (iMsgQueue)
         {
@@ -143,15 +153,15 @@
         }
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::RunL
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::RunL
 // Process requests.
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CQueueHandler::RunL()
+void TMSQueueHandler::RunL()
     {
     TmsMsgBuf msgBuf;
-    TInt err = KErrNone;
+    gint err = TMS_RESULT_SUCCESS;
 
     if (iMsgQueue)
         {
@@ -159,14 +169,14 @@
         }
     else
         {
-        err = KErrGeneral;
+        err = TMS_RESULT_INVALID_STATE;
         }
 
-    // Start monitoring for more events before calling the observer as client
-    // may decide to destroy us before this RunL completes executing.
+    // Start monitoring for more events before calling the observer in case
+    // client decides to destroy us before this RunL completes executing.
     Start();
 
-    if (err == KErrNone)
+    if (err == TMS_RESULT_SUCCESS)
         {
         switch (msgBuf.iRequest)
             {
@@ -179,7 +189,7 @@
             case ECmdDownlinkPaused:
             case ECmdUplinkPaused:
                 {
-                TInt index = FindStreamInList();
+                gint index = FindStreamInList();
                 if (index != KErrNotFound)
                     {
                     TMSStreamState streamstate = ConvertToStreamState(
@@ -190,7 +200,7 @@
                 else
                     {
                     // This should never happen
-                    err = KErrNotFound;
+                    err = TMS_RESULT_DOES_NOT_EXIST;
                     }
                 break;
                 }
@@ -226,21 +236,23 @@
                 }
             case ECmdSetGain:
                 {
-                TInt index = FindGainEffectInList();
+                gint index = FindGainEffectInList();
                 if (index != KErrNotFound)
                     {
-                    iObserversList[index]->QueueEvent(TMS_EVENT_EFFECT_GAIN_CHANGED,
-                            msgBuf.iStatus, NULL);
+                    iObserversList[index]->QueueEvent(
+                            TMS_EVENT_EFFECT_GAIN_CHANGED, msgBuf.iStatus,
+                            NULL);
                     }
                 }
                 break;
             case ECmdSetVolume:
                 {
-                TInt index = FindVolEffectInList();
+                gint index = FindVolEffectInList();
                 if (index != KErrNotFound)
                     {
-                    iObserversList[index]->QueueEvent(TMS_EVENT_EFFECT_VOL_CHANGED,
-                            msgBuf.iStatus, NULL);
+                    iObserversList[index]->QueueEvent(
+                            TMS_EVENT_EFFECT_VOL_CHANGED, msgBuf.iStatus,
+                            NULL);
                     }
                 }
                 break;
@@ -250,15 +262,15 @@
         }
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::DoFillBuffer
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::DoFillBuffer
 //
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CQueueHandler::DoFillBuffer(TInt aBufLen, TInt aStatus,
-        TBool aOpenChunk, TUint32 key)
+void TMSQueueHandler::DoFillBuffer(gint aBufLen, gint aStatus,
+        gboolean aOpenChunk, guint32 key)
     {
-    TInt err = KErrNone;
+    gint err = TMS_RESULT_SUCCESS;
 
     // See if chunk needs to be opened
     if (aOpenChunk)
@@ -271,20 +283,19 @@
         iBuffer = NULL;
 
         // Get handle to chunk from proxy
-        TInt hndl(0);
-        err = KErrNotReady;
+        gint hndl(0);
+        err = TMS_RESULT_NULL_ARGUMENT;
         if (iTMSGlobalContext->CallProxy)
             {
             hndl = (iTMSGlobalContext->CallProxy)->GetDataXferChunkHandle(
                     iTMSGlobalContext->CallType,
                     iTMSGlobalContext->StreamType,
-                    iTMSGlobalContext->StreamId,
-                    key);
+                    iTMSGlobalContext->StreamId, key);
             err = iChunk.SetReturnedHandle(hndl);
             }
         }
 
-    if (err == KErrNone)
+    if (err == TMS_RESULT_SUCCESS)
         {
         iChunkDataPtr.Set(iChunk.Base(), 0, aBufLen);
         if (!iBuffer)
@@ -294,15 +305,15 @@
             }
         iBuffer->SetDataSize(aBufLen);
 
-        TInt index = iClientList.Find(TMS_SOURCE_CLIENT);
+        gint index = iClientList.Find(TMS_SOURCE_CLIENT);
         if (index != KErrNotFound)
             {
-            iObserversList[index]->QueueEvent(
-                    TMS_EVENT_SOURCE_FILL_BUFFER, aStatus, iBuffer);
+            iObserversList[index]->QueueEvent(TMS_EVENT_SOURCE_FILL_BUFFER,
+                    aStatus, iBuffer);
             }
         else
             {
-            err = KErrNotFound;
+            err = TMS_RESULT_DOES_NOT_EXIST;
             }
         }
     else
@@ -311,15 +322,15 @@
         }
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::DoEmptyBuffer
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::DoEmptyBuffer
 //
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-void CQueueHandler::DoEmptyBuffer(TInt aBufLen, TInt aStatus,
-        TBool aOpenChunk, TUint32 key)
+void TMSQueueHandler::DoEmptyBuffer(gint aBufLen, gint aStatus,
+        gboolean aOpenChunk, guint32 key)
     {
-    TInt err(KErrNone);
+    gint err(TMS_RESULT_SUCCESS);
 
     // See if chunk needs to be opened
     if (aOpenChunk)
@@ -330,15 +341,14 @@
             }
 
         // Get handle to chunk from proxy
-        TInt hndl(0);
-        err = KErrNotReady;
+        gint hndl(0);
+        err = TMS_RESULT_NULL_ARGUMENT;
         if (iTMSGlobalContext->CallProxy)
             {
             hndl = (iTMSGlobalContext->CallProxy)->GetDataXferChunkHandle(
                     iTMSGlobalContext->CallType,
                     iTMSGlobalContext->StreamType,
-                    iTMSGlobalContext->StreamId,
-                    key);
+                    iTMSGlobalContext->StreamId, key);
             err = iChunk.SetReturnedHandle(hndl);
             }
         // TODO handle error here
@@ -346,7 +356,7 @@
         iBuffer = NULL;
         }
 
-    if (err == KErrNone)
+    if (err == TMS_RESULT_SUCCESS)
         {
         iChunkDataPtr.Set(iChunk.Base(), aBufLen, aBufLen);
         if (!iBuffer)
@@ -355,15 +365,15 @@
                     const_cast<guint8*> (iChunkDataPtr.Ptr()), iBuffer);
             }
         iBuffer->SetDataSize(aBufLen);
-        TInt index = iClientList.Find(TMS_SINK_CLIENT);
+        gint index = iClientList.Find(TMS_SINK_CLIENT);
         if (index != KErrNotFound)
             {
-            iObserversList[index]->QueueEvent(
-                    TMS_EVENT_SINK_PROCESS_BUFFER, aStatus, iBuffer);
+            iObserversList[index]->QueueEvent(TMS_EVENT_SINK_PROCESS_BUFFER,
+                    aStatus, iBuffer);
             }
         else
             {
-            err = KErrNotFound;
+            err = TMS_RESULT_DOES_NOT_EXIST;
             }
         }
     else
@@ -372,12 +382,12 @@
         }
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::ConvertToStreamState
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::ConvertToStreamState
 //
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-TMSStreamState CQueueHandler::ConvertToStreamState(TInt request)
+TMSStreamState TMSQueueHandler::ConvertToStreamState(gint request)
     {
     TMSStreamState state = TMS_STREAM_UNINITIALIZED;
     switch (request)
@@ -404,62 +414,61 @@
     return state;
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::RunError
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::RunError
 // Process requests.
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-TInt CQueueHandler::RunError(TInt /*aError*/)
+TInt TMSQueueHandler::RunError(TInt /*aError*/)
     {
     // Current implementation of RunL does not leave
-    return 0;
+    return TMS_RESULT_SUCCESS;
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::Status
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::Status
 // Return request status.
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-TRequestStatus* CQueueHandler::Status()
+TRequestStatus* TMSQueueHandler::Status()
     {
     return &iStatus;
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::FindStreamInList
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::FindStreamInList
 // Return stream index.
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-TInt CQueueHandler::FindStreamInList()
+gint TMSQueueHandler::FindStreamInList()
     {
     gint index(-1);
     index = iClientList.Find(TMS_STREAM_UPLINK);
     if (index == KErrNotFound)
         {
         index = iClientList.Find(TMS_STREAM_DOWNLINK);
-        return index;
         }
     return index;
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::FindGainEffectInList
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::FindGainEffectInList
 // Return effect index.
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-TInt CQueueHandler::FindGainEffectInList()
+gint TMSQueueHandler::FindGainEffectInList()
     {
     gint index(-1);
     index = iClientList.Find(TMS_EFFECT_GAIN);
     return index;
     }
 
-// ----------------------------------------------------------------------------
-// CQueueHandler::FindVolEffectInList
+// -----------------------------------------------------------------------------
+// TMSQueueHandler::FindVolEffectInList
 // Return effect index.
-// ----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
 //
-TInt CQueueHandler::FindVolEffectInList()
+gint TMSQueueHandler::FindVolEffectInList()
     {
     gint index(-1);
     index = iClientList.Find(TMS_EFFECT_VOLUME);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsimpl/src/tmsringtonebodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,233 @@
+/*
+ * 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 <tms.h>
+#include <tmsringtoneobsrvr.h>
+#include "tmsutility.h"
+#include "tmsproxy.h"
+#include "tmsringtonebodyimpl.h"
+
+using namespace TMS;
+
+TMSRingToneBodyImpl::TMSRingToneBodyImpl() :
+    iObserver(NULL),
+    iProxy(NULL),
+    iParent(NULL)
+    {
+    }
+
+TMSRingToneBodyImpl::~TMSRingToneBodyImpl()
+    {
+    if (iProxy)
+        {
+        iProxy->Close();
+        delete iProxy;
+        iProxy = NULL;
+        }
+    iObserver = NULL;
+    iParent = NULL;
+    iUserData = NULL;
+    }
+
+gint TMSRingToneBodyImpl::Create(TMSRingToneBody*& bodyimpl)
+    {
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    TMSRingToneBodyImpl* self = new TMSRingToneBodyImpl;
+    if (self)
+        {
+        ret = self->PostConstruct();
+        if (ret != TMS_RESULT_SUCCESS)
+            {
+            delete self;
+            self = NULL;
+            }
+        }
+    bodyimpl = self;
+    return ret;
+    }
+
+gint TMSRingToneBodyImpl::Create(TMSRingToneBody*& bodyimpl,
+        RWindow& /*window*/, gint /*scrid*/)
+    {
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    TMSRingToneBodyImpl* self = new TMSRingToneBodyImpl;
+    if (self)
+        {
+        ret = self->PostConstruct();
+        if (ret != TMS_RESULT_SUCCESS)
+            {
+            delete self;
+            self = NULL;
+            }
+        }
+    bodyimpl = self;
+    return ret;
+    }
+
+gint TMSRingToneBodyImpl::PostConstruct()
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    iClientId = 1;
+    iProxy = new TMSProxy;
+
+    if (!iProxy)
+        {
+        ret = TMS_RESULT_INSUFFICIENT_MEMORY;
+        }
+    RET_REASON_IF_ERR(ret);
+
+    if (iProxy->Connect() != TMS_RESULT_SUCCESS)
+        {
+        delete iProxy;
+        iProxy = NULL;
+        ret = TMS_RESULT_FATAL_ERROR;
+        }
+    RET_REASON_IF_ERR(ret);
+    return ret;
+    }
+
+gint TMSRingToneBodyImpl::AddObserver(TMSRingToneObserver& obsrvr,
+        gpointer user_data)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (!iObserver)
+        {
+        iObserver = &obsrvr;
+        iUserData = user_data;
+        if (iProxy)
+            {
+            ret = iProxy->SetMsgQueueNotifier(EMsgQueueRingtoneType, iObserver,
+                    iParent, iClientId);
+            }
+        else
+            {
+            ret = TMS_RESULT_DOES_NOT_EXIST;
+            }
+        }
+    else
+        {
+        ret = TMS_RESULT_ALREADY_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSRingToneBodyImpl::RemoveObserver(TMSRingToneObserver& obsrvr)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (iProxy && (&obsrvr == iObserver))
+        {
+        ret = iProxy->RemoveMsgQueueNotifier(EMsgQueueRingtoneType, iObserver);
+        iObserver = NULL;
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSRingToneBodyImpl::Init(const TMSRingToneType type, GString* str,
+        GString* tts)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (iProxy)
+        {
+        ret = iProxy->InitRT(type, str, tts);
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSRingToneBodyImpl::Deinit()
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (iProxy)
+        {
+        ret = iProxy->DeinitRT();
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSRingToneBodyImpl::Play()
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (iProxy)
+        {
+        ret = iProxy->PlayRT();
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSRingToneBodyImpl::Stop()
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (iProxy)
+        {
+        ret = iProxy->StopRT();
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSRingToneBodyImpl::Pause()
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (iProxy)
+        {
+        ret = iProxy->PauseRT();
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+gint TMSRingToneBodyImpl::Mute()
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (iProxy)
+        {
+        ret = iProxy->MuteRT();
+        }
+    else
+        {
+        ret = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return ret;
+    }
+
+
+void TMSRingToneBodyImpl::SetParent(TMSRingTone*& parent)
+    {
+    iParent = parent;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsimpl/src/tmsringtoneimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,138 @@
+/*
+ * 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 "tmsutility.h"
+#include "tmsringtonebodyimpl.h"
+#include "tmsringtoneimpl.h"
+
+using namespace TMS;
+
+TMSRingToneImpl::TMSRingToneImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSRingToneImpl::~TMSRingToneImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+gint TMSRingToneImpl::PostConstruct()
+    {
+    TRACE_PRN_FN_ENT;
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    TMSRingToneBody* bodyimpl(NULL);
+    ret = TMSRingToneBodyImpl::Create(bodyimpl);
+
+    if (ret == TMS_RESULT_SUCCESS)
+        {
+        this->iBody = bodyimpl;
+        }
+    TRACE_PRN_FN_EXT;
+    return ret;
+    }
+
+gint TMSRingToneImpl::PostConstruct(RWindow& window, gint scrid)
+    {
+    TRACE_PRN_FN_ENT;
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    TMSRingToneBody* bodyimpl(NULL);
+    ret = TMSRingToneBodyImpl::Create(bodyimpl, window, scrid);
+
+    if (ret == TMS_RESULT_SUCCESS)
+        {
+        this->iBody = bodyimpl;
+        }
+    TRACE_PRN_FN_EXT;
+    return ret;
+    }
+
+EXPORT_C gint TMSRingToneImpl::Create(TMSRingTone*& rt)
+    {
+    TRACE_PRN_FN_ENT;
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    TMSRingToneImpl *self = new TMSRingToneImpl;
+
+    TRACE_PRN_FN_ENT;
+    if (self)
+        {
+        ret = self->PostConstruct();
+        if (ret != TMS_RESULT_SUCCESS)
+            {
+            delete self;
+            self = NULL;
+            }
+        }
+    if (self && ret == TMS_RESULT_SUCCESS)
+        {
+        rt = self;
+        self->SetParent(rt);
+        }
+    TRACE_PRN_FN_EXT;
+    return ret;
+    }
+
+EXPORT_C gint TMSRingToneImpl::Create(TMSRingTone*& rt, RWindow& window,
+        gint scrid)
+    {
+    TRACE_PRN_FN_ENT;
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    TMSRingToneImpl *self = new TMSRingToneImpl;
+    if (self)
+        {
+        ret = self->PostConstruct(window, scrid);
+        if (ret != TMS_RESULT_SUCCESS)
+            {
+            delete self;
+            self = NULL;
+            }
+        }
+    if (self && ret == TMS_RESULT_SUCCESS)
+        {
+        rt = self;
+        self->SetParent(rt);
+        }
+    TRACE_PRN_FN_EXT;
+    return ret;
+    }
+
+EXPORT_C gint TMSRingToneImpl::Delete(TMSRingTone*& rt)
+    {
+    TRACE_PRN_FN_ENT;
+    gint ret(TMS_RESULT_SUCCESS);
+    delete (TMSRingToneImpl*) (rt);
+    rt = NULL;
+    TRACE_PRN_FN_EXT;
+    return ret;
+    }
+
+gint TMSRingToneImpl::SetParent(TMSRingTone*& parent)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (this->iBody)
+        {
+        ((TMSRingToneBodyImpl*) this->iBody)->SetParent(parent);
+        }
+    else
+        {
+        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
+        }
+    return ret;
+    }
+
--- a/mmserv/tms/tmsimpl/src/tmssinkimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmssinkimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,15 +15,26 @@
  *
  */
 
-#include <tms.h>
+#include "tmsutility.h"
 #include "tmsclientsinkimpl.h"
-#include "tmsutility.h"
-#include "tmssinkimpl.h"
 #include "tmsmodemsinkimpl.h"
 #include "tmsspeakersinkimpl.h"
+#include "tmssinkimpl.h"
 
 using namespace TMS;
 
+TMSSinkImpl::TMSSinkImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSSinkImpl::~TMSSinkImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
 EXPORT_C gint TMSSinkImpl::Create(TMSSinkType sinktype, TMSSink*& tmssink)
     {
     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
--- a/mmserv/tms/tmsimpl/src/tmssourceimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmssourceimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsclientsourceimpl.h"
 #include "tmsutility.h"
 #include "tmssourceimpl.h"
@@ -24,6 +23,18 @@
 
 using namespace TMS;
 
+TMSSourceImpl::TMSSourceImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSSourceImpl::~TMSSourceImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
 EXPORT_C gint TMSSourceImpl::Create(TMSSourceType sourcetype,
         TMSSource*& tmssource)
     {
--- a/mmserv/tms/tmsimpl/src/tmsspeakersinkbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsspeakersinkbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -64,7 +64,7 @@
         gpointer /*queuehandler*/)
     {
     iProxy = aProxy;
-    //((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_SINK_SPEAKER);
+    //((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_SINK_SPEAKER);
     }
 
 // End of file
--- a/mmserv/tms/tmsimpl/src/tmsspeakersinkimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsspeakersinkimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsspeakersinkimpl.h"
 #include "tmsspeakersinkbodyimpl.h"
@@ -24,10 +23,14 @@
 
 TMSSpeakerSinkImpl::TMSSpeakerSinkImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSSpeakerSinkImpl::~TMSSpeakerSinkImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSSpeakerSinkImpl::PostConstruct()
--- a/mmserv/tms/tmsimpl/src/tmsstreambodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsstreambodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -705,7 +705,7 @@
         }
     else
         {
-        iMsgQHandler = CQueueHandler::NewL(&iMsgQueue, &iContext);
+        iMsgQHandler = TMSQueueHandler::NewL(&iMsgQueue, &iContext);
         iMsgQHandler->AddObserver(*this, iContext.StreamType);
         }
 
--- a/mmserv/tms/tmsimpl/src/tmsstreamimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsstreamimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,7 +15,7 @@
  *
  */
 
-#include <tms.h>
+#include "tmsutility.h"
 #include "tmsstreambodyimpl.h"
 #include "tmsstreamimpl.h"
 
@@ -23,10 +23,14 @@
 
 TMSStreamImpl::TMSStreamImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSStreamImpl::~TMSStreamImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSStreamImpl::PostConstruct(TMSCallType callType, TMSStreamType stype,
@@ -63,4 +67,13 @@
     return ret;
     }
 
-// End of file
+gint TMSStreamImpl::Delete(TMSStream*& strm)
+    {
+    TRACE_PRN_FN_ENT;
+    gint ret(TMS_RESULT_SUCCESS);
+    delete (TMSStreamImpl*) (strm);
+    strm = NULL;
+    TRACE_PRN_FN_EXT;
+    return ret;
+    }
+
--- a/mmserv/tms/tmsimpl/src/tmsvolumeeffectbodyimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsvolumeeffectbodyimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -17,6 +17,7 @@
 
 #include <tms.h>
 #include <tmseffectobsrvr.h>
+#include "tmsutility.h"
 #include "tmscallproxy.h"
 #include "tmsqueuehandler.h"
 #include "tmsvolumeeffectbodyimpl.h"
@@ -26,12 +27,14 @@
 TMSVolumeEffectBodyImpl::TMSVolumeEffectBodyImpl() :
     iObserver(NULL),
     iProxy(NULL),
-    iParentEffect(NULL)
+    iParent(NULL)
     {
     }
 
 TMSVolumeEffectBodyImpl::~TMSVolumeEffectBodyImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSVolumeEffectBodyImpl::Create(TMSVolumeEffectBody*& bodyimpl)
@@ -136,12 +139,9 @@
     return ret;
     }
 
-gint TMSVolumeEffectBodyImpl::SetParentEffect(TMSEffect*& parenteffect)
+void TMSVolumeEffectBodyImpl::SetParent(TMSEffect*& parent)
     {
-    gint ret(TMS_RESULT_SUCCESS);
-    iParentEffect = NULL;
-    iParentEffect = parenteffect;
-    return ret;
+    iParent = parent;
     }
 
 void TMSVolumeEffectBodyImpl::SetProxy(TMSCallProxy* aProxy,
@@ -150,7 +150,8 @@
     iProxy = aProxy;
     if (queuehandler)
         {
-        ((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_EFFECT_VOLUME);
+        ((TMSQueueHandler*) queuehandler)->AddObserver(*this,
+                TMS_EFFECT_VOLUME);
         }
     }
 
@@ -158,7 +159,6 @@
         void* /*user_data*/)
     {
     TMSSignalEvent event;
-
     event.type = TMS_EVENT_EFFECT_VOL_CHANGED;
     event.reason = aError;
 
@@ -166,9 +166,9 @@
         {
         case TMS_EVENT_EFFECT_VOL_CHANGED:
             {
-            if (iObserver && iParentEffect)
+            if (iObserver && iParent)
                 {
-                iObserver->EffectsEvent(iParentEffect, event);
+                iObserver->EffectsEvent(iParent, event);
                 }
             }
             break;
@@ -177,4 +177,3 @@
         }
     }
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsvolumeeffectimpl.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsvolumeeffectimpl.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -15,9 +15,8 @@
  *
  */
 
-#include <tms.h>
+#include "tmsutility.h"
 #include "tmsvolumeeffectbodyimpl.h"
-#include "tmsutility.h"
 #include "tmsvolumeeffectimpl.h"
 
 using namespace TMS;
@@ -64,30 +63,15 @@
             self = NULL;
             }
         }
-
     if (self && ret == TMS_RESULT_SUCCESS)
         {
         tmseffect = self;
-        ret = self->SetParentEffect(tmseffect);
+        ret = self->SetParent(tmseffect);
         }
     TRACE_PRN_FN_EXT;
     return ret;
     }
 
-gint TMSVolumeEffectImpl::SetParentEffect(TMSEffect*& parenteffect)
-    {
-    gint  ret(TMS_RESULT_SUCCESS);
-    if (this->iBody)
-        {
-        ((TMSVolumeEffectBodyImpl*) this->iBody)->SetParentEffect(parenteffect);
-        }
-    else
-        {
-        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
-        }
-    return ret;
-    }
-
 gint TMSVolumeEffectImpl::SetProxy(TMSCallProxy* aProxy, gpointer queuehandler)
     {
     gint ret(TMS_RESULT_SUCCESS);
@@ -103,4 +87,17 @@
     return ret;
     }
 
-// End of file
+gint TMSVolumeEffectImpl::SetParent(TMSEffect*& parent)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (this->iBody)
+        {
+        ((TMSVolumeEffectBodyImpl*) this->iBody)->SetParent(parent);
+        }
+    else
+        {
+        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
+        }
+    return ret;
+    }
+
--- a/mmserv/tms/tmsproxy/bwins/tmsproxy.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsproxy/bwins/tmsproxy.def	Fri Apr 16 15:29:42 2010 +0300
@@ -1,26 +1,39 @@
 EXPORTS
-	?SetMsgQueueNotifier@TMSProxy@TMS@@QAEHW4TMSMsgQueueNotifierType@2@PAX1H@Z @ 1 NONAME ; int TMS::TMSProxy::SetMsgQueueNotifier(enum TMS::TMSMsgQueueNotifierType, void *, void *, int)
-	?RemoveMsgQueueNotifier@TMSProxy@TMS@@QAEHW4TMSMsgQueueNotifierType@2@PAX@Z @ 2 NONAME ; int TMS::TMSProxy::RemoveMsgQueueNotifier(enum TMS::TMSMsgQueueNotifierType, void *)
+	?RemoveMsgQueueNotifier@TMSProxy@TMS@@QAEHW4TMSMsgQueueNotifierType@2@PAX@Z @ 1 NONAME ; int TMS::TMSProxy::RemoveMsgQueueNotifier(enum TMS::TMSMsgQueueNotifierType, void *)
+	?StartDTMFNotifier@TMSProxy@TMS@@QAEHXZ @ 2 NONAME ; int TMS::TMSProxy::StartDTMFNotifier(void)
 	?GetMaxLevel@TMSProxy@TMS@@QAEHAAI@Z @ 3 NONAME ; int TMS::TMSProxy::GetMaxLevel(unsigned int &)
-	?StartRoutingNotifier@TMSProxy@TMS@@QAEHXZ @ 4 NONAME ; int TMS::TMSProxy::StartRoutingNotifier(void)
-	?GetAvailableOutputs@TMSProxy@TMS@@QAEHAAV?$vector@IV?$allocator@I@std@@@std@@@Z @ 5 NONAME ; int TMS::TMSProxy::GetAvailableOutputs(class std::vector<unsigned int, class std::allocator<unsigned int> > &)
-	?GetSupportedDecoders@TMSProxy@TMS@@QAEHAAV?$RArray@K@@AAH@Z @ 6 NONAME ; int TMS::TMSProxy::GetSupportedDecoders(class RArray<unsigned long> &, int &)
-	?Connect@TMSProxy@TMS@@QAEHXZ @ 7 NONAME ; int TMS::TMSProxy::Connect(void)
-	?SetLevel@TMSProxy@TMS@@QAEHI@Z @ 8 NONAME ; int TMS::TMSProxy::SetLevel(unsigned int)
-	?CancelRoutingNotifier@TMSProxy@TMS@@QAEHXZ @ 9 NONAME ; int TMS::TMSProxy::CancelRoutingNotifier(void)
-	?GetGain@TMSProxy@TMS@@QAEHAAI@Z @ 10 NONAME ; int TMS::TMSProxy::GetGain(unsigned int &)
-	?SetGain@TMSProxy@TMS@@QAEHI@Z @ 11 NONAME ; int TMS::TMSProxy::SetGain(unsigned int)
-	?GetLevel@TMSProxy@TMS@@QAEHAAI@Z @ 12 NONAME ; int TMS::TMSProxy::GetLevel(unsigned int &)
-	?GetPreviousOutput@TMSProxy@TMS@@QAEHAAH@Z @ 13 NONAME ; int TMS::TMSProxy::GetPreviousOutput(int &)
-	?Version@TMSProxy@TMS@@QBE?AVTVersion@@XZ @ 14 NONAME ; class TVersion TMS::TMSProxy::Version(void) const
-	?Close@TMSProxy@TMS@@QAEXXZ @ 15 NONAME ; void TMS::TMSProxy::Close(void)
-	?GetTMSCallSessionHandle@TMSProxy@TMS@@QAEHXZ @ 16 NONAME ; int TMS::TMSProxy::GetTMSCallSessionHandle(void)
-	??0TMSProxy@TMS@@QAE@XZ @ 17 NONAME ; TMS::TMSProxy::TMSProxy(void)
-	?GetSupportedEncoders@TMSProxy@TMS@@QAEHAAV?$RArray@K@@AAH@Z @ 18 NONAME ; int TMS::TMSProxy::GetSupportedEncoders(class RArray<unsigned long> &, int &)
-	?SetOutput@TMSProxy@TMS@@QAEHH@Z @ 19 NONAME ; int TMS::TMSProxy::SetOutput(int)
-	?CancelGlobalEffectNotifier@TMSProxy@TMS@@QAEHXZ @ 20 NONAME ; int TMS::TMSProxy::CancelGlobalEffectNotifier(void)
-	?GetMaxGain@TMSProxy@TMS@@QAEHAAI@Z @ 21 NONAME ; int TMS::TMSProxy::GetMaxGain(unsigned int &)
-	?StartGlobalEffectNotifier@TMSProxy@TMS@@QAEHXZ @ 22 NONAME ; int TMS::TMSProxy::StartGlobalEffectNotifier(void)
-	?GetOutput@TMSProxy@TMS@@QAEHAAH@Z @ 23 NONAME ; int TMS::TMSProxy::GetOutput(int &)
-	??1TMSProxy@TMS@@UAE@XZ @ 24 NONAME ; TMS::TMSProxy::~TMSProxy(void)
+	?GetSupportedDecoders@TMSProxy@TMS@@QAEHAAV?$RArray@K@@AAH@Z @ 4 NONAME ; int TMS::TMSProxy::GetSupportedDecoders(class RArray<unsigned long> &, int &)
+	?Connect@TMSProxy@TMS@@QAEHXZ @ 5 NONAME ; int TMS::TMSProxy::Connect(void)
+	?SetLevel@TMSProxy@TMS@@QAEHI@Z @ 6 NONAME ; int TMS::TMSProxy::SetLevel(unsigned int)
+	?InitRT@TMSProxy@TMS@@QAEHHPAU_GString@@0@Z @ 7 NONAME ; int TMS::TMSProxy::InitRT(int, struct _GString *, struct _GString *)
+	?GetGain@TMSProxy@TMS@@QAEHAAI@Z @ 8 NONAME ; int TMS::TMSProxy::GetGain(unsigned int &)
+	?PlayRT@TMSProxy@TMS@@QAEHXZ @ 9 NONAME ; int TMS::TMSProxy::PlayRT(void)
+	?StartInbandTone@TMSProxy@TMS@@QAEHH@Z @ 10 NONAME ; int TMS::TMSProxy::StartInbandTone(int)
+	?Version@TMSProxy@TMS@@QBE?AVTVersion@@XZ @ 11 NONAME ; class TVersion TMS::TMSProxy::Version(void) const
+	?GetTMSCallSessionHandle@TMSProxy@TMS@@QAEHXZ @ 12 NONAME ; int TMS::TMSProxy::GetTMSCallSessionHandle(void)
+	?StopRT@TMSProxy@TMS@@QAEHXZ @ 13 NONAME ; int TMS::TMSProxy::StopRT(void)
+	?GetSupportedEncoders@TMSProxy@TMS@@QAEHAAV?$RArray@K@@AAH@Z @ 14 NONAME ; int TMS::TMSProxy::GetSupportedEncoders(class RArray<unsigned long> &, int &)
+	?ContinueDTMFStringSending@TMSProxy@TMS@@QAEHH@Z @ 15 NONAME ; int TMS::TMSProxy::ContinueDTMFStringSending(int)
+	?StopInbandTone@TMSProxy@TMS@@QAEHXZ @ 16 NONAME ; int TMS::TMSProxy::StopInbandTone(void)
+	?GetOutput@TMSProxy@TMS@@QAEHAAH@Z @ 17 NONAME ; int TMS::TMSProxy::GetOutput(int &)
+	?MuteRT@TMSProxy@TMS@@QAEHXZ @ 18 NONAME ; int TMS::TMSProxy::MuteRT(void)
+	?StopDTMF@TMSProxy@TMS@@QAEHH@Z @ 19 NONAME ; int TMS::TMSProxy::StopDTMF(int)
+	??1TMSProxy@TMS@@UAE@XZ @ 20 NONAME ; TMS::TMSProxy::~TMSProxy(void)
+	?SetMsgQueueNotifier@TMSProxy@TMS@@QAEHW4TMSMsgQueueNotifierType@2@PAX1H@Z @ 21 NONAME ; int TMS::TMSProxy::SetMsgQueueNotifier(enum TMS::TMSMsgQueueNotifierType, void *, void *, int)
+	?StartRoutingNotifier@TMSProxy@TMS@@QAEHXZ @ 22 NONAME ; int TMS::TMSProxy::StartRoutingNotifier(void)
+	?GetAvailableOutputs@TMSProxy@TMS@@QAEHAAV?$vector@IV?$allocator@I@std@@@std@@@Z @ 23 NONAME ; int TMS::TMSProxy::GetAvailableOutputs(class std::vector<unsigned int, class std::allocator<unsigned int> > &)
+	?PauseRT@TMSProxy@TMS@@QAEHXZ @ 24 NONAME ; int TMS::TMSProxy::PauseRT(void)
+	?StartDTMF@TMSProxy@TMS@@QAEHHPAU_GString@@@Z @ 25 NONAME ; int TMS::TMSProxy::StartDTMF(int, struct _GString *)
+	?CancelRoutingNotifier@TMSProxy@TMS@@QAEHXZ @ 26 NONAME ; int TMS::TMSProxy::CancelRoutingNotifier(void)
+	?SetGain@TMSProxy@TMS@@QAEHI@Z @ 27 NONAME ; int TMS::TMSProxy::SetGain(unsigned int)
+	?GetLevel@TMSProxy@TMS@@QAEHAAI@Z @ 28 NONAME ; int TMS::TMSProxy::GetLevel(unsigned int &)
+	?GetPreviousOutput@TMSProxy@TMS@@QAEHAAH@Z @ 29 NONAME ; int TMS::TMSProxy::GetPreviousOutput(int &)
+	?Close@TMSProxy@TMS@@QAEXXZ @ 30 NONAME ; void TMS::TMSProxy::Close(void)
+	??0TMSProxy@TMS@@QAE@XZ @ 31 NONAME ; TMS::TMSProxy::TMSProxy(void)
+	?SetOutput@TMSProxy@TMS@@QAEHH@Z @ 32 NONAME ; int TMS::TMSProxy::SetOutput(int)
+	?DeinitRT@TMSProxy@TMS@@QAEHXZ @ 33 NONAME ; int TMS::TMSProxy::DeinitRT(void)
+	?CancelGlobalEffectNotifier@TMSProxy@TMS@@QAEHXZ @ 34 NONAME ; int TMS::TMSProxy::CancelGlobalEffectNotifier(void)
+	?GetMaxGain@TMSProxy@TMS@@QAEHAAI@Z @ 35 NONAME ; int TMS::TMSProxy::GetMaxGain(unsigned int &)
+	?StartGlobalEffectNotifier@TMSProxy@TMS@@QAEHXZ @ 36 NONAME ; int TMS::TMSProxy::StartGlobalEffectNotifier(void)
+	?CancelDTMFNotifier@TMSProxy@TMS@@QAEHXZ @ 37 NONAME ; int TMS::TMSProxy::CancelDTMFNotifier(void)
 
--- a/mmserv/tms/tmsproxy/eabi/tmsproxy.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsproxy/eabi/tmsproxy.def	Fri Apr 16 15:29:42 2010 +0300
@@ -1,31 +1,44 @@
 EXPORTS
 	_ZN3TMS8TMSProxy10GetMaxGainERj @ 1 NONAME
 	_ZN3TMS8TMSProxy11GetMaxLevelERj @ 2 NONAME
-	_ZN3TMS8TMSProxy17GetPreviousOutputERi @ 3 NONAME
-	_ZN3TMS8TMSProxy19GetAvailableOutputsERSt6vectorIjSaIjEE @ 4 NONAME
-	_ZN3TMS8TMSProxy19SetMsgQueueNotifierENS_23TMSMsgQueueNotifierTypeEPvS2_i @ 5 NONAME
-	_ZN3TMS8TMSProxy20GetSupportedDecodersER6RArrayImERi @ 6 NONAME
-	_ZN3TMS8TMSProxy20GetSupportedEncodersER6RArrayImERi @ 7 NONAME
-	_ZN3TMS8TMSProxy20StartRoutingNotifierEv @ 8 NONAME
-	_ZN3TMS8TMSProxy21CancelRoutingNotifierEv @ 9 NONAME
-	_ZN3TMS8TMSProxy22RemoveMsgQueueNotifierENS_23TMSMsgQueueNotifierTypeEPv @ 10 NONAME
-	_ZN3TMS8TMSProxy23GetTMSCallSessionHandleEv @ 11 NONAME
-	_ZN3TMS8TMSProxy25StartGlobalEffectNotifierEv @ 12 NONAME
-	_ZN3TMS8TMSProxy26CancelGlobalEffectNotifierEv @ 13 NONAME
-	_ZN3TMS8TMSProxy5CloseEv @ 14 NONAME
-	_ZN3TMS8TMSProxy7ConnectEv @ 15 NONAME
-	_ZN3TMS8TMSProxy7GetGainERj @ 16 NONAME
-	_ZN3TMS8TMSProxy7SetGainEj @ 17 NONAME
-	_ZN3TMS8TMSProxy8GetLevelERj @ 18 NONAME
-	_ZN3TMS8TMSProxy8SetLevelEj @ 19 NONAME
-	_ZN3TMS8TMSProxy9GetOutputERi @ 20 NONAME
-	_ZN3TMS8TMSProxy9SetOutputEi @ 21 NONAME
-	_ZN3TMS8TMSProxyC1Ev @ 22 NONAME
-	_ZN3TMS8TMSProxyC2Ev @ 23 NONAME
-	_ZN3TMS8TMSProxyD0Ev @ 24 NONAME
-	_ZN3TMS8TMSProxyD1Ev @ 25 NONAME
-	_ZN3TMS8TMSProxyD2Ev @ 26 NONAME
-	_ZNK3TMS8TMSProxy7VersionEv @ 27 NONAME
-	_ZTIN3TMS8TMSProxyE @ 28 NONAME
-	_ZTVN3TMS8TMSProxyE @ 29 NONAME
+	_ZN3TMS8TMSProxy14StopInbandToneEv @ 3 NONAME
+	_ZN3TMS8TMSProxy15StartInbandToneEi @ 4 NONAME
+	_ZN3TMS8TMSProxy17GetPreviousOutputERi @ 5 NONAME
+	_ZN3TMS8TMSProxy17StartDTMFNotifierEv @ 6 NONAME
+	_ZN3TMS8TMSProxy18CancelDTMFNotifierEv @ 7 NONAME
+	_ZN3TMS8TMSProxy19GetAvailableOutputsERSt6vectorIjSaIjEE @ 8 NONAME
+	_ZN3TMS8TMSProxy19SetMsgQueueNotifierENS_23TMSMsgQueueNotifierTypeEPvS2_i @ 9 NONAME
+	_ZN3TMS8TMSProxy20GetSupportedDecodersER6RArrayImERi @ 10 NONAME
+	_ZN3TMS8TMSProxy20GetSupportedEncodersER6RArrayImERi @ 11 NONAME
+	_ZN3TMS8TMSProxy20StartRoutingNotifierEv @ 12 NONAME
+	_ZN3TMS8TMSProxy21CancelRoutingNotifierEv @ 13 NONAME
+	_ZN3TMS8TMSProxy22RemoveMsgQueueNotifierENS_23TMSMsgQueueNotifierTypeEPv @ 14 NONAME
+	_ZN3TMS8TMSProxy23GetTMSCallSessionHandleEv @ 15 NONAME
+	_ZN3TMS8TMSProxy25ContinueDTMFStringSendingEi @ 16 NONAME
+	_ZN3TMS8TMSProxy25StartGlobalEffectNotifierEv @ 17 NONAME
+	_ZN3TMS8TMSProxy26CancelGlobalEffectNotifierEv @ 18 NONAME
+	_ZN3TMS8TMSProxy5CloseEv @ 19 NONAME
+	_ZN3TMS8TMSProxy6InitRTEiP8_GStringS2_ @ 20 NONAME
+	_ZN3TMS8TMSProxy6MuteRTEv @ 21 NONAME
+	_ZN3TMS8TMSProxy6PlayRTEv @ 22 NONAME
+	_ZN3TMS8TMSProxy6StopRTEv @ 23 NONAME
+	_ZN3TMS8TMSProxy7ConnectEv @ 24 NONAME
+	_ZN3TMS8TMSProxy7GetGainERj @ 25 NONAME
+	_ZN3TMS8TMSProxy7PauseRTEv @ 26 NONAME
+	_ZN3TMS8TMSProxy7SetGainEj @ 27 NONAME
+	_ZN3TMS8TMSProxy8DeinitRTEv @ 28 NONAME
+	_ZN3TMS8TMSProxy8GetLevelERj @ 29 NONAME
+	_ZN3TMS8TMSProxy8SetLevelEj @ 30 NONAME
+	_ZN3TMS8TMSProxy8StopDTMFEi @ 31 NONAME
+	_ZN3TMS8TMSProxy9GetOutputERi @ 32 NONAME
+	_ZN3TMS8TMSProxy9SetOutputEi @ 33 NONAME
+	_ZN3TMS8TMSProxy9StartDTMFEiP8_GString @ 34 NONAME
+	_ZN3TMS8TMSProxyC1Ev @ 35 NONAME
+	_ZN3TMS8TMSProxyC2Ev @ 36 NONAME
+	_ZN3TMS8TMSProxyD0Ev @ 37 NONAME
+	_ZN3TMS8TMSProxyD1Ev @ 38 NONAME
+	_ZN3TMS8TMSProxyD2Ev @ 39 NONAME
+	_ZNK3TMS8TMSProxy7VersionEv @ 40 NONAME
+	_ZTIN3TMS8TMSProxyE @ 41 NONAME
+	_ZTVN3TMS8TMSProxyE @ 42 NONAME
 
--- a/mmserv/tms/tmsproxy/group/tmsproxy.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsproxy/group/tmsproxy.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -34,7 +34,7 @@
 MW_LAYER_SYSTEMINCLUDE
 OS_LAYER_LIBC_SYSTEMINCLUDE
 OS_LAYER_GLIB_SYSTEMINCLUDE
-SYSTEMINCLUDE   /epoc32/include/stdapis/stlport
+OS_LAYER_STDCPP_SYSTEMINCLUDE
 SYSTEMINCLUDE   /epoc32/include/mmf/common
 SYSTEMINCLUDE   /epoc32/include/mda/common
 SYSTEMINCLUDE   /epoc32/include/mmf/server
--- a/mmserv/tms/tmsproxy/src/tmsproxy.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsproxy/src/tmsproxy.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -16,9 +16,13 @@
  */
 
 #include <s32mem.h>
+#include <gstring.h>
 #include <AudioPreference.h>
 #include <tmseffectobsrvr.h>
 #include <tmsglobalroutingobsrvr.h>
+#include <tmsringtoneobsrvr.h>
+#include <tmsdtmfobsrvr.h>
+#include <tmsinbandtoneobsrvr.h>
 #include "tmsutility.h"
 #include "tmsclientserver.h"
 #include "tmsproxy.h"
@@ -26,8 +30,9 @@
 using namespace TMS;
 
 // CONSTANTS
-const TUint KServerConnectRetries = 2;
+const TUint KTMSServerConnectRetries = 2;
 const TUint KSessionMessageSlots = 10;
+const TUint KUTF8Multiply = 2;
 
 // -----------------------------------------------------------------------------
 // StartServer
@@ -76,10 +81,7 @@
 //
 EXPORT_C TMSProxy::TMSProxy()
     {
-    iEffectsObsrvrList.Reset();
-    iEffectsParentList.Reset();
-    iRoutingObsrvrList.Reset();
-    iRoutingParentList.Reset();
+    ResetObjectLists();
     iMsgQHandler = NULL;
     }
 
@@ -89,10 +91,7 @@
 //
 EXPORT_C TMSProxy::~TMSProxy()
     {
-    iEffectsObsrvrList.Reset();
-    iEffectsParentList.Reset();
-    iRoutingObsrvrList.Reset();
-    iRoutingParentList.Reset();
+    ResetObjectLists();
 
     if (iMsgQHandler)
         {
@@ -118,7 +117,7 @@
     {
     TRACE_PRN_FN_ENT;
 
-    gint retry = KServerConnectRetries;
+    gint retry = KTMSServerConnectRetries;
     gint err(TMS_RESULT_GENERAL_ERROR);
     gint numMessageSlots = KSessionMessageSlots;
 
@@ -165,8 +164,8 @@
 //
 EXPORT_C TVersion TMSProxy::Version() const
     {
-    return (TVersion(KTMSServMajorVersionNumber,
-            KTMSServMinorVersionNumber, KTMSServBuildVersionNumber));
+    return (TVersion(KTMSServMajorVersionNumber, KTMSServMinorVersionNumber,
+            KTMSServBuildVersionNumber));
     }
 
 // -----------------------------------------------------------------------------
@@ -401,6 +400,221 @@
     return TMSRESULT(status);
     }
 
+EXPORT_C gint TMSProxy::InitRT(const TMSRingToneType type, GString* str,
+        GString* tts)
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_INVALID_ARGUMENT);
+    TIpcArgs args;
+    HBufC* ttsBuf(NULL);
+
+    if (tts)
+        {
+        // Convert buffer from UTF-8 to unicode (16-bit)
+        // Note: UTF-8 strings can take up to 4 bytes per character
+        gint unilen = tts->len / KUTF8Multiply;
+        TRAP(status, ttsBuf = HBufC::NewL(unilen));
+        if (status == KErrNone)
+            {
+            TPtr p = ttsBuf->Des();
+            p.Copy((TUint16*) tts->str, unilen);
+            args.Set(1, &p);
+            }
+        }
+
+    switch (type)
+        {
+        case TMS_RINGTONE_DEFAULT:
+            {
+            status = RSessionBase::SendReceive(ETMSRingToneInitDefault, args);
+            break;
+            }
+        case TMS_RINGTONE_FILE:
+            {
+            if (str)
+                {
+                HBufC* buf(NULL);
+                // Convert buffer from UTF-8 to unicode (16-bit)
+                // Note: UTF-8 strings can take up to 4 bytes per character
+                gint unilen = str->len / KUTF8Multiply;
+
+                TRAP(status, buf = HBufC::NewL(unilen));
+                if (status == KErrNone)
+                    {
+                    TPtr p = buf->Des();
+                    p.Copy((TUint16*) str->str, unilen);
+                    TIpcArgs args;
+                    args.Set(0, &p);
+                    status = RSessionBase::SendReceive(ETMSRingToneInitFile,
+                            args);
+                    }
+                delete buf;
+                buf = NULL;
+                }
+            break;
+            }
+        case TMS_RINGTONE_BEEP_ONCE:
+            {
+            status = RSessionBase::SendReceive(ETMSRingToneInitBeepOnce);
+            break;
+            }
+        case TMS_RINGTONE_SILENT:
+            {
+            status = RSessionBase::SendReceive(ETMSRingToneInitSilent);
+            break;
+            }
+        case TMS_RINGTONE_UNSECURE_VOIP:
+            {
+            status = RSessionBase::SendReceive(ETMSRingToneInitUnsecureVoIP);
+            break;
+            }
+        case TMS_RINGTONE_SEQUENCE:
+            {
+            if (str)
+                {
+                HBufC8* buf(NULL);
+                gint len = str->len;
+                TRAP(status, buf = HBufC8::NewL(len));
+                if (status == KErrNone)
+                    {
+                    TPtr8 p = buf->Des();
+                    p.Copy((TUint8*) str->str, len);
+                    TIpcArgs args;
+                    args.Set(0, &p);
+                    status = RSessionBase::SendReceive(
+                            ETMSRingToneInitSequence, args);
+                    }
+                delete buf;
+                buf = NULL;
+                }
+            break;
+            }
+        default:
+            break;
+        }
+
+    delete ttsBuf;
+    ttsBuf = NULL;
+
+    TRACE_PRN_FN_EXT;
+    return TMSRESULT(status);
+    }
+
+EXPORT_C gint TMSProxy::DeinitRT()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    status = RSessionBase::SendReceive(ETMSRingToneDeinit);
+    return TMSRESULT(status);
+    }
+
+EXPORT_C gint TMSProxy::PlayRT()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    status = RSessionBase::SendReceive(ETMSRingTonePlay);
+    return TMSRESULT(status);
+    }
+
+EXPORT_C gint TMSProxy::StopRT()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    status = RSessionBase::SendReceive(ETMSRingToneStop);
+    return TMSRESULT(status);
+    }
+
+EXPORT_C gint TMSProxy::PauseRT()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    status = RSessionBase::SendReceive(ETMSRingTonePause);
+    return TMSRESULT(status);
+    }
+
+EXPORT_C gint TMSProxy::MuteRT()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    status = RSessionBase::SendReceive(ETMSRingToneMute);
+    return TMSRESULT(status);
+    }
+
+EXPORT_C gint TMSProxy::StartDTMF(TMSStreamType streamtype, GString* tone)
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_SUCCESS);
+
+    HBufC* buf(NULL);
+    TRAP(status, buf = HBufC::NewL(tone->len));
+    if (status == KErrNone)
+        {
+        TPtr p1 = buf->Des();
+        TPtr8 p2((TUint8*) tone->str, tone->len, tone->len);
+        p1.Copy(p2);
+
+        TRACE_PRN_N(p1);
+
+        TIpcArgs args;
+        args.Set(0, streamtype);
+        args.Set(1, &p1);
+        status = RSessionBase::SendReceive(ETMSStartDTMF, args);
+        }
+
+    delete buf;
+    buf = NULL;
+
+    TRACE_PRN_FN_EXT;
+    return TMSRESULT(status);
+    }
+
+EXPORT_C gint TMSProxy::StopDTMF(TMSStreamType streamtype)
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_SUCCESS);
+    status = RSessionBase::SendReceive(ETMSStopDTMF, TIpcArgs(streamtype));
+    TRACE_PRN_FN_EXT;
+    return TMSRESULT(status);
+    }
+
+EXPORT_C gint TMSProxy::ContinueDTMFStringSending(gboolean continuesending)
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_SUCCESS);
+    status = RSessionBase::SendReceive(ETMSContinueDTMF,
+            TIpcArgs(continuesending));
+    TRACE_PRN_FN_EXT;
+    return TMSRESULT(status);
+    }
+
+EXPORT_C gint TMSProxy::StartInbandTone(TMSInbandToneType inbandtonetype)
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_SUCCESS);
+    status = RSessionBase::SendReceive(ETMSStartInbandTone,
+            TIpcArgs(inbandtonetype));
+    TRACE_PRN_FN_EXT;
+    return TMSRESULT(status);
+    }
+
+EXPORT_C gint TMSProxy::StopInbandTone()
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_SUCCESS);
+    status = RSessionBase::SendReceive(ETMSStopInbandTone);
+    TRACE_PRN_FN_EXT;
+    return TMSRESULT(status);
+    }
+
+EXPORT_C gint TMSProxy::StartDTMFNotifier()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    status = RSessionBase::SendReceive(ETMSStartDTMFNotifier); //DTMFHandler
+    return TMSRESULT(status);
+    }
+
+EXPORT_C gint TMSProxy::CancelDTMFNotifier()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    status = RSessionBase::SendReceive(ETMSCancelDTMFNotifier); //DTMFHandler
+    return TMSRESULT(status);
+    }
+
 EXPORT_C gint TMSProxy::StartGlobalEffectNotifier()
     {
     gint status(TMS_RESULT_SUCCESS);
@@ -442,11 +656,23 @@
         case EMsgQueueGlobalVolumeType:
         case EMsgQueueGlobalGainType:
             status = AddGlobalEffectObserver((*(TMSEffectObserver*) obsrv),
-                    (*(TMSEffect*)parent), clientid);
+                    (*(TMSEffect*) parent), clientid);
             break;
         case EMsgQueueGlobalRoutingType:
             status = AddRoutingObserver((*(TMSGlobalRoutingObserver*) obsrv),
-                    (*(TMSGlobalRouting*)parent), clientid);
+                    (*(TMSGlobalRouting*) parent), clientid);
+            break;
+        case EMsgQueueRingtoneType:
+            status = AddRingToneObserver((*(TMSRingToneObserver*) obsrv),
+                    (*(TMSRingTone*) parent), clientid);
+            break;
+        case EMsgQueueDTMFType:
+            status = AddDTMFObserver((*(TMSDTMFObserver*) obsrv),
+                    (*(TMSDTMF*) parent), clientid);
+            break;
+        case EMsgQueueInbandToneType:
+            status = AddInbandToneObserver((*(TMSInbandToneObserver*) obsrv),
+                    (*(TMSInbandTone*) parent), clientid);
             break;
         default:
             status = TMS_RESULT_INVALID_ARGUMENT;
@@ -471,7 +697,18 @@
             status = RemoveGlobalEffectObserver((*(TMSEffectObserver*) obsrv));
             break;
         case EMsgQueueGlobalRoutingType:
-            status = RemoveRoutingObserver((*(TMSGlobalRoutingObserver*) obsrv));
+            status = RemoveRoutingObserver((*(TMSGlobalRoutingObserver*)
+                    obsrv));
+            break;
+        case EMsgQueueRingtoneType:
+            status = RemoveRingToneObserver((*(TMSRingToneObserver*) obsrv));
+            break;
+        case EMsgQueueDTMFType:
+            status = RemoveDTMFObserver((*(TMSDTMFObserver*) obsrv));
+            break;
+        case EMsgQueueInbandToneType:
+            status = RemoveInbandToneObserver((*(TMSInbandToneObserver*)
+                    obsrv));
             break;
         default:
             status = TMS_RESULT_INVALID_ARGUMENT;
@@ -512,7 +749,6 @@
         {
         status = iEffectsObsrvrList.Append(&obsrv);
         status = iEffectsParentList.Append(&parent);
-        //status = iClientList.Append(clientid);
         }
     else
         {
@@ -529,7 +765,6 @@
         {
         iEffectsObsrvrList.Remove(index);
         iEffectsParentList.Remove(index);
-        //iClientList.Remove(index);
         }
     else
         {
@@ -546,7 +781,6 @@
         {
         status = iRoutingObsrvrList.Append(&obsrv);
         status = iRoutingParentList.Append(&parent);
-        //status = iClientList.Append(clientid);
         }
     else
         {
@@ -563,7 +797,104 @@
         {
         iRoutingObsrvrList.Remove(index);
         iRoutingParentList.Remove(index);
-        //iClientList.Remove(index);
+        }
+    else
+        {
+        status = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return TMSRESULT(status);
+    }
+
+gint TMSProxy::AddRingToneObserver(TMSRingToneObserver& obsrv,
+        TMSRingTone& parent, gint /*clientid*/)
+    {
+    gint status = iRingToneObsrvrList.Find(&obsrv);
+    if (status == KErrNotFound)
+        {
+        status = iRingToneObsrvrList.Append(&obsrv);
+        status = iRingToneParentList.Append(&parent);
+        }
+    else
+        {
+        status = TMS_RESULT_ALREADY_EXIST;
+        }
+    return TMSRESULT(status);
+    }
+
+gint TMSProxy::RemoveRingToneObserver(TMSRingToneObserver& obsrv)
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    gint index = iRingToneObsrvrList.Find(&obsrv);
+    if (index >= 0)
+        {
+        iRingToneObsrvrList.Remove(index);
+        iRingToneParentList.Remove(index);
+        }
+    else
+        {
+        status = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return TMSRESULT(status);
+    }
+
+gint TMSProxy::AddDTMFObserver(TMSDTMFObserver& obsrv, TMSDTMF& parent,
+        gint /*clientid*/)
+    {
+    // Add to list if observer is not already added
+    gint status = iDTMFObsrvrList.Find(&obsrv);
+    if (status == KErrNotFound)
+        {
+        status = iDTMFObsrvrList.Append(&obsrv);
+        status = iDTMFParentList.Append(&parent);
+        }
+    else
+        {
+        status = TMS_RESULT_ALREADY_EXIST;
+        }
+    return TMSRESULT(status);
+    }
+
+gint TMSProxy::RemoveDTMFObserver(TMSDTMFObserver& obsrv)
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    gint index = iDTMFObsrvrList.Find(&obsrv);
+    if (index >= 0)
+        {
+        iDTMFObsrvrList.Remove(index);
+        iDTMFParentList.Remove(index);
+        }
+    else
+        {
+        status = TMS_RESULT_DOES_NOT_EXIST;
+        }
+    return TMSRESULT(status);
+    }
+
+gint TMSProxy::AddInbandToneObserver(TMSInbandToneObserver& obsrv,
+        TMSInbandTone& parent, gint /*clientid*/)
+    {
+    // Add to list if observer is not already added
+    gint status = iInbandToneObsrvrList.Find(&obsrv);
+    if (status == KErrNotFound)
+        {
+        status = iInbandToneObsrvrList.Append(&obsrv);
+        status = iInbandToneParentList.Append(&parent);
+        }
+    else
+        {
+        status = TMS_RESULT_ALREADY_EXIST;
+        }
+    return TMSRESULT(status);
+    }
+
+gint TMSProxy::RemoveInbandToneObserver(TMSInbandToneObserver& obsrv)
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    gint index = iInbandToneObsrvrList.Find(&obsrv);
+    if (index >= 0)
+        {
+        iInbandToneObsrvrList.Remove(index);
+        iInbandToneParentList.Remove(index);
         }
     else
         {
@@ -612,7 +943,7 @@
         }
     else
         {
-        iMsgQHandler = CQueueHandler::NewL(&iMsgQueue, NULL);
+        iMsgQHandler = TMSQueueHandler::NewL(&iMsgQueue, NULL);
         iMsgQHandler->AddObserver(*this, -1);
         }
     iMsgQHandler->Start();
@@ -653,8 +984,38 @@
                 }
             for (gint i = 0; i < iRoutingObsrvrList.Count(); i++)
                 {
-                iRoutingObsrvrList[i]->GlobalRoutingEvent(iRoutingParentList[i],
-                        event, output);
+                iRoutingObsrvrList[i]->GlobalRoutingEvent(
+                        iRoutingParentList[i], event, output);
+                }
+            break;
+            }
+        case TMS_EVENT_RINGTONE_OPEN_COMPLETE:
+        case TMS_EVENT_RINGTONE_PLAY_COMPLETE:
+        case TMS_EVENT_RINGTONE_DEINIT_COMPLETE:
+            {
+            for (gint i = 0; i < iRingToneObsrvrList.Count(); i++)
+                {
+                iRingToneObsrvrList[i]->RingtoneEvent(iRingToneParentList[i],
+                        event);
+                }
+            break;
+            }
+        case TMS_EVENT_DTMF_TONE_STARTED:
+        case TMS_EVENT_DTMF_TONE_STOPPED:
+            {
+            for (gint i = 0; i < iDTMFObsrvrList.Count(); i++)
+                {
+                iDTMFObsrvrList[i]->DTMFEvent(iDTMFParentList[i], event);
+                }
+            break;
+            }
+        case TMS_EVENT_INBAND_TONE_STARTED:
+        case TMS_EVENT_INBAND_TONE_STOPPED:
+            {
+            for (gint i = 0; i < iInbandToneObsrvrList.Count(); i++)
+                {
+                iInbandToneObsrvrList[i]->InbandToneEvent(
+                        iInbandToneParentList[i], event);
                 }
             break;
             }
@@ -663,4 +1024,23 @@
         }
     }
 
+// ---------------------------------------------------------------------------
+// TMSProxy::ResetObjectLists
+// ---------------------------------------------------------------------------
+//
+void TMSProxy::ResetObjectLists()
+    {
+    iEffectsObsrvrList.Reset();
+    iRoutingObsrvrList.Reset();
+    iRingToneObsrvrList.Reset();
+    iDTMFObsrvrList.Reset();
+    iInbandToneObsrvrList.Reset();
+
+    iEffectsParentList.Reset();
+    iRoutingParentList.Reset();
+    iRingToneParentList.Reset();
+    iDTMFParentList.Reset();
+    iInbandToneParentList.Reset();
+    }
+
 // End of file
--- a/mmserv/tms/tmsproxy/src/tmsqueuehandler.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsproxy/src/tmsqueuehandler.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -27,14 +27,14 @@
 using namespace TMS;
 
 // ----------------------------------------------------------------------------
-// CQueueHandler::NewL
+// TMSQueueHandler::NewL
 // Symbian constructor
 // ----------------------------------------------------------------------------
 //
-CQueueHandler* CQueueHandler::NewL(RMsgQueue<TmsMsgBuf>* aMsgQueue,
+TMSQueueHandler* TMSQueueHandler::NewL(RMsgQueue<TmsMsgBuf>* aMsgQueue,
         TMSGlobalContext* glblCtx)
     {
-    CQueueHandler* self = new (ELeave) CQueueHandler(aMsgQueue, glblCtx);
+    TMSQueueHandler* self = new (ELeave) TMSQueueHandler(aMsgQueue, glblCtx);
     CleanupStack::PushL(self);
     self->ConstructL();
     CleanupStack::Pop(self);
@@ -42,21 +42,21 @@
     }
 
 // ----------------------------------------------------------------------------
-// CQueueHandler::ConstructL
+// TMSQueueHandler::ConstructL
 // Second phase constructor.
 // ----------------------------------------------------------------------------
 //
-void CQueueHandler::ConstructL()
+void TMSQueueHandler::ConstructL()
     {
     iObserver = NULL;
     }
 
 // ----------------------------------------------------------------------------
-// CQueueHandler::~CQueueHandler
+// TMSQueueHandler::~TMSQueueHandler
 // Destructor.
 // ----------------------------------------------------------------------------
 //
-CQueueHandler::~CQueueHandler()
+TMSQueueHandler::~TMSQueueHandler()
     {
     Cancel();
     if (iMsgQueue->Handle() > 0)
@@ -71,11 +71,11 @@
     }
 
 // ----------------------------------------------------------------------------
-// CQueueHandler::CQueueHandler
+// TMSQueueHandler::TMSQueueHandler
 // Constructor.
 // ----------------------------------------------------------------------------
 //
-CQueueHandler::CQueueHandler(RMsgQueue<TmsMsgBuf>* aMsgQueue,
+TMSQueueHandler::TMSQueueHandler(RMsgQueue<TmsMsgBuf>* aMsgQueue,
         TMSGlobalContext* glblCtx) :
     CActive(CActive::EPriorityStandard),
     iMsgQueue(aMsgQueue),
@@ -86,28 +86,29 @@
     }
 
 // ----------------------------------------------------------------------------
-// CQueueHandler::Start
+// TMSQueueHandler::Start
 // Start listening for events on queue 0.
 // ----------------------------------------------------------------------------
 //
-void CQueueHandler::Start()
+void TMSQueueHandler::Start()
     {
-    if (!IsActive())
+    if (!IsActive() && iMsgQueue)
         {
+        iStatus = KRequestPending;
         iMsgQueue->NotifyDataAvailable(iStatus);
         SetActive();
         }
     }
 
 // ----------------------------------------------------------------------------
-// CQueueHandler::AddObserver
+// TMSQueueHandler::AddObserver
 //
 // ----------------------------------------------------------------------------
 //
-TInt CQueueHandler::AddObserver(MQueueHandlerObserver& aObserver,
-        TInt /*aClientId*/)
+gint TMSQueueHandler::AddObserver(MQueueHandlerObserver& aObserver,
+        gint /*aClientId*/)
     {
-    TInt status = KErrNone;
+    gint status = TMS_RESULT_SUCCESS;
 
     if (iObserver == NULL)
         {
@@ -115,41 +116,53 @@
         }
     else
         {
-        status = KErrAlreadyExists;
+        status = TMS_RESULT_ALREADY_EXIST;
         }
     return status;
     }
 
 // ----------------------------------------------------------------------------
-// CQueueHandler::AddObserver
+// TMSQueueHandler::RemoveObserver
 // Marks observer as inactive in the list
 // ----------------------------------------------------------------------------
 //
-TInt CQueueHandler::RemoveObserver(MQueueHandlerObserver& /*aObserver*/)
+gint TMSQueueHandler::RemoveObserver(MQueueHandlerObserver& /*aObserver*/)
     {
     iObserver = NULL;
-    return KErrNone;
+    return TMS_RESULT_SUCCESS;
     }
 
 // ----------------------------------------------------------------------------
-// CQueueHandler::DoCancel
+// TMSQueueHandler::DoCancel
 // Cancel outstanding request
 // ----------------------------------------------------------------------------
 //
-void CQueueHandler::DoCancel()
+void TMSQueueHandler::DoCancel()
     {
-    iMsgQueue->CancelDataAvailable();
+    if (iMsgQueue)
+        {
+        iMsgQueue->CancelDataAvailable();
+        }
     }
 
 // ----------------------------------------------------------------------------
-// CQueueHandler::RunL
+// TMSQueueHandler::RunL
 // Process requests.
 // ----------------------------------------------------------------------------
 //
-void CQueueHandler::RunL()
+void TMSQueueHandler::RunL()
     {
     TmsMsgBuf msgBuf;
-    TInt err = iMsgQueue->Receive(msgBuf);
+    gint err = TMS_RESULT_SUCCESS;
+
+    if (iMsgQueue)
+        {
+        iMsgQueue->Receive(msgBuf);
+        }
+    else
+        {
+        err = TMS_RESULT_INVALID_STATE;
+        }
 
     // Start monitoring for more events before calling the observer in case
     // client decides to destroy us before this RunL completes executing.
@@ -160,24 +173,28 @@
         return;
         }
 
-    if (err == KErrNone)
+    if (err == TMS_RESULT_SUCCESS)
         {
         switch (msgBuf.iRequest)
             {
             case ECmdGlobalEffectChange:
                 iObserver->QueueEvent(msgBuf.iInt, msgBuf.iStatus, NULL);
                 break;
+            case ECmdGlobalRoutingChange:
+                iObserver->QueueEvent(msgBuf.iInt, msgBuf.iStatus,
+                        &msgBuf.iUint);
+                break;
             case ECmdRingToneOpenComplete:
                 iObserver->QueueEvent(TMS_EVENT_RINGTONE_OPEN_COMPLETE,
-                        msgBuf.iStatus, &msgBuf.iInt64);
+                        msgBuf.iStatus, NULL);
                 break;
             case ECmdRingTonePlayComplete:
                 iObserver->QueueEvent(TMS_EVENT_RINGTONE_PLAY_COMPLETE,
                         msgBuf.iStatus, NULL);
                 break;
-            case ECmdGlobalRoutingChange:
-                iObserver->QueueEvent(msgBuf.iInt, msgBuf.iStatus,
-                        &msgBuf.iUint);
+            case ECmdRingToneDeinitComplete:
+                iObserver->QueueEvent(TMS_EVENT_RINGTONE_DEINIT_COMPLETE,
+                        msgBuf.iStatus, NULL);
                 break;
             case ECmdDTMFOpenDnlinkComplete:
             case ECmdDTMFOpenUplinkComplete:
@@ -188,6 +205,14 @@
                 iObserver->QueueEvent(TMS_EVENT_DTMF_TONE_STOPPED,
                         msgBuf.iStatus, NULL);
                 break;
+            case ECmdInbandToneStarted:
+                iObserver->QueueEvent(TMS_EVENT_INBAND_TONE_STARTED,
+                        msgBuf.iStatus, NULL);
+                break;
+            case ECmdInbandToneStopped:
+                iObserver->QueueEvent(TMS_EVENT_INBAND_TONE_STOPPED,
+                        msgBuf.iStatus, NULL);
+                break;
             default:
                 break;
             }
@@ -195,22 +220,22 @@
     }
 
 // ----------------------------------------------------------------------------
-// CQueueHandler::RunError
+// TMSQueueHandler::RunError
 // Process requests.
 // ----------------------------------------------------------------------------
 //
-TInt CQueueHandler::RunError(TInt /*aError*/)
+TInt TMSQueueHandler::RunError(TInt /*aError*/)
     {
     // Current implementation of RunL does not leave
-    return 0;
+    return TMS_RESULT_SUCCESS;
     }
 
 // ----------------------------------------------------------------------------
-// CQueueHandler::Status
+// TMSQueueHandler::Status
 // Return request status.
 // ----------------------------------------------------------------------------
 //
-TRequestStatus* CQueueHandler::Status()
+TRequestStatus* TMSQueueHandler::Status()
     {
     return &iStatus;
     }
Binary file mmserv/tms/tmsserver/conf/tmseffectscenrep.confml has changed
Binary file mmserv/tms/tmsserver/conf/tmseffectscenrep_10207c80.crml has changed
--- a/mmserv/tms/tmsserver/group/tmsserver.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsserver/group/tmsserver.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -23,42 +23,59 @@
 UID             0 0x10207C7C
 EPOCSTACKSIZE   0x5000
 EPOCHEAPSIZE    0x500000 0x1000000
-CAPABILITY      ALL -Tcb
+CAPABILITY      ProtServ MultiMediaDD ReadDeviceData WriteDeviceData ReadUserData WriteUserData UserEnvironment
 VENDORID        VID_DEFAULT
 
+EPOCPROCESSPRIORITY high
+
 SOURCEPATH      ../src
 
 SOURCE          tmsserver.cpp
 SOURCE          tmsserversession.cpp
 SOURCE          tmsservershutdown.cpp
-SOURCE          globaleffectssettings.cpp
-SOURCE          tareventhandler.cpp
-SOURCE          cspcenreplistener.cpp
-SOURCE          cspaudiohandler.cpp
+SOURCE          tmsglobaleffectssettings.cpp
+SOURCE          tmstareventhandler.cpp
+SOURCE          tmscenreplistener.cpp
+SOURCE          tmscenrepaudiohandler.cpp
+SOURCE          tmsdtmfeventhandler.cpp
+SOURCE          tmsaudiotoneutilityimpl.cpp
+SOURCE          tmsaudioinbandtoneplayer.cpp
+SOURCE          tmspubsublistener.cpp
+SOURCE          tmsrtcontainer.cpp
+SOURCE          tmsrtaudiohdlr.cpp
+SOURCE          tmsrtplayer.cpp
+SOURCE          tmstimer.cpp
+SOURCE          tmsasyncreqao.cpp
 
 USERINCLUDE     ../inc
 USERINCLUDE     ../../inc
 
+APP_LAYER_SYSTEMINCLUDE
 MW_LAYER_SYSTEMINCLUDE
 OS_LAYER_LIBC_SYSTEMINCLUDE
 OS_LAYER_GLIB_SYSTEMINCLUDE
-
+OS_LAYER_STDCPP_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/mda/common
 SYSTEMINCLUDE   /epoc32/include/mmf/server
-SYSTEMINCLUDE   /epoc32/include/mda/common
 SYSTEMINCLUDE   /epoc32/include/mmf/common
-SYSTEMINCLUDE   /epoc32/include/platform/app
-SYSTEMINCLUDE   /epoc32/include/stdapis/stlport
-SYSTEMINCLUDE   /epoc32/include/stdapis/glib-2.0/gobject
 
+LIBRARY         bafl.lib
 LIBRARY         ecom.lib
 LIBRARY         euser.lib
 LIBRARY         estor.lib
+LIBRARY         efsrv.lib
 LIBRARY         libglib.lib
 LIBRARY         mmfdevsound.lib
 LIBRARY         tmscallserver.lib
 LIBRARY         centralrepository.lib
 LIBRARY         cenrepnotifhandler.lib
+LIBRARY         profileengine.lib
+LIBRARY         audiooutputrouting.lib
 LIBRARY         mediaclientaudio.lib
+LIBRARY         apgrfx.lib
+LIBRARY         apmime.lib
+LIBRARY         charconv.lib
+LIBRARY         caf.lib
 
 SMPSAFE
 
--- a/mmserv/tms/tmsserver/inc/cspaudiohandler.h	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +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:  Declarations for class CSPAudioHandler
- *
- */
-
-#ifndef CSPAUDIOHANDLER_H
-#define CSPAUDIOHANDLER_H
-
-#include <e32base.h>
-#include <sounddevice.h>
-
-#include "mcspcenrepobserver.h"
-#include "tmsserver.h"
-
-namespace TMS {
-class CSPPubSubListener;
-class CSPCenRepListener;
-class CSPAudioStreams;
-
-/**
- * Handles call adding from calls not done by the plugin.
- *
- */
-class CSPAudioHandler : public CBase,
-                        public MCSPCenRepObserver
-    {
-public:
-    //Constructors and descructor
-
-    /**
-     * Two-phased constructing for the monitor.
-     *
-     * @param aObserver the observer for getting notification
-     * @param aLine the line to monitor
-     * @param aLineId line identifier
-     */
-    static CSPAudioHandler* NewL(TMSServer* aServer);
-
-    /**
-     * C++ default destructor
-     */
-    virtual ~CSPAudioHandler();
-
-    void SetLoudSpeakerVol(TInt vol);
-    void SetEarPieceVol(TInt vol);
-
-    // from base class MCSPPubSubObserver
-    /**
-     * Handler for changed event.
-     * @param aUid uid of setting
-     * @param aKey id of setting
-     * @param aStatus status of completed AO operation
-     */
-    //virtual void HandleNotifyPSL( const TUid aUid, const TInt& aKey,
-    //    const TRequestStatus& aStatus );
-
-    // from base class MCSPCenRepObserver
-    /**
-     * Handler for changed event.
-     * @param aUid uid of setting
-     * @param aVal value
-     */
-    virtual void CSPAudioHandler::HandleNotifyCenRepL(const TUid aUid,
-            const TUint32 aKey, TInt aVal);
-
-    // from base class MDevSoundObserver
-protected:
-    //From DevSound
-
-
-protected:
-    // From CActive
-    /**
-     * From CActive
-     * RunL
-     */
-    void RunL();
-
-    /**
-     * From CActive
-     * Catches errors if RunL leaves
-     * @param aError error code
-     * @return error code
-     */
-    TInt RunError(TInt aError);
-
-    /**
-     * From CActive
-     * Cancels the monitor
-     */
-    void DoCancel();
-
-private:
-    /**
-     * C++ default constructor
-     * @param aObserver the observer for status change (incoming call)
-     * @param aLine the line associated with the call
-     * @param aLineId line identifier
-     */
-    CSPAudioHandler(TMSServer* aServer);
-
-    /**
-     * Constructs the monitor in the second phase.
-     */
-    void ConstructL();
-
-private:
-    // data
-
-    /**
-     * Mute listening from Publish&Subscribe.
-     */
-    CSPPubSubListener* iMuteListener;
-
-    /**
-     * Incall loudspeaker listening from Central Repository.
-     */
-    CSPCenRepListener* iIncallLoudspeakerVolumeListener;
-
-    /**
-     * Incall ear volume listening from Central Repository.
-     */
-    CSPCenRepListener* iIncallEarVolumeListener;
-
-    /**
-     * Audio streams handler.
-     */
-    //CSPAudioStreams* iAudioStreams;
-
-    /**
-     * Call count
-     */
-    TInt iCallCount;
-    TMSServer* iTMSSer;
-    };
-
-} //namespace TMS
-
-#endif // CSPAUDIOHANDLER_H
--- a/mmserv/tms/tmsserver/inc/cspcenreplistener.h	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +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:  This file contains the header of CenRep Listener class.
- *
- */
-
-#ifndef CSPCENREPLISTENER_H
-#define CSPCENREPLISTENER_H
-
-// INCLUDE FILES
-#include <e32base.h>
-#include <centralrepository.h>
-
-namespace TMS {
-
-// Forward declarations
-//class CRepository;
-class MCSPCenRepObserver;    
-   
-    // BASE CLASS
-
-    // CLASS DECLARATION
-
-    /**
-     *   CSPCenRepListener manages getting notification on CenRep key changes.
-     */
-class CSPCenRepListener : public CActive
-        {
-    public:
-
-        /**
-         * Two-phased construction.
-         *
-         * @param aUid cenrep Uid
-         * @param aKey key to be listened
-         * @param aObserver observer for key change.
-         * @return instance of the class
-         */
-        static CSPCenRepListener* NewL(TUid aUid, TUint32 aKey,
-                MCSPCenRepObserver* aObserver);
-
-        /**
-         * Destructor.
-         */
-        virtual ~CSPCenRepListener();
-
-    public:
-
-        /**
-         * Gets the current value of the monitored setting
-         * @param aValue the current value of the monitored setting
-         * @return TInt Symbian OS error code from central repository
-         */
-        TInt Get(TInt& aValue);
-        
-        TInt Set( TInt aValue );
-
-    protected:
-        // From CActive
-
-        void DoCancel();
-        TInt RunError(TInt aError);
-        void RunL();
-
-    private:
-
-        /**
-         * Constructor
-         * @param aUid cenrep Uid
-         * @param aKey key to be listened
-         * @param aObserver observer for key change.
-         */
-        CSPCenRepListener(TUid aUid, TUint32 aKey,
-                MCSPCenRepObserver* aObserver);
-
-        /**
-         * Private constructing.
-         */
-        void ConstructL();
-
-        /**
-         * Submits a notification request
-         */
-        void SubmitNotifyRequestL();
-
-    private:
-        // Owned by this object
-
-        /**
-         * UID of CR key.
-         */
-        TUid iUid;
-
-        /**
-         * Repository access.
-         * Own.
-         */
-        CRepository* iRepository;
-
-        /**
-         * Identification number of the monitored setting.
-         */
-        TUint32 iMonitorSetting;
-
-        MCSPCenRepObserver* iObserver;
-        };
-
-} //namespace TMS
-#endif // CSPCENREPLISTENER_H
--- a/mmserv/tms/tmsserver/inc/globaleffectssettings.h	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +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 GLOBALEFFECTSSETTINGS_H
-#define GLOBALEFFECTSSETTINGS_H
-
-//  INCLUDES
-#include <e32base.h>
-#include <e32property.h>
-#include <sounddevice.h>
-#include <centralrepository.h>
-
-namespace TMS {
-
-// CLASS DECLARATION
-class GlobalEffectsSettings : public CBase
-    {
-public:
-    /**
-     * Two-phased constructor.
-     */
-    static GlobalEffectsSettings* NewL();
-
-    /**
-     * Destructor.
-     */
-    virtual ~GlobalEffectsSettings();
-
-public:
-    /**
-     * Store the current loud speaker volume.
-     * @param aVolume Volume
-     */
-    void SetLoudSpkrVolume(TInt aVolume);
-
-    /**
-     * Store the current earpiece volume.
-     * @param aVolume Volume
-     */
-    void SetEarPieceVolume(TInt aVolume);
-
-
-    /**
-     * Retrieve the current loud speaker volume.
-     * @param aVolume Volume
-     */
-    void GetLoudSpkrVolume(TInt& aVolume);
-
-    /**
-     * Retrieve the current earpiece volume.
-     * @param aVolume Volume
-     */
-    void GetEarPieceVolume(TInt& aVolume);
-
-    /**
-     * Returns the current volume.
-     * @return Current volume
-     */
-    TInt MaxVolume() const;
-
-    /**
-     * Store the current gain.
-     * @param aVolume Volume
-     * @param aPublish ETrue to publish the status to clients
-     */
-    void SetGain(TInt aGain);
-
-    /**
-     * Returns the current gain.
-     * @return Current volume
-     */
-    TInt Gain() const;
-
-    /**
-     * Returns the max gain.
-     * @return Current volume
-     */
-    TInt MaxGain() const;
-
-private:
-
-    /**
-     * C++ default constructor.
-     */
-    GlobalEffectsSettings();
-
-    /**
-     * By default Symbian 2nd phase constructor is private.
-     */
-    void ConstructL();
-
-private:
-    TInt iGain;
-    TInt iMaxVolume;
-    TInt iMaxGain;
-    TInt iEarVolume;
-    TInt iLoudSpkrVolume;
-
-    CRepository* iRepository;
-    };
-
-} //namespace TMS
-
-#endif      // GLOBALEFFECTSSETTINGS_H
-
-// End of File
--- a/mmserv/tms/tmsserver/inc/mcspcenrepobserver.h	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* Copyright (c) 2007 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:  Declarations for class MCSPCenRepObserver
-*
-*/
-
-
-
-#ifndef MCSPCENREPOBSERVER_H
-#define MCSPCENREPOBSERVER_H
-
-//  INCLUDES
-#include <e32std.h>
-
-namespace TMS {
-
-// CLASS DECLARATION
-
-/**
-*  Observer interface for indicating P&S changes
-*
-*/
-class MCSPCenRepObserver
-    {
-    public:  // New functions
-
-        /**
-        * Handler for changed event.
-        * @param aUid uid of setting 
-        * @param aKey the changed key
-        * @param aVal value
-        */
-        virtual void HandleNotifyCenRepL( const TUid aUid, 
-                                          const TUint32 aKey, 
-                                          TInt aVal) = 0;
-    };
-
-}//namespace TMS
-
-#endif      // MCSPCENREPOBSERVER_H   
-
-// End of File
--- a/mmserv/tms/tmsserver/inc/tareventhandler.h	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +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 TAREVENTHANDLER_H
-#define TAREVENTHANDLER_H
-
-//  INCLUDES
-#include <e32base.h>
-#include <e32property.h>
-#include "tmsserver.h"
-
-namespace TMS {
-
-// CLASS DECLARATION
-class CTarEventHandler : public CActive
-    {
-public:
-    /**
-     * Two-phased constructor.
-     */
-    static CTarEventHandler* NewL(TMSServer* aServer);
-
-    /**
-     * Destructor.
-     */
-    virtual ~CTarEventHandler();
-
-private:
-    /**
-     * From CActive
-     * Cancel outstanding request
-     */
-    void DoCancel();
-
-    /**
-     * From CActive
-     * Implementation of CActive::RunL.
-     * Called when server request has completed.
-     **/
-    void RunL();
-
-private:
-
-    /**
-     * C++ default constructor.
-     */
-    CTarEventHandler(TMSServer* aServer);
-
-    /**
-     * By default Symbian 2nd phase constructor is private.
-     */
-    void ConstructL();
-
-private:
-    TMSServer* iTMSSer;
-    RProperty iProperty;
-    };
-
-} //namespace TMS
-
-#endif  // TAREVENTHANDLER_H
-
-// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsasyncreqao.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,91 @@
+/*
+ * 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 TMSASYNCREQAO_H
+#define TMSASYNCREQAO_H
+
+//INCLUDES
+#include <e32base.h>
+#include "tmsasyncreqobsrv.h"
+
+namespace TMS {
+
+// CLASS DECLARATION
+
+/**
+ *  Active object handling asynchronous RingTone requests.
+ */
+NONSHARABLE_CLASS(TMSAsyncReqAO) : public CActive
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     */
+    static TMSAsyncReqAO* NewL(TMSAsyncReqObsrv* aObserver);
+
+    /**
+     * Destructor.
+     */
+    virtual ~TMSAsyncReqAO();
+
+    /**
+     * Starts A/O.
+     */
+    void Start();
+
+protected:
+    // From CActive
+
+    /**
+     * Cancels asyncronous request(s).
+     */
+    void DoCancel();
+
+    /**
+     * Standard RunError() method
+     * @param
+     *      aError RunL leave code.
+     *
+     * @return KErrNone.
+     */
+    TInt RunError(TInt aError);
+
+    /**
+     * Standard RunL() method
+     */
+    void RunL();
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    TMSAsyncReqAO(TMSAsyncReqObsrv* aObserver);
+
+private:
+    //Data
+
+    // Pointer to the observer
+    TMSAsyncReqObsrv* iObserver;
+    };
+
+} //namespace TMS
+
+#endif // TMSASYNCREQAO_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsasyncreqobsrv.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,46 @@
+/*
+ * 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 TMSASYNCREQOBSRV_H
+#define TMSASYNCREQOBSRV_H
+
+namespace TMS {
+
+// CLASS DECLARATION
+
+/**
+ *  Virtual interface to active object handling asynchronous requests.
+ */
+NONSHARABLE_CLASS(TMSAsyncReqObsrv)
+    {
+public:
+    /**
+     * Allows to gracefully handle error on leave during RunL operation.
+     */
+    virtual void HandleError(TInt aError) = 0;
+
+    /**
+     * Calls method handling asynchronous request.
+     */
+    virtual void HandleAsyncReq() = 0;
+    };
+
+} //namespace TMS
+
+#endif // TMSASYNCREQOBSRV_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsaudioinbandtoneplayer.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,154 @@
+/*
+ * 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 CPEAUDIOINBANDTONEPLAYER_H
+#define CPEAUDIOINBANDTONEPLAYER_H
+
+// INCLUDES
+#include <mdaaudiotoneplayer.h>
+#include <ccpdefs.h>
+#include <tms.h>
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSAudioToneUtility;
+
+// CLASS DECLARATION
+
+/**
+ *  This class is used to play inband tones using media server.
+ *
+ */
+class TMSAudioInbandTonePlayer : public MMdaAudioToneObserver
+    {
+public:
+    // Constructors and destructor
+
+    /**
+     * Two-phased constructor.
+     */
+    static TMSAudioInbandTonePlayer* NewL();
+
+    /**
+     * Destructor.
+     */
+    ~TMSAudioInbandTonePlayer();
+
+    /**
+     * Plays given tone. Originates from CCP plugin.
+     * @param aTone inband tone needed to play
+     */
+    void PlayInbandTone(TMSInbandToneType aTone);
+
+    /**
+     * Cancels playing.
+     */
+    void Cancel();
+
+    /**
+     * Sets volume.
+     * @param    aVolume     Volume in 0...10 scale.
+     */
+    void SetVolume(TInt aVolume);
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    TMSAudioInbandTonePlayer();
+
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     */
+    void ConstructL();
+
+    /**
+     * Playes current tone.
+     * @param None.
+     * @return None.
+     */
+    void PlayCurrentTone();
+
+    //From MMdaAudioToneObserver
+
+    /**
+     * Handles completion of preparation.
+     * @param aError Isn't used.
+     * @return None.
+     */
+    void MatoPrepareComplete(TInt aError);
+
+    //From MMdaAudioToneObserver
+    /**
+     * Handles completion of playing.
+     * @param aError Isn't used.
+     * @return None.
+     */
+    void MatoPlayComplete(TInt aError);
+
+    /**
+     * Calculates media server volume level.
+     * @param   aVolume     Volume level in 0...10 scale.
+     * @return  Volume level in media server scale.
+     */
+    TInt CalculateMediaServerVolume(TInt aVolume) const;
+
+    /**
+     * Updates tone player's volume to the current audio volume level.
+     */
+    void UpdateTonePlayerVolume();
+
+private:
+    // Data
+
+    // Currently playing, NULL or tone sequence.
+    TMSAudioToneUtility* iCurrent;
+    //Member variable for inband tone
+    TMSInbandToneType iToneName;
+    //NetworkBusy sequence
+    HBufC8* iResourceBusySeq;
+    //NetworkBusy sequence
+    HBufC8* iResourceReorderSeq;
+    //NetworkBusy sequence
+    HBufC8* iResourceCongestionSeq;
+    //NetworkBusy sequence
+    HBufC8* iResourceSpecialSeq;
+    //NetworkBusy sequence
+    HBufC8* iResourceRadioPathSeq;
+    //NetworkBusy sequence
+    HBufC8* iResourceRingGoingSeq;
+    //CallWaiting sequence
+    HBufC8* iResourceCallWaitingSeq;
+    //Ringing type
+    //       TProfileRingingType iRingingType;
+    //Data call tone sequence
+    HBufC8* iPlayDataSequence;
+    //Data call silent sequence
+    HBufC8* iPlayNoSoundSequence;
+    //Data call beep sequence
+    HBufC8* iPlayBeepSequence;
+    //Handle to a file server session
+    RFs iFsSession;
+
+    };
+} // namespace TMS
+
+#endif      // CPEAUDIOINBANDTONEPLAYER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsaudiotoneutility.h	Fri Apr 16 15:29:42 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 CPEAUDIOTONEUTILITY_H
+#define CPEAUDIOTONEUTILITY_H
+
+#include <mdaaudiotoneplayer.h>
+
+namespace TMS {
+
+/**
+ *  Interface to wrap CMdaAudioToneUtility.
+ *
+ */
+class TMSAudioToneUtility
+    {
+
+public:
+    /**
+     * See CMdaAudioToneUtility::PrepareToPlayDesSequence.
+     */
+    virtual void PrepareToPlayDesSequence(const TDesC8& aSequence ) = 0;
+
+    /**
+     * See CMdaAudioToneUtility::State.
+     */
+    virtual TMdaAudioToneUtilityState State() = 0;
+
+    /**
+     * See CMdaAudioToneUtility::CancelPlay.
+     */
+    virtual void CancelPlay() = 0;
+
+    /**
+     * See CMdaAudioToneUtility::MaxVolume.
+     */
+    virtual TInt MaxVolume() = 0;
+
+    /**
+     * See CMdaAudioToneUtility::SetVolume.
+     */
+    virtual void SetVolume( TInt aVolume ) = 0;
+
+    /**
+     * See CMdaAudioToneUtility::SetRepeats.
+     */
+    virtual void SetRepeats(
+        TInt aRepeatNumberOfTimes,
+        const TTimeIntervalMicroSeconds& aTrailingSilence ) = 0;
+
+    /**
+     * See CMdaAudioToneUtility::SetPriority.
+     */
+    virtual void SetPriority(
+        TInt aPriority,
+        TMdaPriorityPreference aPref) = 0;
+
+    /**
+     * See CMdaAudioToneUtility::SetVolumeRamp.
+     */
+    virtual void SetVolumeRamp(
+        const TTimeIntervalMicroSeconds& aRampDuration) = 0;
+
+    /**
+     * See CMdaAudioToneUtility::SetVolumeRamp.
+     */
+    virtual void Play() = 0;
+
+    /**
+     * See CMdaAudioToneUtility::CancelPrepare.
+     */
+    virtual void CancelPrepare() = 0;
+
+    };
+
+} //namespace TMS
+
+#endif // CPEAUDIOTONEUTILITY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsaudiotoneutilityimpl.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,125 @@
+/*
+ * 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 TMSAUDIOTONEUTILITYIMPL_H
+#define TMSAUDIOTONEUTILITYIMPL_H
+
+#include <e32base.h>
+#include <mdaaudiotoneplayer.h>
+#include "tmsaudiotoneutility.h"
+
+namespace TMS {
+
+/**
+ *  Wraps CMdaAudioToneUtility.
+ *  To ease module testing.
+ *
+ *  @lib AudioHandling
+ */
+class TMSAudioToneUtilityImpl : public TMSAudioToneUtility
+    {
+public:
+
+    static TMSAudioToneUtilityImpl* NewL(
+            MMdaAudioToneObserver& aToneObserver);
+
+    /**
+     * Destructor.
+     */
+    virtual ~TMSAudioToneUtilityImpl();
+
+    // from base class TMSAudioToneUtilityImpl
+
+    /**
+     * From TMSAudioToneUtilityImpl
+     * @see CMdaAudioToneUtility
+     */
+    void PrepareToPlayDesSequence(const TDesC8& aSequence);
+
+    /**
+     * From TMSAudioToneUtilityImpl
+     * @see CMdaAudioToneUtility
+     */
+    TMdaAudioToneUtilityState State();
+
+    /**
+     * From TMSAudioToneUtilityImpl
+     * @see CMdaAudioToneUtility
+     */
+    void CancelPlay();
+
+    /**
+     * From TMSAudioToneUtilityImpl
+     * @see CMdaAudioToneUtility
+     */
+    TInt MaxVolume();
+
+    /**
+     * From TMSAudioToneUtilityImpl
+     * @see CMdaAudioToneUtility
+     */
+    void SetVolume(TInt aVolume);
+
+    /**
+     * From TMSAudioToneUtilityImpl
+     * @see CMdaAudioToneUtility
+     */
+    void SetRepeats(TInt aRepeatNumberOfTimes,
+            const TTimeIntervalMicroSeconds& aTrailingSilence);
+
+    /**
+     * From TMSAudioToneUtilityImpl
+     * @see CMdaAudioToneUtility
+     */
+    void SetPriority(TInt aPriority, TMdaPriorityPreference aPref);
+
+    /**
+     * From TMSAudioToneUtilityImpl
+     * @see CMdaAudioToneUtility
+     */
+    void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration);
+
+    /**
+     * From TMSAudioToneUtilityImpl
+     * @see CMdaAudioToneUtility
+     */
+    void Play();
+
+    /**
+     * From TMSAudioToneUtilityImpl
+     * @see CMdaAudioToneUtility
+     */
+    void CancelPrepare();
+
+private:
+
+    TMSAudioToneUtilityImpl();
+
+    void ConstructL(MMdaAudioToneObserver& aToneObserver);
+
+private:
+    // data
+
+    /**
+     * Own.
+     * For playing tones.
+     */
+    CMdaAudioToneUtility* iToneUtility;
+    };
+} //namespace TMS
+
+#endif // TMSAUDIOTONEUTILITYIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmscenrepaudiohandler.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,144 @@
+/*
+ * 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:  Declarations for class TMSCenRepAudioHandler
+ *
+ */
+
+#ifndef TMSCENREPAUDIOHANDLER_H
+#define TMSCENREPAUDIOHANDLER_H
+
+#include "tmspubsubobserver.h"
+#include "tmscenrepobserver.h"
+#include "tmsserver.h"
+
+namespace TMS {
+
+class TMSPubSubListener;
+class TMSCenRepListener;
+
+/**
+ * Handles call adding from calls not done by the plugin.
+ *
+ */
+class TMSCenRepAudioHandler : public TMSPubSubObserver,
+                              public TMSCenRepObserver
+    {
+public:
+    //Constructors and descructor
+
+    /**
+     * Two-phased constructing for the monitor.
+     *
+     * @param aObserver the observer for getting notification
+     * @param aLine the line to monitor
+     * @param aLineId line identifier
+     */
+    static TMSCenRepAudioHandler* NewL(TMSServer* aServer);
+
+    /**
+     * C++ default destructor
+     */
+    virtual ~TMSCenRepAudioHandler();
+
+    void SetLoudSpeakerVol(TInt vol);
+    void SetEarPieceVol(TInt vol);
+
+    // from base class TMSPubSubObserver
+    /**
+     * Handler for changed event.
+     * @param aUid uid of setting
+     * @param aKey id of setting
+     * @param aStatus status of completed AO operation
+     */
+    virtual void HandleNotifyPSL(const TUid aUid, const TInt& aKey,
+            const TRequestStatus& aStatus);
+
+    // from base class TMSCenRepObserver
+    /**
+     * Handler for changed event.
+     * @param aUid uid of setting
+     * @param aVal value
+     */
+    virtual void HandleNotifyCenRepL(const TUid aUid, const TUint32 aKey,
+            TInt aVal);
+
+protected:
+    // From CActive
+    /**
+     * From CActive
+     * RunL
+     */
+    void RunL();
+
+    /**
+     * From CActive
+     * Catches errors if RunL leaves
+     * @param aError error code
+     * @return error code
+     */
+    TInt RunError(TInt aError);
+
+    /**
+     * From CActive
+     * Cancels the monitor
+     */
+    void DoCancel();
+
+private:
+    /**
+     * C++ default constructor
+     * @param aObserver the observer for status change (incoming call)
+     * @param aLine the line associated with the call
+     * @param aLineId line identifier
+     */
+    TMSCenRepAudioHandler(TMSServer* aServer);
+
+    /**
+     * Constructs the monitor in the second phase.
+     */
+    void ConstructL();
+
+private:
+    // data
+
+    /**
+     * Mute listening from Publish&Subscribe.
+     */
+    TMSPubSubListener* iMuteListener;
+
+    /**
+     * Incall loudspeaker listening from Central Repository.
+     */
+    TMSCenRepListener* iIncallLoudspeakerVolumeListener;
+
+    /**
+     * Incall ear volume listening from Central Repository.
+     */
+    TMSCenRepListener* iIncallEarVolumeListener;
+
+    /**
+     * Audio streams handler.
+     */
+    //CSPAudioStreams* iAudioStreams;
+
+    /**
+     * Call count
+     */
+    TInt iCallCount;
+    TMSServer* iTMSSer;
+    };
+
+} //namespace TMS
+
+#endif // TMSCENREPAUDIOHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmscenreplistener.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,115 @@
+/*
+ * 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 the header of CenRep Listener class.
+ *
+ */
+
+#ifndef TMSCENREPLISTENER_H
+#define TMSCENREPLISTENER_H
+
+// INCLUDE FILES
+#include <glib.h>
+#include <e32base.h>
+#include <centralrepository.h>
+
+namespace TMS {
+
+// Forward declarations
+class TMSCenRepObserver;
+
+/**
+ *   TMSCenRepListener manages getting notification on CenRep key changes.
+ */
+class TMSCenRepListener : public CActive
+    {
+public:
+
+    /**
+     * Two-phased construction.
+     *
+     * @param aUid cenrep Uid
+     * @param aKey key to be listened
+     * @param aObserver observer for key change.
+     * @return instance of the class
+     */
+    static TMSCenRepListener* NewL(TUid aUid, TUint32 aKey,
+            TMSCenRepObserver* aObserver);
+
+    /**
+     * Destructor.
+     */
+    virtual ~TMSCenRepListener();
+
+public:
+
+    /**
+     * Gets the current value of the monitored setting
+     * @param aValue the current value of the monitored setting
+     * @return gint Symbian OS error code from central repository
+     */
+    gint Get(gint& aValue);
+
+    gint Set(gint aValue);
+
+protected:
+    // From CActive
+    void DoCancel();
+    gint RunError(TInt aError);
+    void RunL();
+
+private:
+
+    /**
+     * Constructor
+     * @param aUid cenrep Uid
+     * @param aKey key to be listened
+     * @param aObserver observer for key change.
+     */
+    TMSCenRepListener(TUid aUid, TUint32 aKey, TMSCenRepObserver* aObserver);
+
+    /**
+     * Private constructing.
+     */
+    void ConstructL();
+
+    /**
+     * Submits a notification request
+     */
+    void SubmitNotifyRequestL();
+
+private:
+    // Owned by this object
+
+    /**
+     * UID of CR key.
+     */
+    TUid iUid;
+
+    /**
+     * Repository access.
+     * Own.
+     */
+    CRepository* iRepository;
+
+    /**
+     * Identification number of the monitored setting.
+     */
+    TUint32 iMonitorSetting;
+
+    TMSCenRepObserver* iObserver;
+    };
+
+} //namespace TMS
+
+#endif // TMSCENREPLISTENER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmscenrepobserver.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,51 @@
+/*
+ * 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:  Declarations for class TMSCenRepObserver
+ *
+ */
+
+#ifndef TMSCENREPOBSERVER_H
+#define TMSCENREPOBSERVER_H
+
+//  INCLUDES
+#include <e32std.h>
+
+namespace TMS {
+
+// CLASS DECLARATION
+
+/**
+ *  Observer interface for indicating P&S changes
+ *
+ */
+class TMSCenRepObserver
+    {
+public:
+    // New functions
+
+    /**
+     * Handler for changed event.
+     * @param aUid uid of setting
+     * @param aKey the changed key
+     * @param aVal value
+     */
+    virtual void HandleNotifyCenRepL(const TUid aUid, const TUint32 aKey,
+            TInt aVal) = 0;
+    };
+
+}//namespace TMS
+
+#endif // TMSCENREPOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsdtmfeventhandler.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,77 @@
+/*
+ * 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 DTMFEVENTHANDLER_H
+#define DTMFEVENTHANDLER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32property.h>
+#include "tmsserver.h"
+
+namespace TMS {
+
+// CLASS DECLARATION
+class TMSDtmfEventHandler : public CActive
+    {
+public:
+    /**
+     * Two-phased constructor.
+     */
+    static TMSDtmfEventHandler* NewL(TMSServer* aServer);
+
+    /**
+     * Destructor.
+     */
+    virtual ~TMSDtmfEventHandler();
+
+private:
+    /**
+     * From CActive
+     * Cancel outstanding request
+     */
+    void DoCancel();
+
+    /**
+     * From CActive
+     * Implementation of CActive::RunL.
+     * Called when server request has completed.
+     */
+    void RunL();
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    TMSDtmfEventHandler(TMSServer* aServer);
+
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     */
+    void ConstructL();
+
+private:
+    TMSServer* iTMSSer;
+    RProperty iProperty;
+    };
+
+} //namespace TMS
+
+#endif      // DTMFEVENTHANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsglobaleffectssettings.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,119 @@
+/*
+ * 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 TMSGLOBALEFFECTSSETTINGS_H
+#define TMSGLOBALEFFECTSSETTINGS_H
+
+//  INCLUDES
+#include <e32property.h>
+#include <sounddevice.h>
+#include <centralrepository.h>
+
+namespace TMS {
+
+// CLASS DECLARATION
+class TMSGlobalEffectsSettings
+    {
+public:
+    /**
+     * Two-phased constructor.
+     */
+    static TMSGlobalEffectsSettings* NewL();
+
+    /**
+     * Destructor.
+     */
+    virtual ~TMSGlobalEffectsSettings();
+
+public:
+    /**
+     * Store the current loud speaker volume.
+     * @param aVolume Volume
+     */
+    void SetLoudSpkrVolume(TInt aVolume);
+
+    /**
+     * Store the current earpiece volume.
+     * @param aVolume Volume
+     */
+    void SetEarPieceVolume(TInt aVolume);
+
+
+    /**
+     * Retrieve the current loud speaker volume.
+     * @param aVolume Volume
+     */
+    void GetLoudSpkrVolume(TInt& aVolume);
+
+    /**
+     * Retrieve the current earpiece volume.
+     * @param aVolume Volume
+     */
+    void GetEarPieceVolume(TInt& aVolume);
+
+    /**
+     * Returns the current volume.
+     * @return Current volume
+     */
+    TInt MaxVolume() const;
+
+    /**
+     * Store the current gain.
+     * @param aVolume Volume
+     * @param aPublish ETrue to publish the status to clients
+     */
+    void SetGain(TInt aGain);
+
+    /**
+     * Returns the current gain.
+     * @return Current volume
+     */
+    TInt Gain() const;
+
+    /**
+     * Returns the max gain.
+     * @return Current volume
+     */
+    TInt MaxGain() const;
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    TMSGlobalEffectsSettings();
+
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     */
+    void ConstructL();
+
+private:
+    TInt iGain;
+    TInt iMaxVolume;
+    TInt iMaxGain;
+    TInt iEarVolume;
+    TInt iLoudSpkrVolume;
+
+    CRepository* iRepository;
+    };
+
+} //namespace TMS
+
+#endif // TMSGLOBALEFFECTSSETTINGS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmspubsublistener.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,136 @@
+/*
+ * 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:  Declarations for class TMSPubSubListener
+ *
+ */
+
+#ifndef TMSPUBSUBLISTENER_H
+#define TMSPUBSUBLISTENER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+#include <e32property.h>
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSPubSubObserver;
+
+// CLASS DECLARATION
+
+/**
+ *  RProperty poller.
+ */
+class TMSPubSubListener : public CActive
+    {
+public:
+    // Constructors and destructor
+
+    /**
+     * Two-phased constructor.
+     * @param aUid the Uid to use
+     * @param aKey item's key
+     * @param aObserver callback interface for notification
+     * @return instance of CSPPubSubListener
+     */
+    static TMSPubSubListener* NewL(const TUid aUid, const TInt aKey,
+            TMSPubSubObserver* aObserver);
+
+    /**
+     * Destructor.
+     */
+    virtual ~TMSPubSubListener();
+
+public:
+    // New functions.
+
+    /**
+     * Gets integer value from P & S.
+     * @param aVal a value in return
+     * @return error code
+     */
+    TInt Get(TInt& aVal);
+
+    /**
+     * Gets 8 bit string value from P&S.
+     * @param aVal a value in return
+     * @return error code
+     */
+    TInt Get(TDes8& aVal);
+
+    /**
+     * Gets 16 bit descriptor value from P&S.
+     * @param aVal a value in return
+     * @return error code
+     */
+    TInt Get(TDes16& aVal);
+
+private:
+    // New functions.
+
+    /**
+     * Starts the listening (RunL).
+     */
+    void StartListening();
+
+private:
+    // From CActive.
+
+    /** @see CActive::RunL */
+    virtual void RunL();
+
+    /** @see CActive::Cancel */
+    virtual void DoCancel();
+
+    /** @see CActive::RunError */
+    virtual TInt RunError(TInt aError);
+
+private:
+
+    /**
+     * Constructor of the listener.
+     * @param aUid the Uid to use
+     * @param aKey item's key
+     * @param aObserver callback interface for notification
+     */
+    TMSPubSubListener(const TUid aUid, TInt aKey,
+	        TMSPubSubObserver* aObserver);
+
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     */
+    void ConstructL();
+
+private:
+    // Data
+
+    /** UID of the monitored item. */
+    TUid iUid;
+
+    /** ID of the monitored item. */
+    TInt iId;
+
+    /** Property to subscribe to. */
+    RProperty iProperty;
+
+    /** Observer for PS notifications. */
+    TMSPubSubObserver* iObserver;
+    };
+
+} //namespace TMS
+
+#endif // TMSPUBSUBLISTENER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmspubsubobserver.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,51 @@
+/*
+ * 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:  Declarations for class TMSPubSubObserver
+ *
+ */
+
+#ifndef TMSPUBSUBOBSERVER_H
+#define TMSPUBSUBOBSERVER_H
+
+//  INCLUDES
+#include <e32std.h>
+
+namespace TMS {
+
+// CLASS DECLARATION
+
+/**
+ *  Observer interface for indicating P&S changes
+ *
+ */
+class TMSPubSubObserver
+    {
+public:
+    // New functions
+
+    /**
+     * Handler for changed event.
+     * @param aUid uid of setting
+     * @param aKey id of setting
+     * @param aStatus status of completed AO operation
+     */
+    virtual void HandleNotifyPSL(const TUid aUid, const TInt& aKey,
+            const TRequestStatus& aStatus) = 0;
+    };
+
+} // TMS namespace
+
+#endif // TMSPUBSUBOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsrtaudiohdlr.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,301 @@
+/*
+ * 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:  Ring Tone Audio playback handler.
+ *
+ */
+
+#ifndef TMSRTAUDIOHDLR_H
+#define TMSRTAUDIOHDLR_H
+
+// INCLUDES
+
+#include <AudioOutput.h>
+//#include <c3dringingtoneinterface.h>
+#include <mdaaudiosampleplayer.h>
+#include <mdaaudiotoneplayer.h>
+
+namespace TMS {
+
+// CLASS DECLARATION
+class TMSRtAudioHdlrObsrv;
+class TMSRtContainer;
+
+/**
+ *  RingTone audio handler.
+ *  Handles audio for tone sequence and digital sample playback.
+ */
+class TMSRtAudioHdlr : public CBase,
+                       public MMdaAudioPlayerCallback,
+                       public MMdaAudioToneObserver
+    {
+public:
+
+    enum TAudioPlayerStatus
+        {
+        EToneLoading,
+        EToneReady,
+        ETonePlaying
+        };
+
+    enum TRingingType
+        {
+        ETypeRinging,
+        ETypeRingingOnce,
+        ETypeAscending
+        };
+
+public:
+    /**
+     * Two-phased constructor.
+     * @param aRingingTone The ringing tone
+     * @param aPriority The priority for the playing
+     * @param aPreference The preference value
+     * @param aObserver Audio player observer
+     * @param aType The id of this audio player
+     * @param aExtSecNeeded ETrue if DRM extend security is needed
+     * @return The instance of the audio player.
+     */
+    static TMSRtAudioHdlr* NewL(const TMSRtContainer& aRingingTone,
+            TUint aPriority, TUint aPreference,
+            TMSRtAudioHdlrObsrv& aObserver, TInt aType = 0,
+            TBool aExtSecNeeded = EFalse);
+
+    /**
+     * Two-phased constructor.
+     * @param aFileName The ringing tone file name.
+     * @param aPriority The priority for the playing
+     * @param aPreference The preference value
+     * @param aObserver Audio player observer
+     * @param aType The id of this audio player
+     * @param aExtSecNeeded ETrue if DRM extend security is needed
+     * @return The instance of the audio player.
+     */
+    static TMSRtAudioHdlr* NewL(const TDesC& aFileName, TUint aPriority,
+            TUint aPreference, TMSRtAudioHdlrObsrv& aObserver,
+            TInt aType = 0, TBool aExtSecNeeded = EFalse);
+
+    /**
+     * Two-phased constructor, take audio from descriptor.
+     *
+     * @param aSequence sequence to be played.
+     * @param aPriority priority of tone.
+     * @param aPreference preference of tone.
+     * @param aObserver observer.
+     * @param aType identifier, used in observer interface calls.
+     * @return The instance of the audio player.
+     */
+    static TMSRtAudioHdlr* NewSeqL(const TDesC8& aSequence,
+            TUint aPriority, TUint aPreference,
+            TMSRtAudioHdlrObsrv& aObserver, TInt aType = 0);
+
+    /**
+     * Two-phased constructor, takes Text-To-Speech text to be played.
+     * @param aText Text to be pronounced.
+     * @param aPriority priority of tone.
+     * @param aPreference preference of tone.
+     * @param aObserver observer.
+     * @param aType identifier, used in observer interface calls.
+     * @return The instance of the audio player.
+     */
+    static TMSRtAudioHdlr* NewTtsL(const TDesC& aText, TUint aPriority,
+            TUint aPreference, TMSRtAudioHdlrObsrv& aObserver, TInt aType = 0);
+
+    /**
+     * Destructor.
+     */
+    ~TMSRtAudioHdlr();
+
+public:
+    // new function
+
+    /**
+     * Play the audio file or tone
+     * @param aRingingType
+     * @param aVolume take value from 1 to 10
+     * @param aTTsToBePlayed
+     */
+    void Play(TRingingType aRingType, TInt aVolume, TBool aTTsToBePlayed);
+
+    /**
+     * Stop current file playing
+     */
+    void StopPlaying();
+
+    /**
+     * Sets new volumes and ramptimes.
+     * @param aVolume -volume to be set
+     * @param aRamptime -ramptime to be set.
+     */
+    void SetNewVolumeAndRamptime(TInt aVolume, TInt aRamptime);
+
+    /**
+     * Re starts playing.
+     */
+    void ReStartPlaying();
+    /**
+     * Enable or disable TTs playing.
+     * @param aTTsToBePlayed
+     */
+    void SetTTsToBePlayed(const TBool aTTsToBePlayed);
+
+    /**
+     * Sets volume level to zero.
+     */
+    void MutePlaying();
+
+public:
+    /**
+     * from MMdaAudioPlayerCallback
+     */
+    virtual void MapcInitComplete(TInt aError,
+            const TTimeIntervalMicroSeconds& aDuration);
+
+    /**
+     * from MMdaAudioPlayerCallback
+     */
+    virtual void MapcPlayComplete(TInt aError);
+
+    /**
+     * from MMdaAudioToneObserver
+     */
+    virtual void MatoPrepareComplete(TInt aError);
+
+    /**
+     * from MMdaAudioToneObserver
+     */
+    virtual void MatoPlayComplete(TInt aError);
+
+private:
+
+    enum TAudioDataFormat
+        {
+        EFormatTone,
+        EFormatSample,
+        EFormatTts
+        };
+
+    /**
+     * C++ constructor.
+     */
+    TMSRtAudioHdlr(TAudioDataFormat aDataFormat,
+            TMSRtAudioHdlrObsrv& aObserver, TUint aPriority,
+            TUint aPreference, TInt aType);
+
+    /**
+     * Symbian OS constructor.
+     */
+    void ConstructL(const TDesC& aFileName);
+
+    /**
+     * Symbian OS constructor.
+     */
+    void ConstructSeqL(const TDesC8& aSequence);
+
+    /**
+     * Symbian OS constructor for the Text-To-Speech option
+     */
+    void ConstructTtsL(const TDesC& aTtsText, TUint aPriority,
+            TUint aPreference);
+
+    /**
+     * Do the playing stuff
+     */
+    void DoPlay();
+
+    /**
+     * Ser tinging type properties
+     */
+    void SetRingingTypeProperties();
+
+    /**
+     * Call back function for timer
+     */
+    static TInt TimerCallBack(TAny* aAny);
+
+    /**
+     * Handle timer events
+     */
+    void HandleTimerEvent();
+
+    /*
+     * Convert volume to the scale used by hardware
+     * @param aVolume volume to be altered
+     * @return TInt   new volume
+     */
+    TInt ConvertVolume(TInt aVolume);
+
+private:
+    // Data
+
+    // The format of audio data, audio sample file or tone file
+    TAudioDataFormat iFormat;
+
+    // Observer for error handling
+    TMSRtAudioHdlrObsrv& iObserver;
+
+    // Priority. It's only used in playing tone file
+    const TInt iPriority;
+
+    // Preference. Only used for tone file
+    const TUint iPreference;
+
+    // Identifier number
+    TInt iRtType;
+
+    // Player for tone file.
+    CMdaAudioToneUtility* iTonePlayer;
+
+    // Player for audio file.
+    CMdaAudioPlayerUtility* iSamplePlayer;
+
+    // Player for the Text-To-Speech texts
+    CMdaAudioPlayerUtility* iTtsPlayer;
+
+    // The status of the player
+    TAudioPlayerStatus iPlayerStatus;
+
+    // How does the file played. It's only used if the player
+    // is playing the file
+    TRingingType iRingType;
+
+    // Volume
+    TInt iVolume;
+
+    // For ascending and descending used for set current volume
+    TInt iCurrentVolume;
+
+    // Used by sample player
+    TBool iToBePlaying;
+
+    // Store for sequence.
+    HBufC8* iSequence;
+
+    // Store for the TTS source string
+    HBufC8* iTtsText;
+
+    // 3D Audio ringing tone plugin
+    //C3DRingingToneInterface* i3DPlugin;
+
+    // Ringingtone output
+    //CAudioOutput* iAudioOutput;
+
+    // Flag to  indicate whether we need to play TTs or not
+    TBool iTTsToBePlayed;
+    };
+
+} //namespace TMS
+
+#endif //TMSRTAUDIOHDLR_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsrtaudiohdlrobsrv.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,54 @@
+/*
+ * 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:  Observer interface for audio player.
+ *
+ */
+
+#ifndef TMSRTAUDIOHDLROBSRV_H
+#define TMSRTAUDIOHDLROBSRV_H
+
+// INCLUDES
+
+namespace TMS {
+
+// CLASS DECLARATION
+
+/**
+ *  Observer interface for audio player.
+ */
+class TMSRtAudioHdlrObsrv
+    {
+public:
+    /**
+     * This method is called when TMSRingTone event occurs.
+     *
+     * Notified events:
+     *  ECmdRingToneOpenComplete
+     *  ECmdRingTonePlayComplete
+     *
+     * @param  aEvent
+     *      Event descriptor.
+     * @param  aError
+     *      Operation status.
+     * @param  aPlayer
+     *      Indicates audio player that generated the event.
+     */
+    virtual void RtAudioHdlrEvent(TInt aEvent, TInt aError, TInt aPlayer) = 0;
+    };
+
+} // namespace TMS
+
+#endif // TMSRTAUDIOHDLROBSRV_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsrtcontainer.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,133 @@
+/*
+ * 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:  Class representing ringing tone
+ *
+ */
+
+#ifndef TMSRTCONTAINER_H
+#define TMSRTCONTAINER_H
+
+//  INCLUDES
+#include <e32base.h>
+
+namespace TMS {
+
+// CLASS DECLARATION
+
+/**
+ *  Ringtone wrapper for file name. In addtion, provides methods for ringtone
+ *  type identification.
+ */
+class TMSRtContainer : public CBase
+    {
+public:
+    // Constructors and destructor
+
+    /**
+     * Two-phased constructor.
+     * @param aFileName Ringing tone file name with path.
+     * @param aDrmInPlayback ETrue to use IsFileDrmProtected().
+     */
+    static TMSRtContainer* NewL(const TDesC& aFileName,
+            TBool aDrmInPlayback = EFalse);
+
+    /**
+     * Destructor.
+     */
+    virtual ~TMSRtContainer();
+
+public:
+    /**
+     * Sets the file name including path.
+     * @param aFileName file name plus path.
+     */
+    void SetFileName(const TDesC& aFileName);
+
+    /**
+     * Returns file name including path.
+     * @return File name.
+     */
+    const TDesC& FileName() const;
+
+    /**
+     * Returns MIME type.
+     * @return MIME type.
+     */
+    const TDesC& MimeType() const;
+
+    /**
+     * Checks if video ringing tone.
+     * @return ETrue if video ringing tone.
+     */
+    TBool IsVideoRingingTone();
+
+    /**
+     * Checks if the file is a DCF file.
+     * @return ETrue if files is DRM protected.
+     */
+    TBool IsFileDrmProtected() const;
+
+    /**
+     * Checks if the file is in ROM.
+     */
+    TBool IsFileInRom() const;
+
+    /**
+     * Refresh MIME type. This must be called
+     * before using MimeType().
+     */
+    TInt RefreshMime();
+
+private:
+
+    /**
+     * Refresh MIME type.
+     */
+    void RefreshMimeL();
+
+    /**
+     * Checks if file is located in video directory.
+     */
+    TBool IsFileInVideoDirectory() const;
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    TMSRtContainer(TBool aDrmInPlayback);
+
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     */
+    void ConstructL(const TDesC& aFileName);
+
+private:
+    // Data
+
+    // File name with path
+    HBufC* iFileName;
+
+    // MIME type
+    HBufC* iMimeType;
+
+    // Extended security
+    TBool iDrmInPlayback;
+    };
+
+} //namespace TMS {
+
+#endif // TMSRTCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsrtparam.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,63 @@
+/*
+ * 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:
+ *
+ */
+
+#ifndef TMSRTPARAM_H
+#define TMSRTPARAM_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <Profile.hrh>
+
+namespace TMS {
+
+// Defines different types of RingTone player
+enum TRtPlayerType
+    {
+    EPlayerFirst,
+    EPlayerAudio = EPlayerFirst,
+    EPlayerBeepOnce,
+    EPlayerSilent,
+    EPlayerUnsecureVoIP,
+    EPlayerDefault,
+    EPlayerSequence,
+    EPlayerBackup,
+    EPlayerTts,
+    EPlayerLast = EPlayerTts,
+    EPlayerCount
+    };
+
+/**
+ *  Structure holding ring tone configuration parameters.
+ */
+struct TMSRtParam
+    {
+public:
+    TPtrC iTextToSay;
+    TRtPlayerType iType;
+    TUint iPriority;
+    TUint iPreference;
+    TInt iVolume;
+    TProfileRingingType iRingingType;
+    TBool iCallerText;
+    TBool iCallerImage;
+    };
+
+} //namespace TMS
+
+#endif // TMSRTPARAM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsrtplayer.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,475 @@
+/*
+ * 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:  Active object which implements ringing tone functionality
+ *
+ */
+
+#ifndef TMSRINGTONEPLAYER_H
+#define TMSRINGTONEPLAYER_H
+
+// INCLUDES
+#include <MProEngEngine.h>
+#include <MProEngProfile.h>
+#include "tmsrtaudiohdlrobsrv.h"
+#include "tmsrtplayerobsrv.h"
+#include "tmsrtaudiohdlr.h"
+#include "tmstimer.h"
+#include "tmsasyncreqao.h"
+#include "tmsrtparam.h"
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSRtAudioHdlr;
+class TMSTimer;
+class CMdaServer;
+class TMSRtContainer;
+class TMSRtParam;
+
+// CLASS DECLARATION
+
+/**
+ * It implements ringing tone functionality.
+ * Note that when issuing Play-command to audio side, ALWAYS set the tone type
+ * before the Play() is called. This is to ensure that correct tone is tried to
+ * be played.
+ */
+class TMSRingTonePlayer : public CBase,
+                          public TMSRtAudioHdlrObsrv,
+                          public TMSTimerObsrv,
+                          public TMSAsyncReqObsrv
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     * @return new instance.
+     */
+    static TMSRingTonePlayer* NewL(TMSRtPlayerObsrv& aObserver);
+
+    /**
+     * Destructor.
+     */
+    ~TMSRingTonePlayer();
+
+    /**
+     * Construct default tone player.
+     */
+    void CreateDefaultRtPlayerL();
+
+    /**
+     * Do construct tone.
+     * @param aRtParam
+     * @param aFile
+     */
+    void CreateRingTonePlayerL(const TRtPlayerType aPlayer,
+            const TDesC& aFile = KNullDesC());
+
+    /**
+     * Construct audio player.
+     */
+    void CreateAudioPlayerL();
+
+    /**
+     * Construct sequence player.
+     * @param aPlayer
+     */
+    void CreateSequencePlayerL(const TRtPlayerType aPlayer);
+
+    /**
+     * Construct custom sequence players.
+     * @param aSequence
+     */
+    void CreateCustomSequencePlayerL(const TDesC8& aSequence);
+
+    /**
+     * Construct TTS player.
+     * @param aTextToSay
+     */
+    void CreateTTSPlayerL(const TDesC& aTextToSay);
+
+    /**
+     * Delete TTS player.
+     */
+    void RemoveTTSPlayer();
+
+    /**
+     * Play ring tone
+     */
+    void PlayRingToneL();
+
+    /**
+     * Play audio ring tone
+     */
+    void PlayAudioRingToneL();
+
+    /**
+     * Playing the Beep once.
+     */
+    void BeepOnceL();
+
+    /**
+     * Play silent tone. No_sound.wav will be played.
+     * If vibration alert is ON, phone will vibrate.
+     */
+    void PlaySilentToneL();
+
+    /**
+     * Play unsecure VoIP tone.
+     * Play tone if secure call fails and call is changed to unsecure call
+     */
+    void PlayUnsecureVoIPToneL();
+
+    /**
+    * Play custom sequence tone.
+    */
+    void PlaySequenceToneL();
+
+    /**
+     * Stops playing the ringing tone.
+     */
+    void StopPlaying();
+
+    /**
+     * Continues video and audio RT playback with volume 0
+     */
+    void MuteRingTone();
+
+    /**
+     * Deinitialize Ringtone player.
+     */
+    void DeinitRingTonePlayer();
+
+    /**
+     * Play default tone.
+     */
+    void PlayDefaultToneL();
+
+    /**
+     * Play TTS tone along with audio RT. Only supported with Default and
+     * custom sample tones. TTS does not start playing immediately.
+     * This method does not command phone to play TTS immediately but after
+     * pre-determined delay.
+     */
+    void PlayTtsTone();
+
+    /**
+     * Checks if extended security is required.
+     * @return ETrue if extended security is required.
+     */
+    TBool ExtendedSecurity() const;
+
+    /*
+     * Return RT player type
+     */
+    TRtPlayerType PlayerType() const;
+
+    /*
+     * From TMSAsyncReqObsrv
+     */
+    virtual void HandleError(TInt aError);
+    virtual void HandleAsyncReq();
+
+private:
+
+    /**
+     * Creates single beep tone player.
+     */
+    void CreateBeepOncePlayerL();
+
+    /**
+     * Creates silent tone player.
+     */
+    void CreateSilentPlayerL();
+
+    /**
+     * Creates unsecure voip tone player.
+     */
+    void CreateUnsecureVoipPlayerL();
+
+    /**
+     * Initializes ring tone configuration parameters.
+     */
+    void InitRtParamsL(TRtPlayerType aPlayerType);
+
+    /*
+     * from TMSRtAudioHdlrObsrv
+     */
+    void RtAudioHdlrEvent(TInt aEvent, TInt aError, TInt aPlayer);
+
+    /**
+     * Handle RT player error event.
+     */
+    void HandleRtAudioError(TInt aEvent, TInt aError, TInt aPlayer);
+
+    /**
+     * Handle RT player initialize complete event.
+     */
+    virtual void HandleRtAudioInitComplete(TInt aEvent, TInt aError,
+            TInt aPlayer);
+
+    /**
+     * Handle RT play complete event.
+     */
+    virtual void HandleRtAudioPlayComplete(TInt aEvent, TInt aError,
+            TInt aPlayer);
+
+    /**
+     * @see TMSTimerObsrv
+     */
+    virtual void HandleTimeOutL();
+
+    /**
+     * Enumerates how many times TTS has played
+     * ESaidOnce
+     * ESaidTwice
+     */
+    enum TTtsStatus
+        {
+        ESaidOnce,
+        ESaidTwice
+        };
+
+    /**
+     * C++ default constructor.
+     */
+    TMSRingTonePlayer(TMSRtPlayerObsrv& aObserver);
+
+    /**
+     * Default Symbian OS constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Play backup tone.
+     */
+    void PlayBackupToneL();
+
+    /**
+     * Handle audio player error.
+     * @param aDelete ETrue if deletion of the player allowed.
+     * @param aSync ETrue if synchronous deletion of players is allowed.
+     */
+    void DoHandlePlayerError(TBool aDelete, TBool aSync);
+
+    /**
+     * Convert ringing type from TProfileRingingType to local type.
+     * @param aRingingType ringing type form PhoneAppEngine.
+     * @return local ringing type mapping.
+     */
+    TMSRtAudioHdlr::TRingingType ConvertRingingType(
+            TProfileRingingType aRingingType);
+
+    /**
+     * Construct default ring tone container
+     */
+    void CreateDefaultRingToneL();
+
+    /**
+     * Load ring tone settings from curent Profile
+     */
+    void LoadActiveProfileSettingsL();
+
+    /**
+     * Load ring tone settings from curent Profile
+     */
+    void LoadProfileRingToneL();
+
+    /**
+     * Sets TTS volume ramp and schedules next TTS playback
+     */
+    void ResumeTTS();
+
+    /**
+     * Construct backup tone player.
+     */
+    void CreateBkpRtPlayerL();
+
+    /**
+     * Delete all players.
+     */
+    void RemovePlayers();
+
+    /**
+     * Delete single player based on index.
+     */
+    void DeletePlayer();
+
+    /**
+     * Deletes player asynchronoysly.
+     * @param aPlayer player to be deleted.
+     */
+    void DeletePlayerAsync(TRtPlayerType aPlayer);
+
+    /**
+     * Wrapper of DoHandleTtsDelayTimeout, that can be used as TCallback.
+     * Immediately passes control to DoHandleTtsDelayTimeout method.
+     * @param object Object to call DoHandleTtsDelayTimeout() on.
+     * @return status.
+     */
+    static TInt HandleTtsDelayTimeout(TAny* object);
+
+    /**
+     * It is called after TTS delay elapsed. Starts playing TTS.
+     */
+    void DoHandleTtsDelayTimeout();
+
+    /**
+     * Returns currently active player which is used with TTS player.
+     * @return pointer to active player.
+     */
+    TMSRtAudioHdlr* GetCurrentlyActiveAudioPlayerWithTTS();
+
+    /**
+     * Calculates new volume and ramptimes for Ascending TTS and normal TTS
+     * ringing.
+     * @param aStatus - TTS player status.
+     */
+    void SolveNewVolumeAndRamptime(TTtsStatus aStatus);
+
+    /**
+     * Restarts currently active ringingtone player.
+     */
+    void ReStartRingTonePlayer();
+
+    /**
+     * Checks if ring tone file size is within allowed limit. If size limit
+     * is exceeded, default tone is played instead.
+     * @param aRingingTone RT file to be checked.
+     * @return EFalse if the limit was exceeded.
+     *         ETrue  if tone file's size was valid.
+     */
+    TBool CheckAndHandleToneSizeLimit(TMSRtContainer* aRingingTone);
+
+    /**
+     * Checks if ring tone file size is larger than the allowed limit.
+     * @param aFile   File to check.
+     *        aSizeLimitKB  the size limit in kB.
+     * @return KErrNone          if the file can be used as a ring tone.
+     *         KErrTooBig        if the file size limit is exceeded.
+     *         Other error value if error happened during size checking.
+     */
+    TInt CheckToneFileSize(const TDesC& aFile, TInt aSizeLimitKB);
+
+    /**
+     * Reads from central repository the file size limit of following tones:
+     * - contact's personal ringing tone
+     * - voice call line1
+     * - voice call line2
+     * Value 0 means all sizes are allowed.
+     * @param aSizeLimitKB  the size limit in kB is read to this variable.
+     * @return leaves on error.
+     */
+    void GetMaxToneFileSizeL(TInt& aSizeLimitKB) const;
+
+    /**
+     * Returns currently active audio player.
+     * @return Currently active audio player or NULL if none is active.
+     */
+    TMSRtAudioHdlr* ActiveAudioPlayer();
+
+private:
+
+    TMSRtAudioHdlr* iAudioPlayer;
+    TMSRtAudioHdlr* iBeepOncePlayer;
+    TMSRtAudioHdlr* iSilentPlayer;
+    TMSRtAudioHdlr* iUnsecureVoIPTonePlayer;
+    TMSRtAudioHdlr* iDefaultPlayer;
+    TMSRtAudioHdlr* iSequencePlayer;
+    TMSRtAudioHdlr* iTtsPlayer;
+    TMSRtAudioHdlr* iBackupPlayer;
+
+    // Indicate which tone is playing
+    enum TTonePlayingStatus
+        {
+        EIdle,
+        EAudioTonePlaying,
+        EBeepOnce,
+        ESilentTonePlaying,
+        EUnsecureVoIPTonePlaying,
+        EDefaultTonePlaying,
+        EBackupTonePlaying,
+        EVideoTonePlaying,
+        ESilentVideoTonePlaying,
+        ESequenceTonePlaying,
+        EPersonalVideoTonePlaying
+        };
+
+    // Current playing status.
+    TTonePlayingStatus iTonePlayingStatus;
+
+    // True if TTS is currently playing. Different from iTonePlayingStatus,
+    // because TTS is played in parallel with the other tone types.
+    TBool iTtsTonePlaying;
+
+    // Zero -based index of the TTS delay that is "executed" currently,
+    // or to be "executed" after the current playing of the TTS tone.
+    TInt iTtsDelayIndex;
+
+    // True if TTS tone should be played when the next playing of the
+    // default or personal tone is fired.
+    TBool iTtsToneToBePlayed;
+
+    // Audio/Video RT file container
+    TMSRtContainer* iRtContainer;
+
+    // Volume of the TTS
+    TInt iTtsVolume;
+
+    // RT player type
+    TInt iRtType;
+
+    //
+    TMSRtPlayerObsrv& iRtObserver;
+    TMSAsyncReqAO* iAsyncReqAO;
+    TMSRtParam iRtParam;
+
+    // 3 sec timer that fires up fallback logic.
+    TMSTimer* iTimer;
+
+    // Timer that tracks delays before playing TTS.
+    TMSTimer* iTtsDelayTimer;
+
+    // Number of times TTS tone should be played for the current ringtone.
+    // If ringing tone is to be played just once, iTtsDelayCount == 1,
+    // otherwise iTtsDelayCount == KTtsDelayCount.
+    TInt iTtsDelaysCount;
+
+    // Array of players to be deleted asynchronously.
+    RPointerArray<TMSRtAudioHdlr> iAsyncDeletePlayers;
+
+    // DRM extend security flag.
+    TBool iExtSecNeeded;
+
+    // Async delete request is active.
+    TBool iAsyncReq;
+
+    // Ringing Type of TTS Player.
+    TProfileRingingType iTtsRingingType;
+
+    // Counter for TTS timeouts.
+    TInt iTTsTimeOutCounter;
+
+    // Voice call RT file size max.
+    TInt iToneFileSizeLimitKB;
+
+    MProEngEngine* iEngine;
+    MProEngProfile* iProfile;
+    };
+
+} //namespace TMS
+
+#endif // TMSRINGTONEPLAYER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsrtplayerobsrv.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,58 @@
+/*
+ * 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:  Observer interface for ringing tone playing.
+ *
+ */
+
+#ifndef TMSRTPLAYEROBSRV_H
+#define TMSRTPLAYEROBSRV_H
+
+// INCLUDES
+#include <e32base.h>
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSRtPlayer;
+
+// CLASS DECLARATION
+
+/**
+ *  Observer interface for TMSRingTonePlayer
+ */
+class TMSRtPlayerObsrv
+    {
+public:
+    /**
+     * This method is called when TMSRingTone event occurs.
+     *
+     * Notified events:
+     *  ECmdRingToneOpenComplete
+     *  ECmdRingTonePlayComplete
+     *
+     * @param  aEventType
+     *      Event descriptor.
+     *
+     * @param  aError
+     *      Operation status.
+     *
+     */
+    virtual void RtPlayerEvent(TInt aEventType, TInt aError) = 0;
+    };
+
+} //namespace TMS
+
+#endif // TMSRTPLAYEROBSRV_H
+
+// End of File
--- a/mmserv/tms/tmsserver/inc/tmsserver.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsserver/inc/tmsserver.h	Fri Apr 16 15:29:42 2010 +0300
@@ -23,23 +23,27 @@
 #include <tms.h>
 #include "tmsshared.h"
 #include "tmsclientserver.h"
+#include "tmsrtplayerobsrv.h"
+#include "tmsrtplayer.h"
 
 namespace TMS {
 
 // FORWARD DECLARATIONS
 class TMSServerShutDown;
-class CStartAndMonitorTMSCallThread;
+class TMSStartAndMonitorTMSCallThread;
 class TMSCallProxyLocal;
-class GlobalEffectsSettings;
-class CTarEventHandler;
-class CSPCenRepListener;
-class CSPAudioHandler;
+class TMSGlobalEffectsSettings;
+class TMSTarEventHandler;
+class TMSCSPCenRepListener;
+class TMSCenRepAudioHandler;
+class TMSDtmfEventHandler;
 
 // -----------------------------------------------------------------------------
 // TMSServer class
 // -----------------------------------------------------------------------------
 //
-class TMSServer : public CServer2
+class TMSServer : public CServer2,
+                  private TMSRtPlayerObsrv
     {
 public:
     static TMSServer* NewL();
@@ -47,10 +51,10 @@
 
     void AddSession();
     void DropSession();
-    TInt SessionCount();
+    TInt SessionCount() const;
 
-    void SetDnLinkSession(TBool aSession);
-    void SetUpLinkSession(TBool aSession);
+    void SetDnLinkSession(const TBool aSession);
+    void SetUpLinkSession(const TBool aSession);
 
     TBool HasDnLinkSession() const;
     TBool HasUpLinkSession() const;
@@ -72,12 +76,36 @@
             RArray<TFourCC>*& aCodecs);
 
     TInt NotifyTarClients(TRoutingMsgBufPckg routingpckg);
+    TInt StartDTMF(const RMessage2& aMessage);
+    TInt StopDTMF(const RMessage2& aMessage);
+    TInt ContinueSendingDTMF(const RMessage2& aMessage);
+    TInt NotifyDtmfClients(TmsMsgBufPckg dtmfpckg);
 
+    void StartDTMFNotifierL();
+    void CancelDTMFNotifier();
     void StartRoutingNotifierL();
     void CancelRoutingNotifier();
     void StartCenRepHandlerL();
     void CancelCenRepHandler();
 
+    // for RingTone player
+    void InitRingTonePlayerL();
+    void OpenRingTonePlayerFromProfileL(const RMessage2& aMessage);
+    void OpenRingTonePlayerFromFileL(const RMessage2& aMessage);
+    void OpenRingToneTTSPlayerL(const RMessage2& aMessage);
+    void OpenRingToneSequencePlayerL(const RMessage2& aMessage);
+    void OpenRingToneBeepOnceL();
+    void OpenRingToneSilentL();
+    void OpenRingToneUnsecureVoipL();
+    void DeinitRingTonePlayer();
+    void PlayRingToneL();
+    void PauseVideoRingTone();
+    void StopRingTone();
+    void MuteRingTone();
+
+    // from TMSRtPlayerObsrv
+    void RtPlayerEvent(TInt aEventType, TInt aError);
+
 private:
     TMSServer();
     void ConstructL();
@@ -96,18 +124,29 @@
     TBool iDnlinkSession;
     TBool iUplinkSession;
 
-    mutable RPointerArray<CStartAndMonitorTMSCallThread> iTMSCallServList;
-    GlobalEffectsSettings* iEffectSettings;
-    CTarEventHandler* iTarHandler;
-    CSPAudioHandler* iAudioCenRepHandler;
+    mutable RPointerArray<TMSStartAndMonitorTMSCallThread> iTMSCallServList;
+    TMSGlobalEffectsSettings* iEffectSettings;
+    TMSTarEventHandler* iTarHandler;
+    TMSCenRepAudioHandler* iAudioCenRepHandler;
     TMSAudioOutput iCurrentRouting;
+    TMSDtmfEventHandler* iDTMFHandler;
+    TInt iTarHandlerCount;
+    TInt iAudioCenRepHandlerCount;
+    TInt iDTMFHandlerCount;
 
+    // for RT
+    TMSRingTonePlayer* iTMSRtPlayer;
+    HBufC* iRtFile;
+    HBufC8* iRtSequence;
+    HBufC* iTtsText;
+
+    // for codecs count
     RArray<TFourCC> iDnlCodecs;
     RArray<TFourCC> iUplCodecs;
     };
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread class
+// TMSStartAndMonitorTMSCallThread class
 // -----------------------------------------------------------------------------
 //
 class TMSCallProxyLocal : public RSessionBase
@@ -121,19 +160,19 @@
     };
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread class
+// TMSStartAndMonitorTMSCallThread class
 // -----------------------------------------------------------------------------
 //
-class CStartAndMonitorTMSCallThread : public CActive
+class TMSStartAndMonitorTMSCallThread : public CActive
     {
 public:
-    static CStartAndMonitorTMSCallThread* NewL(TMSServer* aServer);
-    ~CStartAndMonitorTMSCallThread();
+    static TMSStartAndMonitorTMSCallThread* NewL(TMSServer* aServer);
+    ~TMSStartAndMonitorTMSCallThread();
     TInt StartTMSCallServer(TMSCallProxyLocal& aHandle);
 
 private:
     // Construct
-    CStartAndMonitorTMSCallThread(TMSServer* aServer);
+    TMSStartAndMonitorTMSCallThread(TMSServer* aServer);
     void ConstructL();
 
     // From CActive
--- a/mmserv/tms/tmsserver/inc/tmsserversession.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsserver/inc/tmsserversession.h	Fri Apr 16 15:29:42 2010 +0300
@@ -28,6 +28,8 @@
 
 // FORWARD DECLARATIONS
 class TMSServerThread;
+class TMSAudioInbandTonePlayer;
+class TMSRingTonePlayer;
 
 // -----------------------------------------------------------------------------
 //  Class Name:  TMSServerSession
@@ -37,7 +39,6 @@
 class TMSServerSession : public CSession2
     {
 public:
-
     // Constractor
     static TMSServerSession* NewL(TMSServer &aServer);
 
@@ -47,8 +48,10 @@
     void HandleGlobalEffectChange(TInt globalevent);
     void HandleRoutingChange(TRoutingMsgBufPckg routinginfo);
 
+    // Send notifications to clients
+    void NotifyClient(const TInt aCommand, const TInt aStatus = KErrNone);
+
 private:
-
     // Symbian constructors
     void ConstructL();
     TMSServerSession(TMSServer& aServer);
@@ -64,8 +67,9 @@
     void SetVolLevel(const RMessage2& aMessage);
     void SetMicGain(const RMessage2& aMessage);
 
-    // Send notification to the client
-    void NotifyClient();
+    // for Inband tone player
+    void StartInbandTone(const RMessage2& aMessage);
+    void StopInbandTone(const RMessage2& aMessage);
 
 private:
     TMSServer& iServer;
@@ -75,6 +79,8 @@
     TBool iMsgQueued;
     RMsgQueue<TmsMsgBuf> iMsgQueue;
     TmsMsgBuf iMsgBuffer;
+    TMSAudioInbandTonePlayer* iInbandTonePlayer;
+    TBool iHasRtPlayer;
     };
 
 } //namespace TMS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmstareventhandler.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,77 @@
+/*
+ * 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 TMSTAREVENTHANDLER_H
+#define TMSTAREVENTHANDLER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32property.h>
+#include "tmsserver.h"
+
+namespace TMS {
+
+// CLASS DECLARATION
+class TMSTarEventHandler : public CActive
+    {
+public:
+    /**
+     * Two-phased constructor.
+     */
+    static TMSTarEventHandler* NewL(TMSServer* aServer);
+
+    /**
+     * Destructor.
+     */
+    virtual ~TMSTarEventHandler();
+
+private:
+    /**
+     * From CActive
+     * Cancel outstanding request
+     */
+    void DoCancel();
+
+    /**
+     * From CActive
+     * Implementation of CActive::RunL.
+     * Called when server request has completed.
+     **/
+    void RunL();
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    TMSTarEventHandler(TMSServer* aServer);
+
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     */
+    void ConstructL();
+
+private:
+    TMSServer* iTMSSer;
+    RProperty iProperty;
+    };
+
+} //namespace TMS
+
+#endif //TMSTAREVENTHANDLER_H
+
+// End of File
--- a/mmserv/tms/tmsserver/inc/tmstelephonycenrep.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsserver/inc/tmstelephonycenrep.h	Fri Apr 16 15:29:42 2010 +0300
@@ -18,6 +18,6 @@
 #ifndef TMS_TELEPHONY_CENREP_H
 #define TMS_TELEPHONY_CENREP_H
 
-//#define _USE_TELEPHONY_CENREP_
+#define _USE_TELEPHONY_CENREP_ 1
 
 #endif //TMS_TELEPHONY_CENREP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmstimer.h	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,134 @@
+/*
+ * 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:
+ *    Utility class for CTimer object
+ *
+ */
+
+#ifndef TMSTIMER_H
+#define TMSTIMER_H
+
+//  INCLUDES
+#include <e32base.h>
+
+namespace TMS {
+
+/**
+*  Mixin class for phone timer
+*/
+class TMSTimerObsrv
+    {
+
+    public: // New functions
+
+        /**
+        * Destructor
+        */
+        virtual ~TMSTimerObsrv(){};
+
+        /**
+        * This function is called after on timeout
+        */
+        virtual void HandleTimeOutL() = 0;
+    };
+
+// CLASS DECLARATION
+
+/**
+ *  Utility class for timer
+ */
+class TMSTimer : public CTimer
+    {
+public:
+    // Constructors and destructor
+
+    /**
+     * Two-phased constructor.
+     */
+    IMPORT_C static TMSTimer* NewL(
+            TInt aPriority = CActive::EPriorityStandard);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~TMSTimer();
+
+public:
+    // New functions
+
+    /**
+     * The Callback function is called after the interval
+     * All former request will be canceled first
+     */
+    IMPORT_C void After(TTimeIntervalMicroSeconds32 anInterval,
+            TCallBack aCallBack);
+
+    /**
+     * Use the maxin class to notify the timer
+     * All former request will be canceled first
+     */
+    IMPORT_C void After(TTimeIntervalMicroSeconds32 anInterval,
+            TMSTimerObsrv* aObserver);
+
+    /**
+     * Cancel the timer if needed
+     */
+    IMPORT_C void CancelTimer();
+
+protected:
+    // Functions from base classes
+
+    /**
+     * From CTimer::RunL()
+     */
+    virtual void RunL();
+
+    /**
+     * From CTimer::DoCancel()
+     */
+    virtual void DoCancel();
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    TMSTimer(TInt aPriority);
+
+    /**
+     * By default Symbian OS constructor is private.
+     */
+    void ConstructL();
+
+    // By default, prohibit copy constructor
+    TMSTimer(const TMSTimer&);
+
+    // Prohibit assigment operator
+    TMSTimer& operator = (const TMSTimer&);
+
+private:
+    // Data
+
+    // Used by After( anInterval, aCallBack )
+    TCallBack iCallBack;
+
+    // Used by After( anInterval, aObserver )
+    TMSTimerObsrv* iTimerObserver;
+    };
+
+} // namespace TMS
+
+#endif // TMSTIMER_H
+
+// End of File
--- a/mmserv/tms/tmsserver/src/cspaudiohandler.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +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:  Implements the class CSPAudioHandler
- *
- */
-
-#include <e32base.h>
-#include "tmstelephonycenrep.h"
-
-#ifdef _USE_TELEPHONY_CENREP_
-#include <telmicmutestatuspskeys.h>
-#include <telincallvolcntrlcrkeys.h>
-#else
-const TUid KCRUidInCallVolume = {0x102828B1};
-const TUint32 KTelIncallEarVolume  = 0x00000001;
-const TUint32 KTelIncallLoudspeakerVolume  = 0x00000002;
-#endif
-
-#include "cspaudiohandler.h"
-#include "cspcenreplistener.h"
-#include "tmsutility.h"
-
-using namespace TMS;
-// ---------------------------------------------------------------------------
-// CSPAudioHandler::NewL.
-// ---------------------------------------------------------------------------
-//
-CSPAudioHandler* CSPAudioHandler::NewL(TMSServer* aServer)
-    {
-    TRACE_PRN_FN_ENT;
-    CSPAudioHandler* self = new (ELeave) CSPAudioHandler(aServer);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    TRACE_PRN_FN_EXT;
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Destructs the object by canceling first ongoing monitoring.
-// ---------------------------------------------------------------------------
-//
-CSPAudioHandler::~CSPAudioHandler()
-    {
-    TRACE_PRN_FN_ENT;
-    delete iIncallLoudspeakerVolumeListener;
-    delete iIncallEarVolumeListener;
-    TRACE_PRN_FN_EXT;
-    }
-
-// ---------------------------------------------------------------------------
-// CSPAudioHandler::SetLoudSpeakerVol
-// ---------------------------------------------------------------------------
-//
-void CSPAudioHandler::SetLoudSpeakerVol(TInt vol)
-    {
-    if (iIncallLoudspeakerVolumeListener)
-        {
-        iIncallLoudspeakerVolumeListener->Set(vol);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CSPAudioHandler::SetEarPieceVol
-// ---------------------------------------------------------------------------
-//
-void CSPAudioHandler::SetEarPieceVol(TInt vol)
-    {
-    if (iIncallEarVolumeListener)
-        {
-        iIncallEarVolumeListener->Set(vol);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// From MCSPCenRepObserver
-// CSPAudioHandler::HandleNotifyCenRepL
-// ---------------------------------------------------------------------------
-//
-void CSPAudioHandler::HandleNotifyCenRepL(const TUid /*aUid*/,
-        const TUint32 aKey, TInt aVal)
-    {
-    TRACE_PRN_FN_ENT;
-    if (aKey == KTelIncallLoudspeakerVolume)
-        {
-        iTMSSer->SetLevel(NULL,FALSE, aVal);
-        }
-    else if (aKey == KTelIncallEarVolume)
-        {
-        iTMSSer->SetLevel(NULL,FALSE, aVal);
-        }
-    TRACE_PRN_FN_EXT;
-    }
-
-// ---------------------------------------------------------------------------
-// Constructs the monitor.
-// ---------------------------------------------------------------------------
-//
-CSPAudioHandler::CSPAudioHandler(TMSServer* aServer) :
-    iTMSSer(aServer)
-    {
-    TRACE_PRN_FN_ENT;
-    iCallCount = 0; // Active calls count
-    TRACE_PRN_FN_EXT;
-    }
-
-// ---------------------------------------------------------------------------
-// Second phase construction.
-// ---------------------------------------------------------------------------
-//
-void CSPAudioHandler::ConstructL()
-    {
-    TRACE_PRN_FN_ENT;
-
-    iIncallLoudspeakerVolumeListener = CSPCenRepListener::NewL(
-            KCRUidInCallVolume, KTelIncallLoudspeakerVolume, this);
-
-    iIncallEarVolumeListener = CSPCenRepListener::NewL(KCRUidInCallVolume,
-            KTelIncallEarVolume, this);
-
-    // Initialize audio volumes
-    TInt volEar;
-    TInt volLoud;
-
-    TInt volGetRes = iIncallEarVolumeListener->Get(volEar);
-    volGetRes = iIncallLoudspeakerVolumeListener->Get(volLoud);
-
-    TRACE_PRN_FN_EXT;
-    }
-
-// End of file
--- a/mmserv/tms/tmsserver/src/cspcenreplistener.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ /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:  Central Repository listening
- *
- */
-
-// INCLUDE FILES
-#include "cspcenreplistener.h"
-#include "mcspcenrepobserver.h"
-#include "tmsutility.h"
-
-using namespace TMS;
-
-// -----------------------------------------------------------------------------
-// CSPCenRepListener::CSPCenRepListener
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CSPCenRepListener* CSPCenRepListener::NewL(TUid aUid,
-        TUint32 aMonitorSetting, MCSPCenRepObserver* aObserver)
-    {
-    TRACE_PRN_FN_ENT;
-    CSPCenRepListener* self = new (ELeave) CSPCenRepListener(aUid,
-            aMonitorSetting, aObserver);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    TRACE_PRN_FN_EXT;
-    return self;
-    }
-
-// Destructor
-CSPCenRepListener::~CSPCenRepListener()
-    {
-    TRACE_PRN_FN_ENT;
-    Cancel();
-    delete iRepository;
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSPCenRepListener::Get
-// -----------------------------------------------------------------------------
-//
-TInt CSPCenRepListener::Get(TInt& aValue)
-    {
-    TRACE_PRN_FN_ENT;
-    TRACE_PRN_FN_EXT;
-    return (iRepository->Get(iMonitorSetting, aValue));
-
-    }
-
-// -----------------------------------------------------------------------------
-// CSPCenRepListener::Set
-// -----------------------------------------------------------------------------
-//
-TInt CSPCenRepListener::Set(TInt aValue)
-    {
-    TRACE_PRN_FN_ENT;
-    TRACE_PRN_FN_EXT;
-    return (iRepository->Set(iMonitorSetting, aValue));
-
-    }
-// -----------------------------------------------------------------------------
-// CSPCenRepListener::DoCancel
-// -----------------------------------------------------------------------------
-//
-void CSPCenRepListener::DoCancel()
-    {
-    TRACE_PRN_FN_ENT;
-    iRepository->NotifyCancel(iMonitorSetting);
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSPCenRepListener::RunError
-// -----------------------------------------------------------------------------
-//
-TInt CSPCenRepListener::RunError(
-#ifdef _DEBUG
-        TInt aError // Log the leavecode from RunL
-#else
-        TInt /*aError*/
-#endif
-        )
-    {
-    TRACE_PRN_FN_ENT;
-#ifdef _DEBUG
-    TRACE_PRN_IF_ERR(aError);
-#endif
-    TRACE_PRN_FN_EXT;
-    return ( KErrNone );
-    }
-
-// -----------------------------------------------------------------------------
-// CSPCenRepListener::RunL
-// -----------------------------------------------------------------------------
-//
-void CSPCenRepListener::RunL()
-    {
-    TRACE_PRN_FN_ENT;
-    // Don't resubmit the request on error
-    // Central repositry completes notifications with id of setting
-    // so check only that value of iStatus is negative
-    User::LeaveIfError(iStatus.Int() < KErrNone);
-    SubmitNotifyRequestL();
-
-    TInt volume;
-    // The loudspeaker volume has changed in repository.
-    // Retrieve the current volume from repository.
-    User::LeaveIfError(Get(volume));
-
-    iObserver->HandleNotifyCenRepL(iUid, iMonitorSetting, volume);
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSPCenRepListener::CSPCenRepListener
-// -----------------------------------------------------------------------------
-//
-CSPCenRepListener::CSPCenRepListener(TUid aUid, TUint32 aMonitorSetting,
-        MCSPCenRepObserver* aObserver) :
-    CActive(EPriorityStandard),
-    iUid(aUid),
-    iMonitorSetting(aMonitorSetting),
-    iObserver(aObserver)
-    {
-    TRACE_PRN_FN_ENT;
-    CActiveScheduler::Add(this);
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSPCenRepListener::ConstructL
-// -----------------------------------------------------------------------------
-//
-void CSPCenRepListener::ConstructL()
-    {
-    TRACE_PRN_FN_ENT;
-    // Create repository instance
-    iRepository = CRepository::NewL(iUid);
-    // Start monitoring
-    SubmitNotifyRequestL();
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSPCenRepListener::SubmitNotifyRequestL
-// -----------------------------------------------------------------------------
-//
-void CSPCenRepListener::SubmitNotifyRequestL()
-    {
-    TRACE_PRN_FN_ENT;
-    iRepository->NotifyRequest(iMonitorSetting, iStatus);
-    SetActive();
-    TRACE_PRN_FN_EXT;
-    }
-
-// End of file
--- a/mmserv/tms/tmsserver/src/globaleffectssettings.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +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 "globaleffectssettings.h"
-#include "tmsclientserver.h"
-
-using namespace TMS;
-// CONSTANTS
-const TInt KDefaultVolume = 4;
-const TInt KDefaultMaxVolume = 10;
-const TInt KDefaultGain = 1;
-const TInt KDefaultMaxGain = 64;
-
-TUid KCRUidTmseffects = {0x10207C80};
-const TUint32 KTmsEarPieceVolume = 0x00000001;
-const TUint32 KTmsLoudSpkrVolume = 0x00000002;
-
-// -----------------------------------------------------------------------------
-// GlobalEffectsSettings::GlobalEffectsSettings
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-GlobalEffectsSettings::GlobalEffectsSettings() :
-    iGain(KDefaultGain),
-    iMaxVolume(KDefaultMaxVolume),
-    iMaxGain(KDefaultMaxGain),
-    iEarVolume(KDefaultVolume),
-    iLoudSpkrVolume(KDefaultVolume)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// GlobalEffectsSettings::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void GlobalEffectsSettings::ConstructL()
-    {
-    // Create repository instance
-    iRepository = CRepository::NewL(KCRUidTmseffects);
-    if (iRepository)
-        {
-        iRepository->Get(KTmsLoudSpkrVolume, iLoudSpkrVolume);
-        iRepository->Get(KTmsEarPieceVolume, iEarVolume);
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// GlobalEffectsSettings::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-GlobalEffectsSettings* GlobalEffectsSettings::NewL()
-    {
-    GlobalEffectsSettings* self = new (ELeave) GlobalEffectsSettings();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// Destructor
-GlobalEffectsSettings::~GlobalEffectsSettings()
-    {
-    delete iRepository;
-    }
-
-// -----------------------------------------------------------------------------
-// GlobalEffectsSettings::SetLoudSpkrVolume
-// -----------------------------------------------------------------------------
-//
-void GlobalEffectsSettings::SetLoudSpkrVolume(TInt aVolume)
-    {
-    TInt status(KErrNone);
-    if (iRepository)
-        {
-        status = iRepository->Set(KTmsLoudSpkrVolume, aVolume);
-        if (status == KErrNone)
-            {
-            iLoudSpkrVolume = aVolume;
-            }
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// GlobalEffectsSettings::SetEarPieceVolume
-// -----------------------------------------------------------------------------
-//
-void GlobalEffectsSettings::SetEarPieceVolume(TInt aVolume)
-    {
-    TInt status(KErrNone);
-    if (iRepository)
-        {
-        status = iRepository->Set(KTmsEarPieceVolume, aVolume);
-        if (status == KErrNone)
-            {
-            iEarVolume = aVolume;
-            }
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// GlobalEffectsSettings::GetLoudSpkrVolume
-// -----------------------------------------------------------------------------
-//
-void GlobalEffectsSettings::GetLoudSpkrVolume(TInt& aVolume)
-    {
-    aVolume = iLoudSpkrVolume;
-    }
-
-// -----------------------------------------------------------------------------
-// GlobalEffectsSettings::GetEarPieceVolume
-// -----------------------------------------------------------------------------
-//
-void GlobalEffectsSettings::GetEarPieceVolume(TInt& aVolume)
-    {
-    aVolume = iEarVolume;
-    }
-
-// -----------------------------------------------------------------------------
-// GlobalEffectsSettings::MaxVolume
-// -----------------------------------------------------------------------------
-//
-TInt GlobalEffectsSettings::MaxVolume() const
-    {
-    return iMaxVolume;
-    }
-
-// -----------------------------------------------------------------------------
-// GlobalEffectsSettings::SetGain
-// -----------------------------------------------------------------------------
-//
-void GlobalEffectsSettings::SetGain(TInt aGain)
-    {
-    iGain = aGain;
-    }
-
-// -----------------------------------------------------------------------------
-// GlobalEffectsSettings::Gain
-// -----------------------------------------------------------------------------
-//
-TInt GlobalEffectsSettings::Gain() const
-    {
-    return iGain;
-    }
-
-// -----------------------------------------------------------------------------
-// GlobalEffectsSettings::MaxGain
-// -----------------------------------------------------------------------------
-//
-TInt GlobalEffectsSettings::MaxGain() const
-    {
-    return iMaxGain;
-    }
-
-//  End of File
--- a/mmserv/tms/tmsserver/src/tareventhandler.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +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 "tareventhandler.h"
-#include "tmsclientserver.h"
-#include "tmsutility.h"
-
-using namespace TMS;
-
-// -----------------------------------------------------------------------------
-// CTarEventHandler::CTarEventHandler
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CTarEventHandler::CTarEventHandler(TMSServer* aServer) :
-    CActive(EPriorityStandard),
-    iTMSSer(aServer)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CTarEventHandler::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CTarEventHandler::ConstructL()
-    {
-    TRACE_PRN_FN_ENT;
-    CActiveScheduler::Add(this);
-    User::LeaveIfError(iProperty.Attach(KTMSPropertyCategory, ERoutingPs));
-    iProperty.Subscribe(iStatus);
-    SetActive();
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// CTarEventHandler::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CTarEventHandler* CTarEventHandler::NewL(TMSServer* aServer)
-    {
-    CTarEventHandler* self = new (ELeave) CTarEventHandler(aServer);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// Destructor
-CTarEventHandler::~CTarEventHandler()
-    {
-    TRACE_PRN_FN_ENT;
-    if (IsActive())
-        {
-        Cancel();
-        }
-    iProperty.Close();
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// CTarEventHandler::DoCancel
-// -----------------------------------------------------------------------------
-//
-void CTarEventHandler::DoCancel()
-    {
-    TRACE_PRN_FN_ENT;
-    iProperty.Cancel();
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// CTarEventHandler::RunL
-// -----------------------------------------------------------------------------
-//
-void CTarEventHandler::RunL()
-    {
-    TRACE_PRN_FN_ENT;
-    // Subscribe immediately before analyzing the notification to ensure that we
-    // don't miss further updates.
-    if (iStatus.Int() == KErrNone)
-        {
-        iProperty.Subscribe(iStatus);
-        SetActive();
-        TRoutingMsgBufPckg routingpckg;
-        iProperty.Get(routingpckg);
-        iTMSSer->NotifyTarClients(routingpckg);
-        }
-    TRACE_PRN_FN_EXT;
-    }
-
-//  End of File
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmsasyncreqao.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,90 @@
+/*
+ * 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 "tmsasyncreqao.h"
+
+using namespace TMS;
+
+// -----------------------------------------------------------------------------
+// TMSAsyncReqAO::TMSAsyncReqAO
+// -----------------------------------------------------------------------------
+//
+TMSAsyncReqAO::TMSAsyncReqAO(TMSAsyncReqObsrv* aObserver) :
+    CActive(CActive::EPriorityStandard),
+    iObserver(aObserver)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAsyncReqAO::NewL
+// -----------------------------------------------------------------------------
+//
+TMSAsyncReqAO* TMSAsyncReqAO::NewL(TMSAsyncReqObsrv* aObserver)
+    {
+    return new (ELeave) TMSAsyncReqAO(aObserver);
+    }
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+//
+TMSAsyncReqAO::~TMSAsyncReqAO()
+    {
+    Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAsyncReqAO::Start
+// -----------------------------------------------------------------------------
+//
+void TMSAsyncReqAO::Start()
+    {
+    SetActive();
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete(status, KErrNone);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAsyncReqAO::DoCancel
+// -----------------------------------------------------------------------------
+//
+void TMSAsyncReqAO::DoCancel()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAsyncReqAO::RunError
+// -----------------------------------------------------------------------------
+//
+TInt TMSAsyncReqAO::RunError(TInt aError)
+    {
+    iObserver->HandleError(aError);
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAsyncReqAO::RunL
+// -----------------------------------------------------------------------------
+//
+void TMSAsyncReqAO::RunL()
+    {
+    iObserver->HandleAsyncReq();
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmsaudioinbandtoneplayer.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,545 @@
+/*
+ * 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 <tms.h>
+#include <AudioPreference.h>
+#include <barsc.h>
+#include <barsread.h>
+#include <data_caging_path_literals.hrh>
+#include <defaultbeep.rsg>
+#include "tmsutility.h"
+#include "tmsaudioinbandtoneplayer.h"
+#include "tmsaudiotoneutilityimpl.h"
+
+using namespace TMS;
+
+// CONSTANTS
+const TInt KPhoneInbandVolumeMax = 10;
+const TInt KPhoneInbandVolumeMin = 0;
+const TInt KPhoneInbandToneZero = 0;
+
+// Resourcefile destination.
+_LIT( KSystemDefaultbeepRscDrive, "Z:" );
+_LIT( KSystemDefaultbeepRscFile, "DEFAULTBEEP.rSC" );
+
+// -----------------------------------------------------------------------------
+// TMSAudioInbandTonePlayer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+TMSAudioInbandTonePlayer* TMSAudioInbandTonePlayer::NewL()
+    {
+    TMSAudioInbandTonePlayer* self =
+            new (ELeave) TMSAudioInbandTonePlayer();
+    CleanupStack::PushL(self);
+    self->ConstructL( /*aAudioFactory*/);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+//Destructor
+TMSAudioInbandTonePlayer::~TMSAudioInbandTonePlayer()
+    {
+    TRACE_PRN_FN_ENT;
+    iFsSession.Close();
+    delete iPlayBeepSequence;
+    delete iPlayNoSoundSequence;
+    delete iPlayDataSequence;
+    delete iResourceCallWaitingSeq;
+    delete iResourceRingGoingSeq;
+    delete iResourceRadioPathSeq;
+    delete iResourceSpecialSeq;
+    delete iResourceCongestionSeq;
+    delete iResourceReorderSeq;
+    delete iResourceBusySeq;
+    delete iCurrent;
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAudioInbandTonePlayer::TMSAudioInbandTonePlayer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+TMSAudioInbandTonePlayer::TMSAudioInbandTonePlayer()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAudioInbandTonePlayer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void TMSAudioInbandTonePlayer::ConstructL()
+    {
+    // iCurrent = aFactory.CreateAudioToneUtilityL( *this );
+    TRACE_PRN_FN_ENT;
+    iCurrent = TMSAudioToneUtilityImpl::NewL(*this);
+
+    //Get the inband tone sequences from resource and and store to member
+    //variables
+    RResourceFile resourceFile;
+
+    TFileName fileName(KSystemDefaultbeepRscDrive);
+    fileName.Append(KDC_RESOURCE_FILES_DIR);
+    fileName.Append(KSystemDefaultbeepRscFile);
+
+    iFsSession.Connect();
+    resourceFile.OpenL(iFsSession, fileName);
+    CleanupClosePushL(resourceFile);
+
+    HBufC8* resourceBusy = resourceFile.AllocReadL(R_NET_BUSY);
+    HBufC8* resourceReorder = resourceFile.AllocReadL(R_NET_REORDER);
+    HBufC8* resourceCongestion = resourceFile.AllocReadL(R_NET_CONGESTION);
+    HBufC8* resourceSpecial = resourceFile.AllocReadL(
+            R_NET_SPECIAL_INFORMATION);
+    HBufC8* resourceRadioPath = resourceFile.AllocReadL(
+            R_NET_RADIO_NOT_AVAILABLE);
+    HBufC8* resourceRingGoing = resourceFile.AllocReadL(R_NET_RING_GOING);
+    HBufC8* resourceCallWaiting = resourceFile.AllocReadL(R_NET_CALL_WAITING);
+    HBufC8* dataCallTone = resourceFile.AllocReadL(R_DATA_CALL_TONE);
+    HBufC8* noSoundSequence = resourceFile.AllocReadL(R_NO_SOUND_SEQUENCE);
+    HBufC8* beepSequence = resourceFile.AllocReadL(R_BEEP_SEQUENCE);
+
+    CleanupStack::PopAndDestroy(&resourceFile);
+
+    TResourceReader reader;
+    TInt i(0);
+    TInt length(0);
+
+    //SubscriberBusy
+    reader.SetBuffer(resourceBusy);
+    length = reader.ReadInt16();
+    iResourceBusySeq = HBufC8::NewL(length);
+    //Tptr modifies member variables (HBufC8) length so it includes the memory
+    //edited by Append()
+    TPtr8 appendBusy(iResourceBusySeq->Des());
+
+    for (i = 0; i < length; i++)
+        {
+        appendBusy.Append(reader.ReadUint16());
+        }
+
+    //Reorder
+    reader.SetBuffer(resourceReorder);
+    length = reader.ReadInt16();
+    iResourceReorderSeq = HBufC8::NewL(length);
+    //Tptr modifies member variables (HBufC8) length so it includes the memory
+    //edited by Append()
+    TPtr8 appendReorder(iResourceReorderSeq->Des());
+
+    for (i = 0; i < length; i++)
+        {
+        appendReorder.Append(reader.ReadUint16());
+        }
+
+    //Congestion
+    reader.SetBuffer(resourceCongestion);
+    length = reader.ReadInt16();
+    iResourceCongestionSeq = HBufC8::NewL(length);
+    //Tptr modifies member variables (HBufC8) length so it includes the memory
+    //edited by Append()
+    TPtr8 appendCongestion(iResourceCongestionSeq->Des());
+
+    for (i = 0; i < length; i++)
+        {
+        appendCongestion.Append(reader.ReadUint16());
+        }
+
+    //Special Information
+    reader.SetBuffer(resourceSpecial);
+    length = reader.ReadInt16();
+    iResourceSpecialSeq = HBufC8::NewL(length);
+    //Tptr modifies member variables (HBufC8) length so it includes the memory
+    //edited by Append()
+    TPtr8 appendSpecial(iResourceSpecialSeq->Des());
+
+    for (i = 0; i < length; i++)
+        {
+        appendSpecial.Append(reader.ReadUint16());
+        }
+
+    //RadioPathNotAvailable
+    reader.SetBuffer(resourceRadioPath);
+    length = reader.ReadInt16();
+    iResourceRadioPathSeq = HBufC8::NewL(length);
+    //Tptr modifies member variables (HBufC8) length so it includes the memory
+    //edited by Append()
+    TPtr8 appendRadio(iResourceRadioPathSeq->Des());
+
+    for (i = 0; i < length; i++)
+        {
+        appendRadio.Append(reader.ReadUint16());
+        }
+
+    //RemoteAlertingTone
+    reader.SetBuffer(resourceRingGoing);
+    length = reader.ReadInt16();
+    iResourceRingGoingSeq = HBufC8::NewL(length);
+    //Tptr modifies member variables (HBufC8) length so it includes the memory
+    //edited by Append()
+    TPtr8 appendRingGoing(iResourceRingGoingSeq->Des());
+
+    for (i = 0; i < length; i++)
+        {
+        appendRingGoing.Append(reader.ReadUint16());
+        }
+    //CallWaitingTone
+    reader.SetBuffer(resourceCallWaiting);
+    length = reader.ReadInt16();
+    iResourceCallWaitingSeq = HBufC8::NewL(length);
+    //Tptr modifies member variables (HBufC8) length so it includes the memory
+    //edited by Append()
+    TPtr8 appendCallWaiting(iResourceCallWaitingSeq->Des());
+
+    for (i = 0; i < length; i++)
+        {
+        appendCallWaiting.Append(reader.ReadUint16());
+        }
+
+    //DataCalTone
+    reader.SetBuffer(dataCallTone);
+    length = reader.ReadInt16();
+    iPlayDataSequence = HBufC8::NewL(length);
+    //Tptr modifies member variables (HBufC8) length so it includes the memory
+    //edited by Append()
+    TPtr8 appendDataCallTone(iPlayDataSequence->Des());
+
+    for (i = 0; i < length; i++)
+        {
+        appendDataCallTone.Append(reader.ReadUint16());
+        }
+
+    //NoSoundSequence
+    reader.SetBuffer(noSoundSequence);
+    length = reader.ReadInt16();
+    iPlayNoSoundSequence = HBufC8::NewL(length);
+    //Tptr modifies member variables (HBufC8) length so it includes the memory
+    //edited by Append()
+    TPtr8 appendNoSoundSequence(iPlayNoSoundSequence->Des());
+
+    for (i = 0; i < length; i++)
+        {
+        appendNoSoundSequence.Append(reader.ReadUint16());
+        }
+
+    //BeepSequence
+    reader.SetBuffer(beepSequence);
+    length = reader.ReadInt16();
+    iPlayBeepSequence = HBufC8::NewL(length);
+    //Tptr modifies member variables (HBufC8) length so it includes the memory
+    //edited by Append()
+    TPtr8 appendBeepSequence(iPlayBeepSequence->Des());
+
+    for (i = 0; i < length; i++)
+        {
+        appendBeepSequence.Append(reader.ReadUint16());
+        }
+
+    delete dataCallTone;
+    delete noSoundSequence;
+    delete beepSequence;
+    delete resourceBusy;
+    delete resourceReorder;
+    delete resourceCongestion;
+    delete resourceSpecial;
+    delete resourceRadioPath;
+    delete resourceRingGoing;
+    delete resourceCallWaiting;
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAudioInbandTonePlayer::PlayInbandTone
+// Searches the given Inband tone from iToneArray and calls PlayCurrentTone.
+// -----------------------------------------------------------------------------
+//
+void TMSAudioInbandTonePlayer::PlayInbandTone(
+/*TCCPTone*/TMSInbandToneType aTone)
+    {
+    TRACE_PRN_FN_ENT;
+    //Stop playing if there is something playing
+    Cancel();
+
+    UpdateTonePlayerVolume();
+
+    iToneName = aTone;
+
+    TPtr8 resourceBusySeq = iResourceBusySeq -> Des();
+    TPtr8 resourceRadioPathSeq = iResourceRadioPathSeq -> Des();
+    TPtr8 resourceCongestionSeq = iResourceCongestionSeq -> Des();
+    TPtr8 resourceSpecialSeq = iResourceSpecialSeq -> Des();
+    TPtr8 resourceReorderSeq = iResourceReorderSeq->Des();
+    TPtr8 resourceRingGoingSeq = iResourceRingGoingSeq -> Des();
+    TPtr8 resourceCallWaitingSeq = iResourceCallWaitingSeq -> Des();
+
+    switch (aTone)
+        {
+        case TMS_INBAND_USER_BUSY://ECCPToneUserBusy:
+            iCurrent->PrepareToPlayDesSequence(resourceBusySeq);
+            break;
+        case TMS_INBAND_RADIO_PATH_NOT_AVAIL://ECCPToneRadioPathNotAvailable:
+            iCurrent->PrepareToPlayDesSequence(resourceRadioPathSeq);
+            break;
+        case TMS_INBAND_CONGESTION://ECCPToneCongestion:
+            iCurrent->PrepareToPlayDesSequence(resourceCongestionSeq);
+            break;
+        case TMS_INBAND_SPECIAL_INFO://ECCPToneSpecialInformation:
+            iCurrent->PrepareToPlayDesSequence(resourceSpecialSeq);
+            break;
+        case TMS_INBAND_REORDER://ECCPReorder:
+            iCurrent->PrepareToPlayDesSequence(resourceReorderSeq);
+            break;
+        case TMS_INBAND_REMOTE_ALEARTING://ECCPRemoteAlerting:
+            iCurrent->PrepareToPlayDesSequence(resourceRingGoingSeq);
+            break;
+        case TMS_INBAND_CALL_WAITING://ECCPCallWaiting:
+            iCurrent->PrepareToPlayDesSequence(resourceCallWaitingSeq);
+            break;
+        case TMS_INBAND_NO_SEQUENCE://ECCPNoSoundSequence:
+            break;
+        default:
+            break;
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAudioInbandTonePlayer::Cancel
+// Cancels the currently playing tone.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void TMSAudioInbandTonePlayer::Cancel()
+    {
+    TRACE_PRN_FN_ENT;
+
+    if (iCurrent)
+        {
+        if (iCurrent->State() == EMdaAudioToneUtilityNotReady)
+            {
+            // Prepare is called, but toneplayer's state is not yet prepare,
+            // then cancel to prepare is needed.
+            iCurrent->CancelPrepare();
+            }
+        else
+            {
+            iCurrent->CancelPlay();
+            }
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAudioInbandTonePlayer::PlayCurrentTone
+// Cancels the currently playing tone.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void TMSAudioInbandTonePlayer::PlayCurrentTone()
+    {
+    TRACE_PRN_FN_ENT;
+    if (iCurrent)
+        {
+        if (iCurrent->State() == EMdaAudioToneUtilityPrepared)
+            {
+            UpdateTonePlayerVolume();
+
+            switch (iToneName)
+                {
+                case TMS_INBAND_USER_BUSY://ECCPToneUserBusy:
+                    iCurrent->SetRepeats(KMdaAudioToneRepeatForever,
+                            TTimeIntervalMicroSeconds(KPhoneInbandToneZero));
+                    iCurrent->SetPriority(KAudioPriorityNetMsg,
+                            static_cast<TMdaPriorityPreference> (
+                                    KAudioPrefBusy));
+                    break;
+                case TMS_INBAND_RADIO_PATH_NOT_AVAIL://ECCPToneRadioPathNotAvailable:
+                    iCurrent->SetRepeats(KMdaAudioToneRepeatForever,
+                            TTimeIntervalMicroSeconds(KPhoneInbandToneZero));
+                    iCurrent->SetPriority(KAudioPriorityNetMsg,
+                            static_cast<TMdaPriorityPreference> (
+                                    KAudioPrefRadioNotAvailable));
+                    break;
+                case TMS_INBAND_CONGESTION://ECCPToneCongestion:
+                    iCurrent->SetRepeats(KMdaAudioToneRepeatForever,
+                            TTimeIntervalMicroSeconds(KPhoneInbandToneZero));
+                    iCurrent->SetPriority(KAudioPriorityNetMsg,
+                            static_cast<TMdaPriorityPreference> (
+                                    KAudioPrefCongestion));
+                    break;
+                case TMS_INBAND_SPECIAL_INFO://ECCPToneSpecialInformation:
+                    iCurrent->SetRepeats(KMdaAudioToneRepeatForever,
+                            TTimeIntervalMicroSeconds(KPhoneInbandToneZero));
+                    iCurrent->SetPriority(KAudioPriorityNetMsg,
+                            static_cast<TMdaPriorityPreference> (
+                                    KAudioPrefSpecialInformation));
+                    break;
+                case TMS_INBAND_REORDER://ECCPReorder:
+                    iCurrent->SetRepeats(KMdaAudioToneRepeatForever,
+                            TTimeIntervalMicroSeconds(KPhoneInbandToneZero));
+                    iCurrent->SetPriority(KAudioPriorityNetMsg,
+                            static_cast<TMdaPriorityPreference> (
+                                    KAudioPrefReorder));
+                    break;
+                case TMS_INBAND_REMOTE_ALEARTING://ECCPRemoteAlerting:
+                    iCurrent->SetRepeats(KMdaAudioToneRepeatForever,
+                            TTimeIntervalMicroSeconds(KPhoneInbandToneZero));
+                    iCurrent->SetPriority(KAudioPriorityNetMsg,
+                            static_cast<TMdaPriorityPreference> (
+                                    KAudioPrefRingGoing));
+                    break;
+                case TMS_INBAND_CALL_WAITING://ECCPCallWaiting:
+                    iCurrent->SetRepeats(0, TTimeIntervalMicroSeconds(
+                            KPhoneInbandToneZero));
+                    iCurrent->SetPriority(KAudioPriorityNetMsg,
+                            static_cast<TMdaPriorityPreference> (
+                                    KAudioPrefCallWaiting));
+                    break;
+                case TMS_INBAND_DATA_CALL://ECCPDataCallTone: //EProfileRingingTypeRinging, EProfileRingingTypeAscending, EProfileRingingTypeRingingOnce
+                    iCurrent->SetRepeats(KMdaAudioToneRepeatForever,
+                            TTimeIntervalMicroSeconds(KPhoneInbandToneZero));
+                    iCurrent->SetPriority(KAudioPriorityPhoneCall,
+                            static_cast<TMdaPriorityPreference> (
+                                    KAudioPrefIncomingDataCall));
+
+                    //      if ( iRingingType == EProfileRingingTypeAscending )
+                    //           {
+                    //           iCurrent->SetVolumeRamp(
+                    //               TTimeIntervalMicroSeconds( KPERingingToneRampDuration ) );
+                    //           }
+                    //       else
+                    //          {
+                    //EProfileRingingTypeRinging, EProfileRingingTypeRingingOnce
+                    iCurrent->SetVolumeRamp(TTimeIntervalMicroSeconds(
+                            KPhoneInbandToneZero));
+                    //           }
+                    //      if ( iRingingType == EProfileRingingTypeRingingOnce )
+                    //          {
+                    iCurrent->SetRepeats(0, TTimeIntervalMicroSeconds(
+                            KPhoneInbandToneZero));
+                    //          }
+                    break;
+                case TMS_INBAND_NO_SEQUENCE://ECCPNoSoundSequence:
+                case TMS_INBAND_BEEP_SEQUENCE://ECCPBeepSequence:
+                    iCurrent->SetRepeats(KMdaAudioToneRepeatForever,
+                            TTimeIntervalMicroSeconds(KPhoneInbandToneZero));
+                    iCurrent->SetPriority(
+                            KAudioPriorityPhoneCall,
+                            static_cast<TMdaPriorityPreference> (
+                                    KAudioPrefIncomingCall));
+                    iCurrent->SetRepeats(0, TTimeIntervalMicroSeconds(
+                            KPhoneInbandToneZero));
+                    iCurrent->SetVolumeRamp(TTimeIntervalMicroSeconds(
+                            KPhoneInbandToneZero));
+                    break;
+                default:
+                    break;
+                }
+
+#ifdef __WINS__
+
+#else
+            //Play the tone
+            iCurrent->Play();
+#endif
+
+            } // State()
+        } //iCurrent
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAudioInbandTonePlayer::MatoPrepareComplete
+// Updates flag values and plays current inbandtone.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void TMSAudioInbandTonePlayer::MatoPrepareComplete(TInt aError)
+    {
+    TRACE_PRN_FN_ENT;
+    if (aError == KErrNone)
+        {
+        PlayCurrentTone();
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAudioInbandTonePlayer::SetVolume
+// -----------------------------------------------------------------------------
+//
+void TMSAudioInbandTonePlayer::SetVolume(TInt aVolume)
+    {
+    TRACE_PRN_FN_ENT;
+    TInt safeVolume = Max(Min(aVolume, KPhoneInbandVolumeMax),
+            KPhoneInbandVolumeMin);
+
+    if (iCurrent && EMdaAudioToneUtilityNotReady != iCurrent->State())
+        {
+        TInt mediaServerVolume = CalculateMediaServerVolume(safeVolume);
+        iCurrent->SetVolume(mediaServerVolume);
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAudioInbandTonePlayer::MatoPlayComplete
+// -
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void TMSAudioInbandTonePlayer::MatoPlayComplete(TInt aError)
+    {
+    TRACE_PRN_FN_ENT;
+    if (aError != KErrNone)
+        {
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAudioInbandTonePlayer::CalculateMediaServerVolume
+// -----------------------------------------------------------------------------
+//
+TInt TMSAudioInbandTonePlayer::CalculateMediaServerVolume(TInt aVolume) const
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    // Our volume level scale is 0...10, media server's can be anything.
+    // This scales the volume to correct level.
+    return (iCurrent->MaxVolume() * aVolume) /
+            (KPhoneInbandVolumeMax - KPhoneInbandVolumeMin);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSAudioInbandTonePlayer::UpdateTonePlayerVolume
+// -----------------------------------------------------------------------------
+//
+void TMSAudioInbandTonePlayer::UpdateTonePlayerVolume()
+    {
+    TRACE_PRN_FN_ENT;
+    TInt volume( /*KPhoneInbandVolumeMin*/KPhoneInbandVolumeMax);
+    // iOwner.GetAudioVolumeSync( volume );
+    SetVolume(volume);
+    TRACE_PRN_FN_EXT;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmsaudiotoneutilityimpl.cpp	Fri Apr 16 15:29:42 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
+ *
+ */
+
+#include "tmsaudiotoneutilityimpl.h"
+
+using namespace TMS;
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TMSAudioToneUtilityImpl::TMSAudioToneUtilityImpl()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 2nd phase construcotor
+// ---------------------------------------------------------------------------
+//
+void TMSAudioToneUtilityImpl::ConstructL(MMdaAudioToneObserver& aToneObserver)
+    {
+    iToneUtility = CMdaAudioToneUtility::NewL(aToneObserver);
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+TMSAudioToneUtilityImpl* TMSAudioToneUtilityImpl::NewL(
+        MMdaAudioToneObserver& aToneObserver)
+    {
+    TMSAudioToneUtilityImpl* self = new (ELeave) TMSAudioToneUtilityImpl;
+    CleanupStack::PushL(self);
+    self->ConstructL(aToneObserver);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+TMSAudioToneUtilityImpl::~TMSAudioToneUtilityImpl()
+    {
+    delete iToneUtility;
+    }
+
+// ---------------------------------------------------------------------------
+// From class TMSAudioToneUtilityImpl
+// ---------------------------------------------------------------------------
+//
+void TMSAudioToneUtilityImpl::PrepareToPlayDesSequence(const TDesC8& aSequence)
+    {
+    iToneUtility->PrepareToPlayDesSequence(aSequence);
+    }
+
+// ---------------------------------------------------------------------------
+// From class TMSAudioToneUtilityImpl
+// ---------------------------------------------------------------------------
+//
+TMdaAudioToneUtilityState TMSAudioToneUtilityImpl::State()
+    {
+    return iToneUtility->State();
+    }
+
+// ---------------------------------------------------------------------------
+// From class TMSAudioToneUtilityImpl
+// ---------------------------------------------------------------------------
+//
+void TMSAudioToneUtilityImpl::CancelPlay()
+    {
+    // Do state specific cancellations, this way we do not end up in a
+    // endless play state if CancelPlay() is called during preparation.
+    if (EMdaAudioToneUtilityPlaying == iToneUtility->State())
+        {
+        iToneUtility->CancelPlay();
+        }
+    else if (EMdaAudioToneUtilityPrepared == iToneUtility->State())
+        {
+        iToneUtility->CancelPrepare();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class TMSAudioToneUtilityImpl
+// ---------------------------------------------------------------------------
+//
+TInt TMSAudioToneUtilityImpl::MaxVolume()
+    {
+    return iToneUtility->MaxVolume();
+    }
+
+// ---------------------------------------------------------------------------
+// From class TMSAudioToneUtilityImpl
+// ---------------------------------------------------------------------------
+//
+void TMSAudioToneUtilityImpl::SetVolume(TInt aVolume)
+    {
+    iToneUtility->SetVolume(aVolume);
+    }
+
+// ---------------------------------------------------------------------------
+// From class TMSAudioToneUtilityImpl
+// ---------------------------------------------------------------------------
+//
+void TMSAudioToneUtilityImpl::SetRepeats(TInt aRepeatNumberOfTimes,
+        const TTimeIntervalMicroSeconds& aTrailingSilence)
+    {
+    iToneUtility->SetRepeats(aRepeatNumberOfTimes, aTrailingSilence);
+    }
+
+// ---------------------------------------------------------------------------
+// From class TMSAudioToneUtilityImpl
+// ---------------------------------------------------------------------------
+//
+void TMSAudioToneUtilityImpl::SetPriority(TInt aPriority,
+        TMdaPriorityPreference aPref)
+    {
+    iToneUtility->SetPriority(aPriority, aPref);
+    }
+
+// ---------------------------------------------------------------------------
+// From class TMSAudioToneUtilityImpl
+// ---------------------------------------------------------------------------
+//
+void TMSAudioToneUtilityImpl::SetVolumeRamp(
+        const TTimeIntervalMicroSeconds& aRampDuration)
+    {
+    iToneUtility->SetVolumeRamp(aRampDuration);
+    }
+
+// ---------------------------------------------------------------------------
+// From class TMSAudioToneUtilityImpl
+// ---------------------------------------------------------------------------
+//
+void TMSAudioToneUtilityImpl::Play()
+    {
+    iToneUtility->Play();
+    }
+
+// ---------------------------------------------------------------------------
+// From class TMSAudioToneUtilityImpl
+// ---------------------------------------------------------------------------
+//
+void TMSAudioToneUtilityImpl::CancelPrepare()
+    {
+    iToneUtility->CancelPrepare();
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmscenrepaudiohandler.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,189 @@
+/*
+ * 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:  Implements the class TMSCenRepAudioHandler
+ *
+ */
+
+#include <e32base.h>
+#include <e32property.h>
+#include "tmstelephonycenrep.h"
+
+#ifdef _USE_TELEPHONY_CENREP_
+#include <telmicmutestatuspskeys.h>
+#include <telincallvolcntrlcrkeys.h>
+#else
+const TUid KCRUidInCallVolume = {0x102828B1};
+const TUint32 KTelIncallEarVolume = 0x00000001;
+const TUint32 KTelIncallLoudspeakerVolume = 0x00000002;
+#endif
+
+#include "tmscenrepaudiohandler.h"
+#include "tmscenreplistener.h"
+#include "tmspubsublistener.h"
+#include "tmsutility.h"
+
+const TInt KDefaultMaxGain = 64;
+
+using namespace TMS;
+
+// ---------------------------------------------------------------------------
+// TMSCenRepAudioHandler::NewL.
+// ---------------------------------------------------------------------------
+//
+TMSCenRepAudioHandler* TMSCenRepAudioHandler::NewL(TMSServer* aServer)
+    {
+    TRACE_PRN_FN_ENT;
+    TMSCenRepAudioHandler* self = new (ELeave) TMSCenRepAudioHandler(aServer);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    TRACE_PRN_FN_EXT;
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+TMSCenRepAudioHandler::~TMSCenRepAudioHandler()
+    {
+    TRACE_PRN_FN_ENT;
+    delete iMuteListener;
+    delete iIncallLoudspeakerVolumeListener;
+    delete iIncallEarVolumeListener;
+    TRACE_PRN_FN_EXT;
+    }
+
+void TMSCenRepAudioHandler::HandleNotifyPSL(const TUid /*aUid*/,
+        const TInt& /*aKey*/, const TRequestStatus& /*aStatus*/)
+    {
+    TInt muteVal;
+    TInt err = KErrNotFound;
+
+    if (iMuteListener)
+        {
+        err = iMuteListener->Get(muteVal);
+        }
+    if (iTMSSer && err == KErrNone && muteVal == EPSTelMicMuteOn)
+        {
+#if !defined(__WINSCW__)
+        iTMSSer->SetGain(NULL, 0);
+#endif //__WINSCW__
+        }
+    else if (err == KErrNone)
+        {
+#if !defined(__WINSCW__)
+        // Change when gain is really changed
+        iTMSSer->SetGain(NULL, KDefaultMaxGain);
+#endif //__WINSCW__
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// TMSCenRepAudioHandler::SetLoudSpeakerVol
+// ---------------------------------------------------------------------------
+//
+void TMSCenRepAudioHandler::SetLoudSpeakerVol(TInt vol)
+    {
+    if (iIncallLoudspeakerVolumeListener)
+        {
+        iIncallLoudspeakerVolumeListener->Set(vol);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// TMSCenRepAudioHandler::SetEarPieceVol
+// ---------------------------------------------------------------------------
+//
+void TMSCenRepAudioHandler::SetEarPieceVol(TInt vol)
+    {
+    if (iIncallEarVolumeListener)
+        {
+        iIncallEarVolumeListener->Set(vol);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From TMSCenRepObserver
+// TMSCenRepAudioHandler::HandleNotifyCenRepL
+// ---------------------------------------------------------------------------
+//
+void TMSCenRepAudioHandler::HandleNotifyCenRepL(const TUid /*aUid*/,
+        const TUint32 aKey, TInt aVal)
+    {
+    TRACE_PRN_FN_ENT;
+    if (iTMSSer && aKey == KTelIncallLoudspeakerVolume)
+        {
+        iTMSSer->SetLevel(NULL, FALSE, aVal);
+        }
+    else if (iTMSSer && aKey == KTelIncallEarVolume)
+        {
+        iTMSSer->SetLevel(NULL, FALSE, aVal);
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the monitor.
+// ---------------------------------------------------------------------------
+//
+TMSCenRepAudioHandler::TMSCenRepAudioHandler(TMSServer* aServer) :
+    iTMSSer(aServer)
+    {
+    TRACE_PRN_FN_ENT;
+    iCallCount = 0; // Active calls count
+    TRACE_PRN_FN_EXT;
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase construction.
+// ---------------------------------------------------------------------------
+//
+void TMSCenRepAudioHandler::ConstructL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    RProperty::TType type(RProperty::EInt);
+    TSecurityPolicy readPolicy(ECapability_None);
+    TSecurityPolicy writePolicy(ECapabilityWriteDeviceData);
+
+    RProperty::Define(KPSUidTelMicrophoneMuteStatus, KTelMicrophoneMuteState,
+            type, readPolicy, writePolicy);
+
+    iMuteListener = TMSPubSubListener::NewL(KPSUidTelMicrophoneMuteStatus,
+            KTelMicrophoneMuteState, this);
+
+    iIncallLoudspeakerVolumeListener = TMSCenRepListener::NewL(
+            KCRUidInCallVolume, KTelIncallLoudspeakerVolume, this);
+
+    iIncallEarVolumeListener = TMSCenRepListener::NewL(KCRUidInCallVolume,
+            KTelIncallEarVolume, this);
+
+    // Initialize audio volumes
+    TInt volEar;
+    TInt volLoud;
+
+    if (iIncallEarVolumeListener)
+        {
+        /*TInt volGetRes =*/ iIncallEarVolumeListener->Get(volEar);
+        }
+    if (iIncallLoudspeakerVolumeListener)
+        {
+        /*volGetRes =*/ iIncallLoudspeakerVolumeListener->Get(volLoud);
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmscenreplistener.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,190 @@
+/*
+ * 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:  Central Repository listening
+ *
+ */
+
+// INCLUDE FILES
+#include "tmscenreplistener.h"
+#include "tmscenrepobserver.h"
+#include "tmsutility.h"
+
+using namespace TMS;
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::TMSCenRepListener
+// C++ default constructor
+// -----------------------------------------------------------------------------
+//
+TMSCenRepListener* TMSCenRepListener::NewL(TUid aUid, TUint32 aMonitorSetting,
+        TMSCenRepObserver* aObserver)
+    {
+    TRACE_PRN_FN_ENT;
+    TMSCenRepListener* self = new (ELeave) TMSCenRepListener(aUid,
+            aMonitorSetting, aObserver);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    TRACE_PRN_FN_EXT;
+    return self;
+    }
+
+// Destructor
+TMSCenRepListener::~TMSCenRepListener()
+    {
+    TRACE_PRN_FN_ENT;
+    Cancel();
+    delete iRepository;
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::Get
+// -----------------------------------------------------------------------------
+//
+gint TMSCenRepListener::Get(gint& aValue)
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_SUCCESS);
+    if (iRepository)
+        {
+        status = iRepository->Get(iMonitorSetting, aValue);
+        }
+    TRACE_PRN_FN_EXT;
+    return status;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::Set
+// -----------------------------------------------------------------------------
+//
+gint TMSCenRepListener::Set(gint aValue)
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_SUCCESS);
+    if (iRepository)
+        {
+        status = iRepository->Set(iMonitorSetting, aValue);
+        }
+    TRACE_PRN_FN_EXT;
+    return status;
+
+    }
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::DoCancel
+// -----------------------------------------------------------------------------
+//
+void TMSCenRepListener::DoCancel()
+    {
+    TRACE_PRN_FN_ENT;
+    if (iRepository)
+        {
+        iRepository->NotifyCancel(iMonitorSetting);
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::RunError
+// -----------------------------------------------------------------------------
+//
+gint TMSCenRepListener::RunError(
+#ifdef _DEBUG
+        TInt aError // Log the leavecode from RunL
+#else
+        TInt /*aError*/
+#endif
+        )
+    {
+    TRACE_PRN_FN_ENT;
+#ifdef _DEBUG
+    TRACE_PRN_IF_ERR(aError);
+#endif
+    TRACE_PRN_FN_EXT;
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::RunL
+// -----------------------------------------------------------------------------
+//
+void TMSCenRepListener::RunL()
+    {
+    TRACE_PRN_FN_ENT;
+    // Don't resubmit the request on error
+    // Central repositry completes notifications with id of setting
+    // so check only that value of iStatus is negative
+    if (iStatus.Int() == KErrNone)
+        {
+        SubmitNotifyRequestL();
+        }
+
+    // The loudspeaker volume has changed in repository.
+    // Retrieve the current volume from repository.
+    gint volume;
+    Get(volume);
+    if (iObserver)
+        {
+        iObserver->HandleNotifyCenRepL(iUid, iMonitorSetting, volume);
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::TMSCenRepListener
+// -----------------------------------------------------------------------------
+//
+TMSCenRepListener::TMSCenRepListener(TUid aUid, TUint32 aMonitorSetting,
+        TMSCenRepObserver* aObserver) :
+    CActive(EPriorityStandard),
+    iUid(aUid),
+    iMonitorSetting(aMonitorSetting),
+    iObserver(aObserver)
+    {
+    TRACE_PRN_FN_ENT;
+    CActiveScheduler::Add(this);
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::ConstructL
+// -----------------------------------------------------------------------------
+//
+void TMSCenRepListener::ConstructL()
+    {
+    TRACE_PRN_FN_ENT;
+    // Create repository instance
+    iRepository = CRepository::NewL(iUid);
+    // Start monitoring
+    SubmitNotifyRequestL();
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::SubmitNotifyRequestL
+// -----------------------------------------------------------------------------
+//
+void TMSCenRepListener::SubmitNotifyRequestL()
+    {
+    TRACE_PRN_FN_ENT;
+    if (iRepository)
+        {
+        iStatus = KRequestPending;
+        iRepository->NotifyRequest(iMonitorSetting, iStatus);
+        SetActive();
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmsdtmfeventhandler.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,112 @@
+/*
+ * 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 "tmsdtmfeventhandler.h"
+#include "tmsclientserver.h"
+#include "tmsutility.h"
+
+using namespace TMS;
+
+// -----------------------------------------------------------------------------
+// TMSDtmfEventHandler::TMSDtmfEventHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+TMSDtmfEventHandler::TMSDtmfEventHandler(TMSServer* aServer) :
+    CActive(EPriorityStandard),
+    iTMSSer(aServer)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TMSDtmfEventHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void TMSDtmfEventHandler::ConstructL()
+    {
+    TRACE_PRN_FN_ENT;
+    CActiveScheduler::Add(this);
+    User::LeaveIfError(iProperty.Attach(KTMSPropertyCategory, EDtmfPs));
+    iStatus = KRequestPending;
+    iProperty.Subscribe(iStatus);
+    SetActive();
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSDtmfEventHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+TMSDtmfEventHandler* TMSDtmfEventHandler::NewL(TMSServer* aServer)
+    {
+    TMSDtmfEventHandler* self = new (ELeave) TMSDtmfEventHandler(aServer);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Destructor
+TMSDtmfEventHandler::~TMSDtmfEventHandler()
+    {
+    TRACE_PRN_FN_ENT;
+    if (IsActive())
+        {
+        Cancel();
+        }
+    iProperty.Close();
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSDtmfEventHandler::DoCancel
+// -----------------------------------------------------------------------------
+//
+void TMSDtmfEventHandler::DoCancel()
+    {
+    TRACE_PRN_FN_ENT;
+    iProperty.Cancel();
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSDtmfEventHandler::RunL
+// -----------------------------------------------------------------------------
+//
+void TMSDtmfEventHandler::RunL()
+    {
+    TRACE_PRN_FN_ENT;
+// Subscribe immediately before analyzing the notification to ensure that we
+// don't miss further updates.
+//if (iStatus.Int() == KErrNone)
+//    {
+    iStatus = KRequestPending;
+    iProperty.Subscribe(iStatus);
+    SetActive();
+    TmsMsgBufPckg dtmfpckg;
+    iProperty.Get(dtmfpckg);
+    iTMSSer->NotifyDtmfClients(dtmfpckg);
+//    }
+    TRACE_PRN_FN_EXT;
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmsglobaleffectssettings.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,172 @@
+/*
+ * 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 "tmsglobaleffectssettings.h"
+#include "tmsclientserver.h"
+
+using namespace TMS;
+// CONSTANTS
+const TInt KDefaultVolume = 4;
+const TInt KDefaultMaxVolume = 10;
+const TInt KDefaultGain = 1;
+const TInt KDefaultMaxGain = 64;
+
+TUid KCRUidTmseffects = {0x10207C80};
+const TUint32 KTmsEarPieceVolume = 0x00000001;
+const TUint32 KTmsLoudSpkrVolume = 0x00000002;
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::TMSGlobalEffectsSettings
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+TMSGlobalEffectsSettings::TMSGlobalEffectsSettings() :
+    iGain(KDefaultGain),
+    iMaxVolume(KDefaultMaxVolume),
+    iMaxGain(KDefaultMaxGain),
+    iEarVolume(KDefaultVolume),
+    iLoudSpkrVolume(KDefaultVolume)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void TMSGlobalEffectsSettings::ConstructL()
+    {
+    // Create repository instance
+    iRepository = CRepository::NewL(KCRUidTmseffects);
+    if (iRepository)
+        {
+        iRepository->Get(KTmsLoudSpkrVolume, iLoudSpkrVolume);
+        iRepository->Get(KTmsEarPieceVolume, iEarVolume);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+TMSGlobalEffectsSettings* TMSGlobalEffectsSettings::NewL()
+    {
+    TMSGlobalEffectsSettings* self = new (ELeave) TMSGlobalEffectsSettings();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Destructor
+TMSGlobalEffectsSettings::~TMSGlobalEffectsSettings()
+    {
+    delete iRepository;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::SetLoudSpkrVolume
+// -----------------------------------------------------------------------------
+//
+void TMSGlobalEffectsSettings::SetLoudSpkrVolume(TInt aVolume)
+    {
+    TInt status(KErrNone);
+    if (iRepository)
+        {
+        status = iRepository->Set(KTmsLoudSpkrVolume, aVolume);
+        if (status == KErrNone)
+            {
+            iLoudSpkrVolume = aVolume;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::SetEarPieceVolume
+// -----------------------------------------------------------------------------
+//
+void TMSGlobalEffectsSettings::SetEarPieceVolume(TInt aVolume)
+    {
+    TInt status(KErrNone);
+    if (iRepository)
+        {
+        status = iRepository->Set(KTmsEarPieceVolume, aVolume);
+        if (status == KErrNone)
+            {
+            iEarVolume = aVolume;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::GetLoudSpkrVolume
+// -----------------------------------------------------------------------------
+//
+void TMSGlobalEffectsSettings::GetLoudSpkrVolume(TInt& aVolume)
+    {
+    aVolume = iLoudSpkrVolume;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::GetEarPieceVolume
+// -----------------------------------------------------------------------------
+//
+void TMSGlobalEffectsSettings::GetEarPieceVolume(TInt& aVolume)
+    {
+    aVolume = iEarVolume;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::MaxVolume
+// -----------------------------------------------------------------------------
+//
+TInt TMSGlobalEffectsSettings::MaxVolume() const
+    {
+    return iMaxVolume;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::SetGain
+// -----------------------------------------------------------------------------
+//
+void TMSGlobalEffectsSettings::SetGain(TInt aGain)
+    {
+    iGain = aGain;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::Gain
+// -----------------------------------------------------------------------------
+//
+TInt TMSGlobalEffectsSettings::Gain() const
+    {
+    return iGain;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::MaxGain
+// -----------------------------------------------------------------------------
+//
+TInt TMSGlobalEffectsSettings::MaxGain() const
+    {
+    return iMaxGain;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmspubsublistener.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,157 @@
+/*
+ * 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:  Implements the class TMSPubSubListener
+ *
+ */
+
+#include "tmspubsublistener.h"
+#include "tmspubsubobserver.h"
+
+using namespace TMS;
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::TMSPubSubListener
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+TMSPubSubListener::TMSPubSubListener(const TUid aUid, const TInt aKey,
+        TMSPubSubObserver* aObserver) :
+    CActive(CActive::EPriorityStandard),
+    iUid(aUid),
+    iId(aKey),
+    iObserver(aObserver)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::~TMSPubSubListener
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+TMSPubSubListener::~TMSPubSubListener()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::RunL
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+void TMSPubSubListener::RunL()
+    {
+    const TRequestStatus status(iStatus);
+    StartListening();
+    iObserver->HandleNotifyPSL(iUid, iId, status);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::DoCancel
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+void TMSPubSubListener::DoCancel()
+    {
+
+    iProperty.Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::RunError
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+TInt TMSPubSubListener::RunError(TInt /*aError*/)
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::NewL
+// -----------------------------------------------------------------------------
+//
+TMSPubSubListener* TMSPubSubListener::NewL(const TUid aUid, const TInt aKey,
+        TMSPubSubObserver* aObserver)
+    {
+
+    TMSPubSubListener* self = new (ELeave) TMSPubSubListener(aUid, aKey,
+            aObserver);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::StartListening
+// -----------------------------------------------------------------------------
+//
+void TMSPubSubListener::StartListening()
+    {
+    iProperty.Subscribe(iStatus);
+    SetActive();
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::ConstructL
+// -----------------------------------------------------------------------------
+//
+void TMSPubSubListener::ConstructL()
+    {
+    if (iObserver)
+        {
+        CActiveScheduler::Add(this);
+        }
+
+    User::LeaveIfError(iProperty.Attach(iUid, iId, EOwnerThread));
+
+    if (iObserver)
+        {
+        StartListening();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::Get
+// Read integer value.
+// -----------------------------------------------------------------------------
+//
+TInt TMSPubSubListener::Get(TInt& aVal)
+    {
+    return iProperty.Get(iUid, iId, aVal);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::Get
+// Read binary value.
+// -----------------------------------------------------------------------------
+//
+TInt TMSPubSubListener::Get(TDes8& aVal)
+    {
+    return iProperty.Get(iUid, iId, aVal);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::Get
+// Read string value.
+// -----------------------------------------------------------------------------
+//
+TInt TMSPubSubListener::Get(TDes16& aVal)
+    {
+    return iProperty.Get(iUid, iId, aVal);
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmsrtaudiohdlr.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,793 @@
+/*
+ * 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:  Audio player implementation.
+ *
+ */
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <utf.h>    // For converting data for TTS
+#include "tmsshared.h"
+#include "tmsutility.h"
+#include "tmsrtaudiohdlr.h"
+#include "tmsrtcontainer.h"
+#include "tmsrtaudiohdlrobsrv.h"
+
+using namespace TMS;
+
+// CONSTANTS
+const TInt KMinVolumeLevel = 1;
+const TInt KMaxVolumeLevel = 10;
+const TInt KTMSRingingRepeatsTrailPause = 1000000;
+const TInt KTMSAudioAscendingRampDuration = 3000000;
+const TInt KTMSMdaAudioToneRepeatForever = -2;
+const TInt KUTF8Multiply = 2;
+
+_LIT(KFileListRngMimeType, "application/vnd.nokia.ringing-tone");
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::TMSRtAudioHdlr
+// -----------------------------------------------------------------------------
+//
+TMSRtAudioHdlr::TMSRtAudioHdlr(TAudioDataFormat aDataFormat,
+        TMSRtAudioHdlrObsrv& aObserver, TUint aPriority, TUint aPreference,
+        TInt aType) :
+    iFormat(aDataFormat),
+    iObserver(aObserver),
+    iPriority(aPriority),
+    iPreference(aPreference),
+    iRtType(aType)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::ConstructL
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::ConstructL(const TDesC& aFileName)
+    {
+    TRACE_PRN_FN_ENT;
+    if (iFormat == EFormatTone)
+        {
+        iTonePlayer = CMdaAudioToneUtility::NewL(*this);
+        iTonePlayer->PrepareToPlayFileSequence(aFileName);
+        iPlayerStatus = EToneLoading;
+        }
+    else
+        {
+        iSamplePlayer = CMdaAudioPlayerUtility::NewFilePlayerL(aFileName, *this,
+                iPriority, iPreference);
+        iPlayerStatus = EToneLoading;
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::ConstructSeqL
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::ConstructSeqL(const TDesC8& aSequence)
+    {
+    TRACE_PRN_FN_ENT;
+    iTonePlayer = CMdaAudioToneUtility::NewL(*this);
+    iSequence = aSequence.AllocL();
+    iTonePlayer->PrepareToPlayDesSequence(*iSequence);
+    iPlayerStatus = EToneLoading;
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::ConstructTtsL
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::ConstructTtsL(const TDesC& aTtsText, TUint aPriority,
+        TUint aPreference)
+    {
+    TRACE_PRN_FN_ENT;
+    delete iTtsPlayer;
+    iTtsPlayer = NULL;
+    iTtsPlayer = CMdaAudioPlayerUtility::NewL(*this, aPriority, aPreference);
+
+    delete iTtsText;
+    iTtsText = NULL;
+    // UTF-8 strings can take up to 4 bytes per character
+    iTtsText = HBufC8::NewL(aTtsText.Length() << KUTF8Multiply);
+
+    TPtr8 refText = iTtsText->Des();
+    User::LeaveIfError(CnvUtfConverter::ConvertFromUnicodeToUtf8(refText,
+            aTtsText));
+
+    // UTF-8 chars can be up to 4 bytes long, but usually
+    // take 1-2 bytes, 3 for asian chars.
+    HBufC8* oldText = iTtsText;
+    iTtsText = iTtsText->ReAlloc(iTtsText->Length());
+    if (!iTtsText)
+        {
+        // ReAlloc failed, set back to original.
+        iTtsText = oldText;
+        }
+    iTtsPlayer->OpenDesL(*iTtsText);
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::NewL
+// -----------------------------------------------------------------------------
+//
+TMSRtAudioHdlr* TMSRtAudioHdlr::NewL(const TMSRtContainer& aRingingTone,
+        TUint aPriority, TUint aPreference, TMSRtAudioHdlrObsrv& aObserver,
+        TInt aType, TBool aExtSecNeeded)
+    {
+    TRACE_PRN_FN_ENT;
+    // Check file DRM property if extended security is needed.
+    if (aExtSecNeeded)
+        {
+        if (!aRingingTone.IsFileInRom() && !aRingingTone.IsFileDrmProtected())
+            {
+            // DRM extended security check permission denied
+            User::Leave(KErrPermissionDenied);
+            }
+        // DRM extended security check ok
+        }
+
+    // RNG file types have to be played with CMdaAudioToneUtility player.
+    // Other audio formats use sample player
+    TAudioDataFormat format = (aRingingTone.MimeType().CompareF(
+            KFileListRngMimeType) == KErrNone) ? EFormatTone : EFormatSample;
+
+    TMSRtAudioHdlr* self = new (ELeave) TMSRtAudioHdlr(format, aObserver,
+            aPriority, aPreference, aType);
+    CleanupStack::PushL(self);
+    self->ConstructL(aRingingTone.FileName());
+    CleanupStack::Pop(self);
+    TRACE_PRN_FN_EXT;
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::NewL
+// -----------------------------------------------------------------------------
+//
+TMSRtAudioHdlr* TMSRtAudioHdlr::NewL(const TDesC& aFileName, TUint aPriority,
+        TUint aPreference, TMSRtAudioHdlrObsrv& aObserver, TInt aType,
+        TBool aExtSecNeeded)
+    {
+    TRACE_PRN_FN_ENT;
+    TMSRtContainer* tone = TMSRtContainer::NewL(aFileName);
+    CleanupStack::PushL(tone);
+    TMSRtAudioHdlr* player = TMSRtAudioHdlr::NewL(*tone, aPriority, aPreference,
+            aObserver, aType, aExtSecNeeded);
+    CleanupStack::PopAndDestroy(tone);
+    TRACE_PRN_FN_EXT;
+    return player;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::NewSeqL
+// -----------------------------------------------------------------------------
+//
+TMSRtAudioHdlr* TMSRtAudioHdlr::NewSeqL(const TDesC8& aSequence,
+        TUint aPriority, TUint aPreference, TMSRtAudioHdlrObsrv& aObserver,
+        TInt aType)
+    {
+    TRACE_PRN_FN_ENT;
+    TMSRtAudioHdlr* self = new (ELeave) TMSRtAudioHdlr(EFormatTone,
+            aObserver, aPriority, aPreference, aType);
+    CleanupStack::PushL(self);
+    self->ConstructSeqL(aSequence);
+    CleanupStack::Pop(self);
+    TRACE_PRN_FN_EXT;
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::NewTtsL
+// -----------------------------------------------------------------------------
+//
+TMSRtAudioHdlr* TMSRtAudioHdlr::NewTtsL(const TDesC& aText, TUint aPriority,
+        TUint aPreference, TMSRtAudioHdlrObsrv& aObserver, TInt aType)
+    {
+    TRACE_PRN_FN_ENT;
+    TMSRtAudioHdlr* self = new (ELeave) TMSRtAudioHdlr(EFormatTts, aObserver,
+            aPriority, aPreference, aType);
+    CleanupStack::PushL(self);
+    self->ConstructTtsL(aText, aPriority, aPreference);
+    CleanupStack::Pop(self);
+    TRACE_PRN_FN_EXT;
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::~TMSRtAudioHdlr
+// -----------------------------------------------------------------------------
+//
+TMSRtAudioHdlr::~TMSRtAudioHdlr()
+    {
+    TRACE_PRN_FN_ENT;
+    /*if (i3DPlugin)
+         {
+         i3DPlugin->Stop();
+         }
+    delete i3DPlugin;
+    delete iAudioOutput;*/
+    delete iTonePlayer;
+    delete iSamplePlayer;
+    delete iTtsPlayer;
+    delete iSequence;
+    delete iTtsText;
+    REComSession::FinalClose();
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::Play
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::Play(TRingingType aRingType, TInt aVolume,
+        TInt aTTsToBePlayed)
+    {
+    TRACE_PRN_FN_ENT;
+    iRingType = aRingType;
+    iVolume = aVolume;
+    iTTsToBePlayed = aTTsToBePlayed;
+
+    if (iFormat == EFormatTone)
+        {
+        switch (iPlayerStatus)
+            {
+            case ETonePlaying:
+                iTonePlayer->CancelPlay();
+                DoPlay();
+                break;
+            case EToneReady:
+                iPlayerStatus = ETonePlaying;
+                DoPlay();
+                break;
+            case EToneLoading:
+                iToBePlaying = ETrue;
+                break;
+            default:
+                __ASSERT_DEBUG(EFalse,
+                        User::Panic(KTMSPanic, TMS_RESULT_DOES_NOT_EXIST));
+                break;
+            }
+        }
+    else if (iFormat == EFormatTts)
+        {
+        switch (iPlayerStatus)
+            {
+            case ETonePlaying:
+                iTtsPlayer->Stop();
+                DoPlay();
+                break;
+            case EToneReady:
+                iPlayerStatus = ETonePlaying;
+                DoPlay();
+                break;
+            case EToneLoading:
+                iToBePlaying = ETrue;
+                break;
+            default:
+                __ASSERT_DEBUG(EFalse,
+                        User::Panic(KTMSPanic, TMS_RESULT_DOES_NOT_EXIST));
+                break;
+            }
+        }
+    else
+        {
+        switch (iPlayerStatus)
+            {
+            case ETonePlaying:
+                StopPlaying();
+                iPlayerStatus = ETonePlaying;
+                DoPlay();
+                break;
+            case EToneReady:
+                iPlayerStatus = ETonePlaying;
+                DoPlay();
+                break;
+            case EToneLoading:
+                iToBePlaying = ETrue;
+                break;
+            default:
+                __ASSERT_DEBUG(EFalse,
+                        User::Panic(KTMSPanic, TMS_RESULT_DOES_NOT_EXIST));
+                break;
+            }
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::ReStartPlaying
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::ReStartPlaying()
+    {
+    TRACE_PRN_FN_ENT;
+    if (iFormat == EFormatTone)
+        {
+        iTonePlayer->Play();
+        iPlayerStatus = ETonePlaying;
+        }
+    else if (iFormat == EFormatTts)
+        {
+        iTtsPlayer->Play();
+        iPlayerStatus = ETonePlaying;
+        }
+    else
+        {
+        iSamplePlayer->Play();
+        iPlayerStatus = ETonePlaying;
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::StopPlaying
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::StopPlaying()
+    {
+    TRACE_PRN_FN_ENT;
+    iToBePlaying = EFalse;
+
+    if (iFormat == EFormatTone)
+        {
+        if (EMdaAudioToneUtilityPrepared == iTonePlayer->State())
+            {
+            iTonePlayer->CancelPrepare();
+            }
+        else if (EMdaAudioToneUtilityPlaying == iTonePlayer->State())
+            {
+            iTonePlayer->CancelPlay();
+            }
+        }
+    else if (iFormat == EFormatTts)
+        {
+        iTtsPlayer->Stop();
+        }
+    else
+        {
+/*        if (i3DPlugin)
+            {
+            i3DPlugin->Stop();
+            delete i3DPlugin;
+            i3DPlugin = NULL;
+            }
+        else
+            {*/
+            iSamplePlayer->Stop();
+/*            }*/
+        }
+    iPlayerStatus = EToneReady;
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::MapcInitComplete
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::MapcInitComplete(TInt aError,
+        const TTimeIntervalMicroSeconds& /*aDuration*/)
+    {
+    TRACE_PRN_N2(
+            _L("TMS->TMSRtAudioHdlr::MapcInitComplete: player[%d], err[%d]"),
+            iRtType, aError);
+
+    __ASSERT_DEBUG((iFormat == EFormatSample) ||
+            ((iFormat == EFormatTts) && (iPlayerStatus == EToneLoading)),
+            PANIC(TMS_RESULT_INVALID_STATE));
+
+    if (aError == TMS_RESULT_SUCCESS)
+        {
+        if (iToBePlaying)
+            {
+            iPlayerStatus = ETonePlaying;
+            iToBePlaying = EFalse;
+            DoPlay();
+            }
+        else
+            {
+            iPlayerStatus = EToneReady;
+            }
+        }
+    iObserver.RtAudioHdlrEvent(ECmdRingToneOpenComplete, aError, iRtType);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::MapcPlayComplete
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::MapcPlayComplete(TInt aError)
+    {
+    TRACE_PRN_N2(
+            _L("TMS->TMSRtAudioHdlr::MapcPlayComplete: player[%d], err[%d]"),
+            iRtType, aError);
+
+    iPlayerStatus = EToneReady;
+
+    // Delete 3D plugin before RT player. In case of continuous ringing type,
+    // 3D plugin is destructed in StopPlaying().
+/*    if (i3DPlugin)
+        {
+        i3DPlugin->Stop();
+        delete i3DPlugin;
+        i3DPlugin = NULL;
+        }*/
+    iObserver.RtAudioHdlrEvent(ECmdRingTonePlayComplete, aError, iRtType);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::MatoPrepareComplete
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::MatoPrepareComplete(TInt aError)
+    {
+    TRACE_PRN_N2(
+            _L("TMS->TMSRtAudioHdlr::MatoPrepareComplete: player[%d], err[%d]"),
+            iRtType, aError);
+
+    __ASSERT_DEBUG(((iFormat == EFormatTone) &&
+            (iPlayerStatus == EToneLoading)), PANIC(TMS_RESULT_INVALID_STATE));
+
+    if (aError == TMS_RESULT_SUCCESS)
+        {
+        if (iToBePlaying)
+            {
+            iPlayerStatus = ETonePlaying;
+            iToBePlaying = EFalse;
+            DoPlay();
+            }
+        else
+            {
+            iPlayerStatus = EToneReady;
+            }
+        }
+    iObserver.RtAudioHdlrEvent(ECmdRingToneOpenComplete, aError, iRtType);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::MatoPlayComplete
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::MatoPlayComplete(TInt aError)
+    {
+    TRACE_PRN_N2(
+            _L("TMS->TMSRtAudioHdlr::MatoPlayComplete: player[%d], err[%d]"),
+            iRtType, aError);
+
+    iObserver.RtAudioHdlrEvent(ECmdRingTonePlayComplete, aError, iRtType);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::DoPlay
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::DoPlay()
+    {
+    TRACE_PRN_FN_ENT;
+
+    __ASSERT_DEBUG(iPlayerStatus == ETonePlaying,
+            PANIC(TMS_RESULT_INVALID_STATE));
+
+    //TInt err(TMS_RESULT_SUCCESS);
+    SetRingingTypeProperties();
+
+    if (iFormat == EFormatTone)
+        {
+        iTonePlayer->Play();
+        }
+    else if (iFormat == EFormatTts)
+        {
+        iTtsPlayer->Play();
+        }
+    else
+        {
+#ifdef __WINS__
+        iSamplePlayer->Play();
+#else
+/*
+        //TODO: compare with phoneapp
+        TInt err = KErrNone;
+        TRAP(err, i3DPlugin = C3DRingingToneInterface::NewL(KNullUid));
+        if (!err && i3DPlugin)
+            {
+            i3DPlugin->SetAttr(E3DRTIAttrAudioPlayerUtility, iSamplePlayer);
+            TRAP(err, i3DPlugin->PlayL())
+            }
+        if (err || !i3DPlugin)
+            {
+            if (!iAudioOutput)
+                {
+                TRAP(err, iAudioOutput = CAudioOutput::NewL(*iSamplePlayer));
+                }
+            if (!err && iAudioOutput)
+                {
+                TRAP(err, iAudioOutput->SetAudioOutputL(CAudioOutput::EAll));
+                }
+            }*/
+        iSamplePlayer->Play();
+#endif //__WINS__
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::SetRingingTypeProperties
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::SetRingingTypeProperties()
+    {
+    TInt rampTime(0);
+    if (iFormat == EFormatTone)
+        {
+        switch (iRingType)
+            {
+            case ETypeRinging:
+                {
+                // If we have TTS activated and ringing type is "ringing", then
+                // we need to play TTS sequence again when ringtone restarts.
+                // That's why we need to set ringing type to ETypeRingingOnce,
+                // because it is the only way of knowing when ringtone playback
+                // is completed. Then we can restart it with new TTS iterations.
+                if (iTTsToBePlayed)
+                    {
+                    // Play only once
+                    iTonePlayer->SetRepeats(0, TTimeIntervalMicroSeconds(
+                            KTMSRingingRepeatsTrailPause));
+                    iTonePlayer->SetVolume(ConvertVolume(iVolume));
+                    }
+                else
+                    {
+                    iTonePlayer->SetRepeats(KTMSMdaAudioToneRepeatForever,
+                            TTimeIntervalMicroSeconds(
+                                    KTMSRingingRepeatsTrailPause));
+                    iTonePlayer->SetVolume(ConvertVolume(iVolume));
+                    }
+                break;
+                }
+            case ETypeRingingOnce:
+                {
+                // Play only once
+                iTonePlayer->SetRepeats(0, TTimeIntervalMicroSeconds(
+                        KTMSRingingRepeatsTrailPause));
+                iTonePlayer->SetVolume(ConvertVolume(iVolume));
+                break;
+                }
+            case ETypeAscending:
+                {
+                iTonePlayer->SetRepeats(KTMSMdaAudioToneRepeatForever,
+                        TTimeIntervalMicroSeconds(
+                                KTMSRingingRepeatsTrailPause));
+
+                // Special case for TTS + ascending profile. Volume and
+                // ramptime need to be different then usual
+                if (iTTsToBePlayed)
+                    {
+                    // RampTime is only 3 seconds and volume is 1.
+                    rampTime = KTMSAudioAscendingRampDuration;
+                    iTonePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(
+                            rampTime));
+                    iCurrentVolume = 1; //we start from the lowest volume
+                    iTonePlayer->SetVolume(ConvertVolume(iCurrentVolume));
+                    }
+                else
+                    {
+                    // RampTime: time for one step * volume level
+                    rampTime = KTMSAudioAscendingRampDuration * iVolume;
+                    iTonePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(
+                            rampTime));
+                    iCurrentVolume = 1; //we start from the lowest volume
+                    iTonePlayer->SetVolume(ConvertVolume(iVolume));
+                    }
+                break;
+                }
+            default:
+                //PANIC(TMS_RESULT_DOES_NOT_EXIST);
+                break;
+            }
+        //Set priority and preference
+        iTonePlayer->SetPriority(iPriority, iPreference);
+        }
+    else if (iFormat == EFormatTts)
+        {
+        switch (iRingType)
+            {
+            case ETypeRinging:
+            case ETypeAscending:
+                {
+                // Not allowed for TTS.
+                break;
+                }
+            case ETypeRingingOnce:
+                {
+                iTtsPlayer->SetRepeats(0, TTimeIntervalMicroSeconds(
+                        KTMSRingingRepeatsTrailPause));
+                iTtsPlayer->SetVolume(ConvertVolume(iVolume));
+                break;
+                }
+            default:
+                {
+                __ASSERT_DEBUG(EFalse, PANIC(TMS_RESULT_DOES_NOT_EXIST));
+                break;
+                }
+            }
+        }
+    else
+        {
+        switch (iRingType)
+            {
+            case ETypeRinging:
+                {
+                // If we have TTS activated and ringing type is "ringing", then
+                // we need to play TTS sequence again when ringtone restarts.
+                // That's why we need to set ringingtype to ETypeRingingOnce,
+                // because it is the only way of knowing when ringtone playback
+                // is completed. Then we can restart it with new TTS iterations.
+                if (iTTsToBePlayed)
+                    {
+                    // Play only once
+                    iSamplePlayer->SetRepeats(0, TTimeIntervalMicroSeconds(
+                            KTMSRingingRepeatsTrailPause));
+                    iSamplePlayer->SetVolume(ConvertVolume(iVolume));
+                    }
+                else
+                    {
+                    iSamplePlayer->SetRepeats(
+                            KTMSMdaAudioToneRepeatForever,
+                            TTimeIntervalMicroSeconds(
+                                    KTMSRingingRepeatsTrailPause));
+                    iSamplePlayer->SetVolume(ConvertVolume(iVolume));
+                    }
+                break;
+                }
+            case ETypeRingingOnce:
+                {
+                iSamplePlayer->SetRepeats(0, TTimeIntervalMicroSeconds(
+                        KTMSRingingRepeatsTrailPause));
+                iSamplePlayer->SetVolume(ConvertVolume(iVolume));
+                break;
+                }
+            case ETypeAscending:
+                {
+                iSamplePlayer->SetRepeats(KTMSMdaAudioToneRepeatForever,
+                        TTimeIntervalMicroSeconds(
+                                KTMSRingingRepeatsTrailPause));
+
+                // Special case for TTS + ascending profile. Volume and
+                // ramptime need to be different then usual
+                if (iTTsToBePlayed)
+                    {
+                    // RampTime is only 3 seconds and volume is 1.
+                    rampTime = KTMSAudioAscendingRampDuration;
+                    iSamplePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(
+                            rampTime));
+                    iCurrentVolume = 1; //we start from the lowest volume
+                    iSamplePlayer->SetVolume(ConvertVolume(iCurrentVolume));
+                    }
+                else
+                    {
+                    // RampTime: time for one step * volume level
+                    rampTime = KTMSAudioAscendingRampDuration * iVolume;
+                    iSamplePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(
+                            rampTime));
+
+                    iCurrentVolume = 1; //we start from the lowest volume
+                    iSamplePlayer->SetVolume(ConvertVolume(iVolume));
+                    }
+                break;
+                }
+            default:
+                {
+                break;
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::SetNewVolumeAndRamptime
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::SetNewVolumeAndRamptime(TInt aVolume, TInt aRamptime)
+    {
+    // Check that volume is in a valid range.
+    TInt volume = aVolume < 1 ? 1 : aVolume;
+
+    if (iFormat == EFormatTone && iTonePlayer)
+        {
+        iTonePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(aRamptime));
+        iTonePlayer->SetVolume(ConvertVolume(volume));
+        }
+    else if (iFormat == EFormatTts && iTtsPlayer)
+        {
+        iTtsPlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(aRamptime));
+        iTtsPlayer->SetVolume(ConvertVolume(volume));
+        }
+    else
+        {
+        iSamplePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds(aRamptime));
+        iSamplePlayer->SetVolume(ConvertVolume(volume));
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::ConvertVolume
+// -----------------------------------------------------------------------------
+//
+TInt TMSRtAudioHdlr::ConvertVolume(TInt aVolume)
+    {
+    TInt result(0);
+
+    if (iFormat == EFormatTone)
+        {
+        result = iTonePlayer->MaxVolume() * aVolume / KMaxVolumeLevel;
+        }
+    else if (iFormat == EFormatTts)
+        {
+        result = iTtsPlayer->MaxVolume() * aVolume / KMaxVolumeLevel;
+        }
+    else
+        {
+        result = iSamplePlayer->MaxVolume() * aVolume / KMaxVolumeLevel;
+        }
+
+    // If user selected minimum volume level set HW volume 1
+    if (aVolume == KMinVolumeLevel && result == 0)
+        {
+        result = 1;
+        }
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::SetTTsToBePlayed
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::SetTTsToBePlayed(const TBool aTTsToBePlayed)
+    {
+    iTTsToBePlayed = aTTsToBePlayed;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtAudioHdlr::MutePlaying
+// -----------------------------------------------------------------------------
+//
+void TMSRtAudioHdlr::MutePlaying()
+    {
+    if (iPlayerStatus == ETonePlaying)
+        {
+        if (iFormat == EFormatTone)
+            {
+            iTonePlayer->SetVolume(0);
+            }
+        else if (iFormat == EFormatTts)
+            {
+            iTtsPlayer->SetVolume(0);
+            }
+        else // EFormatSample
+            {
+            iSamplePlayer->SetVolume(0);
+            }
+        }
+    else
+        {
+        // Mute during EToneLoading state.
+        iToBePlaying = EFalse;
+        }
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmsrtcontainer.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,267 @@
+/*
+ * 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:  Class representing ringing tone
+ *
+ */
+
+// INCLUDE FILES
+#include <apgcli.h>
+#include <DRMHelper.h>
+#include <bldvariant.hrh>
+//#include <pathinfo.h>
+#include "tmsrtcontainer.h"
+
+using namespace TMS;
+
+// CONSTANTS
+// Rich audio file MIME types
+_LIT(KAac, "audio/aac");
+_LIT(KMp3, "audio/mp3");
+_LIT(KMpeg, "audio/mpeg");
+_LIT(K3gpp, "audio/3gpp");
+_LIT(KMp4, "audio/mp4");
+_LIT(KAmrWb, "audio/amr-wb");
+_LIT(KWavX, "audio/x-wav");
+_LIT(KWav, "audio/wav");
+// Rich video file MIME types
+_LIT(KV3gpp, "video/3gpp");
+_LIT(KVMp4, "video/mp4");
+_LIT(KV3gpp2, "video/3gpp2");
+// Used in CPhoneRingingTone
+_LIT(KPhoneRingingToneDriveZ, "z:");
+#ifdef RD_VIDEO_AS_RINGING_TONE
+_LIT(KPhoneRingingToneVideoMime, "video/*");
+_LIT(KPhoneRingingToneRealVideoMime, "*realmedia");
+#endif
+
+// -----------------------------------------------------------------------------
+// TMSRtContainer::TMSRtContainer
+// C++ default constructor
+// -----------------------------------------------------------------------------
+//
+TMSRtContainer::TMSRtContainer(TBool aDrmInPlayback) :
+    iDrmInPlayback(aDrmInPlayback)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtContainer::ConstructL
+// Symbian 2nd phase constructor
+// -----------------------------------------------------------------------------
+//
+void TMSRtContainer::ConstructL(const TDesC& aFileName)
+    {
+    iFileName = aFileName.AllocL();
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtContainer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+TMSRtContainer* TMSRtContainer::NewL(const TDesC& aFileName,
+        TBool aDrmInPlayback)
+    {
+    TMSRtContainer* self = new (ELeave) TMSRtContainer(aDrmInPlayback);
+    CleanupStack::PushL(self);
+    self->ConstructL(aFileName);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Destructor
+TMSRtContainer::~TMSRtContainer()
+    {
+    delete iFileName;
+    delete iMimeType;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtContainer::SetFileName
+// -----------------------------------------------------------------------------
+//
+void TMSRtContainer::SetFileName(const TDesC& aFileName)
+    {
+    delete iFileName;
+    iFileName = aFileName.Alloc();
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtContainer::FileName
+// -----------------------------------------------------------------------------
+//
+const TDesC& TMSRtContainer::FileName() const
+    {
+    // iFileName is never NULL
+    return *iFileName;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtContainer::MimeType
+// -----------------------------------------------------------------------------
+//
+const TDesC& TMSRtContainer::MimeType() const
+    {
+    if (iMimeType)
+        {
+        return *iMimeType;
+        }
+    else
+        {
+        return KNullDesC;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtContainer::IsVideoRingingTone
+// -----------------------------------------------------------------------------
+//
+TBool TMSRtContainer::IsVideoRingingTone()
+    {
+#ifdef RD_VIDEO_AS_RINGING_TONE
+    if (RefreshMime() != KErrNone)
+        {
+        // try to handle as audio
+        return EFalse;
+        }
+
+    TBool isVideo(EFalse);
+
+    if (iMimeType && iMimeType->MatchF(KPhoneRingingToneVideoMime)
+            != KErrNotFound)
+        {
+        isVideo = ETrue;
+        }
+    else if (iMimeType && iMimeType->MatchF(KPhoneRingingToneRealVideoMime)
+            != KErrNotFound)
+        {
+        isVideo = ETrue;
+        }
+
+    if (isVideo)
+        {
+        if (IsFileInRom() && !IsFileInVideoDirectory())
+            {
+            // For ROM files check also location, because
+            // MIME check is not fully reliable.
+            isVideo = EFalse;
+            }
+        }
+
+    return isVideo;
+
+#else
+    // if extended security -> refresh MIME
+    if (iDrmInPlayback)
+        {
+        RefreshMime();
+        }
+
+    return EFalse;
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtContainer::IsFileDrmProtected
+// -----------------------------------------------------------------------------
+//
+TBool TMSRtContainer::IsFileDrmProtected() const
+    {
+    const TDesC& type = MimeType();
+
+    if (type == KAac || type == KMp3 || type == KMpeg || type == K3gpp ||
+            type == KMp4 || type == KAmrWb || type == KWavX || type == KWav ||
+            type == KV3gpp || type == KVMp4 || type == KV3gpp2)
+        {
+        ContentAccess::CContent* content = NULL;
+        TRAPD(err, content = ContentAccess::CContent::NewL(*iFileName));
+        if (err == KErrNone && content)
+            {
+            TInt drmProtected(0);
+            content->GetAttribute(ContentAccess::EIsProtected, drmProtected);
+            delete content;
+            return drmProtected;
+            }
+        }
+
+    return ETrue; // Other MIMEs can be played without DRM check.
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtContainer::IsFileInRom
+// -----------------------------------------------------------------------------
+//
+TBool TMSRtContainer::IsFileInRom() const
+    {
+    TParsePtrC parsedName(*iFileName);
+
+    // Files on ROM don't need to be checked for DRM
+    if (parsedName.Drive().CompareF(KPhoneRingingToneDriveZ) == 0)
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtContainer::IsFileInVideoDirectory
+// -----------------------------------------------------------------------------
+//
+TBool TMSRtContainer::IsFileInVideoDirectory() const
+    {/*
+    TParsePtrC parsedName(*iFileName);
+
+    if (PathInfo::PathType(parsedName.DriveAndPath()) == PathInfo::EVideosPath)
+        {
+        return ETrue;
+        }
+    else
+        {*/
+        return EFalse;
+        //}
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtContainer::RefreshMime
+// -----------------------------------------------------------------------------
+//
+TInt TMSRtContainer::RefreshMime()
+    {
+    TRAPD(err, RefreshMimeL());
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRtContainer::RefreshMimeL
+// -----------------------------------------------------------------------------
+//
+void TMSRtContainer::RefreshMimeL()
+    {
+    RApaLsSession apaLsSession;
+    User::LeaveIfError(apaLsSession.Connect());
+    CleanupClosePushL(apaLsSession);
+    TUid dummyUid = {0};
+    TDataType dataType(dummyUid);
+    User::LeaveIfError(apaLsSession.AppForDocument(*iFileName, dummyUid,
+            dataType));
+    CleanupStack::PopAndDestroy(); // CleanupClosePushL
+    delete iMimeType;
+    iMimeType = NULL;
+    iMimeType = dataType.Des().AllocL();
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmsrtplayer.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,1707 @@
+/*
+ * 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 <AudioPreference.h>
+#include <MProEngTones.h>
+#include <MProEngToneSettings.h>
+#include <ProEngFactory.h>
+#include "tmsshared.h"
+#include "tmsutility.h"
+#include "tmsrtplayerobsrv.h"
+#include "tmsrtcontainer.h"
+#include "tmsrtplayer.h"
+
+using namespace TMS;
+
+// CONSTANTS
+const TInt KTMSMaxRingingWaiting = 3000000;
+const TInt KTMSTtsAscendingStep = 3000000;
+const TInt KRTDefaultVolume = 2;
+//const TInt KTtsVolumeBoost = 9;
+const TInt KTtsVolumeMin = 2;
+const TInt KTtsVolumeAscendingRepeat = 4;
+const TInt KPlayerVolumeAscendingRepeat = 3;
+const TInt KTtsVolumeAscendingDecrease = 2;
+
+// Delays between periods of Text-To-Speech playback
+// {3000000, 4000000} means the following order of playing:
+// 3 secs tone, then TTS, then 4 secs of tone, then TTS, then tone forever.
+const TInt KTMSTtsDelays[] = {3000000, 4000000};
+// Number of elements in KTMSTtsDelays array.
+const TInt KTMSTtsDelaysCount = sizeof(KTMSTtsDelays) / sizeof (TInt);
+const TInt Kkilo = 1024;
+
+_LIT(KTMSTtsHeader, "(tts)");
+
+#ifdef __WINS__
+//_LIT(KTMSDefaultSoundFile, "z:\\data\\sounds\\digital\\Nokia_tune.aac");
+_LIT(KTMSDefaultSoundFile, "Z:\\Data\\Sounds\\Digital\\Nokia tune.aac");
+//_LIT(KTMSDefaultSoundFile, "c:\\data\\sounds\\digital\\test_8khz.wav");
+_LIT(KTMSNoSoundSequence,  "z:\\data\\sounds\\digital\\clock.aac");
+//_LIT(KTMSNoSoundSequence, "c:\\data\\sounds\\digital\\test_8khz.wav");
+_LIT(KTMSBeepSequence,     "z:\\data\\sounds\\digital\\clock.aac");
+//_LIT(KTMSBeepSequence, "c:\\data\\sounds\\digital\\test_8khz.wav");
+_LIT(KTMSUnsecureVoIPCall, "z:\\data\\sounds\\digital\\alarm.aac");
+//_LIT(KTMSUnsecureVoIPCall, "c:\\data\\sounds\\digital\\test_8khz.wav");
+#else
+// DO NOT change these sequences!
+_LIT(KTMSDefaultSoundFile, "\\System\\Sounds\\Simple\\Nokia tune.wav");
+_LIT8(KTMSBeepSequence, "\x00\x11\x0A\x0A\x08\x73\x0A\x40\x28\x0A\xF7\x05\
+\xFC\x40\x64\x0A\x08\x40\x32\x0A\xF7\x06\x0B");
+_LIT8(KTMSNoSoundSequence, "\x00\x11\x0A\x05\xFC\x0A\x08\x40\x32\x0A\xF7\
+\x40\x64\x06\x0B");
+_LIT8(KTMSUnsecureVoIPCall, "\x00\x11\x0B\x67\x04\x40\x04\x67\x04\x40\x04\
+\x6C\x04\x40\x04\x6D\x04\x0B");
+#endif // __WINS__
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::NewL
+// -----------------------------------------------------------------------------
+//
+TMSRingTonePlayer* TMSRingTonePlayer::NewL(TMSRtPlayerObsrv& aObserver)
+    {
+    TMSRingTonePlayer* self = new (ELeave) TMSRingTonePlayer(aObserver);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::TMSRingTonePlayer
+// -----------------------------------------------------------------------------
+//
+TMSRingTonePlayer::TMSRingTonePlayer(TMSRtPlayerObsrv& aObserver) :
+    iRtObserver(aObserver)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::ConstructL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::ConstructL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    for (TInt i = EPlayerFirst; i <= EPlayerLast; i++)
+        {
+        User::LeaveIfError(iAsyncDeletePlayers.Append(NULL));
+        }
+
+    // Construct timer.
+    iTimer = TMSTimer::NewL();
+    iTtsDelayTimer = TMSTimer::NewL();
+    iAsyncReqAO = TMSAsyncReqAO::NewL(this);
+
+    // TODO:
+    // Checks if DRM extend security is needed
+    // Check video player configuration.
+
+    iEngine =  ProEngFactory::NewEngineL();
+
+    InitRtParamsL(EPlayerBackup);
+    //CreateDefaultRingToneL();
+    CreateBkpRtPlayerL();
+    //GetMaxToneFileSizeL(iToneFileSizeLimitKB);
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::~TMSRingTonePlayer
+// -----------------------------------------------------------------------------
+//
+TMSRingTonePlayer::~TMSRingTonePlayer()
+    {
+    TRACE_PRN_FN_ENT;
+
+    iAsyncDeletePlayers.ResetAndDestroy();
+    iAsyncDeletePlayers.Close();
+    if (iProfile)
+        {
+        iProfile->Release();
+        }
+    if (iEngine)
+        {
+        iEngine->Release();
+        }
+    RemovePlayers();
+    delete iBackupPlayer;
+    delete iAsyncReqAO;
+    delete iTimer;
+    delete iTtsDelayTimer;
+    delete iRtContainer;
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::InitRtParamsL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::InitRtParamsL(TRtPlayerType aPlayerType)
+    {
+    TRACE_PRN_FN_ENT;
+
+    iRtParam.iType = aPlayerType;
+    iRtParam.iPriority = KAudioPriorityPhoneCall;
+    iRtParam.iPreference = KAudioPrefIncomingCall;
+    iRtParam.iRingingType = EProfileRingingTypeRinging;
+    iRtParam.iVolume = KRTDefaultVolume;
+    iRtParam.iTextToSay.Set(KNullDesC());
+
+    if (aPlayerType == EPlayerUnsecureVoIP)
+        {
+        iRtParam.iPriority = KAudioPrioritySpecialInformationTone;
+        iRtParam.iPreference = KAudioPrefSpecialInformation;
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::CreateDefaultPlayerL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::CreateDefaultRingToneL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    InitRtParamsL(EPlayerDefault);
+    LoadProfileRingToneL();
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::LoadActiveProfileSettingsL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::LoadActiveProfileSettingsL()
+    {
+    if (!iEngine)
+        {
+        iEngine =  ProEngFactory::NewEngineL();
+        }
+    if (iProfile)
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        }
+    __ASSERT_DEBUG(iEngine, PANIC(TMS_RESULT_UNINITIALIZED_OBJECT));
+
+    iProfile = iEngine->ActiveProfileL();
+    MProEngToneSettings& settings = iProfile->ToneSettings();
+    iRtParam.iVolume = settings.RingingVolume();
+    iRtParam.iRingingType = settings.RingingType();
+    iRtParam.iCallerText = settings.TextToSpeech();
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::LoadProfileRingToneL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::LoadProfileRingToneL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    LoadActiveProfileSettingsL();
+    __ASSERT_DEBUG(iProfile, PANIC(TMS_RESULT_UNINITIALIZED_OBJECT));
+
+    MProEngTones& tones = iProfile->ProfileTones();
+    // Get alternate line RT: tones.RingingTone2()
+    // Get default video RT: tones.VideoCallRingingTone()
+
+    if (!iRtContainer)
+        {
+        iRtContainer = TMSRtContainer::NewL(tones.RingingTone1());
+        }
+    else
+        {
+        if (tones.RingingTone1().CompareF(iRtContainer->FileName()) != KErrNone)
+            {
+            // Profile changed - update RT
+            iRtContainer->SetFileName(tones.RingingTone1());
+            iRtContainer->RefreshMime();
+            }
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::CreateBkpRtPlayerL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::CreateBkpRtPlayerL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    delete iBackupPlayer;
+    iBackupPlayer = NULL;
+    TFileName file(KTMSDefaultSoundFile);
+    iBackupPlayer = TMSRtAudioHdlr::NewL(file, KAudioPriorityPhoneCall,
+            KAudioPrefIncomingCall, *this, EPlayerBackup);
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::CreateDefaultRtPlayerL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::CreateDefaultRtPlayerL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    // Fresh start for the default tone.
+    CreateDefaultRingToneL();
+
+    delete iDefaultPlayer;
+    iDefaultPlayer = NULL;
+    iDefaultPlayer = TMSRtAudioHdlr::NewL(*iRtContainer,
+            KAudioPriorityPhoneCall, KAudioPrefIncomingCall, *this,
+            EPlayerDefault, EFalse);
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::CreateAudioPlayerL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::CreateAudioPlayerL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    delete iAudioPlayer;
+    iAudioPlayer = NULL;
+    iAudioPlayer = TMSRtAudioHdlr::NewL(*iRtContainer, iRtParam.iPriority,
+            iRtParam.iPreference, *this, iRtParam.iType,
+            iRtParam.iType == EPlayerDefault ? EFalse : iExtSecNeeded);
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::CreateRingTonePlayerL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::CreateRingTonePlayerL(const TRtPlayerType aPlayer,
+        const TDesC& aFile)
+    {
+    TRACE_PRN_FN_ENT;
+
+    TInt len = aFile.Length();
+    if (!len || aPlayer == EPlayerDefault)
+        {
+        CreateDefaultRtPlayerL();
+        }
+    else
+        {
+        if (!iRtContainer)
+            {
+            CreateDefaultRingToneL();
+            }
+        if (len && iRtContainer)
+            {
+            iRtContainer->SetFileName(aFile);
+            iRtContainer->RefreshMime();
+            iRtParam.iType = aPlayer;
+            }
+        CreateAudioPlayerL();
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::CreateSequencePlayerL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::CreateSequencePlayerL(const TRtPlayerType aPlayer)
+    {
+    TRACE_PRN_FN_ENT;
+
+    switch (aPlayer)
+        {
+        case EPlayerBeepOnce:
+            CreateBeepOncePlayerL();
+            break;
+        case EPlayerSilent:
+            CreateSilentPlayerL();
+            break;
+        case EPlayerUnsecureVoIP:
+            CreateUnsecureVoipPlayerL();
+            break;
+        default:
+            break;
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::CreateBeepOncePlayerL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::CreateBeepOncePlayerL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    delete iBeepOncePlayer;
+    iBeepOncePlayer = NULL;
+
+#ifdef __WINS__
+    TParse* fp = new (ELeave) TParse();
+    fp->Set(KTMSBeepSequence, NULL, NULL);
+    TFileName fileName(fp->FullName());
+    delete fp;
+    iBeepOncePlayer = TMSRtAudioHdlr::NewL(fileName, iRtParam.iPriority,
+            iRtParam.iPreference, *this, EPlayerBeepOnce);
+#else
+    iBeepOncePlayer = TMSRtAudioHdlr::NewSeqL(KTMSBeepSequence(),
+            iRtParam.iPriority, iRtParam.iPreference, *this, EPlayerBeepOnce);
+#endif // __WINS__
+
+    iRtParam.iType = EPlayerBeepOnce;
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::CreateSilentPlayerL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::CreateSilentPlayerL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    iRtParam.iVolume = 0;
+    delete iSilentPlayer;
+    iSilentPlayer = NULL;
+
+#ifdef __WINS__
+    TParse* fp = new (ELeave) TParse();
+    fp->Set(KTMSNoSoundSequence, NULL, NULL);
+    TFileName fileName(fp->FullName());
+    delete fp;
+    iSilentPlayer = TMSRtAudioHdlr::NewL(fileName, iRtParam.iPriority,
+            iRtParam.iPreference, *this, EPlayerSilent);
+#else
+    iSilentPlayer = TMSRtAudioHdlr::NewSeqL(KTMSNoSoundSequence(),
+            iRtParam.iPriority, iRtParam.iPreference, *this, EPlayerSilent);
+#endif // __WINS__
+
+    iRtParam.iType = EPlayerSilent;
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::CreateUnsecureVoipPlayerL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::CreateUnsecureVoipPlayerL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    delete iUnsecureVoIPTonePlayer;
+    iUnsecureVoIPTonePlayer = NULL;
+
+#ifdef __WINS__
+    TParse* fp = new (ELeave) TParse();
+    fp->Set(KTMSUnsecureVoIPCall, NULL, NULL);
+    TFileName fileName(fp->FullName());
+    delete fp;
+    iUnsecureVoIPTonePlayer = TMSRtAudioHdlr::NewL(fileName,
+            iRtParam.iPriority, iRtParam.iPreference, *this,
+            EPlayerUnsecureVoIP);
+#else
+    iUnsecureVoIPTonePlayer = TMSRtAudioHdlr::NewSeqL(KTMSUnsecureVoIPCall(),
+            iRtParam.iPriority, iRtParam.iPreference, *this,
+            EPlayerUnsecureVoIP);
+#endif // __WINS__
+
+    iRtParam.iType = EPlayerUnsecureVoIP;
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::CreateCustomSequencePlayerL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::CreateCustomSequencePlayerL(const TDesC8&
+#ifdef __WINS__
+        /*aSequence*/)
+#else
+        aSequence)
+#endif
+    {
+    TRACE_PRN_FN_ENT;
+
+    delete iSequencePlayer;
+    iSequencePlayer = NULL;
+
+#ifdef __WINS__
+    TParse* fp = new (ELeave) TParse();
+    fp->Set(KTMSBeepSequence, NULL, NULL);
+    TFileName fileName(fp->FullName());
+    delete fp;
+    iSequencePlayer = TMSRtAudioHdlr::NewL(fileName, iRtParam.iPriority,
+            iRtParam.iPreference, *this, EPlayerSequence);
+#else
+    iSequencePlayer = TMSRtAudioHdlr::NewSeqL(aSequence, iRtParam.iPriority,
+            iRtParam.iPreference, *this, EPlayerSequence);
+#endif // __WINS__
+
+    iRtParam.iType = EPlayerSequence;
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::CreateTTSPlayerL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::CreateTTSPlayerL(const TDesC& aTextToSay)
+    {
+    TRACE_PRN_FN_ENT;
+
+    RemoveTTSPlayer();
+    TPtrC ttsHeader(KTMSTtsHeader);
+    HBufC* buf = HBufC::New(aTextToSay.Length() + ttsHeader.Length());
+    if (buf)
+        {
+        TPtr ptr = buf->Des();
+        ptr.Append(ttsHeader);
+        ptr.Append(aTextToSay);
+        TRACE_PRN_N1(_L("TMS->CreateTTSPlayerL: Text:[%S]"), &ptr);
+        TRAPD(err, iTtsPlayer = TMSRtAudioHdlr::NewTtsL(*buf,
+                KAudioPriorityTextToSpeechCall, KAudioPrefTextToSpeechCall,
+                *this, EPlayerTts));
+        if (err == TMS_RESULT_SUCCESS)
+            {
+            iTtsToneToBePlayed = ETrue;
+            iRtParam.iTextToSay.Set(aTextToSay);
+            }
+        }
+    delete buf;
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::RemoveTTSPlayer
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::RemoveTTSPlayer()
+    {
+    TRACE_PRN_FN_ENT;
+
+    delete iTtsPlayer;
+    iTtsPlayer = NULL;
+    iTtsToneToBePlayed = EFalse;
+    iRtParam.iTextToSay.Set(KNullDesC());
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::PlayRingToneL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::PlayRingToneL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    // Check active Profile for any changes since Init()
+    // TODO: To improve perfomrance, instead of polling Profile settings,
+    //       consider subscribing to ProfilEngine P&S keys in CenRep.
+    LoadActiveProfileSettingsL();
+
+    switch (iRtParam.iType)
+        {
+        case EPlayerAudio:
+            {
+            PlayTtsTone();
+            PlayAudioRingToneL();
+            break;
+            }
+        case EPlayerBeepOnce:
+            BeepOnceL();
+            break;
+        case EPlayerSilent:
+            PlaySilentToneL();
+            break;
+        case EPlayerUnsecureVoIP:
+            PlayUnsecureVoIPToneL();
+            break;
+        case EPlayerDefault:
+            PlayTtsTone();
+            PlayDefaultToneL();
+            break;
+        case EPlayerBackup:
+            PlayBackupToneL();
+            break;
+        case EPlayerSequence:
+            PlaySequenceToneL();
+            break;
+        default:
+            break;
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::PlayAudioRingToneL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::PlayAudioRingToneL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    if (!iRtContainer || !CheckAndHandleToneSizeLimit(iRtContainer))
+        {
+        PlayDefaultToneL();
+        }
+    else if (iRtParam.iRingingType == EProfileRingingTypeSilent)
+        {
+        PlaySilentToneL();
+        }
+    else if (iRtParam.iRingingType == EProfileRingingTypeBeepOnce)
+        {
+        BeepOnceL();
+        }
+    else
+        {
+        if (!iAudioPlayer)
+            {
+            CreateAudioPlayerL();
+            if (!iTimer->IsActive())
+                {
+                // If InitComplete event doesn't occur within permittable time,
+                // this will trigger fallback routine.
+                iTimer->After(KTMSMaxRingingWaiting, this);
+                }
+            }
+
+        // Start playing.
+        if (!iAudioPlayer)
+            {
+            iTimer->Cancel();
+            PlayDefaultToneL();
+            }
+        else
+            {
+            iTonePlayingStatus = EAudioTonePlaying;
+            iAudioPlayer->Play(ConvertRingingType(iRtParam.iRingingType),
+                    iRtParam.iVolume, iTtsToneToBePlayed);
+            }
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::BeepOnceL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::BeepOnceL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    if (!iBeepOncePlayer)
+        {
+        CreateBeepOncePlayerL();
+        }
+    if (iBeepOncePlayer)
+        {
+        iTonePlayingStatus = EBeepOnce;
+        iBeepOncePlayer->Play(TMSRtAudioHdlr::ETypeRingingOnce,
+                iRtParam.iVolume, EFalse);
+        }
+    else
+        {
+        PlayDefaultToneL();
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::PlaySilentToneL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::PlaySilentToneL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    if (!iSilentPlayer)
+        {
+        CreateSilentPlayerL();
+        }
+    if (iSilentPlayer)
+        {
+        iTonePlayingStatus = ESilentTonePlaying;
+        iSilentPlayer->Play(TMSRtAudioHdlr::ETypeRinging, 0, EFalse);
+        }
+    else
+        {
+        PlayDefaultToneL();
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::PlayUnsecureVoIPToneL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::PlayUnsecureVoIPToneL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    if (!iUnsecureVoIPTonePlayer)
+        {
+        CreateUnsecureVoipPlayerL();
+        }
+    if (iUnsecureVoIPTonePlayer)
+        {
+        iTonePlayingStatus = EUnsecureVoIPTonePlaying;
+        iUnsecureVoIPTonePlayer->Play(TMSRtAudioHdlr::ETypeRingingOnce,
+                KRTDefaultVolume, EFalse);
+        }
+    else
+        {
+        PlayDefaultToneL();
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::PlaySequenceToneL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::PlaySequenceToneL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    if (iSequencePlayer)
+        {
+        iTonePlayingStatus = ESequenceTonePlaying;
+        iSequencePlayer->Play(ConvertRingingType(iRtParam.iRingingType),
+                iRtParam.iVolume, EFalse);
+        }
+    else
+        {
+        PlayDefaultToneL();
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::PlayTtsTone
+// Schedule TTS to play, if text has been provided
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::PlayTtsTone()
+    {
+    TRACE_PRN_FN_ENT;
+
+    TInt err = TMS_RESULT_SUCCESS;
+
+    if (iRtParam.iTextToSay.Length() && !iTtsPlayer)
+        {
+        TRAP(err, CreateTTSPlayerL(iRtParam.iTextToSay));
+        }
+    if (err == TMS_RESULT_SUCCESS && iTtsPlayer && iTtsToneToBePlayed)
+        {
+        iTtsDelayIndex = 0;
+        iTtsDelaysCount = KTMSTtsDelaysCount;
+
+        // Start TTS timer just before RT
+        if (!iTtsDelayTimer->IsActive())
+            {
+            iTtsDelayTimer->After(KTMSTtsDelays[iTtsDelayIndex],
+                    TCallBack(HandleTtsDelayTimeout, this));
+            }
+        iTtsVolume = iRtParam.iVolume;
+        iTtsRingingType = iRtParam.iRingingType;
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::PlayBackupToneL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::PlayBackupToneL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    TInt err = TMS_RESULT_SUCCESS;
+
+    if (!iBackupPlayer)
+        {
+        TRAP(err, CreateBkpRtPlayerL());
+        }
+
+    if (iBackupPlayer && err == TMS_RESULT_SUCCESS)
+        {
+        iTonePlayingStatus = EBackupTonePlaying;
+        iTtsToneToBePlayed = EFalse;
+        iTTsTimeOutCounter = 0;
+        iTtsDelayTimer->Cancel();
+        if (iTtsPlayer)
+            {
+            iTtsPlayer->StopPlaying();
+            delete iTtsPlayer;
+            iTtsPlayer = NULL;
+            }
+        iBackupPlayer->Play(ConvertRingingType(iRtParam.iRingingType),
+                iRtParam.iVolume, EFalse);
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::PlayDefaultToneL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::PlayDefaultToneL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    if (iRtParam.iRingingType == EProfileRingingTypeSilent ||
+            iRtParam.iRingingType == EProfileRingingTypeBeepOnce)
+        {
+        return;
+        }
+
+    if (!iRtContainer)
+        {
+        // Default tone does not exist, play backup.
+        PlayBackupToneL();
+        return;
+        }
+
+    if (!iDefaultPlayer)
+        {
+        CreateDefaultRtPlayerL();
+        if (!iTimer->IsActive())
+            {
+            // If InitComplete event doesn't occur within permittable time,
+            // this will trigger fallback routine.
+            iTimer->After(KTMSMaxRingingWaiting, this);
+            }
+        }
+
+    // Start playing.
+    if (!iDefaultPlayer)
+        {
+        // Default player not ready, play backup.
+        iTimer->Cancel();
+        PlayBackupToneL();
+        }
+    else
+        {
+        iTonePlayingStatus = EDefaultTonePlaying;
+        iDefaultPlayer->Play(ConvertRingingType(iRtParam.iRingingType),
+                iRtParam.iVolume, iTtsToneToBePlayed);
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::StopPlaying
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::StopPlaying()
+    {
+    TRACE_PRN_FN_ENT;
+
+    iTtsToneToBePlayed = EFalse;
+    iTTsTimeOutCounter = 0;
+    iTtsDelayTimer->Cancel();
+    if (iTtsPlayer)
+        {
+        iTtsPlayer->StopPlaying();
+        delete iTtsPlayer;
+        iTtsPlayer = NULL;
+        }
+    iTimer->Cancel();
+
+    switch (iTonePlayingStatus)
+        {
+        case EAudioTonePlaying:
+            if (iAudioPlayer)
+                {
+                // Commented out to correct screen jamming after
+                // REComSession::FinalClose(). Audio player will be stopped
+                // in its destructor. Fixes EKKI-7WYG2G and JKAN-7XNGQU.
+                // iAudioPlayer->StopPlaying();
+                delete iAudioPlayer;
+                iAudioPlayer = NULL;
+                }
+            break;
+        case EDefaultTonePlaying:
+            if (iDefaultPlayer)
+                {
+                iDefaultPlayer->StopPlaying();
+                delete iDefaultPlayer;
+                iDefaultPlayer = NULL;
+                }
+            break;
+        case EBeepOnce:
+            if (iBeepOncePlayer)
+                {
+                iBeepOncePlayer->StopPlaying();
+                delete iBeepOncePlayer;
+                iBeepOncePlayer = NULL;
+                }
+            break;
+        case EBackupTonePlaying:
+            if (iBackupPlayer)
+                {
+                iBackupPlayer->StopPlaying();
+                }
+            break;
+        case ESilentTonePlaying:
+            if (iSilentPlayer)
+                {
+                iSilentPlayer->StopPlaying();
+                delete iSilentPlayer;
+                iSilentPlayer = NULL;
+                }
+            break;
+        case EUnsecureVoIPTonePlaying:
+            if (iUnsecureVoIPTonePlayer)
+                {
+                iUnsecureVoIPTonePlayer->StopPlaying();
+                delete iUnsecureVoIPTonePlayer;
+                iUnsecureVoIPTonePlayer = NULL;
+                }
+            break;
+        case ESequenceTonePlaying:
+            if (iSequencePlayer)
+                {
+                iSequencePlayer->StopPlaying();
+                delete iSequencePlayer;
+                iSequencePlayer = NULL;
+                }
+            break;
+        case EVideoTonePlaying: // video ringing tone
+        case EPersonalVideoTonePlaying:
+        case ESilentVideoTonePlaying:
+            if (iBeepOncePlayer != NULL)
+                {
+                iBeepOncePlayer->StopPlaying();
+                delete iBeepOncePlayer;
+                iBeepOncePlayer = NULL;
+                }
+            if (iSilentPlayer != NULL)
+                {
+                iSilentPlayer->StopPlaying();
+                delete iSilentPlayer;
+                iSilentPlayer = NULL;
+                }
+            if (iRtContainer)
+                {
+                delete iRtContainer;
+                iRtContainer = NULL;
+                }
+            break;
+        case EIdle:
+            // Do nothing here.
+            return;
+        default:
+            break;
+        }
+
+    iTonePlayingStatus = EIdle;
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::DeinitRingTonePlayer
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::DeinitRingTonePlayer()
+    {
+    StopPlaying();
+    RemovePlayers();
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::RemovePlayers
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::RemovePlayers()
+    {
+    delete iAudioPlayer;
+    iAudioPlayer = NULL;
+
+    delete iDefaultPlayer;
+    iDefaultPlayer = NULL;
+
+    delete iBeepOncePlayer;
+    iBeepOncePlayer = NULL;
+
+    delete iSilentPlayer;
+    iSilentPlayer = NULL;
+
+    delete iUnsecureVoIPTonePlayer;
+    iUnsecureVoIPTonePlayer = NULL;
+
+    delete iSequencePlayer;
+    iSequencePlayer = NULL;
+
+    delete iTtsPlayer;
+    iTtsPlayer = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::DeletePlayer
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::DeletePlayer()
+    {
+    switch (iTonePlayingStatus)
+        {
+        case EAudioTonePlaying:
+            DeletePlayerAsync(EPlayerAudio);
+            iAudioPlayer = NULL;
+            break;
+        case EDefaultTonePlaying:
+            DeletePlayerAsync(EPlayerDefault);
+            iDefaultPlayer = NULL;
+            break;
+        case ESilentTonePlaying:
+            DeletePlayerAsync(EPlayerSilent);
+            iSilentPlayer = NULL;
+            break;
+        case EUnsecureVoIPTonePlaying:
+            DeletePlayerAsync(EPlayerUnsecureVoIP);
+            iUnsecureVoIPTonePlayer = NULL;
+            break;
+        case EBeepOnce:
+            DeletePlayerAsync(EPlayerBeepOnce);
+            iBeepOncePlayer = NULL;
+            break;
+        case ESequenceTonePlaying:
+            DeletePlayerAsync(EPlayerSequence);
+            iSequencePlayer = NULL;
+            break;
+        case EBackupTonePlaying:
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::DeletePlayerAsync
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::DeletePlayerAsync(TRtPlayerType aPlayer)
+    {
+    TRACE_PRN_FN_ENT;
+
+    __ASSERT_DEBUG(aPlayer >= EPlayerFirst &&
+            aPlayer < iAsyncDeletePlayers.Count(),
+            PANIC(TMS_RESULT_INVALID_ARGUMENT));
+
+    // Player is deleted in HandleAsyncReq.
+
+    if (iAsyncDeletePlayers[aPlayer])
+        {
+        delete iAsyncDeletePlayers[aPlayer];
+        iAsyncDeletePlayers[aPlayer] = NULL;
+        }
+
+    TMSRtAudioHdlr** players[] = {
+        &iAudioPlayer,
+        &iBeepOncePlayer,
+        &iSilentPlayer,
+        &iUnsecureVoIPTonePlayer,
+        &iDefaultPlayer,
+        &iSequencePlayer,
+        &iBackupPlayer,
+        &iTtsPlayer
+        };
+
+    __ASSERT_DEBUG(iAsyncDeletePlayers.Count() > aPlayer,
+            PANIC(TMS_RESULT_ILLEGAL_OPERATION));
+
+    iAsyncDeletePlayers[aPlayer] = *(players[aPlayer]);
+    *(players[aPlayer]) = NULL;
+    iAsyncReq = ETrue;
+    if (!iAsyncReqAO->IsActive())
+        iAsyncReqAO->Start(); //Start async request
+
+    TRACE_PRN_FN_ENT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::HandleError
+// From TMSAsyncReqObsrv
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::HandleError(TInt /*aError*/)
+    {
+    // TODO: should we kill/restart a/o?
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::HandleAsyncReq
+// From TMSAsyncReqObsrv
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::HandleAsyncReq()
+    {
+    TRACE_PRN_FN_ENT;
+
+    if (iAsyncReq)
+        {
+        for (TInt i = EPlayerFirst; i <= EPlayerLast; i++)
+            {
+            delete iAsyncDeletePlayers[i];
+            iAsyncDeletePlayers[i] = NULL;
+            }
+        }
+    iAsyncReq = EFalse;
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::HandleTtsDelayTimeout
+// -----------------------------------------------------------------------------
+//
+TInt TMSRingTonePlayer::HandleTtsDelayTimeout(TAny* object)
+    {
+    static_cast<TMSRingTonePlayer*> (object)->DoHandleTtsDelayTimeout();
+    return TMS_RESULT_SUCCESS;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::DoHandleTtsDelayTimeout
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::DoHandleTtsDelayTimeout()
+    {
+    TRACE_PRN_FN_ENT;
+
+    TMSRtAudioHdlr* currPlayer = NULL;
+    currPlayer = GetCurrentlyActiveAudioPlayerWithTTS();
+
+    if (!currPlayer)
+        {
+        return;
+        }
+
+    TInt volume(0);
+
+    // Ascending case. TTS player needs to be ascending.
+    if (iTtsRingingType == EProfileRingingTypeAscending)
+        {
+        // Adjust volume for each ascending step
+        if (!iTTsTimeOutCounter)
+            {
+            // Playing caller's name for the first time in ascending mode.
+            volume = KTtsVolumeMin;
+            iTtsPlayer->Play(ConvertRingingType(EProfileRingingTypeRingingOnce),
+                    volume, iTtsToneToBePlayed);
+            }
+        else
+            {
+            // Checks the case that ringingtone is very quiet. Then do not play
+            // TTS too loud
+            volume = iTtsVolume < KTtsVolumeMin ?
+                KTtsVolumeMin : KTtsVolumeAscendingRepeat;
+
+            // We are saying callers name for the second time in ascending mode.
+            // Say callers name by volume level KTtsVolumeAscendingRepeat and
+            // decrease current players volume
+            // to KPlayerVolumeAscendingRepeat. RampTime is zero
+            currPlayer->SetNewVolumeAndRamptime(
+                    KPlayerVolumeAscendingRepeat, 0);
+            iTtsPlayer->Play(ConvertRingingType(EProfileRingingTypeRingingOnce),
+                    volume, iTtsToneToBePlayed);
+            }
+        }
+    else //Normal ringing case.
+        {
+        currPlayer->SetNewVolumeAndRamptime(iTtsVolume - 5, 0);
+        iTtsPlayer->Play(ConvertRingingType(EProfileRingingTypeRingingOnce),
+                iTtsVolume, iTtsToneToBePlayed);
+        }
+
+    iTTsTimeOutCounter++;
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::MuteRingTone
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::MuteRingTone()
+    {
+    TMSRtAudioHdlr* activePlayer = ActiveAudioPlayer();
+    if (activePlayer != NULL)
+        {
+        activePlayer->MutePlaying();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::RtAudioHdlrEvent
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::RtAudioHdlrEvent(TInt aEvent, TInt aError, TInt aPlayer)
+    {
+    if (aError == TMS_RESULT_SUCCESS)
+        {
+        switch (aEvent)
+            {
+            case ECmdRingToneOpenComplete:
+                if (aPlayer != EPlayerBackup && aPlayer != EPlayerTts)
+                    {
+                    HandleRtAudioInitComplete(aEvent, aError, aPlayer);
+                    }
+                break;
+            case ECmdRingTonePlayComplete:
+                HandleRtAudioPlayComplete(aEvent, aError, aPlayer);
+                break;
+            default:
+                //not possible
+                break;
+            }
+        }
+     else
+         {
+         HandleRtAudioError(aEvent, aError, aPlayer);
+         }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::HandleRtAudioError
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::HandleRtAudioError(TInt aEvent, TInt aError,
+        TInt aPlayer)
+    {
+    TRACE_PRN_N1(_L("TMS->HandleRtAudioError [%d]"), aError);
+
+    // Backup player events don't need to be propagated
+    if (aPlayer == EPlayerBackup)
+        {
+        return;
+        }
+    if (aPlayer == EPlayerTts && aEvent == ECmdRingTonePlayComplete)
+        {
+        // Remove TTS and keep playing RT
+        DeletePlayerAsync(EPlayerTts);
+        return;
+        }
+    const TBool deleteAll = (aError == KErrServerTerminated);
+    if (deleteAll)
+        {
+        // KErrServerTerminated is considered fatal error - delete all.
+        for (TInt i = EPlayerFirst; i <= EPlayerLast; i++)
+            {
+            DeletePlayerAsync(static_cast<TRtPlayerType> (i));
+            }
+        // Recreate backup player
+        TRAPD(ignore, CreateBkpRtPlayerL());
+        if (ignore) ;
+        }
+
+    iTimer->Cancel();
+    DoHandlePlayerError(!deleteAll, EFalse);
+    iRtObserver.RtPlayerEvent(aEvent, aError);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::HandleRtAudioInitComplete
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::HandleRtAudioInitComplete(TInt aEvent, TInt aError,
+        TInt aPlayer)
+    {
+    if ((iTonePlayingStatus == EAudioTonePlaying && aPlayer == EPlayerAudio) ||
+            (iTonePlayingStatus == EDefaultTonePlaying &&
+            aPlayer == EPlayerDefault))
+        {
+        iTimer->Cancel();
+        }
+    else
+        {
+        iRtObserver.RtPlayerEvent(aEvent, aError);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::HandleRtAudioPlayComplete
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::HandleRtAudioPlayComplete(TInt aEvent, TInt aError,
+        TInt aPlayer)
+    {
+    TRACE_PRN_N2(_L("TMS->HandleRtAudioPlayComplete: player=[%d], err=[%d]"),
+            aPlayer, aError);
+
+    if (aPlayer == EPlayerTts)
+        {
+        ResumeTTS();
+        return;
+        }
+    // RT playback has completed: ring once and TTS is activated
+    else if (iRtParam.iRingingType == EProfileRingingTypeRingingOnce &&
+            iTtsToneToBePlayed)
+        {
+        // Ring once and TTS
+        if (iTtsDelayIndex < iTtsDelaysCount)
+            {
+            ReStartRingTonePlayer();
+            return;
+            }
+        }
+    // RT has completed: ringing and TTS is activated.
+    // We need to restart RT and new TTS iterations are required.
+    else if (iRtParam.iRingingType == EProfileRingingTypeRinging &&
+            iTtsToneToBePlayed)
+        {
+        // Ringing and TTS
+        if (iTtsDelayIndex == iTtsDelaysCount)
+            {
+            // Ringingtype is "Ringing". New TTS iterations are required.
+            // Need to restart TTS sequence TTS has completed its iterations,
+            // set index to zero.
+            iTtsDelayIndex = 0;
+            if (!iTtsDelayTimer->IsActive())
+                {
+                // Restart TTS sequence
+                iTtsDelayTimer->After(KTMSTtsDelays[iTtsDelayIndex],
+                        TCallBack(HandleTtsDelayTimeout, this));
+                }
+            }
+
+        ReStartRingTonePlayer();
+        return;
+        }
+
+    DeletePlayer();
+    iTonePlayingStatus = EIdle;
+    iRtObserver.RtPlayerEvent(aEvent, aError);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::ResumeTTS
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::ResumeTTS()
+    {
+    // TTS playing complete, normal tone player should volume up.
+    if ((iTtsToneToBePlayed) && (++iTtsDelayIndex < iTtsDelaysCount))
+        {
+        // Resuming after TTS first time
+        // Caller name is said once. Increase tone player volume.
+        SolveNewVolumeAndRamptime(ESaidOnce);
+
+        if (!iTtsDelayTimer->IsActive())
+            {
+            // There are more TTS iterations to be played.
+            iTtsDelayTimer->After(KTMSTtsDelays[iTtsDelayIndex],
+                    TCallBack(HandleTtsDelayTimeout, this));
+            }
+        }
+    else
+        {
+        // Resuming after TTS second time.
+        SolveNewVolumeAndRamptime(ESaidTwice);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::HandleTimeOutL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::HandleTimeOutL()
+    {
+    DoHandlePlayerError(ETrue, ETrue);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::DoHandlePlayerError
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::DoHandlePlayerError(TBool aDelete, TBool aSync)
+    {
+    switch (iTonePlayingStatus)
+        {
+        case EAudioTonePlaying:
+            {
+            if (aDelete)
+                {
+                if (aSync)
+                    {
+                    delete iAudioPlayer;
+                    }
+                else
+                    {
+                    DeletePlayerAsync(EPlayerAudio);
+                    }
+                iAudioPlayer = NULL;
+                }
+
+#ifdef __WINS__
+            TRAPD(ignore, PlayAudioRingToneL());
+            iTonePlayingStatus = EDefaultTonePlaying;
+#else
+            TRAPD(ignore, PlayDefaultToneL());
+#endif
+            if (ignore) ;
+            break;
+            }
+        case EDefaultTonePlaying:
+            {
+            if (aDelete)
+                {
+                if (aSync)
+                    {
+                    delete iDefaultPlayer;
+                    }
+                else
+                    {
+                    DeletePlayerAsync(EPlayerDefault);
+                    }
+                iDefaultPlayer = NULL;
+                }
+
+            TRAPD(ignore, PlayBackupToneL());
+            if (ignore) ;
+            break;
+            }
+        case ESilentTonePlaying:
+        case EBeepOnce:
+        case EBackupTonePlaying:
+        case EIdle:
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::ConvertRingingType
+// -----------------------------------------------------------------------------
+//
+TMSRtAudioHdlr::TRingingType TMSRingTonePlayer::ConvertRingingType(
+        TProfileRingingType aRingingType)
+    {
+    TMSRtAudioHdlr::TRingingType ringingType = TMSRtAudioHdlr::ETypeRinging;
+    switch (aRingingType)
+        {
+        case EProfileRingingTypeRinging:
+            ringingType = TMSRtAudioHdlr::ETypeRinging;
+            break;
+        case EProfileRingingTypeAscending:
+            ringingType = TMSRtAudioHdlr::ETypeAscending;
+            break;
+        case EProfileRingingTypeRingingOnce:
+            ringingType = TMSRtAudioHdlr::ETypeRingingOnce;
+            break;
+        default:
+            break;
+        }
+    return ringingType;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::ExtendedSecurity
+// -----------------------------------------------------------------------------
+//
+TBool TMSRingTonePlayer::ExtendedSecurity() const
+    {
+    return iExtSecNeeded;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::SolveNewVolumeAndRamptime
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::SolveNewVolumeAndRamptime(TTtsStatus aStatus)
+    {
+    TMSRtAudioHdlr* currPlayer = NULL;
+    currPlayer = GetCurrentlyActiveAudioPlayerWithTTS();
+    if (!currPlayer)
+        {
+        return;
+        }
+
+    TInt ramptime(0);
+
+    // Handle TTS volume. TTS sequence is as follows:
+    // 3 sec, tone + name + 4 sec, tone + name + the tone until the end.
+    switch (aStatus)
+        {
+        case ESaidOnce:
+            {
+            if (iTtsRingingType == EProfileRingingTypeAscending)
+                {
+                // The ramptime could be (4)* KTMSTtsAscendingStep but now
+                // we are setting this to 0 because when caller's name is played
+                // for the first time: play ringing tone on level 3 for 4 secs.
+                ramptime = 0;
+                // Played once ascending
+                currPlayer->SetNewVolumeAndRamptime(
+                        KPlayerVolumeAscendingRepeat, ramptime);
+                }
+            else
+                {
+                // Normal ringtone case. Adjust volume back to profile level.
+                // Played once normal
+                currPlayer->SetNewVolumeAndRamptime(iTtsVolume, 0);
+                }
+            break;
+            }
+        case ESaidTwice:
+            {
+            if (iTtsRingingType == EProfileRingingTypeAscending)
+                {
+                TInt vol = iTtsVolume;
+                if (vol > KPlayerVolumeAscendingRepeat)
+                    {
+                    vol = vol - KTtsVolumeAscendingDecrease;
+                    }
+
+                // TTS playing complete for the second time. Increase volume.
+                ramptime = (vol) * KTMSTtsAscendingStep;
+                // Played twice ascending
+                currPlayer->SetNewVolumeAndRamptime(iTtsVolume, ramptime);
+                }
+            else
+                {
+                // Normal ringtone case. Adjust volume back to profile level.
+                // Played twice normal
+                currPlayer->SetNewVolumeAndRamptime(iTtsVolume, 0);
+                }
+            break;
+            }
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::PlayerType
+// -----------------------------------------------------------------------------
+//
+TRtPlayerType TMSRingTonePlayer::PlayerType() const
+    {
+    return iRtParam.iType;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::GetCurrentlyActiveAudioPlayerWithTTS
+// -----------------------------------------------------------------------------
+//
+TMSRtAudioHdlr* TMSRingTonePlayer::GetCurrentlyActiveAudioPlayerWithTTS()
+    {
+    TMSRtAudioHdlr* player = NULL;
+
+    if (iAudioPlayer)
+        {
+        player = iAudioPlayer;
+        }
+    else if (iDefaultPlayer)
+        {
+        player = iDefaultPlayer;
+        }
+    else if (iBackupPlayer)
+        {
+        player = iBackupPlayer;
+        }
+    return player;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::ReStartRingTonePlayer
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::ReStartRingTonePlayer()
+    {
+    // Find active player which plays along with TTS.
+    TMSRtAudioHdlr* currPlayer = NULL;
+    currPlayer = GetCurrentlyActiveAudioPlayerWithTTS();
+    if (currPlayer)
+        {
+        currPlayer->ReStartPlaying();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::CheckAndHandleToneSizeLimit
+// -----------------------------------------------------------------------------
+//
+TBool TMSRingTonePlayer::CheckAndHandleToneSizeLimit(
+        TMSRtContainer* aRingingTone)
+    {
+    TBool bValidSize = ETrue;
+
+    // If RT size is too large, will play default tone instead.
+    if (iToneFileSizeLimitKB)
+        {
+        if (CheckToneFileSize(aRingingTone->FileName(), iToneFileSizeLimitKB)
+                != TMS_RESULT_SUCCESS)
+            {
+            bValidSize = EFalse;
+            }
+        }
+    return bValidSize;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::CheckToneFileSize
+// -----------------------------------------------------------------------------
+//
+TInt TMSRingTonePlayer::CheckToneFileSize(const TDesC& aFile, TInt aSizeLimitKB)
+    {
+    // Get file size
+    TInt size = 0;
+    TInt error = TMS_RESULT_SUCCESS;
+
+    RFs fs;
+    fs.Connect();
+    TEntry entry;
+    if (TMS_RESULT_SUCCESS == fs.Entry(aFile, entry))
+        {
+        size = entry.iSize;
+        }
+    fs.Close();
+
+    aSizeLimitKB *= Kkilo;
+    if (aSizeLimitKB && size > aSizeLimitKB)
+        {
+        error = KErrTooBig;
+        }
+
+    TRACE_PRN_N1(_L("TMS->CheckToneFileSize: [%d]"), size);
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::GetMaxToneFileSizeL
+// -----------------------------------------------------------------------------
+//
+void TMSRingTonePlayer::GetMaxToneFileSizeL(TInt& /*aMaxSizeKB*/) const
+    {/*
+     const TInt error = CPhoneCenRepProxy::Instance()->GetInt(
+     KCRUidProfileEngine, KProEngRingingToneMaxSize, aMaxSizeKB);
+
+     if (error != TMS_RESULT_SUCCESS)
+     {
+     aMaxSizeKB = 0;
+     }
+     if (aMaxSizeKB < 0)
+     {
+     aMaxSizeKB = 0;
+     }
+     */
+    //TRACE_PRN_N1("TMS->GetMaxToneFileSizeL: [%d]", aMaxSizeKB);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSRingTonePlayer::ActiveAudioPlayer
+// -----------------------------------------------------------------------------
+//
+TMSRtAudioHdlr* TMSRingTonePlayer::ActiveAudioPlayer()
+    {
+    TMSRtAudioHdlr* audioHdlr = NULL;
+
+    switch (iTonePlayingStatus)
+        {
+        case EAudioTonePlaying:
+            {
+            if (iAudioPlayer != NULL)
+                {
+                audioHdlr = iAudioPlayer;
+                }
+            break;
+            }
+        case EDefaultTonePlaying:
+            {
+            if (iDefaultPlayer != NULL)
+                {
+                audioHdlr = iDefaultPlayer;
+                }
+            break;
+            }
+        case EBeepOnce:
+            {
+            if (iBeepOncePlayer != NULL)
+                {
+                audioHdlr = iBeepOncePlayer;
+                }
+            break;
+            }
+        case ESequenceTonePlaying:
+            {
+            if (iSequencePlayer != NULL)
+                {
+                audioHdlr = iSequencePlayer;
+                }
+            break;
+            }
+         case EBackupTonePlaying:
+             {
+            if (iBackupPlayer != NULL)
+                {
+                audioHdlr = iBackupPlayer;
+                }
+            break;
+             }
+        case ESilentTonePlaying:
+            {
+            if (iSilentPlayer != NULL)
+                {
+                audioHdlr = iSilentPlayer;
+                }
+            break;
+            }
+        case EUnsecureVoIPTonePlaying:
+            {
+            if (iUnsecureVoIPTonePlayer != NULL)
+                {
+                audioHdlr = iUnsecureVoIPTonePlayer;
+                }
+            break;
+            }
+        default:
+            break;
+        }
+
+    return audioHdlr;
+    }
+
+//  End of File
--- a/mmserv/tms/tmsserver/src/tmsserver.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsserver/src/tmsserver.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -18,22 +18,26 @@
 #include <e32svr.h>
 #include <e32uid.h>
 #include <e32capability.h>
+#include <AudioPreference.h>
 #include "tmsutility.h"
 #include "tmsclientserver.h"
-#include "tmsserver.h"
+#include "tmstelephonycenrep.h"
 #include "tmsservershutdown.h"
 #include "tmsserversession.h"
 #include "tmscallserverstartparam.h"
 #include "tmscallserver.h"
 #include "tmscallclisrv.h"
-#include "globaleffectssettings.h"
-#include "tareventhandler.h"
-#include "cspaudiohandler.h"
+#include "tmsglobaleffectssettings.h"
+#include "tmstareventhandler.h"
+#include "tmscenrepaudiohandler.h"
+#include "tmsdtmfeventhandler.h"
+#include "tmsrtparam.h"
+#include "tmsserver.h"
 
 using namespace TMS;
 
 // CONSTANTS
-const TInt KShutDownDelayTime = 5000000; // 5 sec delay time
+const TInt KTMSShutDownDelayTime = 1000000; // 1 sec delay time
 const TInt KOutputsArraySize = 10;
 
 // -----------------------------------------------------------------------------
@@ -80,6 +84,9 @@
     delete iEffectSettings;
     CancelRoutingNotifier();
     CancelCenRepHandler();
+    CancelDTMFNotifier();
+    DeinitRingTonePlayer();
+    delete iTMSRtPlayer;
 
     TRACE_PRN_FN_EXT;
     }
@@ -100,8 +107,7 @@
         }
 
     const TVersion version(KTMSServMajorVersionNumber,
-                           KTMSServMinorVersionNumber,
-                           KTMSServBuildVersionNumber);
+            KTMSServMinorVersionNumber, KTMSServBuildVersionNumber);
 
     if (!User::QueryVersionSupported(version, aVersion))
         {
@@ -126,10 +132,12 @@
     iShutdownTimer = TMSServerShutDown::NewL();
     StartL(KTMSServerName);
     RThread().SetPriority(EPriorityRealTime);
-    iEffectSettings = GlobalEffectsSettings::NewL();
+    iEffectSettings = TMSGlobalEffectsSettings::NewL();
     iTarHandler = NULL;
     iAudioCenRepHandler = NULL;
+    iDTMFHandler = NULL;
     iCurrentRouting = TMS_AUDIO_OUTPUT_NONE;
+    InitRingTonePlayerL();
 
     TRACE_PRN_FN_EXT;
     }
@@ -161,7 +169,7 @@
     if (iSession == 0)
         {
         iShutdownTimer->SetDelay(TTimeIntervalMicroSeconds32(
-                KShutDownDelayTime));
+                KTMSShutDownDelayTime));
         }
 
     TRACE_PRN_N1(_L("TMS->DNL: DropSession->Active Sessions: [%d]"), iSession);
@@ -172,7 +180,7 @@
 //
 // -----------------------------------------------------------------------------
 //
-TInt TMSServer::SessionCount()
+TInt TMSServer::SessionCount() const
     {
     return iSession;
     }
@@ -182,7 +190,7 @@
 //
 // -----------------------------------------------------------------------------
 //
-void TMSServer::SetDnLinkSession(TBool aSession)
+void TMSServer::SetDnLinkSession(const TBool aSession)
     {
     iDnlinkSession = aSession;
     }
@@ -192,7 +200,7 @@
 //
 // -----------------------------------------------------------------------------
 //
-void TMSServer::SetUpLinkSession(TBool aSession)
+void TMSServer::SetUpLinkSession(const TBool aSession)
     {
     iUplinkSession = aSession;
     }
@@ -229,7 +237,7 @@
     TInt i = 0;
     while (i < iTMSCallServList.Count())
         {
-        CStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
+        TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
         if (!callThread->IsActive())
             {
             iTMSCallServList.Remove(i);
@@ -245,6 +253,7 @@
     TMSCallProxyLocal tmsCallSessionHandle;
     User::LeaveIfError(StartTMSCallServer(tmsCallSessionHandle));
     aHandle = tmsCallSessionHandle;
+
     TRACE_PRN_FN_EXT;
     }
 
@@ -256,19 +265,19 @@
 TInt TMSServer::StartTMSCallServer(TMSCallProxyLocal& aHandle)
     {
     TRACE_PRN_FN_ENT;
-    TInt status = KErrNone;
 
-    CStartAndMonitorTMSCallThread* callServerThread = NULL;
-    TRAP(status, callServerThread =
-    CStartAndMonitorTMSCallThread::NewL(const_cast<TMSServer*>(this)));
-    if (status != KErrNone)
+    TInt status = TMS_RESULT_SUCCESS;
+    TMSStartAndMonitorTMSCallThread* callServerThread = NULL;
+    TRAP(status, callServerThread =TMSStartAndMonitorTMSCallThread::NewL(
+            const_cast<TMSServer*>(this)));
+    if (status != TMS_RESULT_SUCCESS)
         {
         delete callServerThread;
         }
     else
         {
         status = iTMSCallServList.Append(callServerThread);
-        if (callServerThread && status == KErrNone)
+        if (callServerThread && status == TMS_RESULT_SUCCESS)
             {
             status = callServerThread->StartTMSCallServer(aHandle);
             TInt count = 0;
@@ -313,10 +322,16 @@
 //
 void TMSServer::StartRoutingNotifierL()
     {
+    TRACE_PRN_FN_ENT;
+
     if (!iTarHandler)
         {
-        iTarHandler = CTarEventHandler::NewL((const_cast<TMSServer*> (this)));
+        iTarHandlerCount = 0;
+        iTarHandler = TMSTarEventHandler::NewL((const_cast<TMSServer*> (this)));
         }
+    iTarHandlerCount++;
+
+    TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
@@ -326,8 +341,11 @@
 //
 void TMSServer::CancelRoutingNotifier()
     {
-    delete iTarHandler;
-    iTarHandler = NULL;
+    if (--iTarHandlerCount <= 0)
+        {
+        delete iTarHandler;
+        iTarHandler = NULL;
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -337,13 +355,19 @@
 //
 void TMSServer::StartCenRepHandlerL()
     {
+    TRACE_PRN_FN_ENT;
+
 #ifdef _USE_TELEPHONY_CENREP_
     if (!iAudioCenRepHandler)
         {
-        iAudioCenRepHandler = CSPAudioHandler::NewL(
+        iAudioCenRepHandlerCount = 0;
+        iAudioCenRepHandler = TMSCenRepAudioHandler::NewL(
                 (const_cast<TMSServer*> (this)));
         }
+    iAudioCenRepHandlerCount++;
 #endif
+
+    TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
@@ -353,8 +377,45 @@
 //
 void TMSServer::CancelCenRepHandler()
     {
-    delete iAudioCenRepHandler;
-    iAudioCenRepHandler = NULL;
+    if (--iAudioCenRepHandlerCount <= 0)
+        {
+        delete iAudioCenRepHandler;
+        iAudioCenRepHandler = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::StartDTMFNotifierL
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::StartDTMFNotifierL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    if (!iDTMFHandler)
+        {
+        iDTMFHandlerCount = 0;
+        iDTMFHandler = TMSDtmfEventHandler::NewL(
+                (const_cast<TMSServer*> (this)));
+        }
+    iDTMFHandlerCount++;
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::CancelDTMFNotifier
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::CancelDTMFNotifier()
+    {
+    if (--iDTMFHandlerCount <= 0)
+        {
+        delete iDTMFHandler;
+        iDTMFHandler = NULL;
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -365,11 +426,9 @@
 TInt TMSServer::SetOutput(CSession2* /*sid*/, TInt output)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
 
-    status = SendMessageToCallServ(TMS_ROUTING_OUTPUT_SET, output);
-
-    if (status == KErrNone)
+    TInt status = SendMessageToCallServ(TMS_ROUTING_OUTPUT_SET, output);
+    if (status == TMS_RESULT_SUCCESS)
         {
         iCurrentRouting = output;
         }
@@ -389,16 +448,16 @@
 
     TUint output;
     TInt i = 0;
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     while (i < iTMSCallServList.Count())
         {
-        CStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
+        TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
 
         if (callThread)
             {
             status = callThread->iTMSCallProxyLocal.ReceiveFromCallServer(
                     TMS_ROUTING_OUTPUT_GET, output);
-            if (status != KErrNone)
+            if (status != TMS_RESULT_SUCCESS)
                 {
                 break;
                 }
@@ -407,9 +466,10 @@
         }
     TPckgBuf<TInt> p(output);
     aMessage.Write(0, p);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
+
     TRACE_PRN_FN_EXT;
-    return KErrNone;
+    return status;
     }
 
 // -----------------------------------------------------------------------------
@@ -420,18 +480,19 @@
 TInt TMSServer::GetPreviousOutput(const RMessage2& aMessage)
     {
     TRACE_PRN_FN_ENT;
+
     TUint output;
     TInt i = 0;
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     while (i < iTMSCallServList.Count())
         {
-        CStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
+        TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
 
         if (callThread)
             {
             status = callThread->iTMSCallProxyLocal.ReceiveFromCallServer(
                     TMS_ROUTING_PREVIOUSOUTPUT_GET, output);
-            if (status != KErrNone)
+            if (status != TMS_RESULT_SUCCESS)
                 {
                 break;
                 }
@@ -440,7 +501,8 @@
         }
     TPckgBuf<TInt> p(output);
     aMessage.Write(0, p);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
+
     TRACE_PRN_FN_EXT;
     return status;
     }
@@ -465,7 +527,7 @@
     {
     TRACE_PRN_FN_ENT;
 
-    TInt status = KErrNone;
+    TInt status = TMS_RESULT_SUCCESS;
     OutputVector outputs;
     HBufC8* buf = HBufC8::NewLC(KOutputsArraySize * sizeof(TUint32));
     TPtr8 ptr = buf->Des();
@@ -478,13 +540,13 @@
 
     while (i < iTMSCallServList.Count())
         {
-        CStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
+        TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
 
         if (callThread)
             {
             status = callThread->iTMSCallProxyLocal.ReceiveFromCallServer(
                     TMS_ROUTING_AVAILABLE_OUTPUT_GET, args);
-            if (status != KErrNone)
+            if (status != TMS_RESULT_SUCCESS)
                 {
                 break;
                 }
@@ -509,15 +571,17 @@
 TInt TMSServer::GetMaxLevel(const RMessage2& aMessage)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
+
+    TInt status(TMS_RESULT_SUCCESS);
     TPckgBuf<TUint> pckg;
 
     pckg() = iEffectSettings->MaxVolume();
-    if (status == KErrNone)
+    if (status == TMS_RESULT_SUCCESS)
         {
         status = aMessage.Write(0, pckg);
         aMessage.Complete(status);
         }
+
     TRACE_PRN_FN_EXT;
     return status;
     }
@@ -530,7 +594,8 @@
 TInt TMSServer::GetLevel(const RMessage2& aMessage)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
+
+    TInt status(TMS_RESULT_SUCCESS);
     TPckgBuf<TUint> pckg;
     TInt volume;
 
@@ -546,7 +611,7 @@
         }
 
     pckg() = volume;
-    if (status == KErrNone)
+    if (status == TMS_RESULT_SUCCESS)
         {
         aMessage.Write(0, pckg);
         aMessage.Complete(status);
@@ -564,11 +629,9 @@
 TInt TMSServer::SetLevel(CSession2* /*sid*/, TBool tmsclient, TInt level)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
 
-    status = SendMessageToCallServ(TMS_EFFECT_GLOBAL_VOL_SET, level);
-
-    if (status == KErrNone)
+    TInt status = SendMessageToCallServ(TMS_EFFECT_GLOBAL_VOL_SET, level);
+    if (status == TMS_RESULT_SUCCESS)
         {
         switch (iCurrentRouting)
             {
@@ -625,11 +688,11 @@
 TInt TMSServer::GetMaxGain(const RMessage2& aMessage)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
+
+    TInt status(TMS_RESULT_SUCCESS);
     TPckgBuf<TUint> pckg;
-
     pckg() = iEffectSettings->MaxGain();
-    if (status == KErrNone)
+    if (status == TMS_RESULT_SUCCESS)
         {
         status = aMessage.Write(0, pckg);
         aMessage.Complete(status);
@@ -647,11 +710,11 @@
 TInt TMSServer::GetGain(const RMessage2& aMessage)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
+
+    TInt status(TMS_RESULT_SUCCESS);
     TPckgBuf<TUint> pckg;
-
     pckg() = iEffectSettings->Gain();
-    if (status == KErrNone)
+    if (status == TMS_RESULT_SUCCESS)
         {
         status = aMessage.Write(0, pckg);
         aMessage.Complete(status);
@@ -669,11 +732,9 @@
 TInt TMSServer::SetGain(CSession2* /*sid*/, TInt level)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
 
-    status = SendMessageToCallServ(TMS_EFFECT_GLOBAL_GAIN_SET, level);
-
-    if (status == KErrNone)
+    TInt status = SendMessageToCallServ(TMS_EFFECT_GLOBAL_GAIN_SET, level);
+    if (status == TMS_RESULT_SUCCESS)
         {
         iEffectSettings->SetGain(level);
         iSessionIter.SetToFirst();
@@ -701,6 +762,8 @@
 TInt TMSServer::GetSupportedCodecs(const TMSStreamType strmType,
         RArray<TFourCC>*& aCodecs)
     {
+    TRACE_PRN_FN_ENT;
+
     if (strmType == TMS_STREAM_UPLINK)
         {
         aCodecs = &iUplCodecs;
@@ -709,7 +772,9 @@
         {
         aCodecs = &iDnlCodecs;
         }
-    return KErrNone;
+
+    TRACE_PRN_FN_EXT;
+    return TMS_RESULT_SUCCESS;
     }
 
 // -----------------------------------------------------------------------------
@@ -719,11 +784,13 @@
 //
 TInt TMSServer::SendMessageToCallServ(TInt func, TInt value)
     {
-    TInt status(KErrNone);
+    TRACE_PRN_FN_ENT;
+
+    TInt status(TMS_RESULT_SUCCESS);
     TInt i = 0;
     while (i < iTMSCallServList.Count())
         {
-        CStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
+        TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
 
         if (callThread)
             {
@@ -736,7 +803,7 @@
                 {
                 status = callThread->iTMSCallProxyLocal.SendToCallServer(
                         func, value);
-                if (status != KErrNone)
+                if (status != TMS_RESULT_SUCCESS)
                     {
                     break;
                     }
@@ -744,6 +811,8 @@
             }
         i++;
         }
+
+    TRACE_PRN_FN_EXT;
     return status;
     }
 
@@ -754,11 +823,13 @@
 //
 TInt TMSServer::SendMessageToCallServ(TInt func, TIpcArgs args)
     {
-    TInt status(KErrNone);
+    TRACE_PRN_FN_ENT;
+
+    TInt status(TMS_RESULT_SUCCESS);
     TInt i = 0;
     while (i < iTMSCallServList.Count())
         {
-        CStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
+        TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
 
         if (callThread)
             {
@@ -771,7 +842,7 @@
                 {
                 status = callThread->iTMSCallProxyLocal.SendToCallServer(
                         func, args);
-                if (status != KErrNone)
+                if (status != TMS_RESULT_SUCCESS)
                     {
                     break;
                     }
@@ -779,6 +850,8 @@
             }
         i++;
         }
+
+    TRACE_PRN_FN_EXT;
     return status;
     }
 
@@ -789,6 +862,8 @@
 //
 TInt TMSServer::NotifyTarClients(TRoutingMsgBufPckg routingpckg)
     {
+    TRACE_PRN_FN_ENT;
+
     iCurrentRouting = routingpckg().iOutput;
     iSessionIter.SetToFirst();
     TMSServerSession* serverSession =
@@ -799,7 +874,397 @@
         serverSession->HandleRoutingChange(routingpckg);
         serverSession = static_cast<TMSServerSession*> (iSessionIter++);
         }
-    return KErrNone;
+
+    TRACE_PRN_FN_EXT;
+    return TMS_RESULT_SUCCESS;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::StartDTMF
+//
+// -----------------------------------------------------------------------------
+//
+TInt TMSServer::StartDTMF(const RMessage2& aMessage)
+    {
+    TRACE_PRN_FN_ENT;
+
+    TInt status(TMS_RESULT_SUCCESS);
+    TInt len(0);
+    TMSStreamType strmtype;
+
+    strmtype = (TMSStreamType) aMessage.Int0();
+    len = aMessage.GetDesLength(1);
+    HBufC* tone(NULL);
+    if (len > 0)
+        {
+        delete tone;
+        tone = NULL;
+        TRAP(status,tone = HBufC::NewL(len));
+        if (status == TMS_RESULT_SUCCESS)
+            {
+            TPtr ptr = tone->Des();
+            status = aMessage.Read(1, ptr);
+            TRACE_PRN_N(ptr);
+
+            TIpcArgs args;
+            args.Set(0, strmtype);
+            args.Set(1, &ptr);
+            status = SendMessageToCallServ(TMS_DTMF_START, args);
+            delete tone;
+            tone = NULL;
+            }
+        }
+    aMessage.Complete(status);
+
+    TRACE_PRN_FN_EXT;
+    return status;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::StopDTMF
+//
+// -----------------------------------------------------------------------------
+//
+TInt TMSServer::StopDTMF(const RMessage2& aMessage)
+    {
+    TRACE_PRN_FN_ENT;
+
+    TInt status(TMS_RESULT_SUCCESS);
+    TMSStreamType streamtype;
+    streamtype = (TMSStreamType) aMessage.Int0();
+    status = SendMessageToCallServ(TMS_DTMF_STOP, streamtype);
+    aMessage.Complete(status);
+
+    TRACE_PRN_FN_EXT;
+    return status;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::ContinueSendingDTMF
+//
+// -----------------------------------------------------------------------------
+//
+TInt TMSServer::ContinueSendingDTMF(const RMessage2& aMessage)
+    {
+    TRACE_PRN_FN_ENT;
+
+    TInt status(TMS_RESULT_SUCCESS);
+    TBool continuesending;
+    continuesending = (TBool) aMessage.Int0();
+    status = SendMessageToCallServ(TMS_DTMF_CONTINUE, continuesending);
+    aMessage.Complete(status);
+
+    TRACE_PRN_FN_EXT;
+    return status;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::NotifyDtmfClients
+//
+// -----------------------------------------------------------------------------
+//
+TInt TMSServer::NotifyDtmfClients(TmsMsgBufPckg dtmfpckg)
+    {
+    TRACE_PRN_FN_ENT;
+
+    iSessionIter.SetToFirst();
+    TMSServerSession* serverSession =
+            static_cast<TMSServerSession*> (iSessionIter++);
+
+    while (serverSession != NULL)
+        {
+        serverSession->NotifyClient(dtmfpckg().iRequest, dtmfpckg().iStatus);
+        serverSession = static_cast<TMSServerSession*> (iSessionIter++);
+        }
+
+    TRACE_PRN_FN_EXT;
+    return TMS_RESULT_SUCCESS;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::InitRingTonePlayerL
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::InitRingTonePlayerL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    DeinitRingTonePlayer();
+
+    if (!iTMSRtPlayer)
+        {
+        iTMSRtPlayer = TMSRingTonePlayer::NewL(*this);
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::DeinitRingTonePlayer
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::DeinitRingTonePlayer()
+    {
+    TRACE_PRN_FN_ENT;
+
+    if (iTMSRtPlayer)
+        {
+        iTMSRtPlayer->DeinitRingTonePlayer();
+        }
+
+    delete iRtFile;
+    iRtFile = NULL;
+    delete iRtSequence;
+    iRtSequence = NULL;
+    delete iTtsText;
+    iTtsText = NULL;
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::OpenRingTonePlayerFromFileL
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::OpenRingTonePlayerFromFileL(const RMessage2& aMessage)
+    {
+    TRACE_PRN_FN_ENT;
+
+    gint status(TMS_RESULT_INVALID_ARGUMENT);
+    gint len = aMessage.GetDesLength(0);
+    if (len > 0)
+        {
+        InitRingTonePlayerL();
+
+        if (iTMSRtPlayer)
+            {
+            iRtFile = HBufC::NewL(len);
+            TPtr ptr = iRtFile->Des();
+            aMessage.ReadL(0, ptr);
+            iTMSRtPlayer->CreateRingTonePlayerL(EPlayerAudio, *iRtFile);
+            len = aMessage.GetDesLength(1);
+            if (len > 0)
+                {
+                delete iTtsText;
+                iTtsText = NULL;
+                iTtsText = HBufC::NewL(len);
+                TPtr ptr1 = iTtsText->Des();
+                aMessage.ReadL(1, ptr1);
+                iTMSRtPlayer->CreateTTSPlayerL(ptr1);
+                }
+            status = TMS_RESULT_SUCCESS;
+            }
+        }
+    aMessage.Complete(status);
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::OpenRingTonePlayerFromProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::OpenRingTonePlayerFromProfileL(const RMessage2& aMessage)
+    {
+    TRACE_PRN_FN_ENT;
+
+    gint status(TMS_RESULT_INVALID_ARGUMENT);
+    InitRingTonePlayerL();
+
+    if (iTMSRtPlayer)
+        {
+        iTMSRtPlayer->CreateRingTonePlayerL(EPlayerDefault);
+        gint len = aMessage.GetDesLength(1);
+        if (len > 0)
+            {
+            delete iTtsText;
+            iTtsText = NULL;
+            iTtsText = HBufC::NewL(len);
+            TPtr ptr = iTtsText->Des();
+            aMessage.ReadL(1, ptr);
+            iTMSRtPlayer->CreateTTSPlayerL(ptr);
+            }
+        status = TMS_RESULT_SUCCESS;
+        }
+    aMessage.Complete(status);
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::OpenRingToneSequencePlayerL
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::OpenRingToneSequencePlayerL(const RMessage2& aMessage)
+    {
+    TRACE_PRN_FN_ENT;
+
+    gint status(TMS_RESULT_INVALID_ARGUMENT);
+    gint len = aMessage.GetDesLength(0);
+    if (len > 0)
+        {
+        InitRingTonePlayerL();
+        iRtSequence = HBufC8::NewL(len);
+        TPtr8 ptr = iRtSequence->Des();
+        aMessage.ReadL(0, ptr);
+
+        if (iTMSRtPlayer)
+            {
+            iTMSRtPlayer->CreateCustomSequencePlayerL(ptr);
+            status = TMS_RESULT_SUCCESS;
+            }
+        }
+    aMessage.Complete(status);
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::OpenRingToneBeepOnceL
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::OpenRingToneBeepOnceL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    InitRingTonePlayerL();
+
+    if (iTMSRtPlayer)
+        {
+        iTMSRtPlayer->CreateSequencePlayerL(EPlayerBeepOnce);
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::DeinitRingTone
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::OpenRingToneSilentL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    InitRingTonePlayerL();
+
+    if (iTMSRtPlayer)
+        {
+        iTMSRtPlayer->CreateSequencePlayerL(EPlayerSilent);
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::OpenRingToneUnsecureVoipL
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::OpenRingToneUnsecureVoipL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    InitRingTonePlayerL();
+
+    if (iTMSRtPlayer)
+        {
+        iTMSRtPlayer->CreateSequencePlayerL(EPlayerUnsecureVoIP);
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::PlayRingToneL
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::PlayRingToneL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    if (iTMSRtPlayer)
+        {
+        iTMSRtPlayer->PlayRingToneL();
+        }
+    else
+        {
+        User::Leave(TMS_RESULT_UNINITIALIZED_OBJECT);
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::PauseVideoRingTone
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::PauseVideoRingTone()
+    {
+    StopRingTone();
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::StopRingTone
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::StopRingTone()
+    {
+    TRACE_PRN_FN_ENT;
+
+    if (iTMSRtPlayer)
+        {
+        iTMSRtPlayer->StopPlaying();
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::MuteRingTone
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::MuteRingTone()
+    {
+    TRACE_PRN_FN_ENT;
+
+    if (iTMSRtPlayer)
+        {
+        iTMSRtPlayer->MuteRingTone();
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServer::RtPlayerEvent
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServer::RtPlayerEvent(gint aEventType, gint aError)
+    {
+    TRACE_PRN_FN_ENT;
+
+    iSessionIter.SetToFirst();
+    TMSServerSession* ss = static_cast<TMSServerSession*> (iSessionIter++);
+
+    while (ss != NULL)
+        {
+        ss->NotifyClient(aEventType, aError);
+        ss = static_cast<TMSServerSession*> (iSessionIter++);
+        }
+
+    TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
@@ -820,7 +1285,7 @@
     TMSServer* server = TMSServer::NewL();
 
     // Initialisation complete, now signal the client
-    RProcess::Rendezvous(KErrNone);
+    RProcess::Rendezvous(TMS_RESULT_SUCCESS);
 
     // Start the scheduler and wait for client requests
     CActiveScheduler::Start();
@@ -834,11 +1299,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::CStartAndMonitorTMSCallThread
+// TMSStartAndMonitorTMSCallThread::TMSStartAndMonitorTMSCallThread
 // Perhaps we need to move this to a .cpp?
 // -----------------------------------------------------------------------------
 //
-CStartAndMonitorTMSCallThread::CStartAndMonitorTMSCallThread(
+TMSStartAndMonitorTMSCallThread::TMSStartAndMonitorTMSCallThread(
         TMSServer* aServer) :
     CActive(EPriorityStandard),
     iTMSServer(aServer)
@@ -849,11 +1314,11 @@
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::~CStartAndMonitorTMSCallThread
+// TMSStartAndMonitorTMSCallThread::~TMSStartAndMonitorTMSCallThread
 //
 // -----------------------------------------------------------------------------
 //
-CStartAndMonitorTMSCallThread::~CStartAndMonitorTMSCallThread()
+TMSStartAndMonitorTMSCallThread::~TMSStartAndMonitorTMSCallThread()
     {
     TRACE_PRN_FN_ENT;
     Cancel();
@@ -861,44 +1326,47 @@
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::NewL
+// TMSStartAndMonitorTMSCallThread::NewL
 //
 // -----------------------------------------------------------------------------
 //
-CStartAndMonitorTMSCallThread* CStartAndMonitorTMSCallThread::NewL(
+TMSStartAndMonitorTMSCallThread* TMSStartAndMonitorTMSCallThread::NewL(
         TMSServer* aServer)
     {
     TRACE_PRN_FN_ENT;
-    CStartAndMonitorTMSCallThread* self =
-            new (ELeave) CStartAndMonitorTMSCallThread(aServer);
+
+    TMSStartAndMonitorTMSCallThread* self =
+            new (ELeave) TMSStartAndMonitorTMSCallThread(aServer);
     CleanupStack::PushL(self);
     self->ConstructL();
     CleanupStack::Pop(self);
+
     TRACE_PRN_FN_EXT;
     return self;
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::ConstructL
+// TMSStartAndMonitorTMSCallThread::ConstructL
 //
 // -----------------------------------------------------------------------------
 //
-void CStartAndMonitorTMSCallThread::ConstructL()
+void TMSStartAndMonitorTMSCallThread::ConstructL()
     {
     TRACE_PRN_FN_ENT;
     TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::StartTMSCallServer
+// TMSStartAndMonitorTMSCallThread::StartTMSCallServer
 //
 // -----------------------------------------------------------------------------
 //
-TInt CStartAndMonitorTMSCallThread::StartTMSCallServer(TMSCallProxyLocal& aHndl)
+TInt TMSStartAndMonitorTMSCallThread::StartTMSCallServer(
+        TMSCallProxyLocal& aHndl)
     {
     TRACE_PRN_FN_ENT;
 
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     TMSCallServerStartParam start(iTMSServer, iCallSrvrHndl);
     const TUidType serverUid(KNullUid, KNullUid, KUidTMSCallServerUid3);
     TThreadFunction serverFunc = TMSCallServer::StartThread;
@@ -911,7 +1379,7 @@
                                   &start,
                                   EOwnerProcess);
 
-    if (status != KErrNone)
+    if (status != TMS_RESULT_SUCCESS)
         {
         return status;
         }
@@ -935,7 +1403,7 @@
         }
 
     User::WaitForRequest(reqStatus); // wait for start or death
-    if (reqStatus.Int() != KErrNone)
+    if (reqStatus.Int() != TMS_RESULT_SUCCESS)
         {
         iServerThread.Close();
         iCallSrvrHndl.Close();
@@ -943,43 +1411,48 @@
         }
     status = aHndl.Open(iCallSrvrHndl);
 
-    if (status != KErrNone)
+    if (status != TMS_RESULT_SUCCESS)
         {
         iServerThread.Close();
         iCallSrvrHndl.Close();
         return status;
         }
     aHndl.ShareProtected();
+    iStatus = KRequestPending;
     iServerThread.Logon(iStatus);
     SetActive();
 
     TRACE_PRN_FN_EXT;
-    return KErrNone;
+    return TMS_RESULT_SUCCESS;
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::RunL
+// TMSStartAndMonitorTMSCallThread::RunL
 // From CActive
 // -----------------------------------------------------------------------------
 //
-void CStartAndMonitorTMSCallThread::RunL()
+void TMSStartAndMonitorTMSCallThread::RunL()
     {
     TRACE_PRN_FN_ENT;
     iServerThread.Close();
-    //NOTE: This is causing a panic when closing down tms server.
+    //NOTE: This is causing a panic when closing down TMS server.
     //iCallSrvrHndl.Close();
     TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
-// CStartAndMonitorTMSCallThread::DoCancel
+// TMSStartAndMonitorTMSCallThread::DoCancel
 // From CActive
 // -----------------------------------------------------------------------------
 //
-void CStartAndMonitorTMSCallThread::DoCancel()
+void TMSStartAndMonitorTMSCallThread::DoCancel()
     {
     TRACE_PRN_FN_ENT;
-    iServerThread.LogonCancel(iStatus);
+    if (iServerThread.Handle())
+        {
+        iServerThread.LogonCancel(iStatus);
+        User::WaitForRequest(iStatus);
+        }
     TRACE_PRN_FN_EXT;
     }
 
@@ -990,6 +1463,7 @@
 TInt TMSCallProxyLocal::Open(RServer2& aTMSCallServerHandle)
     {
     TRACE_PRN_FN_ENT;
+
     TInt status(KErrNotSupported);
     status = CreateSession(aTMSCallServerHandle,
                            TVersion(KTMSCallServerMajorVersionNumber,
@@ -1008,7 +1482,7 @@
 //
 TInt TMSCallProxyLocal::SendToCallServer(TInt aFunc, TUint value)
     {
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     status = SendReceive(aFunc, TIpcArgs(value));
     return status;
     }
@@ -1020,7 +1494,7 @@
 //
 TInt TMSCallProxyLocal::SendToCallServer(TInt aFunc, TIpcArgs args)
     {
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     status = SendReceive(aFunc, args);
     return status;
     }
@@ -1032,11 +1506,11 @@
 //
 TInt TMSCallProxyLocal::ReceiveFromCallServer(TInt aFunc, TUint& value)
     {
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     TPckgBuf<TUint> pckg;
     TIpcArgs args(&pckg);
     status = SendReceive(aFunc, args);
-    if (status == KErrNone)
+    if (status == TMS_RESULT_SUCCESS)
         {
         value = pckg();
         }
@@ -1050,7 +1524,7 @@
 //
 TInt TMSCallProxyLocal::ReceiveFromCallServer(TInt aFunc, TIpcArgs args)
     {
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     status = SendReceive(aFunc, args);
     return status;
     }
--- a/mmserv/tms/tmsserver/src/tmsserversession.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsserver/src/tmsserversession.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -19,6 +19,8 @@
 #include "tmsutility.h"
 #include "tmsclientserver.h"
 #include "tmsshared.h"
+#include "tmsaudioinbandtoneplayer.h"
+#include "tmsrtplayer.h"
 #include "tmsserversession.h"
 
 using namespace TMS;
@@ -50,6 +52,7 @@
 
     iServer.DropSession(); // will start shutdown if no more sessions left
     delete iDevSound;
+    delete iInbandTonePlayer;
 
     if (iMsgQueue.Handle() > 0)
         {
@@ -99,7 +102,7 @@
     {
     TRAPD(err, DispatchMessageL(aMessage));
 
-    if (err != KErrNone)
+    if (err != TMS_RESULT_SUCCESS)
         {
         aMessage.Complete(err);
         }
@@ -143,19 +146,19 @@
             break;
         case ETMSStartRoutingNotifier:
             iServer.StartRoutingNotifierL();
-            aMessage.Complete(KErrNone);
+            aMessage.Complete(TMS_RESULT_SUCCESS);
             break;
         case ETMSCancelRoutingNotifier:
             iServer.CancelRoutingNotifier();
-            aMessage.Complete(KErrNone);
+            aMessage.Complete(TMS_RESULT_SUCCESS);
             break;
         case ETMSStartGlobalEffectNotifier:
             iServer.StartCenRepHandlerL();
-            aMessage.Complete(KErrNone);
+            aMessage.Complete(TMS_RESULT_SUCCESS);
             break;
         case ETMSCancelGlobalEffectNotifier:
             iServer.CancelCenRepHandler();
-            aMessage.Complete(KErrNone);
+            aMessage.Complete(TMS_RESULT_SUCCESS);
             break;
         case ETMSSetMsgQueueHandle:
             SetMessageQueueHandleL(aMessage);
@@ -178,6 +181,79 @@
         case ETMSGetMaxGlobalGain:
             iServer.GetMaxGain(aMessage);
             break;
+        case ETMSRingToneInitDefault:
+            iHasRtPlayer = ETrue;
+            iServer.OpenRingTonePlayerFromProfileL(aMessage);
+            break;
+        case ETMSRingToneInitFile:
+            iHasRtPlayer = ETrue;
+            iServer.OpenRingTonePlayerFromFileL(aMessage);
+            break;
+        case ETMSRingToneInitSequence:
+            iHasRtPlayer = ETrue;
+            iServer.OpenRingToneSequencePlayerL(aMessage);
+            break;
+        case ETMSRingToneInitBeepOnce:
+            iHasRtPlayer = ETrue;
+            iServer.OpenRingToneBeepOnceL();
+            aMessage.Complete(TMS_RESULT_SUCCESS);
+            break;
+        case ETMSRingToneInitSilent:
+            iHasRtPlayer = ETrue;
+            iServer.OpenRingToneSilentL();
+            aMessage.Complete(TMS_RESULT_SUCCESS);
+            break;
+        case ETMSRingToneInitUnsecureVoIP:
+            iHasRtPlayer = ETrue;
+            iServer.OpenRingToneUnsecureVoipL();
+            aMessage.Complete(TMS_RESULT_SUCCESS);
+            break;
+        case ETMSRingToneDeinit:
+            iServer.DeinitRingTonePlayer();
+            NotifyClient(ECmdRingToneDeinitComplete, KErrNone);
+            iHasRtPlayer = EFalse;
+            aMessage.Complete(TMS_RESULT_SUCCESS);
+            break;
+        case ETMSRingTonePlay:
+            iHasRtPlayer = ETrue; //will play w/o prior initialization
+            iServer.PlayRingToneL();
+            aMessage.Complete(TMS_RESULT_SUCCESS);
+            break;
+        case ETMSRingTonePause:
+            iServer.PauseVideoRingTone();
+            aMessage.Complete(TMS_RESULT_SUCCESS);
+            break;
+        case ETMSRingToneStop:
+            iServer.StopRingTone();
+            aMessage.Complete(TMS_RESULT_SUCCESS);
+            break;
+        case ETMSRingToneMute:
+            iServer.MuteRingTone();
+            aMessage.Complete(TMS_RESULT_SUCCESS);
+            break;
+        case ETMSStartDTMFNotifier:
+            iServer.StartDTMFNotifierL();
+            aMessage.Complete(TMS_RESULT_SUCCESS);
+            break;
+        case ETMSCancelDTMFNotifier:
+            iServer.CancelDTMFNotifier();
+            aMessage.Complete(TMS_RESULT_SUCCESS);
+            break;
+        case ETMSStartDTMF:
+            iServer.StartDTMF(aMessage);
+            break;
+        case ETMSStopDTMF:
+            iServer.StopDTMF(aMessage);
+            break;
+        case ETMSContinueDTMF:
+            iServer.ContinueSendingDTMF(aMessage);
+            break;
+        case ETMSStartInbandTone:
+            StartInbandTone(aMessage);
+            break;
+        case ETMSStopInbandTone:
+            StopInbandTone(aMessage);
+            break;
         default:
             User::Leave(KErrNotSupported);
             break;
@@ -192,16 +268,16 @@
 //
 void TMSServerSession::SetMessageQueueHandleL(const RMessage2& aMessage)
     {
-    gint status = KErrNone;
+    gint status = TMS_RESULT_SUCCESS;
     if (iMsgQueue.Handle() <= 0)
         {
         status = iMsgQueue.Open(aMessage, 0);
         }
-    if (status != KErrNone)
+    if (status != TMS_RESULT_SUCCESS)
         {
         User::Leave(KErrArgument);
         }
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
     }
 
 // -----------------------------------------------------------------------------
@@ -212,7 +288,7 @@
     {
     TInt level = aMessage.Int0();
     iServer.SetLevel(this, TRUE, level);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
     }
 
 // -----------------------------------------------------------------------------
@@ -223,7 +299,7 @@
     {
     TInt gain = aMessage.Int0();
     iServer.SetGain(this, gain);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
     }
 
 // -----------------------------------------------------------------------------
@@ -233,10 +309,8 @@
 void TMSServerSession::HandleGlobalEffectChange(TInt globalevent)
     {
     TRACE_PRN_FN_ENT;
-    iMsgBuffer.iRequest = ECmdGlobalEffectChange;
-    iMsgBuffer.iStatus = KErrNone;
     iMsgBuffer.iInt = globalevent;
-    NotifyClient();
+    NotifyClient(ECmdGlobalEffectChange);
     TRACE_PRN_FN_EXT;
     }
 
@@ -247,11 +321,9 @@
 void TMSServerSession::HandleRoutingChange(TRoutingMsgBufPckg routinginfo)
     {
     TRACE_PRN_FN_ENT;
-    iMsgBuffer.iRequest = ECmdGlobalRoutingChange;
-    iMsgBuffer.iStatus = KErrNone;
     iMsgBuffer.iInt = routinginfo().iEvent;
     iMsgBuffer.iUint = routinginfo().iOutput;
-    NotifyClient();
+    NotifyClient(ECmdGlobalRoutingChange);
     TRACE_PRN_FN_EXT;
     }
 
@@ -280,7 +352,7 @@
 void TMSServerSession::GetCodecsCountL(const RMessage2& aMessage,
         TMSStreamType strmType)
     {
-    TInt err = KErrNone;
+    TInt err = TMS_RESULT_SUCCESS;
     TInt codecsCount = 0;
 
     RArray<TFourCC>* codecs;
@@ -315,13 +387,6 @@
                 err = KErrNotSupported;
                 }
 
-#ifdef __WINSCW__
-            // Support for adaptation stubs
-            codecs->Append(KMccFourCCIdG711);
-            codecs->Append(KMccFourCCIdG729);
-            codecs->Append(KMccFourCCIdILBC);
-            codecs->Append(KMccFourCCIdAMRNB);
-#endif
             codecsCount = codecs->Count();
             }
 
@@ -339,7 +404,7 @@
 #endif //__WINSCW__
     p().iStatus = err;
     aMessage.WriteL(0, p);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
     }
 
 // -----------------------------------------------------------------------------
@@ -373,7 +438,7 @@
     aMessage.WriteL(0, dataCopyBuffer->Ptr(0));
     CleanupStack::PopAndDestroy(&stream);
     CleanupStack::PopAndDestroy(dataCopyBuffer);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
 
     TRACE_PRN_FN_EXT;
     }
@@ -386,15 +451,67 @@
     {
     TInt output = aMessage.Int0();
     iServer.SetOutput(this, output);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServerSession::StartInbandTone
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServerSession::StartInbandTone(const RMessage2& aMessage)
+    {
+    if (!iInbandTonePlayer)
+        {
+        //TODO: Add inband tone observer
+        iInbandTonePlayer = TMSAudioInbandTonePlayer::NewL();
+        }
+
+    if (iInbandTonePlayer)
+        {
+        TMSInbandToneType tonetype = (TMSInbandToneType) aMessage.Int0();
+        iInbandTonePlayer->PlayInbandTone(tonetype);
+        }
+
+    //TODO: Move to inband tone observer callback
+    NotifyClient(ECmdInbandToneStarted);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSServerSession::StopInbandTone
+//
+// -----------------------------------------------------------------------------
+//
+void TMSServerSession::StopInbandTone(const RMessage2& aMessage)
+    {
+    if (iInbandTonePlayer)
+        {
+        iInbandTonePlayer->Cancel();
+        }
+
+    //TODO: Move to inband tone observer callback
+    NotifyClient(ECmdInbandToneStopped);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
     }
 
 // -----------------------------------------------------------------------------
 // TMSServerSession::NotifyClient
 // -----------------------------------------------------------------------------
 //
-void TMSServerSession::NotifyClient()
+void TMSServerSession::NotifyClient(const TInt aCommand, const TInt aStatus)
     {
+    if (aCommand == ECmdRingToneOpenComplete ||
+            aCommand == ECmdRingToneOpenComplete)
+        {
+        if (!iHasRtPlayer)
+            {
+            return;
+            }
+        }
+
+    iMsgBuffer.iRequest = aCommand;
+    iMsgBuffer.iStatus = aStatus;
     if (iMsgQueue.Handle() > 0)
         {
         iMsgQueue.Send(iMsgBuffer);
--- a/mmserv/tms/tmsserver/src/tmsservershutdown.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsserver/src/tmsservershutdown.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -82,6 +82,7 @@
 
     if (!IsActive())
         {
+        iStatus = KRequestPending;
         iShutDownTimer.After(iStatus, aDelay);
         }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmstareventhandler.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,112 @@
+/*
+ * 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 "tmstareventhandler.h"
+#include "tmsclientserver.h"
+#include "tmsutility.h"
+
+using namespace TMS;
+
+// -----------------------------------------------------------------------------
+// TMSTarEventHandler::TMSTarEventHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+TMSTarEventHandler::TMSTarEventHandler(TMSServer* aServer) :
+    CActive(EPriorityStandard),
+    iTMSSer(aServer)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TMSTarEventHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void TMSTarEventHandler::ConstructL()
+    {
+    TRACE_PRN_FN_ENT;
+    CActiveScheduler::Add(this);
+    User::LeaveIfError(iProperty.Attach(KTMSPropertyCategory, ERoutingPs));
+    iStatus = KRequestPending;
+    iProperty.Subscribe(iStatus);
+    SetActive();
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSTarEventHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+TMSTarEventHandler* TMSTarEventHandler::NewL(TMSServer* aServer)
+    {
+    TMSTarEventHandler* self = new (ELeave) TMSTarEventHandler(aServer);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Destructor
+TMSTarEventHandler::~TMSTarEventHandler()
+    {
+    TRACE_PRN_FN_ENT;
+    if (IsActive())
+        {
+        Cancel();
+        }
+    iProperty.Close();
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSTarEventHandler::DoCancel
+// -----------------------------------------------------------------------------
+//
+void TMSTarEventHandler::DoCancel()
+    {
+    TRACE_PRN_FN_ENT;
+    iProperty.Cancel();
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSTarEventHandler::RunL
+// -----------------------------------------------------------------------------
+//
+void TMSTarEventHandler::RunL()
+    {
+    TRACE_PRN_FN_ENT;
+    // Subscribe immediately before analyzing the notification to ensure that we
+    // don't miss further updates.
+    if (iStatus.Int() == TMS_RESULT_SUCCESS)
+        {
+        iStatus = KRequestPending;
+        iProperty.Subscribe(iStatus);
+        SetActive();
+        TRoutingMsgBufPckg routingpckg;
+        iProperty.Get(routingpckg);
+        iTMSSer->NotifyTarClients(routingpckg);
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmstimer.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -0,0 +1,143 @@
+/*
+ * 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 FILES
+#include "tmstimer.h"
+
+using namespace TMS;
+
+// ---------------------------------------------------------
+// TMSTimer::TMSTimer
+// ---------------------------------------------------------
+//
+TMSTimer::TMSTimer(TInt aPriority) :
+    CTimer(aPriority)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+// ---------------------------------------------------------
+// TMSTimer::ConstructL
+// ---------------------------------------------------------
+//
+void TMSTimer::ConstructL()
+    {
+    CTimer::ConstructL();
+    }
+
+// ---------------------------------------------------------
+// TMSTimer::NewL
+// ---------------------------------------------------------
+//
+EXPORT_C TMSTimer* TMSTimer::NewL(TInt aPriority)
+    {
+    TMSTimer* self = new (ELeave) TMSTimer(aPriority);
+
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// TMSTimer::~TMSTimer
+// ---------------------------------------------------------
+//
+EXPORT_C TMSTimer::~TMSTimer()
+    {
+    Cancel();
+    }
+
+// ---------------------------------------------------------
+// TMSTimer::RunL()
+// ---------------------------------------------------------
+//
+void TMSTimer::RunL()
+    {
+    if (iStatus != KErrNone)
+        {
+        //error code is ignored, as CPeriodic.
+        return;
+        }
+
+    if (!iTimerObserver)
+        {
+        //"TMSTimer::RunL CallBack" );
+        iCallBack.CallBack();
+        }
+    else
+        {
+        //"TMSTimer::RunL HandleTimeOutL" );
+        iTimerObserver->HandleTimeOutL();
+        }
+    }
+
+// ---------------------------------------------------------
+// TMSTimer::After()
+// ---------------------------------------------------------
+//
+EXPORT_C void TMSTimer::After(TTimeIntervalMicroSeconds32 anInterval,
+        TCallBack aCallBack)
+    {
+    if (IsActive())
+        {
+        Cancel();
+        }
+    iTimerObserver = NULL;
+    iCallBack = aCallBack;
+    CTimer::After(anInterval);
+    }
+
+// ---------------------------------------------------------
+// TMSTimer::After()
+// ---------------------------------------------------------
+//
+
+EXPORT_C void TMSTimer::After(TTimeIntervalMicroSeconds32 anInterval,
+        TMSTimerObsrv* aObserver)
+    {
+    //__ASSERT_DEBUG( aObserver, Panic( EPhoneUtilsParameterNotInitialized ) );
+
+    if (IsActive())
+        {
+        Cancel();
+        }
+    iTimerObserver = aObserver;
+    CTimer::After(anInterval);
+    }
+
+// ---------------------------------------------------------
+//  TMSTimer::CancelTimer
+// ---------------------------------------------------------
+//
+EXPORT_C void TMSTimer::CancelTimer()
+    {
+    Cancel();
+    }
+
+// ---------------------------------------------------------
+//  TMSTimer::DoCancel
+// ---------------------------------------------------------
+//
+void TMSTimer::DoCancel()
+    {
+    iTimerObserver = NULL;
+    CTimer::DoCancel();
+    }
+
+//  End of File
--- a/mmserv/tms/tmsutility/bwins/tmsutility.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsutility/bwins/tmsutility.def	Fri Apr 16 15:29:42 2010 +0300
@@ -2,6 +2,7 @@
 	?FourCCToTMSFormat@TMSUtility@TMS@@SAHK@Z @ 1 NONAME ; int TMS::TMSUtility::FourCCToTMSFormat(unsigned long)
 	?ToTAROutput@TMSUtility@TMS@@SA?AW4TAudioOutput@CTelephonyAudioRouting@@H@Z @ 2 NONAME ; enum CTelephonyAudioRouting::TAudioOutput TMS::TMSUtility::ToTAROutput(int)
 	?ToFourCC@TMSUtility@TMS@@SAKH@Z @ 3 NONAME ; unsigned long TMS::TMSUtility::ToFourCC(int)
-	?ToTMSOutput@TMSUtility@TMS@@SAHW4TAudioOutput@CTelephonyAudioRouting@@@Z @ 4 NONAME ; int TMS::TMSUtility::ToTMSOutput(enum CTelephonyAudioRouting::TAudioOutput)
-	?TMSResult@TMSUtility@TMS@@SAHH@Z @ 5 NONAME ; int TMS::TMSUtility::TMSResult(int)
+	?EtelToTMSResult@TMSUtility@TMS@@SAHH@Z @ 4 NONAME ; int TMS::TMSUtility::EtelToTMSResult(int)
+	?ToTMSOutput@TMSUtility@TMS@@SAHW4TAudioOutput@CTelephonyAudioRouting@@@Z @ 5 NONAME ; int TMS::TMSUtility::ToTMSOutput(enum CTelephonyAudioRouting::TAudioOutput)
+	?TMSResult@TMSUtility@TMS@@SAHH@Z @ 6 NONAME ; int TMS::TMSUtility::TMSResult(int)
 
--- a/mmserv/tms/tmsutility/eabi/tmsutility.def	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsutility/eabi/tmsutility.def	Fri Apr 16 15:29:42 2010 +0300
@@ -1,7 +1,8 @@
 EXPORTS
 	_ZN3TMS10TMSUtility11ToTAROutputEi @ 1 NONAME
 	_ZN3TMS10TMSUtility11ToTMSOutputEN22CTelephonyAudioRouting12TAudioOutputE @ 2 NONAME
-	_ZN3TMS10TMSUtility17FourCCToTMSFormatEm @ 3 NONAME
-	_ZN3TMS10TMSUtility8ToFourCCEi @ 4 NONAME
-	_ZN3TMS10TMSUtility9TMSResultEi @ 5 NONAME
+	_ZN3TMS10TMSUtility15EtelToTMSResultEi @ 3 NONAME
+	_ZN3TMS10TMSUtility17FourCCToTMSFormatEm @ 4 NONAME
+	_ZN3TMS10TMSUtility8ToFourCCEi @ 5 NONAME
+	_ZN3TMS10TMSUtility9TMSResultEi @ 6 NONAME
 
--- a/mmserv/tms/tmsutility/group/tmsutility.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsutility/group/tmsutility.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -30,7 +30,7 @@
 MW_LAYER_SYSTEMINCLUDE
 OS_LAYER_LIBC_SYSTEMINCLUDE
 OS_LAYER_GLIB_SYSTEMINCLUDE
-SYSTEMINCLUDE   /epoc32/include/stdapis/stlport
+OS_LAYER_STDCPP_SYSTEMINCLUDE
 SYSTEMINCLUDE   /epoc32/include/mmf/common
 
 USERINCLUDE     ../inc
--- a/mmserv/tms/tmsutility/src/tmsutility.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/tms/tmsutility/src/tmsutility.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -18,7 +18,7 @@
 #include <e32cmn.h>
 #include <mmffourcc.h>
 #include <mmcccodecinformation.h>
-//#include <tms.h>
+#include <etel.h>
 #include "tmsutility.h"
 
 using namespace TMS;
@@ -120,6 +120,59 @@
     }
 
 // -----------------------------------------------------------------------------
+// TMSUtility::EtelToTMSResult
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C gint TMSUtility::EtelToTMSResult(const gint aError)
+    {
+    gint result(TMS_RESULT_SUCCESS);
+
+    if (aError >= TMS_RESULT_SUCCESS)
+        {
+        return aError; //return TMS error
+        }
+
+    switch(aError)
+        {
+        case KErrArgument: //-6
+            result = TMS_RESULT_INVALID_ARGUMENT;
+            break;
+        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
+        case KErrEtelAlreadyCallOwner://-2002
+        case KErrEtelNoCarrier://-2003
+        case KErrEtelBusyDetected://-2004
+        case KErrEtelNoClientInterestedInThisCall://-2005
+        case KErrEtelInitialisationFailure://-2006
+        //case KErrEtelCallNotActive: //-2007
+        case KErrEtelNoAnswer://-2008
+        case KErrEtelNoDialTone://-2009
+        case KErrEtelConfigPortFailure://-2010
+        case KErrEtelFaxChunkNotCreated://-2011
+        case KErrEtelNotFaxOwner://-2012
+        case KErrEtelPortNotLoanedToClient://-2013
+        case KErrEtelWrongModemType://-2014
+        case KErrEtelUnknownModemCapability://-2015
+        case KErrEtelAnswerAlreadyOutstanding://-2016
+        case KErrEtelModemNotDetected://-2017
+        case KErrEtelModemSettingsCorrupt://-2018
+        case KErrEtelPortAlreadyLoaned://-2019
+        case KErrEtelCallAlreadyActive: //-2020
+        default:
+            result = TMS_RESULT_GENERAL_ERROR; //add TMS_DTMF_GENERAL_ERROR/FAILED
+            break;
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
 // TMSUtility::ToTMSOutput
 //
 // -----------------------------------------------------------------------------
--- a/mmserv/voipaudioservices/JitterBufferUtility/group/JitterBuffer.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/voipaudioservices/JitterBufferUtility/group/JitterBuffer.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:  VOIP AUdio Services
+* Description:  VOIP Audio Services
 *
 */
 
@@ -28,6 +28,7 @@
 USERINCLUDE     ../../inc
 
 MW_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE   /epoc32/include/mmf/common
 
 SOURCEPATH      ../src
--- a/mmserv/voipaudioservices/JitterBufferUtility/src/JitterBuffer.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/voipaudioservices/JitterBufferUtility/src/JitterBuffer.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2008 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"
@@ -234,7 +234,7 @@
         TRACE_PRN_N(_L("CVoIPJitterBuffer::FillBufferL NORMAL"));
 
         TUint32 emptyBufferDelay = 0;
-        
+
         if (iCodec != KMccFourCCIdG729)
             {
             // This can cause JB overflow on G729 (it does in the loopback)
@@ -385,6 +385,7 @@
 
     if (aStateChangeDelay)
         {
+        iStatus = KRequestPending;
         iTimer.After(iStatus, TTimeIntervalMicroSeconds32(aStateChangeDelay));
         }
     else
--- a/mmserv/voipaudioservices/VoIPIntfc/src/VoIPQueueHandler.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/voipaudioservices/VoIPIntfc/src/VoIPQueueHandler.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -1,20 +1,19 @@
 /*
-* Copyright (c) 2007-2008 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:  VOIP Audio Services  CMsgQueueHandler class implementation.
-*
-*/
-
+ * Copyright (c) 2007-2008 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:  VOIP Audio Services  CMsgQueueHandler class implementation.
+ *
+ */
 
 #include <voipaudiocommon.h>
 #include <voipuplinkstream.h>
@@ -26,15 +25,13 @@
 #include "VoIPDataBufferImpl.h"
 #include "VoIPQueueHandler.h"
 
-
 // ----------------------------------------------------------------------------
 // CQueueHandler::NewL
 // Symbian constructor
 // ----------------------------------------------------------------------------
 //
 CQueueHandler* CQueueHandler::NewL(MQueueHandlerObserver* aObserver,
-                                   RMsgQueue<TVoIPMsgBuf>* aMsgQueue,
-                                   TInt aBufferLen)
+        RMsgQueue<TVoIPMsgBuf>* aMsgQueue, TInt aBufferLen)
     {
     CQueueHandler* self = new (ELeave) CQueueHandler(aMsgQueue);
     CleanupStack::PushL(self);
@@ -49,7 +46,7 @@
 // ----------------------------------------------------------------------------
 //
 void CQueueHandler::ConstructL(MQueueHandlerObserver* aObserver,
-                               TInt aBufferLen)
+        TInt aBufferLen)
     {
     iObserver = aObserver;
 
@@ -79,9 +76,8 @@
 //
 CQueueHandler::CQueueHandler(RMsgQueue<TVoIPMsgBuf>* aMsgQueue) :
     CActive(CActive::EPriorityStandard),
-//  CActive(CActive::EPriorityHigh),
     iMsgQueue(aMsgQueue),
-    iChunkDataPtr(0,0,0)
+    iChunkDataPtr(0, 0, 0)
     {
     CActiveScheduler::Add(this);
     }
@@ -95,6 +91,7 @@
     {
     if (!IsActive())
         {
+        iStatus = KRequestPending;
         iMsgQueue->NotifyDataAvailable(iStatus);
         SetActive();
         }
@@ -131,13 +128,13 @@
             case ECmdDownlinkInitComplete:
                 {
                 iObserver->Event(MVoIPDownlinkObserver::KOpenComplete,
-                                 msgBuf.iStatus);
+                        msgBuf.iStatus);
                 break;
                 }
             case ECmdUplinkInitComplete:
                 {
                 iObserver->Event(MVoIPUplinkObserver::KOpenComplete,
-                                 msgBuf.iStatus);
+                        msgBuf.iStatus);
                 break;
                 }
             case ECmdFillBuffer:
@@ -154,51 +151,51 @@
                 {
                 iChunk.Close();
                 iObserver->Event(MVoIPDownlinkObserver::KDownlinkClosed,
-                                 msgBuf.iStatus);
+                        msgBuf.iStatus);
                 break;
                 }
             case ECmdUplinkThreadClosed:
                 {
                 iChunk.Close();
                 iObserver->Event(MVoIPUplinkObserver::KUplinkClosed,
-                                 msgBuf.iStatus);
+                        msgBuf.iStatus);
                 break;
                 }
             case ECmdRingToneOpenComplete:
                 {
                 iObserver->Event(MRingToneObserver::KOpenComplete,
-                                 msgBuf.iStatus);
+                        msgBuf.iStatus);
                 break;
                 }
             case ECmdRingTonePlayComplete:
                 {
                 iObserver->Event(MRingToneObserver::KPlaybackComplete,
-                                 msgBuf.iStatus);
+                        msgBuf.iStatus);
                 break;
                 }
             case ECmdDnLinkError:
             case ECmdDnLinkJBError:
                 {
                 iObserver->Event(MVoIPDownlinkObserver::KDownlinkError,
-                                 msgBuf.iStatus);
+                        msgBuf.iStatus);
                 break;
                 }
             case ECmdUpLinkError:
                 {
                 iObserver->Event(MVoIPUplinkObserver::KUplinkError,
-                                 msgBuf.iStatus);
+                        msgBuf.iStatus);
                 break;
                 }
             case ECmdDTMFOpenDnlinkComplete:
                 {
                 iObserver->Event(MDTMFToneObserver::KOpenCompleteDNL,
-                                 msgBuf.iStatus);
+                        msgBuf.iStatus);
                 break;
                 }
             case ECmdDTMFOpenUplinkComplete:
                 {
                 iObserver->Event(MDTMFToneObserver::KOpenCompleteUPL,
-                                 msgBuf.iStatus);
+                        msgBuf.iStatus);
                 break;
                 }
             case ECmdDTMFTonePlayFinished:
@@ -288,5 +285,4 @@
     return &iStatus;
     }
 
-
 // End of File
--- a/mmserv/voipaudioservices/VoIPServer/group/VoIPAudioServer.mmp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/voipaudioservices/VoIPServer/group/VoIPAudioServer.mmp	Fri Apr 16 15:29:42 2010 +0300
@@ -42,6 +42,7 @@
 USERINCLUDE     ../../inc
 
 MW_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE   /epoc32/include/mmf/server
 SYSTEMINCLUDE   /epoc32/include/mda/common
 SYSTEMINCLUDE   /epoc32/include/mmf/common
--- a/mmserv/voipaudioservices/VoIPServer/inc/VoIPECallEventHandler.h	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/voipaudioservices/VoIPServer/inc/VoIPECallEventHandler.h	Fri Apr 16 15:29:42 2010 +0300
@@ -21,7 +21,7 @@
 //  INCLUDES
 #include <e32base.h>
 #include <e32property.h>
-#include "voipserver.h"
+#include "VoIPServer.h"
 
 // CLASS DECLARATION
 class CVoIPECallEventHandler : public CActive
--- a/mmserv/voipaudioservices/VoIPServer/src/VoIPECallEventHandler.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/voipaudioservices/VoIPServer/src/VoIPECallEventHandler.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -18,7 +18,7 @@
 // INCLUDE FILES
 #include <ctsydomainpskeys.h>
 #include "debugtracemacros.h"
-#include "voipecalleventhandler.h"
+#include "VoIPECallEventHandler.h"
 
 // -----------------------------------------------------------------------------
 // CVoIPECallEventHandler::CVoIPECallEventHandler
@@ -43,6 +43,7 @@
     CActiveScheduler::Add(this);
     User::LeaveIfError(iProperty.Attach(KPSUidCtsyEmergencyCallInfo,
             KCTSYEmergencyCallInfo));
+    iStatus = KRequestPending;
     iProperty.Subscribe(iStatus);
     SetActive();
     TRACE_PRN_FN_EXT;
@@ -98,6 +99,7 @@
     // don't miss further updates.
     if (iStatus.Int() == KErrNone)
         {
+        iStatus = KRequestPending;
         iProperty.Subscribe(iStatus);
         SetActive();
 
--- a/mmserv/voipaudioservices/VoIPServer/src/VoIPQueueHandlerSrv.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/voipaudioservices/VoIPServer/src/VoIPQueueHandlerSrv.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -62,7 +62,6 @@
 //
 CQueueHandlerSrv::CQueueHandlerSrv(RMsgQueue<TVoIPMsgBuf>* aMsgQueue) :
     CActive(CActive::EPriorityStandard),
-    //  CActive(CActive::EPriorityHigh),
     iMsgQueue(aMsgQueue)
     {
     CActiveScheduler::Add(this);
@@ -77,6 +76,7 @@
     {
     if (!IsActive())
         {
+        iStatus = KRequestPending;
         iMsgQueue->NotifyDataAvailable(iStatus);
         SetActive();
         }
@@ -118,7 +118,7 @@
 TInt CQueueHandlerSrv::RunError(TInt aError)
     {
     // RunL can actually leave if any iObserver->Event leave is not trapped
-    //    iObserver->Event(ECmdGeneralError, aError);
+    // iObserver->Event(ECmdGeneralError, aError);
     return aError;
     }
 
--- a/mmserv/voipaudioservices/VoIPServer/src/VoIPServerAO.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/voipaudioservices/VoIPServer/src/VoIPServerAO.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -57,8 +57,8 @@
     {
     if (!IsActive())
         {
+        iStatus = KRequestPending;
         SetActive();
-        iStatus = KRequestPending;
         }
     }
 
--- a/mmserv/voipaudioservices/VoIPServer/src/VoIPServerShutdown.cpp	Tue Feb 02 01:08:46 2010 +0200
+++ b/mmserv/voipaudioservices/VoIPServer/src/VoIPServerShutdown.cpp	Fri Apr 16 15:29:42 2010 +0300
@@ -80,6 +80,7 @@
 
     if (!IsActive())
         {
+        iStatus = KRequestPending;
         iShutDownTimer.After(iStatus, aDelay);
         }
 
--- a/package_definition.xml	Tue Feb 02 01:08:46 2010 +0200
+++ b/package_definition.xml	Fri Apr 16 15:29:42 2010 +0300
@@ -1,120 +1,67 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <SystemDefinition schema="3.0.0">
   <package id="mmmw" name="Multimedia Middleware" levels="plugin framework server generic specific">
-    <collection id="radioutility" name="Radio Utility" level="generic">
-      <component id="radioserver" filter="s60" name="Radio Server">
-        <unit bldFile="radioutility/radioserver/group"/>
-        <!-- <unit bldFile="radioutility/radioserver/server/group"/> -->
-        <!-- <unit bldFile="radioutility/radioserver/session/group"/> -->
+  	<collection id="mmfenh" name="MMF Enhancements" level="generic">
+      <component id="advancedaudiocontroller" filter="s60" name="Advanced Audio Controllers" class="plugin">
+        <unit bldFile="mmfenh/advancedaudiocontroller/group"/>
       </component>
-      <component id="radio_utility" filter="s60" name="Radio Utility">
-        <unit bldFile="radioutility/radio_utility/group"/>
-      </component>
-      <component id="fmpresetutility" filter="s60" name="FM Preset Utility">
-        <unit bldFile="radioutility/fmpresetutility/group"/>
-      </component>
-      <component id="radioutility_build" filter="s60" name="Radio Utility Build">
-          <!-- should remove included bld.infs from here -->
-        <unit bldFile="radioutility/group"/>
+      <component id="audiooutputcontrolutility" filter="s60" name="Audio Output Control Utility">
+        <unit bldFile="mmfenh/audiooutputcontrolutility/group"/>
       </component>
-    </collection>
-    <collection id="audioeffectsui" name="Audio Effects UI" level="specific">
-      <component id="equalizer" filter="s60" name="Equalizer">
-        <unit bldFile="audioeffectsui/equalizer/group"/>
+      <component id="configurationcomponentsfactory" filter="s60" name="Configuration Components Factory">
+        <unit bldFile="mmfenh/configurationcomponentsfactory/group"/>
       </component>
-    </collection>
-    <collection id="audioenhancements" name="Audio Enhancements" level="generic">
       <component id="enhancedaudioplayerutility" filter="s60" name="Enhanced Audio Player Utility">
-        <unit bldFile="audioenhancements/enhancedaudioplayerutility/group"/>
-        <!-- should the rest of the bld.infs be #included? -->
-        <!-- <unit bldFile="audioenhancements/enhancedaudioplayerutility/audioplayer/group"/> -->
-        <!-- <unit bldFile="audioenhancements/enhancedaudioplayerutility/audiostreaming/group"/> -->
-        <!-- <unit bldFile="audioenhancements/enhancedaudioplayerutility/s60audiosource/group"/> -->
-        <!-- <unit bldFile="audioenhancements/enhancedaudioplayerutility/s60audiosourcefactory/group"/> -->
-        <!-- <unit bldFile="audioenhancements/enhancedaudioplayerutility/s60audioutility/group"/> -->
+        <unit bldFile="mmfenh/enhancedaudioplayerutility/group"/>
+      </component>
+      <component id="enhancedmediaclient" filter="s60" name="Enhanced Media Client">
+        <unit bldFile="mmfenh/enhancedmediaclient/group"/>
+      </component>
+      <component id="profilesettingsmonitor" filter="s60" name="Profile Settings Monitor">
+        <unit bldFile="mmfenh/profilesettingsmonitor/group"/>
       </component>
       <component id="progressivedownload" filter="s60" name="Progressive Download">
-        <unit bldFile="audioenhancements/progressivedownload/group"/>
-        <!-- <unit bldFile="audioenhancements/progressivedownload/progressivedownloadsource/group"/> -->
-        <!-- <unit bldFile="audioenhancements/progressivedownload/progressivedownloadutility/group"/> -->
-      </component>
-      <component id="enhancedmediaclient" filter="s60" name="Enhanced Media Client">
-        <unit bldFile="audioenhancements/enhancedmediaclient/group"/>
+        <unit bldFile="mmfenh/progressivedownload/group"/>
       </component>
-      <component id="profilesettingsmonitor" filter="s60" name="Profile Settings Monitor">
-        <unit bldFile="audioenhancements/profilesettingsmonitor/group"/>
-      </component>
-      <component id="voipaudioservices" filter="s60" name="VoIP Audio Services">
-        <unit bldFile="audioenhancements/voipaudioservices/group"/>
-      </component>
-      <component id="configurationcomponentsfactory" filter="s60" name="Configuration Components Factory">
-        <unit bldFile="audioenhancements/configurationcomponentsfactory/group"/>
-      </component>
-      <component id="audiooutputcontrolutility" filter="s60" name="Audio Output Control Utility">
-        <unit bldFile="audioenhancements/audiooutputcontrolutility/group"/>
+      <component id="mmfenh_test" filter="s60,test,module_test,pref_test" name="MMF Enhancements Tests" purpose="development">
+        <unit bldFile="mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/group"/>
+      </component>      
+    </collection>
+    <collection id="mmserv" name="Multimedia Services" level="specific">
+      <component id="audioeffectsui" filter="s60" name="Audio Effects UI">
+        <unit bldFile="mmserv/audioeffectsui/group"/>
       </component>
       <component id="callaudiocontrol" filter="s60" name="Call Audio Control">
-        <unit bldFile="audioenhancements/callaudiocontrol/group"/>
+        <unit bldFile="mmserv/callaudiocontrol/group"/>
+      </component>
+      <component id="metadatautility" filter="s60" name="Metadata Utility">
+        <unit bldFile="mmserv/metadatautility/group"/>
       </component>
-    </collection>
-    <collection id="metadatautility" name="Metadata Utility" level="generic">
-      <component id="extparserlib3gp_stub" filter="s60" name="3GP Extension Parser Library">
-        <unit bldFile="metadatautility/3gpextparserlib_stub/group"/>
+      <component id="radioutility" filter="s60" name="Radio Utility">
+        <unit bldFile="mmserv/radioutility/group"/>
       </component>
-      <component id="metadatautility_build" filter="s60" name="Metadata Utility Build">
-        <unit bldFile="metadatautility/group"/>
+      <component id="thumbnailengine" filter="s60" name="Thumbnail Engine" introduced="^2">
+        <unit bldFile="mmserv/thumbnailengine/group"/>
+      </component>
+      <component id="tms" filter="s60" name="Telephony Multimedia Service" introduced="^3">
+        <unit bldFile="mmserv/tms/group"/>
       </component>
-    </collection>
-    <collection id="advancedaudiocontroller" name="Advanced Audio Controller" level="plugin">
-      <component id="audiocontrollerpluginsvariant" filter="s60" name="Audio Controller Plugins Variant" class="plugin">
-        <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/group"/>
-                <!-- do the rest of these need to be #included? -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudioplaycontroller/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudiorecordcontroller/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/3gpdatasourceadapter/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/advancedaudiocontroller/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/advancedaudiocontrollerutility/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/amraudiorecordcontroller/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/datasourceadapter/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/devsoundaudioinput/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/devsoundaudiooutput/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/fileaudiooutput/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/hxaudiorecognizer/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/metadatawrite/group"/> -->
-        <!-- <unit bldFile="advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/group"/> -->
+      <component id="voipaudioservices" filter="s60" name="VoIP Audio Services">
+        <unit bldFile="mmserv/voipaudioservices/group"/>
+      </component>
+      <component id="lib3gpextparser" filter="s60"  name="3GP Extension Metadata Parser Library">
+        <unit bldFile="mmserv/metadatautility/3GPExtParserLib_stub/group" filter="sf_build"/>
       </component>
-      <component id="wavplaycontrollerplugin" filter="s60" name="WAV Play Controller Plugin" class="plugin">
-        <unit bldFile="advancedaudiocontroller/wavplaycontrollerplugin/group"/>
-      </component>
-      <component id="advancedaudiocontroller_test" filter="s60" name="Advanced Audio Controller Test" purpose="development">
-        <!-- <unit bldFile="advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/group"/> -->
+    </collection>    
+    <collection id="mmmw_info" name="Multimedia Middleware Info" level="specific">
+      <component id="mmmw_test" filter="s60,test,api_test,pref_test" name="Multimedia Middleware Tests" purpose="development">
+        <unit bldFile="tsrc/group"/>
       </component>
-    </collection>
-    <collection id="thumbnailengine" name="Thumbnail Engine" level="server">
-      <component id="tneengine" filter="s60" name="Thumbnail Engine Build" introduced="^2">
-        <unit bldFile="thumbnailengine/group"/>
-      </component>
-    </collection>
-    <collection id="mm_fw" name="Multimedia Framework" level="framework">
-      <component id="helix_stub" filter="s60" name="Helix Stub" introduced="^2">
-        <unit bldFile="mmfw/helix_stub/group"/>
-      </component>
-    </collection>
-    <collection id="mmmw_info" name="Multimedia Middleware Info" level="specific">
-      <component id="mmmw_test" filter="s60" name="Multimedia Middleware Test" purpose="development">
-        <!-- <unit bldFile="tsrc/group"/> -->
+      <component id="mmmw_api_test" filter="s60,test,api_test" name="Multimedia Middleware API Tests" purpose="development">
+        <unit bldFile="mmmw_plat/telephony_multimedia_service_api/tsrc/group"/>
       </component>
       <component id="mmmw_plat" filter="s60" name="Multimedia Middleware Platform Interfaces" class="api">
-        <unit bldFile="mmmw_plat/audio_metadata_reader_api/tsrc/group"/>
-        <unit bldFile="mmmw_plat/audio_output_control_utility_api/tsrc/group"/>
-        <unit bldFile="mmmw_plat/call_audio_control_api/tsrc/group"/>
-        <unit bldFile="mmmw_plat/enhanced_media_client_api/tsrc/group"/>
         <unit bldFile="mmmw_plat/group"/>
-        <unit bldFile="mmmw_plat/radio_utilities_api/tsrc/group"/>
-        <unit bldFile="mmmw_plat/voip_audio_services_api/tsrc/group"/>
       </component>
       <component id="mmmw_metadata" name="Multimedia Middleware Metadata" class="config" introduced="^2" purpose="development" target="desktop">
         <unit mrp="mmmw_info/mmmw_metadata/mmmw_metadata.mrp"/>